GPU-Accelerated Coverage  0.1.0
Compute coverage tours for known environment with articulated objects on GPU
Public Member Functions | Protected Types | Protected Attributes | List of all members
gpu_coverage::Renderer Class Reference

Renderer for rendering a 3D scene using textures and materials. More...

#include <Renderer.h>

Inheritance diagram for gpu_coverage::Renderer:
Inheritance graph
[legend]

Public Member Functions

 Renderer (const Scene *const scene, const bool renderToWindow, const bool renderToTexture)
 Constructor. More...
 
virtual ~Renderer ()
 Destructor.
 
virtual void display ()
 Renders the scene. More...
 
const GLuint & getTexture () const
 Returns the OpenGL texture ID of the result texture. More...
 
const int & getTextureHeight () const
 Height of the result texture. More...
 
const int & getTextureWidth () const
 Width of the result texture. More...
 
void setCamera (CameraPerspective *cameraNew)
 Change the active camera used for rendering. More...
 
- Public Member Functions inherited from gpu_coverage::AbstractRenderer
 AbstractRenderer (const Scene *const scene, const std::string &name)
 Constructor. More...
 
virtual ~AbstractRenderer ()
 Destructor.
 
const bool & isReady () const
 Returns true if the renderer has been initialized correctly. More...
 
const std::string & getName () const
 Returns the name of the renderer for logging purposes. More...
 

Protected Types

enum  TextureRole { COLOR = 0, DEPTH = 1 }
 Texture roles. More...
 

Protected Attributes

const bool renderToWindow
 True if renderer should render to the window framebufer.
 
const bool renderToTexture
 True if renderer should render to an off-screen texture.
 
const int width
 Width of the off-screen texture in pixels.
 
const int height
 Height of the off-screen texture in pixels.
 
CameraPerspectivecamera
 Active camera used for rendering.
 
ProgramVisualTexture progVisualTexture
 Shader program for rendering a mesh with materials and/or textures.
 
ProgramVisualVertexcolor progVisualVertexcolor
 Shader program for rendering a mesh with per-vertex colors.
 
ProgramShowTextureprogShowTexture
 Program for rendering a texture to a framebuffer.
 
CoordinateAxes coordinateAxes
 Coordinate axes scene object.
 
GLuint framebuffer
 Framebuffer for offscreen rendering.
 
GLuint textures [2]
 Color and depth textures for offscreen rendering.
 
GLuint vao
 Vertex array object.
 
GLuint vbo
 Vertex buffer object.
 
- Protected Attributes inherited from gpu_coverage::AbstractRenderer
const Scene *const scene
 Pointer to the scene to be rendered.
 
const std::string name
 Name of the renderer, see getName().
 
bool ready
 Set to true when renderer is ready, see isReady().
 

Detailed Description

Renderer for rendering a 3D scene using textures and materials.

Member Enumeration Documentation

Texture roles.

Enumerator
COLOR 

Color buffer.

DEPTH 

Depth buffer.

Constructor & Destructor Documentation

gpu_coverage::Renderer::Renderer ( const Scene *const  scene,
const bool  renderToWindow,
const bool  renderToTexture 
)

Constructor.

Parameters
sceneThe scene to be rendered.
renderToWindowTrue if scene should be rendered to the window framebuffer.
renderToTextureTrue if scene should be rendered off-screen to texture.

It is possible to render to both the window framebuffer and off-screen to texture.

Member Function Documentation

virtual void gpu_coverage::Renderer::display ( )
virtual

Renders the scene.

This method does the main work of the renderer.

Implements gpu_coverage::AbstractRenderer.

const GLuint& gpu_coverage::Renderer::getTexture ( ) const
inlinevirtual

Returns the OpenGL texture ID of the result texture.

Returns
OpenGL texture ID.

Implements gpu_coverage::AbstractRenderer.

const int& gpu_coverage::Renderer::getTextureHeight ( ) const
inlinevirtual

Height of the result texture.

Returns
Height in pixels.

Implements gpu_coverage::AbstractRenderer.

const int& gpu_coverage::Renderer::getTextureWidth ( ) const
inlinevirtual

Width of the result texture.

Returns
Width in pixels.

Implements gpu_coverage::AbstractRenderer.

void gpu_coverage::Renderer::setCamera ( CameraPerspective cameraNew)
inline

Change the active camera used for rendering.

Parameters
cameraNewThe new camera.

The documentation for this class was generated from the following file: