BALL::VIEW::Renderer Class Reference
[Renderer]

#include <BALL/VIEW/RENDERING/renderer.h>

Inheritance diagram for BALL::VIEW::Renderer:
BALL::Object BALL::AutoDeletable BALL::VIEW::BufferedRenderer BALL::VIEW::GLRenderer BALL::VIEW::POVRenderer BALL::VIEW::STLRenderer BALL::VIEW::TilingRenderer BALL::VIEW::VRMLRenderer

List of all members.


Public Member Functions

Constructors and Destructors
 Renderer ()
 Renderer (const Renderer &renderer)
virtual ~Renderer ()
virtual void clear ()
virtual bool init (Scene &scene)
virtual bool init (const Stage &stage, float height, float width)
virtual void setLights (bool reset_all=false)
 

Set the light sources according to the stage.


virtual void updateCamera (const Camera *camera=0)
virtual void updateBackgroundColor ()
 

Update the background color from the stage.


virtual void setupStereo (float eye_separation, float focal_length)
virtual void useContinuousLoop (bool use_loop)
bool isContinuous ()
virtual bool finish ()
virtual Vector3 mapViewportTo3D (Position x, Position y)
virtual Vector2 map3DToViewport (const Vector3 &vec)
Accessors
virtual bool renderOneRepresentation (const Representation &representation)
virtual void bufferRepresentation (const Representation &)
virtual void removeRepresentation (const Representation &)
virtual const StagegetStage () const
virtual void setStage (const Stage &stage)
bool hasStage () const
 

Test if a Stage was assigned to the Renderer.


virtual void setSize (float width, float height)
 

Set the size of the display.


virtual float getWidth () const
virtual float getHeight () const
virtual void setPreviewMode (bool show_preview)
virtual void showLightSources (bool show_light_sources)
virtual void renderRuler ()

Protected Attributes

Scenescene_
const Stagestage_
float width_
float height_
bool show_preview_
float volume_width_
bool show_light_sources_
Camera camera_
Vector3 camera_offset_
bool use_continuous_loop_

Predicates

bool operator== (const Renderer &) const
virtual void render_ (const GeometricObject *object)
 

Wrapper for the renderering of special GeometricObjects.


virtual void renderClippingPlane_ (const ClippingPlane &)
virtual void renderLabel_ (const Label &)
virtual void renderLine_ (const Line &)
 

Render a line.


virtual void renderMultiLine_ (const MultiLine &)
 

Render an illuminated line.


virtual void renderMesh_ (const Mesh &)
 

Render a surface mesh.


virtual void renderPoint_ (const Point &)
 

Render a single point.


virtual void renderBox_ (const Box &)
 

Render a box.


virtual void renderSimpleBox_ (const SimpleBox &)
 

Render a simple box (parallel to the axes).


virtual void renderSphere_ (const Sphere &)
 

Render a sphere.


virtual void renderDisc_ (const Disc &)
 

Render a disc.


virtual void renderTube_ (const Tube &)
 

Render a tube.


virtual void renderTwoColoredLine_ (const TwoColoredLine &)
 

Render a line with two colors.


virtual void renderTwoColoredTube_ (const TwoColoredTube &)
 

Render a tube with two colors.


virtual void renderGridVisualisation_ (const GridVisualisation &)
 

Render a grid.


virtual void renderQuadMesh_ (const QuadMesh &)
 

Render a quad mesh.



Detailed Description

Renderer is just a generic base class. Derived classes are GLRenderer and POVRenderer. Every renderer has a pointer to a Stage object, which contains the viewpoint, the LightSource, etc. The renderer also knows the width and height, of the display, it shall render.


Constructor & Destructor Documentation

BALL::VIEW::Renderer::Renderer (  ) 

Default Constructor.

BALL::VIEW::Renderer::Renderer ( const Renderer renderer  ) 

Copy constructor.

virtual BALL::VIEW::Renderer::~Renderer (  )  [inline, virtual]

Destructor


Member Function Documentation

virtual void BALL::VIEW::Renderer::bufferRepresentation ( const Representation  )  [inline, virtual]

Buffer a Representation for later rendering.

