Tucano  0.1
A library for rapid prototyping with modern OpenGL and GLSL
Tucano::Model Class Reference

The Model class is a holder for any kind of model, such as meshes, point clouds, surfaces ... that should inherit the model class. More...

#include <model.hpp>

Inheritance diagram for Tucano::Model:
Tucano::Mesh Tucano::Shapes::CoordinateAxes Tucano::Shapes::Arrow Tucano::Shapes::Box Tucano::Shapes::CameraRep Tucano::Shapes::Cone Tucano::Shapes::Cylinder Tucano::Shapes::Plane Tucano::Shapes::Quad Tucano::Shapes::Sphere

Public Member Functions

 Model (void)
 
Eigen::Vector4f getColor (void)
 Returns the default color of the model. More...
 
void setColor (const Eigen::Vector4f &color)
 Sets the default color of the model. More...
 
virtual Eigen::Vector3f getObjectCenter (void) const
 Returns the center of the axis-aligned bounding box. More...
 
virtual Eigen::Vector3f getCentroid (void) const
 Returns the centroid of the model. More...
 
virtual float getBoundingSphereRadius (void) const
 
Eigen::Affine3f getModelMatrix (void) const
 Returns the model matrix. More...
 
Eigen::Affine3f * modelMatrix (void)
 Returns a pointer to the model matrix. More...
 
void setModelMatrix (const Eigen::Affine3f &m)
 Sets the model matrix. More...
 
float getScale (void) const
 Returns the scale factor for fitting the model inside a unit cube. More...
 
void normalizeModelMatrix (void)
 Normalize model matrix to center and scale model. The model matrix will include a translation to place model's centroid at the origin, and scale the model to fit inside a unit sphere. More...
 
void desnormalizeModelMatrix (void)
 Desnormalize model matrix. More...
 
void resetModelMatrix (void)
 Resets the model matrix. More...
 

Protected Attributes

Eigen::Affine3f model_matrix
 Model matrix, holds information about the models location and orientation. More...
 
Eigen::Vector3f objectCenter
 Center of the mesh object. More...
 
Eigen::Vector3f centroid
 Object's centroid (different from center of bounding box) More...
 
float radius
 Radius of the mesh bounding sphere. More...
 
float scale
 The normalization scale factor, scales the model matrix to fit the model inside a unit cube. More...
 
Eigen::Vector4f default_color = Eigen::Vector4f (0.7, 0.7, 0.7, 1.0)
 Default color. More...
 

Detailed Description

The Model class is a holder for any kind of model, such as meshes, point clouds, surfaces ... that should inherit the model class.

It basically contains only information about its spatial location and orientation, that is, a model matrix.

Constructor & Destructor Documentation

Tucano::Model::Model ( void  )
inline

Default Constructor.

Member Function Documentation

void Tucano::Model::desnormalizeModelMatrix ( void  )
inline

Desnormalize model matrix.

virtual float Tucano::Model::getBoundingSphereRadius ( void  ) const
inlinevirtual

Returns the radius of the bounding sphere. The bounding sphere is computed as the distance from the farthest point to the object's centroid.

Returns
Radius of the bounding sphere.
virtual Eigen::Vector3f Tucano::Model::getCentroid ( void  ) const
inlinevirtual

Returns the centroid of the model.

Returns
The centroid of the mesh object. given by the mean position of all vertices.
Eigen::Vector4f Tucano::Model::getColor ( void  )
inline

Returns the default color of the model.

Returns
RGBA default color
Eigen::Affine3f Tucano::Model::getModelMatrix ( void  ) const
inline

Returns the model matrix.

Returns
Model matrix as an Affine 3f matrix.
virtual Eigen::Vector3f Tucano::Model::getObjectCenter ( void  ) const
inlinevirtual

Returns the center of the axis-aligned bounding box.

Returns
The center of the axis-aligned bounding box.
float Tucano::Model::getScale ( void  ) const
inline

Returns the scale factor for fitting the model inside a unit cube.

Returns
Scale factor.
Eigen::Affine3f* Tucano::Model::modelMatrix ( void  )
inline

Returns a pointer to the model matrix.

Returns
Pointer to the odel matrix as an Affine 3f matrix.
void Tucano::Model::normalizeModelMatrix ( void  )
inline

Normalize model matrix to center and scale model. The model matrix will include a translation to place model's centroid at the origin, and scale the model to fit inside a unit sphere.

void Tucano::Model::resetModelMatrix ( void  )
inline

Resets the model matrix.

void Tucano::Model::setColor ( const Eigen::Vector4f &  color)
inline

Sets the default color of the model.

Parameters
colorGiven new default color
void Tucano::Model::setModelMatrix ( const Eigen::Affine3f &  m)
inline

Sets the model matrix.

Parameters
mGiven new model matrix

Member Data Documentation

Eigen::Vector3f Tucano::Model::centroid
protected

Object's centroid (different from center of bounding box)

Eigen::Vector4f Tucano::Model::default_color = Eigen::Vector4f (0.7, 0.7, 0.7, 1.0)
protected

Default color.

Eigen::Affine3f Tucano::Model::model_matrix
protected

Model matrix, holds information about the models location and orientation.

Eigen::Vector3f Tucano::Model::objectCenter
protected

Center of the mesh object.

float Tucano::Model::radius
protected

Radius of the mesh bounding sphere.

float Tucano::Model::scale
protected

The normalization scale factor, scales the model matrix to fit the model inside a unit cube.


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