# opentl::modelprojection::GLRenderer Class Reference

Class for OpenGL based output to screen or other virtual devices. More...

Inherits opentl::core::util::ParameterContainer.

List of all members.

## Public Types
## Public Member Functions
void | drawObjects (const std::vector< boost::shared_ptr< opentl::core::State > > &states, const ObjModelPtrVector &objModels, int camIdx, std::vector< int > &linkIds, std::vector< opentl::math::Vector4 > &shadowColors, DrawMode drawMode=DRAWFACES_NOLIGHTING, HiddenMode hiddenMode=ALL, DrawBuffer drawBuffer=SCREENBUF, opentl::core::cvdata::TextureGpu *backgdTex=NULL, opentl::core::cvdata::TextureGpu *outputTex=NULL)
| Draw the stored object with the with the latest warp settings in the current OpenGL context in the selected mode.
void | drawObjectsIntoImage (const std::vector< boost::shared_ptr< opentl::core::State > > &states, const ObjModelPtrVector &objModels, int camIdx, std::vector< int > &linkIds, std::vector< opentl::math::Vector4 > &shadowColors, opentl::core::cvdata::Image &dstImage, DrawMode drawMode=DRAWFACES_NOLIGHTING, HiddenMode hiddenMode=ALL, opentl::core::cvdata::TextureGpu *backgdTex=NULL, bool drawIntoROIs=false)
| Same as drawObjects, but result is drawn into image. TRY TO AVOID THIS FUNCTION, IT'S SLOW!
opentl::cvprocess::GlFbo * | getFboHandle ()
opentl::core::cvdata::TextureGpu * | getFlippedTex ()
opentl::core::cvdata::TextureGpu * | getInternalTex ()
| GLRenderer (opentl::modelprojection::Warp &warp, opentl::modelprojection::GLScene &scene)
| Constructor.
void | init ()
| Initialize the class.
void | setupFBO ()
| Internal function to setup framebuffer and textures if output FBO is selected.
virtual | ~GLRenderer ()
| Destructor.

## Detailed Description

Class for OpenGL based output to screen or other virtual devices.

Author:
  E. Roth <eroth@mytum.de>

## Member Enumeration Documentation

enum opentl::modelprojection::GLRenderer::DrawBuffer

Enumerator:

  SCREENBUF |
  FBO |

enum opentl::modelprojection::GLRenderer::DrawMode

Enumerator:

  NORENDER |
  DRAWPOINTS |
  DRAWLINES |
  DRAWFACES_NOLIGHTING |
  DRAWFACES |
  DRAWTEXTURE |
  DRAWTEXTURE_NOLIGHTING |
  DRAWSILHOUETTE |

enum opentl::modelprojection::GLRenderer::HiddenMode

Enumerator:

  ALL |
  VISIBLE |

enum opentl::modelprojection::GLRenderer::OfflineParameters

Enumerator:

  construct_frameBufferSizeX | (int) framebuffer size X
  construct_frameBufferSizeY | (int) framebuffer size Y
  OFFLINE_COUNT |

enum opentl::modelprojection::GLRenderer::OnlineParameters

Enumerator:

  backgroundColor | (std::vector(GLclampf) ) Output window background color. (in case no background texture is selected)
  foregroundColor | (std::vector(GLclampf) ) Object color, in case lighting is disabled.
  lightGlobalAmbient | (std::vector(GLfloat) ) Global ambient light. GL lighting settings, see: http://www.falloutsoftware.com/tutorials/gl/gl8.htm
  light0PositionEyeSpace | (std::vector(GLfloat) ) Position of light source 0 in eye space.
  light0Ambient | (std::vector(GLfloat) ) Ambient light source 0.
  light0Diffuse | (std::vector(GLfloat) ) Diffuse light source 0.
  light0Specular | (std::vector(GLfloat) ) Specular light source 0.
  ONLINE_COUNT |

## Constructor & Destructor Documentation

