Skip to content

Commit

Permalink
Move Boolean.h
Browse files Browse the repository at this point in the history
  • Loading branch information
afabri committed Oct 4, 2024
1 parent f6da27d commit d03325b
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 13 deletions.
7 changes: 5 additions & 2 deletions GraphicsView/demo/Triangulation_2/Boolean_2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#include <CGAL/Exact_predicates_inexact_constructions_kernel.h>
#include <CGAL/Polygon_2.h>
#include <CGAL/point_generators_2.h>
#include <CGAL/Triangulation_2/Boolean.h>
#include <CGAL/Polygon_repair/Boolean.h>
#include <boost/config.hpp>
#include <boost/version.hpp>
#include <CGAL/IO/WKT.h>
Expand Down Expand Up @@ -36,7 +36,7 @@ typedef CGAL::Polygon_2<K> Polygon2;
typedef CGAL::Polygon_with_holes_2<K> Polygon_with_holes_2;
typedef CGAL::Multipolygon_with_holes_2<K> Multipolygon_with_holes_2;

typedef CGAL::Triangulations::Boolean<K> Boolean;
typedef CGAL::Polygon_repair::Boolean<K> Boolean;
typedef std::shared_ptr<Polygon2> PolygonPtr ;

typedef std::vector<PolygonPtr> PolygonPtr_vector ;
Expand Down Expand Up @@ -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());
Expand Down
9 changes: 7 additions & 2 deletions Polygon_repair/examples/Polygon_repair/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand All @@ -13,4 +13,9 @@ file(
${CMAKE_CURRENT_SOURCE_DIR}/*.cpp)
foreach(cppfile ${cppfiles})
create_single_source_cgal_program("${cppfile}")
endforeach()
endforeach()


if(CGAL_Qt6_FOUND)
target_link_libraries(repair_non_zero_polygon_2 PUBLIC CGAL::CGAL_Basic_viewer)
endif()
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@
#include <CGAL/Exact_predicates_inexact_constructions_kernel.h>
#include <CGAL/Polygon_repair/repair.h>
#include <CGAL/IO/WKT.h>
#include <CGAL/draw_multipolygon_with_holes_2.h>

using Kernel = CGAL::Exact_predicates_inexact_constructions_kernel;
using Point_2 = Kernel::Point_2;
using Polygon_2 = CGAL::Polygon_2<Kernel>;
using Polygon_with_holes_2 = CGAL::Polygon_with_holes_2<Kernel>;
using Multipolygon_with_holes_2 = CGAL::Multipolygon_with_holes_2<Kernel>;
using Winding = CGAL::Polygon_repair::Winding<Kernel>;

int main(int argc, char* argv[]) {

Expand All @@ -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 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 <CGAL/license/Triangulation_2.h>

#include <CGAL/Exact_predicates_exact_constructions_kernel.h>
#include <CGAL/license/Polygon_repair.h>

#include <CGAL/Polygon_with_holes_2.h>
#include <CGAL/Multipolygon_with_holes_2.h>
Expand All @@ -31,7 +29,7 @@
#include <boost/property_map/property_map.hpp>

namespace CGAL {
namespace Triangulations {
namespace Polygon_repair {

/*!
\ingroup PkgTriangulation2Miscellaneous
Expand Down Expand Up @@ -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

0 comments on commit d03325b

Please sign in to comment.