\( \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.11.2 - 2D Regularized Boolean Set-Operations
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Groups Pages

Each one of these functions computes the intersection of two given polygons p1 and p2, inserts the resulting polygons with holes into an output container through a given output iterator oi, and returns the output iterator. The value type of the OutputIterator is either Polygon_with_holes_2 or General_polygon_with_holes_2.

The signature of the function is

OutputIterator intersection(const Type1 & p1, const Type2 & p2, OutputIterator oi);

Parameters

The types of the paramters of the intersection() 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::join()
CGAL::difference()
CGAL::symmetric_difference()

Functions

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

Function Documentation

OutputIterator CGAL::intersection ( const Type1 &  p1,
const Type2 &  p2,
OutputIterator  oi 
)

writes the intersection of the polygons p1 and p2 into the output iterator oi.

The value type of oi is Polygon_with_holes_2.

#include <CGAL/Boolean_set_operations_2.h>

Examples:
Boolean_set_operations_2/bezier_traits_adapter.cpp, Boolean_set_operations_2/conic_traits_adapter.cpp, and Boolean_set_operations_2/simple_join_intersect.cpp.
template<class Kernel , class Container , class OutputIterator >
OutputIterator CGAL::intersection ( const Polygon_2< Kernel, Container > &  p1,
const Polygon_2< Kernel, Container > &  p2,
OutputIterator  oi 
)

writes the intersection of the polygons p1 and p2 into the output iterator oi.

The value type of oi is Polygon_with_holes_2.

#include <CGAL/Boolean_set_operations_2.h>

template<class Kernel , class Container , class OutputIterator >
OutputIterator CGAL::intersection ( const Polygon_2< Kernel, Container > &  p1,
const Polygon_with_holes_2< Kernel, Container > &  p2,
OutputIterator  oi 
)

writes the intersection of the polygons p1 and p2 into the output iterator oi.

The value type of oi is Polygon_with_holes_2.

#include <CGAL/Boolean_set_operations_2.h>

template<class Kernel , class Container , class OutputIterator >
OutputIterator CGAL::intersection ( const Polygon_with_holes_2< Kernel, Container > &  p1,
const Polygon_2< Kernel, Container > &  p2,
OutputIterator  oi 
)

writes the intersection of the polygons p1 and p2 into the output iterator oi.

The value type of oi is Polygon_with_holes_2.

#include <CGAL/Boolean_set_operations_2.h>

template<class Kernel , class Container , class OutputIterator >
OutputIterator CGAL::intersection ( const Polygon_with_holes_2< Kernel, Container > &  p1,
const Polygon_with_holes_2< Kernel, Container > &  p2,
OutputIterator  oi 
)

writes the intersection of the polygons p1 and p2 into the output iterator oi.

The value type of oi is Polygon_with_holes_2.

#include <CGAL/Boolean_set_operations_2.h>

template<class Traits , class OutputIterator >
OutputIterator CGAL::intersection ( const General_polygon_2< Traits > &  p1,
const General_polygon_2< Traits > &  p2,
OutputIterator  oi 
)

writes the intersection of the general polygons p1 and p2 into the output iterator oi.

The value type of oi is General_polygon_with_holes_2.

#include <CGAL/Boolean_set_operations_2.h>

template<class Traits , class OutputIterator >
OutputIterator CGAL::intersection ( const General_polygon_with_holes_2< General_polygon_2< Traits > > &  p1,
const General_polygon_2< Traits > &  p2,
OutputIterator  oi 
)

writes the intersection of the general polygons p1 and p2 into the output iterator oi.

The value type of oi is General_polygon_with_holes_2.

#include <CGAL/Boolean_set_operations_2.h>

template<class Traits , class OutputIterator >
OutputIterator CGAL::intersection ( const General_polygon_2< Traits > &  p1,
const General_polygon_with_holes_2< General_polygon_2< Traits > > &  p2,
OutputIterator  oi 
)

writes the intersection of the general polygons p1 and p2 into the output iterator oi.

The value type of oi is General_polygon_with_holes_2.

#include <CGAL/Boolean_set_operations_2.h>

template<class Polygon , class OutputIterator >
OutputIterator CGAL::intersection ( const General_polygon_with_holes_2< Polygon > &  p1,
const General_polygon_with_holes_2< Polygon > &  p2,
OutputIterator  oi 
)

writes the intersection of the general polygons p1 and p2 into the output iterator oi.

The value type of oi is General_polygon_with_holes_2.

#include <CGAL/Boolean_set_operations_2.h>

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

computes the intersection 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.

#include <CGAL/Boolean_set_operations_2.h>

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

computes the intersection 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.

#include <CGAL/Boolean_set_operations_2.h>