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
33
enum
AxisAlignment
34
{
35
XY_PLANE
,
36
REVERSED_XY_PLANE
,
37
XZ_PLANE
,
38
REVERSED_XZ_PLANE
,
39
YZ_PLANE
,
40
REVERSED_YZ_PLANE
,
41
SCREEN
,
42
USER_DEFINED_ROTATION
43
};
44
45
enum
BackdropType
46
{
47
DROP_SHADOW_BOTTOM_RIGHT = 0,
// usually the type of shadow you see
48
DROP_SHADOW_CENTER_RIGHT
,
49
DROP_SHADOW_TOP_RIGHT
,
50
DROP_SHADOW_BOTTOM_CENTER
,
51
DROP_SHADOW_TOP_CENTER
,
52
DROP_SHADOW_BOTTOM_LEFT
,
53
DROP_SHADOW_CENTER_LEFT
,
54
DROP_SHADOW_TOP_LEFT
,
55
OUTLINE
,
56
NONE
57
};
58
59
enum
AlignmentType
60
{
61
LEFT_TOP
,
62
LEFT_CENTER
,
63
LEFT_BOTTOM
,
64
65
CENTER_TOP
,
66
CENTER_CENTER
,
67
CENTER_BOTTOM
,
68
69
RIGHT_TOP
,
70
RIGHT_CENTER
,
71
RIGHT_BOTTOM
,
72
73
LEFT_BASE_LINE
,
74
CENTER_BASE_LINE
,
75
RIGHT_BASE_LINE
,
76
77
LEFT_BOTTOM_BASE_LINE
,
78
CENTER_BOTTOM_BASE_LINE
,
79
RIGHT_BOTTOM_BASE_LINE
,
80
81
BASE_LINE = LEFT_BASE_LINE
82
83
};
84
85
86
enum
DrawModeMask
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
agxOSG::Text
Definition:
Text.h:29
agx::init
void AGXPHYSICS_EXPORT init()
Initialize AGX Dynamics API including thread resources and must be executed before using the AGX API...
agxOSG::Text::LEFT_CENTER
Definition:
Text.h:62
agxOSG::Text::CENTER_CENTER
Definition:
Text.h:66
AGXOSG_EXPORT
#define AGXOSG_EXPORT
agxOSG::Text::DROP_SHADOW_TOP_LEFT
Definition:
Text.h:54
agxOSG::Text::CENTER_TOP
Definition:
Text.h:65
agxOSG::Text::DROP_SHADOW_BOTTOM_CENTER
Definition:
Text.h:50
PopDisableWarnings.h
agx::Vec4T
A class holding 4 dimensional vectors and providing basic arithmetic.
Definition:
Vec4Template.h:34
agxOSG::Text::DROP_SHADOW_TOP_RIGHT
Definition:
Text.h:49
agxOSG::Text::LEFT_BASE_LINE
Definition:
Text.h:73
agxOSG::Text::AlignmentType
AlignmentType
Definition:
Text.h:59
agx::AgXString< std::string >
agxOSG::Text::REVERSED_YZ_PLANE
Definition:
Text.h:40
agxOSG::Text::DrawModeMask
DrawModeMask
Definition:
Text.h:86
agxOSG::Text::REVERSED_XY_PLANE
Definition:
Text.h:36
Node.h
agxOSG::Text::RIGHT_TOP
Definition:
Text.h:69
agxOSG::Text::YZ_PLANE
Definition:
Text.h:39
agxOSG::Text::LEFT_TOP
Definition:
Text.h:61
agxOSG::Text::OUTLINE
Definition:
Text.h:55
agxOSG::Text::DROP_SHADOW_CENTER_LEFT
Definition:
Text.h:53
agxOSG::Text::REVERSED_XZ_PLANE
Definition:
Text.h:38
agxOSG::Text::DROP_SHADOW_TOP_CENTER
Definition:
Text.h:51
agxOSG::Text::LEFT_BOTTOM
Definition:
Text.h:63
agxOSG
The agxOSG namespace provides functionality for visualizing AGX simulations with OpenSceneGraph.
agxOSG::Text::DROP_SHADOW_BOTTOM_LEFT
Definition:
Text.h:52
agxOSG::Text::RIGHT_BASE_LINE
Definition:
Text.h:75
agxOSG::Text::RIGHT_BOTTOM
Definition:
Text.h:71
agxOSG::Text::LEFT_BOTTOM_BASE_LINE
Definition:
Text.h:77
agxOSG::Text::BackdropType
BackdropType
Definition:
Text.h:45
agxOSG::Text::XY_PLANE
Definition:
Text.h:35
agxOSG::Text::SCREEN
Definition:
Text.h:41
agxOSG::Text::CENTER_BOTTOM
Definition:
Text.h:67
agx::Vec3T< Real >
agxOSG::Text::XZ_PLANE
Definition:
Text.h:37
PushDisableWarnings.h
export.h
agxOSG::Text::DROP_SHADOW_CENTER_RIGHT
Definition:
Text.h:48
agxOSG::Text::CENTER_BOTTOM_BASE_LINE
Definition:
Text.h:78
agxOSG::Text::AxisAlignment
AxisAlignment
Definition:
Text.h:33
agxOSG::Text::RIGHT_BOTTOM_BASE_LINE
Definition:
Text.h:79
agxOSG::Text::CENTER_BASE_LINE
Definition:
Text.h:74
agxOSG::Text::RIGHT_CENTER
Definition:
Text.h:70
include
agxOSG
Text.h
Generated on Sun Jan 28 2024 11:19:35 for AGX Dynamics by
1.8.13