BALL
1.5.0
include
BALL
VIEW
RENDERING
RENDERERS
XML3DRenderer.h
Go to the documentation of this file.
1
// -*- Mode: C++; tab-width: 2; -*-
2
// vi: set ts=2:
3
//
4
5
#ifndef BALL_VIEW_RENDERING_RENDERERS_XML3DRENDERER_H
6
#define BALL_VIEW_RENDERING_RENDERERS_XML3DRENDERER_H
7
8
#ifndef BALL_VIEW_RENDERING_RENDERERS_RENDERER_H
9
# include <
BALL/VIEW/RENDERING/RENDERERS/renderer.h
>
10
#endif
11
12
#ifndef BALL_SYSTEM_FILE_H
13
# include <
BALL/SYSTEM/file.h
>
14
#endif
15
16
#ifndef BALL_MATHS_VECTOR3_H
17
# include <
BALL/MATHS/vector3.h
>
18
#endif
19
20
#ifndef BALL_MATHS_MATRIX44_H
21
# include <
BALL/MATHS/matrix44.h
>
22
#endif
23
24
#ifndef BALL_MATHS_SURFACE_H
25
# include <
BALL/MATHS/surface.h
>
26
#endif
27
28
namespace
BALL
29
{
30
namespace
VIEW
31
{
32
class
ColorRGBA;
33
class
ClippingPlane;
34
43
class
BALL_DEPRECATED
BALL_VIEW_EXPORT
XML3DRenderer
:
public
Renderer
44
{
45
public
:
46
47
BALL_CREATE
(
XML3DRenderer
)
48
49
struct
XML3DRendererClippingPlane
50
{
51
public
:
52
Vector3
normal
;
53
float
translation
;
54
// Vector3 translation;
55
};
56
60
62
XML3DRenderer
();
63
68
XML3DRenderer
(
const
String
& name);
69
70
XML3DRenderer
(std::ostream& name);
71
72
// Only for Python
73
XML3DRenderer
(
const
XML3DRenderer
& renderer);
74
75
77
virtual
~
XML3DRenderer
();
78
80
virtual
void
clear();
81
83
86
87
virtual
void
setSize(
float
width,
float
height);
88
93
void
setFileName(
const
String
& name);
94
96
void
setOstream(std::ostream& out_stream);
97
99
void
setHumanReadable
(
bool
state)
100
{ human_readable_ = state;}
101
103
bool
isHumanReadable
()
const
104
{
return
human_readable_;}
105
108
String
XML3DColorRGBA(
const
ColorRGBA
& input,
const
String
& name);
109
112
String
XML3DFinish(
const
String
&
object
,
const
ColorRGBA
& input);
113
116
String
XML3DRaytracingMaterial(
const
Stage::Material
&
/* input */
);
117
120
String
XML3DVector3(
Vector3
input);
121
124
String
XML3DString(
const
String
& input);
125
126
virtual
bool
renderOneRepresentation(
const
Representation
& representation);
127
129
133
136
virtual
bool
init(
Scene
& scene);
137
141
virtual
bool
init(
const
Stage
& stage,
float
width,
float
height);
142
146
virtual
bool
finish();
147
148
void
createXHTMLHeader();
149
150
void
createXHTMLFooter();
151
152
void
renderSphere_(
const
Sphere
& sphere);
153
154
void
renderDisc_(
const
Disc
&
/* disc */
);
155
156
void
renderTube_(
const
Tube
&
/* tube */
);
157
158
void
renderTwoColoredTube_(
const
TwoColoredTube
& tube);
159
160
void
renderMesh_(
const
Mesh
& mesh);
161
162
void
renderTwoColoredLine_(
const
TwoColoredLine
&
/* line */
);
163
164
void
renderLine_(
const
Line
&
/* line */
);
165
166
void
renderPoint_(
const
Point
&
/* point */
);
167
168
// do nothing
169
void
renderLabel_(
const
Label
&);
170
172
virtual
void
renderMultiLine_(
const
MultiLine
& line);
173
175
176
protected
:
177
178
const
ColorRGBA
& getColor_(
const
GeometricObject
&
object
);
179
180
std::ostream*
outfile_
;
181
String
trimFloatValue_(
float
value);
182
void
storeColor_(
const
GeometricObject
&
object
);
183
String
getColorIndex_(
const
ColorRGBA
& color);
184
void
createTubeTransform_(
const
TwoColoredTube
& tube);
185
void
createSphereTemplate_();
186
187
188
Vector3
origin_
;
189
Matrix4x4
rotation_
;
190
vector<ClippingPlane*>
clipping_planes_
;
191
bool
human_readable_
;
192
193
typedef
HashMap<String, Size>
ColorMap
;
194
ColorMap
color_map_
;
195
vector<const Representation*>
representations_
;
196
HashSet<const Mesh*>
wireframes_
;
197
HashSet<String>
color_strings_
;
198
double
m_[12];
199
Position
color_index_
;
200
bool
create_XHTML_
;
201
202
Surface
sphere_template_
;
203
Surface
tube_template_
;
204
205
Stage::Material
rt_material_
;
206
207
Index
current_sphere_number_
;
208
Index
current_tube_number_
;
209
210
float
fov_x_
;
211
float
fov_y_
;
212
};
213
214
}
// namespace BALL
215
}
// namespace VIEW
216
217
#endif // BALL_VIEW_RENDERING_XML3DRENDERER_H
BALL::VIEW::XML3DRenderer::outfile_
std::ostream * outfile_
Definition:
XML3DRenderer.h:180
BALL::VIEW::XML3DRenderer::representations_
vector< const Representation * > representations_
Definition:
XML3DRenderer.h:195
BALL::VIEW::XML3DRenderer::fov_x_
float fov_x_
Definition:
XML3DRenderer.h:210
BALL::VIEW::Stage
Definition:
stage.h:238
BALL_INDEX_TYPE
BALL_VIEW_EXPORT
#define BALL_VIEW_EXPORT
Definition:
COMMON/global.h:52
BALL::VIEW::Sphere
Definition:
sphere.h:30
BALL::HashSet
Definition:
hashSet.h:45
BALL::VIEW::XML3DRenderer::fov_y_
float fov_y_
Definition:
XML3DRenderer.h:211
BALL::TSurface< float >
BALL::VIEW::XML3DRenderer::color_index_
Position color_index_
Definition:
XML3DRenderer.h:199
BALL::HashMap< String, Size >
vector3.h
BALL::VIEW::MultiLine
Definition:
multiLine.h:30
BALL::VIEW::Renderer
Definition:
renderer.h:54
BALL::VIEW::XML3DRenderer::clipping_planes_
vector< ClippingPlane * > clipping_planes_
Definition:
XML3DRenderer.h:190
BALL::VIEW::TwoColoredLine
Definition:
twoColoredLine.h:45
BALL::TVector3< float >
BALL_SIZE_TYPE
BALL::VIEW::XML3DRenderer::tube_template_
Surface tube_template_
Definition:
XML3DRenderer.h:203
BALL::VIEW::XML3DRenderer::wireframes_
HashSet< const Mesh * > wireframes_
Definition:
XML3DRenderer.h:196
BALL::TMatrix4x4< float >
file.h
BALL::VIEW::Mesh
Definition:
mesh.h:38
BALL
Definition:
constants.h:12
BALL::VIEW::XML3DRenderer::current_sphere_number_
Index current_sphere_number_
Definition:
XML3DRenderer.h:207
BALL::String
Definition:
string.h:56
BALL::VIEW::Representation
Definition:
representation.h:57
BALL::VIEW::Stage::Material
Definition:
stage.h:244
BALL::VIEW::Label
Definition:
label.h:45
BALL_DEPRECATED
#define BALL_DEPRECATED
Definition:
COMMON/global.h:64
BALL::VIEW::XML3DRenderer::human_readable_
bool human_readable_
Definition:
XML3DRenderer.h:191
BALL::VIEW::XML3DRenderer::XML3DRendererClippingPlane
Definition:
XML3DRenderer.h:49
BALL::VIEW::Scene
Definition:
scene.h:138
BALL::VIEW::TwoColoredTube
Definition:
twoColoredTube.h:45
BALL::VIEW::XML3DRenderer::XML3DRendererClippingPlane::normal
Vector3 normal
Definition:
XML3DRenderer.h:52
BALL::VIEW::XML3DRenderer::sphere_template_
Surface sphere_template_
Definition:
XML3DRenderer.h:202
BALL::VIEW::XML3DRenderer::rt_material_
Stage::Material rt_material_
Definition:
XML3DRenderer.h:205
BALL::VIEW::XML3DRenderer::setHumanReadable
void setHumanReadable(bool state)
Definition:
XML3DRenderer.h:99
BALL::VIEW::ColorRGBA
Definition:
colorRGBA.h:31
BALL::VIEW::Disc
Definition:
disc.h:29
renderer.h
BALL::VIEW::XML3DRenderer::color_strings_
HashSet< String > color_strings_
Definition:
XML3DRenderer.h:197
BALL::VIEW::XML3DRenderer::color_map_
ColorMap color_map_
Definition:
XML3DRenderer.h:194
BALL::VIEW::XML3DRenderer::ColorMap
HashMap< String, Size > ColorMap
Definition:
XML3DRenderer.h:193
matrix44.h
BALL::VIEW::XML3DRenderer::rotation_
Matrix4x4 rotation_
Definition:
XML3DRenderer.h:189
BALL::VIEW::XML3DRenderer
Definition:
XML3DRenderer.h:43
BALL::VIEW::GeometricObject
Definition:
geometricObject.h:36
BALL::VIEW::Tube
Definition:
tube.h:37
BALL::VIEW::XML3DRenderer::XML3DRendererClippingPlane::translation
float translation
Definition:
XML3DRenderer.h:53
BALL_CREATE
#define BALL_CREATE(name)
Definition:
create.h:62
BALL::VIEW::XML3DRenderer::origin_
Vector3 origin_
Definition:
XML3DRenderer.h:188
BALL::VIEW::XML3DRenderer::current_tube_number_
Index current_tube_number_
Definition:
XML3DRenderer.h:208
surface.h
BALL::VIEW::Point
Definition:
point.h:34
BALL::VIEW::Line
Definition:
line.h:35
BALL::VIEW::XML3DRenderer::isHumanReadable
bool isHumanReadable() const
Definition:
XML3DRenderer.h:103
BALL::VIEW::XML3DRenderer::create_XHTML_
bool create_XHTML_
Definition:
XML3DRenderer.h:200
Generated by
1.8.16