AGX Dynamics 2.42.1.1
Loading...
Searching...
No Matches
Text.h
Go to the documentation of this file.
1/*
2Copyright 2007-2025. 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_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
27namespace 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
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 );
104 void setDrawMode( DrawModeMask drawMode );
105 void setText( const agx::String& text );
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
#define AGXOSG_EXPORT
DrawModeMask
Definition: Text.h:87
void setCharacterSize(float size)
AlignmentType
Definition: Text.h:60
@ RIGHT_TOP
Definition: Text.h:69
@ RIGHT_BOTTOM
Definition: Text.h:71
@ RIGHT_BASE_LINE
Definition: Text.h:75
@ CENTER_BASE_LINE
Definition: Text.h:74
@ LEFT_TOP
Definition: Text.h:61
@ CENTER_BOTTOM_BASE_LINE
Definition: Text.h:78
@ RIGHT_CENTER
Definition: Text.h:70
@ CENTER_CENTER
Definition: Text.h:66
@ CENTER_BOTTOM
Definition: Text.h:67
@ LEFT_CENTER
Definition: Text.h:62
@ CENTER_TOP
Definition: Text.h:65
@ LEFT_BASE_LINE
Definition: Text.h:73
@ LEFT_BOTTOM
Definition: Text.h:63
@ LEFT_BOTTOM_BASE_LINE
Definition: Text.h:77
@ RIGHT_BOTTOM_BASE_LINE
Definition: Text.h:79
Text(const agx::String &text, const agx::Vec3 &position=agx::Vec3(), const agx::Vec4 &color=agx::Vec4(1, 1, 1, 1))
void setAlignment(AlignmentType alignment)
AxisAlignment
Definition: Text.h:34
@ REVERSED_XY_PLANE
Definition: Text.h:36
@ REVERSED_XZ_PLANE
Definition: Text.h:38
@ XZ_PLANE
Definition: Text.h:37
@ YZ_PLANE
Definition: Text.h:39
@ XY_PLANE
Definition: Text.h:35
@ SCREEN
Definition: Text.h:41
@ REVERSED_YZ_PLANE
Definition: Text.h:40
BackdropType
Definition: Text.h:46
@ DROP_SHADOW_CENTER_RIGHT
Definition: Text.h:48
@ DROP_SHADOW_BOTTOM_LEFT
Definition: Text.h:52
@ OUTLINE
Definition: Text.h:55
@ DROP_SHADOW_BOTTOM_CENTER
Definition: Text.h:50
@ DROP_SHADOW_TOP_CENTER
Definition: Text.h:51
@ DROP_SHADOW_TOP_LEFT
Definition: Text.h:54
@ DROP_SHADOW_CENTER_LEFT
Definition: Text.h:53
@ DROP_SHADOW_TOP_RIGHT
Definition: Text.h:49
void setDrawMode(DrawModeMask drawMode)
void setFont(const agx::String &font)
void setText(const agx::String &text)
void setPosition(const agx::Vec3 &position)
void setColor(const agx::Vec4f &color)
void setBackdropType(BackdropType type)
void setAxisAlignment(AxisAlignment alignment)
A class holding 4 dimensional vectors and providing basic arithmetic.
Definition: Vec4Template.h:35
The agxOSG namespace provides functionality for visualizing AGX simulations with OpenSceneGraph.