From 88b2d599b837db9b8422f071e12fdf80ab7acd94 Mon Sep 17 00:00:00 2001 From: Laurent Rineau Date: Thu, 24 Jan 2013 18:05:16 +0100 Subject: [PATCH] Bug fix to Polyhedron_demo_triangulate_facets_plugin::applicable() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The following commit: | commit 1bc5244886f9ab7dd46b95c2e50a89f7377ff809 | Author: Philipp Möller | Date: Wed Jul 11 13:15:37 2012 +0000 | | Filter the Operations menu by querying plug-ins for the applicability. | | Some meta-programming might make that mechanism less boiler-plate-y, | but it is fine for now. | | Notes: | r70473 branches/features/Point_set_and_Polyhedron_demo-merge-GF was not right for triangulate_facets_plugin. The applicable() must aknowledge the fact that the triangulate_facets_plugin can triangulate a collection of polyhedra, and not only one. --- .../Polyhedron_demo_triangulate_facets_plugin.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Polyhedron/demo/Polyhedron/Polyhedron_demo_triangulate_facets_plugin.cpp b/Polyhedron/demo/Polyhedron/Polyhedron_demo_triangulate_facets_plugin.cpp index 55db648ec36..99e8dc370f3 100644 --- a/Polyhedron/demo/Polyhedron/Polyhedron_demo_triangulate_facets_plugin.cpp +++ b/Polyhedron/demo/Polyhedron/Polyhedron_demo_triangulate_facets_plugin.cpp @@ -42,7 +42,11 @@ public: } bool applicable() const { - return qobject_cast(scene->item(scene->mainSelectionIndex())); + Q_FOREACH(Scene_interface::Item_id index, scene->selectionIndices()) { + Scene_polyhedron_item* item = qobject_cast(scene->item(index)); + if(!item) return false; + } + return true; }