Go to the documentation of this file.
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
30 #elif defined(BALL_OS_DARWIN)
31 # include <OpenGL/gl.h>
32 # include <OpenGL/glu.h>
38 #ifndef BALL_VIEW_RENDERING_GLDISPLAYLIST_H
42 #ifndef BALL_DATATYPE_REGULARDATA3D_H
56 #define BALL_GLRENDERER_PICKING_NUMBER_OF_MAX_OBJECTS 1000000
79 RENDER_MODE_UNDEFINED = 0,
88 RENDER_MODE_ALWAYS_FRONT
102 REBUILD_DISPLAY_LISTS
128 virtual void clear();
131 void dump(std::ostream& s,
Size depth)
const;
142 virtual bool init(
const Stage& stage,
float width,
float height);
145 virtual void setLights(
bool reset_all =
false);
149 virtual void setSmoothLines(
bool smooth_lines);
150 virtual bool getSmoothLines();
155 std::list<GeometricObject*>& objects);
166 void pickObjects2(std::list<GeometricObject*>& objects);
170 void setFogIntensity(
float intensity);
173 void enterPickingMode();
176 void exitPickingMode();
179 void setSize(
float width,
float height);
182 float getXScale()
const;
185 float getYScale()
const;
188 virtual void updateBackgroundColor();
191 void initTransparent();
197 void initAlwaysFront();
200 void setAntialiasing(
bool state);
224 virtual void renderToBuffer(
RenderTarget* renderTarget, BufferMode);
227 virtual bool render(
const Representation& representation,
bool for_display_list =
false);
229 virtual void bufferingDependentRender_(
const Representation& repr, BufferMode mode);
234 bool isExtensionSupported(
const String& extension)
const;
240 bool vertexBuffersSupported()
const;
249 String getOpenGLVersion();
252 vector<String> getExtensions();
255 bool runningOnVirtualBox();
258 bool enableVertexBuffers(
bool state);
261 bool vertexBuffersEnabled()
const;
267 void initPerspective();
270 void setProjection();
273 void setColorRGBA_(
const ColorRGBA& color);
276 void vertexVector3_(
const Vector3& v);
279 void updateCamera(
const Camera* camera = 0);
282 void setupStereo(
float eye_separation,
float focal_length);
287 virtual void getFrustum(
float& near_f,
float& far_f,
float& left_f,
float& right_f,
float& top_f,
float& bottom_f);
296 bool mapViewplaneToScreen_();
298 void renderRepresentation_(
const Representation& representation,
bool for_display_list);
301 void renderRepresentations_(BufferMode mode);
304 virtual void renderLabel_(
const Label& );
307 virtual void renderLine_(
const Line& );
310 virtual void renderMultiLine_(
const MultiLine& line);
313 virtual void renderMesh_(
const Mesh& );
316 virtual void renderQuadMesh_(
const QuadMesh& );
319 void initDrawingMeshes_();
322 void initDrawingOthers_();
331 virtual void renderRuler();
334 virtual void renderPoint_(
const Point& );
337 virtual void renderSimpleBox_(
const SimpleBox& );
340 virtual void renderBox_(
const Box& );
343 virtual void renderSphere_(
const Sphere& );
346 virtual void renderDisc_(
const Disc& );
349 virtual void renderTube_(
const Tube& );
358 virtual void renderClippingPlane_(
const ClippingPlane& plane);
367 void createSpheres_();
382 void createLineBox_();
385 void createDotBox_();
388 void createSolidBox_();
394 void normalVector3_(
const Vector3& v);
398 void translateVector3_(
const Vector3& v);
402 { glTexCoord3f(v.
x, v.
y, v.
z); }
405 void scaleVector3_(
const Vector3& v);
408 void rotateVector3Angle_(
const Vector3& v,
Real angle);
411 void scale_(
float f);
417 void setOrthographicZoom(
float orthographic_zoom);
420 float getOrthographicZoom(
void);
423 void generateIlluminationTexture_(
float ka,
float kd,
float kr,
float shininess);
461 GLubyte line_tex_[128][128][4];
494 # ifndef BALL_NO_INLINE_FUNCTIONS
495 # include <BALL/VIEW/RENDERING/RENDERERS/glRenderer.iC>
501 #endif // BALL_VIEW_RENDERING_GLRENDERER_H
GLUquadricObj * GLU_quadric_obj_
GLDisplayList * GL_boxes_list_
HashMap< const RegularData3D *, Position > grid_to_texture_
HashMap< Name, const GeometricObject * > GeometricObjectHashMap
Render the contents of the display lists.
HashMap< const Representation *, vector< MeshBuffer * > > MeshBufferHashMap
GLuint line_texture_bind_
#define BALL_GLRENDERER_PICKING_NUMBER_OF_MAX_OBJECTS
NameHashMap object_to_name_
bool drawed_other_object_
GLDisplayList * sphere_list_
DrawingMode drawing_mode_
void setRenderMode(RenderMode mode)
void updateMaterialForRepresentation(Representation const *rep)
Position display_lists_index_
unsigned int Name
Typedef for OPENGL names.
HashMap< const Representation *, GLDisplayList * > DisplayListHashMap
virtual bool init(Scene &scene)
MeshBufferHashMap rep_to_buffers_
GLDisplayList * GL_tubes_list_
DrawingMode
Enumeration for Drawing Modes.
void texCoordVector3_(const Vector3 &v)
GeometricObjectHashMap name_to_object_
GLDisplayList * GL_spheres_list_
DisplayListHashMap display_lists_
HashMap< const GeometricObject *, Name > NameHashMap