Main Page | Modules | Namespace List | Class Hierarchy | Class List | Namespace Members | Class Members

VIEW::GLRenderer Class Reference
[Renderer]

GLRenderer Renderer which provides hardware accelerated OPENGL rendering. More...

#include <glRenderer.h>

Inheritance diagram for VIEW::GLRenderer:

VIEW::Renderer Object AutoDeletable List of all members.

Public Types

typedef unsigned int Name
 Typedef for OPENGL names.
typedef HashMap< const GeometricObject *,
Name
NameHashMap
typedef HashMap< Name, const
GeometricObject * > 
GeometricObjectHashMap
typedef HashMap< const Representation *,
GLDisplayList * > 
DisplayListHashMap
typedef HashMap< const Representation *,
vector< MeshBuffer * > > 
MeshBufferHashMap
enum  StereoMode { NO_STEREO = 0, ACTIVE_STEREO, DUAL_VIEW_STEREO }
enum  RenderMode { RENDER_MODE_UNDEFINED = 0, RENDER_MODE_SOLID, RENDER_MODE_TRANSPARENT, RENDER_MODE_ALWAYS_FRONT }

Public Member Functions

 GLRenderer () throw ()
 Default Constructor.
virtual ~GLRenderer () throw ()
 Destructor.
virtual void clear () throw ()
 Explicit default initialization.
void dump (std::ostream &s, Size depth) const throw ()
Name getName (const GeometricObject &object) throw ()
GeometricObjectgetObject (GLRenderer::Name name) const throw ()
virtual bool init (Scene &scene) throw ()
 Initialise the renderer, by calling the init method below This method is called by Scene::initializeGL.
virtual bool init (const Stage &stage, float height, float width) throw ()
 Initialise the renderer, e.g. the display lists.
virtual void setLights (bool reset_all=false) throw ()
 Set the light sources according to the stage.
void pickObjects1 (Position x1, Position y1, Position x2, Position y2) throw ()
 Pick geometric objects.
void pickObjects2 (List< GeometricObject * > &objects) throw ()
 Pick geometric objects method2.
void enterPickingMode ()
void exitPickingMode ()
void setSize (float width, float height) throw ()
 Set the size of the display.
float getXScale () const throw ()
float getYScale () const throw ()
void updateCamera (const Camera *camera=0) throw ()
 Update the camera position with gluLookAt, either from a given Camera, or from the default Stage.
void updateBackgroundColor () throw ()
 Update the background color from the stage.
void initTransparent () throw ()
void initSolid () throw ()
void initAlwaysFront () throw ()
void setAntialiasing (bool state)
 Enable or disable antialiasing.
void removeRepresentation (const Representation &rep) throw ()
 Remove all VertexBuffer and DisplayLists for the given Representation.
void bufferRepresentation (const Representation &rep) throw ()
 Buffer the visualisation for the given Representation into OpenGL VertexBuffer Objects and DisplayLists.
void drawBuffered (const Representation &rep) throw ()
 Draw the visualisation of the given Representation from the VertexBuffers and a DisplayList.
bool hasDisplayListFor (const Representation &rep) const throw ()
 Test if a Representation has a DisplayList.
void setStereoMode (StereoMode state) throw ()
StereoMode getStereoMode () const throw ()
RenderMode getRenderMode () const throw ()
void setRenderMode (RenderMode mode)
virtual bool render (const Representation &representation, bool for_display_list=false) throw ()
bool isExtensionSupported (const String &extension) const throw ()
 Test if a given opengl extension is supported by the current driver.
void clearVertexBuffersFor (Representation &rep) throw ()
bool vertexBuffersSupported () const throw ()
String getVendor ()
String getRenderer ()
String getOpenGLVersion ()
vector< StringgetExtensions ()
bool enableVertexBuffers (bool state) throw ()
bool vertexBuffersEnabled () const
DrawingMode getDrawingMode () const
void initPerspective ()
void renderRepresentation_ (const Representation &representation, bool for_display_list)
virtual void renderLabel_ (const Label &) throw ()
virtual void renderLine_ (const Line &) throw ()
 Render a line.
virtual void renderMultiLine_ (const MultiLine &line) throw ()
 Render an illuminated line.
virtual void renderMesh_ (const Mesh &) throw ()
 Render a surface mesh.
virtual void renderQuadMesh_ (const QuadMesh &) throw ()
 Render a quad mesh.
void initDrawingMeshes_ ()
void initDrawingOthers_ ()
virtual void renderPoint_ (const Point &) throw ()
 Render a single point.
virtual void renderSimpleBox_ (const SimpleBox &) throw ()
 Render a simple box (parallel to the axes).
