Helios++
Helios software for LiDAR simulations
visualhelios::VHStaticObjectAdapter Class Referenceabstract

Abstract class defining core mechanisms to adapt static objects to the visual Helios context based on PCL and VTK libraries. More...

#include <VHStaticObjectAdapter.h>

Inheritance diagram for visualhelios::VHStaticObjectAdapter:
Collaboration diagram for visualhelios::VHStaticObjectAdapter:

Public Member Functions

 VHStaticObjectAdapter (ScenePart &staticObj)
 Constructor for the visual Helios static object adapter. More...
 
virtual void buildPolymesh ()
 Build the polygon mesh from static object primitives. This implies building corresponding vertices vector too. More...
 
virtual void constructPolymesh ()=0
 Instantiate the polymesh object. More...
 
virtual void vertexToMesh (Vertex const &vertex)=0
 Add a vertex to the polymesh. More...
 
virtual void addTriangleToPolymesh (Primitive *primitive, int &offset)
 Function to add triangle primitives to the polymesh during building time. More...
 
virtual void addVoxelToPolymesh (Primitive *primitive, int &offset)
 Function to add voxel primitives to the polymesh during building time. More...
 
ScenePartgetStaticObj ()
 Obtain the static object. More...
 
vector< pcl::Vertices > const & getVertices () const
 Obtain the ordered vertices indices representing the static object. More...
 
string const & getId () const
 Obtain the ID of the static object. More...
 
bool isRenderingNormals () const
 Check whether the static object normals must be rendered or not. More...
 
void setRenderingNormals (bool const renderingNormals)
 Enable or disable normals rendering for the static object. More...
 

Protected Attributes

ScenePartstaticObj
 The adapted static object. More...
 
vector< pcl::Vertices > vertices
 Static object vertices connection specification through ordered indices for visualization purposes. More...
 
bool renderingNormals
 Specify if the static object normals must be rendered (true) or not (false)
 

Detailed Description

Abstract class defining core mechanisms to adapt static objects to the visual Helios context based on PCL and VTK libraries.

Author
Alberto M. Esmoris Pena
Version
1.0

Constructor & Destructor Documentation

◆ VHStaticObjectAdapter()

visualhelios::VHStaticObjectAdapter::VHStaticObjectAdapter ( ScenePart staticObj)
inline

Constructor for the visual Helios static object adapter.

Parameters
staticObjStatic object to be adapted for visual Helios

Member Function Documentation

◆ addTriangleToPolymesh()

void VHStaticObjectAdapter::addTriangleToPolymesh ( Primitive primitive,
int &  offset 
)
virtual

Function to add triangle primitives to the polymesh during building time.

Parameters
primitiveThe triangle primitive to be added
offsetThe offset for vertex index at current iteration
See also
VHStaticObjectAdapter::buildPolymesh
VHStaticObjectAdapter::addVoxelToPolymesh

◆ addVoxelToPolymesh()

void VHStaticObjectAdapter::addVoxelToPolymesh ( Primitive primitive,
int &  offset 
)
virtual

Function to add voxel primitives to the polymesh during building time.

Parameters
primitiveThe triangle primitive to be added
offsetThe offset for vertex index at current iteration
See also
VHStaticObjectAdapter::buildPolymesh
VHStaticObjectAdapter::addTriangleToPolymesh

◆ buildPolymesh()

void VHStaticObjectAdapter::buildPolymesh ( )
virtual

Build the polygon mesh from static object primitives. This implies building corresponding vertices vector too.

See also
VHStaticObjectAdapter::polymesh
VHStaticObjectAdapter::vertices

◆ constructPolymesh()

virtual void visualhelios::VHStaticObjectAdapter::constructPolymesh ( )
pure virtual

Instantiate the polymesh object.

The buildPolymesh method requires to call this function to instantiate a new mesh replacing the old one if any. Therefore, any concrete implementation of a VHStaticObjectAdapter must provide its own definition for this method.

See also
VHStaticObjectAdapter::buildPolymesh
VHStaticObjectAdapter::vertexToMesh(Vertex const &)

Implemented in visualhelios::VHStaticObjectXYZRGBAdapter, and visualhelios::VHStaticObjectXYZAdapter.

◆ getId()

string const& visualhelios::VHStaticObjectAdapter::getId ( ) const
inline

Obtain the ID of the static object.

Returns
Static object ID

◆ getStaticObj()

ScenePart& visualhelios::VHStaticObjectAdapter::getStaticObj ( )
inline

Obtain the static object.

WARNING this getter returns the static object (scene part) reference allowing modifications. Use with caution.

Returns
Static object

◆ getVertices()

vector<pcl::Vertices> const& visualhelios::VHStaticObjectAdapter::getVertices ( ) const
inline

Obtain the ordered vertices indices representing the static object.

Returns
Ordered vertices indices representing the static object

◆ isRenderingNormals()

bool visualhelios::VHStaticObjectAdapter::isRenderingNormals ( ) const
inline

Check whether the static object normals must be rendered or not.

Returns
True if static objects normals must be rendered, false otherwise
See also
VHStaticObjectAdapter::renderingNormals

◆ setRenderingNormals()

void visualhelios::VHStaticObjectAdapter::setRenderingNormals ( bool const  renderingNormals)
inline

Enable or disable normals rendering for the static object.

Parameters
renderingNormalsTrue to enable rendering normals, false to disable it
See also
VHStaticObjectAdapter::renderingNormals

◆ vertexToMesh()

virtual void visualhelios::VHStaticObjectAdapter::vertexToMesh ( Vertex const &  vertex)
pure virtual

Add a vertex to the polymesh.

The buildPolymesh method requires to call this function to generate points/vertices defining the mesh from static object primitives. Therefore, any concrete implementation of a VHStaticObjectAdapter must provide its own definition for this method.

Parameters
vertexVertex from the static object that must be added to the mesh
See also
VHStaticObjectAdapter::buildPolymesh
VHStaticObjectAdapter::constructPolymesh

Implemented in visualhelios::VHStaticObjectXYZRGBAdapter, and visualhelios::VHStaticObjectXYZAdapter.

Member Data Documentation

◆ staticObj

ScenePart& visualhelios::VHStaticObjectAdapter::staticObj
protected

The adapted static object.

See also
ScenePart

◆ vertices

vector<pcl::Vertices> visualhelios::VHStaticObjectAdapter::vertices
protected

Static object vertices connection specification through ordered indices for visualization purposes.

It is, how the vertices must be connected to render each primitive in the polygon mesh.


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