22#include <CGAL/Boolean_set_operations_2.h>
30 template <
typename KernelType>
31 CGAL::Polygon_2<KernelType>
36 CGAL::Polygon_2<KernelType> polygon;
42 CGALWrappers::dealii_point_to_cgal_point<CGAL::Point_2<KernelType>,
45 CGALWrappers::dealii_point_to_cgal_point<CGAL::Point_2<KernelType>,
48 CGALWrappers::dealii_point_to_cgal_point<CGAL::Point_2<KernelType>,
54 CGALWrappers::dealii_point_to_cgal_point<CGAL::Point_2<KernelType>,
57 CGALWrappers::dealii_point_to_cgal_point<CGAL::Point_2<KernelType>,
60 CGALWrappers::dealii_point_to_cgal_point<CGAL::Point_2<KernelType>,
63 CGALWrappers::dealii_point_to_cgal_point<CGAL::Point_2<KernelType>,
75 template <
typename KernelType>
76 CGAL::Polygon_with_holes_2<KernelType>
85 CGAL::Polygon_2<KernelType> outer_boundary;
86 std::vector<CGAL::Polygon_2<KernelType>> holes;
87 holes.reserve(boundaries.size() - 1);
89 for (
const auto &boundary : boundaries)
92 CGAL::Polygon_2<KernelType> current_polygon;
93 for (
const auto &vertices : boundary)
95 current_polygon.push_back(
96 dealii_point_to_cgal_point<CGAL::Point_2<KernelType>, 2>(
100 if (current_polygon.is_counterclockwise_oriented())
102 outer_boundary = current_polygon;
106 holes.push_back(current_polygon);
109 return CGAL::Polygon_with_holes_2<KernelType>(outer_boundary,
115 template <
typename KernelType>
116 CGAL::Polygon_with_holes_2<KernelType>
118 const CGAL::Polygon_2<KernelType> &boundary_outside,
119 const std::vector<CGAL::Polygon_2<KernelType>> &boundary_holes)
121 return CGAL::Polygon_with_holes_2<KernelType>(boundary_outside,
122 boundary_holes.begin(),
123 boundary_holes.end());
128 template <
typename KernelType>
129 std::vector<CGAL::Polygon_with_holes_2<KernelType>>
131 const CGAL::Polygon_with_holes_2<KernelType> &polygon_1,
132 const CGAL::Polygon_with_holes_2<KernelType> &polygon_2,
136 ExcMessage(
"Corefinement has no usecase for 2D polygons"));
138 std::vector<CGAL::Polygon_with_holes_2<KernelType>> polygon_out;
142 CGAL::intersection(polygon_1,
144 std::back_inserter(polygon_out));
148 CGAL::difference(polygon_1, polygon_2, std::back_inserter(polygon_out));
152 polygon_out.resize(1);
153 CGAL::join(polygon_1, polygon_2, polygon_out[0]);
166# include "cgal/polygon.inst"
virtual boost::container::small_vector< Point< spacedim >, ReferenceCells::max_n_vertices< dim >() > get_vertices(const typename Triangulation< dim, spacedim >::cell_iterator &cell) const
ReferenceCell< structdim > reference_cell() const
#define DEAL_II_NAMESPACE_OPEN
#define DEAL_II_NAMESPACE_CLOSE
#define DEAL_II_ASSERT_UNREACHABLE()
#define Assert(cond, exc)
static ::ExceptionBase & ExcMessage(std::string arg1)
TriaIterator< CellAccessor< dim, spacedim > > cell_iterator
MappingQ< dim, spacedim > StaticMappingQ1< dim, spacedim >::mapping
std::vector< CGAL::Polygon_with_holes_2< KernelType > > compute_boolean_operation(const CGAL::Polygon_with_holes_2< KernelType > &polygon_1, const CGAL::Polygon_with_holes_2< KernelType > &polygon_2, const BooleanOperation &boolean_operation)
CGAL::Polygon_2< KernelType > dealii_cell_to_cgal_polygon(const typename Triangulation< 2, 2 >::cell_iterator &cell, const Mapping< 2, 2 > &mapping)
CGAL::Polygon_with_holes_2< KernelType > dealii_tria_to_cgal_polygon(const Triangulation< 2, 2 > &tria, const Mapping< 2, 2 > &mapping)
CGAL::Polygon_with_holes_2< KernelType > polygon_to_polygon_with_holes(const CGAL::Polygon_2< KernelType > &boundary_outside, const std::vector< CGAL::Polygon_2< KernelType > > &boundary_holes={})
constexpr ReferenceCell< 2 > Quadrilateral
constexpr ReferenceCell< 2 > Triangle