llfloatertelehub.h 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. /**
  2. * @file llfloatertelehub.h
  3. * @author James Cook
  4. * @brief LLFloaterTelehub class definition
  5. *
  6. * $LicenseInfo:firstyear=2005&license=viewergpl$
  7. *
  8. * Copyright (c) 2005-2009, 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_LLFLOATERTELEHUB_H
  34. #define LL_LLFLOATERTELEHUB_H
  35. #include "llfloater.h"
  36. #include "llsafehandle.h"
  37. class LLButton;
  38. class LLMessageSystem;
  39. class LLObjectSelection;
  40. class LLScrollListCtrl;
  41. constexpr S32 MAX_SPAWNPOINTS_PER_TELEHUB = 16;
  42. class LLFloaterTelehub final : public LLFloater,
  43. public LLFloaterSingleton<LLFloaterTelehub>
  44. {
  45. friend class LLUISingleton<LLFloaterTelehub, VisibilityPolicy<LLFloater> >;
  46. public:
  47. ~LLFloaterTelehub() override;
  48. bool postBuild() override;
  49. void draw() override;
  50. void refresh() override;
  51. LL_INLINE static bool renderBeacons()
  52. {
  53. return findInstance() && getInstance()->mTelehubObjectID.notNull();
  54. }
  55. static void addBeacons();
  56. private:
  57. // Open only via LLFloaterSingleton interface, i.e. showInstance() or
  58. // toggleInstance().
  59. LLFloaterTelehub(const LLSD&);
  60. void sendTelehubInfoRequest();
  61. void unpackTelehubInfo(LLMessageSystem* msg);
  62. static void processTelehubInfo(LLMessageSystem* msg, void**);
  63. static void onClickConnect(void*);
  64. static void onClickDisconnect(void*);
  65. static void onClickAddSpawnPoint(void*);
  66. static void onClickRemoveSpawnPoint(void* data);
  67. private:
  68. LLSafeHandle<LLObjectSelection> mObjectSelection;
  69. LLButton* mConnectBtn;
  70. LLButton* mDisconnectBtn;
  71. LLButton* mAddSpawnBtn;
  72. LLButton* mRemoveSpawnBtn;
  73. LLScrollListCtrl* mSpawnPointsList;
  74. LLUUID mTelehubObjectID; // null if no telehub
  75. // region local, fallback if viewer can't see the object
  76. LLVector3 mTelehubPos;
  77. LLQuaternion mTelehubRot;
  78. S32 mNumSpawn;
  79. LLVector3 mSpawnPointPos[MAX_SPAWNPOINTS_PER_TELEHUB];
  80. std::string mTelehubObjectName;
  81. };
  82. #endif