llfloaterpathfindingcharacters.h 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130
  1. /**
  2. * @file llfloaterpathfindingcharacters.h
  3. * @brief Pathfinding characters floater, allowing for identification of
  4. * pathfinding characters and their cpu usage.
  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_LLFLOATERPATHFINDINGCHARACTERS_H
  34. #define LL_LLFLOATERPATHFINDINGCHARACTERS_H
  35. #include "llfloaterpathfindingobjects.h"
  36. class LLCheckBoxCtrl;
  37. class LLPathfindingCharacter;
  38. class LLQuaternion;
  39. class LLVector3;
  40. class LLFloaterPathfindingCharacters final
  41. : public LLFloaterPathfindingObjects,
  42. public LLFloaterSingleton<LLFloaterPathfindingCharacters>
  43. {
  44. friend class LLUISingleton<LLFloaterPathfindingCharacters,
  45. VisibilityPolicy<LLFloater> >;
  46. protected:
  47. LOG_CLASS(LLFloaterPathfindingCharacters);
  48. public:
  49. void onClose(bool app_quitting) override;
  50. static void openCharactersWithSelectedObjects();
  51. protected:
  52. // Open only via openCharactersWithSelectedObjects()
  53. LLFloaterPathfindingCharacters(const LLSD&);
  54. bool postBuild() override;
  55. void requestGetObjects() override;
  56. void addObjectsIntoScrollList(const LLPathfindingObjectList::ptr_t) override;
  57. LL_INLINE void resetLoadingNameObjectsList() override
  58. {
  59. mLoadingNameObjects.clear();
  60. }
  61. void updateControlsOnScrollListChange() override;
  62. LL_INLINE S32 getNameColumnIndex() const override
  63. {
  64. return 0;
  65. }
  66. LL_INLINE S32 getOwnerNameColumnIndex() const override
  67. {
  68. return 2;
  69. }
  70. std::string getOwnerName(const LLPathfindingObject* obj) const override;
  71. LL_INLINE const LLColor4& getBeaconColor() const override
  72. {
  73. return mBeaconColor;
  74. }
  75. LLPathfindingObjectList::ptr_t getEmptyObjectList() const override;
  76. #if HAVE_PATHINGLIB
  77. bool isPhysicsCapsuleEnabled(LLUUID& id, LLVector3& pos,
  78. LLQuaternion& rot) const;
  79. #endif
  80. static void newObjectList(LLPathfindingManager::request_id_t request_id,
  81. LLPathfindingManager::ERequestStatus req_status,
  82. LLPathfindingObjectList::ptr_t pobjects);
  83. private:
  84. LLSD buildCharacterScrollListItemData(const LLPathfindingCharacter* charp) const;
  85. void rebuildScrollListAfterAvatarNameLoads(const LLPathfindingObject::ptr_t pobj);
  86. #if HAVE_PATHINGLIB
  87. void updateStateOnDisplayControls();
  88. void showSelectedCharacterCapsules();
  89. void showCapsule() const;
  90. void hideCapsule() const;
  91. bool getCapsuleRenderData(LLVector3& pPosition, LLQuaternion& rot) const;
  92. static void onShowPhysicsCapsuleClicked(LLUICtrl* ctrl, void* data);
  93. #endif
  94. static void handleObjectNameResponse(const LLPathfindingObject* pobj);
  95. private:
  96. LLUUID mSelectedCharacterId;
  97. LLColor4 mBeaconColor;
  98. uuid_list_t mLoadingNameObjects;
  99. #if HAVE_PATHINGLIB
  100. LLCheckBoxCtrl* mShowCapsuleCheck;
  101. #endif
  102. };
  103. #endif // LL_LLFLOATERPATHFINDINGCHARACTERS_H