ACloudViewer  3.9.4
A Modern Library for 3D Data Processing
cloudViewer::GenericIndexedMesh Class Referenceabstract

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

#include <GenericIndexedMesh.h>

Inheritance diagram for cloudViewer::GenericIndexedMesh:
Collaboration diagram for cloudViewer::GenericIndexedMesh:

Public Member Functions

 GenericIndexedMesh ()=default
 
 ~GenericIndexedMesh () override=default
 Default destructor. More...
 
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 void getTriangleVertices (unsigned triangleIndex, double A[3], double B[3], double C[3]) const =0
 
virtual VerticesIndexesgetNextTriangleVertIndexes ()=0
 
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 cloudViewer::GenericMesh
 GenericMesh ()=default
 
virtual ~GenericMesh ()=default
 Default destructor. More...
 
virtual unsigned size () const =0
 Returns the number of triangles. More...
 
virtual bool hasTriangles () const
 
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 cloudViewer::GenericMesh
enum class  SimplificationContraction { Average , Quadric }
 Indicates the method that is used for mesh simplification if multiple vertices are combined to a single one. More...
 
enum class  FilterScope { All , Color , Normal , Vertex }
 Indicates the scope of filter operations. More...
 
enum class  DeformAsRigidAsPossibleEnergy { Spokes , Smoothed }
 
using genericTriangleAction = std::function< void(GenericTriangle &)>
 Generic function to apply to a triangle (used by foreach) More...
 

Detailed Description

A generic mesh with index-based vertex access.

Implements the GenericMehs interface.

Definition at line 37 of file GenericIndexedMesh.h.

Constructor & Destructor Documentation

◆ GenericIndexedMesh()

cloudViewer::GenericIndexedMesh::GenericIndexedMesh ( )
default

◆ ~GenericIndexedMesh()

cloudViewer::GenericIndexedMesh::~GenericIndexedMesh ( )
overridedefault

Default destructor.

Member Function Documentation

◆ _getTriangle()

virtual GenericTriangle* cloudViewer::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 PyGenericIndexedMesh< GenericIndexedMeshBase >, ccMesh, cloudViewer::SimpleMesh, cloudViewer::Delaunay2dMesh, ccSubMesh, and ccMeshGroup.

Referenced by define_GenericIndexedMesh().

◆ getNextTriangleVertIndexes()

virtual VerticesIndexes* cloudViewer::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 PyGenericIndexedMesh< GenericIndexedMeshBase >, ccSubMesh, ccMeshGroup, ccMesh, cloudViewer::SimpleMesh, and cloudViewer::Delaunay2dMesh.

Referenced by cloudViewer::MeshSamplingTools::buildMeshEdgeUsageMap(), define_GenericIndexedMesh(), MAFilter::saveToFile(), and cloudViewer::ManualSegmentationTools::segmentMesh().

◆ getTriangleVertices() [1/2]

virtual void cloudViewer::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 PyGenericIndexedMesh< GenericIndexedMeshBase >, ccSubMesh, ccMeshGroup, ccMesh, cloudViewer::SimpleMesh, and cloudViewer::Delaunay2dMesh.

Referenced by ComparePointsAndTriangles().

◆ getTriangleVertices() [2/2]

virtual void cloudViewer::GenericIndexedMesh::getTriangleVertices ( unsigned  triangleIndex,
double  A[3],
double  B[3],
double  C[3] 
) const
pure virtual

◆ getTriangleVertIndexes()

virtual VerticesIndexes* cloudViewer::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 PyGenericIndexedMesh< GenericIndexedMeshBase >, ccSubMesh, ccMeshGroup, ccMesh, cloudViewer::SimpleMesh, and cloudViewer::Delaunay2dMesh.

Referenced by ccCropTool::Crop(), MergeOldTriangles(), cloudViewer::ManualSegmentationTools::segmentMeshWithAABox(), cloudViewer::ManualSegmentationTools::segmentMeshWithAAPlane(), and ToFbxMesh().

◆ interpolateNormals()

virtual bool cloudViewer::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 PyGenericIndexedMesh< GenericIndexedMeshBase >, ccSubMesh, ccMeshGroup, ccMesh, and cloudViewer::SimpleMesh.

Definition at line 89 of file GenericIndexedMesh.h.

◆ normalsAvailable()

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

Returns whether normals are available.

Reimplemented in PyGenericIndexedMesh< GenericIndexedMeshBase >, ccMesh, ccGenericMesh, and cloudViewer::SimpleMesh.

Definition at line 80 of file GenericIndexedMesh.h.


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