opentl::modelprojection::GLRenderer::GLRenderer | ( | opentl::modelprojection::Warp & | warp,
|  | opentl::modelprojection::GLScene & | scene |
| ) |  |  |

Constructor.

virtual opentl::modelprojection::GLRenderer::~GLRenderer | ( |  | ) | `[virtual]`

Destructor.

## Member Function Documentation

void opentl::modelprojection::GLRenderer::drawObjects | ( | const std::vector< boost::shared_ptr< opentl::core::State > > & | states,
|  | const ObjModelPtrVector & | objModels,
|  | int | camIdx,
|  | std::vector< int > & | linkIds,
|  | std::vector< opentl::math::Vector4 > & | shadowColors,
|  | DrawMode | drawMode = `DRAWFACES_NOLIGHTING`,
|  | HiddenMode | hiddenMode = `ALL`,
|  | DrawBuffer | drawBuffer = `SCREENBUF`,
|  | opentl::core::cvdata::TextureGpu * | backgdTex = `NULL`,
|  | opentl::core::cvdata::TextureGpu * | outputTex = `NULL` |
| ) |  |  |

Draw the stored object with the with the latest warp settings in the current OpenGL context in the selected mode.

Parameters:

  | states | Vector of states.
  | objModels | Vector of object models
  | camIdx | Camera index.
  | linkIds | Link indices: for each object, a single link, or the full shape (id = -1) can be rendered.
  | shadowColors | Custom colors (per target), in case of shadow drawing (must have the same size of linkIds, or empty = all white)
  | drawMode | Can be one of the DrawMode constants.
  | HiddenMode | Can be one of the HiddenMode constants.
  | drawBuffer | Buffer to draw into.
  | backgdTex | Option: Render onto an existing background texture.
  | outputTex | Option: Render into an externally-provided output texture (only when FBO is used!).

void opentl::modelprojection::GLRenderer::drawObjectsIntoImage | ( | const std::vector< boost::shared_ptr< opentl::core::State > > & | states,
|  | const ObjModelPtrVector & | objModels,
|  | int | camIdx,
|  | std::vector< int > & | linkIds,
|  | std::vector< opentl::math::Vector4 > & | shadowColors,
|  | opentl::core::cvdata::Image & | dstImage,
|  | DrawMode | drawMode = `DRAWFACES_NOLIGHTING`,
|  | HiddenMode | hiddenMode = `ALL`,
|  | opentl::core::cvdata::TextureGpu * | backgdTex = `NULL`,
|  | bool | drawIntoROIs = `false` |
| ) |  |  |

Same as drawObjects, but result is drawn into image. TRY TO AVOID THIS FUNCTION, IT'S SLOW!

Parameters:

  | states | Vector of states.
  | objModels | Vector of object models
  | camIdx | Camera index.
  | linkIds | Link indices: for each object, a single link, or the full shape (id = -1) can be rendered.
  | shadowColors | Custom colors (per target), in case of shadow drawing (must have the same size of linkIds, or empty = all white)
  | dstImage | Destination image (must have the same size of camera camIdx).
  | drawMode | Can be one of the DrawMode constants.
  | HiddenMode | Can be one of the HiddenMode constants.
  | backgdTex | Option: Render onto an existing background texture.
  | drawIntoROI | Option: Copy back the image only into the bounding box (ROI) of each target.

opentl::cvprocess::GlFbo* opentl::modelprojection::GLRenderer::getFboHandle | ( |  | ) | `[inline]`

opentl::core::cvdata::TextureGpu* opentl::modelprojection::GLRenderer::getFlippedTex | ( |  | ) | `[inline]`

opentl::core::cvdata::TextureGpu* opentl::modelprojection::GLRenderer::getInternalTex | ( |  | ) | `[inline]`

void opentl::modelprojection::GLRenderer::init | ( |  | ) | `[virtual]`

Initialize the class.

Implements opentl::core::util::ParameterContainer.

void opentl::modelprojection::GLRenderer::setupFBO | ( |  | ) |

Internal function to setup framebuffer and textures if output FBO is selected.