CGAL 6.0 - 2D Regularized Boolean Set-Operations
Loading...
Searching...
No Matches

There are several overloaded function templates called difference() that compute the difference between two polygons and insert the resulting polygons with holes into a container via an output iterator.

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

1.1.OutputIterator difference(const Type1& pgn1, const Type2& pgn2, OutputIterator oi, UsePolylines = Tag_true());
1.2.OutputIterator difference(const Type1& pgn1, const Type2& pgn2, OutputIterator oi);
2.OutputIterator difference(const Type1& pgn1, const Type2& pgn2, OutputIterator oi, const GpsTraits& traits);
Template Parameters
UsePolylinesdetermines whether the boundaries of the input polygons are 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, the input polygons are converted to general polygons bounded by polylines before the operation is actually performed. Then, the resulting general polygons with holes are converted back to standard polygons. If substituted with CGAL::Tag_false, the input polygons are used as is. Refer to Traits Selection for more information.
 Type1 Type2 Dereference Type of oi
1Polygon_2 Polygon_2 Polygon_with_holes_2
2Polygon_2 Polygon_with_holes_2 Polygon_with_holes_2
3Polygon_with_holes_2 Polygon_2 Polygon_with_holes_2
4Polygon_with_holes_2 Polygon_with_holes_2 Polygon_with_holes_2
5General_polygon_2 General_polygon_2 General_polygon_with_holes_2
6General_polygon_2 General_polygon_with_holes_2General_polygon_with_holes_2
7General_polygon_with_holes_2General_polygon_2 General_polygon_with_holes_2
8General_polygon_with_holes_2General_polygon_with_holes_2General_polygon_with_holes_2
Parameters
pgn1,pgn2the input polygons.
oithe output iterator for the result.
traitsan optional traits object.
See also
CGAL::complement()
CGAL::do_intersect()
CGAL::intersection()
CGAL::join()
CGAL::symmetric_difference()

Functions

template<typename Kernel , typename Container , typename OutputIterator >
OutputIterator CGAL::difference (const Polygon_2< Kernel, Container > &pgn1, const Polygon_2< Kernel, Container > &pgn2, OutputIterator oi)
 computes the difference of two polygons and inserts the resulting polygons with holes into a container via an output iterator.
 
template<typename Kernel , typename Container , typename OutputIterator , typename UsePolylines >
OutputIterator CGAL::difference (const Polygon_2< Kernel, Container > &pgn1, const Polygon_2< Kernel, Container > &pgn2, OutputIterator oi, UsePolylines=Tag_true())
 computes the difference of two polygons and inserts the resulting polygons with holes into a container via an output iterator.
 
template<typename Kernel , typename Container , typename OutputIterator >
OutputIterator CGAL::difference (const Polygon_2< Kernel, Container > &pgn1, const Polygon_with_holes_2< Kernel, Container > &pgn2, OutputIterator oi)
 computes the difference of two polygons and inserts the resulting polygons with holes into a container via an output iterator.
 
template<typename Kernel , typename Container , typename OutputIterator , typename UsePolylines >
OutputIterator CGAL::difference (const Polygon_2< Kernel, Container > &pgn1, const Polygon_with_holes_2< Kernel, Container > &pgn2, OutputIterator oi, UsePolylines=Tag_true())
 computes the difference of two polygons and inserts the resulting polygons with holes into a container via an output iterator.
 
template<typename Kernel , typename Container , typename OutputIterator >
OutputIterator CGAL::difference (const Polygon_with_holes_2< Kernel, Container > &pgn1, const Polygon_2< Kernel, Container > &pgn2, OutputIterator oi)
 computes the difference of two polygons and inserts the resulting polygons with holes into a container via an output iterator.
 
template<typename Kernel , typename Container , typename OutputIterator , typename UsePolylines >
OutputIterator CGAL::difference (const Polygon_with_holes_2< Kernel, Container > &pgn1, const Polygon_2< Kernel, Container > &pgn2, OutputIterator oi, UsePolylines=Tag_true())
 computes the difference of two polygons and inserts the resulting polygons with holes into a container via an output iterator.
 
template<typename Kernel , typename Container , typename OutputIterator >
OutputIterator CGAL::difference (const Polygon_with_holes_2< Kernel, Container > &pgn1, const Polygon_with_holes_2< Kernel, Container > &pgn2, OutputIterator oi)
 computes the difference of two polygons and inserts the resulting polygons with holes into a container via an output iterator.
 
