mirror of https://github.com/CGAL/cgal
Fix for Windows 'min/max' bug
This commit is contained in:
parent
c153408f14
commit
77f3648287
|
|
@ -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<K,std::list< Point_2 > > Polygon; // it must be a list for the partition
|
||||
typedef CGAL::Polygon_2<K,std::list< Point_2 > > Polygon2; // it must be a list for the partition
|
||||
typedef CGAL::Polygon_with_holes_2<K,std::list< Point_2 > > Polygon_with_holes_2;
|
||||
|
||||
typedef CGAL::Straight_skeleton_2<K> Ss ;
|
||||
|
||||
typedef boost::shared_ptr<Ss> SsPtr ;
|
||||
|
||||
typedef boost::shared_ptr<Polygon> PolygonPtr ;
|
||||
typedef boost::shared_ptr<Polygon2> PolygonPtr ;
|
||||
|
||||
typedef std::vector<PolygonPtr> PolygonPtr_vector ;
|
||||
|
||||
|
|
@ -56,23 +56,23 @@ private:
|
|||
|
||||
|
||||
CGAL::Qt::Converter<K> convert;
|
||||
Polygon poly, kgon;
|
||||
Polygon2 poly, kgon;
|
||||
Polygon_with_holes_2 selfmink;
|
||||
QGraphicsScene scene;
|
||||
|
||||
CGAL::Qt::PolygonGraphicsItem<Polygon> * pgi;
|
||||
CGAL::Qt::PolygonGraphicsItem<Polygon2> * pgi;
|
||||
|
||||
CGAL::Qt::GraphicsViewPolylineInput<K> * pi;
|
||||
|
||||
CGAL::Qt::PolygonWithHolesGraphicsItem<Polygon_with_holes_2> * minkgi;
|
||||
|
||||
std::list<Polygon> partitionPolygons;
|
||||
std::list<CGAL::Qt::PolygonGraphicsItem<Polygon>* > partitionGraphicsItems;
|
||||
std::list<Polygon2> partitionPolygons;
|
||||
std::list<CGAL::Qt::PolygonGraphicsItem<Polygon2>* > partitionGraphicsItems;
|
||||
std::list<QGraphicsLineItem* > skeletonGraphicsItems;
|
||||
std::list<QGraphicsLineItem* > offsetGraphicsItems;
|
||||
CGAL::Qt::LineGraphicsItem<K>* lgi;
|
||||
|
||||
CGAL::Qt::PolygonGraphicsItem<Polygon> * kgongi;
|
||||
CGAL::Qt::PolygonGraphicsItem<Polygon2> * 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<Polygon>(&poly);
|
||||
// Add a GraphicItem for the Polygon2
|
||||
pgi = new CGAL::Qt::PolygonGraphicsItem<Polygon2>(&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<Polygon>(&kgon);
|
||||
kgongi = new CGAL::Qt::PolygonGraphicsItem<Polygon2>(&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<Polygon>::iterator it = partitionPolygons.begin();
|
||||
for(std::list<Polygon2>::iterator it = partitionPolygons.begin();
|
||||
it != partitionPolygons.end();
|
||||
++it){
|
||||
partitionGraphicsItems.push_back(new CGAL::Qt::PolygonGraphicsItem<Polygon>(&(*it)));
|
||||
partitionGraphicsItems.push_back(new CGAL::Qt::PolygonGraphicsItem<Polygon2>(&(*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<CGAL::Qt::PolygonGraphicsItem<Polygon>* >::iterator it = partitionGraphicsItems.begin();
|
||||
for(std::list<CGAL::Qt::PolygonGraphicsItem<Polygon2>* >::iterator it = partitionGraphicsItems.begin();
|
||||
it != partitionGraphicsItems.end();
|
||||
++it){
|
||||
scene.removeItem(*it);
|
||||
|
|
|
|||
Loading…
Reference in New Issue