neurolots  0.3.5
NeuroLOTs
nlrender::Renderer Class Reference
+ Collaboration diagram for nlrender::Renderer:

Public Types

enum  TTessCriteria { HOMOGENEOUS = 0, LINEAR }
 
enum  TColorFunc { PERVERTEX = 0, GLOBAL }
 
enum  TTransparencyStatus { DISABLE = 0, ENABLE }
 

Public Member Functions

NLRENDER_API Renderer (bool keepOpenGLServerStack_=false)
 Default constructor.
 
NLRENDER_API ~Renderer (void)
 Default destructors.
 
NLRENDER_API Eigen::Matrix4f & viewMatrix (void)
 Method that return the scene camera view matrix. More...
 
NLRENDER_API Eigen::Matrix4f & projectionMatrix (void)
 Method that return the scene camera view matrix. More...
 
NLRENDER_API float & lod (void)
 Method that return the level of detail. More...
 
NLRENDER_API float & tangentModulus (void)
 Method that return the tangent modulus. More...
 
NLRENDER_API float & maximumDistance (void)
 Method that return the maximum distance. More...
 
NLRENDER_API float & alpha (void)
 Method that return the transparency factor. More...
 
NLRENDER_API TTessCriteria tessCriteria (void)
 Method that return the tessellation criteria. More...
 
NLRENDER_API void tessCriteria (TTessCriteria tessCriteria_)
 
NLRENDER_API TColorFunc colorFunc (void)
 Method that return the type of color function. More...
 
NLRENDER_API void colorFunc (TColorFunc colorFunc_)
 
NLRENDER_API TTransparencyStatus transparencyStatus (void)
 Method that return the transparency status. More...
 
NLRENDER_API void render (nlgeometry::MeshPtr mesh_, const Eigen::Matrix4f &modelMatrix_=Eigen::Matrix4f::Identity(), const Eigen::Vector3f &color_=Eigen::Vector3f(0.5f, 0.5f, 0.5f), bool renderTriangles_=true, bool renderQuads_=true, bool renderLines=true) const
 Method that renderize the given mesh. More...
 
NLRENDER_API void render (nlgeometry::Meshes meshes_, const std::vector< Eigen::Matrix4f > &modelMatrices_, const Eigen::Vector3f &color_=Eigen::Vector3f(0.5f, 0.5f, 0.5f), bool renderLines_=true, bool renderTriangles_=true, bool renderQuads_=true) const
 Method that renderize the given meshes. More...
 
NLRENDER_API void render (nlgeometry::Meshes meshes_, const std::vector< Eigen::Matrix4f > &modelMatrices_, const std::vector< Eigen::Vector3f > &baseColors, const std::vector< Eigen::Vector3f > &colors_, bool renderLines_=true, bool renderTriangles_=true, bool renderQuads_=true) const
 Method that renderize the given meshes. More...
 
NLRENDER_API nlgeometry::MeshPtr extract (nlgeometry::MeshPtr mesh_, const Eigen::Matrix4f &modelMatrix_=Eigen::Matrix4f::Identity(), bool extractTriangles_=true, bool extractQuads_=true) const
 Method that extract the given mesh. More...
 
NLRENDER_API nlgeometry::Meshes & extract (nlgeometry::Meshes meshes_, const std::vector< Eigen::Matrix4f > &modelMatrices_, bool extractTriangles_=true, bool extractQuads_=true) const
 Method that extract the given meshes. More...
 
NLRENDER_API void initTransparencySystem (unsigned int width_, unsigned int height_)
 
NLRENDER_API void setUpOpaqueTransparencyScene (Eigen::Vector3f backgroundColor_, unsigned int width_, unsigned int height_)
 
NLRENDER_API void setUpTransparentTransparencyScene (void)
 
NLRENDER_API void composeTransparencyScene (unsigned int finalFbo_)
 

Protected Member Functions

nlgeometry::MeshPtr _vectorToMesh (std::vector< float > positions_, std::vector< float > normals_) const
 
void _uploadQuad (void)
 
void _composeVertexSubroutines (void)
 
void _composeFragmentSubroutines (void)
 

Protected Attributes

