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
142 virtual bool init(
const Stage& stage,
float width,
float height);
155 std::list<GeometricObject*>& objects);
287 virtual void getFrustum(
float& near_f,
float& far_f,
float& left_f,
float& right_f,
float& top_f,
float& bottom_f);
402 { glTexCoord3f(v.
x, v.
y, v.
z); }
461 GLubyte line_tex_[128][128][4];
494# ifndef BALL_NO_INLINE_FUNCTIONS
495# include <BALL/VIEW/RENDERING/RENDERERS/glRenderer.iC>
#define BALL_GLRENDERER_PICKING_NUMBER_OF_MAX_OBJECTS
DrawingMode
Enumeration for Drawing Modes.
bool enableVertexBuffers(bool state)
HashMap< const GeometricObject *, Name > NameHashMap
Position display_lists_index_
GeometricObjectHashMap name_to_object_
virtual void renderSimpleBox_(const SimpleBox &)
Render a simple box (parallel to the axes)
void setAntialiasing(bool state)
Enable or disable antialiasing.
void subdivideTriangle_(Vector3 &v1, Vector3 &v2, Vector3 &v3, int precision)
@ RENDER_MODE_TRANSPARENT
virtual void renderTube_(const Tube &)
Render a tube.
GLuint line_texture_bind_
RenderMode getRenderMode() const
virtual void renderQuadMesh_(const QuadMesh &)
Render a quad mesh.
virtual void renderToBuffer(RenderTarget *renderTarget, BufferMode)
void updateMaterialForRepresentation(Representation const *rep)
virtual void setLights(bool reset_all=false)
Set the light sources according to the stage.
virtual void renderBox_(const Box &)
Render a box.
GLDisplayList * GL_tubes_list_
virtual void renderLine_(const Line &)
Render a line.
void generateIlluminationTexture_(float ka, float kd, float kr, float shininess)
GLDisplayList * sphere_list_
virtual void renderTwoColoredTube_(const TwoColoredTube &)
Render a tube with two colors.
HashMap< Name, const GeometricObject * > GeometricObjectHashMap
void clearVertexBuffersFor(Representation &rep)
void setMaterial_(const Stage::Material &mat)
void setColor4ub_(const GeometricObject &object)
void translateVector3_(const Vector3 &v)
virtual void bufferingDependentRender_(const Representation &repr, BufferMode mode)
void renderRepresentation_(const Representation &representation, bool for_display_list)
void setColorRGBA_(const ColorRGBA &color)
virtual void clear()
Explicit default initialization.
HashMap< const Representation *, vector< MeshBuffer * > > MeshBufferHashMap
GLRenderer()
Default Constructor.
void setupGridClipPlanes_(const GridVisualisation &slice)
virtual void renderTwoColoredLine_(const TwoColoredLine &)
Render a line with two colors.
Position getTextureIndex_(Position x, Position y, Position z, Size width, Size height)
GLDisplayList * GL_boxes_list_
bool mapViewplaneToScreen_()
GLUquadricObj * GLU_quadric_obj_
Name getName(const GeometricObject &object)
DrawingMode getDrawingMode() const
DrawingMode drawing_mode_
void renderRepresentations_(BufferMode mode)
void texCoordVector3_(const Vector3 &v)
virtual bool getSmoothLines()
virtual void renderRuler()
Position createTextureFromGrid(const RegularData3D &grid, const ColorMap &map)
void scaleVector3_(const Vector3 &v)
virtual void renderDisc_(const Disc &)
Render a disc.
virtual void renderPoint_(const Point &)
Render a single point.
virtual bool render(const Representation &representation, bool for_display_list=false)
virtual void renderGridVisualisation_(const GridVisualisation &vol)
Render a grid slice.
void bufferRepresentation(const Representation &rep)
Buffer the visualisation for the given Representation into OpenGL VertexBuffer Objects and DisplayLis...
void updateCamera(const Camera *camera=0)
vector< String > getExtensions()
void dump(std::ostream &s, Size depth) const
virtual void renderSphere_(const Sphere &)
Render a sphere.
void setFogIntensity(float intensity)
void initDrawingOthers_()
MeshBufferHashMap rep_to_buffers_
void setSize(float width, float height)
Set the size of the display.
void initDrawingMeshes_()
HashMap< const RegularData3D *, Position > grid_to_texture_
virtual void pickObjects(Position x1, Position y1, Position x2, Position y2, std::list< GeometricObject * > &objects)
bool isExtensionSupported(const String &extension) const
virtual ~GLRenderer()
Destructor.
void removeRepresentation(const Representation &rep)
Remove all VertexBuffer and DisplayLists for the given Representation.
DisplayListHashMap display_lists_
void drawBuffered(const Representation &rep)
Draw the visualisation of the given Representation from the VertexBuffers and a DisplayList.
bool runningOnVirtualBox()
void removeTextureFor_(const RegularData3D &grid)
void setRenderMode(RenderMode mode)
void pickObjects1(Position x1, Position y1, Position x2, Position y2)
GLDisplayList * GL_spheres_list_
bool hasDisplayListFor(const Representation &rep) const
Test if a Representation has a DisplayList.
void initGLU_(DrawingMode mode)
virtual void renderLabel_(const Label &)
bool vertexBuffersSupported() const
void createDottedSphere_(int precision)
virtual void updateBackgroundColor()
Update the background color from the stage.
NameHashMap object_to_name_
@ DISPLAY_LISTS_RENDERING
Render the contents of the display lists.
virtual void renderMultiLine_(const MultiLine &line)
Render an illuminated line.
bool vertexBuffersEnabled() const
virtual void renderClippingPlane_(const ClippingPlane &plane)
virtual void getFrustum(float &near_f, float &far_f, float &left_f, float &right_f, float &top_f, float &bottom_f)
void rotateVector3Angle_(const Vector3 &v, Real angle)
bool drawed_other_object_
virtual void setSmoothLines(bool smooth_lines)
GeometricObject * getObject(GLRenderer::Name name) const
void vertexVector3_(const Vector3 &v)
void setOrthographicZoom(float orthographic_zoom)
unsigned int Name
Typedef for OPENGL names.
void pickObjects2(std::list< GeometricObject * > &objects)
virtual bool init(const Stage &stage, float width, float height)
Initialise the renderer, e.g. the display lists.
void setupStereo(float eye_separation, float focal_length)
float getOrthographicZoom(void)
virtual void renderMesh_(const Mesh &)
Render a surface mesh.
String getOpenGLVersion()
void normalVector3_(const Vector3 &v)
HashMap< const Representation *, GLDisplayList * > DisplayListHashMap
WrongModes(const char *file, int line, int mode, int precision)
virtual bool init(Scene &scene)