diff --git a/GraphicsView/demo/Triangulation_2/Boolean_2.cpp b/GraphicsView/demo/Triangulation_2/Boolean_2.cpp index b163eb14ad44..1b0c6c05d556 100644 --- a/GraphicsView/demo/Triangulation_2/Boolean_2.cpp +++ b/GraphicsView/demo/Triangulation_2/Boolean_2.cpp @@ -3,7 +3,7 @@ #include #include #include -#include +#include #include #include #include @@ -36,7 +36,7 @@ typedef CGAL::Polygon_2 Polygon2; typedef CGAL::Polygon_with_holes_2 Polygon_with_holes_2; typedef CGAL::Multipolygon_with_holes_2 Multipolygon_with_holes_2; -typedef CGAL::Triangulations::Boolean Boolean; +typedef CGAL::Polygon_repair::Boolean Boolean; typedef std::shared_ptr PolygonPtr ; typedef std::vector PolygonPtr_vector ; @@ -211,6 +211,9 @@ MainWindow::on_actionClear_triggered() { pwhA.clear(); mpwhA.clear(); + pwhB.clear(); + mpwhB.clear(); + mpwhC.clear(); clear(); this->actionCreateInputPolygon->setChecked(true); Q_EMIT( changed()); diff --git a/Polygon_repair/examples/Polygon_repair/CMakeLists.txt b/Polygon_repair/examples/Polygon_repair/CMakeLists.txt index 93722bb7c3ba..2f77af2afe7b 100644 --- a/Polygon_repair/examples/Polygon_repair/CMakeLists.txt +++ b/Polygon_repair/examples/Polygon_repair/CMakeLists.txt @@ -4,7 +4,7 @@ cmake_minimum_required(VERSION 3.12...3.29) project(Polygon_repair_Examples) -find_package(CGAL REQUIRED) +find_package(CGAL REQUIRED OPTIONAL_COMPONENTS Qt6) # create a target per cppfile file( @@ -13,4 +13,9 @@ file( ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) foreach(cppfile ${cppfiles}) create_single_source_cgal_program("${cppfile}") -endforeach() \ No newline at end of file +endforeach() + + +if(CGAL_Qt6_FOUND) + target_link_libraries(repair_non_zero_polygon_2 PUBLIC CGAL::CGAL_Basic_viewer) +endif() 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 9856375f3e79..b87459e968d7 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,13 +5,13 @@ #include #include #include +#include using Kernel = CGAL::Exact_predicates_inexact_constructions_kernel; using Point_2 = Kernel::Point_2; using Polygon_2 = CGAL::Polygon_2; using Polygon_with_holes_2 = CGAL::Polygon_with_holes_2; using Multipolygon_with_holes_2 = CGAL::Multipolygon_with_holes_2; -using Winding = CGAL::Polygon_repair::Winding; int main(int argc, char* argv[]) { @@ -23,6 +23,8 @@ int main(int argc, char* argv[]) { Multipolygon_with_holes_2 mp = CGAL::Polygon_repair::repair(pin, CGAL::Polygon_repair::Non_zero_rule()); + CGAL::draw(mp); + if (mp.number_of_polygons_with_holes() > 1) { CGAL::IO::write_multi_polygon_WKT(std::cout, mp); } else { diff --git a/Triangulation_2/include/CGAL/Triangulation_2/Boolean.h b/Polygon_repair/include/CGAL/Polygon_repair/Boolean.h similarity index 97% rename from Triangulation_2/include/CGAL/Triangulation_2/Boolean.h rename to Polygon_repair/include/CGAL/Polygon_repair/Boolean.h index 34215bd21202..b355bc6909ec 100644 --- a/Triangulation_2/include/CGAL/Triangulation_2/Boolean.h +++ b/Polygon_repair/include/CGAL/Polygon_repair/Boolean.h @@ -10,12 +10,10 @@ // // Author(s) : Andreas Fabri -#ifndef CGAL_TRIANGULATION_2_BOOLEAN_H -#define CGAL_TRIANGULATION_2_BOOLEAN_H +#ifndef CGAL_POLYGON_REPAIR_BOOLEAN_H +#define CGAL_POLYGON_REPAIR_BOOLEAN_H -#include - -#include +#include #include #include @@ -31,7 +29,7 @@ #include namespace CGAL { -namespace Triangulations { +namespace Polygon_repair { /*! \ingroup PkgTriangulation2Miscellaneous @@ -404,7 +402,7 @@ access to the underlying constrained triangulation. }; -} // namespace Triangulations +} // namespace Polygon_repair } //namespace CGAL -#endif CGAL_TRIANGULATION_2_BOOLEAN_H +#endif CGAL_POLYGON_REPAIR_BOOLEAN_H