53 #define MESHNAVIGATIONT_C 59 #include <OpenMesh/Core/Mesh/TriMesh_ArrayKernelT.hh> 60 #include <OpenMesh/Core/Geometry/MathDefs.hh> 69 template <
typename MeshT >
71 typename MeshT::HalfedgeHandle
73 typename MeshT::VertexOHalfedgeIter opp_he( _mesh , _he);
80 template <
typename MeshT >
82 typename MeshT::VertexHandle
87 _mesh->add_property(visited,
"Visited Property" );
90 typename MeshT::VertexIter v_it, v_end = _mesh->vertices_end();
91 for( v_it = _mesh->vertices_begin(); v_it != v_end; ++v_it )
92 _mesh->property( visited, *v_it ) =
false;
94 std::queue< typename MeshT::VertexHandle > queue;
97 while(!queue.empty()){
98 typename MeshT::VertexHandle vh = queue.front();
100 if (_mesh->property(visited, vh))
continue;
102 for (
typename MeshT::VertexOHalfedgeIter voh_it(*_mesh,vh); voh_it.is_valid(); ++voh_it){
104 if ( _mesh->is_boundary(*voh_it) ){
105 _mesh->remove_property(visited);
106 return _mesh->to_vertex_handle(*voh_it);
108 queue.push( _mesh->to_vertex_handle(*voh_it) );
111 _mesh->property(visited, vh) =
true;
114 _mesh->remove_property(visited);
115 return typename MeshT::VertexHandle(-1);
MeshT::VertexHandle findClosestBoundary(MeshT *_mesh, typename MeshT::VertexHandle _vh)
Find the closest boundary vertex to another vertex.
MeshT::HalfedgeHandle opposite_halfedge(MeshT &_mesh, typename MeshT::HalfedgeHandle _he)
Functions for getting information about a mesh.