virtual void renderBox_ (const Box &) throw ()
 Render a box.
virtual void renderSphere_ (const Sphere &) throw ()
 Render a sphere.
virtual void renderDisc_ (const Disc &) throw ()
 Render a disc.
virtual void renderTube_ (const Tube &) throw ()
 Render a tube.
virtual void renderTwoColoredLine_ (const TwoColoredLine &) throw ()
 Render a line with two colors.
virtual void renderTwoColoredTube_ (const TwoColoredTube &) throw ()
 Render a tube with two colors.
virtual void renderClippingPlane_ (const ClippingPlane &plane) throw ()
virtual void renderGridVisualisation_ (const GridVisualisation &vol) throw ()
 Render a grid slice.
void setColor4ub_ (const GeometricObject &object) throw ()
void createSpheres_ () throw ()
void createTubes_ () throw ()
void createBoxes_ () throw ()
void createDottedSphere_ (int precision) throw ()
void subdivideTriangle_ (Vector3 &v1, Vector3 &v2, Vector3 &v3, int precision) throw ()
void createLineBox_ () throw ()
void createDotBox_ () throw ()
void createSolidBox_ () throw ()
void clearNames_ () throw ()
void normalVector3_ (const Vector3 &v) throw ()
void vertexVector3_ (const Vector3 &v) throw ()
void translateVector3_ (const Vector3 &v) throw ()
void texCoordVector3_ (const Vector3 &v) throw ()
void scaleVector3_ (const Vector3 &v) throw ()
void rotateVector3Angle_ (const Vector3 &v, Real angle) throw ()
void scale_ (float f) throw ()
void setColorRGBA_ (const ColorRGBA &color) throw ()
void initGLU_ (DrawingMode mode)
void generateIlluminationTexture_ (float ka, float kd, float kr, float shininess)
Position getTextureIndex_ (Position x, Position y, Position z, Size width, Size height)
Position createTextureFromGrid (const RegularData3D &grid, const ColorMap &map)
void removeTextureFor_ (const RegularData3D &grid)
void setupGridClipPlanes_ (const GridVisualisation &slice)

Public Attributes

Scenescene_
DrawingMode drawing_mode_
Index drawing_precision_
float x_scale_
float y_scale_
GLDisplayListGL_spheres_list_
GLDisplayListGL_tubes_list_
GLDisplayListGL_boxes_list_
GLDisplayListsphere_list_
GLDisplayList line_list_
GLuint line_texture_bind_
GLubyte line_tex_ [128][128][4]
GeometricObjectHashMap name_to_object_
NameHashMap object_to_name_
DisplayListHashMap display_lists_
MeshBufferHashMap rep_to_buffers_
Name all_names_
GLuint object_buffer_ [BALL_GLRENDERER_PICKING_NUMBER_OF_MAX_OBJECTS]
Vector3 normal_vector_
StereoMode stereo_
RenderMode render_mode_
bool use_vertex_buffer_
bool picking_mode_
ModelType model_type_
Position display_lists_index_
bool single_pick_
bool drawed_other_object_
bool drawed_mesh_
GLUquadricObj * GLU_quadric_obj_
HashMap< const RegularData3D *,
Position
grid_to_texture_
GLuint cel_texture_

Friends

class Scene

Detailed Description

GLRenderer Renderer which provides hardware accelerated OPENGL rendering.


Member Enumeration Documentation

enum VIEW::GLRenderer::StereoMode
 

Enumeration values:
ACTIVE_STEREO  Stereo mode for shutter glasses.
DUAL_VIEW_STEREO  Stereo mode for output on two projectors.


Member Function Documentation

virtual bool VIEW::GLRenderer::init Scene scene  )  throw () [virtual]
 

Initialise the renderer, by calling the init method below This method is called by Scene::initializeGL.

bool VIEW::GLRenderer::isExtensionSupported const String extension  )  const throw ()
 

Test if a given opengl extension is supported by the current driver.

Call this only after Scene::initializeGL();

void VIEW::GLRenderer::pickObjects1 Position  x1,
Position  y1,
Position  x2,
Position  y2
throw ()
 

Pick geometric objects.

Parameters:
x1,y1,x2,y2 the rectangle of the selection

void VIEW::GLRenderer::pickObjects2 List< GeometricObject * > &  objects  )  throw ()
 

Pick geometric objects method2.

Call this method after pickObjects1 and rendering the representations.

Parameters:
objects returns the picked objects

void VIEW::GLRenderer::updateCamera const Camera camera = 0  )  throw ()
 

Update the camera position with gluLookAt, either from a given Camera, or from the default Stage.