VR-Forces 4.1 Class Documentation
Home
Modules
Namespaces
Classes
Files
Examples
Behavior Models
File List
File Members
include
vrvGraphics
DtTriangleRenderer.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
14
#include <
vrvGraphics/DtPrimitiveRenderer.h
>
15
16
#include <vector>
17
18
namespace
makVrv
19
{
20
21
class
DtBufferObject;
22
class
DtTriangleProxy;
23
class
DtPrimitiveStyle;
24
27
class
DT_DLL_VRVGRAPHICS
DtTriangleRenderer
:
public
DtPrimitiveRenderer
28
{
29
public
:
30
31
enum
Styles
32
{
33
Style_Flat = 0,
34
Style_Stippled
,
35
//Style_Textured,
36
Styles_End
37
};
38
39
friend
class
DtTriangleProxy
;
40
42
DtTriangleRenderer
(
DtOverlayResourceProvider
& resourceProvider );
43
45
virtual
~
DtTriangleRenderer
();
46
48
virtual
int
numberOfPrimitives()
const
;
49
51
virtual
void
render(
bool
geocentric,
float
geocentricAlpha,
52
const
double
location[3],
const
double
positionMatrix[16] );
53
55
virtual
void
releaseResources();
56
58
virtual
bool
isRenderModeSupported(
int
mode );
59
61
DtTriangleProxy
* allocateProxy(
Styles
= Style_Flat);
62
63
protected
:
64
66
void
add(
DtTriangleProxy
* toAdd );
67
69
void
remove
(
const
DtTriangleProxy
*
const
proxy,
70
bool
isBeingDeleted = false );
71
73
void
dirty(
DtTriangleProxy
* proxy );
74
76
void
updateRenderData();
77
78
protected
:
79
80
typedef
std::vector<DtTriangleProxy*>
TriangleProxyList
;
81
82
DtPrimitiveStyle
* myStyles[Styles_End];
83
TriangleProxyList
myTriangles
;
84
TriangleProxyList
myDirtyList
;
85
86
};
87
88
92
class
DT_DLL_VRVGRAPHICS
DtTriangleProxy
93
{
94
public
:
95
96
friend
class
DtTriangleRenderer
;
97
99
~
DtTriangleProxy
();
100
102
void
setGroup(
float
order );
103
105
float
group()
const
;
106
108
void
set3DPositions(
109
float
x1,
float
y1,
float
z1,
float
w1,
110
float
x2,
float
y2,
float
z2,
float
w2,
111
float
x3,
float
y3,
float
z3,
float
w3 );
112
116
void
set3DPosition(
float
x,
float
y,
float
z,
float
w );
117
119
void
set3DPosition(
unsigned
int
index,
float
x,
float
y,
float
z,
120
float
w );
121
123
void
get3DPosition(
unsigned
int
index,
float
& x,
float
& y,
float
& z,
124
float
& w );
125
127
void
set2DPositions(
float
x1,
float
y1,
float
x2,
float
y2,
float
x3,
float
y3 );
128
130
void
set2DPosition(
unsigned
int
index,
float
x,
float
y );
131
133
void
get2DPosition(
unsigned
int
index,
float
& x,
float
& y )
const
;
134
136
void
setStyle(
int
style );
137
139
int
style()
const
;
140
142
void
setColor(
unsigned
int
vertIndex,
float
r,
float
g,
float
b,
143
float
a );
144
146
void
setColor(
float
r,
float
g,
float
b,
float
a );
147
149
void
getColor(
float
& r,
float
& g,
float
& b,
float
& a )
const
;
150
152
void
setFillParameters(
unsigned
int
fill,
153
unsigned
int
fullStipplePattern[32] = 0 );
154
156
void
setIndex(
unsigned
int
index );
157
159
unsigned
int
index()
const
;
160
161
protected
:
162
164
DtTriangleProxy
(
DtTriangleRenderer
& renderer,
unsigned
int
style );
165
166
protected
:
167
168
DtTriangleRenderer
*
myParent
;
169
unsigned
int
myIndex
;
170
unsigned
char
myStyle
;
171
bool
myDirtyBit
;
172
173
};
174
175
}
Document ID: Generated on Tue Jan 29 18:21:16 EST 2013 from SVN revision 123193
Copyright © 2005-2013 VT MÄK Inc. All Rights Reserved (
www.mak.com
)