AGX Dynamics 2.38.0.2
Loading...
Searching...
No Matches
HudTextManager.h
Go to the documentation of this file.
1/*
2Copyright 2007-2024. Algoryx Simulation AB.
3
4All AGX source code, intellectual property, documentation, sample code,
5tutorials, scene files and technical white papers, are copyrighted, proprietary
6and confidential material of Algoryx Simulation AB. You may not download, read,
7store, distribute, publish, copy or otherwise disseminate, use or expose this
8material unless having a written signed agreement with Algoryx Simulation AB, or having been
9advised so by Algoryx Simulation AB for a time limited evaluation, or having purchased a
10valid commercial license from Algoryx Simulation AB.
11
12Algoryx Simulation AB disclaims all responsibilities for loss or damage caused
13from using this software, unless otherwise stated in written agreements with
14Algoryx Simulation AB.
15*/
16
17#ifndef AGXOSG_HUDTEXTMANAGER_H
18#define AGXOSG_HUDTEXTMANAGER_H
19
20#include <agxOSG/export.h>
23
24
26namespace agxOSG
27{
28
29
31
39 {
40
41 public:
45 {
46 public:
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
64
66 void addText(const agx::String& text);
67
72 void addConstantText(const agx::String& text);
73
76
78 void clearText();
79
81 void updateHud();
82
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 AGX_DECLARE_POINTER_TYPES(type)
Definition Referenced.h:254
#define AGXOSG_EXPORT
A class for having text elements with reference counting.
void setText(const agx::String &text)
Set the new text.
ReferencedText(const agx::String &text)
Creates a referenced text given a string.
const agx::String & getText() const
Get the current text.
HudTextManager is a class that inherits from agxSDK::StepEventListener and makes it easier to manipul...
void addConstantText(const agx::String &text)
Add text which should be shown all time steps (until removed).
void clearConstantText()
Clear constant text.
void addReferencedText(ReferencedText *text)
Adds referenced text.
HudTextManager(agxOSG::SceneDecorator *sceneDecorator)
void addText(const agx::String &text)
Add text which should be shown only this time step.
agx::Vector< ReferencedTextObserver > m_referencedTexts
virtual void last(const agx::TimeStamp &t) override
Inherited from agxSDK::StepEventListener.
void updateHud()
Updates the HUD given constant text, referenced text and text, without clearing text.
osg::observer_ptr< agxOSG::SceneDecorator > m_sceneDecorator
void clearText()
Clear text which should be shown only this time step.
Decorates a scene with a specific AGX Rendering Style.
Derive from this class to implement a listener for simulation step events.
Base class providing referencing counted objects.
Definition Referenced.h:120
Templated vector class.
Definition agx/Vector.h:53
The agxOSG namespace provides functionality for visualizing AGX simulations with OpenSceneGraph.
agx::Real TimeStamp
Definition TimeStamp.h:26