From 371e3008b8356538d2b68aac4e90f1f844bc4dfc Mon Sep 17 00:00:00 2001 From: Maxime Gimeno Date: Tue, 14 Jun 2016 14:26:58 +0200 Subject: [PATCH] Enhancement - Adds a warning when the Parameterization_plugin is used on a polyhedron without borders. --- .../Plugins/Surface_mesh/Parameterization_plugin.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/Polyhedron/demo/Polyhedron/Plugins/Surface_mesh/Parameterization_plugin.cpp b/Polyhedron/demo/Polyhedron/Plugins/Surface_mesh/Parameterization_plugin.cpp index 5611f44eac5..05d1e3597ab 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/Surface_mesh/Parameterization_plugin.cpp +++ b/Polyhedron/demo/Polyhedron/Plugins/Surface_mesh/Parameterization_plugin.cpp @@ -7,6 +7,7 @@ #include "Scene_textured_polyhedron_item.h" #include "Textured_polyhedron_type.h" #include "Polyhedron_type.h" +#include "Messages_interface.h" #include @@ -41,10 +42,11 @@ public: void init(QMainWindow* mainWindow, Scene_interface* scene_interface, - Messages_interface*) + Messages_interface* m_i) { mw = mainWindow; scene = scene_interface; + message = m_i; QAction* actionMVC = new QAction("Mean Value Coordinates", mw); QAction* actionDCP = new QAction ("Discrete Conformal Map", mw); QAction* actionLSC = new QAction("Least Square Conformal Map", mw); @@ -77,6 +79,7 @@ protected: void parameterize(Parameterization_method method); private: QList _actions; + Messages_interface* message; }; // end Polyhedron_demo_parameterization_plugin @@ -89,7 +92,9 @@ void Polyhedron_demo_parameterization_plugin::parameterize(const Parameterizatio qobject_cast(scene->item(index)); if(!poly_item) return; - + poly_item->polyhedron()->normalize_border(); + if(poly_item->polyhedron()->size_of_border_halfedges()==0) + message->warning("The polyhedorn has no border, therefore the Parameterization cannot apply."); Polyhedron* pMesh = poly_item->polyhedron(); if(!pMesh) return;