llpanelobject.h 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210
  1. /**
  2. * @file llpanelobject.h
  3. * @brief Object editing (position, scale, etc.) in the tools floater
  4. *
  5. * $LicenseInfo:firstyear=2004&license=viewergpl$
  6. *
  7. * Copyright (c) 2004-2009, Linden Research, Inc.
  8. *
  9. * Second Life Viewer Source Code
  10. * The source code in this file ("Source Code") is provided by Linden Lab
  11. * to you under the terms of the GNU General Public License, version 2.0
  12. * ("GPL"), unless you have obtained a separate licensing agreement
  13. * ("Other License"), formally executed by you and Linden Lab. Terms of
  14. * the GPL can be found in doc/GPL-license.txt in this distribution, or
  15. * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
  16. *
  17. * There are special exceptions to the terms and conditions of the GPL as
  18. * it is applied to this Source Code. View the full text of the exception
  19. * in the file doc/FLOSS-exception.txt in this software distribution, or
  20. * online at
  21. * http://secondlifegrid.net/programs/open_source/licensing/flossexception
  22. *
  23. * By copying, modifying or distributing this software, you acknowledge
  24. * that you have read and understood your obligations described above,
  25. * and agree to abide by those obligations.
  26. *
  27. * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
  28. * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
  29. * COMPLETENESS OR PERFORMANCE.
  30. * $/LicenseInfo$
  31. */
  32. #ifndef LL_LLPANELOBJECT_H
  33. #define LL_LLPANELOBJECT_H
  34. #include "llpanel.h"
  35. #include "llpointer.h"
  36. #include "llvolume.h"
  37. #include "llvector3.h"
  38. class LLSpinCtrl;
  39. class LLCheckBoxCtrl;
  40. class LLTextBox;
  41. class LLUICtrl;
  42. class LLButton;
  43. class LLViewerObject;
  44. class LLComboBox;
  45. class LLColorSwatchCtrl;
  46. class LLTextureCtrl;
  47. class LLInventoryItem;
  48. class LLUUID;
  49. class LLPanelObject final : public LLPanel
  50. {
  51. protected:
  52. LOG_CLASS(LLPanelObject);
  53. public:
  54. LLPanelObject(const std::string& name);
  55. bool postBuild() override;
  56. void draw() override;
  57. void clearCtrls() override;
  58. void refresh() override;
  59. private:
  60. static void onCommitLock(LLUICtrl* ctrl, void* userdata);
  61. static void onCommitPosition(LLUICtrl* ctrl, void* userdata);
  62. static void onCommitScale(LLUICtrl* ctrl, void* userdata);
  63. static void onCommitRotation(LLUICtrl* ctrl, void* userdata);
  64. static void onCommitTemporary(LLUICtrl* ctrl, void* userdata);
  65. static void onCommitPhantom(LLUICtrl* ctrl, void* userdata);
  66. static void onCommitParametric(LLUICtrl* ctrl, void* userdata);
  67. static void onCommitSculpt(LLUICtrl* ctrl, void* userdata);
  68. static void onCancelSculpt(LLUICtrl* ctrl, void* userdata);
  69. static void onSelectSculpt(LLUICtrl* ctrl, void* userdata);
  70. static bool onDropSculpt(LLUICtrl* ctrl, LLInventoryItem* item, void* ud);
  71. static void onCommitSculptType(LLUICtrl* ctrl, void* userdata);
  72. static void onCommitCopyPaste(LLUICtrl* ctrl, void* userdata);
  73. static void onClickCopy(void* userdata);
  74. static void onClickPaste(void* userdata);
  75. void getState();
  76. void setCopyPasteState();
  77. void sendRotation(bool btn_down);
  78. void sendScale(bool btn_down);
  79. void sendPosition(bool btn_down);
  80. void sendIsTemporary();
  81. void sendIsPhantom();
  82. void sendSculpt();
  83. void getVolumeParams(LLVolumeParams& volume_params);
  84. private:
  85. LLTextBox* mLabelSelectSingle;
  86. LLTextBox* mLabelEditObject;
  87. // Per-object options
  88. LLTextBox* mLabelBaseType;
  89. LLComboBox* mComboBaseType;
  90. LLTextBox* mLabelCut;
  91. LLSpinCtrl* mSpinCutBegin;
  92. LLSpinCtrl* mSpinCutEnd;
  93. LLTextBox* mLabelHollow;
  94. LLSpinCtrl* mSpinHollow;
  95. LLTextBox* mLabelHollowShape;
  96. LLComboBox* mComboHoleType;
  97. LLTextBox* mLabelTwist;
  98. LLSpinCtrl* mSpinTwist;
  99. LLSpinCtrl* mSpinTwistBegin;
  100. LLTextBox* mLabelScaleHole;
  101. LLTextBox* mLabelScaleTaper;
  102. LLSpinCtrl* mSpinScaleX;
  103. LLSpinCtrl* mSpinScaleY;
  104. LLTextBox* mLabelSkew;
  105. LLSpinCtrl* mSpinSkew;
  106. LLTextBox* mLabelShear;
  107. LLSpinCtrl* mSpinShearX;
  108. LLSpinCtrl* mSpinShearY;
  109. // Advanced Path
  110. LLTextBox* mLabelAdvancedCut;
  111. LLTextBox* mLabelAdvancedDimple;
  112. LLTextBox* mLabelAdvancedSlice;
  113. LLSpinCtrl* mCtrlPathBegin;
  114. LLSpinCtrl* mCtrlPathEnd;
  115. LLTextBox* mLabelTaper;
  116. LLSpinCtrl* mSpinTaperX;
  117. LLSpinCtrl* mSpinTaperY;
  118. LLTextBox* mLabelRadiusOffset;
  119. LLSpinCtrl* mSpinRadiusOffset;
  120. LLTextBox* mLabelRevolutions;
  121. LLSpinCtrl* mSpinRevolutions;
  122. LLTextBox* mLabelPosition;
  123. LLSpinCtrl* mCtrlPosX;
  124. LLSpinCtrl* mCtrlPosY;
  125. LLSpinCtrl* mCtrlPosZ;
  126. LLCheckBoxCtrl* mCheckCopyPos;
  127. LLTextBox* mLabelSize;
  128. LLSpinCtrl* mCtrlScaleX;
  129. LLSpinCtrl* mCtrlScaleY;
  130. LLSpinCtrl* mCtrlScaleZ;
  131. LLCheckBoxCtrl* mCheckCopySize;
  132. LLTextBox* mLabelRotation;
  133. LLSpinCtrl* mCtrlRotX;
  134. LLSpinCtrl* mCtrlRotY;
  135. LLSpinCtrl* mCtrlRotZ;
  136. LLCheckBoxCtrl* mCheckCopyRot;
  137. LLCheckBoxCtrl* mCheckLock;
  138. LLCheckBoxCtrl* mCheckTemporary;
  139. LLCheckBoxCtrl* mCheckPhantom;
  140. LLCheckBoxCtrl* mCheckCopyShape;
  141. LLTextureCtrl* mCtrlSculptTexture;
  142. LLTextBox* mLabelSculptType;
  143. LLComboBox* mCtrlSculptType;
  144. LLCheckBoxCtrl* mCtrlSculptMirror;
  145. LLCheckBoxCtrl* mCtrlSculptInvert;
  146. LLButton* mButtonCopy;
  147. LLButton* mButtonPaste;
  148. LLPointer<LLViewerObject> mObject;
  149. LLPointer<LLViewerObject> mRootObject;
  150. S32 mSelectedType; // So we know what selected type we last were
  151. LLUUID mSculptTextureRevert; // so we can revert the sculpt texture on cancel
  152. LLVector3 mCurEulerDegrees; // to avoid sending rotation when not changed
  153. bool mIsTemporary; // to avoid sending "temporary" when not changed
  154. bool mIsPhantom; // to avoid sending "phantom" when not changed
  155. bool mSizeChanged;
  156. U8 mSculptTypeRevert; // so we can revert the sculpt type on cancel
  157. // Object clipboard data
  158. static bool sSavedSizeValid;
  159. static bool sSavedPosValid;
  160. static bool sSavedRotValid;
  161. static bool sSavedShapeValid;
  162. static LLVector3 sSavedSize;
  163. static LLVector3 sSavedPos;
  164. static LLVector3 sSavedRot;
  165. static LLVolumeParams sSavedShape;
  166. };
  167. #endif