BALL  1.4.79
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members
BALL::VIEW::TilingRenderer Class Reference

#include <BALL/VIEW/RENDERING/RENDERERS/tilingRenderer.h>

Inheritance diagram for BALL::VIEW::TilingRenderer:
BALL::VIEW::Renderer

Public Member Functions

Constructors and Destructors
 TilingRenderer (Renderer *real_renderer, Size final_width, Size final_height, Size border=0)
 
 TilingRenderer (const TilingRenderer &renderer)
 
virtual ~TilingRenderer ()
 
virtual void setLights (bool reset_all=false)
 Set the light sources according to the stage. More...
 
virtual void updateCamera (const Camera *camera=0)
 
virtual void updateBackgroundColor ()
 Update the background color from the stage. More...
 
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 &rep)
 
virtual void removeRepresentation (const Representation &rep)
 
virtual void setSize (float width, float height)
 Set the size of the display. More...
 
virtual void renderRuler ()
 
- Public Member Functions inherited from BALL::VIEW::Renderer
 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 updateMaterialForRepresentation (Representation const *)
 
virtual void setupEnvironmentMap (const QImage &image)
 Setup an environment map. More...
 
virtual void setupStereo (float eye_separation, float focal_length)
 
virtual void useContinuousLoop (bool use_loop)
 
bool isContinuous ()
 
virtual bool hasFPScounter ()
 
virtual double getFPS ()
 
virtual void pickObjects (Position x1, Position y1, Position x2, Position y2, std::list< GeometricObject * > &objects)
 
virtual void getFrustum (float &near_f, float &far_f, float &left_f, float &right_f, float &top_f, float &bottom_f)
 
virtual const StagegetStage () const
 
virtual void setStage (const Stage &stage)
 
bool hasStage () const
 Test if a Stage was assigned to the Renderer. More...
 
virtual float getWidth () const
 
virtual float getHeight () const
 
virtual void setPreviewMode (bool show_preview)
 
virtual void showLightSources (bool show_light_sources)
 
virtual void setStereoMode (StereoMode state)
 
virtual StereoMode getStereoMode () const
 
virtual void setStereoFrustumConversion (int width_factor, int height_factor)
 
bool operator== (const Renderer &) const
 

Predicates

Rendererreal_renderer_
 The renderer used for rendering the individual tiles. More...
 
Size final_width_
 The desired width of the final image. More...
 
Size final_height_
 The desired height of the final image. More...
 
Size border_
 The border oversampled for each tile. More...
 
Size num_cols_
 
Size num_rows_
 
virtual void renderToBuffer (RenderTarget *target)
 
virtual void render_ (const GeometricObject *object)
 Wrapper for the renderering of special GeometricObjects. More...
 
void computeTilingSetup_ ()
 

Additional Inherited Members

- Public Types inherited from BALL::VIEW::Renderer
enum  StereoMode {
  NO_STEREO = 0, ACTIVE_STEREO, DUAL_VIEW_STEREO, DUAL_VIEW_DIFFERENT_DISPLAY_STEREO,
  TOP_BOTTOM_STEREO, INTERLACED_STEREO
}
 
- Protected Member Functions inherited from BALL::VIEW::Renderer
virtual void renderClippingPlane_ (const ClippingPlane &)
 
virtual void renderLabel_ (const Label &)
 
virtual void renderLine_ (const Line &)
 Render a line. More...
 
virtual void renderMultiLine_ (const MultiLine &)
 Render an illuminated line. More...
 
virtual void renderMesh_ (const Mesh &)
 Render a surface mesh. More...
 
virtual void renderPoint_ (const Point &)
 Render a single point. More...
 
virtual void renderBox_ (const Box &)
 Render a box. More...
 
virtual void renderSimpleBox_ (const SimpleBox &)
 Render a simple box (parallel to the axes) More...
 
virtual void renderSphere_ (const Sphere &)
 Render a sphere. More...
 
virtual void renderDisc_ (const Disc &)
 Render a disc. More...
 
virtual void renderTube_ (const Tube &)
 Render a tube. More...
 
virtual void renderTwoColoredLine_ (const TwoColoredLine &)
 Render a line with two colors. More...
 
virtual void renderTwoColoredTube_ (const TwoColoredTube &)
 Render a tube with two colors. More...
 
virtual void renderGridVisualisation_ (const GridVisualisation &)
 Render a grid. More...
 
virtual void renderQuadMesh_ (const QuadMesh &)
 Render a quad mesh. More...
 
