CGAL 5.5.1 - 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 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); |
UsePolylines | determines 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. |
Type
and Type2
of the parameters must be convertible to the types specified in a row in the table below, respectively.Type1 | Type2 | |
---|---|---|
1 | Polygon_2 | Polygon_with_holes_2 |
2 | Polygon_with_holes_2 | Polygon_with_holes_2 |
3 | General_polygon_2 | General_polygon_with_holes_2 |
4 | General_polygon_with_holes_2 | General_polygon_with_holes_2 |
pgn | the input polygon. |
res | the resulting polygon. |
traits | an optional traits object. |
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 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. 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 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. 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... | |
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.
pgn | the input polygon. |
res | the resulting complement of pgn . |
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.
UsePolylines | determines 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. |
pgn | the input polygon. |
res | the resulting complement of pgn . |
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.
pgn | the input polygon. |
res | the complement of pgn . |
ArrTraits
must be a model of the concept ArrangementDirectionalXMonotoneTraits_2
. 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.
pgn | the input polygon. |
oi | the output iterator for the result. Its dereference type must be convertible to Polygon_with_holes_2<Kernel, Container> . |
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.
UsePolylines | determines 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. |
pgn | the input polygon. |
oi | the output iterator for the result. Its dereference type must be convertible to Polygon_with_holes_2<Kernel, Container> . |
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.
pgn | the input polygon. |
oi | the output iterator for the result. Its dereference type must be convertible to General_polygon_with_holes_2<<General_polygon_2<ArrTraits>> . |
ArrTraits
must be a model of the concept ArrangementDirectionalXMonotoneTraits_2
. 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.
pgn | the input polygon. |
res | the resulting complement of pgn |
traits | a traits object. |
GpsTraits
must be a model of the concept GeneralPolygonSetTraits_2
. 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.
pgn | the input polygon. |
res | the resulting complement of pgn |
traits | a traits object. |
ArrTraits
must be a model of the concept ArrangementDirectionalXMonotoneTraits_2
. GpsTraits
must be a model of the concept GeneralPolygonSetTraits_2
. 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.
pgn | the input polygon. |
oi | the output iterator for the result. Its dereference type must be convertible to Polygon_with_holes_2<Kernel, Container> . |
traits | a traits object. |
GpsTraits
must be a model of the concept GeneralPolygonSetTraits_2
. 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.
pgn | the input polygon. |
oi | the output iterator for the result. Its dereference type must be convertible to General_polygon_with_holes_2<<General_polygon_2<ArrTraits>> . |
traits | a traits object. |
ArrTraits
must be a model of the concept ArrangementDirectionalXMonotoneTraits_2
. GpsTraits
must be a model of the concept GeneralPolygonSetTraits_2
.