BALL  1.4.79
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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
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 
42  {
43  public:
44 
46 
48  {
49  public:
51  float translation;
52 // Vector3 translation;
53  };
54 
58 
60  XML3DRenderer();
61 
65  XML3DRenderer(const String& name)
67 
68  XML3DRenderer(std::ostream& name);
69 
70  // Only for Python
71  XML3DRenderer(const XML3DRenderer& renderer);
72 
73 
75  virtual ~XML3DRenderer();
76 
78  virtual void clear();
79 
81 
84 
85  virtual void setSize(float width, float height);
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::Material& 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 
193  vector<const Representation*> representations_;
196  double m_[12];
199 
202 
204 
207 
208  float fov_x_;
209  float fov_y_;
210  };
211 
212  } // namespace BALL
213 } // namespace VIEW
214 
215 #endif // BALL_VIEW_RENDERING_XML3DRENDERER_H
void setHumanReadable(bool state)
Definition: XML3DRenderer.h:97
#define BALL_CREATE(name)
Definition: create.h:62
bool isHumanReadable() const
HashSet< const Mesh * > wireframes_
Stage::Material rt_material_
#define BALL_VIEW_EXPORT
Definition: COMMON/global.h:52
HashSet< String > color_strings_
HashMap< String, Size > ColorMap
vector< ClippingPlane * > clipping_planes_
vector< const Representation * > representations_