BALL  1.4.79
XML3DRenderer.h
Go to the documentation of this file.
1 // -*- Mode: C++; tab-width: 2; -*-
2 // vi: set ts=2:
3 //
4 // $Id: XML3DRenderer.h,v 1.12.16.1 2007/03/25 21:26:13 oliver Exp $
5 //
6 
7 #ifndef BALL_VIEW_RENDERING_RENDERERS_XML3DRENDERER_H
8 #define BALL_VIEW_RENDERING_RENDERERS_XML3DRENDERER_H
9 
10 #ifndef BALL_VIEW_RENDERING_RENDERERS_RENDERER_H
12 #endif
13 
14 #ifndef BALL_SYSTEM_FILE_H
15 # include <BALL/SYSTEM/file.h>
16 #endif
17 
18 #ifndef BALL_MATHS_VECTOR3_H
19 # include <BALL/MATHS/vector3.h>
20 #endif
21 
22 #ifndef BALL_MATHS_MATRIX44_H
23 # include <BALL/MATHS/matrix44.h>
24 #endif
25 
26 #ifndef BALL_MATHS_SURFACE_H
27 # include <BALL/MATHS/surface.h>
28 #endif
29 
30 namespace BALL
31 {
32  namespace VIEW
33  {
34  class ColorRGBA;
35  class ClippingPlane;
36 
44  {
45  public:
46 
48 
50  {
51  public:
53  float translation;
54 // Vector3 translation;
55  };
56 
60 
62  XML3DRenderer();
63 
67  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 
90  void setFileName(const String& name)
92 
94  void setOstream(std::ostream& out_stream);
95 
97  void setHumanReadable(bool state)
98  { human_readable_ = state;}
99 
101  bool isHumanReadable() const
102  { return human_readable_;}
103 
106  String XML3DColorRGBA(const ColorRGBA& input, const String& name);
107 
110  String XML3DFinish(const String& object, const ColorRGBA& input);
111 
114  String XML3DRaytracingMaterial(const Stage::RaytracingMaterial& input);
115 
118  String XML3DVector3(Vector3 input);
119 
122  String XML3DString(const String& input);
123 
124  virtual bool renderOneRepresentation(const Representation& representation);
125 
127 
131 
134  virtual bool init(Scene& scene);
135 
139  virtual bool init(const Stage& stage, float width, float height);
140 
144  virtual bool finish();
145 
146  void createXHTMLHeader();
147 
148  void createXHTMLFooter();
149 
150  void renderSphere_(const Sphere& sphere);
151 
152  void renderDisc_(const Disc& disc);
153 
154  void renderTube_(const Tube& tube);
155 
156  void renderTwoColoredTube_(const TwoColoredTube& tube);
157 
158  void renderMesh_(const Mesh& mesh);
159 
160  void renderTwoColoredLine_(const TwoColoredLine& line);
161 
162  void renderLine_(const Line& line);
163 
164  void renderPoint_(const Point& point);
165 
166  // do nothing
167  void renderLabel_(const Label&);
168 
170  virtual void renderMultiLine_(const MultiLine& line);
171 
173 
174  protected:
175 
176  const ColorRGBA& getColor_(const GeometricObject& object);
177 
178  std::ostream* outfile_;
179  String trimFloatValue_(float value);
180  void storeColor_(const GeometricObject& object);
181  String getColorIndex_(const ColorRGBA& color);
182  void createTubeTransform_(const TwoColoredTube& tube);
183  void createSphereTemplate_();
184 
185 
188  vector<ClippingPlane*> clipping_planes_;
190 
192  ColorMap color_map_;
193  vector<const Representation*> representations_;
196  double m_[12];
199 
202 
204  };
205 
206  } // namespace BALL
207 } // namespace VIEW
208 
209 #endif // BALL_VIEW_RENDERING_XML3DRENDERER_H
void setHumanReadable(bool state)
Definition: XML3DRenderer.h:97
#define BALL_CREATE(name)
Definition: create.h:62
Stage::RaytracingMaterial rt_material_
bool isHumanReadable() const
HashSet< const Mesh * > wireframes_
#define BALL_VIEW_EXPORT
Definition: COMMON/global.h:52
HashSet< String > color_strings_
-*- Mode: C++; tab-width: 2; -*-
Definition: constants.h:12
HashMap< String, Size > ColorMap
vector< ClippingPlane * > clipping_planes_
vector< const Representation * > representations_