OpenWalnut  1.5.0dev
Functions
tm_utils Namespace Reference

TriangleMesh utils. More...

Functions

std::shared_ptr< std::list< std::shared_ptr< WTriangleMesh > > > componentDecomposition (const WTriangleMesh &mesh)
 Decompose the given mesh into connected components. More...
 
std::ostream & operator<< (std::ostream &os, const WTriangleMesh &rhs)
 Prints for each mesh #vertices and #triangles, as well as each triangle with its positions. More...
 

Detailed Description

TriangleMesh utils.

Function Documentation

◆ componentDecomposition()

std::shared_ptr< std::list< std::shared_ptr< WTriangleMesh > > > tm_utils::componentDecomposition ( const WTriangleMesh mesh)

Decompose the given mesh into connected components.

Parameters
meshThe triangle mesh to decompose
Returns
List of components where each of them is a WTriangleMesh again.

Definition at line 705 of file WTriangleMesh.cpp.

References WUnionFind::find(), WTriangleMesh::getTriangles(), WTriangleMesh::getVertexArray(), WUnionFind::merge(), WTriangleMesh::triangleSize(), and WTriangleMesh::vertSize().

Referenced by WMTriangleMeshRenderer::renderMesh(), WTriangleMeshTest::testComponentDecomposition(), and WTriangleMeshTest::testComponentDecompositionOnEmptyMesh().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ operator<<()

std::ostream & tm_utils::operator<< ( std::ostream &  os,
const WTriangleMesh rhs 
)

Prints for each mesh #vertices and #triangles, as well as each triangle with its positions.

No point IDs are printed.

Parameters
osOutput stream to print on.
rhsThe mesh instance.
Returns
The output stream again for further usage.

Definition at line 682 of file WTriangleMesh.cpp.

References WTriangleMesh::getTriangles(), WTriangleMesh::getVertexArray(), WTriangleMesh::triangleSize(), and WTriangleMesh::vertSize().

+ Here is the call graph for this function: