From 080f63b1b84615382ba8cac6e0f63ddaa3bbdcdc Mon Sep 17 00:00:00 2001 From: Maxime Gimeno Date: Wed, 7 Nov 2018 11:58:50 +0100 Subject: [PATCH] Disable WKT for boost < 1.56 --- .../demo/Alpha_shapes_2/Alpha_shapes_2.cpp | 7 ++++++- .../Apollonius_graph_2/Apollonius_graph_2.cpp | 10 ++++++++++ .../Bounding_volumes/Bounding_volumes.cpp | 12 ++++++++++- .../Circular_kernel_2/Circular_kernel_2.cpp | 9 ++++++++- .../L1_voronoi_diagram_2.cpp | 14 +++++++++++-- .../Periodic_2_Delaunay_triangulation_2.cpp | 10 ++++++++++ GraphicsView/demo/Polygon/Polygon_2.cpp | 10 ++++++++++ .../Segment_voronoi_2.cpp | 17 ++++++++++++++-- .../Segment_voronoi_linf_2.cpp | 14 ++++++++++++- .../demo/Snap_rounding_2/Snap_rounding_2.cpp | 10 ++++++++++ .../Spatial_searching_2.cpp | 6 ++++++ .../demo/Stream_lines_2/Stream_lines_2.cpp | 20 +++++++++++++++---- .../Constrained_Delaunay_triangulation_2.cpp | 14 ++++++++++++- .../Delaunay_triangulation_2.cpp | 10 ++++++++++ .../Regular_triangulation_2.cpp | 10 ++++++++++ .../Polyline_simplification_2.cpp | 18 ++++++++++++++--- .../points_and_vertices.cpp | 7 ++++++- .../Polyline_simplification_2/simplify.cpp | 2 ++ .../simplify_polygon.cpp | 2 ++ .../simplify_polyline.cpp | 4 ++-- .../doc/Stream_support/CGAL/IO/io.h | 14 ++++++++++++- .../Stream_support/Linestring_WKT.cpp | 2 ++ .../examples/Stream_support/Point_WKT.cpp | 2 ++ .../examples/Stream_support/Polygon_WKT.cpp | 2 ++ .../examples/Stream_support/read_WKT.cpp | 2 ++ Stream_support/include/CGAL/IO/WKT.h | 5 +++-- .../include/CGAL/IO/traits_linestring.h | 2 ++ .../include/CGAL/IO/traits_multilinestring.h | 3 ++- .../include/CGAL/IO/traits_multipoint.h | 2 ++ .../include/CGAL/IO/traits_multipolygon.h | 2 ++ Stream_support/include/CGAL/IO/traits_point.h | 3 ++- .../include/CGAL/IO/traits_point_3.h | 3 ++- .../include/CGAL/IO/traits_polygon.h | 2 ++ .../CGAL/internal/Geometry_container.h | 2 ++ .../test/Stream_support/test_read_WKT.cpp | 4 +++- .../test/Stream_support/test_write_WKT.cpp | 2 ++ 36 files changed, 232 insertions(+), 26 deletions(-) diff --git a/GraphicsView/demo/Alpha_shapes_2/Alpha_shapes_2.cpp b/GraphicsView/demo/Alpha_shapes_2/Alpha_shapes_2.cpp index 1d440a57c32..61c269f3416 100644 --- a/GraphicsView/demo/Alpha_shapes_2/Alpha_shapes_2.cpp +++ b/GraphicsView/demo/Alpha_shapes_2/Alpha_shapes_2.cpp @@ -6,8 +6,9 @@ #include #include #include +#if BOOST_VERSION >= 105600 #include - +#endif #include // Qt headers @@ -251,7 +252,9 @@ MainWindow::on_actionLoadPoints_triggered() tr("Open Points file"), ".", tr("CGAL files (*.pts.cgal);;" + #if BOOST_VERSION >= 105600 "WKT files (*.wktk *.WKT);;" + #endif "All files (*)")); if(! fileName.isEmpty()){ open(fileName); @@ -270,7 +273,9 @@ MainWindow::open(QString fileName) std::ifstream ifs(qPrintable(fileName)); if(fileName.endsWith(".wkt",Qt::CaseInsensitive)) { +#if BOOST_VERSION >= 105600 CGAL::read_multi_point_WKT(ifs, points); +#endif } else { diff --git a/GraphicsView/demo/Apollonius_graph_2/Apollonius_graph_2.cpp b/GraphicsView/demo/Apollonius_graph_2/Apollonius_graph_2.cpp index 41e30836721..48bb8a7199d 100644 --- a/GraphicsView/demo/Apollonius_graph_2/Apollonius_graph_2.cpp +++ b/GraphicsView/demo/Apollonius_graph_2/Apollonius_graph_2.cpp @@ -6,7 +6,9 @@ #include #include #include +#if BOOST_VERSION >= 105600 #include +#endif #include #include @@ -217,7 +219,9 @@ MainWindow::on_actionLoadPoints_triggered() tr("Open Points file"), ".", tr("CGAL files (*.wpts.cgal);;" + #if BOOST_VERSION >= 105600 "WKT files (*.wkt *.WKT);;" + #endif "All files (*)")); if(! fileName.isEmpty()){ open(fileName); @@ -236,12 +240,14 @@ MainWindow::open(QString fileName) std::vector points; if(fileName.endsWith(".wkt", Qt::CaseInsensitive)) { +#if BOOST_VERSION >= 105600 std::vector point_3_s; CGAL::read_multi_point_WKT(ifs, point_3_s); BOOST_FOREACH(const K::Point_3& point_3, point_3_s) { points.push_back(Apollonius_site_2(K::Point_2(point_3.x(), point_3.y()), point_3.z())); } +#endif } else{ K::Weighted_point_2 p; while(ifs >> p) { @@ -263,12 +269,15 @@ MainWindow::on_actionSavePoints_triggered() tr("Save points"), ".reg.cgal", tr("Weighted Points (*.wpts.cgal);;" + #if BOOST_VERSION >= 105600 "WKT files(*.wkt *.WKT);;" + #endif "All (*)")); if(! fileName.isEmpty()){ std::ofstream ofs(qPrintable(fileName)); if(fileName.endsWith(".wkt",Qt::CaseInsensitive)) { +#if BOOST_VERSION >= 105600 std::vector points; for(Apollonius::Sites_iterator vit = ag.sites_begin(), @@ -280,6 +289,7 @@ MainWindow::on_actionSavePoints_triggered() vit->weight())); } CGAL::write_multi_point_WKT(ofs, points); +#endif } else for(Apollonius::Sites_iterator diff --git a/GraphicsView/demo/Bounding_volumes/Bounding_volumes.cpp b/GraphicsView/demo/Bounding_volumes/Bounding_volumes.cpp index df21710e62f..c026d6ddd08 100644 --- a/GraphicsView/demo/Bounding_volumes/Bounding_volumes.cpp +++ b/GraphicsView/demo/Bounding_volumes/Bounding_volumes.cpp @@ -13,7 +13,9 @@ #include #include #include +#if BOOST_VERSION >= 105600 #include +#endif // Qt headers #include @@ -475,7 +477,9 @@ MainWindow::on_actionLoadPoints_triggered() tr("Open Points file"), ".", tr("CGAL files (*.pts.cgal);;" + #if BOOST_VERSION >= 105600 "WKT files (*.WKT *.wkt);;" + #endif "All files (*)")); if(! fileName.isEmpty()){ open(fileName); @@ -491,12 +495,14 @@ MainWindow::open(QString fileName) std::ifstream ifs(qPrintable(fileName)); if(fileName.endsWith(".wkt", Qt::CaseInsensitive)) { +#if BOOST_VERSION >= 105600 CGAL::read_multi_point_WKT(ifs, points); BOOST_FOREACH(K::Point_2 p, points) { mc.insert(p); me.insert(p); } +#endif } else { @@ -524,19 +530,23 @@ MainWindow::on_actionSavePoints_triggered() tr("Save points"), ".", tr("CGAL files (*.pts.cgal);;" + #if BOOST_VERSION >= 105600 "WKT files (*.WKT *.wkt);;" + #endif "All files (*)")); if(! fileName.isEmpty()){ std::ofstream ofs(qPrintable(fileName)); if(fileName.endsWith(".wkt", Qt::CaseInsensitive)) { +#if BOOST_VERSION >= 105600 std::vector out_pts; out_pts.reserve(std::distance(mc.points_begin(), mc.points_end())); for(Min_circle::Point_iterator pit = mc.points_begin(); pit != mc.points_end(); ++pit) out_pts.push_back(*pit); - CGAL::write_multi_point_WKT(ofs, out_pts); + CGAL::write_multi_point_WKT(ofs, out_pts); +#endif } else { diff --git a/GraphicsView/demo/Circular_kernel_2/Circular_kernel_2.cpp b/GraphicsView/demo/Circular_kernel_2/Circular_kernel_2.cpp index b38454cc108..1892ff4e48d 100644 --- a/GraphicsView/demo/Circular_kernel_2/Circular_kernel_2.cpp +++ b/GraphicsView/demo/Circular_kernel_2/Circular_kernel_2.cpp @@ -9,7 +9,9 @@ #include #include #include +#if BOOST_VERSION >= 105600 #include +#endif // Qt headers #include @@ -213,7 +215,10 @@ MainWindow::on_actionLoadLineAndCircularArcs_triggered() tr("Open Line and Circular Arc File"), ".", tr("Edge files (*.arc)\n" - "WKT files (*.wkt *.WKT)\n")); + #if BOOST_VERSION >= 105600 + "WKT files (*.wkt *.WKT)\n" + #endif + )); if(! fileName.isEmpty()){ open(fileName); this->addToRecentFiles(fileName); @@ -230,6 +235,7 @@ MainWindow::open(QString fileName) double x,y; if(fileName.endsWith(".wkt", Qt::CaseInsensitive)) { +#if BOOST_VERSION >= 105600 //read pairs as Line_arc_2 and triplets as circular_arc_2 do { @@ -272,6 +278,7 @@ MainWindow::open(QString fileName) } }while(ifs.good() && !ifs.eof()); ifs.close(); +#endif } else { diff --git a/GraphicsView/demo/L1_Voronoi_diagram_2/L1_voronoi_diagram_2.cpp b/GraphicsView/demo/L1_Voronoi_diagram_2/L1_voronoi_diagram_2.cpp index 59f6150ffd6..cb44771ae04 100644 --- a/GraphicsView/demo/L1_Voronoi_diagram_2/L1_voronoi_diagram_2.cpp +++ b/GraphicsView/demo/L1_Voronoi_diagram_2/L1_voronoi_diagram_2.cpp @@ -31,7 +31,9 @@ #include #include #include +#if BOOST_VERSION >= 105600 #include +#endif #include @@ -280,7 +282,9 @@ MainWindow::on_actionLoadPoints_triggered() tr("Open Points file"), ".", tr("CGAL files (*.pts.cgal);;" + #if BOOST_VERSION >= 105600 "WKT files (*.wkt *.WKT);;" + #endif "All files (*)")); if(! fileName.isEmpty()){ open(fileName); @@ -298,7 +302,9 @@ MainWindow::open(QString fileName) std::ifstream ifs(qPrintable(fileName)); if(fileName.endsWith(".wkt", Qt::CaseInsensitive)) { +#if BOOST_VERSION >= 105600 CGAL::read_multi_point_WKT(ifs, m_sites); +#endif } else { @@ -323,13 +329,17 @@ MainWindow::on_actionSavePoints_triggered() tr("Save points"), ".", tr("CGAL files (*.pts.cgal);;" + #if BOOST_VERSION >= 105600 "WKT files (*.wkt *.WKT);;" + #endif "All files (*)")); if(! fileName.isEmpty()) { std::ofstream ofs(qPrintable(fileName)); - if(fileName.endsWith(".wkt", Qt::CaseInsensitive)) + if(fileName.endsWith(".wkt", Qt::CaseInsensitive)){ +#if BOOST_VERSION >= 105600 CGAL::write_multi_point_WKT(ofs, m_sites); - else +#endif + }else for(Points::iterator it = m_sites.begin(); it != m_sites.end(); ++it) { diff --git a/GraphicsView/demo/Periodic_2_triangulation_2/Periodic_2_Delaunay_triangulation_2.cpp b/GraphicsView/demo/Periodic_2_triangulation_2/Periodic_2_Delaunay_triangulation_2.cpp index 40cceb8d325..c2f8ad8530e 100644 --- a/GraphicsView/demo/Periodic_2_triangulation_2/Periodic_2_Delaunay_triangulation_2.cpp +++ b/GraphicsView/demo/Periodic_2_triangulation_2/Periodic_2_Delaunay_triangulation_2.cpp @@ -6,7 +6,9 @@ #include #include #include +#if BOOST_VERSION >= 105600 #include +#endif // Qt headers #include @@ -351,7 +353,9 @@ MainWindow::on_actionLoadPoints_triggered() tr("Open Points file"), ".", tr("CGAL files (*.pts.cgal);;" + #if BOOST_VERSION >= 105600 "WKT files (*.wkt *.WKT);;" + #endif "All files (*)")); if(! fileName.isEmpty()){ open(fileName); @@ -370,7 +374,9 @@ MainWindow::open(QString fileName) std::vector points; if(fileName.endsWith(".wkt", Qt::CaseInsensitive)) { +#if BOOST_VERSION >= 105600 CGAL::read_multi_point_WKT(ifs, points); +#endif } else { @@ -396,12 +402,15 @@ MainWindow::on_actionSavePoints_triggered() tr("Save points"), ".", tr("CGAL files (*.pts.cgal);;" + #if BOOST_VERSION >= 105600 "WKT files (*.wkt *.WKT);;" + #endif "All files (*)")); if(! fileName.isEmpty()){ std::ofstream ofs(qPrintable(fileName)); if(fileName.endsWith(".wkt", Qt::CaseInsensitive)) { +#if BOOST_VERSION >= 105600 std::vector points; points.reserve(std::distance(triang.unique_vertices_begin(), triang.unique_vertices_end())); @@ -413,6 +422,7 @@ MainWindow::on_actionSavePoints_triggered() points.push_back(vit->point()); } CGAL::write_multi_point_WKT(ofs, points); +#endif } else { diff --git a/GraphicsView/demo/Polygon/Polygon_2.cpp b/GraphicsView/demo/Polygon/Polygon_2.cpp index 7a4bddbcdae..8bb9973cf91 100644 --- a/GraphicsView/demo/Polygon/Polygon_2.cpp +++ b/GraphicsView/demo/Polygon/Polygon_2.cpp @@ -11,7 +11,9 @@ #include #include #include +#if BOOST_VERSION >= 105600 #include +#endif // Qt headers #include @@ -230,7 +232,9 @@ MainWindow::on_actionLoadPolygon_triggered() ".", tr( "Polyline files (*.polygons.cgal);;" "WSL files (*.wsl);;" + #if BOOST_VERSION >= 105600 "WKT files (*.wkt *.WKT);;" + #endif "All file (*)")); if(! fileName.isEmpty()){ open(fileName); @@ -245,10 +249,12 @@ MainWindow::open(QString fileName) poly.clear(); if(fileName.endsWith(".wkt", Qt::CaseInsensitive)) { +#if BOOST_VERSION >= 105600 CGAL::Polygon_with_holes_2 P; CGAL::read_polygon_WKT(ifs, P); poly = Polygon2(P.outer_boundary().begin(), P.outer_boundary().end()); +#endif } else { @@ -268,16 +274,20 @@ MainWindow::on_actionSavePolygon_triggered() tr("Save Polygon"), ".", tr( "Polyline files (*.polygons.cgal);;" + #if BOOST_VERSION >= 105600 "WKT files (*.wkt *.WKT);;" + #endif "All file (*)")); if(! fileName.isEmpty()){ std::ofstream ofs(qPrintable(fileName)); if(fileName.endsWith(".wkt", Qt::CaseInsensitive)) { +#if BOOST_VERSION >= 105600 CGAL::Polygon_2 P(poly.begin(), poly.end()); CGAL::Polygon_with_holes_2 Pwh(P); CGAL::write_polygon_WKT(ofs, Pwh); +#endif } else ofs << poly; diff --git a/GraphicsView/demo/Segment_Delaunay_graph_2/Segment_voronoi_2.cpp b/GraphicsView/demo/Segment_Delaunay_graph_2/Segment_voronoi_2.cpp index 805873eab21..5705d657661 100644 --- a/GraphicsView/demo/Segment_Delaunay_graph_2/Segment_voronoi_2.cpp +++ b/GraphicsView/demo/Segment_Delaunay_graph_2/Segment_voronoi_2.cpp @@ -24,7 +24,9 @@ #include #include #include +#if BOOST_VERSION >= 105600 #include +#endif //#include // the two base classes @@ -245,8 +247,10 @@ MainWindow::open(QString fileName) loadEdgConstraints(fileName); this->addToRecentFiles(fileName); } else if(fileName.endsWith(".wkt", Qt::CaseInsensitive)){ +#if BOOST_VERSION >= 105600 loadWKTConstraints(fileName); this->addToRecentFiles(fileName); +#endif } } } @@ -259,7 +263,10 @@ MainWindow::on_actionLoadSegments_triggered() ".", tr("Edge files (*.edg);;" "Polyline files (*.polygons.cgal);;" - "WKT files (*.wkt *.WKT)")); + #if BOOST_VERSION >= 105600 + "WKT files (*.wkt *.WKT)" + #endif + )); open(fileName); } @@ -333,8 +340,13 @@ MainWindow::loadEdgConstraints(QString fileName) } void -MainWindow::loadWKTConstraints(QString fileName) +MainWindow::loadWKTConstraints(QString + #if BOOST_VERSION >= 105600 + fileName + #endif + ) { +#if BOOST_VERSION >= 105600 typedef CGAL::Polygon_with_holes_2 Polygon; typedef std::vector LineString; @@ -401,6 +413,7 @@ MainWindow::loadWKTConstraints(QString fileName) }while(ifs.good() && !ifs.eof()); Q_EMIT( changed()); actionRecenter->trigger(); +#endif } void diff --git a/GraphicsView/demo/Segment_Delaunay_graph_Linf_2/Segment_voronoi_linf_2.cpp b/GraphicsView/demo/Segment_Delaunay_graph_Linf_2/Segment_voronoi_linf_2.cpp index c70e143792c..275ccba5faf 100644 --- a/GraphicsView/demo/Segment_Delaunay_graph_Linf_2/Segment_voronoi_linf_2.cpp +++ b/GraphicsView/demo/Segment_Delaunay_graph_Linf_2/Segment_voronoi_linf_2.cpp @@ -22,7 +22,9 @@ #include #include #include +#if BOOST_VERSION >= 105600 #include +#endif //#include // the two base classes @@ -269,8 +271,10 @@ MainWindow::open(QString fileName) loadSitesInput(fileName); this->addToRecentFiles(fileName); } else if(fileName.endsWith(".wkt", Qt::CaseInsensitive)){ +#if BOOST_VERSION >= 105600 loadWKT(fileName); this->addToRecentFiles(fileName); +#endif } } } @@ -288,7 +292,9 @@ MainWindow::on_actionLoadSegments_triggered() "Pts files (*.pts);;" "Edge files (*.edg);;" "Polylines files (*.polygons.cgal);;" + #if BOOST_VERSION >= 105600 "WKT files (*.WKT *.wkt)" + #endif )); open(fileName); } @@ -383,8 +389,13 @@ MainWindow::loadPoints(QString fileName) } void -MainWindow::loadWKT(QString fileName) +MainWindow::loadWKT(QString + #if BOOST_VERSION >= 105600 + fileName + #endif + ) { +#if BOOST_VERSION >= 105600 std::ifstream ifs(qPrintable(fileName)); //Points do @@ -469,6 +480,7 @@ MainWindow::loadWKT(QString fileName) Q_EMIT( changed()); actionRecenter->trigger(); +#endif } void diff --git a/GraphicsView/demo/Snap_rounding_2/Snap_rounding_2.cpp b/GraphicsView/demo/Snap_rounding_2/Snap_rounding_2.cpp index 1e8f9a666b5..8d4208e08e2 100644 --- a/GraphicsView/demo/Snap_rounding_2/Snap_rounding_2.cpp +++ b/GraphicsView/demo/Snap_rounding_2/Snap_rounding_2.cpp @@ -18,7 +18,9 @@ #include #include #include +#if BOOST_VERSION >= 105600 #include +#endif // for viewportsBbox #include @@ -248,7 +250,9 @@ MainWindow::on_actionLoadSegments_triggered() tr("Open segment file"), ".", tr("Edge files (*.edg);;" + #if BOOST_VERSION >= 105600 "WKT files (*.wkt *.WKT);;" + #endif "All files (*)")); if(! fileName.isEmpty()){ open(fileName); @@ -264,6 +268,7 @@ MainWindow::open(QString fileName) std::ifstream ifs(qPrintable(fileName)); if(fileName.endsWith(".wkt", Qt::CaseInsensitive)) { +#if BOOST_VERSION >= 105600 std::vector > mls; CGAL::read_multi_linestring_WKT(ifs, mls); BOOST_FOREACH(const std::vector& ls, mls) @@ -273,6 +278,7 @@ MainWindow::open(QString fileName) Segment_2 seg(ls[0], ls[1]); input.push_back(seg); } +#endif } else { std::copy(std::istream_iterator(ifs), @@ -296,13 +302,16 @@ MainWindow::on_actionSaveSegments_triggered() tr("Save points"), ".", tr("Edge files (*.edg);;" + #if BOOST_VERSION >= 105600 "WKT files (*.wkt *.WKT);;" + #endif "All files (*)")); if(! fileName.isEmpty()){ std::ofstream ofs(qPrintable(fileName)); ofs.precision(12); if(fileName.endsWith(".wkt", Qt::CaseInsensitive)) { +#if BOOST_VERSION >= 105600 std::vector >mls; BOOST_FOREACH(const Segment_2& seg, input) { @@ -313,6 +322,7 @@ MainWindow::on_actionSaveSegments_triggered() } CGAL::write_multi_linestring_WKT(ofs, mls); } +#endif else std::copy(input.begin(), input.end(), std::ostream_iterator(ofs, "\n")); } diff --git a/GraphicsView/demo/Spatial_searching_2/Spatial_searching_2.cpp b/GraphicsView/demo/Spatial_searching_2/Spatial_searching_2.cpp index 5f417358e60..6b3c298c1f6 100644 --- a/GraphicsView/demo/Spatial_searching_2/Spatial_searching_2.cpp +++ b/GraphicsView/demo/Spatial_searching_2/Spatial_searching_2.cpp @@ -15,7 +15,9 @@ // GraphicsView items and event filters (input classes) #include #include +#if BOOST_VERSION >= 105600 #include +#endif // the two base classes #include "ui_Spatial_searching_2.h" @@ -245,7 +247,9 @@ MainWindow::on_actionLoadPoints_triggered() tr("Open Points file"), ".", tr("CGAL files (*.pts.cgal);;" + #if BOOST_VERSION >= 105600 "WKT files (*.wkt *.WKT);;" + #endif "All files (*)")); if(! fileName.isEmpty()){ open(fileName); @@ -265,7 +269,9 @@ MainWindow::open(QString fileName) std::vector points; if(fileName.endsWith(".wkt", Qt::CaseInsensitive)) { +#if BOOST_VERSION >= 105600 CGAL::read_multi_point_WKT(ifs, points); +#endif } else{ while(ifs >> p) { diff --git a/GraphicsView/demo/Stream_lines_2/Stream_lines_2.cpp b/GraphicsView/demo/Stream_lines_2/Stream_lines_2.cpp index 52868447dd6..bf4a0f3944a 100644 --- a/GraphicsView/demo/Stream_lines_2/Stream_lines_2.cpp +++ b/GraphicsView/demo/Stream_lines_2/Stream_lines_2.cpp @@ -20,7 +20,9 @@ // for viewportsBbox #include +#if BOOST_VERSION >= 105600 #include +#endif // the two base classes #include "ui_Stream_lines_2.h" #include @@ -164,10 +166,15 @@ MainWindow::generate() void MainWindow::on_actionLoadPoints_triggered() { +#if BOOST_VERSION >= 105600 +#endif QString fileName = QFileDialog::getOpenFileName(this, tr("Open grid file"), - ".", - tr("WKT files (*.wkt *.WKT)")); + "." + #if BOOST_VERSION >= 105600 + ,tr("WKT files (*.wkt *.WKT)") + #endif + ); if(! fileName.isEmpty()){ open(fileName); } @@ -186,6 +193,7 @@ MainWindow::open(QString fileName) iXSize = iYSize = 512; if(fileName.endsWith(".wkt", Qt::CaseInsensitive)) { +#if BOOST_VERSION >= 105600 std::vector > mp; int size= -1; do @@ -207,6 +215,10 @@ MainWindow::open(QString fileName) { regular_grid->set_field(i, j, Vector(mp[j][i].x(), mp[j][i].y())); } +#else + QApplication::restoreOverrideCursor(); + return; +#endif } else{ unsigned int x_samples, y_samples; @@ -235,7 +247,7 @@ MainWindow::open(QString fileName) void MainWindow::on_actionSavePoints_triggered() { - +#if BOOST_VERSION >= 105600 QString fileName = QFileDialog::getSaveFileName(this, tr("Save points"), ".", @@ -257,7 +269,7 @@ MainWindow::on_actionSavePoints_triggered() } ofs.close(); } - +#endif } diff --git a/GraphicsView/demo/Triangulation_2/Constrained_Delaunay_triangulation_2.cpp b/GraphicsView/demo/Triangulation_2/Constrained_Delaunay_triangulation_2.cpp index 86267e75821..714373b7474 100644 --- a/GraphicsView/demo/Triangulation_2/Constrained_Delaunay_triangulation_2.cpp +++ b/GraphicsView/demo/Triangulation_2/Constrained_Delaunay_triangulation_2.cpp @@ -22,7 +22,9 @@ #include #include #include +#if BOOST_VERSION >= 105600 #include +#endif // Qt headers #include @@ -523,7 +525,9 @@ MainWindow::open(QString fileName) } else if(fileName.endsWith(".poly")){ loadPolyConstraints(fileName); } else if(fileName.endsWith(".wkt")){ +#if BOOST_VERSION >= 105600 loadWKT(fileName); +#endif } this->addToRecentFiles(fileName); } @@ -541,14 +545,21 @@ MainWindow::on_actionLoadConstraints_triggered() "Polyline files (*.polygons.cgal);;" "Poly files (*.poly);;" "CGAL files (*.cpts.cgal);;" + #if BOOST_VERSION >= 105600 "WKT files (*.WKT *.wkt);;" + #endif "All (*)")); open(fileName); } void -MainWindow::loadWKT(QString filename) +MainWindow::loadWKT(QString + #if BOOST_VERSION >= 105600 + filename + #endif + ) { +#if BOOST_VERSION >= 105600 //Polygons todo : make it multipolygons std::ifstream ifs(qPrintable(filename)); do @@ -636,6 +647,7 @@ MainWindow::loadWKT(QString filename) discoverComponents(cdt, m_seeds); Q_EMIT( changed()); actionRecenter->trigger(); +#endif } void diff --git a/GraphicsView/demo/Triangulation_2/Delaunay_triangulation_2.cpp b/GraphicsView/demo/Triangulation_2/Delaunay_triangulation_2.cpp index 2d431869816..aacb269aeb4 100644 --- a/GraphicsView/demo/Triangulation_2/Delaunay_triangulation_2.cpp +++ b/GraphicsView/demo/Triangulation_2/Delaunay_triangulation_2.cpp @@ -21,7 +21,9 @@ #include "TriangulationPointInputAndConflictZone.h" #include #include +#if BOOST_VERSION >= 105600 #include +#endif // for viewportsBbox #include @@ -318,7 +320,9 @@ MainWindow::on_actionLoadPoints_triggered() tr("Open Points file"), ".", tr("CGAL files (*.pts.cgal);;" + #if BOOST_VERSION >= 105600 "WKT files (*.WKT *.wkt);;" + #endif "All files (*)")); if(! fileName.isEmpty()){ open(fileName); @@ -337,7 +341,9 @@ MainWindow::open(QString fileName) std::vector points; if(fileName.endsWith(".wkt", Qt::CaseInsensitive)) { +#if BOOST_VERSION >= 105600 CGAL::read_multi_point_WKT(ifs, points); +#endif } else while(ifs >> p) { @@ -362,12 +368,15 @@ MainWindow::on_actionSavePoints_triggered() tr("Save points"), ".", tr("CGAL files (*.pts.cgal);;" + #if BOOST_VERSION >= 105600 "WKT files (*.WKT *.wkt);;" + #endif "All files (*)")); if(! fileName.isEmpty()){ std::ofstream ofs(qPrintable(fileName)); if(fileName.endsWith(".wkt", Qt::CaseInsensitive)) { +#if BOOST_VERSION >= 105600 std::vector points; points.reserve(dt.number_of_vertices()); for(Delaunay::Finite_vertices_iterator @@ -378,6 +387,7 @@ MainWindow::on_actionSavePoints_triggered() points.push_back(vit->point()); } CGAL::write_multi_point_WKT(ofs, points); +#endif } else for(Delaunay::Finite_vertices_iterator diff --git a/GraphicsView/demo/Triangulation_2/Regular_triangulation_2.cpp b/GraphicsView/demo/Triangulation_2/Regular_triangulation_2.cpp index a5bd5b6c025..939670cb111 100644 --- a/GraphicsView/demo/Triangulation_2/Regular_triangulation_2.cpp +++ b/GraphicsView/demo/Triangulation_2/Regular_triangulation_2.cpp @@ -3,7 +3,9 @@ // CGAL headers #include #include +#if BOOST_VERSION >= 105600 #include +#endif #include // Qt headers @@ -243,7 +245,9 @@ MainWindow::on_actionLoadPoints_triggered() tr("Open Points file"), ".", tr("Weighted Points (*.wpts.cgal);;" + #if BOOST_VERSION >= 105600 "WKT files (*.wkt *.WKT);;" + #endif "All (*)")); if(! fileName.isEmpty()){ @@ -251,12 +255,14 @@ MainWindow::on_actionLoadPoints_triggered() std::vector points; if(fileName.endsWith(".wkt",Qt::CaseInsensitive)) { +#if BOOST_VERSION >= 105600 std::vector points_3; CGAL::read_multi_point_WKT(ifs, points_3); BOOST_FOREACH(const K::Point_3& p, points_3) { points.push_back(Weighted_point_2(K::Point_2(p.x(), p.y()), p.z())); } +#endif } else { @@ -280,12 +286,15 @@ MainWindow::on_actionSavePoints_triggered() tr("Save points"), ".reg.cgal", tr("Weighted Points (*.wpts.cgal);;" + #if BOOST_VERSION >= 105600 "WKT files (*.wkt *.WKT);;" + #endif "All (*)")); if(! fileName.isEmpty()){ std::ofstream ofs(qPrintable(fileName)); if(fileName.endsWith(".wkt",Qt::CaseInsensitive)) { +#if BOOST_VERSION >= 105600 std::vector points_3; for(Regular::Finite_vertices_iterator vit = dt.finite_vertices_begin(), @@ -297,6 +306,7 @@ MainWindow::on_actionSavePoints_triggered() vit->point().weight())); } CGAL::write_multi_point_WKT(ofs, points_3); +#endif } else { diff --git a/Polyline_simplification_2/demo/Polyline_simplification_2/Polyline_simplification_2.cpp b/Polyline_simplification_2/demo/Polyline_simplification_2/Polyline_simplification_2.cpp index a3af28b73c1..c93de7c99f6 100644 --- a/Polyline_simplification_2/demo/Polyline_simplification_2/Polyline_simplification_2.cpp +++ b/Polyline_simplification_2/demo/Polyline_simplification_2/Polyline_simplification_2.cpp @@ -9,7 +9,9 @@ #include #include #include +#if BOOST_VERSION >= 105600 #include +#endif //#define CGAL_TESTING_POLYLINE_SIMPLIFICATION //#define CGAL_POLYLINE_SIMPLIFICATION_TRACE_LEVEL 15 @@ -341,8 +343,10 @@ MainWindow::open(QString fileName) this->addToRecentFiles(fileName); } else if(fileName.endsWith(".wkt")){ +#if BOOST_VERSION >= 105600 loadWKT(fileName); this->addToRecentFiles(fileName); +#endif } } } @@ -352,8 +356,10 @@ MainWindow::on_actionLoadConstraints_triggered() { QString fileName = QFileDialog::getOpenFileName(this, tr("Open Constraint File"), - "../data", - tr("Polylines (*.osm *.wkt);;") + "../data" + #if BOOST_VERSION >= 105600 + ,tr("Polylines (*.osm *.wkt);;") + #endif ); open(fileName); } @@ -370,8 +376,13 @@ std::string trim_right ( std::string str ) return std::string("") ; } -void MainWindow::loadWKT(QString fileName) +void MainWindow::loadWKT(QString + #if BOOST_VERSION >= 105600 + fileName + #endif + ) { +#if BOOST_VERSION >= 105600 typedef std::vector MultiPoint; typedef std::vector LineString; @@ -409,6 +420,7 @@ void MainWindow::loadWKT(QString fileName) Q_EMIT( changed()); actionRecenter->trigger(); +#endif } diff --git a/Polyline_simplification_2/examples/Polyline_simplification_2/points_and_vertices.cpp b/Polyline_simplification_2/examples/Polyline_simplification_2/points_and_vertices.cpp index 1c76c77f9ae..56eec8dd263 100644 --- a/Polyline_simplification_2/examples/Polyline_simplification_2/points_and_vertices.cpp +++ b/Polyline_simplification_2/examples/Polyline_simplification_2/points_and_vertices.cpp @@ -6,7 +6,9 @@ #include #include #include +#if BOOST_VERSION >= 105600 #include +#endif namespace PS = CGAL::Polyline_simplification_2; @@ -51,6 +53,7 @@ void print(const CT& ct, Constraint_id cid) int main(int argc, char* argv[]) { std::ifstream ifs( (argc==1)?"data/polygon.wkt":argv[1]); +#if BOOST_VERSION >= 105600 const bool remove_points = false; CT ct; Polygon_with_holes_2 P; @@ -69,7 +72,9 @@ int main(int argc, char* argv[]) PS::simplify(ct, cid, Cost(), Stop(0.5), remove_points); ct.remove_points_without_corresponding_vertex(cid); print(ct, cid); - +#else + ifs.close(); +#endif return 0; } diff --git a/Polyline_simplification_2/examples/Polyline_simplification_2/simplify.cpp b/Polyline_simplification_2/examples/Polyline_simplification_2/simplify.cpp index ceae87c7c17..e6b98a4951d 100644 --- a/Polyline_simplification_2/examples/Polyline_simplification_2/simplify.cpp +++ b/Polyline_simplification_2/examples/Polyline_simplification_2/simplify.cpp @@ -1,3 +1,4 @@ +#if BOOST_VERSION >= 105600 #include #include #include @@ -54,5 +55,6 @@ int main(int argc, char* argv[]) } return 0; } +#endif diff --git a/Polyline_simplification_2/examples/Polyline_simplification_2/simplify_polygon.cpp b/Polyline_simplification_2/examples/Polyline_simplification_2/simplify_polygon.cpp index 776d5b0bed3..b9ace85ad20 100644 --- a/Polyline_simplification_2/examples/Polyline_simplification_2/simplify_polygon.cpp +++ b/Polyline_simplification_2/examples/Polyline_simplification_2/simplify_polygon.cpp @@ -1,3 +1,4 @@ +#if BOOST_VERSION >= 105600 #include #include #include @@ -27,5 +28,6 @@ int main(int argc, char* argv[]) return 0; } +#endif diff --git a/Polyline_simplification_2/examples/Polyline_simplification_2/simplify_polyline.cpp b/Polyline_simplification_2/examples/Polyline_simplification_2/simplify_polyline.cpp index 301e66a725f..f1bf0552e5b 100644 --- a/Polyline_simplification_2/examples/Polyline_simplification_2/simplify_polyline.cpp +++ b/Polyline_simplification_2/examples/Polyline_simplification_2/simplify_polyline.cpp @@ -1,3 +1,4 @@ +#if BOOST_VERSION >= 105600 #include #include #include @@ -29,5 +30,4 @@ int main(int argc, char* argv[]) } return 0; } - - +#endif diff --git a/Stream_support/doc/Stream_support/CGAL/IO/io.h b/Stream_support/doc/Stream_support/CGAL/IO/io.h index 89dcf7dbdc7..4d7d90fb7d1 100644 --- a/Stream_support/doc/Stream_support/CGAL/IO/io.h +++ b/Stream_support/doc/Stream_support/CGAL/IO/io.h @@ -296,6 +296,7 @@ istream& operator>>(istream& is, Class c); //! //! \tparam Point can be a `CGAL::Point_2` or `CGAL::Point_3`. //! \attention Only Cartesian Kernels with double or float as `FT` are supported. +//! \attention This function is only available with boost versions starting at 1.56. //! //! \see `CGAL::Point_2` //! \see `CGAL::Point_3` @@ -316,7 +317,7 @@ read_point_WKT( std::istream& in, //! - an `operator[]()` that takes a `size_type`. //! //! \attention Only Cartesian Kernels with double or float as `FT` are supported. -//! +//! \attention This function is only available with boost versions starting at 1.56. //! \see `CGAL::Point_2` //! \see `CGAL::Point_3` template @@ -336,6 +337,7 @@ read_multi_point_WKT( std::istream& in, //! - a function `resize()` that takes an `size_type` //! - an `operator[]()` that takes a `size_type`. //! \attention Only Cartesian Kernels with double or float as `FT` are supported. +//! \attention This function is only available with boost versions starting at 1.56. //! \see `CGAL::Point_2` template std::istream& @@ -353,6 +355,7 @@ read_linestring_WKT( std::istream& in, //! - a function `resize()` that takes an `size_type` //! - an `operator[]()` that takes a `size_type`. //! \attention Only Cartesian Kernels with double or float as `FT` are supported. +//! \attention This function is only available with boost versions starting at 1.56. //! //! \see `CGAL::Point_2` template @@ -366,6 +369,7 @@ read_multi_linestring_WKT( std::istream& in, //! //! \tparam Polygon is a `CGAL::General_polygon_with_holes_2`. //! \attention Only Cartesian Kernels with double or float as `FT` are supported. +//! \attention This function is only available with boost versions starting at 1.56. //! //! \see `CGAL::General_polygon_with_holes_2` template @@ -384,6 +388,7 @@ read_polygon_WKT( std::istream& in, //! - a function `resize()` that takes an `size_type` //! - an `operator[]()` that takes a `size_type`. //! \attention Only Cartesian Kernels with double or float as `FT` are supported. +//! \attention This function is only available with boost versions starting at 1.56. //! \see `CGAL::General_polygon_with_holes_2` template @@ -395,6 +400,7 @@ read_multi_polygon_WKT( std::istream& in, //! \brief `write_point_WKT()` writes `point` into a WKT stream. //! \tparam Point is a `CGAL::Point_2` //! \attention Only Cartesian Kernels with double or float as `FT` are supported. +//! \attention This function is only available with boost versions starting at 1.56. //! \see `CGAL::Point_2` template std::ostream& @@ -405,6 +411,7 @@ write_point_WKT( std::ostream& out, //! \brief `write_polygon_WKT()` writes `poly` into a WKT stream. //! \tparam Polygon must be a `CGAL::General_polygon_with_holes_2` //! \attention Only Cartesian Kernels with double or float as `FT` are supported. +//! \attention This function is only available with boost versions starting at 1.56. //! \see `CGAL::General_polygon_with_holes_2` template std::ostream& @@ -416,6 +423,7 @@ write_polygon_WKT( std::ostream& out, //! into a WKT stream. //! \tparam LineString must be a `RandomAccessRange` of `CGAL::Point_2`. //! \attention Only Cartesian Kernels with double or float as `FT` are supported. +//! \attention This function is only available with boost versions starting at 1.56. //!\see `CGAL::Point_2` template std::ostream& @@ -427,6 +435,7 @@ write_linestring_WKT( std::ostream& out, //! into a WKT stream. //! \tparam MultiPoint must be a `RandomAccessRange` of `CGAL::Point_2`. //! \attention Only Cartesian Kernels with double or float as `FT` are supported. +//! \attention This function is only available with boost versions starting at 1.56. //!\see `CGAL::Point_2` template std::ostream& @@ -438,6 +447,7 @@ write_multi_point_WKT( std::ostream& out, //! into a WKT stream. //! \tparam MultiPolygon must be a `RandomAccessRange` of `CGAL::General_polygon_with_holes_2`. //! \attention Only Cartesian Kernels with double or float as `FT` are supported. +//! \attention This function is only available with boost versions starting at 1.56. //!\see `CGAL::General_polygon_with_holes_2` template std::ostream& @@ -449,6 +459,7 @@ write_multi_polygon_WKT( std::ostream& out, //! into a WKT stream. //! \tparam MultiLineString must be a `RandomAccessRange` of `LineString`. //! \attention Only Cartesian Kernels with double or float as `FT` are supported. +//! \attention This function is only available with boost versions starting at 1.56. //! \see `CGAL::write_linestring_WKT()` template std::ostream& @@ -463,6 +474,7 @@ write_multi_linestring_WKT( std::ostream& out, //! \tparam MultiLineString must be a `RandomAccessRange` of `Linestring`. //! \tparam MultiPolygon must be a model of `RandomAccessRange` of `CGAL::General_polygon_with_holes_2`. //! \attention Only Cartesian Kernels with double or float as `FT` are supported. +//! \attention This function is only available with boost versions starting at 1.56. //! \see `CGAL::read_linestring_WKT()` template= 105600 #include #include @@ -39,3 +40,4 @@ int main(int argc, char* argv[]) } } +#endif diff --git a/Stream_support/examples/Stream_support/Point_WKT.cpp b/Stream_support/examples/Stream_support/Point_WKT.cpp index 1498f16b995..7c97f211bac 100644 --- a/Stream_support/examples/Stream_support/Point_WKT.cpp +++ b/Stream_support/examples/Stream_support/Point_WKT.cpp @@ -1,3 +1,4 @@ +#if BOOST_VERSION >= 105600 #include #include @@ -29,3 +30,4 @@ int main(int argc, char* argv[]) } is.close(); } +#endif diff --git a/Stream_support/examples/Stream_support/Polygon_WKT.cpp b/Stream_support/examples/Stream_support/Polygon_WKT.cpp index 382820077e3..c415b26d9ce 100644 --- a/Stream_support/examples/Stream_support/Polygon_WKT.cpp +++ b/Stream_support/examples/Stream_support/Polygon_WKT.cpp @@ -1,3 +1,4 @@ +#if BOOST_VERSION >= 105600 #include #include @@ -44,3 +45,4 @@ int main(int argc, char* argv[]) } return 0; } +#endif diff --git a/Stream_support/examples/Stream_support/read_WKT.cpp b/Stream_support/examples/Stream_support/read_WKT.cpp index f2d66ecf59b..cf619ca789c 100644 --- a/Stream_support/examples/Stream_support/read_WKT.cpp +++ b/Stream_support/examples/Stream_support/read_WKT.cpp @@ -1,3 +1,4 @@ +#if BOOST_VERSION >= 105600 #include #include @@ -42,3 +43,4 @@ int main(int argc, char* argv[]) } return 0; } +#endif diff --git a/Stream_support/include/CGAL/IO/WKT.h b/Stream_support/include/CGAL/IO/WKT.h index 34602dd3451..4dad1f6d129 100644 --- a/Stream_support/include/CGAL/IO/WKT.h +++ b/Stream_support/include/CGAL/IO/WKT.h @@ -20,12 +20,12 @@ #ifndef CGAL_IO_WKT_H #define CGAL_IO_WKT_H - +#if BOOST_VERSION >= 105600 #include #include #include -#include + #include #include #include @@ -395,3 +395,4 @@ read_WKT( std::istream& input, } }//end CGAL #endif +#endif diff --git a/Stream_support/include/CGAL/IO/traits_linestring.h b/Stream_support/include/CGAL/IO/traits_linestring.h index 0e55829e09e..f6da2fa019c 100644 --- a/Stream_support/include/CGAL/IO/traits_linestring.h +++ b/Stream_support/include/CGAL/IO/traits_linestring.h @@ -17,6 +17,7 @@ // SPDX-License-Identifier: LGPL-3.0+ // // Author(s) : Maxime Gimeno +#if BOOST_VERSION >= 105600 #ifndef CGAL_IO_TRAITS_LINESTRING_H #define CGAL_IO_TRAITS_LINESTRING_H @@ -35,3 +36,4 @@ template< typename R> struct tag= 105600 #include #include #include @@ -37,3 +37,4 @@ struct tag > }//end geometry }//end boost #endif // TRAITS_MULTILINESTRING_H +#endif diff --git a/Stream_support/include/CGAL/IO/traits_multipoint.h b/Stream_support/include/CGAL/IO/traits_multipoint.h index bd140294f67..c8d92470908 100644 --- a/Stream_support/include/CGAL/IO/traits_multipoint.h +++ b/Stream_support/include/CGAL/IO/traits_multipoint.h @@ -20,6 +20,7 @@ #ifndef CGAL_IO_TRAITS_MULTIPOINT_H #define CGAL_IO_TRAITS_MULTIPOINT_H +#if BOOST_VERSION >= 105600 #include #include #include @@ -36,3 +37,4 @@ struct tag > }//end geometry }//end boost #endif // TRAITS_MULTIPOINT_H +#endif diff --git a/Stream_support/include/CGAL/IO/traits_multipolygon.h b/Stream_support/include/CGAL/IO/traits_multipolygon.h index 323160ca551..fd3b7259fb9 100644 --- a/Stream_support/include/CGAL/IO/traits_multipolygon.h +++ b/Stream_support/include/CGAL/IO/traits_multipolygon.h @@ -20,6 +20,7 @@ #ifndef CGAL_IO_TRAITS_MULTIPOLYGON_H #define CGAL_IO_TRAITS_MULTIPOLYGON_H +#if BOOST_VERSION >= 105600 #include #include #include @@ -38,4 +39,5 @@ struct tag > }//end boost #endif +#endif diff --git a/Stream_support/include/CGAL/IO/traits_point.h b/Stream_support/include/CGAL/IO/traits_point.h index 7223512eb29..a5026cad1f3 100644 --- a/Stream_support/include/CGAL/IO/traits_point.h +++ b/Stream_support/include/CGAL/IO/traits_point.h @@ -20,7 +20,7 @@ #ifndef CGAL_IO_TRAITS_POINT_H #define CGAL_IO_TRAITS_POINT_H - +#if BOOST_VERSION >= 105600 #include #include #include @@ -74,3 +74,4 @@ struct access , 1> }}}//end namespaces #endif +#endif diff --git a/Stream_support/include/CGAL/IO/traits_point_3.h b/Stream_support/include/CGAL/IO/traits_point_3.h index 38dbfa3cdc7..dc7cd863032 100644 --- a/Stream_support/include/CGAL/IO/traits_point_3.h +++ b/Stream_support/include/CGAL/IO/traits_point_3.h @@ -20,7 +20,7 @@ #ifndef CGAL_IO_TRAITS_POINT_3_H #define CGAL_IO_TRAITS_POINT_3_H - +#if BOOST_VERSION >= 105600 #include #include #include @@ -88,3 +88,4 @@ struct access , 2> }}}//end namespaces #endif +#endif diff --git a/Stream_support/include/CGAL/IO/traits_polygon.h b/Stream_support/include/CGAL/IO/traits_polygon.h index 1e7acb13106..be71ff5ab3f 100644 --- a/Stream_support/include/CGAL/IO/traits_polygon.h +++ b/Stream_support/include/CGAL/IO/traits_polygon.h @@ -20,6 +20,7 @@ #ifndef CGAL_IO_TRAITS_POLYGON_H #define CGAL_IO_TRAITS_POLYGON_H +#if BOOST_VERSION >= 105600 #include #include #include @@ -91,3 +92,4 @@ struct range_value > }//end boost #endif +#endif diff --git a/Stream_support/include/CGAL/internal/Geometry_container.h b/Stream_support/include/CGAL/internal/Geometry_container.h index 2b3b72899e6..957f83cae7b 100644 --- a/Stream_support/include/CGAL/internal/Geometry_container.h +++ b/Stream_support/include/CGAL/internal/Geometry_container.h @@ -20,6 +20,7 @@ #ifndef GEOMETRY_CONTAINER_H #define GEOMETRY_CONTAINER_H +#if BOOST_VERSION >= 105600 #include #include #include @@ -123,3 +124,4 @@ struct range_mutable_iterator > }//end boost #endif // GEOMETRY_CONTAINER_H +#endif diff --git a/Stream_support/test/Stream_support/test_read_WKT.cpp b/Stream_support/test/Stream_support/test_read_WKT.cpp index b33c387f028..5d5e6a615c6 100644 --- a/Stream_support/test/Stream_support/test_read_WKT.cpp +++ b/Stream_support/test/Stream_support/test_read_WKT.cpp @@ -1,6 +1,6 @@ #include #include - +#if BOOST_VERSION >= 105600 #include #include @@ -67,3 +67,5 @@ int main() std::cout<<"WKT reading test passed."<= 105600 #include #include @@ -201,3 +202,4 @@ int main() std::cout<<"WKT writing test passed."<