CCCoreLib 31 May 2022
CloudCompare Core algorithms
Public Member Functions | List of all members
CCCoreLib::GenericIndexedMesh Class Referenceabstract

A generic mesh with index-based vertex access. More...

#include <GenericIndexedMesh.h>

Inheritance diagram for CCCoreLib::GenericIndexedMesh:
Inheritance graph
[legend]
Collaboration diagram for CCCoreLib::GenericIndexedMesh:
Collaboration graph
[legend]

Public Member Functions

 ~GenericIndexedMesh () override=default
 Default destructor.
 
virtual GenericTriangle_getTriangle (unsigned triangleIndex)=0
 Returns the ith triangle. More...
 
virtual VerticesIndexesgetTriangleVertIndexes (unsigned triangleIndex)=0
 Returns the indexes of the vertices of a given triangle. More...
 
virtual void getTriangleVertices (unsigned triangleIndex, CCVector3 &A, CCVector3 &B, CCVector3 &C) const =0
 Returns the vertices of a given triangle. More...
 
virtual VerticesIndexesgetNextTriangleVertIndexes ()=0
 Returns the indexes of the vertices of the next triangle (relatively to the global iterator position) More...
 
virtual bool normalsAvailable () const
 Returns whether normals are available. More...
 
virtual bool interpolateNormals (unsigned triIndex, const CCVector3 &P, CCVector3 &N)
 Interpolates normal(s) inside a given triangle. More...
 
- Public Member Functions inherited from CCCoreLib::GenericMesh
virtual ~GenericMesh ()=default
 Default destructor.
 
virtual unsigned size () const =0
 Returns the number of triangles. More...
 
virtual void forEach (genericTriangleAction action)=0
 Fast iteration mechanism. More...
 
virtual void getBoundingBox (CCVector3 &bbMin, CCVector3 &bbMax)=0
 Returns the mesh bounding-box. More...
 
virtual void placeIteratorAtBeginning ()=0
 Places the mesh iterator at the beginning. More...
 
virtual GenericTriangle_getNextTriangle ()=0
 Returns the next triangle (relatively to the global iterator position) More...
 

Additional Inherited Members

- Public Types inherited from CCCoreLib::GenericMesh
using genericTriangleAction = std::function< void(GenericTriangle &)>
 Generic function to apply to a triangle (used by foreach)
 

Detailed Description

A generic mesh with index-based vertex access.

Implements the GenericMesh interface.

Member Function Documentation

◆ _getTriangle()

virtual GenericTriangle * CCCoreLib::GenericIndexedMesh::_getTriangle ( unsigned  triangleIndex)
pure virtual

Returns the ith triangle.

Virtual method to request a triangle with a specific index. The returned object can be temporary.

Parameters
triangleIndexof the requested triangle (between 0 and the mesh size-1)
Returns
the requested triangle, or 0 if index value is not valid

Implemented in CCCoreLib::Delaunay2dMesh, and CCCoreLib::SimpleMesh.

◆ getNextTriangleVertIndexes()

virtual VerticesIndexes * CCCoreLib::GenericIndexedMesh::getNextTriangleVertIndexes ( )
pure virtual

Returns the indexes of the vertices of the next triangle (relatively to the global iterator position)

Returns
the triangle indexes (or 0 if the global iterator is out of bounds)

Implemented in CCCoreLib::Delaunay2dMesh, and CCCoreLib::SimpleMesh.

◆ getTriangleVertices()

virtual void CCCoreLib::GenericIndexedMesh::getTriangleVertices ( unsigned  triangleIndex,
CCVector3 A,
CCVector3 B,
CCVector3 C 
) const
pure virtual

Returns the vertices of a given triangle.

Parameters
[in]triangleIndexindex of the triangle (between 0 and the size(mesh)-1)
[out]Afirst vertex
[out]Bsecond vertex
[out]Cthird vertex

Implemented in CCCoreLib::Delaunay2dMesh, and CCCoreLib::SimpleMesh.

◆ getTriangleVertIndexes()

virtual VerticesIndexes * CCCoreLib::GenericIndexedMesh::getTriangleVertIndexes ( unsigned  triangleIndex)
pure virtual

Returns the indexes of the vertices of a given triangle.

Parameters
triangleIndexindex of the triangle (between 0 and size(mesh)-1)
Returns
the triangle indexes (or 0 if index value is not valid)

Implemented in CCCoreLib::Delaunay2dMesh, and CCCoreLib::SimpleMesh.

◆ interpolateNormals()

virtual bool CCCoreLib::GenericIndexedMesh::interpolateNormals ( unsigned  triIndex,
const CCVector3 P,
CCVector3 N 
)
inlinevirtual

Interpolates normal(s) inside a given triangle.

This method should be ideally overriden by the child class if normals are supported

Parameters
[in]triIndextriangle index
[in]Ppoint where to interpolate (should be inside the triangle!)
[out]Ninterpolated normal
Returns
success

Reimplemented in CCCoreLib::SimpleMesh.

◆ normalsAvailable()

virtual bool CCCoreLib::GenericIndexedMesh::normalsAvailable ( ) const
inlinevirtual

Returns whether normals are available.

Reimplemented in CCCoreLib::SimpleMesh.


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