From 6bbdfcedfbd069db9e75ca9ba2a32bfc9954f82a Mon Sep 17 00:00:00 2001 From: Susan Hert Date: Thu, 26 Jul 2001 12:29:12 +0000 Subject: [PATCH] moved reference pages into SearchStructures_ref subdirectory --- Packages/kdtree/changes.txt | 2 + .../SearchStructures_ref/KdtreeDTraits.tex | 44 ++++ .../SearchStructures_ref/Kdtree_Interface.tex | 27 +++ .../Kdtree_Interface_2d.tex | 19 ++ .../Kdtree_Interface_3d.tex | 19 ++ .../SearchStructures_ref/Kdtree_d.tex | 45 ++++ .../SearchStructures_ref/Kdtree_d_Box.tex | 34 +++ .../SearchStructures_ref/kd_main.tex | 15 ++ .../doc_tex/SearchStructures/kd-tree.tex | 210 ------------------ .../doc_tex/SearchStructures/manual.tex | 3 +- .../SearchStructures_ref/KdtreeDTraits.tex | 44 ++++ .../SearchStructures_ref/Kdtree_Interface.tex | 27 +++ .../Kdtree_Interface_2d.tex | 19 ++ .../Kdtree_Interface_3d.tex | 19 ++ .../SearchStructures_ref/Kdtree_d.tex | 45 ++++ .../SearchStructures_ref/Kdtree_d_Box.tex | 34 +++ .../SearchStructures_ref/kd_main.tex | 15 ++ .../basic/SearchStructures/kd-tree.tex | 210 ------------------ .../doc_tex/basic/SearchStructures/manual.tex | 3 +- 19 files changed, 412 insertions(+), 422 deletions(-) create mode 100644 Packages/kdtree/doc_tex/SearchStructures/SearchStructures_ref/KdtreeDTraits.tex create mode 100644 Packages/kdtree/doc_tex/SearchStructures/SearchStructures_ref/Kdtree_Interface.tex create mode 100644 Packages/kdtree/doc_tex/SearchStructures/SearchStructures_ref/Kdtree_Interface_2d.tex create mode 100644 Packages/kdtree/doc_tex/SearchStructures/SearchStructures_ref/Kdtree_Interface_3d.tex create mode 100644 Packages/kdtree/doc_tex/SearchStructures/SearchStructures_ref/Kdtree_d.tex create mode 100644 Packages/kdtree/doc_tex/SearchStructures/SearchStructures_ref/Kdtree_d_Box.tex create mode 100644 Packages/kdtree/doc_tex/SearchStructures/SearchStructures_ref/kd_main.tex create mode 100644 Packages/kdtree/doc_tex/basic/SearchStructures/SearchStructures_ref/KdtreeDTraits.tex create mode 100644 Packages/kdtree/doc_tex/basic/SearchStructures/SearchStructures_ref/Kdtree_Interface.tex create mode 100644 Packages/kdtree/doc_tex/basic/SearchStructures/SearchStructures_ref/Kdtree_Interface_2d.tex create mode 100644 Packages/kdtree/doc_tex/basic/SearchStructures/SearchStructures_ref/Kdtree_Interface_3d.tex create mode 100644 Packages/kdtree/doc_tex/basic/SearchStructures/SearchStructures_ref/Kdtree_d.tex create mode 100644 Packages/kdtree/doc_tex/basic/SearchStructures/SearchStructures_ref/Kdtree_d_Box.tex create mode 100644 Packages/kdtree/doc_tex/basic/SearchStructures/SearchStructures_ref/kd_main.tex diff --git a/Packages/kdtree/changes.txt b/Packages/kdtree/changes.txt index 00fad98b173..b48640c6f42 100644 --- a/Packages/kdtree/changes.txt +++ b/Packages/kdtree/changes.txt @@ -1,3 +1,5 @@ +2.2.18 put reference pages in SearchStructures_ref directory + 2.2.18 Added example and name of classes and concepts in section Kd-Trees. 2.2.17 Example code cleanups. diff --git a/Packages/kdtree/doc_tex/SearchStructures/SearchStructures_ref/KdtreeDTraits.tex b/Packages/kdtree/doc_tex/SearchStructures/SearchStructures_ref/KdtreeDTraits.tex new file mode 100644 index 00000000000..ec28a688410 --- /dev/null +++ b/Packages/kdtree/doc_tex/SearchStructures/SearchStructures_ref/KdtreeDTraits.tex @@ -0,0 +1,44 @@ +\begin{ccRefConcept}{KdtreeDTraits} + +The \ccStyle{Kdtree_d} class is parameterized with the +interface class \ccStyle{Traits} which defines the abstract interface +between the \ccStyle{Kdtree_d} class and the data (i.e., points). The following +requirement catalog lists the primitives, i.e.,~types, member functions +etc., that must be defined for a class that can be used to +parameterize \kdts. Ready-made implementation are available +by the \ccStyle{Kdtree_d} default traits classes. + +\ccThree{static void}{}{\hspace*{7.1cm}} +\ccTwo{}{\hspace*{7.1cm}} + + + + \ccCreationVariable{t} + + \ccDefinition + A class \ccClassName\ that satisfies the requirements of an + interface class for a \ccStyle{Kdtree_d} class must provide the + following types and operations. + + \ccTypes + + \ccNestedType{Point}{A type to hold a input item.} + + \ccOperations +% \ccSetTwoOfThreeColumns{4cm}{4cm} + + \ccMethod{static Comparison_result compare( + int k, + const Point & p0, + const Point & p1);} {compare the \ccStyle{k}-th coordinate + of $p0$ and $p1$. Return \ccStyle{LARGER} if $p0_k > + p1_k$, \ccStyle{SMALLER} if $p0_k < p1_k$, or else + \ccStyle{EQUAL}. } + + \ccMethod{static void copy_coord( int k, Point & dest, + const Point & src );}{Copy the $k$-th coordinate of $src$ to + the $k$-th coordinate of $dest$.} + + \ccMethod{static int dimension( const Point & pnt );} + {return the dimension of \ccStyle{pnt}} +\end{ccRefConcept} diff --git a/Packages/kdtree/doc_tex/SearchStructures/SearchStructures_ref/Kdtree_Interface.tex b/Packages/kdtree/doc_tex/SearchStructures/SearchStructures_ref/Kdtree_Interface.tex new file mode 100644 index 00000000000..e3e42ee000f --- /dev/null +++ b/Packages/kdtree/doc_tex/SearchStructures/SearchStructures_ref/Kdtree_Interface.tex @@ -0,0 +1,27 @@ +\begin{ccRefClass}{Kdtree_Interface} + +{\cgal} contains a default implementation for the Kdtree\_d traits +class, that +may be applied to any +standard class of point provided by \cgal. + +The default traits class \ccStyle{Kdtree_Interface} is +templated with a parameter \ccStyle{Point}, which is required to +supply the following methods: + +\begin{itemize} + \item Constructor, and copy constructor. + + \item \ccStyle{int dimension();} - return the dimension of the point. + + \item \ccStyle{operator[](int dim);} - an operator for accessing + the various coordinates of the given point. Used also to copy + coordinates between points. +\end{itemize} + +There are two other default traits classes \ccStyle{Kdtree_Interface_2d} +and \ccStyle{Kdtree_Interface_3d} which should be used when using +2D and 3D points from the {\cgal} kernel. This is done since the points in the +kernel do not support changing their coordinates through direct access. + +\end{ccRefClass} diff --git a/Packages/kdtree/doc_tex/SearchStructures/SearchStructures_ref/Kdtree_Interface_2d.tex b/Packages/kdtree/doc_tex/SearchStructures/SearchStructures_ref/Kdtree_Interface_2d.tex new file mode 100644 index 00000000000..0cd36b737c0 --- /dev/null +++ b/Packages/kdtree/doc_tex/SearchStructures/SearchStructures_ref/Kdtree_Interface_2d.tex @@ -0,0 +1,19 @@ +\begin{ccRefClass}{Kdtree_Interface_2d} + +The default traits class \ccStyle{Kdtree_Interface_2d} +should be used when using 2D points from the {\cgal} kernel. +It is +templated with a parameter \ccStyle{Point}, which is required to +supply the following methods: + +\begin{itemize} + \item Constructor, and copy constructor. + + \item \ccStyle{int dimension();} - return the dimension of the point. + + \item \ccStyle{operator[](int dim);} - an operator for accessing + the various coordinates of the given point. Used also to copy + coordinates between points. +\end{itemize} + +\end{ccRefClass} diff --git a/Packages/kdtree/doc_tex/SearchStructures/SearchStructures_ref/Kdtree_Interface_3d.tex b/Packages/kdtree/doc_tex/SearchStructures/SearchStructures_ref/Kdtree_Interface_3d.tex new file mode 100644 index 00000000000..864b952e74f --- /dev/null +++ b/Packages/kdtree/doc_tex/SearchStructures/SearchStructures_ref/Kdtree_Interface_3d.tex @@ -0,0 +1,19 @@ +\begin{ccRefClass}{Kdtree_Interface_3d} + +The default traits class \ccStyle{Kdtree_Interface_3d} +should be used when using 3D points from the {\cgal} kernel. +It is +templated with a parameter \ccStyle{Point}, which is required to +supply the following methods: + +\begin{itemize} + \item Constructor, and copy constructor. + + \item \ccStyle{int dimension();} - return the dimension of the point. + + \item \ccStyle{operator[](int dim);} - an operator for accessing + the various coordinates of the given point. Used also to copy + coordinates between points. +\end{itemize} + +\end{ccRefClass} diff --git a/Packages/kdtree/doc_tex/SearchStructures/SearchStructures_ref/Kdtree_d.tex b/Packages/kdtree/doc_tex/SearchStructures/SearchStructures_ref/Kdtree_d.tex new file mode 100644 index 00000000000..8557bd609b4 --- /dev/null +++ b/Packages/kdtree/doc_tex/SearchStructures/SearchStructures_ref/Kdtree_d.tex @@ -0,0 +1,45 @@ +\begin{ccRefClass}{Kdtree_d} + +\ccThree{KdtreexdxTraitsx}{}{\hspace*{7.6cm}} +\ccTwo{}{\hspace*{7.6cm}} + +%\begin{ccClassTemplate}{Kdtree_d} + \ccDefinition An object $T$ of the class + \ccStyle{Kdtree_d} is the {\kdt} induced by a set of points + in $d$-dimensions. + + \ccInclude{ CGAL/kdtree_d.h} + + \ccTypes + + \ccNestedType{Box}{represents an axis-parallel box in + $d$-dimensions. The box might be unbounded.} + + \ccTypedef{typedef Traits::Point Point;}{} + \ccTypedef{typedef list List_points;}{} + + \ccCreation + \ccCreationVariable{kd_tree} + + \ccConstructor{Kdtree_d( int dim = 2 );}{construct an + empty {\kdt} of dimension \ccStyle{dim}.} + + \ccOperations + +\ccThree{bool}{}{\hspace*{7.6cm}} + + \ccMethod{bool is_valid(bool verbose = false, int level = 0) + const;} {perform internal consistency checks to verify the + correctness of the \kdt} + + \ccMethod{void build( list &l );}{construct the + {\kdt} from the points stored in \ccStyle{l}. + \ccPrecond{all the points in \ccStyle{l} are of dimension no + smaller than the dimension of {{\ccVar} } itself.} } + + \ccMethod{void search( back_insert_iterator + result, Box & query_box );}{return into \ccStyle{result} all + the points of the {{\kdt} } that lie inside \ccStyle{query_box}} +%\end{ccClassTemplate} + +\end{ccRefClass} diff --git a/Packages/kdtree/doc_tex/SearchStructures/SearchStructures_ref/Kdtree_d_Box.tex b/Packages/kdtree/doc_tex/SearchStructures/SearchStructures_ref/Kdtree_d_Box.tex new file mode 100644 index 00000000000..4cc71ccf603 --- /dev/null +++ b/Packages/kdtree/doc_tex/SearchStructures/SearchStructures_ref/Kdtree_d_Box.tex @@ -0,0 +1,34 @@ +\begin{ccRefClass}[Kdtree_d::]{Box} + \ccDefinition An object $B$ of the class + \ccStyle{Box} is a $d$-dimensional box (it may + be unbounded). A $d$-dimensional box is the set defined by the + Cartesian set $[l_1, r_1) \times [l_2, r_2) \times \cdots \times + [l_d,r_d)$. + + \ccCreation + \ccCreationVariable{box} + + \ccConstructor{Box( int d );}{Construct a box corresponding to + the whole $d$-dimensional space} + + \ccConstructor{Box( Point left, Right right, int d );}{ Construct + the axis parallel box in the $d$-dimensional space defined by + the points \ccStyle{left}, \ccStyle{right}.} + + \ccOperations + + \ccMethod{void set_coord_left( int k, Point & left );}{ set + the left endpoint of the $k$-th dimensional interval of \ccVar\ {} + to be the $k$-th coordinate of \ccStyle{left}} + + \ccMethod{void set_coord_right( int k, Point & right );}{ set + the right endpoint of the $k$-th dimensional interval of \ccVar\ {} + to be the $k$-th coordinate of \ccStyle{right}} + + \ccMethod{bool is_in( Point pnt );}{return \ccStyle{true} + if \ccStyle{pnt} lies inside \ccVar.} + + \ccMethod{bool is_coord_in_range( int k, Point pnt );}{ return + \ccStyle{true} if the $k$-th coordinate of \ccStyle{pnt} lies + inside the $k$-th dimensional interval of \ccVar.} +\end{ccRefClass} diff --git a/Packages/kdtree/doc_tex/SearchStructures/SearchStructures_ref/kd_main.tex b/Packages/kdtree/doc_tex/SearchStructures/SearchStructures_ref/kd_main.tex new file mode 100644 index 00000000000..55ff3d964f3 --- /dev/null +++ b/Packages/kdtree/doc_tex/SearchStructures/SearchStructures_ref/kd_main.tex @@ -0,0 +1,15 @@ +% +------------------------------------------------------------------------+ +% | CBP Reference Manual: main.tex +% +------------------------------------------------------------------------+ +% | Automatically generated driver file for the reference manual chapter +% | of this package. Do not edit manually, you may loose your changes. +% +------------------------------------------------------------------------+ + +\input{SearchStructures_ref/KdtreeDTraits.tex} +\input{SearchStructures_ref/Kdtree_d.tex} +\input{SearchStructures_ref/Kdtree_d_Box.tex} +\input{SearchStructures_ref/Kdtree_Interface.tex} +\input{SearchStructures_ref/Kdtree_Interface_2d.tex} +\input{SearchStructures_ref/Kdtree_Interface_3d.tex} + +%% EOF diff --git a/Packages/kdtree/doc_tex/SearchStructures/kd-tree.tex b/Packages/kdtree/doc_tex/SearchStructures/kd-tree.tex index d5ed2ae4003..c366e92d667 100644 --- a/Packages/kdtree/doc_tex/SearchStructures/kd-tree.tex +++ b/Packages/kdtree/doc_tex/SearchStructures/kd-tree.tex @@ -211,216 +211,6 @@ int main() The partition of a set of points induced by a kd-tree of the points \end{ccHtmlOnly} -\section{Reference Pages for Kd-Trees} -\label{KDT_sec:RefPages} - -\begin{ccRefClass}{Kdtree_d} - -\ccThree{KdtreexdxTraitsx}{}{\hspace*{7.6cm}} -\ccTwo{}{\hspace*{7.6cm}} - -%\begin{ccClassTemplate}{Kdtree_d} - \ccDefinition An object $T$ of the class - \ccStyle{Kdtree_d} is the {\kdt} induced by a set of points - in $d$-dimensions. - - \ccInclude{ CGAL/kdtree_d.h} - - \ccTypes - - \ccNestedType{Box}{represents an axis-parallel box in - $d$-dimensions. The box might be unbounded.} - - \ccTypedef{typedef Traits::Point Point;}{} - \ccTypedef{typedef list List_points;}{} - - \ccCreation - \ccCreationVariable{kd_tree} - - \ccConstructor{Kdtree_d( int dim = 2 );}{construct an - empty {\kdt} of dimension \ccStyle{dim}.} - - \ccOperations - -\ccThree{bool}{}{\hspace*{7.6cm}} - - \ccMethod{bool is_valid(bool verbose = false, int level = 0) - const;} {perform internal consistency checks to verify the - correctness of the \kdt} - - \ccMethod{void build( list &l );}{construct the - {\kdt} from the points stored in \ccStyle{l}. - \ccPrecond{all the points in \ccStyle{l} are of dimension no - smaller than the dimension of {{\ccVar} } itself.} } - - \ccMethod{void search( back_insert_iterator - result, Box & query_box );}{return into \ccStyle{result} all - the points of the {{\kdt} } that lie inside \ccStyle{query_box}} -%\end{ccClassTemplate} - -\end{ccRefClass} - -%\ccHeading{\ccStyle{Kdtree_d::Box}} - -%\begin{ccClassTemplate}{Kdtree_d::Box} -\begin{ccRefClass}[Kdtree_d::]{Box} - \ccDefinition An object $B$ of the class - \ccStyle{Box} is a $d$-dimensional box (it may - be unbounded). A $d$-dimensional box is the set defined by the - Cartesian set $[l_1, r_1) \times [l_2, r_2) \times \cdots \times - [l_d,r_d)$. - - \ccCreation - \ccCreationVariable{box} - - \ccConstructor{Box( int d );}{Construct a box corresponding to - the whole $d$-dimensional space} - - \ccConstructor{Box( Point left, Right right, int d );}{ Construct - the axis parallel box in the $d$-dimensional space defined by - the points \ccStyle{left}, \ccStyle{right}.} - - \ccOperations - - \ccMethod{void set_coord_left( int k, Point & left );}{ set - the left endpoint of the $k$-th dimensional interval of \ccVar\ {} - to be the $k$-th coordinate of \ccStyle{left}} - - \ccMethod{void set_coord_right( int k, Point & right );}{ set - the right endpoint of the $k$-th dimensional interval of \ccVar\ {} - to be the $k$-th coordinate of \ccStyle{right}} - - \ccMethod{bool is_in( Point pnt );}{return \ccStyle{true} - if \ccStyle{pnt} lies inside \ccVar.} - - \ccMethod{bool is_coord_in_range( int k, Point pnt );}{ return - \ccStyle{true} if the $k$-th coordinate of \ccStyle{pnt} lies - inside the $k$-th dimensional interval of \ccVar.} -%\end{ccClassTemplate} -%\end{ccClass} -\end{ccRefClass} - -%******************************************************** -\begin{ccRefConcept}{Kdtree_d_traits} - -The \ccStyle{Kdtree_d} class is parameterized with the -interface class \ccStyle{Traits} which defines the abstract interface -between the \ccStyle{Kdtree_d} class and the data (i.e., points). The following -requirement catalog lists the primitives, i.e.,~types, member functions -etc., that must be defined for a class that can be used to -parameterize \kdts. Ready-made implementation are available -by the \ccStyle{Kdtree_d} default traits classes. - -\ccThree{static void}{}{\hspace*{7.1cm}} -\ccTwo{}{\hspace*{7.1cm}} - - -\begin{ccClass} {Traits} - - \ccCreationVariable{t} - - \ccDefinition - A class \ccClassName\ that satisfies the requirements of an - interface class for a \ccStyle{Kdtree_d} class must provide the - following types and operations. - - \ccTypes - - \ccNestedType{Point}{A type to hold a input item.} - - \ccOperations -% \ccSetTwoOfThreeColumns{4cm}{4cm} - - \ccMethod{static Comparison_result compare( - int k, - const Point & p0, - const Point & p1);} {compare the \ccStyle{k}-th coordinate - of $p0$ and $p1$. Return \ccStyle{LARGER} if $p0_k > - p1_k$, \ccStyle{SMALLER} if $p0_k < p1_k$, or else - \ccStyle{EQUAL}. } - - \ccMethod{static void copy_coord( int k, Point & dest, - const Point & src );}{Copy the $k$-th coordinate of $src$ to - the $k$-th coordinate of $dest$.} - - \ccMethod{static int dimension( const Point & pnt );} - {return the dimension of \ccStyle{pnt}} -\end{ccClass} -\end{ccRefConcept} - -\begin{ccRefClass}{Kdtree_Interface} - -{\cgal} contains a default implementation for the Kdtree\_d traits -class, that -may be applied to any -standard class of point provided by \cgal. - -The default traits class \ccStyle{Kdtree_Interface} is -templated with a parameter \ccStyle{Point}, which is required to -supply the following methods: - -\begin{itemize} - \item Constructor, and copy constructor. - - \item \ccStyle{int dimension();} - return the dimension of the point. - - \item \ccStyle{operator[](int dim);} - an operator for accessing - the various coordinates of the given point. Used also to copy - coordinates between points. -\end{itemize} - -There are two other default traits classes \ccStyle{Kdtree_Interface_2d} -and \ccStyle{Kdtree_Interface_3d} which should be used when using -2D and 3D points from the {\cgal} kernel. This is done since the points in the -kernel do not support changing their coordinates through direct access. - -\end{ccRefClass} -%******************************************************** - -%******************************************************** -\begin{ccRefClass}{Kdtree_Interface_2d} - -The default traits class \ccStyle{Kdtree_Interface_2d} -should be used when using 2D points from the {\cgal} kernel. -It is -templated with a parameter \ccStyle{Point}, which is required to -supply the following methods: - -\begin{itemize} - \item Constructor, and copy constructor. - - \item \ccStyle{int dimension();} - return the dimension of the point. - - \item \ccStyle{operator[](int dim);} - an operator for accessing - the various coordinates of the given point. Used also to copy - coordinates between points. -\end{itemize} - -\end{ccRefClass} - -%******************************************************** -\begin{ccRefClass}{Kdtree_Interface_3d} - -The default traits class \ccStyle{Kdtree_Interface_3d} -should be used when using 3D points from the {\cgal} kernel. -It is -templated with a parameter \ccStyle{Point}, which is required to -supply the following methods: - -\begin{itemize} - \item Constructor, and copy constructor. - - \item \ccStyle{int dimension();} - return the dimension of the point. - - \item \ccStyle{operator[](int dim);} - an operator for accessing - the various coordinates of the given point. Used also to copy - coordinates between points. -\end{itemize} - -\end{ccRefClass} - -%********************************************************* - %------------------------------------------------------------------------- % Bibiliography %------------------------------------------------------------------------- diff --git a/Packages/kdtree/doc_tex/SearchStructures/manual.tex b/Packages/kdtree/doc_tex/SearchStructures/manual.tex index afbb066512f..b82b7f61fa4 100644 --- a/Packages/kdtree/doc_tex/SearchStructures/manual.tex +++ b/Packages/kdtree/doc_tex/SearchStructures/manual.tex @@ -47,7 +47,8 @@ \renewcommand{\ccRefPageBegin}{\ccParDims\cgalColumnLayout} \ccDefGlobalScope{CGAL::} -\include{kd-tree} +\input{kd-tree} +\input{SearchStructures_ref/kd_main} \bibliographystyle{alpha} \bibliography{geom,cgal} diff --git a/Packages/kdtree/doc_tex/basic/SearchStructures/SearchStructures_ref/KdtreeDTraits.tex b/Packages/kdtree/doc_tex/basic/SearchStructures/SearchStructures_ref/KdtreeDTraits.tex new file mode 100644 index 00000000000..ec28a688410 --- /dev/null +++ b/Packages/kdtree/doc_tex/basic/SearchStructures/SearchStructures_ref/KdtreeDTraits.tex @@ -0,0 +1,44 @@ +\begin{ccRefConcept}{KdtreeDTraits} + +The \ccStyle{Kdtree_d} class is parameterized with the +interface class \ccStyle{Traits} which defines the abstract interface +between the \ccStyle{Kdtree_d} class and the data (i.e., points). The following +requirement catalog lists the primitives, i.e.,~types, member functions +etc., that must be defined for a class that can be used to +parameterize \kdts. Ready-made implementation are available +by the \ccStyle{Kdtree_d} default traits classes. + +\ccThree{static void}{}{\hspace*{7.1cm}} +\ccTwo{}{\hspace*{7.1cm}} + + + + \ccCreationVariable{t} + + \ccDefinition + A class \ccClassName\ that satisfies the requirements of an + interface class for a \ccStyle{Kdtree_d} class must provide the + following types and operations. + + \ccTypes + + \ccNestedType{Point}{A type to hold a input item.} + + \ccOperations +% \ccSetTwoOfThreeColumns{4cm}{4cm} + + \ccMethod{static Comparison_result compare( + int k, + const Point & p0, + const Point & p1);} {compare the \ccStyle{k}-th coordinate + of $p0$ and $p1$. Return \ccStyle{LARGER} if $p0_k > + p1_k$, \ccStyle{SMALLER} if $p0_k < p1_k$, or else + \ccStyle{EQUAL}. } + + \ccMethod{static void copy_coord( int k, Point & dest, + const Point & src );}{Copy the $k$-th coordinate of $src$ to + the $k$-th coordinate of $dest$.} + + \ccMethod{static int dimension( const Point & pnt );} + {return the dimension of \ccStyle{pnt}} +\end{ccRefConcept} diff --git a/Packages/kdtree/doc_tex/basic/SearchStructures/SearchStructures_ref/Kdtree_Interface.tex b/Packages/kdtree/doc_tex/basic/SearchStructures/SearchStructures_ref/Kdtree_Interface.tex new file mode 100644 index 00000000000..e3e42ee000f --- /dev/null +++ b/Packages/kdtree/doc_tex/basic/SearchStructures/SearchStructures_ref/Kdtree_Interface.tex @@ -0,0 +1,27 @@ +\begin{ccRefClass}{Kdtree_Interface} + +{\cgal} contains a default implementation for the Kdtree\_d traits +class, that +may be applied to any +standard class of point provided by \cgal. + +The default traits class \ccStyle{Kdtree_Interface} is +templated with a parameter \ccStyle{Point}, which is required to +supply the following methods: + +\begin{itemize} + \item Constructor, and copy constructor. + + \item \ccStyle{int dimension();} - return the dimension of the point. + + \item \ccStyle{operator[](int dim);} - an operator for accessing + the various coordinates of the given point. Used also to copy + coordinates between points. +\end{itemize} + +There are two other default traits classes \ccStyle{Kdtree_Interface_2d} +and \ccStyle{Kdtree_Interface_3d} which should be used when using +2D and 3D points from the {\cgal} kernel. This is done since the points in the +kernel do not support changing their coordinates through direct access. + +\end{ccRefClass} diff --git a/Packages/kdtree/doc_tex/basic/SearchStructures/SearchStructures_ref/Kdtree_Interface_2d.tex b/Packages/kdtree/doc_tex/basic/SearchStructures/SearchStructures_ref/Kdtree_Interface_2d.tex new file mode 100644 index 00000000000..0cd36b737c0 --- /dev/null +++ b/Packages/kdtree/doc_tex/basic/SearchStructures/SearchStructures_ref/Kdtree_Interface_2d.tex @@ -0,0 +1,19 @@ +\begin{ccRefClass}{Kdtree_Interface_2d} + +The default traits class \ccStyle{Kdtree_Interface_2d} +should be used when using 2D points from the {\cgal} kernel. +It is +templated with a parameter \ccStyle{Point}, which is required to +supply the following methods: + +\begin{itemize} + \item Constructor, and copy constructor. + + \item \ccStyle{int dimension();} - return the dimension of the point. + + \item \ccStyle{operator[](int dim);} - an operator for accessing + the various coordinates of the given point. Used also to copy + coordinates between points. +\end{itemize} + +\end{ccRefClass} diff --git a/Packages/kdtree/doc_tex/basic/SearchStructures/SearchStructures_ref/Kdtree_Interface_3d.tex b/Packages/kdtree/doc_tex/basic/SearchStructures/SearchStructures_ref/Kdtree_Interface_3d.tex new file mode 100644 index 00000000000..864b952e74f --- /dev/null +++ b/Packages/kdtree/doc_tex/basic/SearchStructures/SearchStructures_ref/Kdtree_Interface_3d.tex @@ -0,0 +1,19 @@ +\begin{ccRefClass}{Kdtree_Interface_3d} + +The default traits class \ccStyle{Kdtree_Interface_3d} +should be used when using 3D points from the {\cgal} kernel. +It is +templated with a parameter \ccStyle{Point}, which is required to +supply the following methods: + +\begin{itemize} + \item Constructor, and copy constructor. + + \item \ccStyle{int dimension();} - return the dimension of the point. + + \item \ccStyle{operator[](int dim);} - an operator for accessing + the various coordinates of the given point. Used also to copy + coordinates between points. +\end{itemize} + +\end{ccRefClass} diff --git a/Packages/kdtree/doc_tex/basic/SearchStructures/SearchStructures_ref/Kdtree_d.tex b/Packages/kdtree/doc_tex/basic/SearchStructures/SearchStructures_ref/Kdtree_d.tex new file mode 100644 index 00000000000..8557bd609b4 --- /dev/null +++ b/Packages/kdtree/doc_tex/basic/SearchStructures/SearchStructures_ref/Kdtree_d.tex @@ -0,0 +1,45 @@ +\begin{ccRefClass}{Kdtree_d} + +\ccThree{KdtreexdxTraitsx}{}{\hspace*{7.6cm}} +\ccTwo{}{\hspace*{7.6cm}} + +%\begin{ccClassTemplate}{Kdtree_d} + \ccDefinition An object $T$ of the class + \ccStyle{Kdtree_d} is the {\kdt} induced by a set of points + in $d$-dimensions. + + \ccInclude{ CGAL/kdtree_d.h} + + \ccTypes + + \ccNestedType{Box}{represents an axis-parallel box in + $d$-dimensions. The box might be unbounded.} + + \ccTypedef{typedef Traits::Point Point;}{} + \ccTypedef{typedef list List_points;}{} + + \ccCreation + \ccCreationVariable{kd_tree} + + \ccConstructor{Kdtree_d( int dim = 2 );}{construct an + empty {\kdt} of dimension \ccStyle{dim}.} + + \ccOperations + +\ccThree{bool}{}{\hspace*{7.6cm}} + + \ccMethod{bool is_valid(bool verbose = false, int level = 0) + const;} {perform internal consistency checks to verify the + correctness of the \kdt} + + \ccMethod{void build( list &l );}{construct the + {\kdt} from the points stored in \ccStyle{l}. + \ccPrecond{all the points in \ccStyle{l} are of dimension no + smaller than the dimension of {{\ccVar} } itself.} } + + \ccMethod{void search( back_insert_iterator + result, Box & query_box );}{return into \ccStyle{result} all + the points of the {{\kdt} } that lie inside \ccStyle{query_box}} +%\end{ccClassTemplate} + +\end{ccRefClass} diff --git a/Packages/kdtree/doc_tex/basic/SearchStructures/SearchStructures_ref/Kdtree_d_Box.tex b/Packages/kdtree/doc_tex/basic/SearchStructures/SearchStructures_ref/Kdtree_d_Box.tex new file mode 100644 index 00000000000..4cc71ccf603 --- /dev/null +++ b/Packages/kdtree/doc_tex/basic/SearchStructures/SearchStructures_ref/Kdtree_d_Box.tex @@ -0,0 +1,34 @@ +\begin{ccRefClass}[Kdtree_d::]{Box} + \ccDefinition An object $B$ of the class + \ccStyle{Box} is a $d$-dimensional box (it may + be unbounded). A $d$-dimensional box is the set defined by the + Cartesian set $[l_1, r_1) \times [l_2, r_2) \times \cdots \times + [l_d,r_d)$. + + \ccCreation + \ccCreationVariable{box} + + \ccConstructor{Box( int d );}{Construct a box corresponding to + the whole $d$-dimensional space} + + \ccConstructor{Box( Point left, Right right, int d );}{ Construct + the axis parallel box in the $d$-dimensional space defined by + the points \ccStyle{left}, \ccStyle{right}.} + + \ccOperations + + \ccMethod{void set_coord_left( int k, Point & left );}{ set + the left endpoint of the $k$-th dimensional interval of \ccVar\ {} + to be the $k$-th coordinate of \ccStyle{left}} + + \ccMethod{void set_coord_right( int k, Point & right );}{ set + the right endpoint of the $k$-th dimensional interval of \ccVar\ {} + to be the $k$-th coordinate of \ccStyle{right}} + + \ccMethod{bool is_in( Point pnt );}{return \ccStyle{true} + if \ccStyle{pnt} lies inside \ccVar.} + + \ccMethod{bool is_coord_in_range( int k, Point pnt );}{ return + \ccStyle{true} if the $k$-th coordinate of \ccStyle{pnt} lies + inside the $k$-th dimensional interval of \ccVar.} +\end{ccRefClass} diff --git a/Packages/kdtree/doc_tex/basic/SearchStructures/SearchStructures_ref/kd_main.tex b/Packages/kdtree/doc_tex/basic/SearchStructures/SearchStructures_ref/kd_main.tex new file mode 100644 index 00000000000..55ff3d964f3 --- /dev/null +++ b/Packages/kdtree/doc_tex/basic/SearchStructures/SearchStructures_ref/kd_main.tex @@ -0,0 +1,15 @@ +% +------------------------------------------------------------------------+ +% | CBP Reference Manual: main.tex +% +------------------------------------------------------------------------+ +% | Automatically generated driver file for the reference manual chapter +% | of this package. Do not edit manually, you may loose your changes. +% +------------------------------------------------------------------------+ + +\input{SearchStructures_ref/KdtreeDTraits.tex} +\input{SearchStructures_ref/Kdtree_d.tex} +\input{SearchStructures_ref/Kdtree_d_Box.tex} +\input{SearchStructures_ref/Kdtree_Interface.tex} +\input{SearchStructures_ref/Kdtree_Interface_2d.tex} +\input{SearchStructures_ref/Kdtree_Interface_3d.tex} + +%% EOF diff --git a/Packages/kdtree/doc_tex/basic/SearchStructures/kd-tree.tex b/Packages/kdtree/doc_tex/basic/SearchStructures/kd-tree.tex index d5ed2ae4003..c366e92d667 100644 --- a/Packages/kdtree/doc_tex/basic/SearchStructures/kd-tree.tex +++ b/Packages/kdtree/doc_tex/basic/SearchStructures/kd-tree.tex @@ -211,216 +211,6 @@ int main() The partition of a set of points induced by a kd-tree of the points \end{ccHtmlOnly} -\section{Reference Pages for Kd-Trees} -\label{KDT_sec:RefPages} - -\begin{ccRefClass}{Kdtree_d} - -\ccThree{KdtreexdxTraitsx}{}{\hspace*{7.6cm}} -\ccTwo{}{\hspace*{7.6cm}} - -%\begin{ccClassTemplate}{Kdtree_d} - \ccDefinition An object $T$ of the class - \ccStyle{Kdtree_d} is the {\kdt} induced by a set of points - in $d$-dimensions. - - \ccInclude{ CGAL/kdtree_d.h} - - \ccTypes - - \ccNestedType{Box}{represents an axis-parallel box in - $d$-dimensions. The box might be unbounded.} - - \ccTypedef{typedef Traits::Point Point;}{} - \ccTypedef{typedef list List_points;}{} - - \ccCreation - \ccCreationVariable{kd_tree} - - \ccConstructor{Kdtree_d( int dim = 2 );}{construct an - empty {\kdt} of dimension \ccStyle{dim}.} - - \ccOperations - -\ccThree{bool}{}{\hspace*{7.6cm}} - - \ccMethod{bool is_valid(bool verbose = false, int level = 0) - const;} {perform internal consistency checks to verify the - correctness of the \kdt} - - \ccMethod{void build( list &l );}{construct the - {\kdt} from the points stored in \ccStyle{l}. - \ccPrecond{all the points in \ccStyle{l} are of dimension no - smaller than the dimension of {{\ccVar} } itself.} } - - \ccMethod{void search( back_insert_iterator - result, Box & query_box );}{return into \ccStyle{result} all - the points of the {{\kdt} } that lie inside \ccStyle{query_box}} -%\end{ccClassTemplate} - -\end{ccRefClass} - -%\ccHeading{\ccStyle{Kdtree_d::Box}} - -%\begin{ccClassTemplate}{Kdtree_d::Box} -\begin{ccRefClass}[Kdtree_d::]{Box} - \ccDefinition An object $B$ of the class - \ccStyle{Box} is a $d$-dimensional box (it may - be unbounded). A $d$-dimensional box is the set defined by the - Cartesian set $[l_1, r_1) \times [l_2, r_2) \times \cdots \times - [l_d,r_d)$. - - \ccCreation - \ccCreationVariable{box} - - \ccConstructor{Box( int d );}{Construct a box corresponding to - the whole $d$-dimensional space} - - \ccConstructor{Box( Point left, Right right, int d );}{ Construct - the axis parallel box in the $d$-dimensional space defined by - the points \ccStyle{left}, \ccStyle{right}.} - - \ccOperations - - \ccMethod{void set_coord_left( int k, Point & left );}{ set - the left endpoint of the $k$-th dimensional interval of \ccVar\ {} - to be the $k$-th coordinate of \ccStyle{left}} - - \ccMethod{void set_coord_right( int k, Point & right );}{ set - the right endpoint of the $k$-th dimensional interval of \ccVar\ {} - to be the $k$-th coordinate of \ccStyle{right}} - - \ccMethod{bool is_in( Point pnt );}{return \ccStyle{true} - if \ccStyle{pnt} lies inside \ccVar.} - - \ccMethod{bool is_coord_in_range( int k, Point pnt );}{ return - \ccStyle{true} if the $k$-th coordinate of \ccStyle{pnt} lies - inside the $k$-th dimensional interval of \ccVar.} -%\end{ccClassTemplate} -%\end{ccClass} -\end{ccRefClass} - -%******************************************************** -\begin{ccRefConcept}{Kdtree_d_traits} - -The \ccStyle{Kdtree_d} class is parameterized with the -interface class \ccStyle{Traits} which defines the abstract interface -between the \ccStyle{Kdtree_d} class and the data (i.e., points). The following -requirement catalog lists the primitives, i.e.,~types, member functions -etc., that must be defined for a class that can be used to -parameterize \kdts. Ready-made implementation are available -by the \ccStyle{Kdtree_d} default traits classes. - -\ccThree{static void}{}{\hspace*{7.1cm}} -\ccTwo{}{\hspace*{7.1cm}} - - -\begin{ccClass} {Traits} - - \ccCreationVariable{t} - - \ccDefinition - A class \ccClassName\ that satisfies the requirements of an - interface class for a \ccStyle{Kdtree_d} class must provide the - following types and operations. - - \ccTypes - - \ccNestedType{Point}{A type to hold a input item.} - - \ccOperations -% \ccSetTwoOfThreeColumns{4cm}{4cm} - - \ccMethod{static Comparison_result compare( - int k, - const Point & p0, - const Point & p1);} {compare the \ccStyle{k}-th coordinate - of $p0$ and $p1$. Return \ccStyle{LARGER} if $p0_k > - p1_k$, \ccStyle{SMALLER} if $p0_k < p1_k$, or else - \ccStyle{EQUAL}. } - - \ccMethod{static void copy_coord( int k, Point & dest, - const Point & src );}{Copy the $k$-th coordinate of $src$ to - the $k$-th coordinate of $dest$.} - - \ccMethod{static int dimension( const Point & pnt );} - {return the dimension of \ccStyle{pnt}} -\end{ccClass} -\end{ccRefConcept} - -\begin{ccRefClass}{Kdtree_Interface} - -{\cgal} contains a default implementation for the Kdtree\_d traits -class, that -may be applied to any -standard class of point provided by \cgal. - -The default traits class \ccStyle{Kdtree_Interface} is -templated with a parameter \ccStyle{Point}, which is required to -supply the following methods: - -\begin{itemize} - \item Constructor, and copy constructor. - - \item \ccStyle{int dimension();} - return the dimension of the point. - - \item \ccStyle{operator[](int dim);} - an operator for accessing - the various coordinates of the given point. Used also to copy - coordinates between points. -\end{itemize} - -There are two other default traits classes \ccStyle{Kdtree_Interface_2d} -and \ccStyle{Kdtree_Interface_3d} which should be used when using -2D and 3D points from the {\cgal} kernel. This is done since the points in the -kernel do not support changing their coordinates through direct access. - -\end{ccRefClass} -%******************************************************** - -%******************************************************** -\begin{ccRefClass}{Kdtree_Interface_2d} - -The default traits class \ccStyle{Kdtree_Interface_2d} -should be used when using 2D points from the {\cgal} kernel. -It is -templated with a parameter \ccStyle{Point}, which is required to -supply the following methods: - -\begin{itemize} - \item Constructor, and copy constructor. - - \item \ccStyle{int dimension();} - return the dimension of the point. - - \item \ccStyle{operator[](int dim);} - an operator for accessing - the various coordinates of the given point. Used also to copy - coordinates between points. -\end{itemize} - -\end{ccRefClass} - -%******************************************************** -\begin{ccRefClass}{Kdtree_Interface_3d} - -The default traits class \ccStyle{Kdtree_Interface_3d} -should be used when using 3D points from the {\cgal} kernel. -It is -templated with a parameter \ccStyle{Point}, which is required to -supply the following methods: - -\begin{itemize} - \item Constructor, and copy constructor. - - \item \ccStyle{int dimension();} - return the dimension of the point. - - \item \ccStyle{operator[](int dim);} - an operator for accessing - the various coordinates of the given point. Used also to copy - coordinates between points. -\end{itemize} - -\end{ccRefClass} - -%********************************************************* - %------------------------------------------------------------------------- % Bibiliography %------------------------------------------------------------------------- diff --git a/Packages/kdtree/doc_tex/basic/SearchStructures/manual.tex b/Packages/kdtree/doc_tex/basic/SearchStructures/manual.tex index afbb066512f..b82b7f61fa4 100644 --- a/Packages/kdtree/doc_tex/basic/SearchStructures/manual.tex +++ b/Packages/kdtree/doc_tex/basic/SearchStructures/manual.tex @@ -47,7 +47,8 @@ \renewcommand{\ccRefPageBegin}{\ccParDims\cgalColumnLayout} \ccDefGlobalScope{CGAL::} -\include{kd-tree} +\input{kd-tree} +\input{SearchStructures_ref/kd_main} \bibliographystyle{alpha} \bibliography{geom,cgal}