template<typename Kernel , typename Container , typename OutputIterator , typename UsePolylines >
OutputIterator CGAL::difference (const Polygon_with_holes_2< Kernel, Container > &pgn1, const Polygon_with_holes_2< Kernel, Container > &pgn2, OutputIterator oi, UsePolylines=Tag_true())
 computes the difference of two polygons and inserts the resulting polygons with holes into a container via an output iterator.
 
template<typename ArrTraits , typename OutputIterator >
OutputIterator CGAL::difference (const General_polygon_2< ArrTraits > &pgn1, const General_polygon_2< ArrTraits > &pgn2, OutputIterator oi)
 computes the difference of two general polygons and inserts the resulting general polygons with holes into a container via an output iterator.
 
template<typename ArrTraits , typename OutputIterator >
OutputIterator CGAL::difference (const General_polygon_with_holes_2< General_polygon_2< ArrTraits > > &pgn1, const General_polygon_2< ArrTraits > &pgn2, OutputIterator oi)
 computes the difference of two general polygons and inserts the resulting general polygons with holes into a container via an output iterator.
 
template<typename ArrTraits , typename OutputIterator >
OutputIterator CGAL::difference (const General_polygon_2< ArrTraits > &pgn1, const General_polygon_with_holes_2< General_polygon_2< ArrTraits > > &pgn2, OutputIterator oi)
 computes the difference of two polygons and inserts the resulting general polygons with holes into a container via an output iterator.
 
template<typename Polygon , typename OutputIterator >
OutputIterator CGAL::difference (const General_polygon_with_holes_2< Polygon > &pgn1, const General_polygon_with_holes_2< Polygon > &pgn2, OutputIterator oi)
 computes the difference of two general polygons with holes and inserts the resulting general polygons with holes into a container via an output iterator.
 
template<typename Kernel , typename Container , typename OutputIterator , typename GpsTraits >
OutputIterator CGAL::difference (const Polygon_2< Kernel, Container > &pgn1, const Polygon_2< Kernel, Container > &pgn2, OutputIterator oi, const GpsTraits &traits)
 computes the difference of two polygons and inserts the resulting polygons with holes into a container via an output iterator.
 
template<typename Kernel , typename Container , typename OutputIterator , typename GpsTraits >
OutputIterator CGAL::difference (const Polygon_2< Kernel, Container > &pgn1, const Polygon_with_holes_2< Kernel, Container > &pgn2, OutputIterator oi, const GpsTraits &traits)
 computes the difference of two polygons and inserts the resulting polygons with holes into a container via an output iterator.
 
template<typename Kernel , typename Container , typename OutputIterator , typename GpsTraits >
OutputIterator CGAL::difference (const Polygon_with_holes_2< Kernel, Container > &pgn1, const Polygon_2< Kernel, Container > &pgn2, OutputIterator oi, const GpsTraits &traits)
 computes the difference of two polygons and inserts the resulting polygons with holes into a container via an output iterator.
 
template<typename Kernel , typename Container , typename OutputIterator , typename GpsTraits >
OutputIterator CGAL::difference (const Polygon_with_holes_2< Kernel, Container > &pgn1, const Polygon_with_holes_2< Kernel, Container > &pgn2, OutputIterator oi, const GpsTraits &traits)
 computes the difference of two polygons with holes and inserts the resulting polygons with holes into a container via an output iterator.
 
template<typename ArrTraits , typename OutputIterator , typename GpsTraits >
OutputIterator CGAL::difference (const General_polygon_2< ArrTraits > &pgn1, const General_polygon_2< ArrTraits > &pgn2, OutputIterator oi, const GpsTraits &traits)
 computes the difference of two general polygons and inserts the resulting general polygons with holes into a container via an output iterator.
 
template<typename ArrTraits , typename OutputIterator , typename GpsTraits >
OutputIterator CGAL::difference (const General_polygon_with_holes_2< General_polygon_2< ArrTraits > > &pgn1, const General_polygon_2< ArrTraits > &pgn2, OutputIterator oi, const GpsTraits &traits)
 computes the difference of two general polygons and inserts the resulting general polygons with holes into a container via an output iterator.
 
template<typename ArrTraits , typename OutputIterator , typename GpsTraits >
OutputIterator CGAL::difference (const General_polygon_2< ArrTraits > &pgn1, const General_polygon_with_holes_2< General_polygon_2< ArrTraits > > &pgn2, OutputIterator oi, const GpsTraits &traits)
 computes the difference of two general polygons and inserts the resulting general polygons with holes into a container via an output iterator.
 
