60 if ( !_mesh->get_property_handle(visited,
"visited") )
61 _mesh->add_property(visited,
"visited");
64 for (
auto f_it : _mesh->faces()) {
65 _mesh->property(visited, f_it) =
false;
71 fh = *(_mesh->faces_begin());
72 _mesh->property(visited, fh) =
true;
77 std::vector< typename OpenMesh::SmartFaceHandle > handles;
78 handles.push_back( fh );
81 while( handles.size() > 0 ){
86 for (
auto ff_it : current.
faces() )
87 if ( ! _mesh->property(visited, ff_it) ){
88 _mesh->property(visited, ff_it) =
true;
89 handles.push_back( ff_it );
94 for (
auto f_it : _mesh->faces()) {
96 if ( _mesh->property(visited, f_it) )
103 _copy->garbage_collection();
104 _mesh->garbage_collection();
106 _mesh->remove_property(visited);
116 if ( !_mesh->get_property_handle(visited,
"visited") )
117 _mesh->add_property(visited,
"visited");
119 std::vector<typename OpenMesh::SmartFaceHandle> facesInBiggest;
121 for (
auto fIter : _mesh->faces())
123 if (_mesh->property(visited,fIter))
127 std::vector<typename OpenMesh::SmartFaceHandle> componentFaces;
128 componentFaces.push_back(fIter);
130 for(std::size_t i = 0; i < componentFaces.size(); ++i )
133 for (
auto ffIter : componentFaces[i].faces())
135 if (!ffIter.is_valid())
136 std::cout <<
"handleId: " << ffIter << std::endl;
137 if (ffIter.is_valid() && !_mesh->property(visited,ffIter) )
139 _mesh->property(visited,ffIter) =
true;
140 componentFaces.push_back(ffIter);
146 if (facesInBiggest.size() < componentFaces.size())
148 std::swap(facesInBiggest,componentFaces);
151 _mesh->remove_property(visited);
154 for (
auto iter : facesInBiggest)
156 _mesh->status(iter).set_selected(
true);