- bug fix: missing do_intersect(Circle_2,Circle_2) added in Kernel_23

- added do_intersect and intersect coming from CK2 and SK3
This commit is contained in:
Monique Teillaud 2008-09-01 09:14:12 +00:00
parent 0081acb19a
commit 0ec24cd91a
2 changed files with 205 additions and 3 deletions

View File

@ -1,8 +1,7 @@
\begin{ccRefFunction}{do_intersect}
\ccInclude{CGAL/intersections.h}
\ccUnchecked{
\ccFunction{bool do_intersect(Type1<Kernel> obj1, Type2<Kernel> obj2);}
\ccFunction{bool do_intersect(Type1 obj1, Type2 obj2);}
{checks whether \ccc{obj1} and \ccc{obj2} intersect.
Two objects \ccStyle{obj1} and \ccStyle{obj2} intersect if there is a point
\ccStyle{p} that is part of both \ccStyle{obj1} and \ccStyle{obj2}.
@ -12,6 +11,14 @@ Note that for objects like triangles and polygons that enclose a
bounded region, this region is part of the object.
}}
Depending on which \cgal\ \ccHtmlNoLinksFrom{kernel} is used,
\ccStyle{Type1} and \ccStyle{Type2} can be of different types.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\paragraph{With the basic 2D and 3D Kernel} (see Chapter~\ref{chapter-kernel-23})
\ccInclude{CGAL/intersections.h}
The types \ccStyle{Type1} and \ccStyle{Type2} can be any of the following:
\begin{itemize}\ccTexHtml{\itemsep0pt\topsep0pt\partopsep0pt\parskip0pt\parsep0pt}{}
\item \ccStyle{Point_2<Kernel>}
@ -22,6 +29,11 @@ The types \ccStyle{Type1} and \ccStyle{Type2} can be any of the following:
\item \ccStyle{Iso_rectangle_2<Kernel>}
\end{itemize}
Also, \ccStyle{Type1} and \ccStyle{Type2} can be both of type
\begin{itemize}\ccTexHtml{\itemsep0pt\topsep0pt\partopsep0pt\parskip0pt\parsep0pt}{}
\item \ccStyle{Circle_2<Kernel>}
\end{itemize}
In three-dimensional space, \ccc{Type1} can be \ccc{Plane_3<Kernel>} or
\ccc{Triangle_3<Kernel>} and \ccc{Type2} any of
\begin{itemize}\ccTexHtml{\itemsep0pt\topsep0pt\partopsep0pt\parskip0pt\parsep0pt}{}
@ -31,6 +43,7 @@ In three-dimensional space, \ccc{Type1} can be \ccc{Plane_3<Kernel>} or
\item \ccStyle{Segment_3<Kernel>}
\item \ccStyle{Triangle_3<Kernel>}
\end{itemize}
Also, \ccc{Type1} and \ccc{Type2} can be respectively of types
\begin{itemize}\ccTexHtml{\itemsep0pt\topsep0pt\partopsep0pt\parskip0pt\parsep0pt}{}
\item \ccStyle{Triangle_3<Kernel>} and \ccStyle{Tetrahedron_3<Kernel>}
@ -39,6 +52,55 @@ Also, \ccc{Type1} and \ccc{Type2} can be respectively of types
\item \ccStyle{Sphere_3<Kernel>} and \ccStyle{Sphere_3<Kernel>}.
\end{itemize}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\paragraph{With the 2D Circular Kernel} (see Chapter~\ref{chapter-circular-kernel})
\ccInclude{CGAL/Circular_kernel_intersections.h}
If this kernel is used, in addition to the combinations of 2D types
previously listed, \ccStyle{Type1} and \ccStyle{Type2} can be any of
the following:
\begin{itemize}\ccTexHtml{\itemsep0pt\topsep0pt\partopsep0pt\parskip0pt\parsep0pt}{}
\item \ccStyle{Line_2<CircularKernel>}
\item \ccStyle{Circle_2<CircularKernel>}
\item \ccStyle{Line_arc_2<CircularKernel>}
\item \ccStyle{Circular_arc_2<CircularKernel>}
\end{itemize}
An example illustrating this is presented in
Chapter~\ref{chapter-circular-kernel}.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\paragraph{With the 3D Spherical Kernel} (see Chapter~\ref{chapter-spherical-kernel})
\ccInclude{CGAL/Spherical_kernel_intersections.h}
If this kernel is used, in addition to the combinations of 3D types
previously listed, \ccStyle{Type1} and \ccStyle{Type2} can be any of
the following:
\begin{itemize}\ccTexHtml{\itemsep0pt\topsep0pt\partopsep0pt\parskip0pt\parsep0pt}{}
\item \ccStyle{Line_3<SphericalKernel>}
\item \ccStyle{Circle_3<SphericalKernel>}
\item \ccStyle{Plane_3<SphericalKernel>}
\item \ccStyle{Sphere_3<SphericalKernel>}
\item \ccStyle{Line_arc_3<SphericalKernel>}
\item \ccStyle{Circular_arc_3<SphericalKernel>}
\end{itemize}
An example illustrating this is presented in
Chapter~\ref{chapter-spherical-kernel}.
Also, another predicate is provided with this kernel:
\ccFunction{bool do_intersect(Type1 obj1, Type2 obj2, Type3 obj3);}
{checks whether \ccc{obj1}, \ccc{obj2} and \ccc{obj3} intersect.}
where \ccStyle{Type1}, \ccStyle{Type2} and \ccStyle{Type3} can be:
\begin{itemize}\ccTexHtml{\itemsep0pt\topsep0pt\partopsep0pt\parskip0pt\parsep0pt}{}
\item \ccStyle{Sphere_3<SphericalKernel>}
\item \ccStyle{Plane_3<SphericalKernel>}
\end{itemize}
\ccSeeAlso
\ccRefIdfierPage{CGAL::intersection}

