VR-Vantage API Documentation
Home
Modules
Namespaces
Classes
Files
Examples
Tutorials
File List
File Members
include
vrvGraphics
DtTextRenderer.h
Go to the documentation of this file.
1
/*****************************************************************************
2
* Copyright (c) 2011 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
DtTexturedGlyphRenderer;
26
class
DtOverlayResourceProvider;
27
class
DtProjected2DTexturedEffect;
28
typedef
boost::weak_ptr<DtFont>
DtFontWP
;
29
typedef
boost::shared_ptr<DtFont>
DtFontSP
;
30
33
class
DT_DLL_VRVGRAPHICS
DtTextRenderer
:
public
DtPrimitiveRenderer
34
{
35
public
:
36
37
friend
class
DtTextProxy
;
38
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
61
void
render(
bool
geocentric,
float
geocentricAlpha,
62
const
double
location[3],
const
double
positionMatrix[16] );
63
65
void
addGroupRef(
unsigned
int
);
66
68
void
removeGroupRef(
unsigned
int
);
69
70
protected
:
71
73
void
deleteProxy(
DtTextProxy
* );
74
75
protected
:
76
77
typedef
std::vector<DtTextProxy*>
TextProxyList
;
78
TextProxyList
myProxyList
;
79
DtTexturedGlyphRenderer
*
myGlyphRenderer
;
80
DtProjected2DTexturedEffect
*
myEffect
;
81
82
};
83
84
87
class
DT_DLL_VRVGRAPHICS
DtTextProxy
88
{
89
public
:
90
91
friend
class
DtTextRenderer
;
92
94
~
DtTextProxy
();
95
97
void
setAlignment(
DtFont::TextAlignement
alignment );
98
100
void
setPosition(
float
x,
float
y,
float
z,
float
w = 0 );
101
103
void
setRotation(
float
angle );
104
106
void
setColor(
float
r,
float
g,
float
b,
float
a );
107
109
void
setString(
const
DtUnicode
& str );
110
112
const
DtUnicode
& string()
const
;
113
115
void
setFont(
DtFontSP
font );
116
118
DtFontSP
font();
119
121
void
setBounds(
const
DtBoundingBox
& box );
122
124
void
setGroup(
unsigned
int
group );
125
127
unsigned
int
group()
const
;
128
129
protected
:
130
132
DtTextProxy
(
DtTextRenderer
* parent );
133
135
DtTextProxy
* clone(
DtTextRenderer
* parent )
const
;
136
137
protected
:
138
139
DtTextRenderer
*
myParent
;
140
141
float
myRotation
;
142
float
myPosition[4];
143
float
myColor[4];
144
unsigned
int
myGroup
;
145
146
DtFont::TextAlignement
myAlignment
;
147
DtUnicode
myString
;
148
DtBoundingBox
myBounds
;
149
DtFontSP
myFont
;
150
151
};
152
153
}
Copyright © 2005-2013 VT MÄK Inc. All Rights Reserved (
www.mak.com
)