mirror of https://github.com/CGAL/cgal
nicer applicable
This commit is contained in:
parent
81f0c7152a
commit
b4a44aa9ec
|
|
@ -30,11 +30,9 @@ class Polyhedron_demo_intersection_plugin :
|
|||
public:
|
||||
|
||||
bool applicable(QAction*) const {
|
||||
int nb_selected=0;
|
||||
Q_FOREACH(CGAL::Three::Scene_interface::Item_id index, scene->selectionIndices())
|
||||
if ( qobject_cast<Scene_polyhedron_item*>(scene->item(index)) )
|
||||
++nb_selected;
|
||||
return nb_selected==2;
|
||||
return scene->selectionIndices().size() == 2 &&
|
||||
qobject_cast<Scene_polyhedron_item*>(scene->item(scene->selectionIndices().first())) &&
|
||||
qobject_cast<Scene_polyhedron_item*>(scene->item(scene->selectionIndices().last()));
|
||||
}
|
||||
|
||||
QList<QAction*> actions() const {
|
||||
|
|
|
|||
|
|
@ -29,12 +29,10 @@ class Polyhedron_demo_intersection_plugin :
|
|||
|
||||
public:
|
||||
|
||||
bool applicable(QAction*) const {
|
||||
int nb_selected=0;
|
||||
Q_FOREACH(CGAL::Three::Scene_interface::Item_id index, scene->selectionIndices())
|
||||
if ( qobject_cast<Scene_surface_mesh_item*>(scene->item(index)) )
|
||||
++nb_selected;
|
||||
return nb_selected==2;
|
||||
bool applicable(QAction*) const {
|
||||
return scene->selectionIndices().size() == 2 &&
|
||||
qobject_cast<Scene_surface_mesh_item*>(scene->item(scene->selectionIndices().first())) &&
|
||||
qobject_cast<Scene_surface_mesh_item*>(scene->item(scene->selectionIndices().last()));
|
||||
}
|
||||
|
||||
QList<QAction*> actions() const {
|
||||
|
|
|
|||
Loading…
Reference in New Issue