View File

@ -1,4 +1,12 @@
\begin{ccRefFunction}{intersection}
Depending on which \cgal\ \ccHtmlNoLinksFrom{kernel} is used,
different versions of this global function are available. This is
described below.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\paragraph{With the basic 2D and 3D Kernel} (see Chapter~\ref{chapter-kernel-23})
\ccInclude{CGAL/intersections.h}
\ccUnchecked{
@ -329,10 +337,137 @@ There is also an intersection function between 3 planes.
{returns the intersection of 3 planes, which can be either a point, a line,
a plane, or empty.}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\paragraph{With the 2D Circular Kernel} (see Chapter~\ref{chapter-circular-kernel})
\ccInclude{CGAL/Circular_kernel_intersections.h}
If this kernel is used, in addition to the function and the
combination of 2D types described above, another version of the function
is provided.
Since both the number of intersections, if any, and their type,
depend on the arguments, the function returns an output
iterator on \ccc{Object}'s, as presented below.
\ccFunction{template < class OutputIterator >
OutputIterator
intersection(const Type1 &obj1, const Type2 &obj2,
OutputIterator intersections);}
{Copies in the output iterator the intersection elements between the
two objects. \ccc{intersections} iterates on
elements of type \ccc{CGAL::Object}, in lexicographic order,}
where \ccStyle{Type1} and \ccStyle{Type2} can both be either
\begin{itemize}
\item {} \ccStyle{Line_2<CircularKernel>} or
\item {} \ccStyle{Line_arc_2<CircularKernel>} or
\item {} \ccStyle{Circle_2<CircularKernel>} or
\item {} \ccStyle{Circular_arc_2<CircularKernel>}.
\end{itemize}
Depending on the types \ccStyle{Type1} and \ccStyle{Type2}, these
elements can be assigned to
\begin{itemize}
\item {} \ccStyle{std::pair<Circular_arc_point_2<CircularKernel>, unsigned>},
where the unsigned integer is the multiplicity of the corresponding
intersection point between \ccc{obj1} and \ccc{obj2},
\item {} \ccStyle{Circular_arc_2<CircularKernel>} in case of an overlap of
two circular arcs,
\item {} \ccStyle{Line_arc_2<CircularKernel>} in case of an overlap of two
line segments or
\item {} \ccStyle{Line_2<CircularKernel>} or
\ccStyle{Circle_2<CircularKernel>} in case of two equal input lines or circles.
\end{itemize}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\paragraph{With the 3D Spherical Kernel} (see Chapter~\ref{chapter-spherical-kernel})
\ccInclude{CGAL/Spherical_kernel_intersections.h}
If this kernel is used, in addition to the function and the
combination of 3D types described above, two other versions of the function
are provided.
Since both the number of intersections, if any, and their type,
depend on the arguments, the functions return an output
iterator on \ccStyle{Object}'s, as presented below.
The \textbf{first function} is:
\ccFunction{template < class OutputIterator >
OutputIterator
intersection(const Type1 &obj1, const Type2 &obj2,
OutputIterator intersections);}
{Copies in the output iterator the intersection elements between the
two objects. \ccc{intersections} iterates on
elements of type \ccStyle{CGAL::Object}, in lexicographic order,
when this ordering is defined on the computed objects,}
where \ccStyle{Type1} and \ccStyle{Type2} can both be either:
\begin{itemize}
\item {} \ccStyle{Sphere_3<SphericalKernel>},
\item {} \ccStyle{Plane_<SphericalKernel>3},
\item {} \ccStyle{Line_3<SphericalKernel>},
\item {} \ccStyle{Circle_3<SphericalKernel>},
\item {} \ccStyle{Line_arc_3<SphericalKernel>} or
\item {} \ccStyle{Circular_arc_3<SphericalKernel>},
\end{itemize}
and depending on the types \ccStyle{Type1} and \ccStyle{Type2}, the computed
\ccStyle{CGAL::Object}s can be assigned to
\begin{itemize}
\item {} \ccStyle{std::pair<Circular_arc_point_3<SphericalKernel>, unsigned>},
where the unsigned integer is the multiplicity of the corresponding
intersection point between \ccc{obj1} and \ccc{obj2},
\item {} \ccStyle{Type1}, when \ccStyle{Type1} and \ccStyle{Type2} are equal,
and if the two objets \ccc{obj1} and \ccc{obj2} are equal,
\item {} \ccStyle{Line_3<SphericalKernel>} or
\ccStyle{Circle_3<SphericalKernel>} when \ccStyle{Type1} and \ccStyle{Type2}
are two-dimensional objets intersecting along a curve (2 planes, or 2
spheres, or one plane and one sphere),
\item {} \ccStyle{Circular_arc_3<SphericalKernel>} in case of an overlap of
two circular arcs or
\item {} \ccStyle{Line_arc_3<SphericalKernel>} in case of an overlap of two
line segments.
\end{itemize}
The \textbf{second function} is:
\ccFunction{template < class OutputIterator >
OutputIterator
intersection(const Type1 &obj1, const Type2 &obj2, const Type3 &obj3,
OutputIterator intersections);}
{Copies in the output iterator the intersection elements between the
three objects. \ccc{intersections} iterates on
elements of type \ccStyle{CGAL::Object}, in lexicographic order
when this ordering is defined on the computed objects}
where \ccStyle{Type1}, \ccStyle{Type2} and \ccStyle{Type3}
can be either
\begin{itemize}
\item {} \ccStyle{Sphere_3<SphericalKernel>} or
\item {} \ccStyle{Plane_3<SphericalKernel>}
\end{itemize}
and depending of these types, the computed \ccStyle{CGAL::Object}s can be
assigned to
\begin{itemize}
\item {} \ccStyle{std::pair<Circular_arc_point_3<SphericalKernel>, unsigned>},
where the unsigned integer is the multiplicity of the corresponding
intersection point,
\item {} \ccStyle{Circle_3<SphericalKernel>} or
\item {} \ccStyle{Type1}, when \ccStyle{Type1}, \ccStyle{Type2} and
\ccc{Type3} are equal, and if the three objets \ccc{obj1} and \ccc{obj2}
and \ccc{obj3} are equal.
\end{itemize}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\ccExample
The following example demonstrates the most common use of
\ccc{intersection} routines.
\ccc{intersection} routines with the basic 2D and 3D Kernels.
\begin{verbatim}
#include <CGAL/intersections.h>
@ -366,6 +501,11 @@ void foo(CGAL::Segment_2<Kernel> seg, CGAL::Line_2<Kernel> line)
\end{verbatim}%
\ccHtmlLinksOn%
Examples illustrating the use of this function in the case of the 2D
Circular Kernel and the 3D Spherical Kernel are presented respectively
in Chapters~\ref{chapter-circular-kernel}
and~\ref{chapter-spherical-kernel}.
\ccSeeAlso
% \ccRefIdfierPage{CGAL::assign} \\
\ccRefIdfierPage{CGAL::do_intersect} \\