CGAL 6.1.3 - 2D Regularized Boolean Set-Operations
Loading...
Searching...
No Matches
Complement Functions

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 following signatures:

1.1.void complement(const Type1& pgn, Type2& res, UsePolylines = Tag_true());
1.2.void complement(const Type1& pgn, Type2& res);
2.void complement(const Type1& pgn, Type2& res, const GpsTraits& traits);
Template Parameters
UsePolylinesdetermines whether the boundary of the input polygon is treated as a cyclic sequence of single ( \(x\)-monotone) segments or as a cyclic sequence of ( \(x\)-monotone) polylines. If substituted with CGAL::Tag_true, which is the default, the input polygon is converted to a general polygon bounded by polylines before the operation is actually performed. Then, the resulting general polygon with holes is converted back to a standard polygon. If substituted with CGAL::Tag_false, the input polygon is used as is. Refer to Traits Selection for more information.
  • The types Type and Type2 of the parameters must be convertible to the types specified in a row in the table below, respectively.
  • The types that apply to signature (1.1.) above are restricted to those listed in rows 1 and 2 in the table below.
  • The types that apply to signature (1.2.) above are restricted to those listed in rows 3 and 4 in the table below.
 Type1Type2
1Polygon_2Polygon_with_holes_2
2Polygon_with_holes_2Polygon_with_holes_2
3General_polygon_2General_polygon_with_holes_2
4General_polygon_with_holes_2General_polygon_with_holes_2
Parameters
pgnthe input polygon.
resthe resulting polygon.
traitsan optional traits object.
See also
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.
template<typename Kernel, typename Container, typename UsePolylines>
void CGAL::complement (const Polygon_2< Kernel, Container > &pgn, Polygon_with_holes_2< Kernel, Container > &res, UsePolylines=Tag_true())
 computes the complement of a polygon.
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.
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.
template<typename Traits, typename OutputIterator, typename UsePolylines>
OutputIterator CGAL::complement (const Polygon_with_holes_2< Kernel, Container > &pgn, OutputIterator oi, UsePolylines=Tag_true())
 computes the complement of a polygon with holes.
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.
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.
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.
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.
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.

Function Documentation

◆ complement() [1/10]

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
pgnthe input polygon.
resthe complement of pgn.
Precondition
ArrTraits must be a model of the concept AosDirectionalXMonotoneTraits_2.

◆ complement() [2/10]

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
pgnthe input polygon.
resthe resulting complement of pgn
traitsa traits object.
Precondition
ArrTraits must be a model of the concept AosDirectionalXMonotoneTraits_2.
GpsTraits must be a model of the concept GeneralPolygonSetTraits_2.

◆ complement() [3/10]

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
pgnthe input polygon.
oithe output iterator for the result. Its dereference type must be convertible to General_polygon_with_holes_2<<General_polygon_2<ArrTraits>>.
Returns
the past-the-end iterator of the output container.
Precondition
ArrTraits must be a model of the concept AosDirectionalXMonotoneTraits_2.

◆ complement() [4/10]

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
pgnthe input polygon.
oithe output iterator for the result. Its dereference type must be convertible to General_polygon_with_holes_2<<General_polygon_2<ArrTraits>>.
traitsa traits object.
Returns
the past-the-end iterator of the output container.
Precondition
ArrTraits must be a model of the concept AosDirectionalXMonotoneTraits_2.
GpsTraits must be a model of the concept GeneralPolygonSetTraits_2.

◆ complement() [5/10]

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
pgnthe input polygon.
resthe resulting complement of pgn.

◆ complement() [6/10]

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
pgnthe input polygon.
resthe resulting complement of pgn
traitsa traits object.
Precondition
GpsTraits must be a model of the concept GeneralPolygonSetTraits_2.

◆ complement() [7/10]

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

#include <CGAL/Boolean_set_operations_2.h>

computes the complement of a polygon.

Template Parameters
UsePolylinesdetermines whether the boundary of pgn is treated as a cyclic sequence of single ( \(x\)-monotone) segments or as a cyclic sequence of ( \(x\)-monotone) polylines. If substituted with CGAL::Tag_true, which is the default, pgn is converted to a general polygon bounded by polylines before the operation is actually performed. Then, the resulting general polygon with holes is converted back to a standard polygon. If substituted with CGAL::Tag_false, pgn is used as is. Refer to Traits Selection for more information.
Parameters
pgnthe input polygon.
resthe resulting complement of pgn.

◆ complement() [8/10]

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
pgnthe input polygon.
oithe output iterator for the result. Its dereference type must be convertible to Polygon_with_holes_2<Kernel, Container>.
Returns
the past-the-end iterator of the output container.

◆ complement() [9/10]

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
pgnthe input polygon.
oithe output iterator for the result. Its dereference type must be convertible to Polygon_with_holes_2<Kernel, Container>.
traitsa traits object.
Returns
the past-the-end iterator of the output container.
Precondition
GpsTraits must be a model of the concept GeneralPolygonSetTraits_2.

◆ complement() [10/10]

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

#include <CGAL/Boolean_set_operations_2.h>

computes the complement of a polygon with holes.

Template Parameters
UsePolylinesdetermines whether the boundaries of pgn is treated as cyclic sequences of single ( \(x\)-monotone) segments or as cyclic sequences of ( \(x\)-monotone) polylines. If substituted with CGAL::Tag_true, which is the default, pgn is converted to a general polygon with holes bounded by polylines before the operation is actually performed. Then, the resulting general polygons with holes are converted back to a standard polygon with holes. If substituted with CGAL::Tag_false, pgn is used as is. Refer to Traits Selection for more information.
Parameters
pgnthe input polygon.
oithe output iterator for the result. Its dereference type must be convertible to Polygon_with_holes_2<Kernel, Container>.
Returns
the past-the-end iterator of the output container.