- Protected Attributes inherited from BALL::VIEW::Renderer
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_
 
Size stereo_frustum_conversion_width_
 
Size stereo_frustum_conversion_height_
 
StereoMode stereo_
 

Detailed Description

Offscreen rendering with arbitrary resolution. This class encapsulates a renderer object which it uses to render a number of individual tiles to compose them into a full image. This can be used to render very large images into files.

The idea behind this renderer is heavily based on the extremely useful open-source TR library for tile rendering by Brian Paul (http://www.mesa3d.org/brianp/TR.html).

Definition at line 31 of file tilingRenderer.h.

Constructor & Destructor Documentation

BALL::VIEW::TilingRenderer::TilingRenderer ( Renderer real_renderer,
Size  final_width,
Size  final_height,
Size  border = 0 
)

Detailed Constructor.

Parameters
real_rendererthe renderer to encapsulate
final_widththe width of the generated image
final_heightthe height of the generated image
borderan optional border around each tile
BALL::VIEW::TilingRenderer::TilingRenderer ( const TilingRenderer renderer)

Copy constructor.

virtual BALL::VIEW::TilingRenderer::~TilingRenderer ( )
inlinevirtual

Destructor

Definition at line 56 of file tilingRenderer.h.

Member Function Documentation

virtual void BALL::VIEW::TilingRenderer::bufferRepresentation ( const Representation rep)
virtual

Buffer a Representation for later rendering.

Reimplemented from BALL::VIEW::Renderer.

void BALL::VIEW::TilingRenderer::computeTilingSetup_ ( )
protected
virtual bool BALL::VIEW::TilingRenderer::finish ( )
virtual

Reimplemented from BALL::VIEW::Renderer.

virtual Vector2 BALL::VIEW::TilingRenderer::map3DToViewport ( const Vector3 vec)
virtual

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

Reimplemented from BALL::VIEW::Renderer.

virtual Vector3 BALL::VIEW::TilingRenderer::mapViewportTo3D ( Position  x,
Position  y 
)
virtual

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

Reimplemented from BALL::VIEW::Renderer.

virtual void BALL::VIEW::TilingRenderer::removeRepresentation ( const Representation rep)
virtual

Remove a representation from the buffer.

Reimplemented from BALL::VIEW::Renderer.

virtual void BALL::VIEW::TilingRenderer::render_ ( const GeometricObject object)
virtual

Wrapper for the renderering of special GeometricObjects.

Reimplemented from BALL::VIEW::Renderer.

virtual bool BALL::VIEW::TilingRenderer::renderOneRepresentation ( const Representation representation)
virtual

Render a Representation.

Reimplemented from BALL::VIEW::Renderer.

virtual void BALL::VIEW::TilingRenderer::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 from BALL::VIEW::Renderer.

virtual void BALL::VIEW::TilingRenderer::renderToBuffer ( RenderTarget target)
virtual
virtual void BALL::VIEW::TilingRenderer::setLights ( bool  reset_all = false)
virtual

Set the light sources according to the stage.

Reimplemented from BALL::VIEW::Renderer.

virtual void BALL::VIEW::TilingRenderer::setSize ( float  width,
float  height 
)
virtual

Set the size of the display.

Reimplemented from BALL::VIEW::Renderer.

virtual void BALL::VIEW::TilingRenderer::updateBackgroundColor ( )
virtual

Update the background color from the stage.

Reimplemented from BALL::VIEW::Renderer.

virtual void BALL::VIEW::TilingRenderer::updateCamera ( const Camera camera = 0)
virtual

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

Reimplemented from BALL::VIEW::Renderer.

Member Data Documentation

Size BALL::VIEW::TilingRenderer::border_
protected

The border oversampled for each tile.

Definition at line 134 of file tilingRenderer.h.

Size BALL::VIEW::TilingRenderer::final_height_
protected

The desired height of the final image.

Definition at line 131 of file tilingRenderer.h.

Size BALL::VIEW::TilingRenderer::final_width_
protected

The desired width of the final image.

Definition at line 128 of file tilingRenderer.h.

Size BALL::VIEW::TilingRenderer::num_cols_
protected

Definition at line 136 of file tilingRenderer.h.

Size BALL::VIEW::TilingRenderer::num_rows_
protected

Definition at line 137 of file tilingRenderer.h.

Renderer* BALL::VIEW::TilingRenderer::real_renderer_
protected

The renderer used for rendering the individual tiles.

Definition at line 125 of file tilingRenderer.h.