diff --git a/GraphicsView/demo/Polygon/Polygon_2.cpp b/GraphicsView/demo/Polygon/Polygon_2.cpp index 427e1277bd6..5ea49cde7bf 100644 --- a/GraphicsView/demo/Polygon/Polygon_2.cpp +++ b/GraphicsView/demo/Polygon/Polygon_2.cpp @@ -33,14 +33,14 @@ typedef K::Point_2 Point_2; typedef K::Segment_2 Segment_2; typedef K::Line_2 Line_2; -typedef CGAL::Polygon_2 > Polygon; // it must be a list for the partition +typedef CGAL::Polygon_2 > Polygon2; // it must be a list for the partition typedef CGAL::Polygon_with_holes_2 > Polygon_with_holes_2; typedef CGAL::Straight_skeleton_2 Ss ; typedef boost::shared_ptr SsPtr ; -typedef boost::shared_ptr PolygonPtr ; +typedef boost::shared_ptr PolygonPtr ; typedef std::vector PolygonPtr_vector ; @@ -56,23 +56,23 @@ private: CGAL::Qt::Converter convert; - Polygon poly, kgon; + Polygon2 poly, kgon; Polygon_with_holes_2 selfmink; QGraphicsScene scene; - CGAL::Qt::PolygonGraphicsItem * pgi; + CGAL::Qt::PolygonGraphicsItem * pgi; CGAL::Qt::GraphicsViewPolylineInput * pi; CGAL::Qt::PolygonWithHolesGraphicsItem * minkgi; - std::list partitionPolygons; - std::list* > partitionGraphicsItems; + std::list partitionPolygons; + std::list* > partitionGraphicsItems; std::list skeletonGraphicsItems; std::list offsetGraphicsItems; CGAL::Qt::LineGraphicsItem* lgi; - CGAL::Qt::PolygonGraphicsItem * kgongi; + CGAL::Qt::PolygonGraphicsItem * kgongi; public: MainWindow(); @@ -120,8 +120,8 @@ MainWindow::MainWindow() this->graphicsView->setAcceptDrops(false); minkgi = 0; - // Add a GraphicItem for the Polygon_2 - pgi = new CGAL::Qt::PolygonGraphicsItem(&poly); + // Add a GraphicItem for the Polygon2 + pgi = new CGAL::Qt::PolygonGraphicsItem(&poly); QObject::connect(this, SIGNAL(changed()), pgi, SLOT(modelChanged())); @@ -129,7 +129,7 @@ MainWindow::MainWindow() pgi->setVerticesPen(QPen(Qt::red, 3, Qt::SolidLine, Qt::RoundCap, Qt::RoundJoin)); scene.addItem(pgi); - kgongi = new CGAL::Qt::PolygonGraphicsItem(&kgon); + kgongi = new CGAL::Qt::PolygonGraphicsItem(&kgon); kgongi->setEdgesPen(QPen(Qt::blue, 0, Qt::SolidLine, Qt::RoundCap, Qt::RoundJoin)); kgongi->hide(); scene.addItem(kgongi); @@ -384,9 +384,9 @@ MainWindow::on_actionOuterOffset_triggered() { if ( cit != frame ) { - Polygon const& lContour = **cit ; + Polygon2 const& lContour = **cit ; lContour.area(); - for ( Polygon::Edge_const_iterator eit = lContour.edges_begin(); eit != lContour.edges_end(); ++ eit ) + for ( Polygon2::Edge_const_iterator eit = lContour.edges_begin(); eit != lContour.edges_end(); ++ eit ) { Segment_2 s(eit->source(), eit->target()); offsetGraphicsItems.push_back(new QGraphicsLineItem(convert(s))); @@ -495,10 +495,10 @@ MainWindow::partition(PartitionAlgorithm pa) CGAL::optimal_convex_partition_2(poly.vertices_begin(), poly.vertices_end(), std::back_inserter(partitionPolygons)); break; } - for(std::list::iterator it = partitionPolygons.begin(); + for(std::list::iterator it = partitionPolygons.begin(); it != partitionPolygons.end(); ++it){ - partitionGraphicsItems.push_back(new CGAL::Qt::PolygonGraphicsItem(&(*it))); + partitionGraphicsItems.push_back(new CGAL::Qt::PolygonGraphicsItem(&(*it))); scene.addItem(partitionGraphicsItems.back()); partitionGraphicsItems.back()->setEdgesPen(QPen(Qt::blue, 0, Qt::SolidLine, Qt::RoundCap, Qt::RoundJoin)); } @@ -509,7 +509,7 @@ void MainWindow::clearPartition() { partitionPolygons.clear(); - for(std::list* >::iterator it = partitionGraphicsItems.begin(); + for(std::list* >::iterator it = partitionGraphicsItems.begin(); it != partitionGraphicsItems.end(); ++it){ scene.removeItem(*it);