template<typename Polygon , typename OutputIterator , typename GpsTraits >
OutputIterator CGAL::difference (const General_polygon_with_holes_2< Polygon > &pgn1, const General_polygon_with_holes_2< Polygon > &pgn2, OutputIterator oi, const GpsTraits &traits)
 computes the difference of two general polygons and inserts the resulting general polygons with holes into a container via an output iterator.
 

Function Documentation

◆ difference() [1/20]

template<typename ArrTraits , typename OutputIterator >
OutputIterator CGAL::difference ( const General_polygon_2< ArrTraits > &  pgn1,
const General_polygon_2< ArrTraits > &  pgn2,
OutputIterator  oi 
)

#include <CGAL/Boolean_set_operations_2.h>

computes the difference of two general polygons and inserts the resulting general polygons with holes into a container via an output iterator.

Parameters
pgn1the 1st input polygon.
pgn2the 2nd input polygon.
oithe output iterator for the result. Its dereference type must be convertibe 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 ArrangementDirectionalXMonotoneTraits_2.

◆ difference() [2/20]

template<typename ArrTraits , typename OutputIterator , typename GpsTraits >
OutputIterator CGAL::difference ( const General_polygon_2< ArrTraits > &  pgn1,
const General_polygon_2< ArrTraits > &  pgn2,
OutputIterator  oi,
const GpsTraits &  traits 
)

#include <CGAL/Boolean_set_operations_2.h>

computes the difference of two general polygons and inserts the resulting general polygons with holes into a container via an output iterator.

Parameters
pgn1the 1st input polygon.
pgn2the 2nd input polygon.
oithe output iterator for the result. Its dereference type must be convertibe 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 ArrangementDirectionalXMonotoneTraits_2.
GpsTraits must be a model of GeneralPolygonSetTraits_2.

◆ difference() [3/20]

template<typename ArrTraits , typename OutputIterator >
OutputIterator CGAL::difference ( const General_polygon_2< ArrTraits > &  pgn1,
const General_polygon_with_holes_2< General_polygon_2< ArrTraits > > &  pgn2,
OutputIterator  oi 
)

#include <CGAL/Boolean_set_operations_2.h>

computes the difference of two polygons and inserts the resulting general polygons with holes into a container via an output iterator.

Parameters
pgn1the 1st input polygon.
pgn2the 2nd input polygon.
oithe output iterator for the result. Its dereference type must be convertibe 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 ArrangementDirectionalXMonotoneTraits_2.

◆ difference() [4/20]

template<typename ArrTraits , typename OutputIterator , typename GpsTraits >
OutputIterator CGAL::difference ( const General_polygon_2< ArrTraits > &  pgn1,
const General_polygon_with_holes_2< General_polygon_2< ArrTraits > > &  pgn2,
OutputIterator  oi,
const GpsTraits &  traits 
)

#include <CGAL/Boolean_set_operations_2.h>

computes the difference of two general polygons and inserts the resulting general polygons with holes into a container via an output iterator.

Parameters
pgn1the 1st input polygon.
pgn2the 2nd input polygon.
oithe output iterator for the result. Its dereference type must be convertibe 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 ArrangementDirectionalXMonotoneTraits_2.
GpsTraits must be a model of GeneralPolygonSetTraits_2.

◆ difference() [5/20]

template<typename ArrTraits , typename OutputIterator >
OutputIterator CGAL::difference ( const General_polygon_with_holes_2< General_polygon_2< ArrTraits > > &  pgn1,
const General_polygon_2< ArrTraits > &  pgn2,
OutputIterator  oi 
)

#include <CGAL/Boolean_set_operations_2.h>

computes the difference of two general polygons and inserts the resulting general polygons with holes into a container via an output iterator.

Parameters
pgn1the 1st input polygon.
pgn2the 2nd input polygon.
oithe output iterator for the result. Its dereference type must be convertibe 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 ArrangementDirectionalXMonotoneTraits_2.

◆ difference() [6/20]

template<typename ArrTraits , typename OutputIterator , typename GpsTraits >
OutputIterator CGAL::difference ( const General_polygon_with_holes_2< General_polygon_2< ArrTraits > > &  pgn1,
const General_polygon_2< ArrTraits > &  pgn2,
OutputIterator  oi,
const GpsTraits &  traits 
)

#include <CGAL/Boolean_set_operations_2.h>

computes the difference of two general polygons and inserts the resulting general polygons with holes into a container via an output iterator.

Parameters
pgn1the 1st input polygon.
pgn2the 2nd input polygon.
oithe output iterator for the result. Its dereference type must be convertibe 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 ArrangementDirectionalXMonotoneTraits_2.
GpsTraits must be a model of GeneralPolygonSetTraits_2.