Reimplemented in BALL::VIEW::GLRenderer, and BALL::VIEW::TilingRenderer.

virtual void BALL::VIEW::Renderer::clear (  )  [inline, virtual]

Explicit default initialization.

Reimplemented from BALL::Object.

Reimplemented in BALL::VIEW::GLRenderer, BALL::VIEW::POVRenderer, BALL::VIEW::STLRenderer, and BALL::VIEW::VRMLRenderer.

virtual bool BALL::VIEW::Renderer::finish (  )  [virtual]
virtual float BALL::VIEW::Renderer::getHeight (  )  const [inline, virtual]
virtual const Stage& BALL::VIEW::Renderer::getStage (  )  const [inline, virtual]

Get the stage for the renderer (const)

virtual float BALL::VIEW::Renderer::getWidth (  )  const [inline, virtual]
bool BALL::VIEW::Renderer::hasStage (  )  const

Test if a Stage was assigned to the Renderer.

virtual bool BALL::VIEW::Renderer::init ( const Stage stage,
float  height,
float  width 
) [virtual]

Initialisation with the Stage. Called by Scene::exportScene().

Reimplemented in BALL::VIEW::GLRenderer, and BALL::VIEW::POVRenderer.

virtual bool BALL::VIEW::Renderer::init ( Scene scene  )  [virtual]

Initialization routines. This method is called by Scene::initializeGL.

Reimplemented in BALL::VIEW::GLRenderer, and BALL::VIEW::POVRenderer.

bool BALL::VIEW::Renderer::isContinuous (  )  [inline]

Returns the mode of the render loop.

virtual Vector2 BALL::VIEW::Renderer::map3DToViewport ( const Vector3 vec  )  [virtual]

Compute the 2D position on the screen corresponding to the 3D point vec

Reimplemented in BALL::VIEW::GLRenderer, and BALL::VIEW::TilingRenderer.

virtual Vector3 BALL::VIEW::Renderer::mapViewportTo3D ( Position  x,
Position  y 
) [virtual]

Compute the 3D position on the view plane corresponding to point (x,y) on the view port

Reimplemented in BALL::VIEW::GLRenderer, and BALL::VIEW::TilingRenderer.

bool BALL::VIEW::Renderer::operator== ( const Renderer  )  const [inline]
virtual void BALL::VIEW::Renderer::removeRepresentation ( const Representation  )  [inline, virtual]

Remove a representation from the buffer.

Reimplemented in BALL::VIEW::GLRenderer, and BALL::VIEW::TilingRenderer.

virtual void BALL::VIEW::Renderer::render_ ( const GeometricObject object  )  [virtual]

Wrapper for the renderering of special GeometricObjects.

Reimplemented in BALL::VIEW::TilingRenderer.

virtual void BALL::VIEW::Renderer::renderBox_ ( const Box  )  [inline, protected, virtual]

Render a box.

Reimplemented in BALL::VIEW::GLRenderer.

References BALL::LogStream::error(), and BALL::Log.

virtual void BALL::VIEW::Renderer::renderClippingPlane_ ( const ClippingPlane  )  [inline, protected, virtual]

Reimplemented in BALL::VIEW::GLRenderer.

References BALL::LogStream::error(), and BALL::Log.

virtual void BALL::VIEW::Renderer::renderDisc_ ( const Disc  )  [inline, protected, virtual]

Render a disc.

Reimplemented in BALL::VIEW::GLRenderer, and BALL::VIEW::POVRenderer.

References BALL::LogStream::error(), and BALL::Log.

virtual void BALL::VIEW::Renderer::renderGridVisualisation_ ( const GridVisualisation  )  [inline, protected, virtual]

Render a grid.

Reimplemented in BALL::VIEW::GLRenderer.

References BALL::LogStream::error(), and BALL::Log.

virtual void BALL::VIEW::Renderer::renderLabel_ ( const Label  )  [inline, protected, virtual]
virtual void BALL::VIEW::Renderer::renderLine_ ( const Line  )  [inline, protected, virtual]
virtual void BALL::VIEW::Renderer::renderMesh_ ( const Mesh  )  [inline, protected, virtual]
virtual void BALL::VIEW::Renderer::renderMultiLine_ ( const MultiLine  )  [inline, protected, virtual]

