CGAL 5.3 - 2D Regularized Boolean Set-Operations

There are several overloaded function templates called complement() that compute the complement of a given polygon pgn. Depending on the type of the polygon pgn the complement is either a single (general) polygon with holes, or several (general) poylgons with holes. In the latter case the complement() function template inserts the resulting poylgons with holes into a container via an output iterator.

A function template in this group has one of the two following signatures:

• void complement(const Type1& pgn, Type2& res);
• void complement(const Type1& pgn, Type2& res, const GpsTraits& traits);

Parameters

The types Type and Type2 of the parameters must be convertible to the types specified in a row in the table below, respectively.

Type1 Type2
Polygon_2 Polygon_with_holes_2
Polygon_with_holes_2 Polygon_with_holes_2
General_polygon_2 General_polygon_with_holes_2
General_polygon_with_holes_2General_polygon_with_holes_2
CGAL::do_intersect()
CGAL::intersection()
CGAL::join()
CGAL::difference()
CGAL::symmetric_difference()

## Functions

template<typename Kernel , typename Container >
void CGAL::complement (const Polygon_2< Kernel, Container > &pgn, Polygon_with_holes_2< Kernel, Container > &res)
computes the complement of a polygon. More...

template<typename ArrTraits >
void CGAL::complement (const General_polygon_2< ArrTraits > &pgn, General_polygon_with_holes_2< General_polygon_2< Arr_traits > > &res)
computes the complement of a general polygon. More...

template<typename Kernel , typename Container , typename OutputIterator >
OutputIterator CGAL::complement (const Polygon_with_holes_2< Kernel, Container > &pgn, OutputIterator oi)
computes the complement of a polygon with holes. More...

template<typename ArrTraits , typename OutputIterator >
OutputIterator CGAL::complement (const General_polygon_with_holes_2< General_polygon_2< ArrTraits > > &pgn, OutputIterator oi)
computes the complement of a general polygon with holes. More...

template<typename Kernel , typename Container , typename GpsTraits >
void CGAL::complement (const Polygon_2< Kernel, Container > &pgn, Polygon_with_holes_2< Kernel, Container > &res, const GpsTraits &traits)
computes the complement of a polygon. More...

template<typename ArrTraits , typename GpsTraits >
void CGAL::complement (const General_polygon_2< ArrTraits > &pgn, General_polygon_with_holes_2< General_polygon_2< Arr_traits > > &res, const GpsTraits &traits)
computes the complement of a general polygon. More...

template<typename Kernel , typename Container , typename OutputIterator , typename GpsTraits >
OutputIterator CGAL::complement (const Polygon_with_holes_2< Kernel, Container > &pgn, OutputIterator oi, const GpsTraits &traits)
computes the complement of a polygon with holes. More...

template<typename Polygon , typename OutputIterato , typename GpsTraitsr >
OutputIterator CGAL::complement (const General_polygon_with_holes_2< Polygon > &pgn, OutputIterator oi, const GpsTraits &traits)
computes the complement of the general polygon with holes. More...

## ◆ complement() [1/8]

template<typename Kernel , typename Container >
 void CGAL::complement ( const Polygon_2< Kernel, Container > & pgn, Polygon_with_holes_2< Kernel, Container > & res )

#include <CGAL/Boolean_set_operations_2.h>

computes the complement of a polygon.

Parameters
 pgn the input polygon. res the resulting complement of pgn.

## ◆ complement() [2/8]

template<typename ArrTraits >
 void CGAL::complement ( const General_polygon_2< ArrTraits > & pgn, General_polygon_with_holes_2< General_polygon_2< Arr_traits > > & res )

#include <CGAL/Boolean_set_operations_2.h>

computes the complement of a general polygon.

Parameters
 pgn the input polygon. res the complement of pgn.
Precondition
ArrTraits must be a model of the concept ArrangementDirectionalXMonotoneTraits_2.

## ◆ complement() [3/8]

template<typename Kernel , typename Container , typename OutputIterator >
 OutputIterator CGAL::complement ( const Polygon_with_holes_2< Kernel, Container > & pgn, OutputIterator oi )

#include <CGAL/Boolean_set_operations_2.h>

computes the complement of a polygon with holes.

Parameters
 pgn the input polygon. oi the output iterator for the result. Its dereference type must be convertible to Polygon_with_holes_2.
Returns
the past-the-end iterator of the output container.

## ◆ complement() [4/8]

template<typename ArrTraits , typename OutputIterator >
 OutputIterator CGAL::complement ( const General_polygon_with_holes_2< General_polygon_2< ArrTraits > > & pgn, OutputIterator oi )

#include <CGAL/Boolean_set_operations_2.h>

computes the complement of a general polygon with holes.

Parameters
 pgn the input polygon. oi the output iterator for the result. Its dereference type must be convertible to General_polygon_with_holes_2< >.
Returns
the past-the-end iterator of the output container.
Precondition
ArrTraits must be a model of the concept ArrangementDirectionalXMonotoneTraits_2.

## ◆ complement() [5/8]

template<typename Kernel , typename Container , typename GpsTraits >
 void CGAL::complement ( const Polygon_2< Kernel, Container > & pgn, Polygon_with_holes_2< Kernel, Container > & res, const GpsTraits & traits )

#include <CGAL/Boolean_set_operations_2.h>

computes the complement of a polygon.

Parameters
 pgn the input polygon. res the resulting complement of pgn traits a traits object.
Precondition
GpsTraits must be a model of the concept GeneralPolygonSetTraits_2.

## ◆ complement() [6/8]

template<typename ArrTraits , typename GpsTraits >
 void CGAL::complement ( const General_polygon_2< ArrTraits > & pgn, General_polygon_with_holes_2< General_polygon_2< Arr_traits > > & res, const GpsTraits & traits )

#include <CGAL/Boolean_set_operations_2.h>

computes the complement of a general polygon.

Parameters
 pgn the input polygon. res the resulting complement of pgn traits a traits object.
Precondition
ArrTraits must be a model of the concept ArrangementDirectionalXMonotoneTraits_2.
GpsTraits must be a model of the concept GeneralPolygonSetTraits_2.

## ◆ complement() [7/8]

template<typename Kernel , typename Container , typename OutputIterator , typename GpsTraits >
 OutputIterator CGAL::complement ( const Polygon_with_holes_2< Kernel, Container > & pgn, OutputIterator oi, const GpsTraits & traits )

#include <CGAL/Boolean_set_operations_2.h>

computes the complement of a polygon with holes.

Parameters
 pgn the input polygon. oi the output iterator for the result. Its dereference type must be convertible to Polygon_with_holes_2. traits a traits object.
Returns
the past-the-end iterator of the output container.
Precondition
GpsTraits must be a model of the concept GeneralPolygonSetTraits_2.

## ◆ complement() [8/8]

template<typename Polygon , typename OutputIterato , typename GpsTraitsr >
 OutputIterator CGAL::complement ( const General_polygon_with_holes_2< Polygon > & pgn, OutputIterator oi, const GpsTraits & traits )

#include <CGAL/Boolean_set_operations_2.h>

computes the complement of the general polygon with holes.

Parameters
 pgn the input polygon. oi the output iterator for the result. Its dereference type must be convertible to General_polygon_with_holes_2< >. traits a traits object.
Returns
the past-the-end iterator of the output container.
Precondition
ArrTraits must be a model of the concept ArrangementDirectionalXMonotoneTraits_2.
GpsTraits must be a model of the concept GeneralPolygonSetTraits_2.