◆ difference() [7/20]

template<typename Polygon , typename OutputIterator >
OutputIterator CGAL::difference ( const General_polygon_with_holes_2< Polygon > &  pgn1,
const General_polygon_with_holes_2< Polygon > &  pgn2,
OutputIterator  oi 
)

#include <CGAL/Boolean_set_operations_2.h>

computes the difference of two general polygons with holes and inserts the resulting general polygons with holes into a container via an output iterator.

Parameters
pgn1the 1st input polygon.
pgn2the 2nd input polygon.
oithe output iterator for the result. Its dereference type must be convertibe to General_polygon_with_holes_2<Polygon>.
Returns
the past-the-end iterator of the output container.

◆ difference() [8/20]

template<typename Polygon , typename OutputIterator , typename GpsTraits >
OutputIterator CGAL::difference ( const General_polygon_with_holes_2< Polygon > &  pgn1,
const General_polygon_with_holes_2< Polygon > &  pgn2,
OutputIterator  oi,
const GpsTraits &  traits 
)

#include <CGAL/Boolean_set_operations_2.h>

computes the difference of two general polygons and inserts the resulting general polygons with holes into a container via an output iterator.

Parameters
pgn1the 1st input polygon.
pgn2the 2nd input polygon.
oithe output iterator for the result. Its dereference type must be convertibe to General_polygon_with_holes_2<Polygon>.
traitsa traits object.
Returns
the past-the-end iterator of the output container.
Precondition
GpsTraits must be a model of GeneralPolygonSetTraits_2.

◆ difference() [9/20]

template<typename Kernel , typename Container , typename OutputIterator >
OutputIterator CGAL::difference ( const Polygon_2< Kernel, Container > &  pgn1,
const Polygon_2< Kernel, Container > &  pgn2,
OutputIterator  oi 
)

#include <CGAL/Boolean_set_operations_2.h>

computes the difference of two polygons and inserts the resulting polygons with holes into a container via an output iterator.

Parameters
pgn1the 1st input polygon.
pgn2the 2nd input polygon.
oithe output iterator for the result. Its dereference type must be convertibe to Polygon_with_holes_2<Kernel, Container>.
Returns
the past-the-end iterator of the output container.

◆ difference() [10/20]

template<typename Kernel , typename Container , typename OutputIterator , typename GpsTraits >
OutputIterator CGAL::difference ( const Polygon_2< Kernel, Container > &  pgn1,
const Polygon_2< Kernel, Container > &  pgn2,
OutputIterator  oi,
const GpsTraits &  traits 
)

#include <CGAL/Boolean_set_operations_2.h>

computes the difference of two polygons and inserts the resulting polygons with holes into a container via an output iterator.

Parameters
pgn1the 1st input polygon.
pgn2the 2nd input polygon.
oithe output iterator for the result. Its dereference type must be convertibe 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 GeneralPolygonSetTraits_2.

◆ difference() [11/20]

template<typename Kernel , typename Container , typename OutputIterator , typename UsePolylines >
OutputIterator CGAL::difference ( const Polygon_2< Kernel, Container > &  pgn1,
const Polygon_2< Kernel, Container > &  pgn2,
OutputIterator  oi,
UsePolylines  = Tag_true() 
)

#include <CGAL/Boolean_set_operations_2.h>

computes the difference of two polygons and inserts the resulting polygons with holes into a container via an output iterator.

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

◆ difference() [12/20]

template<typename Kernel , typename Container , typename OutputIterator >
OutputIterator CGAL::difference ( const Polygon_2< Kernel, Container > &  pgn1,
const Polygon_with_holes_2< Kernel, Container > &  pgn2,
OutputIterator  oi 
)

#include <CGAL/Boolean_set_operations_2.h>

computes the difference of two polygons and inserts the resulting polygons with holes into a container via an output iterator.

Parameters
pgn1the 1st input polygon.
pgn2the 2nd input polygon.
oithe output iterator for the result. Its dereference type must be convertibe to Polygon_with_holes_2<Kernel, Container>.
Returns
the past-the-end iterator of the output container.

◆ difference() [13/20]

template<typename Kernel , typename Container , typename OutputIterator , typename GpsTraits >
OutputIterator CGAL::difference ( const Polygon_2< Kernel, Container > &  pgn1,
const Polygon_with_holes_2< Kernel, Container > &  pgn2,
OutputIterator  oi,
const GpsTraits &  traits 
)

#include <CGAL/Boolean_set_operations_2.h>

computes the difference of two polygons and inserts the resulting polygons with holes into a container via an output iterator.

