VR-Forces 4.6 Class Documentation
Home
Modules
Namespaces
Classes
Files
Examples
Behavior Models
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Groups
Pages
include
vrvOsg
DtOsgWidgetLabel.h
Go to the documentation of this file.
1
/*****************************************************************************
2
* Copyright (c) 2012 MAK Technologies, Inc.
3
* All rights reserved.
4
*****************************************************************************/
5
9
10
#pragma once
11
12
#include <
vrvOsg/vrvOsg.h
>
13
14
#include <
vrvCore/DtWidgetLabel.h
>
15
16
#include <
vrvGraphics/DtBoundingBox.h
>
17
18
#include <GL/glew.h>
19
20
#include <osg/ref_ptr>
21
#include <osg/Texture>
22
23
namespace
osg
24
{
25
class
Texture
;
26
}
27
28
namespace
makVrv
29
{
30
31
class
DtSprite;
32
class
DtTextProxy;
33
36
class
DT_DLL_VRVOSG
DtOsgWidgetLabel
:
public
DtWidgetLabel
37
{
38
public
:
39
41
DtOsgWidgetLabel
(
DtDe
& de,
DtUniqueID
id
);
42
44
virtual
~
DtOsgWidgetLabel
();
45
47
virtual
void
setOverlay(
unsigned
int
layer );
48
50
virtual
unsigned
int
overlay()
const
;
51
53
virtual
void
setOrderGroup(
unsigned
int
group );
54
56
virtual
unsigned
int
orderGroup()
const
;
57
59
virtual
void
setPosition(
float
x,
float
y,
float
z,
float
w = 0 );
60
63
virtual
void
setText(
const
DtUnicode
&
string
);
64
66
virtual
void
setFont(
const
std::string& font,
float
size
);
67
69
virtual
void
setFontScale(
float
scale );
70
72
virtual
float
fontScale()
const
;
73
75
virtual
void
setBackgroundImage(
const
std::string&
filename
);
76
virtual
void
setBackgroundImage(
const
std::string& filename,
77
float
left,
float
right,
float
bottom,
float
top );
78
80
virtual
void
setTextColor(
float
r,
float
g,
float
b,
float
a );
81
83
virtual
void
setColor(
float
r,
float
g,
float
b,
float
a );
84
87
virtual
void
setOrigin(
float
originX,
float
originY);
88
90
virtual
void
setSize(
float
w,
float
h);
91
93
virtual
void
getSize
(
float
& width,
float
& height);
94
96
virtual
void
setPadding(
float
paddingX,
float
paddingY );
97
99
virtual
void
setModelDefinition(
const
std::string& str );
100
102
virtual
void
setTextAlignment(
DtWidgetLabel::HorizontalAlignment
ha );
103
105
virtual
void
setGlyphCenterPolicy(
DtWidgetLabel::GlyphCenterPolicy
gcp );
106
108
virtual
void
setEventsEnabled(
bool
enabled );
109
111
virtual
void
setVisible(
bool
visible );
112
115
virtual
void
setBoundsLength(
int
len );
116
118
virtual
void
setRotation(
float
angle );
119
121
virtual
double
getRotation()
const
;
122
125
virtual
void
setSizeConstraints(
SizeConstraints
);
126
protected
:
127
128
void
updateBounds(
bool
calculateText );
129
void
updateTextBounds(
DtBoundingBox
box,
bool
calculateText );
130
void
updateFont(
const
std::string& font );
131
132
protected
:
133
134
osg::ref_ptr<osg::Texture>
myTexture
;
135
DtSprite
*
mySprite
;
136
DtTextProxy
*
myText
;
137
DtBoundingBox
myTextBounds
;
138
unsigned
int
myOverlay
;
139
float
myWidth
;
140
float
myHeight
;
141
float
myOriginX
;
142
float
myOriginY
;
143
float
myPaddingX
;
144
float
myPaddingY
;
145
float
myRotation
;
146
unsigned
int
myGroup
;
147
float
myFontScale
;
148
int
myFontSize
;
149
int
myBoundsLength
;
150
GlyphCenterPolicy
myCenterPolicy
;
151
SizeConstraints
mySizeConstraints
;
152
};
153
154
}
Document ID: Generated on Thu Apr 12 03:15:37 EDT 2018 from SVN revision 187986
Copyright © 2005-2018 VT MÄK. All Rights Reserved (
www.mak.com
)