BALL  1.5.0
VRMLRenderer.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_VRMLRENDERER_H
6 #define BALL_VIEW_RENDERING_RENDERERS_VRMLRENDERER_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 namespace BALL
25 {
26  namespace VIEW
27  {
28  class ColorRGBA;
29 
41 {
42  public:
43 
47 
50 
55  VRMLRenderer(const String& name);
56 
58  virtual ~VRMLRenderer();
59 
61  virtual void clear();
62 
64 
67 
72  void setFileName(const String& name);
73 
77 
81 
83  void VRMLColor(const ColorRGBA& color);
84 
86 
89 
93  virtual bool init(const Stage& stage);
94 
98  virtual bool finish();
99 
101 
102  void renderSphere_(const Sphere& sphere);
103 
104  void renderMesh_(const Mesh& mesh);
105 
106  void renderLine_(const Line& miniTube);
107 
108  void renderTwoColoredLine_(const TwoColoredLine& miniTube);
109 
110  void renderTube_(const Tube& tube);
111 
113 
114  void out_(const String& data);
115 
116  void outheader_(const String& data)
117  {out_(data); current_indent_ += 1;}
118 
119  void outfinish_(const String& data)
120  {out_(data); current_indent_ -= 1;}
121 
122  Size width, height;
123 
124  protected:
125 
126  void header_(const Vector3& translation, const ColorRGBA& color,
127  const String& rotation = "");
128 
129  void footer_();
130 
132 
136 
137  //size estimate for afterwards scaling for printing
138  float smallX, smallY, smallZ, bigX, bigY, bigZ;
139 
140  //boolean showing if scaling is relevant afterall
142 };
143 
144 } } // namespaces
145 
146 #endif // BALL_VIEW_RENDERING_VRMLRENDERER_H
Definition: constants.h:13
BALL_INDEX_TYPE Index
void renderTube_(const Tube &tube)
Render a tube.
void header_(const Vector3 &translation, const ColorRGBA &color, const String &rotation="")
void out_(const String &data)
String VRMLVector3(Vector3 input)
void outfinish_(const String &data)
Definition: VRMLRenderer.h:119
void renderLine_(const Line &miniTube)
Render a line.
virtual bool init(const Stage &stage)
void renderMesh_(const Mesh &mesh)
Render a surface mesh.
void renderSphere_(const Sphere &sphere)
Render a sphere.
void outheader_(const String &data)
Definition: VRMLRenderer.h:116
VRMLRenderer(const String &name)
VRMLRenderer()
Default constructor.
void VRMLColor(const ColorRGBA &color)
void renderTwoColoredTube_(const TwoColoredTube &tube)
Render a tube with two colors.
void setFileName(const String &name)
void renderTwoColoredLine_(const TwoColoredLine &miniTube)
Render a line with two colors.
String VRMLColorRGBA(const ColorRGBA &input)
virtual void clear()
Clear method.
virtual ~VRMLRenderer()
Destructor.
#define BALL_DEPRECATED
Definition: COMMON/global.h:64
#define BALL_VIEW_EXPORT
Definition: COMMON/global.h:52