Parameters
pgn1the 1st input polygon.
pgn2the 2nd input polygon.
oithe output iterator for the result. Its dereference type must be convertibe 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 GeneralPolygonSetTraits_2.

◆ difference() [14/20]

template<typename Kernel , typename Container , typename OutputIterator , typename UsePolylines >
OutputIterator CGAL::difference ( const Polygon_2< Kernel, Container > &  pgn1,
const Polygon_with_holes_2< Kernel, Container > &  pgn2,
OutputIterator  oi,
UsePolylines  = Tag_true() 
)

#include <CGAL/Boolean_set_operations_2.h>

computes the difference of two polygons and inserts the resulting polygons with holes into a container via an output iterator.

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

◆ difference() [15/20]

template<typename Kernel , typename Container , typename OutputIterator >
OutputIterator CGAL::difference ( const Polygon_with_holes_2< Kernel, Container > &  pgn1,
const Polygon_2< Kernel, Container > &  pgn2,
OutputIterator  oi 
)

#include <CGAL/Boolean_set_operations_2.h>

computes the difference of two polygons and inserts the resulting polygons with holes into a container via an output iterator.

Parameters
pgn1the 1st input polygon.
pgn2the 2nd input polygon.
oithe output iterator for the result. Its dereference type must be convertibe to Polygon_with_holes_2<Kernel, Container>.
Returns
the past-the-end iterator of the output container.

◆ difference() [16/20]

template<typename Kernel , typename Container , typename OutputIterator , typename GpsTraits >
OutputIterator CGAL::difference ( const Polygon_with_holes_2< Kernel, Container > &  pgn1,
const Polygon_2< Kernel, Container > &  pgn2,
OutputIterator  oi,
const GpsTraits &  traits 
)

#include <CGAL/Boolean_set_operations_2.h>

computes the difference of two polygons and inserts the resulting polygons with holes into a container via an output iterator.

Parameters
pgn1the 1st input polygon.
pgn2the 2nd input polygon.
oithe output iterator for the result. Its dereference type must be convertibe 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 GeneralPolygonSetTraits_2.

◆ difference() [17/20]

template<typename Kernel , typename Container , typename OutputIterator , typename UsePolylines >
OutputIterator CGAL::difference ( const Polygon_with_holes_2< Kernel, Container > &  pgn1,
const Polygon_2< Kernel, Container > &  pgn2,
OutputIterator  oi,
UsePolylines  = Tag_true() 
)

#include <CGAL/Boolean_set_operations_2.h>

computes the difference of two polygons and inserts the resulting polygons with holes into a container via an output iterator.

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

◆ difference() [18/20]

template<typename Kernel , typename Container , typename OutputIterator >
OutputIterator CGAL::difference ( const Polygon_with_holes_2< Kernel, Container > &  pgn1,
const Polygon_with_holes_2< Kernel, Container > &  pgn2,
OutputIterator  oi 
)

#include <CGAL/Boolean_set_operations_2.h>

computes the difference of two polygons and inserts the resulting polygons with holes into a container via an output iterator.

Parameters
pgn1the 1st input polygon.
pgn2the 2nd input polygon.
oithe output iterator for the result. Its dereference type must be convertibe to Polygon_with_holes_2<Kernel, Container>.
Returns
the past-the-end iterator of the output container.

◆ difference() [19/20]

template<typename Kernel , typename Container , typename OutputIterator , typename GpsTraits >
OutputIterator CGAL::difference ( const Polygon_with_holes_2< Kernel, Container > &  pgn1,
const Polygon_with_holes_2< Kernel, Container > &  pgn2,
OutputIterator  oi,
const GpsTraits &  traits 
)

#include <CGAL/Boolean_set_operations_2.h>

computes the difference of two polygons with holes and inserts the resulting polygons with holes into a container via an output iterator.

Parameters
pgn1the 1st input polygon.
pgn2the 2nd input polygon.
oithe output iterator for the result. Its dereference type must be convertibe 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 GeneralPolygonSetTraits_2.

◆ difference() [20/20]

template<typename Kernel , typename Container , typename OutputIterator , typename UsePolylines >
OutputIterator CGAL::difference ( const Polygon_with_holes_2< Kernel, Container > &  pgn1,
const Polygon_with_holes_2< Kernel, Container > &  pgn2,
OutputIterator  oi,
UsePolylines  = Tag_true() 
)

#include <CGAL/Boolean_set_operations_2.h>

computes the difference of two polygons and inserts the resulting polygons with holes into a container via an output iterator.

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