Parameterization_plugin: Fix link errors and fill 2D triangles.

This commit is contained in:
Maxime Gimeno 2017-05-16 15:01:55 +02:00 committed by Mael Rouxel-Labbé
parent a8f7e2cf50
commit e399a9767d
2 changed files with 10 additions and 7 deletions

View File

@ -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)

View File

@ -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);
}
}