PageRenderTime 26ms CodeModel.GetById 19ms RepoModel.GetById 1ms app.codeStats 0ms

/indra/newview/llhudobject.h

https://bitbucket.org/lindenlab/viewer-beta/
C++ Header | 123 lines | 75 code | 19 blank | 29 comment | 0 complexity | b3985383b9f4d731f4a3a6ee7df303b4 MD5 | raw file
Possible License(s): LGPL-2.1
  1. /**
  2. * @file llhudobject.h
  3. * @brief LLHUDObject class definition
  4. *
  5. * $LicenseInfo:firstyear=2002&license=viewerlgpl$
  6. * Second Life Viewer Source Code
  7. * Copyright (C) 2010, Linden Research, Inc.
  8. *
  9. * This library is free software; you can redistribute it and/or
  10. * modify it under the terms of the GNU Lesser General Public
  11. * License as published by the Free Software Foundation;
  12. * version 2.1 of the License only.
  13. *
  14. * This library is distributed in the hope that it will be useful,
  15. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  16. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  17. * Lesser General Public License for more details.
  18. *
  19. * You should have received a copy of the GNU Lesser General Public
  20. * License along with this library; if not, write to the Free Software
  21. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  22. *
  23. * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
  24. * $/LicenseInfo$
  25. */
  26. #ifndef LL_LLHUDOBJECT_H
  27. #define LL_LLHUDOBJECT_H
  28. /**
  29. * Base class and manager for in-world 2.5D non-interactive objects
  30. */
  31. #include "llpointer.h"
  32. #include "v4color.h"
  33. #include "v3math.h"
  34. #include "v3dmath.h"
  35. #include "lldrawpool.h" // TODO: eliminate, unused below
  36. #include <list>
  37. class LLViewerCamera;
  38. class LLFontGL;
  39. class LLFace;
  40. class LLViewerObject;
  41. class LLHUDEffect;
  42. class LLHUDObject : public LLRefCount
  43. {
  44. public:
  45. virtual void markDead();
  46. virtual F32 getDistance() const;
  47. virtual void setSourceObject(LLViewerObject* objectp);
  48. virtual void setTargetObject(LLViewerObject* objectp);
  49. virtual LLViewerObject* getSourceObject() { return mSourceObject; }
  50. virtual LLViewerObject* getTargetObject() { return mTargetObject; }
  51. void setPositionGlobal(const LLVector3d &position_global);
  52. void setPositionAgent(const LLVector3 &position_agent);
  53. BOOL isVisible() const { return mVisible; }
  54. U8 getType() const { return mType; }
  55. LLVector3d getPositionGlobal() const { return mPositionGlobal; }
  56. static LLHUDObject *addHUDObject(const U8 type);
  57. static LLHUDEffect *addHUDEffect(const U8 type);
  58. static void updateAll();
  59. static void renderAll();
  60. static void renderAllForSelect();
  61. static void renderAllForTimer();
  62. // Some objects may need to update when window shape changes
  63. static void reshapeAll();
  64. static void cleanupHUDObjects();
  65. enum
  66. {
  67. LL_HUD_TEXT,
  68. LL_HUD_ICON,
  69. LL_HUD_CONNECTOR,
  70. LL_HUD_FLEXIBLE_OBJECT, // Ventrella
  71. LL_HUD_ANIMAL_CONTROLS, // Ventrella
  72. LL_HUD_LOCAL_ANIMATION_OBJECT, // Ventrella
  73. LL_HUD_CLOTH, // Ventrella
  74. LL_HUD_EFFECT_BEAM,
  75. LL_HUD_EFFECT_GLOW,
  76. LL_HUD_EFFECT_POINT,
  77. LL_HUD_EFFECT_TRAIL,
  78. LL_HUD_EFFECT_SPHERE,
  79. LL_HUD_EFFECT_SPIRAL,
  80. LL_HUD_EFFECT_EDIT,
  81. LL_HUD_EFFECT_LOOKAT,
  82. LL_HUD_EFFECT_POINTAT,
  83. LL_HUD_EFFECT_VOICE_VISUALIZER, // Ventrella
  84. LL_HUD_NAME_TAG,
  85. LL_HUD_EFFECT_BLOB
  86. };
  87. protected:
  88. static void sortObjects();
  89. LLHUDObject(const U8 type);
  90. ~LLHUDObject();
  91. virtual void render() = 0;
  92. virtual void renderForTimer() {};
  93. protected:
  94. U8 mType;
  95. BOOL mDead;
  96. BOOL mVisible;
  97. LLVector3d mPositionGlobal;
  98. LLPointer<LLViewerObject> mSourceObject;
  99. LLPointer<LLViewerObject> mTargetObject;
  100. private:
  101. typedef std::list<LLPointer<LLHUDObject> > hud_object_list_t;
  102. static hud_object_list_t sHUDObjects;
  103. };
  104. #endif // LL_LLHUDOBJECT_H