All Polygons Boolean Operations tex file.

The boolean operations are:
1. Do intersect
2. Intersection.
3. Union.
4. Difference.
5. Symmetric difference.
This commit is contained in:
Ester Ezra 2002-09-26 15:53:03 +00:00
parent 2b478644be
commit d0af02fe1c
10 changed files with 994 additions and 0 deletions

View File

@ -0,0 +1,102 @@
% +------------------------------------------------------------------------+
% | Reference manual page: Polygons_difference_2.tex (Map_overlay)
% +------------------------------------------------------------------------+
% |
% | Package: ovl (Map_overlay_2)
% |
% +------------------------------------------------------------------------+
\ccRefPageBegin
%%RefPage: end of header, begin of main body
% +------------------------------------------------------------------------+
% +========================================================================+
% Map Overlay
% +========================================================================+
\begin{ccRefFunctionObjectClass}{Polygons_difference_2<Traits>}
\label{OVL_sec:polygon_difference}
\ccDefinition
The class \ccClassTemplateName\ is a function object,
returning the difference between two given polygons.
\ccInclude{CGAL/Polygons_bops_2.h}
The \ccClassTemplateName\ class contains one function
object for computing the difference of two input polygons.
This function returns three containers (as output iterators):
the first container is the points in the difference,
the second is the subcurves in the difference,
and the third is all polygons in the difference.
The three output containers are given as templated
output iterators.
\ccMethod{
template <class Polygon,
class PolygonOutputIterator,
class CurvesOutputIterator,
class PointsOutputIterator>
void
operator()(
const Polygon& polygon1,
const Polygon& polygon2,
PolygonOutputIterator polygons,
CurvesOutputIterator curves,
PointsOutputIterator points);}
\ccHeading{Requirements}
\begin{enumerate}
\item
\ccc{Traits} is a model to the \ccc{PolygonBopsTraits_2} concept.
\item
\ccc{Polygon} is a model of the CGAL polygon.
\item
\ccc{PolygonOutputIterator::value_type} is a Polygon.
\item
\ccc{CurvesOutputIterator::value_type} is equivalent to \ccc{Traits::Curve_2}.
\item
\ccc{PointsOutputIterator::value_type} is equivalent to \ccc{Traits::Point_2}.
\end{enumerate}
\ccSeeAlso
\ccc{CGAL::Polygons_do_intersect_2} \\
\ccc{CGAL::Polygons_intersection_2} \\
\ccc{CGAL::Polygons_union_2} \\
\ccc{CGAL::Polygons_symmetric_difference_2} \\
% \ccImplementation
% The implementation uses the container $map$ defined in STL for
% implementing the event queue and the status line. The implementation
% also keeps per each input curve an associated container of all its
% intersection points ordered from left to right, and also keeps per
% each event point all its outcoming curves. The complexity of this
% algorithm is $O(n\log{n} + k\log{n})$ where $n$ is the number of the input
% curves and $k$ is the number of intersection points induced by these
% curves.
\end{ccRefClass}
% FILL IN THE REST OF THE FILES
% +------------------------------------------------------------------------+
%%RefPage: end of main body, begin of footer
\ccRefPageEnd
% EOF
% +------------------------------------------------------------------------+
%%% Local Variables:
%%% mode: latex
%%% TeX-master: "Polygons_do_intersect_2"
%%% End:

View File