bool _keepOpenGLServerStack
 Variable to determine if keep the OpenGL server status.
 
reto::ShaderProgram * _programLines
 Program to render lines.
 
unsigned int _lGlobalColorInd
 
unsigned int _lVertexColorInd
 
unsigned int _lTransEnableInd
 
unsigned int _lTransDisableInd
 
reto::ShaderProgram * _programTriangles
 Program to render tessellated triangles.
 
unsigned int _tLinearDistInd
 
unsigned int _tHomogeDistInd
 
unsigned int _tGlobalColorInd
 
unsigned int _tVertexColorInd
 
unsigned int _tTransEnableInd
 
unsigned int _tTransDisableInd
 
reto::ShaderProgram * _programQuads
 Program to render tessellated quads.
 
unsigned int _qLinearDistInd
 
unsigned int _qHomogeDistInd
 
unsigned int _qGlobalColorInd
 
unsigned int _qVertexColorInd
 
unsigned int _qTransEnableInd
 
unsigned int _qTransDisableInd
 
reto::ShaderProgram * _programTrianglesFB
 Program to extract tessellated triangles.
 
unsigned int _tFBLinearDistInd
 
unsigned int _tFBHomogeDistInd
 
reto::ShaderProgram * _programQuadsFB
 Program to extract tessellated quads.
 
unsigned int _qFBLinearDistInd
 
unsigned int _qFBHomogeDistInd
 
unsigned int _ulColorSub
 
unsigned int _utColorSub
 
unsigned int _uqColorSub
 
unsigned int _ulTransSub
 
unsigned int _utTransSub
 
unsigned int _uqTransSub
 
std::vector< unsigned int > _tVertexSubroutines
 
std::vector< unsigned int > _qVertexSubroutines
 
std::vector< unsigned int > _tFBVertexSubroutines
 
std::vector< unsigned int > _qFBVertexSubroutines
 
std::vector< unsigned int > _lFragmentSubroutines
 
std::vector< unsigned int > _tFragmentSubroutines
 
std::vector< unsigned int > _qFragmentSubroutines
 
reto::ShaderProgram * _programTransCompose
 Program to compose the transparency scene.
 
Eigen::Matrix4f _viewMatrix
 Scene camera view matrix.
 
Eigen::Matrix4f _projectionMatrix
 Scene camera projection matrix.
 
float _lod
 Level of detail.
 
float _tng
 Tangent modulus.
 
float _maximumDistance
 Maximum tessellation distance.
 
float _alpha
 Transparency factor.
 
TTessCriteria _tessCriteria
 Tessellation level of detail criteria.
 
TColorFunc _colorFunc
 Type of render color function.
 
TTransparencyStatus _transparencyStatus
 Status of transparency render.
 
unsigned int _tfo
 Vertex array object index to mesh extraction.
 
std::vector< unsigned int > _tbos
 Vertex buffers object indices to mesh extraction.
 
unsigned int _quadVao
 Vertex array object index to quad.
 
bool _transSystemInit
 Variable to indicates if the transparency system is initialized.
 
unsigned int _opaqueFbo
 FBO used in the transparency composition to save opaque objects.
 
unsigned int _transFbo
 FBO used in the transparency composition to save transparent objects.
 
reto::Texture2D * _opaqueTexture
 Texture to save the opaque objects color.
 
reto::Texture2D * _accumTexture
 Texture to save the tranparent accumulated objects color.
 
reto::Texture2D * _revealageTexture
 Texture to save the traparent revealage objects color.
 
reto::Texture2D * _depthTexture
 Texture to save the opaque objects depth.
 
unsigned int _transSystemWidth
 Width of the screen for the transparency system.
 
unsigned int _transSystemHeight
 height of the screen for the transparency system
 

Detailed Description

Definition at line 34 of file Renderer.h.

Member Function Documentation

NLRENDER_API float& nlrender::Renderer::alpha ( void  )

Method that return the transparency factor.

Returns
the transparency factor
NLRENDER_API TColorFunc nlrender::Renderer::colorFunc ( void  )

Method that return the type of color function.

