Visual Computing Library  devel
Loading...
Searching...
No Matches
Mesh Statistic Algorithms

TODO. More...

Collaboration diagram for Mesh Statistic Algorithms:

Functions

template<MeshConcept MeshType>
auto vcl::boundingBox (const MeshType &m)
 Compute the bounding box of a mesh.
 
uint vcl::countPerFaceVertexReferences (const FaceMeshConcept auto &mesh)
 Count the number of references to vertices in the mesh faces.
 
uint vcl::countTriangulatedTriangles (const FaceMeshConcept auto &mesh)
 Counts the number of resulting triangles if the input mesh would be triangulated by splitting each face into triangles.
 
template<FaceMeshConcept MeshType>
uint vcl::countVerticesToDuplicateByWedgeTexCoords (const MeshType &mesh, std::vector< std::pair< uint, uint > > &vertWedgeMap=detail::dummyVectorOfPairs, std::list< uint > &vertsToDuplicate=detail::dummyUintList, std::list< std::list< std::pair< uint, uint > > > &facesToReassign=detail::dummyListOfLists)
 This function counts the number of vertices that must be duplicated in a mesh to have a unique texcoord per vertex, by checking the texcoords of the wedges of the mesh faces.
 
uint vcl::largestFaceSize (const FaceMeshConcept auto &mesh)
 Returns the largest face size in the mesh.
 

Detailed Description

TODO.

Function Documentation

◆ boundingBox()

template<MeshConcept MeshType>
auto vcl::boundingBox ( const MeshType &  m)

Compute the bounding box of a mesh.

Given a mesh m, this function computes and returns the bounding box of the mesh. The bounding box is represented by a vcl::Box object.

Template Parameters
MeshTypeThe type of the mesh. It must satisfy the MeshConcept.
Parameters
[in]mThe input mesh to compute the bounding box of
Returns
The bounding box of the input mesh

◆ countPerFaceVertexReferences()

uint vcl::countPerFaceVertexReferences ( const FaceMeshConcept auto mesh)

Count the number of references to vertices in the mesh faces.

If the mesh is a TriangleMesh, the number of references is equal to the number of faces times 3. Otherwise, the function counts the number of references to vertices in each face of the mesh.

Parameters
[in]meshThe input mesh. It must satisfy the MeshConcept.
Returns
The number of references to vertices in the mesh faces.

◆ countTriangulatedTriangles()

uint vcl::countTriangulatedTriangles ( const FaceMeshConcept auto mesh)

Counts the number of resulting triangles if the input mesh would be triangulated by splitting each face into triangles.

Parameters
[in]meshThe input mesh. It must satisfy the MeshConcept.
Returns
The number of resulting triangles if the input mesh would be triangulated by splitting each face into triangles.

◆ countVerticesToDuplicateByWedgeTexCoords()

template<FaceMeshConcept MeshType>
uint vcl::countVerticesToDuplicateByWedgeTexCoords ( const MeshType &  mesh,
std::vector< std::pair< uint, uint > > &  vertWedgeMap = detail::dummyVectorOfPairs,
std::list< uint > &  vertsToDuplicate = detail::dummyUintList,
std::list< std::list< std::pair< uint, uint > > > &  facesToReassign = detail::dummyListOfLists 
)

This function counts the number of vertices that must be duplicated in a mesh to have a unique texcoord per vertex, by checking the texcoords of the wedges of the mesh faces.

The function returns the number of vertices that must be duplicated (i.e., added to the mesh) to have a unique texcoord per vertex. The function also returns a vector that tells, for each vertex, the pair face/wedge index in the face that must be kept for the vertex, the list of vertices to duplicate, and the list of faces that must be reassigned to the duplicated vertices.

Parameters
[in]meshThe input mesh. It must satisfy the FaceMeshConcept and must have per-face wedge texcoords.
[out]vertWedgeMapA vector that tells, for each vertex, the pair face/wedge index in the face that must be kept for the vertex (it allows to index the texcoords of the vertex).
[out]vertsToDuplicatea list of vertices that must be duplicated (each element of the list is the index of the vertex to duplicate).
[out]facesToReassigna list of lists of pairs face/wedge index in the face that must be reassigned to the duplicated vertices (each list of pairs is the list of faces that must be reassigned to the corresponding duplicated vertex). The list contains a list for each vertex to duplicate.
Returns
The number of vertices that must be duplicated.

◆ largestFaceSize()

uint vcl::largestFaceSize ( const FaceMeshConcept auto mesh)

Returns the largest face size in the mesh.

If the mesh is a TriangleMesh, the function returns 3. Otherwise, the function returns the size of the largest face in the mesh.

Parameters
[in]meshThe input mesh. It must satisfy the MeshConcept.
Returns
The largest face size in the mesh.