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
-
| Kernel | a model of the concept PolygonTraits_2. |
| Container | a model of the concept Container; defaults to std::vector<Kernel::Point_2>. |
| ArrTraits | a model of the concept AosDirectionalXMonotoneTraits_2. |
| GpsTraits | a model of the concept GeneralPolygonSetTraits_2, which must be convertible to ArrTraits. |
| 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. |
- The types Type1 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.
- Parameters
-
| pgn | the input polygon. |
| res | the resulting polygon. |
| traits | an optional traits object. |
- See also
- CGAL::do_intersect()
-
CGAL::intersection()
-
CGAL::join()
-
CGAL::difference()
-
CGAL::symmetric_difference()
-
Polygon_2<Kernel, Container>
-
Polygon_with_holes_2<Kernel, Container>
|
| 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.
|