@ -0,0 +1,81 @@
% +------------------------------------------------------------------------+
% | Reference manual page: Polygons_do_intersect_2.tex (Map_overlay)
% +------------------------------------------------------------------------+
% |
% | Package: ovl (Map_overlay_2)
% |
% +------------------------------------------------------------------------+
\ccRefPageBegin
%%RefPage: end of header, begin of main body
% +------------------------------------------------------------------------+
% +========================================================================+
% Map Overlay
% +========================================================================+
\begin{ccRefFunctionObjectClass}{Polygons_do_intersect_2<Traits>}
\label{OVL_sec:polygon_do_intersect}
\ccDefinition
The class \ccClassTemplateName\ is a function object,
checking whether two given polygons have a non-empty
intersection.
\ccInclude{CGAL/Polygons_bops_2.h}
The \ccClassTemplateName\ class contains one function
object checking whether the two given polygons intersect.
This function returns a boolean flag,
indicating whether the intersection is non-empty.
\ccMethod{
template <class Polygon>
bool
operator()(const Polygon& polygon1,
const Polygon& polygon2);}
\ccHeading{Requirements}
\begin{enumerate}
\item
\ccc{Traits} is a model to the \ccc{PolygonBopsTraits_2} concept.
\item
\ccc{Polygon} is a model of the CGAL polygon.
\end{enumerate}
\ccSeeAlso
\ccc{CGAL::Polygons_intersection_2} \\
\ccc{CGAL::Polygons_union_2} \\
\ccc{CGAL::Polygons_difference_2} \\
\ccc{CGAL::Polygons_symmetric_difference_2} \\
% \ccImplementation
% The implementation uses the container $map$ defined in STL for
% implementing the event queue and the status line. The implementation
% also keeps per each input curve an associated container of all its
% intersection points ordered from left to right, and also keeps per
% each event point all its outcoming curves. The complexity of this
% algorithm is $O(n\log{n} + k\log{n})$ where $n$ is the number of the input
% curves and $k$ is the number of intersection points induced by these
% curves.
\end{ccRefClass}
% FILL IN THE REST OF THE FILES
% +------------------------------------------------------------------------+
%%RefPage: end of main body, begin of footer
\ccRefPageEnd
% EOF
% +------------------------------------------------------------------------+

View File

@ -0,0 +1,102 @@
% +------------------------------------------------------------------------+
% | Reference manual page: Polygons_intersection_2.tex (Map_overlay)
% +------------------------------------------------------------------------+
% |
% | Package: ovl (Map_overlay_2)
% |
% +------------------------------------------------------------------------+
\ccRefPageBegin
%%RefPage: end of header, begin of main body
% +------------------------------------------------------------------------+
% +========================================================================+
% Map Overlay
% +========================================================================+
\begin{ccRefFunctionObjectClass}{Polygons_intersection_2<Traits>}
\label{OVL_sec:polygon_intersection}
\ccDefinition
The class \ccClassTemplateName\ is a function object,
returning the intersection of two given polygons.
\ccInclude{CGAL/Polygons_bops_2.h}
The \ccClassTemplateName\ class contains one function
object for computing the intersection on two input polygons.
This function returns three containers (as output iterators):
the first container is the points in the intersection,
the second is the subcurves in the intersection,
and the third is all polygons in the intersection.
The three output containers are given as templated
output iterators.
\ccMethod{
template <class Polygon,
class PolygonOutputIterator,
class CurvesOutputIterator,
class PointsOutputIterator>
void
operator()(
const Polygon& polygon1,
const Polygon& polygon2,
PolygonOutputIterator polygons,
CurvesOutputIterator curves,
PointsOutputIterator points);}
\ccHeading{Requirements}
\begin{enumerate}
\item
\ccc{Traits} is a model to the \ccc{PolygonBopsTraits_2} concept.
\item
\ccc{Polygon} is a model of the CGAL polygon.
\item
\ccc{PolygonOutputIterator::value_type} is a Polygon.
\item
\ccc{CurvesOutputIterator::value_type} is equivalent to \ccc{Traits::Curve_2}.
\item
\ccc{PointsOutputIterator::value_type} is equivalent to \ccc{Traits::Point_2}.
\end{enumerate}
\ccSeeAlso
\ccc{CGAL::Polygons_do_intersect_2} \\
\ccc{CGAL::Polygons_union_2} \\
\ccc{CGAL::Polygons_difference_2} \\
\ccc{CGAL::Polygons_symmetric_difference_2} \\
% \ccImplementation
% The implementation uses the container $map$ defined in STL for
% implementing the event queue and the status line. The implementation
% also keeps per each input curve an associated container of all its
% intersection points ordered from left to right, and also keeps per
% each event point all its outcoming curves. The complexity of this
% algorithm is $O(n\log{n} + k\log{n})$ where $n$ is the number of the input
% curves and $k$ is the number of intersection points induced by these
% curves.
\end{ccRefClass}
% FILL IN THE REST OF THE FILES
% +------------------------------------------------------------------------+
%%RefPage: end of main body, begin of footer
\ccRefPageEnd
% EOF
% +------------------------------------------------------------------------+
%%% Local Variables:
%%% mode: latex
%%% TeX-master: "Polygons_symmetric_difference"
%%% End:

View File

@ -0,0 +1,98 @@
% +------------------------------------------------------------------------+
% | Reference manual page: Polygons_symmetric_difference_2.tex (Map_overlay)
% +------------------------------------------------------------------------+
% |
% | Package: ovl (Map_overlay_2)
% |
% +------------------------------------------------------------------------+
\ccRefPageBegin
%%RefPage: end of header, begin of main body
% +------------------------------------------------------------------------+
% +========================================================================+
% Map Overlay
% +========================================================================+
\begin{ccRefFunctionObjectClass}{Polygons_symmetric_difference_2<Traits>}
\label{OVL_sec:polygon_symmetric_difference}
\ccDefinition
The class \ccClassTemplateName\ is a function object,
returning the symmetric intersection of two given polygons.
\ccInclude{CGAL/Polygons_bops_2.h}
The \ccClassTemplateName\ class contains one function
object for computing symmetric difference on two input polygons.
This function returns three containers (as output irerators):
the first container is the points in the symmetric difference,
the second is the subcurves in the symmetric difference,
and the third is all polygons in the symmetric difference.
The three output containers are given as templated
output iterators.
\ccMethod{
template <class Polygon,
class PolygonOutputIterator,
class CurvesOutputIterator,
class PointsOutputIterator>
void
operator()(
const Polygon& polygon1,
const Polygon& polygon2,
PolygonOutputIterator polygons,
CurvesOutputIterator curves,
PointsOutputIterator points);}
\ccHeading{Requirements}
\begin{enumerate}
\item
\ccc{Traits} is a model to the \ccc{PolygonBopsTraits_2} concept.
\item
\ccc{Polygon} is a model of the CGAL polygon.
\item
\ccc{PolygonOutputIterator::value_type} is a Polygon.
\item
\ccc{CurvesOutputIterator::value_type} is equivalent to \ccc{Traits::Curve_2}.
\item
\ccc{PointsOutputIterator::value_type} is equivalent to \ccc{Traits::Point_2}.
\end{enumerate}
\ccSeeAlso
\ccc{CGAL::Polygons_do_intersect_2} \\
\ccc{CGAL::Polygons_intersection_2} \\
\ccc{CGAL::Polygons_union_2} \\
\ccc{CGAL::Polygons_difference_2} \\
% \ccImplementation
% The implementation uses the container $map$ defined in STL for
% implementing the event queue and the status line. The implementation
% also keeps per each input curve an associated container of all its
% intersection points ordered from left to right, and also keeps per
% each event point all its outcoming curves. The complexity of this
% algorithm is $O(n\log{n} + k\log{n})$ where $n$ is the number of the input
% curves and $k$ is the number of intersection points induced by these
% curves.
\end{ccRefClass}
% FILL IN THE REST OF THE FILES
% +------------------------------------------------------------------------+
%%RefPage: end of main body, begin of footer
\ccRefPageEnd
% EOF
% +------------------------------------------------------------------------+

View File

@ -0,0 +1,114 @@
% +------------------------------------------------------------------------+
% | Reference manual page: Polygons_union_2.tex (Map_overlay)
% +------------------------------------------------------------------------+
% |
% | Package: ovl (Map_overlay_2)
% |
% +------------------------------------------------------------------------+
\ccRefPageBegin
%%RefPage: end of header, begin of main body
% +------------------------------------------------------------------------+
% +========================================================================+
% Map Overlay
% +========================================================================+
\begin{ccRefFunctionObjectClass}{Polygons_union_2<Traits>}
\label{OVL_sec:polygon_union}
\ccDefinition
The class \ccClassTemplateName\ is a function object,
returning the union of two given polygons.
\ccInclude{CGAL/Polygons_bops_2.h}
The \ccClassTemplateName\ class contains one function
object for computing the union on two input polygons.
This function returns three containers (as output iterators):
the first container is the points in the union,
the second is the subcurves in the union,
and the third is all polygons in the union.
The three output containers are given as templated
output iterators.
\ccMethod{
template <class Polygon,
class PolygonOutputIterator,
class CurvesOutputIterator,
class PointsOutputIterator>
void
operator()(
const Polygon& polygon1,
const Polygon& polygon2,
PolygonOutputIterator polygons,
CurvesOutputIterator curves,
PointsOutputIterator points);}
\ccHeading{Requirements}
\begin{enumerate}
\item
\ccc{Traits} is a model to the \ccc{PolygonBopsTraits_2} concept.
\item
\ccc{Polygon} is a model of the CGAL polygon.
\item
\ccc{PolygonOutputIterator::value_type} is a Polygon.
\item
\ccc{CurvesOutputIterator::value_type} is equivalent to \ccc{Traits::Curve_2}.
\item
\ccc{PointsOutputIterator::value_type} is equivalent to \ccc{Traits::Point_2}.
\end{enumerate}
\ccSeeAlso
\ccc{CGAL::Polygons_do_intersect_2} \\
\ccc{CGAL::Polygons_intersection_2} \\
\ccc{CGAL::Polygons_difference_2} \\
\ccc{CGAL::Polygons_symmetric_difference_2} \\
% \ccImplementation
% The implementation uses the container $map$ defined in STL for
% implementing the event queue and the status line. The implementation
% also keeps per each input curve an associated container of all its
% intersection points ordered from left to right, and also keeps per
% each event point all its outcoming curves. The complexity of this
% algorithm is $O(n\log{n} + k\log{n})$ where $n$ is the number of the input
% curves and $k$ is the number of intersection points induced by these
% curves.
\ccExample
\label{sec:example1_polygon_bops}
The following example is a demonstration of the usage of the
\ccClassTemplateName\.
The two input polygons are the unit square,
defined by the coordinates:
$(0,0)$, $(0,1)$, $(1,0)$, $(1,1)$,
and a triangle defined by the coordinates:
$(1,7)$, $(10,7)$, $(5,1)$,
\ccIncludeExampleCode{Polygon_bops/example1.C}
And the output of the program looks like this:
\ccIncludeExampleCode{Polygons_bops/example1.cout}
\end{ccRefClass}
% FILL IN THE REST OF THE FILES
% +------------------------------------------------------------------------+
%%RefPage: end of main body, begin of footer
\ccRefPageEnd
% EOF
% +------------------------------------------------------------------------+

View File

@ -0,0 +1,102 @@
% +------------------------------------------------------------------------+
% | Reference manual page: Polygons_difference_2.tex (Map_overlay)
% +------------------------------------------------------------------------+
% |
% | Package: ovl (Map_overlay_2)
% |
% +------------------------------------------------------------------------+
\ccRefPageBegin
%%RefPage: end of header, begin of main body
% +------------------------------------------------------------------------+
% +========================================================================+
% Map Overlay
% +========================================================================+
\begin{ccRefFunctionObjectClass}{Polygons_difference_2<Traits>}
\label{OVL_sec:polygon_difference}
\ccDefinition
The class \ccClassTemplateName\ is a function object,
returning the difference between two given polygons.
\ccInclude{CGAL/Polygons_bops_2.h}
The \ccClassTemplateName\ class contains one function
object for computing the difference of two input polygons.
This function returns three containers (as output iterators):
the first container is the points in the difference,
the second is the subcurves in the difference,
and the third is all polygons in the difference.
The three output containers are given as templated
output iterators.
\ccMethod{
template <class Polygon,
class PolygonOutputIterator,
class CurvesOutputIterator,
class PointsOutputIterator>
void
operator()(
const Polygon& polygon1,
const Polygon& polygon2,
PolygonOutputIterator polygons,
CurvesOutputIterator curves,
PointsOutputIterator points);}
\ccHeading{Requirements}
\begin{enumerate}
\item
\ccc{Traits} is a model to the \ccc{PolygonBopsTraits_2} concept.
\item
\ccc{Polygon} is a model of the CGAL polygon.
\item
\ccc{PolygonOutputIterator::value_type} is a Polygon.
\item
\ccc{CurvesOutputIterator::value_type} is equivalent to \ccc{Traits::Curve_2}.
\item
\ccc{PointsOutputIterator::value_type} is equivalent to \ccc{Traits::Point_2}.
\end{enumerate}
\ccSeeAlso
\ccc{CGAL::Polygons_do_intersect_2} \\
\ccc{CGAL::Polygons_intersection_2} \\
\ccc{CGAL::Polygons_union_2} \\
\ccc{CGAL::Polygons_symmetric_difference_2} \\
% \ccImplementation
% The implementation uses the container $map$ defined in STL for
% implementing the event queue and the status line. The implementation
% also keeps per each input curve an associated container of all its
% intersection points ordered from left to right, and also keeps per
% each event point all its outcoming curves. The complexity of this
% algorithm is $O(n\log{n} + k\log{n})$ where $n$ is the number of the input
% curves and $k$ is the number of intersection points induced by these
% curves.
\end{ccRefClass}
% FILL IN THE REST OF THE FILES
% +------------------------------------------------------------------------+
%%RefPage: end of main body, begin of footer
\ccRefPageEnd
% EOF
% +------------------------------------------------------------------------+
%%% Local Variables:
%%% mode: latex
%%% TeX-master: "Polygons_do_intersect_2"
%%% End:

View File

@ -0,0 +1,81 @@
% +------------------------------------------------------------------------+
% | Reference manual page: Polygons_do_intersect_2.tex (Map_overlay)
% +------------------------------------------------------------------------+
% |
% | Package: ovl (Map_overlay_2)
% |
% +------------------------------------------------------------------------+
\ccRefPageBegin
%%RefPage: end of header, begin of main body
% +------------------------------------------------------------------------+
% +========================================================================+
% Map Overlay
% +========================================================================+
\begin{ccRefFunctionObjectClass}{Polygons_do_intersect_2<Traits>}
\label{OVL_sec:polygon_do_intersect}
\ccDefinition
The class \ccClassTemplateName\ is a function object,
checking whether two given polygons have a non-empty
intersection.
\ccInclude{CGAL/Polygons_bops_2.h}
The \ccClassTemplateName\ class contains one function
object checking whether the two given polygons intersect.
This function returns a boolean flag,
indicating whether the intersection is non-empty.
\ccMethod{
template <class Polygon>
bool
operator()(const Polygon& polygon1,
const Polygon& polygon2);}
\ccHeading{Requirements}
\begin{enumerate}
\item
\ccc{Traits} is a model to the \ccc{PolygonBopsTraits_2} concept.
\item
\ccc{Polygon} is a model of the CGAL polygon.
\end{enumerate}
\ccSeeAlso
\ccc{CGAL::Polygons_intersection_2} \\
\ccc{CGAL::Polygons_union_2} \\
\ccc{CGAL::Polygons_difference_2} \\
\ccc{CGAL::Polygons_symmetric_difference_2} \\
% \ccImplementation
% The implementation uses the container $map$ defined in STL for
% implementing the event queue and the status line. The implementation
% also keeps per each input curve an associated container of all its
% intersection points ordered from left to right, and also keeps per
% each event point all its outcoming curves. The complexity of this
% algorithm is $O(n\log{n} + k\log{n})$ where $n$ is the number of the input
% curves and $k$ is the number of intersection points induced by these
% curves.
\end{ccRefClass}
% FILL IN THE REST OF THE FILES
% +------------------------------------------------------------------------+
%%RefPage: end of main body, begin of footer
\ccRefPageEnd
% EOF
% +------------------------------------------------------------------------+

View File

@ -0,0 +1,102 @@
% +------------------------------------------------------------------------+
% | Reference manual page: Polygons_intersection_2.tex (Map_overlay)
% +------------------------------------------------------------------------+
% |
% | Package: ovl (Map_overlay_2)
% |
% +------------------------------------------------------------------------+
\ccRefPageBegin
%%RefPage: end of header, begin of main body
% +------------------------------------------------------------------------+
% +========================================================================+
% Map Overlay
% +========================================================================+
\begin{ccRefFunctionObjectClass}{Polygons_intersection_2<Traits>}
\label{OVL_sec:polygon_intersection}
\ccDefinition
The class \ccClassTemplateName\ is a function object,
returning the intersection of two given polygons.
\ccInclude{CGAL/Polygons_bops_2.h}
The \ccClassTemplateName\ class contains one function
object for computing the intersection on two input polygons.
This function returns three containers (as output iterators):
the first container is the points in the intersection,
the second is the subcurves in the intersection,
and the third is all polygons in the intersection.
The three output containers are given as templated
output iterators.
\ccMethod{
template <class Polygon,
class PolygonOutputIterator,
class CurvesOutputIterator,
class PointsOutputIterator>
void
operator()(
const Polygon& polygon1,
const Polygon& polygon2,
PolygonOutputIterator polygons,
CurvesOutputIterator curves,
PointsOutputIterator points);}
\ccHeading{Requirements}
\begin{enumerate}
\item
\ccc{Traits} is a model to the \ccc{PolygonBopsTraits_2} concept.
\item
\ccc{Polygon} is a model of the CGAL polygon.
\item
\ccc{PolygonOutputIterator::value_type} is a Polygon.
\item
\ccc{CurvesOutputIterator::value_type} is equivalent to \ccc{Traits::Curve_2}.
\item
\ccc{PointsOutputIterator::value_type} is equivalent to \ccc{Traits::Point_2}.
\end{enumerate}
\ccSeeAlso
\ccc{CGAL::Polygons_do_intersect_2} \\
\ccc{CGAL::Polygons_union_2} \\
\ccc{CGAL::Polygons_difference_2} \\
\ccc{CGAL::Polygons_symmetric_difference_2} \\
% \ccImplementation
% The implementation uses the container $map$ defined in STL for
% implementing the event queue and the status line. The implementation
% also keeps per each input curve an associated container of all its
% intersection points ordered from left to right, and also keeps per
% each event point all its outcoming curves. The complexity of this
% algorithm is $O(n\log{n} + k\log{n})$ where $n$ is the number of the input
% curves and $k$ is the number of intersection points induced by these
% curves.
\end{ccRefClass}
% FILL IN THE REST OF THE FILES
% +------------------------------------------------------------------------+
%%RefPage: end of main body, begin of footer
\ccRefPageEnd
% EOF
% +------------------------------------------------------------------------+
%%% Local Variables:
%%% mode: latex
%%% TeX-master: "Polygons_symmetric_difference"
%%% End:

View File

@ -0,0 +1,98 @@
% +------------------------------------------------------------------------+
% | Reference manual page: Polygons_symmetric_difference_2.tex (Map_overlay)
% +------------------------------------------------------------------------+
% |
% | Package: ovl (Map_overlay_2)
% |
% +------------------------------------------------------------------------+
\ccRefPageBegin
%%RefPage: end of header, begin of main body
% +------------------------------------------------------------------------+
% +========================================================================+
% Map Overlay
% +========================================================================+
\begin{ccRefFunctionObjectClass}{Polygons_symmetric_difference_2<Traits>}
\label{OVL_sec:polygon_symmetric_difference}
\ccDefinition
The class \ccClassTemplateName\ is a function object,
returning the symmetric intersection of two given polygons.
\ccInclude{CGAL/Polygons_bops_2.h}
The \ccClassTemplateName\ class contains one function
object for computing symmetric difference on two input polygons.
This function returns three containers (as output irerators):
the first container is the points in the symmetric difference,
the second is the subcurves in the symmetric difference,
and the third is all polygons in the symmetric difference.
The three output containers are given as templated
output iterators.
\ccMethod{
template <class Polygon,
class PolygonOutputIterator,
class CurvesOutputIterator,
class PointsOutputIterator>
void
operator()(
const Polygon& polygon1,
const Polygon& polygon2,
PolygonOutputIterator polygons,
CurvesOutputIterator curves,
PointsOutputIterator points);}
\ccHeading{Requirements}
\begin{enumerate}
\item
\ccc{Traits} is a model to the \ccc{PolygonBopsTraits_2} concept.
\item
\ccc{Polygon} is a model of the CGAL polygon.
\item
\ccc{PolygonOutputIterator::value_type} is a Polygon.
\item
\ccc{CurvesOutputIterator::value_type} is equivalent to \ccc{Traits::Curve_2}.
\item
\ccc{PointsOutputIterator::value_type} is equivalent to \ccc{Traits::Point_2}.
\end{enumerate}
\ccSeeAlso
\ccc{CGAL::Polygons_do_intersect_2} \\
\ccc{CGAL::Polygons_intersection_2} \\
\ccc{CGAL::Polygons_union_2} \\
\ccc{CGAL::Polygons_difference_2} \\
% \ccImplementation
% The implementation uses the container $map$ defined in STL for
% implementing the event queue and the status line. The implementation
% also keeps per each input curve an associated container of all its
% intersection points ordered from left to right, and also keeps per
% each event point all its outcoming curves. The complexity of this
% algorithm is $O(n\log{n} + k\log{n})$ where $n$ is the number of the input
% curves and $k$ is the number of intersection points induced by these
% curves.
\end{ccRefClass}
% FILL IN THE REST OF THE FILES
% +------------------------------------------------------------------------+
%%RefPage: end of main body, begin of footer
\ccRefPageEnd
% EOF
% +------------------------------------------------------------------------+

View File

@ -0,0 +1,114 @@
% +------------------------------------------------------------------------+
% | Reference manual page: Polygons_union_2.tex (Map_overlay)
% +------------------------------------------------------------------------+
% |
% | Package: ovl (Map_overlay_2)
% |
% +------------------------------------------------------------------------+
\ccRefPageBegin
%%RefPage: end of header, begin of main body
% +------------------------------------------------------------------------+
% +========================================================================+
% Map Overlay
% +========================================================================+
\begin{ccRefFunctionObjectClass}{Polygons_union_2<Traits>}
\label{OVL_sec:polygon_union}
\ccDefinition
The class \ccClassTemplateName\ is a function object,
returning the union of two given polygons.
\ccInclude{CGAL/Polygons_bops_2.h}
The \ccClassTemplateName\ class contains one function
object for computing the union on two input polygons.
This function returns three containers (as output iterators):
the first container is the points in the union,
the second is the subcurves in the union,
and the third is all polygons in the union.
The three output containers are given as templated
output iterators.
\ccMethod{
template <class Polygon,
class PolygonOutputIterator,
class CurvesOutputIterator,
class PointsOutputIterator>
void
operator()(
const Polygon& polygon1,
const Polygon& polygon2,
PolygonOutputIterator polygons,
CurvesOutputIterator curves,
PointsOutputIterator points);}
\ccHeading{Requirements}
\begin{enumerate}
\item
\ccc{Traits} is a model to the \ccc{PolygonBopsTraits_2} concept.
\item
\ccc{Polygon} is a model of the CGAL polygon.
\item
\ccc{PolygonOutputIterator::value_type} is a Polygon.
\item
\ccc{CurvesOutputIterator::value_type} is equivalent to \ccc{Traits::Curve_2}.
\item
\ccc{PointsOutputIterator::value_type} is equivalent to \ccc{Traits::Point_2}.
\end{enumerate}
\ccSeeAlso
\ccc{CGAL::Polygons_do_intersect_2} \\
\ccc{CGAL::Polygons_intersection_2} \\
\ccc{CGAL::Polygons_difference_2} \\
\ccc{CGAL::Polygons_symmetric_difference_2} \\
% \ccImplementation
% The implementation uses the container $map$ defined in STL for
% implementing the event queue and the status line. The implementation
% also keeps per each input curve an associated container of all its
% intersection points ordered from left to right, and also keeps per
% each event point all its outcoming curves. The complexity of this
% algorithm is $O(n\log{n} + k\log{n})$ where $n$ is the number of the input
% curves and $k$ is the number of intersection points induced by these
% curves.
\ccExample
\label{sec:example1_polygon_bops}
The following example is a demonstration of the usage of the
\ccClassTemplateName\.
The two input polygons are the unit square,
defined by the coordinates:
$(0,0)$, $(0,1)$, $(1,0)$, $(1,1)$,
and a triangle defined by the coordinates:
$(1,7)$, $(10,7)$, $(5,1)$,
\ccIncludeExampleCode{Polygon_bops/example1.C}
And the output of the program looks like this:
\ccIncludeExampleCode{Polygons_bops/example1.cout}
\end{ccRefClass}
% FILL IN THE REST OF THE FILES
% +------------------------------------------------------------------------+
%%RefPage: end of main body, begin of footer
\ccRefPageEnd
% EOF
% +------------------------------------------------------------------------+