PageRenderTime 43ms CodeModel.GetById 29ms app.highlight 11ms RepoModel.GetById 1ms app.codeStats 1ms

/indra/newview/llpanelobject.h

https://bitbucket.org/lindenlab/viewer-beta/
C++ Header | 178 lines | 114 code | 37 blank | 27 comment | 0 complexity | e3c1905ce668c4954014753523366745 MD5 | raw file
  1/** 
  2 * @file llpanelobject.h
  3 * @brief Object editing (position, scale, etc.) in the tools floater
  4 *
  5 * $LicenseInfo:firstyear=2004&license=viewerlgpl$
  6 * Second Life Viewer Source Code
  7 * Copyright (C) 2010, Linden Research, Inc.
  8 * 
  9 * This library is free software; you can redistribute it and/or
 10 * modify it under the terms of the GNU Lesser General Public
 11 * License as published by the Free Software Foundation;
 12 * version 2.1 of the License only.
 13 * 
 14 * This library is distributed in the hope that it will be useful,
 15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 17 * Lesser General Public License for more details.
 18 * 
 19 * You should have received a copy of the GNU Lesser General Public
 20 * License along with this library; if not, write to the Free Software
 21 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
 22 * 
 23 * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
 24 * $/LicenseInfo$
 25 */
 26
 27#ifndef LL_LLPANELOBJECT_H
 28#define LL_LLPANELOBJECT_H
 29
 30#include "v3math.h"
 31#include "llpanel.h"
 32#include "llpointer.h"
 33#include "llvolume.h"
 34
 35class LLSpinCtrl;
 36class LLCheckBoxCtrl;
 37class LLTextBox;
 38class LLUICtrl;
 39class LLButton;
 40class LLViewerObject;
 41class LLComboBox;
 42class LLColorSwatchCtrl;
 43class LLTextureCtrl;
 44class LLInventoryItem;
 45class LLUUID;
 46
 47class LLPanelObject : public LLPanel
 48{
 49public:
 50	LLPanelObject();
 51	virtual ~LLPanelObject();
 52
 53	virtual BOOL	postBuild();
 54	virtual void	draw();
 55	virtual void 	clearCtrls();
 56
 57	void			refresh();
 58
 59	static bool		precommitValidate(const LLSD& data);
 60	
 61	static void		onCommitLock(LLUICtrl *ctrl, void *data);
 62	static void 	onCommitPosition(		LLUICtrl* ctrl, void* userdata);
 63	static void 	onCommitScale(			LLUICtrl* ctrl, void* userdata);
 64	static void 	onCommitRotation(		LLUICtrl* ctrl, void* userdata);
 65	static void 	onCommitTemporary(		LLUICtrl* ctrl, void* userdata);
 66	static void 	onCommitPhantom(		LLUICtrl* ctrl, void* userdata);
 67	static void 	onCommitCastShadows(	LLUICtrl* ctrl, void* userdata);
 68	static void 	onCommitPhysics(		LLUICtrl* ctrl, void* userdata);
 69
 70	static void 	onCommitParametric(LLUICtrl* ctrl, void* userdata);
 71
 72
 73	void     		onCommitSculpt(const LLSD& data);
 74	void     		onCancelSculpt(const LLSD& data);
 75	void     		onSelectSculpt(const LLSD& data);
 76	BOOL     		onDropSculpt(LLInventoryItem* item);
 77	static void     onCommitSculptType(    LLUICtrl *ctrl, void* userdata);
 78		
 79	
 80protected:
 81	void			getState();
 82
 83	void			sendRotation(BOOL btn_down);
 84	void			sendScale(BOOL btn_down);
 85	void			sendPosition(BOOL btn_down);
 86	void			sendIsPhysical();
 87	void			sendIsTemporary();
 88	void			sendIsPhantom();
 89
 90	void			sendCastShadows();
 91	void            sendSculpt();
 92	
 93	void 			getVolumeParams(LLVolumeParams& volume_params);
 94	
 95protected:
 96	// Per-object options
 97	LLComboBox*		mComboBaseType;
 98
 99	LLTextBox*		mLabelCut;
100	LLSpinCtrl*		mSpinCutBegin;
101	LLSpinCtrl*		mSpinCutEnd;
102
103	LLTextBox*		mLabelHollow;
104	LLSpinCtrl*		mSpinHollow;
105
106	LLTextBox*		mLabelHoleType;
107	LLComboBox*		mComboHoleType;
108
109	LLTextBox*		mLabelTwist;
110	LLSpinCtrl*		mSpinTwist;
111	LLSpinCtrl*		mSpinTwistBegin;
112
113	LLSpinCtrl*		mSpinScaleX;
114	LLSpinCtrl*		mSpinScaleY;
115	
116	LLTextBox*		mLabelSkew;
117	LLSpinCtrl*		mSpinSkew;
118
119	LLTextBox*		mLabelShear;
120	LLSpinCtrl*		mSpinShearX;
121	LLSpinCtrl*		mSpinShearY;
122
123	// Advanced Path
124	LLSpinCtrl*		mCtrlPathBegin;
125	LLSpinCtrl*		mCtrlPathEnd;
126
127	LLTextBox*		mLabelTaper;
128	LLSpinCtrl*		mSpinTaperX;
129	LLSpinCtrl*		mSpinTaperY;
130
131	LLTextBox*		mLabelRadiusOffset;
132	LLSpinCtrl*		mSpinRadiusOffset;
133
134	LLTextBox*		mLabelRevolutions;
135	LLSpinCtrl*		mSpinRevolutions;
136
137	LLTextBox*		mLabelPosition;
138	LLSpinCtrl*		mCtrlPosX;
139	LLSpinCtrl*		mCtrlPosY;
140	LLSpinCtrl*		mCtrlPosZ;
141
142	LLTextBox*		mLabelSize;
143	LLSpinCtrl*		mCtrlScaleX;
144	LLSpinCtrl*		mCtrlScaleY;
145	LLSpinCtrl*		mCtrlScaleZ;
146
147	LLTextBox*		mLabelRotation;
148	LLSpinCtrl*		mCtrlRotX;
149	LLSpinCtrl*		mCtrlRotY;
150	LLSpinCtrl*		mCtrlRotZ;
151
152	LLCheckBoxCtrl	*mCheckLock;
153	LLCheckBoxCtrl	*mCheckPhysics;
154	LLCheckBoxCtrl	*mCheckTemporary;
155	LLCheckBoxCtrl	*mCheckPhantom;
156	LLCheckBoxCtrl	*mCheckCastShadows;
157
158	LLTextureCtrl   *mCtrlSculptTexture;
159	LLTextBox       *mLabelSculptType;
160	LLComboBox      *mCtrlSculptType;
161	LLCheckBoxCtrl  *mCtrlSculptMirror;
162	LLCheckBoxCtrl  *mCtrlSculptInvert;
163	
164	LLVector3		mCurEulerDegrees;		// to avoid sending rotation when not changed
165	BOOL			mIsPhysical;			// to avoid sending "physical" when not changed
166	BOOL			mIsTemporary;			// to avoid sending "temporary" when not changed
167	BOOL			mIsPhantom;				// to avoid sending "phantom" when not changed
168	BOOL			mCastShadows;			// to avoid sending "cast shadows" when not changed
169	S32				mSelectedType;			// So we know what selected type we last were
170
171	LLUUID          mSculptTextureRevert;   // so we can revert the sculpt texture on cancel
172	U8              mSculptTypeRevert;      // so we can revert the sculpt type on cancel
173
174	LLPointer<LLViewerObject> mObject;
175	LLPointer<LLViewerObject> mRootObject;
176};
177
178#endif