From db684c71e6e999f5b6014c9ac76329dbb75af2ac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Wed, 6 Nov 2024 10:59:20 +0100 Subject: [PATCH] make draw conditional --- .../examples/Polygon_repair/repair_non_zero_polygon_2.cpp | 5 ++++- .../examples/Polygon_repair/repair_union_intersect_2.cpp | 7 +++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/Polygon_repair/examples/Polygon_repair/repair_non_zero_polygon_2.cpp b/Polygon_repair/examples/Polygon_repair/repair_non_zero_polygon_2.cpp index b87459e968d..3ce04501ab0 100644 --- a/Polygon_repair/examples/Polygon_repair/repair_non_zero_polygon_2.cpp +++ b/Polygon_repair/examples/Polygon_repair/repair_non_zero_polygon_2.cpp @@ -5,7 +5,9 @@ #include #include #include +#ifdef CGAL_USE_BASIC_VIEWER #include +#endif using Kernel = CGAL::Exact_predicates_inexact_constructions_kernel; using Point_2 = Kernel::Point_2; @@ -22,8 +24,9 @@ int main(int argc, char* argv[]) { CGAL::IO::read_polygon_WKT(in, pin); Multipolygon_with_holes_2 mp = CGAL::Polygon_repair::repair(pin, CGAL::Polygon_repair::Non_zero_rule()); - +#ifdef CGAL_USE_BASIC_VIEWER CGAL::draw(mp); +#endif if (mp.number_of_polygons_with_holes() > 1) { CGAL::IO::write_multi_polygon_WKT(std::cout, mp); diff --git a/Polygon_repair/examples/Polygon_repair/repair_union_intersect_2.cpp b/Polygon_repair/examples/Polygon_repair/repair_union_intersect_2.cpp index f4d13ddaafb..c9a16441d7c 100644 --- a/Polygon_repair/examples/Polygon_repair/repair_union_intersect_2.cpp +++ b/Polygon_repair/examples/Polygon_repair/repair_union_intersect_2.cpp @@ -2,7 +2,10 @@ #include #include + +#ifdef CGAL_USE_BASIC_VIEWER #include +#endif #include @@ -38,13 +41,17 @@ main(int argc, char* argv[]) { std::ofstream out("union.wkt"); CGAL::IO::write_multi_polygon_WKT(out, mpwh); +#ifdef CGAL_USE_BASIC_VIEWER CGAL::draw(mpwh); +#endif } mpwh = CGAL::Polygon_repair::repair(pA, CGAL::Polygon_repair::Intersection_rule()); { std::ofstream out("intersection.wkt"); CGAL::IO::write_multi_polygon_WKT(out, mpwh); +#ifdef CGAL_USE_BASIC_VIEWER CGAL::draw(mpwh); +#endif } {