CVB++ 14.1
Mesh< T > Class Template Reference

3D mesh object consisting of polygons. More...

#include <cvb/mesh.hpp>

Public Member Functions

std::size_t NumPolygons () const noexcept
 Get the number of polygons in this mesh. More...
 
Polygon3D< T > PolygonAt (std::size_t index) const
 Gets polygons for this mesh. More...
 
std::vector< std::uint32_tPolygonIndicesAt (std::size_t index) const
 Gets point indices for a polygon. More...
 
std::size_t NumPoints () const noexcept
 Get the number of points in the mesh. More...
 
PointAt (std::size_t index) const noexcept
 Gets the point at the specified index. More...
 
Cuboid CalculateBoundingBox () const
 Calculates the minimum and maximum extent of the mesh. More...
 
void RasterDensePointCloudToDst (const Matrix3D &cameraRotation, Vector3D< double > cameraTranslation, DensePointCloud &denseCloud)
 Rasters this mesh into a dense point cloud and stores the result. More...
 
DensePointCloudPtr RasterDensePointCloud (const Matrix3D &cameraRotation, Vector3D< double > cameraTranslation, double xResIncrement, double yResIncrement)
 Rasters this mesh into a dense point cloud and stores the result. More...
 

Static Public Member Functions

static MeshPtr< T > FromFile (const String &fileName)
 Loads a mesh from file. More...
 
static MeshPtr< T > FromPointCloud (const SparsePointCloudPtr &pointCloud)
 Creates a mesh from a point cloud containing mesh information. More...
 

Detailed Description

template<class T>
class Cvb::Mesh< T >

3D mesh object consisting of polygons.

Member Function Documentation

◆ CalculateBoundingBox()

Cuboid CalculateBoundingBox ( ) const
inline

Calculates the minimum and maximum extent of the mesh.

Returns
The variable to receive the extent.
Exceptions
Anyexception derived from std::exception including CvbException.

◆ FromFile()

static MeshPtr< T > FromFile ( const String fileName)
inlinestatic

Loads a mesh from file.

Use a 3D point as type.

Parameters
[in]fileNameFile to load.
Returns
The typed mesh.
Exceptions
Anyexception derived from std::exception including CvbException.

◆ FromPointCloud()

static MeshPtr< T > FromPointCloud ( const SparsePointCloudPtr pointCloud)
inlinestatic

Creates a mesh from a point cloud containing mesh information.

Use a 3D point as type.

Attention
Note, that pointCloud is shared with the mesh. Do not forget to release pointCloud, as soon as the mesh is not used anymore and destroyed.
Parameters
[in]pointCloudShared pointer to point cloud with mesh information.
Returns
Shared pointer to the mesh
Exceptions
Anyexception derived from std::exception including CvbException and if mesh could not be created.

◆ NumPoints()

std::size_t NumPoints ( ) const
inlinenoexcept

Get the number of points in the mesh.

Returns
Number of points.
Exceptions
Doesnot throw any exception.

◆ NumPolygons()

std::size_t NumPolygons ( ) const
inlinenoexcept

Get the number of polygons in this mesh.

Returns
Number polygons.
Exceptions
Doesnot throw any exception.

◆ PointAt()

T PointAt ( std::size_t  index) const
inlinenoexcept

Gets the point at the specified index.

Parameters
[in]indexThe index.
Returns
A 3D point.
Exceptions
Doesnot throw any exception.

◆ PolygonAt()

Polygon3D< T > PolygonAt ( std::size_t  index) const
inline

Gets polygons for this mesh.

Parameters
[in]indexThe index.
Returns
The polygon at the given index.
Exceptions
Anyexception derived from std::exception including CvbException.

◆ PolygonIndicesAt()

std::vector< std::uint32_t > PolygonIndicesAt ( std::size_t  index) const
inline

Gets point indices for a polygon.

Parameters
[in]indexThe index.
Returns
A vector with the indices.
Exceptions
Anyexception derived from std::exception including CvbException.

◆ RasterDensePointCloud()

DensePointCloudPtr RasterDensePointCloud ( const Matrix3D cameraRotation,
Vector3D< double >  cameraTranslation,
double  xResIncrement,
double  yResIncrement 
)
inline

Rasters this mesh into a dense point cloud and stores the result.

Parameters
[in]cameraRotationRotation matrix for the camera.
[in]cameraTranslationTranslation vector for the camera.
[in]xResIncrementThe pixel size in x-direction.
[in]yResIncrementThe pixel size in y-direction.
Returns
A dense point cloud with the rastered mesh.
Exceptions
Anyexception derived from std::exception including CvbException.

◆ RasterDensePointCloudToDst()

void RasterDensePointCloudToDst ( const Matrix3D cameraRotation,
Vector3D< double >  cameraTranslation,
DensePointCloud denseCloud 
)
inline

Rasters this mesh into a dense point cloud and stores the result.

Parameters
[in]cameraRotationRotation matrix for the camera.
[in]cameraTranslationTranslation vector for the camera.
[in]denseCloudDense point cloud to store the rastered mesh in.
Exceptions
Anyexception derived from std::exception including CvbException.