mirror of https://github.com/CGAL/cgal
Fix point selection in Point_inside_polyhedron_plugin
This commit is contained in:
parent
251bced65e
commit
e510659370
|
|
@ -142,39 +142,27 @@ public Q_SLOTS:
|
||||||
QString("Constructing with %1 items is done in %2 sec.").arg(inside_smesh_testers.size()).arg(timer.time()));
|
QString("Constructing with %1 items is done in %2 sec.").arg(inside_smesh_testers.size()).arg(timer.time()));
|
||||||
timer.reset();
|
timer.reset();
|
||||||
|
|
||||||
std::size_t nb_query = 0, nb_selected = 0;// for print message
|
std::size_t nb_selected = 0;
|
||||||
for(std::vector<Point_set*>::iterator point_set_it = point_sets.begin();
|
for (Point_set* point_set : point_sets)
|
||||||
point_set_it != point_sets.end(); ++point_set_it)
|
point_set->set_first_selected
|
||||||
{
|
(std::partition
|
||||||
Point_set* point_set = *point_set_it;
|
(point_set->begin(), point_set->end(),
|
||||||
for (std::size_t pt = 0;
|
[&](const Point_set::Index& idx) -> bool
|
||||||
pt < point_set->size() - point_set->nb_selected_points();
|
{
|
||||||
++ pt, ++ nb_query)
|
for (const Point_inside_smesh* tester : inside_smesh_testers)
|
||||||
{
|
|
||||||
bool selected = false;
|
|
||||||
Point_set::iterator point_it = point_set->begin() + pt;
|
|
||||||
if(! selected){
|
|
||||||
// now the same for the smeshs
|
|
||||||
point_it = point_set->begin() + pt;
|
|
||||||
for (std::size_t i = 0; i < inside_smesh_testers.size(); ++i)
|
|
||||||
{
|
{
|
||||||
CGAL::Bounded_side res = (*inside_smesh_testers[i])(point_set->point(*point_it));
|
CGAL::Bounded_side res = (*tester)(point_set->point(idx));
|
||||||
|
if ( (inside && res == CGAL::ON_BOUNDED_SIDE) ||
|
||||||
if( (inside && res == CGAL::ON_BOUNDED_SIDE) ||
|
(on_boundary && res == CGAL::ON_BOUNDARY) ||
|
||||||
(on_boundary && res == CGAL::ON_BOUNDARY) ||
|
(outside && res == CGAL::ON_UNBOUNDED_SIDE) )
|
||||||
(outside && res == CGAL::ON_UNBOUNDED_SIDE) )
|
{
|
||||||
{
|
++ nb_selected;
|
||||||
point_set->select(*point_it); ++nb_selected;
|
return false;
|
||||||
-- pt; // Selection replaces current point with unselected one
|
}
|
||||||
selected = true;
|
|
||||||
break;//loop on i
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
return true;
|
||||||
} // loop on points in point_set
|
}));
|
||||||
}// loop on selected point sets
|
|
||||||
|
|
||||||
print_message(QString("Querying with %1 points is done in %2 sec.").arg(nb_query).arg(timer.time()));
|
|
||||||
print_message(QString("%1 points are selected. All Done!").arg(nb_selected));
|
print_message(QString("%1 points are selected. All Done!").arg(nb_selected));
|
||||||
|
|
||||||
// delete testers
|
// delete testers
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue