diff --git a/Kernel_23/doc_tex/Kernel_23_ref/do_intersect.tex b/Kernel_23/doc_tex/Kernel_23_ref/do_intersect.tex index 6e1207e48ed..fd7d0ab9751 100644 --- a/Kernel_23/doc_tex/Kernel_23_ref/do_intersect.tex +++ b/Kernel_23/doc_tex/Kernel_23_ref/do_intersect.tex @@ -1,8 +1,7 @@ \begin{ccRefFunction}{do_intersect} -\ccInclude{CGAL/intersections.h} \ccUnchecked{ -\ccFunction{bool do_intersect(Type1 obj1, Type2 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} @@ -22,6 +29,11 @@ The types \ccStyle{Type1} and \ccStyle{Type2} can be any of the following: \item \ccStyle{Iso_rectangle_2} \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} +\end{itemize} + In three-dimensional space, \ccc{Type1} can be \ccc{Plane_3} or \ccc{Triangle_3} 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} or \item \ccStyle{Segment_3} \item \ccStyle{Triangle_3} \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} and \ccStyle{Tetrahedron_3} @@ -39,6 +52,55 @@ Also, \ccc{Type1} and \ccc{Type2} can be respectively of types \item \ccStyle{Sphere_3} and \ccStyle{Sphere_3}. \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} +\item \ccStyle{Circle_2} +\item \ccStyle{Line_arc_2} +\item \ccStyle{Circular_arc_2} +\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} +\item \ccStyle{Circle_3} +\item \ccStyle{Plane_3} +\item \ccStyle{Sphere_3} +\item \ccStyle{Line_arc_3} +\item \ccStyle{Circular_arc_3} +\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} +\item \ccStyle{Plane_3} +\end{itemize} + \ccSeeAlso \ccRefIdfierPage{CGAL::intersection} diff --git a/Kernel_23/doc_tex/Kernel_23_ref/intersection.tex b/Kernel_23/doc_tex/Kernel_23_ref/intersection.tex index 18012da4c2a..5698d5b1fba 100644 --- a/Kernel_23/doc_tex/Kernel_23_ref/intersection.tex +++ b/Kernel_23/doc_tex/Kernel_23_ref/intersection.tex @@ -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} or +\item {} \ccStyle{Line_arc_2} or +\item {} \ccStyle{Circle_2} or +\item {} \ccStyle{Circular_arc_2}. +\end{itemize} + +Depending on the types \ccStyle{Type1} and \ccStyle{Type2}, these +elements can be assigned to +\begin{itemize} +\item {} \ccStyle{std::pair, unsigned>}, +where the unsigned integer is the multiplicity of the corresponding +intersection point between \ccc{obj1} and \ccc{obj2}, +\item {} \ccStyle{Circular_arc_2} in case of an overlap of +two circular arcs, +\item {} \ccStyle{Line_arc_2} in case of an overlap of two +line segments or +\item {} \ccStyle{Line_2} or +\ccStyle{Circle_2} 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}, +\item {} \ccStyle{Plane_3}, +\item {} \ccStyle{Line_3}, +\item {} \ccStyle{Circle_3}, +\item {} \ccStyle{Line_arc_3} or +\item {} \ccStyle{Circular_arc_3}, +\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, 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} or +\ccStyle{Circle_3} 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} in case of an overlap of +two circular arcs or +\item {} \ccStyle{Line_arc_3} 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} or +\item {} \ccStyle{Plane_3} +\end{itemize} + +and depending of these types, the computed \ccStyle{CGAL::Object}s can be +assigned to +\begin{itemize} +\item {} \ccStyle{std::pair, unsigned>}, +where the unsigned integer is the multiplicity of the corresponding +intersection point, +\item {} \ccStyle{Circle_3} 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 @@ -366,6 +501,11 @@ void foo(CGAL::Segment_2 seg, CGAL::Line_2 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} \\