Go to the documentation of this file.
13 #include <boost/graph/graph_traits.hpp>
45 template<
typename FaceGraph>
47 bool remove_isolated_vertices=
true,
48 bool remove_isolated_edges=
true,
49 bool remove_isolated_faces=
false,
50 bool remove_similar_edges=
true,
51 bool remove_similar_faces=
true)
54 if(remove_isolated_faces)
56 std::vector< typename boost::graph_traits<FaceGraph>::face_descriptor > f_to_remove;
57 auto iterator_pair_f =
faces(g);
58 auto fi = iterator_pair_f.first;
59 auto fi_end = iterator_pair_f.second;
60 for (; fi != fi_end; ++fi)
63 f_to_remove.push_back(*fi);
65 if (!f_to_remove.empty())
68 f_to_remove.begin(), f_to_remove.end(), g);
70 if(remove_isolated_edges)
72 std::vector< typename boost::graph_traits<FaceGraph>::edge_descriptor > e_to_remove;
73 auto iterator_pair_e =
edges(g);
74 auto ei = iterator_pair_e.first;
75 auto ei_end = iterator_pair_e.second;
76 for (; ei != ei_end; ++ei)
79 e_to_remove.push_back(*ei);
81 if (!e_to_remove.empty())
84 e_to_remove.begin(), e_to_remove.end(), g);
86 if(remove_isolated_vertices)
90 auto vi = iterator_pair_v.first;
91 auto vi_end = iterator_pair_v.second;
92 for (; vi != vi_end; ++vi)
95 v_to_remove.push_back(*vi);
97 std::sort(v_to_remove.begin(),
102 return v1->GetIndex() > v2->GetIndex();
104 if (!v_to_remove.empty())
107 v_to_remove.begin(), v_to_remove.end(), g);
111 if(remove_similar_faces)
113 if(remove_similar_edges)
std::pair< typename boost::graph_traits< FEVV::DataStructures::AIF::AIFMesh >::vertex_iterator, typename boost::graph_traits< FEVV::DataStructures::AIF::AIFMesh >::vertex_iterator > vertices(const FEVV::DataStructures::AIF::AIFMesh &sm)
Returns the iterator range of the vertices of the mesh.
static void remove_faces(InputIt first, InputIt last, MeshType &mesh)
static bool is_isolated_edge(edge_descriptor edge)
static bool is_isolated_face(face_descriptor face)
std::pair< typename boost::graph_traits< FEVV::DataStructures::AIF::AIFMesh >::edge_iterator, typename boost::graph_traits< FEVV::DataStructures::AIF::AIFMesh >::edge_iterator > edges(const FEVV::DataStructures::AIF::AIFMesh &sm)
Returns the iterator range of the edges of the mesh.
static void remove_edges(InputIt first, InputIt last, MeshType &mesh)
static void resolve_similar_edges(MutableFaceIncidentGraph &g)
Remove/resolve similar edges for the given mesh g.
bool clean_topology(FaceGraph &g, bool remove_isolated_vertices=true, bool remove_isolated_edges=true, bool remove_isolated_faces=false, bool remove_similar_edges=true, bool remove_similar_faces=true)
Function use for cleaning the topology of mesh g. This can be seen as a preprocessing step for some g...
boost::graph_traits< MeshT >::edges_size_type size_of_edges(const MeshT &g)
Real current number of edges of the mesh. Generic version.
static void resolve_similar_faces(MutableFaceIncidentGraph &g, bool take_into_account_face_rientation=false)
Remove/resolve similar faces for the given mesh g.
Interfaces for plugins These interfaces will be used for different plugins.
std::pair< typename boost::graph_traits< FEVV::DataStructures::AIF::AIFMesh >::face_iterator, typename boost::graph_traits< FEVV::DataStructures::AIF::AIFMesh >::face_iterator > faces(const FEVV::DataStructures::AIF::AIFMesh &sm)
Returns an iterator range over all faces of the mesh.
static bool is_isolated_vertex(vertex_descriptor vertex)
boost::graph_traits< MeshT >::faces_size_type size_of_faces(const MeshT &g)
Real current number of faces of the mesh. Generic version.
boost::graph_traits< MeshT >::vertex_descriptor vertex_descriptor
static void remove_vertices(InputIt first, InputIt last, MeshType &mesh)