Commit 7990676c authored by Hans-Christian Ebke's avatar Hans-Christian Ebke

MeshTools: Added function to grow edge selections.


git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@18262 383ad7c9-94d9-4d36-a494-682f7c89f535
parent bdd29634
......@@ -57,6 +57,7 @@
#include <OpenMesh/Core/Mesh/TriMesh_ArrayKernelT.hh>
#include <stack>
#include <set>
//== NAMESPACES ===============================================================
namespace MeshSelection {
......@@ -572,6 +573,35 @@ void invertEdgeSelection(MeshT* _mesh) {
//=========================================================
template<typename MeshT>
inline
void growEdgeSelection(MeshT* _mesh) {
std::set<typename MeshT::EdgeHandle> selectedEhs;
for (typename MeshT::EdgeIter e_it = _mesh->edges_begin(), e_end = _mesh->edges_end();
e_it != e_end; ++e_it) {
if (!_mesh->status(*e_it).selected()) continue;
const typename MeshT::HalfedgeHandle he = _mesh->halfedge_handle(*e_it, 0);
const typename MeshT::VertexHandle vhs[] = { _mesh->from_vertex_handle(he),
_mesh->to_vertex_handle(he) };
for (int i = 0; i < 2; ++i) {
for (typename MeshT::VertexEdgeIter ve_it = _mesh->ve_begin(vhs[i]), ve_end = _mesh->ve_end(vhs[i]);
ve_it != ve_end; ++ve_it) {
selectedEhs.insert(ve_it.handle());
}
}
}
for (typename std::set<typename MeshT::EdgeHandle>::const_iterator it = selectedEhs.begin(); it != selectedEhs.end(); ++it)
_mesh->status(*it).set_selected(true);
}
//=========================================================
template< typename MeshT >
inline
......
......@@ -276,6 +276,11 @@ template< typename MeshT >
inline
void invertEdgeSelection(MeshT* _mesh);
/// Invert Edge selection
template< typename MeshT >
inline
void growEdgeSelection(MeshT* _mesh);
/// Select all boundary edges of a mesh
template< typename MeshT >
void selectBoundaryEdges(MeshT* _mesh);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment