\( \newcommand{\E}{\mathrm{E}} \) \( \newcommand{\A}{\mathrm{A}} \) \( \newcommand{\R}{\mathrm{R}} \) \( \newcommand{\N}{\mathrm{N}} \) \( \newcommand{\Q}{\mathrm{Q}} \) \( \newcommand{\Z}{\mathrm{Z}} \) \( \def\ccSum #1#2#3{ \sum_{#1}^{#2}{#3} } \def\ccProd #1#2#3{ \sum_{#1}^{#2}{#3} }\)
CGAL 4.14 - 2D Regularized Boolean Set-Operations

Each one of these functions computes the union of two given polygons p1 and p2. If the two given polygons overlap, it returns true, and places the resulting polygon in p. Otherwise, it returns false.

The signature of the function is

bool join(const Type1 & p1, const Type2 & p2, General_polygon_with_holes_2 & res);

Parameters

The types of the paramters of the join() function are any of the following combinations.

Type1Type2
Polygon_2Polygon_2
Polygon_2polygon_with_holes_2
Polygon_with_holes_2Polygon_2
Polygon_with_holes_2Polygon_with_holes_2
General_polygon_2General_polygon_2
General_polygon_2General_polygon_with_holes_2
General_polygon_with_holes_2General_polygon_2
General_polygon_with_holes_2General_polygon_with_holes_2
See also
CGAL::do_intersect()
CGAL::intersection()
CGAL::difference()
CGAL::symmetric_difference()

Functions

template<class Kernel , class Container >
bool CGAL::join (const Polygon_2< Kernel, Container > &p1, const Polygon_2< Kernel, Container > &p2, General_polygon_with_holes_2< Polygon_2< Kernel, Container > > &res)
 writes the union of the polygons p1 and p2 into the polygon with holes res. More...
 
template<class Kernel , class Container >
bool CGAL::join (const Polygon_2< Kernel, Container > &p1, const Polygon_with_holes_2< Kernel, Container > &p2, General_polygon_with_holes_2< Polygon_2< Kernel, Container > > &res)
 writes the union of the polygons p1 and p2 into the polygon with holes res. More...
 
template<class Kernel , class Container >
bool CGAL::join (const Polygon_with_holes_2< Kernel, Container > &p2, const Polygon_2< Kernel, Container > &p1, General_polygon_with_holes_2< Polygon_2< Kernel, Container > > &res)
 writes the union of the polygons p1 and p2 into the polygon with holes res. More...
 
template<class Kernel , class Container >
bool CGAL::join (const Polygon_with_holes_2< Kernel, Container > &p2, const Polygon_with_holes_2< Kernel, Container > &p1, General_polygon_with_holes_2< Polygon_2< Kernel, Container > > &res)
 writes the union of the polygons p1 and p2 into the polygon with holes res. More...
 
template<class Traits >
bool CGAL::join (const General_polygon_2< Traits > &p1, const General_polygon_2< Traits > &p2, General_polygon_with_holes_2< General_polygon_2< Traits > > &res)
 writes the union of the general polygons p1 and p2 into the polygon with holes res. More...
 
template<class Traits >
bool CGAL::join (const General_polygon_2< Traits > &p1, const General_polygon_with_holes_2< General_polygon_2< Traits > > &p2, General_polygon_with_holes_2< General_polygon_2< Traits > > &res)
 writes the union of the polygons p1 and p2 into the polygon with holes res. More...
 
template<class Traits >
bool CGAL::join (const General_polygon_with_holes_2< General_polygon_2< Traits > > &p2, const General_polygon_2< Traits > &p1, General_polygon_with_holes_2< General_polygon_2< Traits > > &res)
 writes the union of the general polygons p1 and p2 into the polygon with holes res. More...
 
template<class Polygon >
bool CGAL::join (const General_polygon_with_holes_2< Polygon > &p1, const General_polygon_with_holes_2< Polygon > &p2, Traits::Polygon_with_holes_2 &res)
 writes the union of the general polygons p1 and p2 into the polygon with holes res. More...
 
template<class InputIterator , class OutputIterator >
OutputIterator CGAL::join (InputIterator begin, InputIterator end, OutputIterator oi)
 computes the union of the general polygons (or general polygons with holes) in the given range. More...
 
template<class InputIterator1 , class InputIterator2 , class OutputIterator >
OutputIterator CGAL::join (InputIterator1 pgn_begin1, InputIterator1 pgn_end1, InputIterator2 pgn_begin2, InputIterator2 pgn_end2, OutputIterator oi)
 computes the union of the general polygons and general polygons with holes in the given two ranges. More...
 

Function Documentation

◆ join() [1/10]

template<class Kernel , class Container >
bool CGAL::join ( const Polygon_2< Kernel, Container > &  p1,
const Polygon_2< Kernel, Container > &  p2,
General_polygon_with_holes_2< Polygon_2< Kernel, Container > > &  res 
)

#include <CGAL/Boolean_set_operations_2.h>

writes the union of the polygons p1 and p2 into the polygon with holes res.

Returns true if the two given polygons overlap.

Examples:
Boolean_set_operations_2/set_union.cpp, and Boolean_set_operations_2/simple_join_intersect.cpp.

◆ join() [2/10]

template<class Kernel , class Container >
bool CGAL::join ( const Polygon_2< Kernel, Container > &  p1,
const Polygon_with_holes_2< Kernel, Container > &  p2,
General_polygon_with_holes_2< Polygon_2< Kernel, Container > > &  res 
)

#include <CGAL/Boolean_set_operations_2.h>

writes the union of the polygons p1 and p2 into the polygon with holes res.

Returns true if the two given polygons overlap.

◆ join() [3/10]

template<class Kernel , class Container >
bool CGAL::join ( const Polygon_with_holes_2< Kernel, Container > &  p2,
const Polygon_2< Kernel, Container > &  p1,
General_polygon_with_holes_2< Polygon_2< Kernel, Container > > &  res 
)

#include <CGAL/Boolean_set_operations_2.h>

writes the union of the polygons p1 and p2 into the polygon with holes res.

Returns true if the two given polygons overlap.

◆ join() [4/10]

template<class Kernel , class Container >
bool CGAL::join ( const Polygon_with_holes_2< Kernel, Container > &  p2,
const Polygon_with_holes_2< Kernel, Container > &  p1,
General_polygon_with_holes_2< Polygon_2< Kernel, Container > > &  res 
)

#include <CGAL/Boolean_set_operations_2.h>

writes the union of the polygons p1 and p2 into the polygon with holes res.

Returns true if the two given polygons overlap.

◆ join() [5/10]

template<class Traits >
bool CGAL::join ( const General_polygon_2< Traits > &  p1,
const General_polygon_2< Traits > &  p2,
General_polygon_with_holes_2< General_polygon_2< Traits > > &  res 
)

#include <CGAL/Boolean_set_operations_2.h>

writes the union of the general polygons p1 and p2 into the polygon with holes res.

Returns true if the two given polygons overlap.

◆ join() [6/10]

template<class Traits >
bool CGAL::join ( const General_polygon_2< Traits > &  p1,
const General_polygon_with_holes_2< General_polygon_2< Traits > > &  p2,
General_polygon_with_holes_2< General_polygon_2< Traits > > &  res 
)

#include <CGAL/Boolean_set_operations_2.h>

writes the union of the polygons p1 and p2 into the polygon with holes res.

Returns true if the two given polygons overlap.

◆ join() [7/10]

template<class Traits >
bool CGAL::join ( const General_polygon_with_holes_2< General_polygon_2< Traits > > &  p2,
const General_polygon_2< Traits > &  p1,
General_polygon_with_holes_2< General_polygon_2< Traits > > &  res 
)

#include <CGAL/Boolean_set_operations_2.h>

writes the union of the general polygons p1 and p2 into the polygon with holes res.

Returns true if the two given polygons overlap.

◆ join() [8/10]

template<class Polygon >
bool CGAL::join ( const General_polygon_with_holes_2< Polygon > &  p1,
const General_polygon_with_holes_2< Polygon > &  p2,
Traits::Polygon_with_holes_2 &  res 
)

#include <CGAL/Boolean_set_operations_2.h>

writes the union of the general polygons p1 and p2 into the polygon with holes res.

Returns true if the two given polygons overlap.

◆ join() [9/10]

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

#include <CGAL/Boolean_set_operations_2.h>

computes the union of the general polygons (or general polygons with holes) in the given range.

(The value type of the input iterator is used to distinguish between the two.) The result, represented by a set of general polygon with holes, is written into the output iterator oi. The output iterator is returned. The value type of the OutputIterator is Traits::Polygon_with_holes_2.

◆ join() [10/10]

template<class InputIterator1 , class InputIterator2 , class OutputIterator >
OutputIterator CGAL::join ( InputIterator1  pgn_begin1,
InputIterator1  pgn_end1,
InputIterator2  pgn_begin2,
InputIterator2  pgn_end2,
OutputIterator  oi 
)

#include <CGAL/Boolean_set_operations_2.h>

computes the union of the general polygons and general polygons with holes in the given two ranges.

The result, represented by a set of general polygon with holes, is written into the output iterator oi. The output iterator is returned. The value type of the OutputIterator is Traits::Polygon_with_holes_2.