Render an illuminated line.

Reimplemented in BALL::VIEW::GLRenderer, and BALL::VIEW::POVRenderer.

References BALL::LogStream::error(), and BALL::Log.

virtual bool BALL::VIEW::Renderer::renderOneRepresentation ( const Representation representation  )  [virtual]
virtual void BALL::VIEW::Renderer::renderPoint_ ( const Point  )  [inline, protected, virtual]

Render a single point.

Reimplemented in BALL::VIEW::GLRenderer, and BALL::VIEW::POVRenderer.

References BALL::LogStream::error(), and BALL::Log.

virtual void BALL::VIEW::Renderer::renderQuadMesh_ ( const QuadMesh  )  [inline, protected, virtual]

Render a quad mesh.

Reimplemented in BALL::VIEW::GLRenderer.

References BALL::LogStream::error(), and BALL::Log.

virtual void BALL::VIEW::Renderer::renderRuler (  )  [virtual]

Render a ruler.

If supported by the renderer implementation, this function will produce a simple ruler that is rendered together with the other representations. The main use of this function is in the edit mode, where it can help to straighten-up structures and to correctly estimate angles and distances.

Reimplemented in BALL::VIEW::GLRenderer, and BALL::VIEW::TilingRenderer.

virtual void BALL::VIEW::Renderer::renderSimpleBox_ ( const SimpleBox  )  [inline, protected, virtual]

Render a simple box (parallel to the axes).

Reimplemented in BALL::VIEW::GLRenderer.

References BALL::LogStream::error(), and BALL::Log.

virtual void BALL::VIEW::Renderer::renderSphere_ ( const Sphere  )  [inline, protected, virtual]
virtual void BALL::VIEW::Renderer::renderTube_ ( const Tube  )  [inline, protected, virtual]
virtual void BALL::VIEW::Renderer::renderTwoColoredLine_ ( const TwoColoredLine  )  [inline, protected, virtual]
virtual void BALL::VIEW::Renderer::renderTwoColoredTube_ ( const TwoColoredTube  )  [inline, protected, virtual]
virtual void BALL::VIEW::Renderer::setLights ( bool  reset_all = false  )  [virtual]

Set the light sources according to the stage.

Reimplemented in BALL::VIEW::GLRenderer, and BALL::VIEW::TilingRenderer.

virtual void BALL::VIEW::Renderer::setPreviewMode ( bool  show_preview  )  [inline, virtual]

Decides whether the renderer should use a faster preview mode. Please note that not all renderers support previews and may choose just to ignore this setting.

virtual void BALL::VIEW::Renderer::setSize ( float  width,
float  height 
) [inline, virtual]

Set the size of the display.

Reimplemented in BALL::VIEW::GLRenderer, and BALL::VIEW::TilingRenderer.

virtual void BALL::VIEW::Renderer::setStage ( const Stage stage  )  [inline, virtual]

Set the stage for the renderer

virtual void BALL::VIEW::Renderer::setupStereo ( float  eye_separation,
float  focal_length 
) [virtual]

Sets this renderer as a part of a stereo setup.

eye_separation denotes the distance along the right vector used by this "eye".

Reimplemented in BALL::VIEW::GLRenderer.

virtual void BALL::VIEW::Renderer::showLightSources ( bool  show_light_sources  )  [inline, virtual]

Decides whether to draw light sources explicitly. Please note that not all renderers support this feature and may choose just to ignore this setting.

virtual void BALL::VIEW::Renderer::updateBackgroundColor (  )  [virtual]

Update the background color from the stage.

Reimplemented in BALL::VIEW::GLRenderer, and BALL::VIEW::TilingRenderer.

virtual void BALL::VIEW::Renderer::updateCamera ( const Camera camera = 0  )  [virtual]

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

Reimplemented in BALL::VIEW::GLRenderer, and BALL::VIEW::TilingRenderer.

virtual void BALL::VIEW::Renderer::useContinuousLoop ( bool  use_loop  )  [inline, virtual]

Decide between event based and (threaded) continuous loop rendering.


Member Data Documentation

const Stage* BALL::VIEW::Renderer::stage_ [protected]