From 8d79689fd3aea71d00e62da397e627af804b10f4 Mon Sep 17 00:00:00 2001 From: Maxime Gimeno Date: Tue, 2 Aug 2016 12:10:08 +0200 Subject: [PATCH] Set the normals of the corresponding points to the plane's normal in shape_detection. --- .../Plugins/Point_set/Point_set_shape_detection_plugin.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Polyhedron/demo/Polyhedron/Plugins/Point_set/Point_set_shape_detection_plugin.cpp b/Polyhedron/demo/Polyhedron/Plugins/Point_set/Point_set_shape_detection_plugin.cpp index e79231d2498..5b0bac801b6 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/Point_set/Point_set_shape_detection_plugin.cpp +++ b/Polyhedron/demo/Polyhedron/Plugins/Point_set/Point_set_shape_detection_plugin.cpp @@ -282,6 +282,12 @@ void Polyhedron_demo_point_set_shape_detection_plugin::on_actionDetect_triggered } else if (dynamic_cast *>(shape.get())) { + CGAL::Shape_detection_3::Plane * plane = dynamic_cast *>(shape.get()); + + //set normals for point_item to the plane's normal + for(Point_set::iterator it = point_item->point_set()->begin(); it != point_item->point_set()->end(); ++it) + it->normal() = plane->plane_normal(); + if(scene->item_id(groups[0]) == -1) scene->addItem(groups[0]); scene->changeGroup(point_item, groups[0]);