VR-Forces 4.5 Class Documentation
Home
Modules
Namespaces
Classes
Files
Examples
Behavior Models
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Groups
Pages
include
vrvGraphics
DtTextRenderer.h
Go to the documentation of this file.
1
/*****************************************************************************
2
* Copyright (c) 2014 MAK Technologies, Inc.
3
* All rights reserved.
4
*****************************************************************************/
5
9
10
#pragma once
11
12
#include <
vrvGraphics/vrvGraphics.h
>
13
#include <
vrvGraphics/DtPrimitiveRenderer.h
>
14
#include <
vrvGraphics/DtBoundingBox.h
>
15
#include <
vrvGraphics/DtTextured2DRenderer.h
>
16
#include <
vrvGraphics/DtFont.h
>
17
18
#include <
vrvUtil/DtUnicode.h
>
19
20
namespace
makVrv
21
{
22
23
class
Dt2DEffect;
24
class
DtTextProxy;
25
class
DtTextLayoutInterface;
26
class
DtTexturedGlyphRenderer;
27
class
DtOverlayResourceProvider;
28
class
DtProjected2DTexturedEffect;
29
typedef
boost::weak_ptr<DtFont>
DtFontWP
;
30
typedef
boost::shared_ptr<DtFont>
DtFontSP
;
31
32
class
DtBufferObject;
33
36
class
DT_DLL_VRVGRAPHICS
DtTextRenderer
:
public
DtPrimitiveRenderer
37
{
38
public
:
40
DtTextRenderer
(
DtOverlayResourceProvider
& provider );
41
43
~
DtTextRenderer
();
44
46
DtTextProxy
* createProxy();
47
49
DtTextProxy
* cloneProxy(
const
DtTextProxy
* );
50
52
virtual
int
numberOfPrimitives()
const
;
53
55
virtual
void
releaseResources();
56
58
virtual
bool
isRenderModeSupported(
int
mode
);
59
60
bool
forceTextShaping(
void
)
const
;
61
63
void
render(
bool
geocentric,
float
geocentricAlpha,
64
const
double
location[3]
65
,
const
double
positionMatrix[16]
66
,
const
double
projectionMatrix[16] );
67
69
void
addGroupRef(
unsigned
int
);
70
72
void
removeGroupRef(
unsigned
int
);
73
75
void
deleteProxy(
DtTextProxy
* );
76
77
protected
:
78
79
typedef
std::vector<DtTextProxy*>
TextProxyList
;
80
TextProxyList
myProxyList
;
81
DtTexturedGlyphRenderer
*
myGlyphRenderer
;
82
DtProjected2DTexturedEffect
*
myEffect
;
83
84
DtBufferObject
*
myBufferObject
;
85
};
86
87
90
class
DT_DLL_VRVGRAPHICS
DtTextProxy
91
{
92
public
:
93
95
DtTextProxy
(
DtTextRenderer
* parent );
96
98
DtTextProxy
* clone(
DtTextRenderer
* parent )
const
;
99
101
virtual
~
DtTextProxy
();
102
104
void
setAlignment(
DtFont::TextAlignement
alignment );
105
107
DtFont::TextAlignement
alignment
()
const
{
return
myAlignment; };
108
110
void
setParent(
DtTextRenderer
*);
111
113
void
setPosition(
float
x,
float
y,
float
z,
float
w = 0 );
114
116
const
float
* position()
const
;
117
119
void
setRotation(
float
angle );
120
122
float
rotation()
const
;
123
125
void
setColor(
float
r,
float
g,
float
b,
float
a );
126
128
const
float
* color()
const
;
129
132
void
setString(
const
DtUnicode
& str );
133
135
const
DtUnicode
& string()
const
;
136
138
void
setFont(
DtFontSP
font );
139
141
DtFontSP
font()
const
;
142
144
Dt2dPoint
calculateGlyphSize(
const
DtPen
& pen,
145
const
DtUnicode
&
string
,
unsigned
int
pos = 0,
int
len = -1);
146
148
DtBoundingBox
calculateBoundingBox(
const
DtPen
& pen,
149
const
DtUnicode
&
string
,
unsigned
int
pos = 0,
int
len = -1);
150
152
void
setBounds(
const
DtBoundingBox
& box );
153
155
const
DtBoundingBox
& bounds()
const
;
156
158
void
setGroup(
unsigned
int
group );
159
161
unsigned
int
group()
const
;
162
164
virtual
void
renderText(
DtTexturedGlyphRenderer
*);
165
166
protected
:
167
168
DtTextRenderer
*
myParent
;
169
170
float
myRotation
;
171
float
myPosition[4];
172
float
myColor[4];
173
unsigned
int
myGroup
;
174
175
DtFont::TextAlignement
myAlignment
;
176
DtUnicode
myString
;
177
DtBoundingBox
myBounds
;
178
DtFontSP
myFont
;
179
DtTextLayoutInterface
*
myTextLayout
;
180
181
void
makeOrChangeTextLayout(
const
DtUnicode
& str);
182
};
183
184
}
Document ID: Generated on Thu Mar 23 18:54:12 EDT 2017 from SVN revision 174804
Copyright © 2005-2017 VT MÄK. All Rights Reserved (
www.mak.com
)