From c4052f224b9abbfcbfb16f7ea7ea06e06ddc206b Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Fri, 6 Feb 2009 09:44:15 +0000 Subject: [PATCH] Add a virtual function for drawing a vertex instead of a point (associated to a vertex) --- .../include/CGAL/Qt/TriangulationGraphicsItem.h | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/GraphicsView/include/CGAL/Qt/TriangulationGraphicsItem.h b/GraphicsView/include/CGAL/Qt/TriangulationGraphicsItem.h index 319b650f5aa..5ef4b576d49 100644 --- a/GraphicsView/include/CGAL/Qt/TriangulationGraphicsItem.h +++ b/GraphicsView/include/CGAL/Qt/TriangulationGraphicsItem.h @@ -97,6 +97,7 @@ protected: virtual void drawAll(QPainter *painter); void paintVertices(QPainter *painter); void paintOneVertex(const typename T::Point& point); + virtual void paintVertex(typename T::Vertex_handle vh); void updateBoundingBox(); T * t; @@ -152,7 +153,7 @@ TriangulationGraphicsItem::operator()(typename T::Face_handle fh) } if(visible_vertices) { for (int i=0; i<3; i++) { - paintOneVertex(fh->vertex(i)->point()); + paintVertex(fh->vertex(i)); } } } @@ -205,6 +206,19 @@ TriangulationGraphicsItem::paintOneVertex(const typename T::Point& point) m_painter->setMatrix(matrix); } +template +void +TriangulationGraphicsItem::paintVertex(typename T::Vertex_handle vh) +{ + Converter convert; + + m_painter->setPen(this->verticesPen()); + QMatrix matrix = m_painter->matrix(); + m_painter->resetMatrix(); + m_painter->drawPoint(matrix.map(convert(vh->point()))); + m_painter->setMatrix(matrix); +} + template void TriangulationGraphicsItem::paint(QPainter *painter,