Returns
the color funciton type
NLRENDER_API nlgeometry::MeshPtr nlrender::Renderer::extract ( nlgeometry::MeshPtr  mesh_,
const Eigen::Matrix4f &  modelMatrix_ = Eigen::Matrix4f::Identity(),
bool  extractTriangles_ = true,
bool  extractQuads_ = true 
) const

Method that extract the given mesh.

Parameters
mesh_mesh to extract
Returns
the extracted mesh
NLRENDER_API nlgeometry::Meshes& nlrender::Renderer::extract ( nlgeometry::Meshes  meshes_,
const std::vector< Eigen::Matrix4f > &  modelMatrices_,
bool  extractTriangles_ = true,
bool  extractQuads_ = true 
) const

Method that extract the given meshes.

Parameters
mesh_meshes to extract
Returns
the extracted meshesh
NLRENDER_API float& nlrender::Renderer::lod ( void  )

Method that return the level of detail.

Returns
the level of detail
NLRENDER_API float& nlrender::Renderer::maximumDistance ( void  )

Method that return the maximum distance.

Returns
the maximum distance
NLRENDER_API Eigen::Matrix4f& nlrender::Renderer::projectionMatrix ( void  )

Method that return the scene camera view matrix.

Returns
the scene camera view matrix
NLRENDER_API void nlrender::Renderer::render ( nlgeometry::MeshPtr  mesh_,
const Eigen::Matrix4f &  modelMatrix_ = Eigen::Matrix4f::Identity(),
const Eigen::Vector3f &  color_ = Eigen::Vector3f(0.5f, 0.5f, 0.5f),
bool  renderTriangles_ = true,
bool  renderQuads_ = true,
bool  renderLines = true 
) const

Method that renderize the given mesh.

Parameters
mesh_mesh to renderize
modelMatrixmodel matrix transform.
color_Rendering color of the mesh, default gray.
renderTriangles_True to render mesh triangles and false otherwise.
renderQuads_True to render mesh quads and false otherwise.
renderLines_True to render mesh lines and false otherwise.
NLRENDER_API void nlrender::Renderer::render ( nlgeometry::Meshes  meshes_,
const std::vector< Eigen::Matrix4f > &  modelMatrices_,
const Eigen::Vector3f &  color_ = Eigen::Vector3f(0.5f, 0.5f, 0.5f),
bool  renderLines_ = true,
bool  renderTriangles_ = true,
bool  renderQuads_ = true 
) const

Method that renderize the given meshes.

Parameters
meshes_meshes to renderize
modelMatricesModel matrices transform.
color_Rendering color of the meshes, default gray.
renderTriangles_True to render mesh triangles and false otherwise.
renderQuads_True to render mesh quads and false otherwise.
renderLines_True to render mesh lines and false otherwise.
NLRENDER_API void nlrender::Renderer::render ( nlgeometry::Meshes  meshes_,
const std::vector< Eigen::Matrix4f > &  modelMatrices_,
const std::vector< Eigen::Vector3f > &  baseColors,
const std::vector< Eigen::Vector3f > &  colors_,
bool  renderLines_ = true,
bool  renderTriangles_ = true,
bool  renderQuads_ = true 
) const

Method that renderize the given meshes.

Parameters
meshes_meshes to renderize
modelMatricesModel matrices transform.
baseColorsDefault mesh colors.
color_Rendering color of the meshes, default gray.
renderTriangles_True to render mesh triangles and false otherwise.
renderQuads_True to render mesh quads and false otherwise.
renderLines_True to render mesh lines and false otherwise.
NLRENDER_API float& nlrender::Renderer::tangentModulus ( void  )

Method that return the tangent modulus.

Returns
the tanget modulus
NLRENDER_API TTessCriteria nlrender::Renderer::tessCriteria ( void  )

Method that return the tessellation criteria.

Returns
the tessellation criteria
NLRENDER_API TTransparencyStatus nlrender::Renderer::transparencyStatus ( void  )

Method that return the transparency status.

Returns
the transparency status
NLRENDER_API Eigen::Matrix4f& nlrender::Renderer::viewMatrix ( void  )

Method that return the scene camera view matrix.

Returns
the scene camera view matrix

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