59 #define MESHNAVIGATIONT_C
65 #include <OpenMesh/Core/Mesh/TriMesh_ArrayKernelT.hh>
66 #include <OpenMesh/Core/Geometry/MathDefs.hh>
75 template <
typename MeshT >
77 typename MeshT::HalfedgeHandle
78 opposite_halfedge(MeshT& _mesh ,
typename MeshT::HalfedgeHandle _he) {
79 typename MeshT::VertexOHalfedgeIter opp_he( _mesh , _he);
86 template <
typename MeshT >
88 typename MeshT::VertexHandle
89 findClosestBoundary(MeshT* _mesh ,
typename MeshT::VertexHandle _vh){
93 _mesh->add_property(visited,
"Visited Property" );
96 typename MeshT::VertexIter v_it, v_end = _mesh->vertices_end();
97 for( v_it = _mesh->vertices_begin(); v_it != v_end; ++v_it )
98 _mesh->property( visited, *v_it ) =
false;
100 std::queue< typename MeshT::VertexHandle > queue;
103 while(!queue.empty()){
104 typename MeshT::VertexHandle vh = queue.front();
106 if (_mesh->property(visited, vh))
continue;
108 for (
typename MeshT::VertexOHalfedgeIter voh_it(*_mesh,vh); voh_it.is_valid(); ++voh_it){
110 if ( _mesh->is_boundary(*voh_it) ){
111 _mesh->remove_property(visited);
112 return _mesh->to_vertex_handle(*voh_it);
114 queue.push( _mesh->to_vertex_handle(*voh_it) );
117 _mesh->property(visited, vh) =
true;
120 _mesh->remove_property(visited);
121 return typename MeshT::VertexHandle(-1);
Functions for getting information about a mesh.