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

There are several overloaded function templates called join() that compute the union of two polygons.

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

1.1.bool join(const Type1& pgn1, const Type2& pgn2, Type3& res, UsePolylines = Tag_true());
1.2.bool join(const Type1& pgn1, const Type2& pgn2, Type3& res);
2.bool join(const Type1& pgn1, const Type2& pgn2, Type3& res, const GpsTraits& traits);

There are also function templates that accept one or two ranges of input polygons:

3.1.OutputIterator join(InputIterator begin, InputIterator end, OutputIterator oi, UsePolylines = Tag_true());
3.2.OutputIterator join(InputIterator begin, InputIterator end, OutputIterator oi);
4.OutputIterator join(InputIterator begin, InputIterator end, OutputIterator oi, const GpsTraits& traits);
5.1.OutputIterator join(InputIterator1 begin1, InputIterator1 end1, InputIterator2 begin2, InputIterator2 end2, OutputIterator oi, UsePolylines = Tag_true());
5.2.OutputIterator join(InputIterator1 begin1, InputIterator1 end1, InputIterator2 begin2, InputIterator2 end2, OutputIterator oi);
6.OutputIterator join(InputIterator1 begin1, InputIterator1 end1, InputIterator2 begin2, InputIterator2 end2, 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 polygon with holes is converted back to a standard polygon. If substituted with CGAL::Tag_false, the input polygons are used as is. Refer to Traits Selection for more information.
 Type1 Type2 Type3
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.
(end,begin)a range of input polygons.
(end1,begin1)the first range of input polygons.
(end2,begin2)the second range of input polygons.
resthe resulting polygon.
oithe output iterator for the result.
traitsan optional traits object.
See also
CGAL::complement()
CGAL::do_intersect()
CGAL::intersection()
CGAL::difference()
CGAL::symmetric_difference()

Functions

template<typename Kernel , typename Container >
bool CGAL::join (const Polygon_2< Kernel, Container > &pgn1, const Polygon_2< Kernel, Container > &pgn2, General_polygon_with_holes_2< Polygon_2< Kernel, Container > > &res)
 computes the union of two polygons.
 
template<typename Kernel , typename Container , typename UsePolylines >
bool CGAL::join (const Polygon_2< Kernel, Container > &pgn1, const Polygon_2< Kernel, Container > &pgn2, General_polygon_with_holes_2< Polygon_2< Kernel, Container > > &res, UsePolylines=Tag_true())
 computes the union of two polygons.
 
template<typename Kernel , typename Container >
bool CGAL::join (const Polygon_2< Kernel, Container > &pgn1, const Polygon_with_holes_2< Kernel, Container > &pgn2, General_polygon_with_holes_2< Polygon_2< Kernel, Container > > &res)
 computes the union of two polygons.
 
template<typename Kernel , typename Container , typename UsePolylines >
bool CGAL::join (const Polygon_2< Kernel, Container > &pgn1, const Polygon_with_holes_2< Kernel, Container > &pgn2, General_polygon_with_holes_2< Polygon_2< Kernel, Container > > &res, UsePolylines=Tag_true())
 computes the union of two polygons.
 
template<typename Kernel , typename Container >
bool CGAL::join (const Polygon_with_holes_2< Kernel, Container > &pgn1, const Polygon_2< Kernel, Container > &pgn2, General_polygon_with_holes_2< Polygon_2< Kernel, Container > > &res)
 computes the union of two polygons.
 
template<typename Kernel , typename Container , typename UsePolylines >
bool CGAL::join (const Polygon_with_holes_2< Kernel, Container > &pgn1, const Polygon_2< Kernel, Container > &pgn2, General_polygon_with_holes_2< Polygon_2< Kernel, Container > > &res, UsePolylines=Tag_true())
 computes the union of two polygons.
 
template<typename Kernel , typename Container >
bool CGAL::join (const Polygon_with_holes_2< Kernel, Container > &pgn1, const Polygon_with_holes_2< Kernel, Container > &pgn2, General_polygon_with_holes_2< Polygon_2< Kernel, Container > > &res)
 computes the union of two polygons with holes.
 
template<typename Kernel , typename Container , typename UsePolylines >
bool CGAL::join (const Polygon_with_holes_2< Kernel, Container > &pgn1, const Polygon_with_holes_2< Kernel, Container > &pgn2, General_polygon_with_holes_2< Polygon_2< Kernel, Container > > &res, UsePolylines=Tag_true())
 computes the union of two polygons with holes.
 
template<typename ArrTraits >
bool CGAL::join (const General_polygon_2< ArrTraits > &pgn1, const General_polygon_2< ArrTraits > &pgn2, General_polygon_with_holes_2< General_polygon_2< ArrTraits > > &res)
 computes the union of two general polygons.
 
template<typename ArrTraits >
bool CGAL::join (const General_polygon_2< ArrTraits > &pgn1, const General_polygon_with_holes_2< General_polygon_2< ArrTraits > > &pgn2, General_polygon_with_holes_2< General_polygon_2< ArrTraits > > &res)
 computes the union of two general polygons.
 
template<typename ArrTraits >
bool CGAL::join (const General_polygon_with_holes_2< General_polygon_2< ArrTraits > > &pgn2, const General_polygon_2< ArrTraits > &pgn1, General_polygon_with_holes_2< General_polygon_2< ArrTraits > > &res)
 computes the union of two general polygons.
 
template<typename Polygon >
bool CGAL::join (const General_polygon_with_holes_2< Polygon > &pgn1, const General_polygon_with_holes_2< Polygon > &pgn2, General_polygon_with_holes_2< Polygon > &res)
 computes the union of two general polygons with holes.
 
template<typename InputIterator , typename OutputIterator >
OutputIterator CGAL::join (InputIterator begin, InputIterator end, OutputIterator oi)
 Given a range of polygons (respectively general polygons) or a range of polygons with holes (respectively general polygons with holes) computes the union of all polygons in the range and inserts the resulting polygons with holes (respectively general polygons with holes) into a container via an output iterator.
 
template<typename InputIterator , typename OutputIterator , typename UsePolylines >
OutputIterator CGAL::join (InputIterator begin, InputIterator end, OutputIterator oi, UsePolylines=Tag_true())
 Given a range of polygons (respectively general polygons) or a range of polygons with holes (respectively general polygons with holes) computes the union of all polygons in the range and inserts the resulting polygons with holes (respectively general polygons with holes) into a container via an output iterator.
 
template<typename InputIterator1 , typename InputIterator2 , typename OutputIterator >
OutputIterator CGAL::join (InputIterator1 begin1, InputIterator1 end1, InputIterator2 begin2, InputIterator2 end2, OutputIterator oi)
 Given a range of polygons (respectively general polygons) and a range of polygons with holes (respectively general polygons with holes) computes the union of all polygons in the two ranges and inserts the resulting polygons with holes (respectively general polygons with holes) into a container via an output iterator.
 
template<typename Kernel , typename Container , typename GpsTraits >
bool CGAL::join (const Polygon_2< Kernel, Container > &pgn1, const Polygon_2< Kernel, Container > &pgn2, General_polygon_with_holes_2< Polygon_2< Kernel, Container > > &res, const GpsTraits &traits)
 computes the union of two polygons.
 
template<typename Kernel , typename Container , typename GpsTraits >
bool CGAL::join (const Polygon_2< Kernel, Container > &pgn1, const Polygon_with_holes_2< Kernel, Container > &pgn2, General_polygon_with_holes_2< Polygon_2< Kernel, Container > > &res, const GpsTraits &traits)
 computes the union of two polygons.
 
template<typename Kernel , typename Container , typename GpsTraits >
bool CGAL::join (const Polygon_with_holes_2< Kernel, Container > &pgn2, const Polygon_2< Kernel, Container > &pgn1, General_polygon_with_holes_2< Polygon_2< Kernel, Container > > &res, const GpsTraits &traits)
 computes the union of two polygons.
 
template<typename Kernel , typename Container , typename GpsTraits >
bool CGAL::join (const Polygon_with_holes_2< Kernel, Container > &pgn2, const Polygon_with_holes_2< Kernel, Container > &pgn1, General_polygon_with_holes_2< Polygon_2< Kernel, Container > > &res, const GpsTraits &traits)
 computes the union of two polygons with holes.
 
template<typename ArrTraits , typename GpsTraits >
bool CGAL::join (const General_polygon_2< ArrTraits > &pgn1, const General_polygon_2< ArrTraits > &pgn2, General_polygon_with_holes_2< General_polygon_2< ArrTraits > > &res, const GpsTraits &traits)
 computes the union of two general polygons.
 
template<typename ArrTraits , typename GpsTraits >
bool CGAL::join (const General_polygon_2< ArrTraits > &pgn1, const General_polygon_with_holes_2< General_polygon_2< ArrTraits > > &pgn2, General_polygon_with_holes_2< General_polygon_2< ArrTraits > > &res, const GpsTraits &traits)
 computes the union of two general polygons.
 
template<typename ArrTraits , typename GpsTraits >
bool CGAL::join (const General_polygon_with_holes_2< General_polygon_2< ArrTraits > > &pgn2, const General_polygon_2< ArrTraits > &pgn1, General_polygon_with_holes_2< General_polygon_2< ArrTraits > > &res, const GpsTraits &traits)
 computes the union of two general polygons.
 
template<typename Polygon , typename GpsTraits >
bool CGAL::join (const General_polygon_with_holes_2< Polygon > &pgn1, const General_polygon_with_holes_2< Polygon > &pgn2, General_polygon_with_holes_2< Polygon > &res, const GpsTraits &traits)
 computes the union of two general polygons with holes.
 
template<typename InputIterator , typename OutputIterator , typename GpsTraits >
OutputIterator CGAL::join (InputIterator begin, InputIterator end, OutputIterator oi, const GpsTraits &traits)
 Given a range of polygons (respectively general polygons) or a range of polygons with holes (respectively general polygons with holes) computes the union of all polygons in the range and inserts the resulting polygons with holes (respectively general polygons with holes) into a container via an output iterator.
 
template<typename InputIterator1 , typename InputIterator2 , typename OutputIterator , typename GpsTraits >
OutputIterator CGAL::join (InputIterator1 begin1, InputIterator1 end1, InputIterator2 begin2, InputIterator2 end2, OutputIterator oi, const GpsTraits &traits)
 Given a range of polygons (respectively general polygons) and a range of polygons with holes (respectively general polygons with holes) computes the union of all polygons in the two ranges and inserts the resulting polygons with holes (respectively general polygons with holes) into a container via an output iterator.
 
template<typename InputIterator1 , typename InputIterator2 , class OutputIterator , typename UsePolylines >
OutputIterator CGAL::join (InputIterator1 begin1, InputIterator1 end1, InputIterator2 begin2, InputIterator2 end2, OutputIterator oi, UsePolylines=Tag_true())
 Given a range of polygons (respectively general polygons) and a range of polygons with holes (respectively general polygons with holes) computes the union of all polygons in the two ranges and inserts the resulting polygons with holes (respectively general polygons with holes) into a container via an output iterator.
 

Function Documentation

◆ join() [1/26]

template<typename ArrTraits >
bool CGAL::join ( const General_polygon_2< ArrTraits > &  pgn1,
const General_polygon_2< ArrTraits > &  pgn2,
General_polygon_with_holes_2< General_polygon_2< ArrTraits > > &  res 
)

#include <CGAL/Boolean_set_operations_2.h>

computes the union of two general polygons.

Parameters
pgn1the 1st input polygon.
pgn2the 2nd input polygon.
resthe resulting union of pgn1 and pgn2.
Returns
true if the two input polygons overlap.
Precondition
ArrTraits must be a model of the concept ArrangementDirectionalXMonotoneTraits_2.

◆ join() [2/26]

template<typename ArrTraits , typename GpsTraits >
bool CGAL::join ( const General_polygon_2< ArrTraits > &  pgn1,
const General_polygon_2< ArrTraits > &  pgn2,
General_polygon_with_holes_2< General_polygon_2< ArrTraits > > &  res,
const GpsTraits &  traits 
)

#include <CGAL/Boolean_set_operations_2.h>

computes the union of two general polygons.

Parameters
pgn1the 1st input polygon.
pgn2the 2nd input polygon.
resthe resulting union of pgn1 and pgn2.
traitsa traits object.
Returns
true if the two input polygons overlap.
Precondition
ArrTraits must be a model of the concept ArrangementDirectionalXMonotoneTraits_2.
GpsTraits must be a model of the concept GeneralPolygonSetTraits_2.

◆ join() [3/26]

template<typename ArrTraits >
bool CGAL::join ( const General_polygon_2< ArrTraits > &  pgn1,
const General_polygon_with_holes_2< General_polygon_2< ArrTraits > > &  pgn2,
General_polygon_with_holes_2< General_polygon_2< ArrTraits > > &  res 
)

#include <CGAL/Boolean_set_operations_2.h>

computes the union of two general polygons.

Parameters
pgn1the 1st input polygon.
pgn2the 2nd input polygon.
resthe resulting union of pgn1 and pgn2.
Returns
true if the two input polygons overlap.
Precondition
ArrTraits must be a model of the concept ArrangementDirectionalXMonotoneTraits_2.

◆ join() [4/26]

template<typename ArrTraits , typename GpsTraits >
bool CGAL::join ( const General_polygon_2< ArrTraits > &  pgn1,
const General_polygon_with_holes_2< General_polygon_2< ArrTraits > > &  pgn2,
General_polygon_with_holes_2< General_polygon_2< ArrTraits > > &  res,
const GpsTraits &  traits 
)

#include <CGAL/Boolean_set_operations_2.h>

computes the union of two general polygons.

Parameters
pgn1the 1st input polygon.
pgn2the 2nd input polygon.
resthe resulting union of pgn1 and pgn2.
traitsa traits object.
Returns
true if the two input polygons overlap.
Precondition
ArrTraits must be a model of the concept ArrangementDirectionalXMonotoneTraits_2.
GpsTraits must be a model of the concept GeneralPolygonSetTraits_2.

◆ join() [5/26]

template<typename ArrTraits >
bool CGAL::join ( const General_polygon_with_holes_2< General_polygon_2< ArrTraits > > &  pgn2,
const General_polygon_2< ArrTraits > &  pgn1,
General_polygon_with_holes_2< General_polygon_2< ArrTraits > > &  res 
)

#include <CGAL/Boolean_set_operations_2.h>

computes the union of two general polygons.

Parameters
pgn1the 1st input polygon.
pgn2the 2nd input polygon.
resthe resulting union of pgn1 and pgn2.
Returns
true if the two input polygons overlap.
Precondition
ArrTraits must be a model of the concept ArrangementDirectionalXMonotoneTraits_2.

◆ join() [6/26]

template<typename ArrTraits , typename GpsTraits >
bool CGAL::join ( const General_polygon_with_holes_2< General_polygon_2< ArrTraits > > &  pgn2,
const General_polygon_2< ArrTraits > &  pgn1,
General_polygon_with_holes_2< General_polygon_2< ArrTraits > > &  res,
const GpsTraits &  traits 
)

#include <CGAL/Boolean_set_operations_2.h>

computes the union of two general polygons.

Parameters
pgn1the 1st input polygon.
pgn2the 2nd input polygon.
resthe resulting union of pgn1 and pgn2.
traitsa traits object.
Returns
true if the two input polygons overlap.
Precondition
ArrTraits must be a model of the concept ArrangementDirectionalXMonotoneTraits_2.
GpsTraits must be a model of the concept GeneralPolygonSetTraits_2.

◆ join() [7/26]

template<typename Polygon >
bool CGAL::join ( const General_polygon_with_holes_2< Polygon > &  pgn1,
const General_polygon_with_holes_2< Polygon > &  pgn2,
General_polygon_with_holes_2< Polygon > &  res 
)

#include <CGAL/Boolean_set_operations_2.h>

computes the union of two general polygons with holes.

Parameters
pgn1the 1st input polygon.
pgn2the 2nd input polygon.
resthe resulting union of pgn1 and pgn2.
Returns
true if the two input polygons overlap.

◆ join() [8/26]

template<typename Polygon , typename GpsTraits >
bool CGAL::join ( const General_polygon_with_holes_2< Polygon > &  pgn1,
const General_polygon_with_holes_2< Polygon > &  pgn2,
General_polygon_with_holes_2< Polygon > &  res,
const GpsTraits &  traits 
)

#include <CGAL/Boolean_set_operations_2.h>

computes the union of two general polygons with holes.

Parameters
pgn1the 1st input polygon.
pgn2the 2nd input polygon.
resthe resulting union of pgn1 and pgn2.
traitsa traits object.
Returns
true if the two input polygons overlap.
Precondition
GpsTraits must be a model of the concept GeneralPolygonSetTraits_2.

◆ join() [9/26]

template<typename Kernel , typename Container >
bool CGAL::join ( const Polygon_2< Kernel, Container > &  pgn1,
const Polygon_2< Kernel, Container > &  pgn2,
General_polygon_with_holes_2< Polygon_2< Kernel, Container > > &  res 
)

#include <CGAL/Boolean_set_operations_2.h>

computes the union of two polygons.

Parameters
pgn1the 1st input polygon.
pgn2the 2nd input polygon.
resthe resulting union of pgn1 and pgn2.
Returns
true if the two input polygons overlap.
Examples
Boolean_set_operations_2/set_union.cpp, and Boolean_set_operations_2/simple_join_intersect.cpp.

◆ join() [10/26]

template<typename Kernel , typename Container , typename GpsTraits >
bool CGAL::join ( const Polygon_2< Kernel, Container > &  pgn1,
const Polygon_2< Kernel, Container > &  pgn2,
General_polygon_with_holes_2< Polygon_2< Kernel, Container > > &  res,
const GpsTraits &  traits 
)

#include <CGAL/Boolean_set_operations_2.h>

computes the union of two polygons.

Parameters
pgn1the 1st input polygon.
pgn2the 2nd input polygon.
resthe resulting union of pgn1 and pgn2.
traitsa traits object.
Returns
true if the two input polygons overlap.
Precondition
GpsTraits must be a model of the concept GeneralPolygonSetTraits_2.

◆ join() [11/26]

template<typename Kernel , typename Container , typename UsePolylines >
bool CGAL::join ( const Polygon_2< Kernel, Container > &  pgn1,
const Polygon_2< Kernel, Container > &  pgn2,
General_polygon_with_holes_2< Polygon_2< Kernel, Container > > &  res,
UsePolylines  = Tag_true() 
)

#include <CGAL/Boolean_set_operations_2.h>

computes the union of two polygons.

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 into 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.
resthe resulting union of pgn1 and pgn2.
Returns
true if the two input polygons overlap.

◆ join() [12/26]

template<typename Kernel , typename Container >
bool CGAL::join ( const Polygon_2< Kernel, Container > &  pgn1,
const Polygon_with_holes_2< Kernel, Container > &  pgn2,
General_polygon_with_holes_2< Polygon_2< Kernel, Container > > &  res 
)

#include <CGAL/Boolean_set_operations_2.h>

computes the union of two polygons.

Parameters
pgn1the 1st input polygon.
pgn2the 2nd input polygon.
resthe resulting union of pgn1 and pgn2.
Returns
true if the two input polygons overlap.

◆ join() [13/26]

template<typename Kernel , typename Container , typename GpsTraits >
bool CGAL::join ( const Polygon_2< Kernel, Container > &  pgn1,
const Polygon_with_holes_2< Kernel, Container > &  pgn2,
General_polygon_with_holes_2< Polygon_2< Kernel, Container > > &  res,
const GpsTraits &  traits 
)

#include <CGAL/Boolean_set_operations_2.h>

computes the union of two polygons.

Parameters
pgn1the 1st input polygon.
pgn2the 2nd input polygon.
resthe resulting union of pgn1 and pgn2.
traitsa traits object.
Returns
true if the two input polygons overlap.
Precondition
GpsTraits must be a model of the concept GeneralPolygonSetTraits_2.

◆ join() [14/26]

template<typename Kernel , typename Container , typename UsePolylines >
bool CGAL::join ( const Polygon_2< Kernel, Container > &  pgn1,
const Polygon_with_holes_2< Kernel, Container > &  pgn2,
General_polygon_with_holes_2< Polygon_2< Kernel, Container > > &  res,
UsePolylines  = Tag_true() 
)

#include <CGAL/Boolean_set_operations_2.h>

computes the union of two polygons.

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 into 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.
resthe resulting union of pgn1 and pgn2.
Returns
true if the two input polygons overlap.

◆ join() [15/26]

template<typename Kernel , typename Container >
bool CGAL::join ( const Polygon_with_holes_2< Kernel, Container > &  pgn1,
const Polygon_2< Kernel, Container > &  pgn2,
General_polygon_with_holes_2< Polygon_2< Kernel, Container > > &  res 
)

#include <CGAL/Boolean_set_operations_2.h>

computes the union of two polygons.

Parameters
pgn1the 1st input polygon.
pgn2the 2nd input polygon.
resthe resulting union of pgn1 and pgn2.
Returns
true if the two input polygons overlap.

◆ join() [16/26]

template<typename Kernel , typename Container , typename UsePolylines >
bool CGAL::join ( const Polygon_with_holes_2< Kernel, Container > &  pgn1,
const Polygon_2< Kernel, Container > &  pgn2,
General_polygon_with_holes_2< Polygon_2< Kernel, Container > > &  res,
UsePolylines  = Tag_true() 
)

#include <CGAL/Boolean_set_operations_2.h>

computes the union of two polygons.

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 into 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.
resthe resulting union of pgn1 and pgn2.
Returns
true if the two input polygons overlap.

◆ join() [17/26]

template<typename Kernel , typename Container >
bool CGAL::join ( const Polygon_with_holes_2< Kernel, Container > &  pgn1,
const Polygon_with_holes_2< Kernel, Container > &  pgn2,
General_polygon_with_holes_2< Polygon_2< Kernel, Container > > &  res 
)

#include <CGAL/Boolean_set_operations_2.h>

computes the union of two polygons with holes.

Parameters
pgn1the 1st input polygon.
pgn2the 2nd input polygon.
resthe resulting union of pgn1 and pgn2.
Returns
true if the two input polygons overlap.

◆ join() [18/26]

template<typename Kernel , typename Container , typename UsePolylines >
bool CGAL::join ( const Polygon_with_holes_2< Kernel, Container > &  pgn1,
const Polygon_with_holes_2< Kernel, Container > &  pgn2,
General_polygon_with_holes_2< Polygon_2< Kernel, Container > > &  res,
UsePolylines  = Tag_true() 
)

#include <CGAL/Boolean_set_operations_2.h>

computes the union of two polygons with holes.

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 into 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.
resthe resulting union of pgn1 and pgn2.
Returns
true if the two input polygons overlap.

◆ join() [19/26]

template<typename Kernel , typename Container , typename GpsTraits >
bool CGAL::join ( const Polygon_with_holes_2< Kernel, Container > &  pgn2,
const Polygon_2< Kernel, Container > &  pgn1,
General_polygon_with_holes_2< Polygon_2< Kernel, Container > > &  res,
const GpsTraits &  traits 
)

#include <CGAL/Boolean_set_operations_2.h>

computes the union of two polygons.

Parameters
pgn1the 1st input polygon.
pgn2the 2nd input polygon.
resthe resulting union of pgn1 and pgn2.
traitsa traits object.
Returns
true if the two input polygons overlap.
Precondition
GpsTraits must be a model of the concept GeneralPolygonSetTraits_2.

◆ join() [20/26]

template<typename Kernel , typename Container , typename GpsTraits >
bool CGAL::join ( const Polygon_with_holes_2< Kernel, Container > &  pgn2,
const Polygon_with_holes_2< Kernel, Container > &  pgn1,
General_polygon_with_holes_2< Polygon_2< Kernel, Container > > &  res,
const GpsTraits &  traits 
)

#include <CGAL/Boolean_set_operations_2.h>

computes the union of two polygons with holes.

Parameters
pgn1the 1st input polygon.
pgn2the 2nd input polygon.
resthe resulting union of pgn1 and pgn2.
traitsa traits object.
Returns
true if the two input polygons overlap.
Precondition
GpsTraits must be a model of the concept GeneralPolygonSetTraits_2.

◆ join() [21/26]

template<typename InputIterator , typename OutputIterator >
OutputIterator CGAL::join ( InputIterator  begin,
InputIterator  end,
OutputIterator  oi 
)

#include <CGAL/Boolean_set_operations_2.h>

Given a range of polygons (respectively general polygons) or a range of polygons with holes (respectively general polygons with holes) computes the union of all polygons in the range and inserts the resulting polygons with holes (respectively general polygons with holes) into a container via an output iterator.

Parameters
beginthe first iterator of the input range. Its value type is either Polygon_2 (respectively General_polygon_2) or Polygon_with_holes_2 (respectively General_polygon_with_holes_2).
endthe past-the-end iterator of the input range. Its value type is either Polygon_2 (respectively General_polygon_2) or Polygon_with_holes_2 (respectively General_polygon_with_holes_2).
oithe output iterator for the result. Its dereference type must be convertible to Polygon_with_holes_2 (respectively General_polygon_with_holes_2).
Returns
the past-the-end iterator of the output container.

◆ join() [22/26]

template<typename InputIterator , typename OutputIterator , typename GpsTraits >
OutputIterator CGAL::join ( InputIterator  begin,
InputIterator  end,
OutputIterator  oi,
const GpsTraits &  traits 
)

#include <CGAL/Boolean_set_operations_2.h>

Given a range of polygons (respectively general polygons) or a range of polygons with holes (respectively general polygons with holes) computes the union of all polygons in the range and inserts the resulting polygons with holes (respectively general polygons with holes) into a container via an output iterator.

Parameters
beginthe first iterator of the input range. Its value type is either Polygon_2 (respectively General_polygon_2) or Polygon_with_holes_2 (respectively General_polygon_with_holes_2).
endthe past-the-end iterator of the input range. Its value type is either Polygon_2 (respectively General_polygon_2) or Polygon_with_holes_2 (respectively General_polygon_with_holes_2).
oithe output iterator for the result. Its dereference type must be convertible to Polygon_with_holes_2 (respectively General_polygon_with_holes_2).
traitsa traits object.
Returns
the past-the-end iterator of the output container.
Precondition
GpsTraits must be a model of the concept GeneralPolygonSetTraits_2.

◆ join() [23/26]

template<typename InputIterator , typename OutputIterator , typename UsePolylines >
OutputIterator CGAL::join ( InputIterator  begin,
InputIterator  end,
OutputIterator  oi,
UsePolylines  = Tag_true() 
)

#include <CGAL/Boolean_set_operations_2.h>

Given a range of polygons (respectively general polygons) or a range of polygons with holes (respectively general polygons with holes) computes the union of all polygons in the range and inserts the resulting polygons with holes (respectively general polygons with holes) into a container via an output iterator.

Template Parameters
UsePolylinesdetermines whether the boundaries of the polygons in the input range 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, the input polygons are converted into general polygon 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
beginthe first iterator of the input range. Its value type is either Polygon_2 (respectively General_polygon_2) or Polygon_with_holes_2 (respectively General_polygon_with_holes_2).
endthe past-the-end iterator of the input range. Its value type is either Polygon_2 (respectively General_polygon_2) or Polygon_with_holes_2 (respectively General_polygon_with_holes_2).
oithe output iterator for the result. Its dereference type must be convertible to Polygon_with_holes_2 (respectively General_polygon_with_holes_2).
Returns
the past-the-end iterator of the output container.

◆ join() [24/26]

template<typename InputIterator1 , typename InputIterator2 , typename OutputIterator >
OutputIterator CGAL::join ( InputIterator1  begin1,
InputIterator1  end1,
InputIterator2  begin2,
InputIterator2  end2,
OutputIterator  oi 
)

#include <CGAL/Boolean_set_operations_2.h>

Given a range of polygons (respectively general polygons) and a range of polygons with holes (respectively general polygons with holes) computes the union of all polygons in the two ranges and inserts the resulting polygons with holes (respectively general polygons with holes) into a container via an output iterator.

Parameters
begin1the first iterator of the 1st input range. Its value type is Polygon_2 (respectively General_polygon_2).
end1the past-the-end iterator of the 1st input range. Its value type is Polygon_2 (respectively General_polygon_2).
begin2the first iterator of the 2nd input range. Its value type is Polygon_with_holes_2 (respectively General_polygon_with_holes_2).
end2the past-the-end iterator of the 2nd input range. Its value type is Polygon_with_holes_2 (respectively General_polygon_with_holes_2).
oithe output iterator for the result. Its dereference type must be convertible to Polygon_with_holes_2 (respectively General_polygon_with_holes_2).
Returns
the past-the-end iterator of the output container.

◆ join() [25/26]

template<typename InputIterator1 , typename InputIterator2 , typename OutputIterator , typename GpsTraits >
OutputIterator CGAL::join ( InputIterator1  begin1,
InputIterator1  end1,
InputIterator2  begin2,
InputIterator2  end2,
OutputIterator  oi,
const GpsTraits &  traits 
)

#include <CGAL/Boolean_set_operations_2.h>

Given a range of polygons (respectively general polygons) and a range of polygons with holes (respectively general polygons with holes) computes the union of all polygons in the two ranges and inserts the resulting polygons with holes (respectively general polygons with holes) into a container via an output iterator.

Parameters
begin1the first iterator of the 1st input range. Its value type is Polygon_2 (respectively General_polygon_2).
end1the past-the-end iterator of the 1st input range. Its value type is Polygon_2 (respectively General_polygon_2).
begin2the first iterator of the 2nd input range. Its value type is Polygon_with_holes_2 (respectively General_polygon_with_holes_2).
end2the past-the-end iterator of the 2nd input range. Its value type is Polygon_with_holes_2 (respectively General_polygon_with_holes_2).
oithe output iterator for the result. Its dereference type must be convertible to Polygon_with_holes_2 (respectively General_polygon_with_holes_2).
traitsa traits object.
Returns
the past-the-end iterator of the output container.
Precondition
GpsTraits must be a model of the concept GeneralPolygonSetTraits_2.

◆ join() [26/26]

template<typename InputIterator1 , typename InputIterator2 , class OutputIterator , typename UsePolylines >
OutputIterator CGAL::join ( InputIterator1  begin1,
InputIterator1  end1,
InputIterator2  begin2,
InputIterator2  end2,
OutputIterator  oi,
UsePolylines  = Tag_true() 
)

#include <CGAL/Boolean_set_operations_2.h>

Given a range of polygons (respectively general polygons) and a range of polygons with holes (respectively general polygons with holes) computes the union of all polygons in the two ranges and inserts the resulting polygons with holes (respectively general polygons with holes) into a container via an output iterator.

Template Parameters
UsePolylinesdetermines whether the boundaries of the polygons in the input ranges 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, the input polygons are converted into general polygon 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
begin1the first iterator of the 1st input range. Its value type is Polygon_2 (respectively General_polygon_2).
end1the past-the-end iterator of the 1st input range. Its value type is Polygon_2 (respectively General_polygon_2).
begin2the first iterator of the 2nd input range. Its value type is Polygon_with_holes_2 (respectively General_polygon_with_holes_2).
end2the past-the-end iterator of the 2nd input range. Its value type is Polygon_with_holes_2 (respectively General_polygon_with_holes_2).
oithe output iterator for the result. Its dereference type must be convertible to Polygon_with_holes_2 (respectively General_polygon_with_holes_2).
Returns
the past-the-end iterator of the output container.
Precondition
GpsTraits must be a model of the concept GeneralPolygonSetTraits_2.