5 #ifndef BALL_VIEW_RENDERING_RENDERERS_GLRENDERER_H
6 #define BALL_VIEW_RENDERING_RENDERERS_GLRENDERER_H
8 #ifndef BALL_VIEW_RENDERING_RENDERERS_RENDERER_H
12 #ifndef BALL_MATHS_QUATERNION_H
16 #ifndef BALL_VIEW_DATATYPE_COLORRGBA_H
20 #ifndef BALL_VIEW_KERNEL_GEOMETRICOBJECT_H
24 #ifndef BALL_VIEW_KERNEL_STAGE_H
32 #ifndef BALL_VIEW_RENDERING_GLDISPLAYLIST_H
36 #ifndef BALL_DATATYPE_REGULARDATA3D_H
50 #define BALL_GLRENDERER_PICKING_NUMBER_OF_MAX_OBJECTS 1000000
73 RENDER_MODE_UNDEFINED = 0,
82 RENDER_MODE_ALWAYS_FRONT
109 WrongModes(
const char* file,
int line,
int mode,
int precision);
122 virtual void clear();
125 void dump(std::ostream& s,
Size depth)
const;
136 virtual bool init(
const Stage& stage,
float width,
float height);
139 virtual void setLights(
bool reset_all =
false);
143 virtual void setSmoothLines(
bool smooth_lines);
144 virtual bool getSmoothLines();
149 std::list<GeometricObject*>& objects);
160 void pickObjects2(std::list<GeometricObject*>& objects);
164 void setFogIntensity(
float intensity);
167 void enterPickingMode();
170 void exitPickingMode();
173 void setSize(
float width,
float height);
176 float getXScale()
const;
179 float getYScale()
const;
182 virtual void updateBackgroundColor();
185 void initTransparent();
191 void initAlwaysFront();
194 void setAntialiasing(
bool state);
218 virtual void renderToBuffer(
RenderTarget* renderTarget, BufferMode);
221 virtual bool render(
const Representation& representation,
bool for_display_list =
false);
223 virtual void bufferingDependentRender_(
const Representation& repr, BufferMode mode);
228 bool isExtensionSupported(
const String& extension)
const;
234 bool vertexBuffersSupported()
const;
243 String getOpenGLVersion();
246 vector<String> getExtensions();
249 bool runningOnVirtualBox();
252 bool enableVertexBuffers(
bool state);
255 bool vertexBuffersEnabled()
const;
261 void initPerspective();
264 void setProjection();
267 void setColorRGBA_(
const ColorRGBA& color);
270 void vertexVector3_(
const Vector3& v);
273 void updateCamera(
const Camera* camera = 0);
276 void setupStereo(
float eye_separation,
float focal_length);
281 virtual void getFrustum(
float& near_f,
float& far_f,
float& left_f,
float& right_f,
float& top_f,
float& bottom_f);
290 bool mapViewplaneToScreen_();
292 void renderRepresentation_(
const Representation& representation,
bool for_display_list);
295 void renderRepresentations_(BufferMode mode);
298 virtual void renderLabel_(
const Label& );
301 virtual void renderLine_(
const Line& );
304 virtual void renderMultiLine_(
const MultiLine& line);
307 virtual void renderMesh_(
const Mesh& );
310 virtual void renderQuadMesh_(
const QuadMesh& );
313 void initDrawingMeshes_();
316 void initDrawingOthers_();
325 virtual void renderRuler();
328 virtual void renderPoint_(
const Point& );
331 virtual void renderSimpleBox_(
const SimpleBox& );
334 virtual void renderBox_(
const Box& );
337 virtual void renderSphere_(
const Sphere& );
340 virtual void renderDisc_(
const Disc& );
343 virtual void renderTube_(
const Tube& );
352 virtual void renderClippingPlane_(
const ClippingPlane& plane);
361 void createSpheres_();
370 void createDottedSphere_(
int precision);
376 void createLineBox_();
379 void createDotBox_();
382 void createSolidBox_();
388 void normalVector3_(
const Vector3& v);
392 void translateVector3_(
const Vector3& v);
396 { glTexCoord3f(v.
x, v.
y, v.
z); }
399 void scaleVector3_(
const Vector3& v);
402 void rotateVector3Angle_(
const Vector3& v,
Real angle);
405 void scale_(
float f);
411 void setOrthographicZoom(
float orthographic_zoom);
414 float getOrthographicZoom(
void);
417 void generateIlluminationTexture_(
float ka,
float kd,
float kr,
float shininess);
455 GLubyte line_tex_[128][128][4];
488 # ifndef BALL_NO_INLINE_FUNCTIONS
489 # include <BALL/VIEW/RENDERING/RENDERERS/glRenderer.iC>
495 #endif // BALL_VIEW_RENDERING_GLRENDERER_H
GLDisplayList * sphere_list_
unsigned int Name
Typedef for OPENGL names.
DrawingMode
Enumeration for Drawing Modes.
void setRenderMode(RenderMode mode)
DrawingMode drawing_mode_
HashMap< Name, const GeometricObject * > GeometricObjectHashMap
GLUquadricObj * GLU_quadric_obj_
HashMap< const GeometricObject *, Name > NameHashMap
void updateMaterialForRepresentation(Representation const *rep)
bool drawed_other_object_
MeshBufferHashMap rep_to_buffers_
HashMap< const RegularData3D *, Position > grid_to_texture_
Render the contents of the display lists.
GeometricObjectHashMap name_to_object_
virtual bool init(Scene &scene)
GLDisplayList * GL_boxes_list_
#define BALL_GLRENDERER_PICKING_NUMBER_OF_MAX_OBJECTS
GLDisplayList * GL_tubes_list_
HashMap< const Representation *, vector< MeshBuffer * > > MeshBufferHashMap
void texCoordVector3_(const Vector3 &v)
NameHashMap object_to_name_
Position display_lists_index_
DisplayListHashMap display_lists_
GLDisplayList * GL_spheres_list_
GLuint line_texture_bind_
HashMap< const Representation *, GLDisplayList * > DisplayListHashMap