llfloatertools.h 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280
  1. /**
  2. * @file llfloatertools.h
  3. * @brief The edit tools, including move, position, land, etc.
  4. *
  5. * $LicenseInfo:firstyear=2002&license=viewergpl$
  6. *
  7. * Copyright (c) 2002-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_LLFLOATERTOOLS_H
  33. #define LL_LLFLOATERTOOLS_H
  34. #include "llfloater.h"
  35. #include "llcheckboxctrl.h"
  36. #include "llcombobox.h"
  37. #include "llcoord.h"
  38. #include "llparcelselection.h"
  39. #include "llsafehandle.h"
  40. class LLButton;
  41. class LLComboBox;
  42. class LLMediaCtrl;
  43. class LLObjectSelection;
  44. class LLPanelContents;
  45. class LLPanelFace;
  46. class LLPanelLandInfo;
  47. class LLPanelObject;
  48. class LLPanelPermissions;
  49. class LLPanelVolume;
  50. class LLParcelSelection;
  51. class LLSliderCtrl;
  52. class LLTabContainer;
  53. class LLTextBox;
  54. class LLTool;
  55. typedef LLSafeHandle<LLObjectSelection> LLObjectSelectionHandle;
  56. class LLFloaterTools final : public LLFloater
  57. {
  58. protected:
  59. LOG_CLASS(LLFloaterTools);
  60. public:
  61. LLFloaterTools();
  62. ~LLFloaterTools() override;
  63. bool postBuild() override;
  64. static void* createPanelPermissions(void* vdata);
  65. static void* createPanelObject(void* vdata);
  66. static void* createPanelVolume(void* vdata);
  67. static void* createPanelFace(void* vdata);
  68. static void* createPanelContents(void* vdata);
  69. static void* createPanelContentsInventory(void* vdata);
  70. static void* createPanelLandInfo(void* vdata);
  71. void onOpen() override;
  72. void onClose(bool app_quitting) override;
  73. bool canClose() override;
  74. void onFocusReceived() override;
  75. void draw() override;
  76. // Call this once per frame to handle visibility, rect location,
  77. // button highlights, etc.
  78. void updatePopup(LLCoordGL center, MASK mask);
  79. void toolsPrecision();
  80. // When the floater is going away, reset any options that need to be
  81. // cleared.
  82. void resetToolState();
  83. enum EInfoPanel
  84. {
  85. PANEL_GENERAL = 0,
  86. PANEL_OBJECT,
  87. PANEL_FEATURES,
  88. PANEL_FACE,
  89. PANEL_CONTENTS,
  90. PANEL_COUNT
  91. };
  92. void dirty();
  93. void showPanel(EInfoPanel panel);
  94. void setStatusText(const std::string& text);
  95. static void setEditTool(void* data);
  96. void saveLastTool();
  97. LL_INLINE void setGridMode(S32 mode) { mComboGridMode->setCurrentByIndex(mode); }
  98. LL_INLINE LLPanelFace* getPanelFace() { return mPanelFace; }
  99. static bool isVisible();
  100. private:
  101. static void setObjectType(void* data);
  102. void refresh() override;
  103. void updatePrevNextBtns();
  104. void getMediaState();
  105. void updateMediaSettings();
  106. bool selectedMediaEditable();
  107. void updateTreeGrassCombo(bool visible);
  108. static void onCommitGridMode(LLUICtrl* ctrl, void* data);
  109. static void commitSelectComponent(LLUICtrl* ctrl, void* data);
  110. static bool deleteMediaConfirm(const LLSD& notification,
  111. const LLSD& response);
  112. static bool multipleFacesSelectedConfirm(const LLSD& notification,
  113. const LLSD& response);
  114. static void onClickBtnEditMedia(void* data);
  115. static void onClickBtnAddMedia(void* data);
  116. static void onClickBtnDeleteMedia(void* data);
  117. static void onClickGridOptions(void* data);
  118. static void onClickLink(void* data);
  119. static void onClickUnlink(void* data);
  120. static void onSelectTreesGrass(LLUICtrl*, void*);
  121. private:
  122. LLButton* mBtnFocus;
  123. LLButton* mBtnMove;
  124. LLButton* mBtnEdit;
  125. LLButton* mBtnCreate;
  126. LLButton* mBtnLand;
  127. LLTextBox* mTextStatus;
  128. // Focus buttons
  129. LLCheckBoxCtrl* mRadioOrbit;
  130. LLCheckBoxCtrl* mRadioZoom;
  131. LLCheckBoxCtrl* mRadioPan;
  132. LLSliderCtrl* mSliderZoom;
  133. // Move buttons
  134. LLCheckBoxCtrl* mRadioMove;
  135. LLCheckBoxCtrl* mRadioLift;
  136. LLCheckBoxCtrl* mRadioSpin;
  137. // Edit buttons
  138. LLCheckBoxCtrl* mRadioPosition;
  139. LLCheckBoxCtrl* mRadioAlign;
  140. LLCheckBoxCtrl* mRadioRotate;
  141. LLCheckBoxCtrl* mRadioStretch;
  142. LLCheckBoxCtrl* mRadioSelectFace;
  143. LLCheckBoxCtrl* mCheckSelectIndividual;
  144. LLButton* mBtnPrevChild;
  145. LLButton* mBtnNextChild;
  146. LLButton* mBtnLink;
  147. LLButton* mBtnUnlink;
  148. LLTextBox* mTextObjectCount;
  149. LLTextBox* mTextPrimCount;
  150. LLButton* mBtnGridOptions;
  151. LLTextBox* mTextGridMode;
  152. LLComboBox* mComboGridMode;
  153. LLCheckBoxCtrl* mCheckStretchUniform;
  154. LLCheckBoxCtrl* mCheckStretchTexture;
  155. LLCheckBoxCtrl* mCheckUseRootForPivot;
  156. LLButton* mBtnRotateLeft;
  157. LLButton* mBtnRotateReset;
  158. LLButton* mBtnRotateRight;
  159. LLButton* mBtnDelete;
  160. LLButton* mBtnDuplicate;
  161. LLButton* mBtnDuplicateInPlace;
  162. // Create buttons
  163. LLCheckBoxCtrl* mCheckSticky;
  164. LLCheckBoxCtrl* mCheckCopySelection;
  165. LLCheckBoxCtrl* mCheckCopyCenters;
  166. LLCheckBoxCtrl* mCheckCopyRotates;
  167. // Land buttons
  168. LLCheckBoxCtrl* mRadioSelectLand;
  169. LLCheckBoxCtrl* mRadioDozerFlatten;
  170. LLCheckBoxCtrl* mRadioDozerRaise;
  171. LLCheckBoxCtrl* mRadioDozerLower;
  172. LLCheckBoxCtrl* mRadioDozerSmooth;
  173. LLCheckBoxCtrl* mRadioDozerNoise;
  174. LLCheckBoxCtrl* mRadioDozerRevert;
  175. LLSliderCtrl* mSliderDozerSize;
  176. LLSliderCtrl* mSliderDozerForce;
  177. LLButton* mBtnApplyToSelection;
  178. LLTextBox* mTextBulldozer;
  179. LLTextBox* mTextDozerSize;
  180. LLTextBox* mTextStrength;
  181. LLComboBox* mComboTreesGrass;
  182. LLTextBox* mTextTreeGrass;
  183. LLButton* mBtnToolTree;
  184. LLButton* mBtnToolGrass;
  185. std::vector<LLButton*> mButtons; //[15];
  186. LLTabContainer* mTab;
  187. LLPanelPermissions* mPanelPermissions;
  188. LLPanelObject* mPanelObject;
  189. LLPanelVolume* mPanelVolume;
  190. LLPanelContents* mPanelContents;
  191. LLPanelFace* mPanelFace;
  192. LLPanelLandInfo* mPanelLandInfo;
  193. LLTabContainer* mTabLand;
  194. LLButton* mBtnEditMedia;
  195. LLButton* mBtnAddMedia;
  196. LLButton* mBtnDeleteMedia;
  197. LLTextBox* mTextMediaInfo;
  198. LLSD mMediaSettings;
  199. std::string mGridScreenText;
  200. std::string mGridLocalText;
  201. std::string mGridWorldText;
  202. std::string mGridReferenceText;
  203. std::string mGridAttachmentText;
  204. typedef std::map<std::string, std::string> status_map_t;
  205. status_map_t mStatusText;
  206. LLParcelSelectionHandle mParcelSelection;
  207. LLObjectSelectionHandle mObjectSelection;
  208. U32 mPrecision;
  209. S32 mLastObjectCount;
  210. S32 mLastPrimCount;
  211. S32 mLastLandImpact;
  212. bool mDirty;
  213. };
  214. class LLFloaterBuildOptions : public LLFloater,
  215. public LLFloaterSingleton<LLFloaterBuildOptions>
  216. {
  217. friend class LLUISingleton<LLFloaterBuildOptions,
  218. VisibilityPolicy<LLFloater> >;
  219. private:
  220. // Open only via LLFloaterSingleton interface, i.e. showInstance() or
  221. // toggleInstance().
  222. LLFloaterBuildOptions(const LLSD&);
  223. };
  224. extern LLFloaterTools* gFloaterToolsp;
  225. #endif