AGX Dynamics  2.37.2.0
Text.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_TEXT_H
18 #define AGXOSG_TEXT_H
19 
20 #include <agxOSG/export.h>
21 #include <agxOSG/Node.h>
22 
23 #include <agx/PushDisableWarnings.h> // Disabling warnings. Include agx/PopDisableWarnings.h below!
24 #include <osgText/Text>
25 #include <agx/PopDisableWarnings.h> // End of disabled warnings.
26 
27 namespace agxOSG
28 {
29  class AGXOSG_EXPORT Text : public osg::Geode
30  {
31  public:
32 
34  {
42  USER_DEFINED_ROTATION
43  };
44 
46  {
47  DROP_SHADOW_BOTTOM_RIGHT = 0, // usually the type of shadow you see
56  NONE
57  };
58 
60  {
64 
68 
72 
76 
80 
81  BASE_LINE = LEFT_BASE_LINE
82 
83  };
84 
85 
87  {
88  TEXT = 1,
89  BOUNDINGBOX = 2,
90  FILLEDBOUNDINGBOX = 4,
91  ALIGNMENT = 8
92  };
93 
94  Text();
95  Text( const agx::String& text, const agx::Vec3& position=agx::Vec3(), const agx::Vec4& color = agx::Vec4( 1, 1, 1, 1 ) );
96 
97 
98  void setFont( const agx::String& font );
99  void setCharacterSize( float size );
100  void setColor( const agx::Vec4f& color );
101  void setPosition( const agx::Vec3& position );
102  void setAxisAlignment( AxisAlignment alignment );
103  void setBackdropType( BackdropType type );
104  void setDrawMode( DrawModeMask drawMode );
105  void setText( const agx::String& text );
106  void setAlignment(AlignmentType alignment);
107 
108  private:
109  void init(const agx::String& text="", const agx::Vec3& position=agx::Vec3(), const agx::Vec4& color = agx::Vec4( 1, 1, 1, 1 ) );
110  osg::ref_ptr<osgText::Text> m_text;
111  };
112 
113 
114 
115 }
116 
117 #endif
void AGXPHYSICS_EXPORT init()
Initialize AGX Dynamics API including thread resources and must be executed before using the AGX API...
#define AGXOSG_EXPORT
A class holding 4 dimensional vectors and providing basic arithmetic.
Definition: Vec4Template.h:34
AlignmentType
Definition: Text.h:59
DrawModeMask
Definition: Text.h:86
The agxOSG namespace provides functionality for visualizing AGX simulations with OpenSceneGraph.
BackdropType
Definition: Text.h:45
AxisAlignment
Definition: Text.h:33