AGX Dynamics  2.37.3.2
HudTextManager.h
Go to the documentation of this file.
1 /*
2 Copyright 2007-2024. 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 
#define AGXOSG_EXPORT
Derive from this class to implement a listener for simulation step events.
agx::Vector< ReferencedTextObserver > m_referencedTexts
A class for having text elements with reference counting.
#define AGX_DECLARE_POINTER_TYPES(type)
Definition: Referenced.h:254
agx::Real TimeStamp
Definition: TimeStamp.h:26
Decorates a scene with a specific AGX Rendering Style.
Base class providing referencing counted objects.
Definition: Referenced.h:119
Templated vector class.
Definition: Vector.h:52
The agxOSG namespace provides functionality for visualizing AGX simulations with OpenSceneGraph.
osg::observer_ptr< agxOSG::SceneDecorator > m_sceneDecorator
HudTextManager is a class that inherits from agxSDK::StepEventListener and makes it easier to manipul...
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.