From fa465cb05e45163b225e25961d9290c943d837f1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20M=C3=B6bius?= Date: Wed, 21 Feb 2024 10:53:01 +0100 Subject: [PATCH] Added some basic holefiller doc --- Doc/holefiller.docu | 21 +++++++++++++ Doc/tools.docu | 1 + src/OpenMesh/Tools/HoleFiller/HoleFillerT.hh | 6 ++-- .../Tools/HoleFiller/HoleFillerT_impl.hh | 30 +++++++++---------- src/Unittests/unittests_holefiller.cc | 2 +- 5 files changed, 41 insertions(+), 19 deletions(-) create mode 100644 Doc/holefiller.docu diff --git a/Doc/holefiller.docu b/Doc/holefiller.docu new file mode 100644 index 00000000..acfb0e4a --- /dev/null +++ b/Doc/holefiller.docu @@ -0,0 +1,21 @@ +//----------------------------------------------------------------------------- + +/** \page holefiller_docu Mesh Hole Filler + +\section HoleFillerAlgo The holefilling algorithm + + The holefiller (OpenMesh::HoleFiller::HoleFillerT) provides a + hole filling algorith based on the Filling Holes in Meshes paper + by Liepa in 2003. + + \code + + // Initialize holefiller + OpenMesh::HoleFiller::HoleFillerT filler(mesh_); + + // Execute the algorithm and fill all holes + filler.fill_all_holes(); + \endcode + +*/ + diff --git a/Doc/tools.docu b/Doc/tools.docu index 7ae8c68a..28fb8d17 100644 --- a/Doc/tools.docu +++ b/Doc/tools.docu @@ -6,6 +6,7 @@ \li \subpage subdivider_docu \li \subpage vdpm_docu \li \subpage smoother_docu +\li \subpage holefiller_docu \li \subpage smarttagger_docu \li Miscellaneous OpenMesh::StripifierT diff --git a/src/OpenMesh/Tools/HoleFiller/HoleFillerT.hh b/src/OpenMesh/Tools/HoleFiller/HoleFillerT.hh index 5eeebd5d..bbdb449d 100644 --- a/src/OpenMesh/Tools/HoleFiller/HoleFillerT.hh +++ b/src/OpenMesh/Tools/HoleFiller/HoleFillerT.hh @@ -50,7 +50,7 @@ namespace OpenMesh { namespace HoleFiller { template< class MeshT > -class HoleFiller +class HoleFillerT { typedef typename MeshT::Point Point; typedef typename MeshT::Scalar Scalar; @@ -58,8 +58,8 @@ class HoleFiller public: // Ctors - explicit HoleFiller( MeshT & _mesh ); - ~HoleFiller(); + explicit HoleFillerT( MeshT & _mesh ); + ~HoleFillerT(); /** Identify and fill all holes of the mesh. * diff --git a/src/OpenMesh/Tools/HoleFiller/HoleFillerT_impl.hh b/src/OpenMesh/Tools/HoleFiller/HoleFillerT_impl.hh index 31e65258..369bf3f5 100644 --- a/src/OpenMesh/Tools/HoleFiller/HoleFillerT_impl.hh +++ b/src/OpenMesh/Tools/HoleFiller/HoleFillerT_impl.hh @@ -53,7 +53,7 @@ namespace OpenMesh { namespace HoleFiller { template< class MeshT > -HoleFiller< MeshT >::HoleFiller(MeshT &_mesh ) +HoleFillerT< MeshT >::HoleFillerT(MeshT &_mesh ) : mesh_( _mesh ) { mesh_.request_vertex_status(); @@ -69,7 +69,7 @@ HoleFiller< MeshT >::HoleFiller(MeshT &_mesh ) template< class MeshT > -HoleFiller< MeshT >::~HoleFiller() +HoleFillerT< MeshT >::~HoleFillerT() { mesh_.release_vertex_status(); mesh_.release_edge_status(); @@ -88,7 +88,7 @@ HoleFiller< MeshT >::~HoleFiller() template< class MeshT > void -HoleFiller< MeshT >::fill_all_holes( int _stages ) +HoleFillerT< MeshT >::fill_all_holes( int _stages ) { @@ -134,7 +134,7 @@ HoleFiller< MeshT >::fill_all_holes( int _stages ) template< class MeshT > void -HoleFiller< MeshT >::fill_hole(typename MeshT::EdgeHandle _eh, int _stages ) +HoleFillerT< MeshT >::fill_hole(typename MeshT::EdgeHandle _eh, int _stages ) { omlog() << " Stage 1 : Computing a minimal triangulation ... "; @@ -248,7 +248,7 @@ HoleFiller< MeshT >::fill_hole(typename MeshT::EdgeHandle _eh, int _stages ) /// path fairing template< class MeshT > void -HoleFiller< MeshT >::fairing( std::vector< OpenMesh::SmartFaceHandle >& _faceHandles ){ +HoleFillerT< MeshT >::fairing( std::vector< OpenMesh::SmartFaceHandle >& _faceHandles ){ //generate vector of all edges hole_edge_.clear(); @@ -374,7 +374,7 @@ HoleFiller< MeshT >::fairing( std::vector< OpenMesh::SmartFaceHandle >& _faceHan template< class MeshT > bool -HoleFiller< MeshT >::refine(typename MeshT::FaceHandle _fh ) +HoleFillerT< MeshT >::refine(typename MeshT::FaceHandle _fh ) { // Collect the three edges of the face into e0, e1, e2 @@ -462,7 +462,7 @@ HoleFiller< MeshT >::refine(typename MeshT::FaceHandle _fh ) template< class MeshT > bool -HoleFiller< MeshT >::relax_edge( OpenMesh::SmartEdgeHandle _eh ) +HoleFillerT< MeshT >::relax_edge( OpenMesh::SmartEdgeHandle _eh ) { if ( mesh_.status( _eh ).locked() ) return false; @@ -508,7 +508,7 @@ HoleFiller< MeshT >::relax_edge( OpenMesh::SmartEdgeHandle _eh ) template< class MeshT > bool -HoleFiller< MeshT >::in_circumsphere( const Point & _x, +HoleFillerT< MeshT >::in_circumsphere( const Point & _x, const Point & _a, const Point & _b, const Point & _c ) const @@ -550,7 +550,7 @@ HoleFiller< MeshT >::in_circumsphere( const Point & _x, template< class MeshT > bool -HoleFiller< MeshT >::fill( int _i, int _j ) +HoleFillerT< MeshT >::fill( int _i, int _j ) { // If the two vertices _i and _j are adjacent, there is nothing to do. @@ -595,8 +595,8 @@ HoleFiller< MeshT >::fill( int _i, int _j ) template< class MeshT > -typename HoleFiller< MeshT >::Weight -HoleFiller< MeshT >::weight( int _i, int _j, int _k ) +typename HoleFillerT< MeshT >::Weight +HoleFillerT< MeshT >::weight( int _i, int _j, int _k ) { // Return an infinite weight if the insertion of this triangle // would create complex edges. @@ -665,7 +665,7 @@ HoleFiller< MeshT >::weight( int _i, int _j, int _k ) template< class MeshT > bool -HoleFiller< MeshT >::exists_edge( OpenMesh::SmartVertexHandle _u, typename MeshT::VertexHandle _w ) +HoleFillerT< MeshT >::exists_edge( OpenMesh::SmartVertexHandle _u, typename MeshT::VertexHandle _w ) { for ( auto vohi : _u.outgoing_halfedges() ) if ( ! vohi.edge().is_boundary() ) @@ -686,7 +686,7 @@ HoleFiller< MeshT >::exists_edge( OpenMesh::SmartVertexHandle _u, typename MeshT template< class MeshT > typename MeshT::Scalar -HoleFiller< MeshT >::area( typename MeshT::VertexHandle _a, typename MeshT::VertexHandle _b, typename MeshT::VertexHandle _c ) +HoleFillerT< MeshT >::area( typename MeshT::VertexHandle _a, typename MeshT::VertexHandle _b, typename MeshT::VertexHandle _c ) { Point a( mesh_.point( _a ) ); Point b( mesh_.point( _b ) ); @@ -711,7 +711,7 @@ HoleFiller< MeshT >::area( typename MeshT::VertexHandle _a, typename MeshT::Vert template< class MeshT > typename MeshT::Scalar -HoleFiller< MeshT >::dihedral_angle( typename MeshT::VertexHandle _u, typename MeshT::VertexHandle _v, typename MeshT::VertexHandle _a, typename MeshT::VertexHandle _b ) +HoleFillerT< MeshT >::dihedral_angle( typename MeshT::VertexHandle _u, typename MeshT::VertexHandle _v, typename MeshT::VertexHandle _a, typename MeshT::VertexHandle _b ) { Point u( mesh_.point( _u ) ); Point v( mesh_.point( _v ) ); @@ -731,7 +731,7 @@ HoleFiller< MeshT >::dihedral_angle( typename MeshT::VertexHandle _u, typename M /// remove degenerated faces template< class MeshT > void -HoleFiller< MeshT >::removeDegeneratedFaces( std::vector< typename MeshT::FaceHandle >& _faceHandles ){ +HoleFillerT< MeshT >::removeDegeneratedFaces( std::vector< typename MeshT::FaceHandle >& _faceHandles ){ for (int i = _faceHandles.size()-1; i >= 0 ; i--){ diff --git a/src/Unittests/unittests_holefiller.cc b/src/Unittests/unittests_holefiller.cc index 00a8936e..5045f430 100644 --- a/src/Unittests/unittests_holefiller.cc +++ b/src/Unittests/unittests_holefiller.cc @@ -48,7 +48,7 @@ TEST_F(OpenMeshHoleFiller_Triangle,Triangle_Hole_Filling) { // Initialize subdivider - OpenMesh::HoleFiller::HoleFiller filler(mesh_); + OpenMesh::HoleFiller::HoleFillerT filler(mesh_); // Execute the algorithm