AGXDynamics  2.35.0.3
HudTextManager.h
Go to the documentation of this file.
1 /*
2 Copyright 2007-2022. Algoryx Simulation AB.
3 
4 All AGX source code, intellectual property, documentation, sample code,
5 tutorials, scene files and technical white papers, are copyrighted, proprietary
6 and confidential material of Algoryx Simulation AB. You may not download, read,
7 store, distribute, publish, copy or otherwise disseminate, use or expose this
8 material unless having a written signed agreement with Algoryx Simulation AB, or having been
9 advised so by Algoryx Simulation AB for a time limited evaluation, or having purchased a
10 valid commercial license from Algoryx Simulation AB.
11 
12 Algoryx Simulation AB disclaims all responsibilities for loss or damage caused
13 from using this software, unless otherwise stated in written agreements with
14 Algoryx Simulation AB.
15 */
16 
17 #ifndef AGXOSG_HUDTEXTMANAGER_H
18 #define AGXOSG_HUDTEXTMANAGER_H
19 
20 #include <agxOSG/export.h>
21 #include <agxOSG/SceneDecorator.h>
23 
24 
26 namespace agxOSG
27 {
28 
29 
31 
39  {
40 
41  public:
45  {
46  public:
48  ReferencedText(const agx::String& text);
49 
51  const agx::String& getText() const;
52 
54  void setText(const agx::String& text);
55 
56  protected:
57  virtual ~ReferencedText();
58 
59  protected:
61  };
62 
63  HudTextManager(agxOSG::SceneDecorator* sceneDecorator);
64 
66  void addText(const agx::String& text);
67 
72  void addConstantText(const agx::String& text);
73 
75  void clearConstantText();
76 
78  void clearText();
79 
81  void updateHud();
82 
88  void addReferencedText(ReferencedText* text);
89 
91  virtual void last(const agx::TimeStamp& t) override;
92 
93  protected:
94  virtual ~HudTextManager();
95 
96 
97  protected:
98  osg::observer_ptr<agxOSG::SceneDecorator> m_sceneDecorator;
102  };
103 
104 }
105 
106 
107 
108 #endif
109 
110 
agxOSG::HudTextManager::m_referencedTexts
agx::Vector< ReferencedTextObserver > m_referencedTexts
Definition: HudTextManager.h:101
agxSDK::StepEventListener
Derive from this class to implement a listener for simulation step events.
Definition: StepEventListener.h:37
agx::Vector
Templated vector class.
Definition: Vector.h:52
agxOSG::HudTextManager::m_sceneDecorator
osg::observer_ptr< agxOSG::SceneDecorator > m_sceneDecorator
Definition: HudTextManager.h:98
StepEventListener.h
agxOSG::addText
AGXOSG_EXPORT bool addText(const agxCollide::Geometry *geometry, osg::Group *root, const std::string &text, const agx::Vec3 &relPosition=agx::Vec3(0, 0, 0), const agx::Vec4f &color=agxRender::Color::Yellow(), agx::Real size=0.2)
Add text relative to an geometry.
agxOSG::HudTextManager::ReferencedText
A class for having text elements with reference counting.
Definition: HudTextManager.h:44
agxOSG::SceneDecorator
Decorates a scene with a specific AGX Rendering Style.
Definition: SceneDecorator.h:62
agxOSG
The agxOSG namespace provides functionality for visualizing AGX simulations with OpenSceneGraph.
agx::Referenced
Base class providing referencing counted objects.
Definition: Referenced.h:113
AGX_DECLARE_POINTER_TYPES
#define AGX_DECLARE_POINTER_TYPES(type)
Definition: Referenced.h:248
SceneDecorator.h
agx::TimeStamp
agx::Real TimeStamp
Definition: TimeStamp.h:26
export.h
agx::AgXString< std::string >
agxOSG::HudTextManager
HudTextManager is a class that inherits from agxSDK::StepEventListener and makes it easier to manipul...
Definition: HudTextManager.h:38
agxOSG::HudTextManager::m_constantText
agx::String m_constantText
Definition: HudTextManager.h:100
agxOSG::HudTextManager::ReferencedText::m_text
agx::String m_text
Definition: HudTextManager.h:60
agxOSG::HudTextManager::m_text
agx::String m_text
Definition: HudTextManager.h:99
AGXOSG_EXPORT
#define AGXOSG_EXPORT