llfloaterpathfindinglinksets.h 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181
  1. /**
  2. * @file llfloaterpathfindinglinksets.h
  3. * @brief Pathfinding linksets floater, allowing manipulation of the linksets
  4. * on the current region.
  5. *
  6. * $LicenseInfo:firstyear=2012&license=viewergpl$
  7. *
  8. * Copyright (c) 2012, Linden Research, Inc.
  9. *
  10. * Second Life Viewer Source Code
  11. * The source code in this file ("Source Code") is provided by Linden Lab
  12. * to you under the terms of the GNU General Public License, version 2.0
  13. * ("GPL"), unless you have obtained a separate licensing agreement
  14. * ("Other License"), formally executed by you and Linden Lab. Terms of
  15. * the GPL can be found in doc/GPL-license.txt in this distribution, or
  16. * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
  17. *
  18. * There are special exceptions to the terms and conditions of the GPL as
  19. * it is applied to this Source Code. View the full text of the exception
  20. * in the file doc/FLOSS-exception.txt in this software distribution, or
  21. * online at
  22. * http://secondlifegrid.net/programs/open_source/licensing/flossexception
  23. *
  24. * By copying, modifying or distributing this software, you acknowledge
  25. * that you have read and understood your obligations described above,
  26. * and agree to abide by those obligations.
  27. *
  28. * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
  29. * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
  30. * COMPLETENESS OR PERFORMANCE.
  31. * $/LicenseInfo$
  32. */
  33. #ifndef LL_LLFLOATERPATHFINDINGLINKSETS_H
  34. #define LL_LLFLOATERPATHFINDINGLINKSETS_H
  35. #include "llfloaterpathfindingobjects.h"
  36. class LLComboBox;
  37. class LLLineEditor;
  38. class LLUICtrl;
  39. class LLVector3;
  40. class LLFloaterPathfindingLinksets final
  41. : public LLFloaterPathfindingObjects,
  42. public LLFloaterSingleton<LLFloaterPathfindingLinksets>
  43. {
  44. friend class LLUISingleton<LLFloaterPathfindingLinksets,
  45. VisibilityPolicy<LLFloater> >;
  46. protected:
  47. LOG_CLASS(LLFloaterPathfindingLinksets);
  48. public:
  49. static void openLinksetsWithSelectedObjects();
  50. protected:
  51. // Open only via openLinksetsWithSelectedObjects()
  52. LLFloaterPathfindingLinksets(const LLSD&);
  53. bool postBuild() override;
  54. void requestGetObjects() override;
  55. void addObjectsIntoScrollList(const LLPathfindingObjectList::ptr_t) override;
  56. LL_INLINE void resetLoadingNameObjectsList() override
  57. {
  58. mLoadingNameObjects.clear();
  59. }
  60. void updateControlsOnScrollListChange() override;
  61. LL_INLINE S32 getNameColumnIndex() const override
  62. {
  63. return 0;
  64. }
  65. LL_INLINE S32 getOwnerNameColumnIndex() const override
  66. {
  67. return 2;
  68. }
  69. std::string getOwnerName(const LLPathfindingObject* obj) const override;
  70. LL_INLINE const LLColor4& getBeaconColor() const override
  71. {
  72. return mBeaconColor;
  73. }
  74. LLPathfindingObjectList::ptr_t getEmptyObjectList() const override;
  75. static void newObjectList(LLPathfindingManager::request_id_t request_id,
  76. LLPathfindingManager::ERequestStatus req_status,
  77. LLPathfindingObjectList::ptr_t pobjects);
  78. private:
  79. void requestSetLinksets(LLPathfindingObjectList::ptr_t linkset_list,
  80. LLPathfindingLinkset::ELinksetUse use,
  81. S32 a, S32 b, S32 c, S32 d);
  82. static void onClearFiltersClicked(void* data);
  83. static void onApplyChangesClicked(void* data);
  84. static void onApplyAllFiltersClicked(void* data);
  85. static void onApplyAllFilters(LLUICtrl* ctrl, void* data);
  86. static void onWalkabilityCoefficientEntered(LLUICtrl* ctrl, void* data);
  87. static void handleObjectNameResponse(const LLPathfindingObject* pobj);
  88. void clearFilters();
  89. void updateEditFieldValues();
  90. LLSD buildLinksetScrollListItemData(const LLPathfindingLinkset* plinkset,
  91. const LLVector3& av_pos);
  92. void rebuildScrollListAfterAvatarNameLoads(const LLPathfindingObject::ptr_t pobj);
  93. bool showUnmodifiablePhantomWarning(LLPathfindingLinkset::ELinksetUse use) const;
  94. bool showPhantomToggleWarning(LLPathfindingLinkset::ELinksetUse use) const;
  95. bool showCannotBeVolumeWarning(LLPathfindingLinkset::ELinksetUse use) const;
  96. void updateStateOnEditFields();
  97. void updateStateOnEditLinksetUse();
  98. void applyEdit();
  99. void handleApplyEdit(const LLSD& notification, const LLSD& response);
  100. void doApplyEdit();
  101. std::string getLinksetUseString(LLPathfindingLinkset::ELinksetUse use) const;
  102. LLPathfindingLinkset::ELinksetUse getFilterLinksetUse() const;
  103. void setFilterLinksetUse(LLPathfindingLinkset::ELinksetUse use);
  104. LLPathfindingLinkset::ELinksetUse getEditLinksetUse() const;
  105. void setEditLinksetUse(LLPathfindingLinkset::ELinksetUse use);
  106. LLPathfindingLinkset::ELinksetUse convertToLinksetUse(LLSD value) const;
  107. LLSD convertToXuiValue(LLPathfindingLinkset::ELinksetUse use) const;
  108. private:
  109. LLLineEditor* mFilterByName;
  110. LLLineEditor* mFilterByDescription;
  111. LLComboBox* mFilterByLinksetUse;
  112. LLComboBox* mEditLinksetUse;
  113. LLScrollListItem* mUseUnset;
  114. LLScrollListItem* mUseWalkable;
  115. LLScrollListItem* mUseStaticObstacle;
  116. LLScrollListItem* mUseDynamicObstacle;
  117. LLScrollListItem* mUseMaterialVolume;
  118. LLScrollListItem* mUseExclusionVolume;
  119. LLScrollListItem* mUseDynamicPhantom;
  120. LLTextBox* mLabelCoefficients;
  121. LLTextBox* mLabelEditA;
  122. LLTextBox* mLabelEditB;
  123. LLTextBox* mLabelEditC;
  124. LLTextBox* mLabelEditD;
  125. LLLineEditor* mEditA;
  126. LLLineEditor* mEditB;
  127. LLLineEditor* mEditC;
  128. LLLineEditor* mEditD;
  129. LLTextBox* mLabelSuggestedUseA;
  130. LLTextBox* mLabelSuggestedUseB;
  131. LLTextBox* mLabelSuggestedUseC;
  132. LLTextBox* mLabelSuggestedUseD;
  133. LLButton* mApplyEditsButton;
  134. LLColor4 mBeaconColor;
  135. uuid_list_t mLoadingNameObjects;
  136. S32 mPreviousValueA;
  137. S32 mPreviousValueB;
  138. S32 mPreviousValueC;
  139. S32 mPreviousValueD;
  140. S32 mScriptedColumnWidth;
  141. bool mHasKnownScripedStatus;
  142. };
  143. #endif // LL_LLFLOATERPATHFINDINGLINKSETS_H