From e399a9767d1d5bad8a11c3fac74aa45d51198e1c Mon Sep 17 00:00:00 2001 From: Maxime Gimeno Date: Tue, 16 May 2017 15:01:55 +0200 Subject: [PATCH] Parameterization_plugin: Fix link errors and fill 2D triangles. --- .../Plugins/Surface_mesh/CMakeLists.txt | 2 +- .../Surface_mesh/Parameterization_plugin.cpp | 15 +++++++++------ 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/Polyhedron/demo/Polyhedron/Plugins/Surface_mesh/CMakeLists.txt b/Polyhedron/demo/Polyhedron/Plugins/Surface_mesh/CMakeLists.txt index 4a8ad74af10..43f580ca93c 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/Surface_mesh/CMakeLists.txt +++ b/Polyhedron/demo/Polyhedron/Plugins/Surface_mesh/CMakeLists.txt @@ -1,7 +1,7 @@ include( polyhedron_demo_macros ) if(EIGEN3_FOUND) qt5_wrap_ui( parameterizationUI_FILES Parameterization_widget.ui ARAP_dialog.ui OTE_dialog.ui) - polyhedron_demo_plugin(parameterization_plugin Parameterization_plugin ${parameterizationUI_FILES}) + polyhedron_demo_plugin(parameterization_plugin Parameterization_plugin ${parameterizationUI_FILES} ${CGAL_Qt5_RESOURCE_FILES} ${CGAL_Qt5_MOC_FILES}) target_link_libraries(parameterization_plugin scene_polyhedron_item scene_textured_polyhedron_item scene_polyhedron_selection_item) else(EIGEN3_FOUND) diff --git a/Polyhedron/demo/Polyhedron/Plugins/Surface_mesh/Parameterization_plugin.cpp b/Polyhedron/demo/Polyhedron/Plugins/Surface_mesh/Parameterization_plugin.cpp index 86bbf3d5d52..50912f56847 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/Surface_mesh/Parameterization_plugin.cpp +++ b/Polyhedron/demo/Polyhedron/Plugins/Surface_mesh/Parameterization_plugin.cpp @@ -246,22 +246,25 @@ public : void paint(QPainter *painter, const QStyleOptionGraphicsItem *, QWidget *) { QPen pen; + QBrush brush; + brush.setColor(Qt::red); + brush.setStyle(Qt::SolidPattern); pen.setColor(Qt::black); pen.setWidth(0); painter->setPen(pen); + painter->setBrush(brush); for( Component::iterator fi = components->at(m_current_component).begin(); fi != components->at(m_current_component).end(); ++fi) { Textured_polyhedron::Facet_handle f(*fi); - QPointF pt_A(f->halfedge()->u(), f->halfedge()->v()); - QPointF pt_B(f->halfedge()->next()->u(), f->halfedge()->next()->v()); - QPointF pt_C(f->halfedge()->next()->next()->u(), f->halfedge()->next()->next()->v()); + QPointF points[3]; + points[0] = QPointF(f->halfedge()->u(), f->halfedge()->v()); + points[1] = QPointF(f->halfedge()->next()->u(), f->halfedge()->next()->v()); + points[2] = QPointF(f->halfedge()->next()->next()->u(), f->halfedge()->next()->next()->v()); - painter->drawLine(pt_A, pt_B); - painter->drawLine(pt_B, pt_C); - painter->drawLine(pt_C, pt_A); + painter->drawPolygon(points,3); } }