From dca851e51653c198b60bca0fbe50a30aa0fb4909 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julia=20Fl=C3=B6totto?= Date: Tue, 27 Jan 2004 18:56:09 +0000 Subject: [PATCH] - added a return boolean value to the coordinate functions - removed some function calles that passed the traits (natural_ and regular_coordinate_function_2) - small fixes in the doc and in the license --- .gitattributes | 2 + .../design_implementation_history.tex | 1 + .../doc_tex/Interpolation/htmlfiles | 2 + .../doc_tex/Interpolation/introduction.tex | 6 +- .../doc_tex/Interpolation/main.tex | 3 +- .../doc_tex/Interpolation/nn_coords.gif | Bin 0 -> 25688 bytes .../doc_tex/Interpolation/surface_coords.tex | 2 +- .../doc_tex/Interpolation_ref/Data_access.tex | 4 +- .../Regular_neighbor_coordinates_traits_2.tex | 58 ------------ .../Voronoi_intersection_2_traits_3.tex | 6 +- .../doc_tex/Interpolation_ref/main.tex | 1 - .../natural_neighbor_coordinates_2.tex | 83 +++++++----------- .../regular_neighbor_coordinates_2.tex | 67 ++++++-------- .../sibson_gradient_fitting.tex | 7 +- .../surface_neighbor_coordinates_3.tex | 65 +++++++------- .../Interpolation_ref/surface_neighbors_3.tex | 4 +- .../design_implementation_history.tex | 1 + .../doc_tex/basic/Interpolation/htmlfiles | 2 + .../basic/Interpolation/introduction.tex | 6 +- .../doc_tex/basic/Interpolation/main.tex | 3 +- .../doc_tex/basic/Interpolation/nn_coords.gif | Bin 0 -> 25687 bytes .../basic/Interpolation/surface_coords.tex | 2 +- .../basic/Interpolation_ref/Data_access.tex | 4 +- .../Regular_neighbor_coordinates_traits_2.tex | 58 ------------ .../Voronoi_intersection_2_traits_3.tex | 6 +- .../doc_tex/basic/Interpolation_ref/main.tex | 1 - .../natural_neighbor_coordinates_2.tex | 83 +++++++----------- .../regular_neighbor_coordinates_2.tex | 67 ++++++-------- .../sibson_gradient_fitting.tex | 7 +- .../surface_neighbor_coordinates_3.tex | 65 +++++++------- .../Interpolation_ref/surface_neighbors_3.tex | 4 +- .../surface_neighbor_coordinates_3.C | 16 +++- .../Interpolation_gradient_fitting_traits_2.h | 2 +- .../include/CGAL/Interpolation_traits_2.h | 2 +- .../Regular_neighbor_coordinates_traits_2.h | 44 ---------- .../CGAL/Voronoi_intersection_2_traits_3.h | 1 - ...s_for_voronoi_intersection_cartesian_2_3.h | 2 +- .../include/CGAL/interpolation_functions.h | 2 +- .../CGAL/natural_neighbor_coordinates_2.h | 4 +- ...s_for_voronoi_intersection_cartesian_2_3.h | 2 +- .../CGAL/regular_neighbor_coordinates_2.h | 2 +- .../include/CGAL/sibson_gradient_fitting.h | 2 +- .../CGAL/surface_neighbor_coordinates_3.h | 38 ++++---- .../include/CGAL/surface_neighbors_3.h | 6 +- .../include/CGAL/_test_surface_neighbors_3.C | 37 ++++---- .../Interpolation/test_regular_neighbors_2.C | 4 +- 46 files changed, 291 insertions(+), 493 deletions(-) create mode 100644 Packages/Interpolation/doc_tex/Interpolation/design_implementation_history.tex create mode 100644 Packages/Interpolation/doc_tex/Interpolation/htmlfiles create mode 100644 Packages/Interpolation/doc_tex/Interpolation/nn_coords.gif delete mode 100644 Packages/Interpolation/doc_tex/Interpolation_ref/Regular_neighbor_coordinates_traits_2.tex create mode 100644 Packages/Interpolation/doc_tex/basic/Interpolation/design_implementation_history.tex create mode 100644 Packages/Interpolation/doc_tex/basic/Interpolation/htmlfiles create mode 100644 Packages/Interpolation/doc_tex/basic/Interpolation/nn_coords.gif delete mode 100644 Packages/Interpolation/doc_tex/basic/Interpolation_ref/Regular_neighbor_coordinates_traits_2.tex delete mode 100644 Packages/Interpolation/include/CGAL/Regular_neighbor_coordinates_traits_2.h diff --git a/.gitattributes b/.gitattributes index c47fef0311a..a4163e66f7f 100644 --- a/.gitattributes +++ b/.gitattributes @@ -937,7 +937,9 @@ Packages/Installation/doc_tex/installation/Fig/a-simp.ipe -text Packages/Installation/doc_tex/installation/Fig/c-simp.ipe -text Packages/Installation/doc_tex/installation/Fig/g-simp.ipe -text Packages/Installation/doc_tex/installation/Fig/l-simp.ipe -text +Packages/Interpolation/doc_tex/Interpolation/nn_coords.gif -text svneol=unset#unset Packages/Interpolation/doc_tex/Interpolation/nn_coords.ipe -text +Packages/Interpolation/doc_tex/basic/Interpolation/nn_coords.gif svneol=native#unset Packages/Kernel_23/doc_tex/kernel/IsoCuboid.eps -text Packages/Kernel_23/doc_tex/kernel/IsoCuboid.gif -text svneol=unset#unset Packages/Kernel_23/doc_tex/kernel/arrlinthree.gif -text svneol=unset#unset diff --git a/Packages/Interpolation/doc_tex/Interpolation/design_implementation_history.tex b/Packages/Interpolation/doc_tex/Interpolation/design_implementation_history.tex new file mode 100644 index 00000000000..f38b2ade7c8 --- /dev/null +++ b/Packages/Interpolation/doc_tex/Interpolation/design_implementation_history.tex @@ -0,0 +1 @@ +\section{Design and Implementation History} \ No newline at end of file diff --git a/Packages/Interpolation/doc_tex/Interpolation/htmlfiles b/Packages/Interpolation/doc_tex/Interpolation/htmlfiles new file mode 100644 index 00000000000..3e98d853f08 --- /dev/null +++ b/Packages/Interpolation/doc_tex/Interpolation/htmlfiles @@ -0,0 +1,2 @@ +nn_coords.gif + diff --git a/Packages/Interpolation/doc_tex/Interpolation/introduction.tex b/Packages/Interpolation/doc_tex/Interpolation/introduction.tex index c5fe03f2802..19a6732c276 100644 --- a/Packages/Interpolation/doc_tex/Interpolation/introduction.tex +++ b/Packages/Interpolation/doc_tex/Interpolation/introduction.tex @@ -1,3 +1,5 @@ +%\ccAuthor{Julia Fl{\"o}totto} + This chapter describes \cgal's interpolation package which implements natural neighbor coordinate functions as well as different methods for scattered data interpolation most of which are based on @@ -13,7 +15,7 @@ Scattered data interpolation solves the following problem: given measures of a function on a set of discrete data points, the task is to interpolate this function on an arbitrary query point. More formally, let $\mathcal{P}=\{\mathbf{p_1},\ldots ,\mathbf{p_n}\}$ be a set of -$n$ point in $\mathbb{R}^2$ or $\mathbb{R}^3$ and $\Phi$ be a scalar +$n$ points in $\mathbb{R}^2$ or $\mathbb{R}^3$ and $\Phi$ be a scalar function defined inside the convex hull of $\mathcal{P}$. We assume that the function values are known at the points of $\mathcal{P}$, i.e. to each $\mathbf{p_i} \in \mathcal{P}$, we associate $z_i = @@ -21,4 +23,4 @@ each $\mathbf{p_i} \in \mathcal{P}$, we associate $z_i = at $\mathbf{p_i}$. It is denoted $\mathbf{g_i}= \nabla \Phi(\mathbf{p_i})$. The interpolation is carried out for an arbitrary query point $\mathbf{x}$. Except for interpolation on surfaces, $\mathbf{x}$ must lie -in the convex hull of $\mathcal{P}$. +inside the convex hull of $\mathcal{P}$. diff --git a/Packages/Interpolation/doc_tex/Interpolation/main.tex b/Packages/Interpolation/doc_tex/Interpolation/main.tex index cd8208bf42f..9490cb6069a 100644 --- a/Packages/Interpolation/doc_tex/Interpolation/main.tex +++ b/Packages/Interpolation/doc_tex/Interpolation/main.tex @@ -5,4 +5,5 @@ \input{Interpolation/introduction} \input{Interpolation/coordinates} \input{Interpolation/surface_coords} -\input{Interpolation/interpolation} \ No newline at end of file +\input{Interpolation/interpolation} +%\input{Interpolation/design_implementation_history} \ No newline at end of file diff --git a/Packages/Interpolation/doc_tex/Interpolation/nn_coords.gif b/Packages/Interpolation/doc_tex/Interpolation/nn_coords.gif new file mode 100644 index 0000000000000000000000000000000000000000..0beb82c43881603a3796b3f8587f3dc68a14ad30 GIT binary patch literal 25688 zcmc&+eOOdg9zMf>2!etr$_O|j5~HRlj^J0KB49Gbf|yK_fFNIsf+18Ejo+h&xk&}G zYpxnwV`660LpyF_mYF*)S{cPc59Y__mON&=w$(PX_ujd4@45G$d+)h?Jj)+E_nEo( zp7Z`b-t(T{IcJiWB*o9lZ2{Hb$9AAnsfMbD`uX{RKoH;&5at!8@zDeZ1_p-*hlYlN zaR9^u5D!K~j2Ia^QWL8gry3XOA34Qq%GBVgF`hB8!(-#d#?2WsXWY1P(b{O8P8S&) zIrsj#v9YnUX3qkN04xPy8PFtZ!cxP)8sJsrMYQW%?Hf=XFm~hEh>VCyk4@4i>gOiT zosl_Xe&+n~YsPD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?1UeE(D1&JQPxe@e#aRhIFR%UFMN8BncS8RhC5A(ms89x?&Fb?u z&%RhsNxZNWNA|RNQi7Lk3oU#6)%3}n+Vj@ZwC3#9xTnI6#LZHcB8;fC{v#q2IQHEe zAblRe=nbfj9n)-Arx7!Yy@E6nJI@E_Np8nQvcNCz9tcF)K_$QZi?&h z8~N*NMp7_w(L&SDv9#FtI97JgY252JtRG~TxuGuMRP?X~RL zl_S0UzzI&)QkY@V-KSwysDH#{0xNqCgvrJmUUVT5mhGZ{iUB5Gp*OHU5yQh6TJo#` zqkk029w;IAPgV8796~F|$)3Ff5pM7ScD*N5E$t8eBQ1L@K9@x1D*a{F4B7dJV%ft) z7efCmpr-NI0Stu_E>j$s(65XmEqjV4^o0&2>OZi1gWkj|9HIvuKG8_Zo-n}yM6~P? zW~PEq_UUh6ITKU=NXZ1lENBeJYLsV0S=mE6>fU#Fl|#I+m%vlc8GVrTA2@Ji^d%1} zlxrIIF9i&=>=`F^u%SO-K>9}?9nP?lf(ym6=L+iQZWW{kw#Q1mm6iSZEI`_q(LZ7` z!O@%<)GGDsBE88dD9kvI@9CGH1E5k&3{Ue0lM*^`FaikMEpUck{zT@NX5gDq{$VXe v=)zT}YkvLt-`}<$hc7M} - - %% \ccHtmlCrossLink{} %% add further rules for cross referencing links - %% \ccHtmlIndexC[class]{} %% add further index entries - \ccCreationVariable{traits} - - \ccInheritsFrom - \ccc{Regular_triangulation_euclidean_traits_2}. - - \ccDefinition \ccRefName\ - %is a model for the concept \ccc{Regular_neighbor_coordinateTraits} and - can be used to instantiate the geometric traits class of the - function \ccc{regular_neighbor_coordinates_2} or the - \ccc{Regular_triangulation_2} passed as parameter to this - function. - - \ccInclude{CGAL/Regular_neighbor_coordinates_traits_2.h} - - \ccIsModel - \ccRefConceptPage{RegularTriangulationTraits_2} - \ccIndexSubitem[c]{RegularTriangulationTraits_2}{model} \\ - - - \ccTypes - \ccTypedef{typedef R::FT FT;}{} - \ccGlue - \ccTypedef{typedef R::Compute_squared_distance_2 - Compute_squared_distance_d;}{} - -\ccOperations -\ccAutoIndexingOff -\ccMemberFunction{Compute_squared_distance_d - compute_squared_distance_d_object() const;}{} - -\ccSeeAlso -\ccRefIdfierPage{CGAL::regular_neighbor_coordinates_2} \\ -\ccRefIdfierPage{CGAL::Regular_triangulation_euclidean_traits_2} \\ - -\ccIndexSubitemEnd{Interpolation}{Regular_neighbor_coordinates_traits_2} -\end{ccRefClass} -% +------------------------------------------------------------------------+ -%%RefPage: end of main body, begin of footer -% EOF -% +------------------------------------------------------------------------+ - diff --git a/Packages/Interpolation/doc_tex/Interpolation_ref/Voronoi_intersection_2_traits_3.tex b/Packages/Interpolation/doc_tex/Interpolation_ref/Voronoi_intersection_2_traits_3.tex index bbeb7d79c24..76b7afba3b8 100644 --- a/Packages/Interpolation/doc_tex/Interpolation_ref/Voronoi_intersection_2_traits_3.tex +++ b/Packages/Interpolation/doc_tex/Interpolation_ref/Voronoi_intersection_2_traits_3.tex @@ -57,17 +57,13 @@ \ccGlue \ccTypedef{typedef K::Ray_3 Ray_2;}{} \ccGlue - \ccTypedef{typedef K::Direction_3 Direction_2;}{} - \ccGlue \ccTypedef{typedef K::Vector_3 Vector_2;}{} \ccGlue \ccTypedef{typedef K::Construct_triangle_3 Construct_triangle_2;}{} \ccGlue \ccTypedef{typedef K::Construct_ray_3 Construct_ray_2;}{} \ccGlue - \ccTypedef{typedef K::Construct_direction_3 Construct_direction_2;}{} - \ccGlue - \ccTypedef{typedef K::Compare_distance_3 Compare_distance_2;}{} + \ccTypedef{typedef K::Compare_distance_3 Compare_distance_2;}{} \ccTypedef{Compute_area_3 Compute_area_2;} {An instance of this function object class computes the square root of the result of \ccc{K::Compute_squared_area_3}. diff --git a/Packages/Interpolation/doc_tex/Interpolation_ref/main.tex b/Packages/Interpolation/doc_tex/Interpolation_ref/main.tex index 55854a635f1..65efb2e28b3 100644 --- a/Packages/Interpolation/doc_tex/Interpolation_ref/main.tex +++ b/Packages/Interpolation/doc_tex/Interpolation_ref/main.tex @@ -8,7 +8,6 @@ \input{Interpolation_ref/Interpolation_traits_2} \input{Interpolation_ref/natural_neighbor_coordinates_2} \input{Interpolation_ref/regular_neighbor_coordinates_2} -\input{Interpolation_ref/Regular_neighbor_coordinates_traits_2} \input{Interpolation_ref/sibson_gradient_fitting} \input{Interpolation_ref/GradientFittingTraits} \input{Interpolation_ref/Interpolation_gradient_fitting_traits_2} diff --git a/Packages/Interpolation/doc_tex/Interpolation_ref/natural_neighbor_coordinates_2.tex b/Packages/Interpolation/doc_tex/Interpolation_ref/natural_neighbor_coordinates_2.tex index 238e2970b38..fe06cf39a07 100644 --- a/Packages/Interpolation/doc_tex/Interpolation_ref/natural_neighbor_coordinates_2.tex +++ b/Packages/Interpolation/doc_tex/Interpolation_ref/natural_neighbor_coordinates_2.tex @@ -23,71 +23,51 @@ of the triangulation. \ccInclude{CGAL/natural_neighbor_coordinates_2.h} -\ccFunction{template - std::pair< OutputIterator, typename Traits::FT > +\ccFunction{template < class Dt, class OutputIterator > CGAL::Triple< + OutputIterator, typename Dt::Geom_traits::FT, bool > natural_neighbor_coordinates_2(const Dt& dt, const typename - Traits::Point_2& p, OutputIterator out, const Traits& traits, - typename Dt::Face_handle start = typename Dt::Face_handle(NULL));} { - computes the natural neighbor coordinates for \ccc{p} with respect - to the points in the two-dimensional Delaunay triangulation \ccc{dt}. - The template class \ccc{Dt} should be of type + Dt::Geom_traits::Point_2& p, OutputIterator out, typename + Dt::Face_handle start = typename Dt::Face_handle());} { computes the + natural neighbor coordinates for \ccc{p} with respect to the points + in the two-dimensional Delaunay triangulation \ccc{dt}. The + template class \ccc{Dt} should be of type \ccc{Delaunay_triangulation_2}. The value type of the \ccc{OutputIterator} is a pair of \ccc{Dt::Point_2} and the coordinate value of type \ccc{Dt::Geom_traits::FT}. The sequence of point/coordinate pairs that is computed by the function is placed - starting at \ccc{out}. The function returns a pair with an iterator - that is placed past-the-end of the resulting sequence of - point/coordinate pairs and the normalization factor of the - coordinates. - \ccPrecond % - \ccc{p} lies in the convex hull of the - points in \ccc{dt}. - } + starting at \ccc{out}. The function returns a triple with an + iterator that is placed past-the-end of the resulting sequence of + point/coordinate pairs, the normalization factor of the coordinates + and a boolean value which is set to true iff the coordinate + computation was successful, i.e. if \ccc{p} lies inside the + convex hull of the points in \ccc{dt}. } -\ccFunction{template < class Dt, class OutputIterator > std::pair< - OutputIterator, typename Dt::Geom_traits::FT > - natural_neighbor_coordinates_2(const Dt& dt, const typename - Dt::Geom_traits::Point_2& p, OutputIterator out, typename - Dt::Face_handle start = typename Dt::Face_handle(NULL));} -% -{The same as above. This function instantiates the template parameter - \ccc{Traits} to be \ccc{Dt::Geom_traits}.} - - -\ccFunction{template std::pair< OutputIterator, typename Traits::FT - > natural_neighbor_coordinates_2(const Dt& dt, const typename - Traits::Point_2& p, OutputIterator out, EdgeIterator hole_begin, - EdgeIterator hole_end, const Traits& traits);} { The same as above. +\ccFunction{template CGAL::Triple< OutputIterator, typename Dt::Geom_traits::FT, + bool > natural_neighbor_coordinates_2(const Dt& dt, const typename + Dt::Geom_traits::Point_2& p, OutputIterator out, EdgeIterator hole_begin, + EdgeIterator hole_end);} { The same as above. \ccc{hole_begin} and \ccc{hole_end} determines the iterator range over the boundary edges of the conflict zone of \ccc{p} in the triangulation. It is the result of the function \ccc{T.get_boundary_of_conflicts(p,std::back_inserter(hole), start)}, see \ccc{Delaunay_triangulation_2}.} -\ccFunction{template std::pair< - OutputIterator, typename Dt::Geom_traits::FT > - natural_neighbor_coordinates_2(const Dt& dt, typename - Dt::Vertex_handle vh, OutputIterator out);}{This function computes +\ccFunction{template + CGAL::Triple< OutputIterator, typename Dt::Geom_traits::FT, bool > + natural_neighbor_coordinates_2(const Dt& dt, + typename Dt::Vertex_handle vh, OutputIterator out);}{This function computes the natural neighbor coordinates of the point \ccc{vh->point()} with respect to the vertices of \ccc{dt} excluding \ccc{vh->point()}. The same as above for the remaining parameters.} -\ccFunction{template - std::pair< OutputIterator, typename Dt::Geom_traits::FT > - natural_neighbor_coordinates_2(const Dt& dt, - typename Dt::Vertex_handle vh, OutputIterator out);}{The template - parameter \ccc{Traits} of the function above is instantiated to - \ccc{Dt::Geom_traits}.} - \ccHeading{Requirements} \begin{enumerate} \item \ccc{Dt} are equivalent to the class \ccc{Delaunay_triangulation_2}. -\item \ccc{OutputIterator::value_type} is equivalent to - \ccc{std::pair}, i.e.\ a pair - associating a point and its natural neighbor coordinate. -\item \ccc{Traits} is a model of the concept \ccc{DelaunayTriangulationTraits_2}. %\ccIndexMainItem[c]{DelaunayTriangulationTraits_2}. +\item The traits class \ccc{Traits} of \ccc{Dt} is a model of the + concept \ccc{DelaunayTriangulationTraits_2}. + %\ccIndexMainItem[c]{DelaunayTriangulationTraits_2}. Only the following members of this traits class are used: \begin{itemize} \item \ccc{Construct_circumcenter_2} @@ -97,6 +77,9 @@ of the triangulation. \item[] Additionally, \ccc{Traits} must meet the requirements for the traits class of the \ccc{polygon_area_2} function. \end{itemize} +\item \ccc{OutputIterator::value_type} is equivalent to + \ccc{std::pair}, i.e.\ a pair + associating a point and its natural neighbor coordinate. \end{enumerate} \ccSeeAlso @@ -105,10 +88,12 @@ of the triangulation. \ccRefIdfierPage{CGAL::surface_neighbor_coordinates_3} \\ \ccRefIdfierPage{CGAL::regular_neighbor_coordinates_2} -\ccImplementation This function computes the area of the sub-cells stolen from the -Voronoi cells of the points in \ccc{dt} when inserting \ccc{p}. The -total area of the Voronoi cell of \ccc{p} is also computed and -returned by the function. +\ccImplementation This function computes the area of the sub-cells +stolen from the Voronoi cells of the points in \ccc{dt} when inserting +\ccc{p}. The total area of the Voronoi cell of \ccc{p} is also +computed and returned by the function. If \ccc{p} lies outside the +convex hull, the coordinate values cannot be computed and the third +value of the result triple is set to \ccc{false}. \ccIndexSubitemEnd{Interpolation}{natural_neighbor_coordinates_2} \end{ccRefFunction} diff --git a/Packages/Interpolation/doc_tex/Interpolation_ref/regular_neighbor_coordinates_2.tex b/Packages/Interpolation/doc_tex/Interpolation_ref/regular_neighbor_coordinates_2.tex index 2d558925e95..a22b87a6b6b 100644 --- a/Packages/Interpolation/doc_tex/Interpolation_ref/regular_neighbor_coordinates_2.tex +++ b/Packages/Interpolation/doc_tex/Interpolation_ref/regular_neighbor_coordinates_2.tex @@ -24,11 +24,11 @@ coordinates regular neighbor coordinates. \ccInclude{CGAL/regular_neighbor_coordinates_2.h} -\ccFunction{template - std::pair< OutputIterator, typename Traits::FT > +\ccFunction{template < class Rt, class OutputIterator > CGAL::Triple< + OutputIterator, typename Rt::Geom_traits::FT, bool > regular_neighbor_coordinates_2(const Rt& rt, const typename - Traits::Weighted_point& p, OutputIterator out, const Traits& traits, - typename Rt::Face_handle start = typename Rt::Face_handle(NULL));} { + Rt::Geom_traits::Weighted_point& p, OutputIterator out, typename + Rt::Face_handle start = typename Rt::Face_handle());} { computes the regular neighbor coordinates for \ccc{p} with respect to the weighted points in the two-dimensional regular triangulation \ccc{rt}. The template class \ccc{Rt} should be of type @@ -36,33 +36,22 @@ coordinates regular neighbor coordinates. \ccc{OutputIterator} is a pair of \ccc{Rt::Weighted_point} and the coordinate value of type \ccc{Rt::Geom_traits::FT}. The sequence of point/coordinate pairs that is computed by the function is placed - starting at \ccc{out}. The function returns a pair with an iterator - that is placed past-the-end of the resulting sequence of - point/coordinate pairs and the normalization factor of the - coordinates. - \ccPrecond % - \ccc{p} lies in the convex hull of the - points in \ccc{rt}. + starting at \ccc{out}. The function returns a triple with an + iterator that is placed past-the-end of the resulting sequence of + point/coordinate pairs, the normalization factor of the coordinates + and a boolean value which is set to true iff the coordinate + computation was successful, i.e. if \ccc{p} lies inside the + convex hull of the points in \ccc{rt}. } -\ccFunction{template < class Rt, class OutputIterator > std::pair< - OutputIterator, typename Rt::Geom_traits::FT > - regular_neighbor_coordinates_2(const Rt& rt, const typename - Rt::Geom_traits::Weighted_point& p, OutputIterator out, typename - Rt::Face_handle start = typename Rt::Face_handle(NULL));} -% -{The same as above. This function instantiates the template parameter - \ccc{Traits} to be \ccc{Rt::Geom_traits}.} - - -\ccFunction{template std::pair< - OutputIterator, typename Traits::FT > +\ccFunction{template CGAL::Triple< + OutputIterator, typename Traits::FT, bool > regular_neighbor_coordinates_2(const Rt& rt, const typename Traits::Weighted_point& p, OutputIterator out, EdgeIterator hole_begin, EdgeIterator hole_end, VertexIterator - hidden_vertices_begin, VertexIterator hidden_vertices_end, const - Traits& traits);} { The same as above. \ccc{hole_begin} and + hidden_vertices_begin, VertexIterator hidden_vertices_end);} +{ The same as above. \ccc{hole_begin} and \ccc{hole_end} determines the iterator range over the boundary edges of the conflict zone of \ccc{p} in the triangulation \ccc{rt}. \ccc{hidden_vertices_begin} and \ccc{hidden_vertices_end} determines @@ -73,39 +62,35 @@ coordinates regular neighbor coordinates. start)}, see \ccc{Regular_triangulation_2}.} -\ccFunction{template - std::pair< OutputIterator, typename Rt::Geom_traits::FT > +\ccFunction{template + CGAL::Triple< OutputIterator, typename Rt::Geom_traits::FT, bool > regular_neighbor_coordinates_2(const Rt& rt, typename Rt::Vertex_handle vh, OutputIterator out);}{This function computes the regular neighbor coordinates of the point \ccc{vh->point()} with respect to the vertices of \ccc{rt} excluding \ccc{vh->point()}. The same as above for the remaining parameters.} -\ccFunction{template - std::pair< OutputIterator, typename Rt::Geom_traits::FT > - regular_neighbor_coordinates_2(const Rt& rt, - typename Rt::Vertex_handle vh, OutputIterator out);}{The template - parameter \ccc{Traits} of the function above is instantiated to - \ccc{Rt::Geom_traits}.} - \ccHeading{Requirements} \begin{enumerate} \item \ccc{Rt} are equivalent to the class \ccc{Regular_triangulation_2}. +\item The traits class \ccc{Traits} of \ccc{Rt} is a model of the + concept \ccc{RegularTriangulationTraits_2}. It provides the number + type \ccc{FT} which is a model for \ccc{FieldNumberType} and it must + meet the requirements for the traits class of the + \ccc{polygon_area_2} function. A model of this traits class is + \ccc{Regular_triangulation_euclidean_traits_2}. \item \ccc{OutputIterator::value_type} is equivalent to \ccc{std::pair}, i.e.\ a pair associating a point and its regular neighbor coordinate. -\item \ccc{Traits} provides the number type \ccc{FT} which is a model - for \ccc{FieldNumberType} and it must meet the requirements for the - traits class of the \ccc{polygon_area_2} function. A model of this - traits class is \ccc{Regular_neighbor_coordinate_traits_2}. \end{enumerate} \ccImplementation This function computes the areas stolen from the Voronoi cells of points in \ccc{rt} by the insertion of \ccc{p}. The total area of the Voronoi cell of \ccc{p} is also computed and -returned by the function. +returned by the function. If \ccc{p} lies outside the convex hull, the +coordinate values cannot be computed and the third value of the result +triple is set to \ccc{false}. \ccSeeAlso \ccRefIdfierPage{CGAL::natural_neighbor_coordinates_2} \\ diff --git a/Packages/Interpolation/doc_tex/Interpolation_ref/sibson_gradient_fitting.tex b/Packages/Interpolation/doc_tex/Interpolation_ref/sibson_gradient_fitting.tex index c6cdc7d08bc..ef984a91bb5 100644 --- a/Packages/Interpolation/doc_tex/Interpolation_ref/sibson_gradient_fitting.tex +++ b/Packages/Interpolation/doc_tex/Interpolation_ref/sibson_gradient_fitting.tex @@ -77,7 +77,7 @@ coordinates. \ccc{OutputIterator::value_type} is a pair associating a point to a vector. The sequence of point/gradient pairs computed by this function is placed starting at \ccc{out}. The function returns an - iterator that is placed past-the-end of the resulting sequence.The + iterator that is placed past-the-end of the resulting sequence. The requirements are the same as above. The template class \ccc{Rt} must be equivalent to \ccc{Regular_triangulation_2}.} @@ -94,10 +94,7 @@ coordinates. \ccImplementation This function implements Sibson's gradient estimation method based on natural neighbor coordinates -\cite{s-bdnni-81}. It computes the weighted sum of matrices and -vectors. The vector is the multiplied with the inverse matrix yielding -the result. - +\cite{s-bdnni-81}. \ccIndexSubitemEnd{Interpolation}{sibson_gradient_fitting} \end{ccRefFunction} diff --git a/Packages/Interpolation/doc_tex/Interpolation_ref/surface_neighbor_coordinates_3.tex b/Packages/Interpolation/doc_tex/Interpolation_ref/surface_neighbor_coordinates_3.tex index 7647ecae827..bb6641346c0 100644 --- a/Packages/Interpolation/doc_tex/Interpolation_ref/surface_neighbor_coordinates_3.tex +++ b/Packages/Interpolation/doc_tex/Interpolation_ref/surface_neighbor_coordinates_3.tex @@ -20,7 +20,7 @@ surface points associated to a finite set of sample points issued from the surface. The coordinates are computed from the intersection of the Voronoi cell of the query point \ccc{p} with the tangent plane to the surface at \ccc{p}. If the sampling is sufficiently dense, the -coordinate systems meets the properties described in the manual pages +coordinate system meets the properties described in the manual pages and in \cite{bf-lcss-02},\cite{prisme-these-flototto}. The query point \ccc{p} needs to lie inside the convex hull of the projection of the sample points onto the tangent plane at \ccc{p}. @@ -28,7 +28,7 @@ the sample points onto the tangent plane at \ccc{p}. \ccInclude{CGAL/surface_neighbor_coordinates_3.h} \ccFunction{template std::pair< OutputIterator, typename Kernel::FT > + Kernel> CGAL::Triple< OutputIterator, typename Kernel::FT, bool > surface_neighbor_coordinates_3(InputIterator first, InputIterator beyond, const typename Kernel::Point_3& p, const typename Kernel::Vector_3& normal, OutputIterator out, const Kernel& K);}{ @@ -36,24 +36,24 @@ the sample points onto the tangent plane at \ccc{p}. $\left[\right.$\ccc{first}, \ccc{beyond}$\left.\right)$. \ccc{InputIterator::value_type} is the point type \ccc{Kernel::Point_3}. The tangent plane is defined by the point - \ccc{p} and the vector \ccc{normal}. The - parameter \ccc{K} determines the kernel type that will instantiate + \ccc{p} and the vector \ccc{normal}. The parameter \ccc{K} + determines the kernel type that will instantiate the template parameter of \ccc{Voronoi_intersection_2_traits_3}. \\ The natural neighbor coordinates for \ccc{p} are computed in the power diagram that results from the intersection of the $3D$ Voronoi diagram of $\mathcal{P}$ with the tangent plane. The sequence of point/coordinate pairs that is computed by the function is placed - starting at \ccc{out}. The function returns a pair with an iterator - that is placed past-the-end of the resulting sequence of - point/coordinate pairs and the normalization factor of the - coordinates. - \ccPrecond % - \ccc{p} lies in the convex hull of the projection of the points - $\mathcal{P}$ onto the tangent plane.} + starting at \ccc{out}. The function returns a triple with an + iterator that is placed past-the-end of the resulting sequence of + point/coordinate pairs, the normalization factor of the coordinates + and a boolean value which is set to true iff the coordinate + computation was successful, i.e. if \ccc{p} lies inside the convex + hull of the projection of the points $\mathcal{P}$ onto the tangent + plane.} \ccFunction{template std::pair< OutputIterator, typename ITraits::FT > + ITraits> CGAL::Triple< OutputIterator, typename ITraits::FT, bool > surface_neighbor_coordinates_3(InputIterator first, InputIterator beyond, const typename ITraits::Point_2& p,OutputIterator out, const ITraits& traits);}{ the same as above only that the traits class @@ -61,40 +61,40 @@ the sample points onto the tangent plane at \ccc{p}. to \ccc{Voronoi_intersection_2_traits_3}.} -The next functions return, in addition, a boolean value that certifies -whether or not, the Voronoi cell of \ccc{p} can be affected by points -that lie outside the input range, i.e.\ outside the ball centered on \ccc{p} -passing through the -furthest sample point from \ccc{p} in the range +The next functions return, in addition, a second boolean value (the +fourth value of the quadrupel) that certifies whether or not, the +Voronoi cell of \ccc{p} can be affected by points that lie outside the +input range, i.e.\ outside the ball centered on \ccc{p} passing +through the furthest sample point from \ccc{p} in the range $\left[\right.$\ccc{first}, \ccc{beyond}$\left.\right)$. If the sample points are collected by a $k$-nearest neighbor or a range search query, this permits to check whether the neighborhood which has been considered is large enough. \ccFunction{template Triple< OutputIterator, typename Kernel::FT, bool > - surface_neighbor_coordinates_certified_3(InputIterator first, + Kernel> CGAL::Quadruple< OutputIterator, typename Kernel::FT, bool, + bool > surface_neighbor_coordinates_certified_3(InputIterator first, InputIterator beyond, const typename Kernel::Point_3& p, const typename Kernel::Vector_3& normal, OutputIterator out, const Kernel& - K);}{Similar to the first function. The additional third return + K);}{Similar to the first function. The additional fourth return value is \ccc{true} if the furthest point in the range $\left[\right.$\ccc{first}, \ccc{beyond}$\left.\right)$ is further away from \ccc{p} than twice the distance from \ccc{p} to the furthest vertex of the intersection of the Voronoi cell of \ccc{p} with the tangent plane defined by \ccc{(p,normal)}. It is \ccc{false} otherwise.} \ccFunction{template Triple< OutputIterator, typename - Kernel::FT, bool > + class InputIterator, class Kernel> CGAL::Quadruple< OutputIterator, + typename Kernel::FT, bool, bool > surface_neighbor_coordinates_certified_3(InputIterator first, InputIterator beyond, const typename Kernel::Point_2& p, const typename Kernel::FT& max_distance, OutputIterator out, const Kernel& kernel);} { The same as above except that this function takes the maximal distance from p to the points in the range - $\left[\right.$\ccc{first}, \ccc{beyond}$\left.\right)$ as additional - parameter.} + $\left[\right.$\ccc{first}, \ccc{beyond}$\left.\right)$ as + additional parameter.} \ccFunction{template Triple< OutputIterator, typename ITraits::FT, bool > + ITraits> CGAL::Quadruple< OutputIterator, typename ITraits::FT, bool, bool > surface_neighbor_coordinates_certified_3(InputIterator first, InputIterator beyond, const typename ITraits::Point_2& p, OutputIterator out, const ITraits& traits);}{The same as above only @@ -103,7 +103,7 @@ considered is large enough. to \ccc{Voronoi_intersection_2_traits_3}.} \ccFunction{template Triple< OutputIterator, typename ITraits::FT, bool > + ITraits> CGAL::Quadruple< OutputIterator, typename ITraits::FT, bool, bool > surface_neighbor_coordinates_certified_3(InputIterator first, InputIterator beyond, const typename ITraits::Point_2& p, const typename ITraits::FT& max_distance, OutputIterator out, const @@ -117,11 +117,11 @@ necessarily neighbors in the Delaunay triangulation of $\mathcal{P} \cup \{p\}$. \ccFunction{template < class Dt, class OutputIterator > - std::pair< OutputIterator, typename Dt::Geom_traits::FT > + CGAL::Triple< OutputIterator, typename Dt::Geom_traits::FT, bool > surface_neighbor_coordinates_3(const Dt& dt, const typename Dt::Geom_traits::Point_2& p, const typename Dt::Geom_traits::Vector_3& normal, OutputIterator out, typename - Dt::Face_handle start = typename Dt::Face_handle(NULL));} {computes + Dt::Face_handle start = typename Dt::Face_handle());} {computes the surface neighbor coordinates with respect to the points that are vertices of the Delaunay triangulation \ccc{dt}. The type \ccc{Dt} must be equivalent to \ccc{Delaunay_triangulation_3}. The @@ -133,11 +133,11 @@ necessarily neighbors in the Delaunay triangulation of $\mathcal{P} \ccFunction{template < class Dt, class OutputIterator, - class ITraits> std::pair< OutputIterator, typename - Dt::Geom_traits::FT > surface_neighbor_coordinates_3(const Dt& dt, + class ITraits> CGAL::Triple< OutputIterator, typename + Dt::Geom_traits::FT, bool > surface_neighbor_coordinates_3(const Dt& dt, const typename Dt::Geom_traits::Point_2& p, OutputIterator out, const ITraits& traits, typename Dt::Face_handle start = typename - Dt::Face_handle(NULL));} + Dt::Face_handle());} % {The same as above only that the parameter \ccc{traits} instantiates the geometric traits class. Its type \ccc{ITraits} must be @@ -163,7 +163,8 @@ necessarily neighbors in the Delaunay triangulation of $\mathcal{P} \ccImplementation This functions construct the regular triangulation of the input points instantiated with \ccc{Voronoi_intersection_2_traits_3} or \ccc{ITraits} if provided. They return the result of the function call -\ccc{regular_neighbor_coordinates_2} with the regular triangulation and \ccc{p} as arguments. +\ccc{regular_neighbor_coordinates_2} +with the regular triangulation and \ccc{p} as arguments. \ccIndexSubitemEnd{Interpolation}{surface_neighbor_coordinates_3} \end{ccRefFunction} diff --git a/Packages/Interpolation/doc_tex/Interpolation_ref/surface_neighbors_3.tex b/Packages/Interpolation/doc_tex/Interpolation_ref/surface_neighbors_3.tex index ceae6366b32..d1bb4c775ff 100644 --- a/Packages/Interpolation/doc_tex/Interpolation_ref/surface_neighbors_3.tex +++ b/Packages/Interpolation/doc_tex/Interpolation_ref/surface_neighbors_3.tex @@ -115,7 +115,7 @@ necessarily neighbors in the Delaunay triangulation of $\mathcal{P} surface_neighbors_3(const Dt& dt, const typename Dt::Geom_traits::Point_2& p, const typename Dt::Geom_traits::Vector_3& normal, OutputIterator out, typename - Dt::Face_handle start = typename Dt::Face_handle(NULL));} {computes + Dt::Face_handle start = typename Dt::Face_handle());} {computes the surface neighbor coordinates with respect to the points that are vertices of the Delaunay triangulation \ccc{dt}. The type \ccc{Dt} must be equivalent to \ccc{Delaunay_triangulation_3}. The @@ -131,7 +131,7 @@ necessarily neighbors in the Delaunay triangulation of $\mathcal{P} OutputIterator surface_neighbors_3(const Dt& dt, const typename Dt::Geom_traits::Point_2& p, OutputIterator out, const ITraits& traits, typename Dt::Face_handle start = typename - Dt::Face_handle(NULL));} + Dt::Face_handle());} % {The same as above only that the parameter \ccc{traits} instantiates the geometric traits class. Its type \ccc{ITraits} must be diff --git a/Packages/Interpolation/doc_tex/basic/Interpolation/design_implementation_history.tex b/Packages/Interpolation/doc_tex/basic/Interpolation/design_implementation_history.tex new file mode 100644 index 00000000000..f38b2ade7c8 --- /dev/null +++ b/Packages/Interpolation/doc_tex/basic/Interpolation/design_implementation_history.tex @@ -0,0 +1 @@ +\section{Design and Implementation History} \ No newline at end of file diff --git a/Packages/Interpolation/doc_tex/basic/Interpolation/htmlfiles b/Packages/Interpolation/doc_tex/basic/Interpolation/htmlfiles new file mode 100644 index 00000000000..3e98d853f08 --- /dev/null +++ b/Packages/Interpolation/doc_tex/basic/Interpolation/htmlfiles @@ -0,0 +1,2 @@ +nn_coords.gif + diff --git a/Packages/Interpolation/doc_tex/basic/Interpolation/introduction.tex b/Packages/Interpolation/doc_tex/basic/Interpolation/introduction.tex index c5fe03f2802..19a6732c276 100644 --- a/Packages/Interpolation/doc_tex/basic/Interpolation/introduction.tex +++ b/Packages/Interpolation/doc_tex/basic/Interpolation/introduction.tex @@ -1,3 +1,5 @@ +%\ccAuthor{Julia Fl{\"o}totto} + This chapter describes \cgal's interpolation package which implements natural neighbor coordinate functions as well as different methods for scattered data interpolation most of which are based on @@ -13,7 +15,7 @@ Scattered data interpolation solves the following problem: given measures of a function on a set of discrete data points, the task is to interpolate this function on an arbitrary query point. More formally, let $\mathcal{P}=\{\mathbf{p_1},\ldots ,\mathbf{p_n}\}$ be a set of -$n$ point in $\mathbb{R}^2$ or $\mathbb{R}^3$ and $\Phi$ be a scalar +$n$ points in $\mathbb{R}^2$ or $\mathbb{R}^3$ and $\Phi$ be a scalar function defined inside the convex hull of $\mathcal{P}$. We assume that the function values are known at the points of $\mathcal{P}$, i.e. to each $\mathbf{p_i} \in \mathcal{P}$, we associate $z_i = @@ -21,4 +23,4 @@ each $\mathbf{p_i} \in \mathcal{P}$, we associate $z_i = at $\mathbf{p_i}$. It is denoted $\mathbf{g_i}= \nabla \Phi(\mathbf{p_i})$. The interpolation is carried out for an arbitrary query point $\mathbf{x}$. Except for interpolation on surfaces, $\mathbf{x}$ must lie -in the convex hull of $\mathcal{P}$. +inside the convex hull of $\mathcal{P}$. diff --git a/Packages/Interpolation/doc_tex/basic/Interpolation/main.tex b/Packages/Interpolation/doc_tex/basic/Interpolation/main.tex index cd8208bf42f..9490cb6069a 100644 --- a/Packages/Interpolation/doc_tex/basic/Interpolation/main.tex +++ b/Packages/Interpolation/doc_tex/basic/Interpolation/main.tex @@ -5,4 +5,5 @@ \input{Interpolation/introduction} \input{Interpolation/coordinates} \input{Interpolation/surface_coords} -\input{Interpolation/interpolation} \ No newline at end of file +\input{Interpolation/interpolation} +%\input{Interpolation/design_implementation_history} \ No newline at end of file diff --git a/Packages/Interpolation/doc_tex/basic/Interpolation/nn_coords.gif b/Packages/Interpolation/doc_tex/basic/Interpolation/nn_coords.gif new file mode 100644 index 0000000000000000000000000000000000000000..b3130fe6be77808d19fd7885965a71ef62b4a6c2 GIT binary patch literal 25687 zcmc&+e^gXe9>2qY$jDI;MHvA{L}Jtw#S#3Ks0gS`u^=XsC?LqMML`iNi^fVDE6hzS zkX>`t*cuZvn-1-`iCSjvxM*b*3myEqxh2PJ*S6Yb_PsZ6-n;L;``){cA7}Z4^UlnB z@7~Y%$LD_T_uf0nOOoPe<+gxo@MAkrsZ>MNL;d~zK_Ce53JCKF)B0%x0|SG@gF{0@ z!8ib70f+}9B1Vji9jT4gj#G_`)I?74nKCtaYK(VG?C{vQv2k<8%o#UsT(mA)uh&P$ zM$Wx|ZftDqtl6_bA^^((SPry_+OX6xunzbX`4H`Dsx<-C0b{p}jmU_Yw0e>u(J(i0 z?u^VC^E2myOrJwGaKHoJz;l+e>OZqbFGNax2l;x>nd-0RjCsQ0L4|YBH zNY^6?JqgAhW1=f@nQK|PD?Q7VmDiP**OOP=Q(WXKs_v;Sca=ZodddPU4WMCP#U7+i;(9b@O|F|u_?bG;AdqB^RgMV}Z z*A?BB8__quiT~zK{G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-?!VLaQE)nm(9Qd(Kvx)||Z-_fWWrxLL|lgb|gNe?(LQ$G*D)q>m$* zd;!(5BiiliG-6`0!gD5^t9lT2y*v~rG37ABUX{Z`%AcCtHzdN1`iid3O>v)nBY(UT zFO34XLUm@Y>XCIF41>KHL-h>DSt}!r_^O$f!moPsFh~Z%jEqT;{kv|Gm z50sF5r>gp34xts~RL`z~2silry1^SNmiCAIkybrczl$PMmHskohU|1ivFc%>3n70N zP_uaK0ER*dmnrs5=vT&(mOVui`a%a1*Jj6TTn4;(l$`jQ6~$~CR$ zhXMv#_KXud*U%p@ApK*A4rf?N!G&Vka~bt(w+d1N+hZlZ%Buc+79j1*=pQke;B3we zYL)tNk=|q!6lR>qclOJ#0Z=I>hNpS6SqU9D83Bat7C6H%eJb-qGw{tQ|FD)Kbm5wl rHNXD+?{C|W!WWl@@8^9Yyrc9LBVK-K126O%g{W?} - - %% \ccHtmlCrossLink{} %% add further rules for cross referencing links - %% \ccHtmlIndexC[class]{} %% add further index entries - \ccCreationVariable{traits} - - \ccInheritsFrom - \ccc{Regular_triangulation_euclidean_traits_2}. - - \ccDefinition \ccRefName\ - %is a model for the concept \ccc{Regular_neighbor_coordinateTraits} and - can be used to instantiate the geometric traits class of the - function \ccc{regular_neighbor_coordinates_2} or the - \ccc{Regular_triangulation_2} passed as parameter to this - function. - - \ccInclude{CGAL/Regular_neighbor_coordinates_traits_2.h} - - \ccIsModel - \ccRefConceptPage{RegularTriangulationTraits_2} - \ccIndexSubitem[c]{RegularTriangulationTraits_2}{model} \\ - - - \ccTypes - \ccTypedef{typedef R::FT FT;}{} - \ccGlue - \ccTypedef{typedef R::Compute_squared_distance_2 - Compute_squared_distance_d;}{} - -\ccOperations -\ccAutoIndexingOff -\ccMemberFunction{Compute_squared_distance_d - compute_squared_distance_d_object() const;}{} - -\ccSeeAlso -\ccRefIdfierPage{CGAL::regular_neighbor_coordinates_2} \\ -\ccRefIdfierPage{CGAL::Regular_triangulation_euclidean_traits_2} \\ - -\ccIndexSubitemEnd{Interpolation}{Regular_neighbor_coordinates_traits_2} -\end{ccRefClass} -% +------------------------------------------------------------------------+ -%%RefPage: end of main body, begin of footer -% EOF -% +------------------------------------------------------------------------+ - diff --git a/Packages/Interpolation/doc_tex/basic/Interpolation_ref/Voronoi_intersection_2_traits_3.tex b/Packages/Interpolation/doc_tex/basic/Interpolation_ref/Voronoi_intersection_2_traits_3.tex index bbeb7d79c24..76b7afba3b8 100644 --- a/Packages/Interpolation/doc_tex/basic/Interpolation_ref/Voronoi_intersection_2_traits_3.tex +++ b/Packages/Interpolation/doc_tex/basic/Interpolation_ref/Voronoi_intersection_2_traits_3.tex @@ -57,17 +57,13 @@ \ccGlue \ccTypedef{typedef K::Ray_3 Ray_2;}{} \ccGlue - \ccTypedef{typedef K::Direction_3 Direction_2;}{} - \ccGlue \ccTypedef{typedef K::Vector_3 Vector_2;}{} \ccGlue \ccTypedef{typedef K::Construct_triangle_3 Construct_triangle_2;}{} \ccGlue \ccTypedef{typedef K::Construct_ray_3 Construct_ray_2;}{} \ccGlue - \ccTypedef{typedef K::Construct_direction_3 Construct_direction_2;}{} - \ccGlue - \ccTypedef{typedef K::Compare_distance_3 Compare_distance_2;}{} + \ccTypedef{typedef K::Compare_distance_3 Compare_distance_2;}{} \ccTypedef{Compute_area_3 Compute_area_2;} {An instance of this function object class computes the square root of the result of \ccc{K::Compute_squared_area_3}. diff --git a/Packages/Interpolation/doc_tex/basic/Interpolation_ref/main.tex b/Packages/Interpolation/doc_tex/basic/Interpolation_ref/main.tex index 55854a635f1..65efb2e28b3 100644 --- a/Packages/Interpolation/doc_tex/basic/Interpolation_ref/main.tex +++ b/Packages/Interpolation/doc_tex/basic/Interpolation_ref/main.tex @@ -8,7 +8,6 @@ \input{Interpolation_ref/Interpolation_traits_2} \input{Interpolation_ref/natural_neighbor_coordinates_2} \input{Interpolation_ref/regular_neighbor_coordinates_2} -\input{Interpolation_ref/Regular_neighbor_coordinates_traits_2} \input{Interpolation_ref/sibson_gradient_fitting} \input{Interpolation_ref/GradientFittingTraits} \input{Interpolation_ref/Interpolation_gradient_fitting_traits_2} diff --git a/Packages/Interpolation/doc_tex/basic/Interpolation_ref/natural_neighbor_coordinates_2.tex b/Packages/Interpolation/doc_tex/basic/Interpolation_ref/natural_neighbor_coordinates_2.tex index 238e2970b38..fe06cf39a07 100644 --- a/Packages/Interpolation/doc_tex/basic/Interpolation_ref/natural_neighbor_coordinates_2.tex +++ b/Packages/Interpolation/doc_tex/basic/Interpolation_ref/natural_neighbor_coordinates_2.tex @@ -23,71 +23,51 @@ of the triangulation. \ccInclude{CGAL/natural_neighbor_coordinates_2.h} -\ccFunction{template - std::pair< OutputIterator, typename Traits::FT > +\ccFunction{template < class Dt, class OutputIterator > CGAL::Triple< + OutputIterator, typename Dt::Geom_traits::FT, bool > natural_neighbor_coordinates_2(const Dt& dt, const typename - Traits::Point_2& p, OutputIterator out, const Traits& traits, - typename Dt::Face_handle start = typename Dt::Face_handle(NULL));} { - computes the natural neighbor coordinates for \ccc{p} with respect - to the points in the two-dimensional Delaunay triangulation \ccc{dt}. - The template class \ccc{Dt} should be of type + Dt::Geom_traits::Point_2& p, OutputIterator out, typename + Dt::Face_handle start = typename Dt::Face_handle());} { computes the + natural neighbor coordinates for \ccc{p} with respect to the points + in the two-dimensional Delaunay triangulation \ccc{dt}. The + template class \ccc{Dt} should be of type \ccc{Delaunay_triangulation_2}. The value type of the \ccc{OutputIterator} is a pair of \ccc{Dt::Point_2} and the coordinate value of type \ccc{Dt::Geom_traits::FT}. The sequence of point/coordinate pairs that is computed by the function is placed - starting at \ccc{out}. The function returns a pair with an iterator - that is placed past-the-end of the resulting sequence of - point/coordinate pairs and the normalization factor of the - coordinates. - \ccPrecond % - \ccc{p} lies in the convex hull of the - points in \ccc{dt}. - } + starting at \ccc{out}. The function returns a triple with an + iterator that is placed past-the-end of the resulting sequence of + point/coordinate pairs, the normalization factor of the coordinates + and a boolean value which is set to true iff the coordinate + computation was successful, i.e. if \ccc{p} lies inside the + convex hull of the points in \ccc{dt}. } -\ccFunction{template < class Dt, class OutputIterator > std::pair< - OutputIterator, typename Dt::Geom_traits::FT > - natural_neighbor_coordinates_2(const Dt& dt, const typename - Dt::Geom_traits::Point_2& p, OutputIterator out, typename - Dt::Face_handle start = typename Dt::Face_handle(NULL));} -% -{The same as above. This function instantiates the template parameter - \ccc{Traits} to be \ccc{Dt::Geom_traits}.} - - -\ccFunction{template std::pair< OutputIterator, typename Traits::FT - > natural_neighbor_coordinates_2(const Dt& dt, const typename - Traits::Point_2& p, OutputIterator out, EdgeIterator hole_begin, - EdgeIterator hole_end, const Traits& traits);} { The same as above. +\ccFunction{template CGAL::Triple< OutputIterator, typename Dt::Geom_traits::FT, + bool > natural_neighbor_coordinates_2(const Dt& dt, const typename + Dt::Geom_traits::Point_2& p, OutputIterator out, EdgeIterator hole_begin, + EdgeIterator hole_end);} { The same as above. \ccc{hole_begin} and \ccc{hole_end} determines the iterator range over the boundary edges of the conflict zone of \ccc{p} in the triangulation. It is the result of the function \ccc{T.get_boundary_of_conflicts(p,std::back_inserter(hole), start)}, see \ccc{Delaunay_triangulation_2}.} -\ccFunction{template std::pair< - OutputIterator, typename Dt::Geom_traits::FT > - natural_neighbor_coordinates_2(const Dt& dt, typename - Dt::Vertex_handle vh, OutputIterator out);}{This function computes +\ccFunction{template + CGAL::Triple< OutputIterator, typename Dt::Geom_traits::FT, bool > + natural_neighbor_coordinates_2(const Dt& dt, + typename Dt::Vertex_handle vh, OutputIterator out);}{This function computes the natural neighbor coordinates of the point \ccc{vh->point()} with respect to the vertices of \ccc{dt} excluding \ccc{vh->point()}. The same as above for the remaining parameters.} -\ccFunction{template - std::pair< OutputIterator, typename Dt::Geom_traits::FT > - natural_neighbor_coordinates_2(const Dt& dt, - typename Dt::Vertex_handle vh, OutputIterator out);}{The template - parameter \ccc{Traits} of the function above is instantiated to - \ccc{Dt::Geom_traits}.} - \ccHeading{Requirements} \begin{enumerate} \item \ccc{Dt} are equivalent to the class \ccc{Delaunay_triangulation_2}. -\item \ccc{OutputIterator::value_type} is equivalent to - \ccc{std::pair}, i.e.\ a pair - associating a point and its natural neighbor coordinate. -\item \ccc{Traits} is a model of the concept \ccc{DelaunayTriangulationTraits_2}. %\ccIndexMainItem[c]{DelaunayTriangulationTraits_2}. +\item The traits class \ccc{Traits} of \ccc{Dt} is a model of the + concept \ccc{DelaunayTriangulationTraits_2}. + %\ccIndexMainItem[c]{DelaunayTriangulationTraits_2}. Only the following members of this traits class are used: \begin{itemize} \item \ccc{Construct_circumcenter_2} @@ -97,6 +77,9 @@ of the triangulation. \item[] Additionally, \ccc{Traits} must meet the requirements for the traits class of the \ccc{polygon_area_2} function. \end{itemize} +\item \ccc{OutputIterator::value_type} is equivalent to + \ccc{std::pair}, i.e.\ a pair + associating a point and its natural neighbor coordinate. \end{enumerate} \ccSeeAlso @@ -105,10 +88,12 @@ of the triangulation. \ccRefIdfierPage{CGAL::surface_neighbor_coordinates_3} \\ \ccRefIdfierPage{CGAL::regular_neighbor_coordinates_2} -\ccImplementation This function computes the area of the sub-cells stolen from the -Voronoi cells of the points in \ccc{dt} when inserting \ccc{p}. The -total area of the Voronoi cell of \ccc{p} is also computed and -returned by the function. +\ccImplementation This function computes the area of the sub-cells +stolen from the Voronoi cells of the points in \ccc{dt} when inserting +\ccc{p}. The total area of the Voronoi cell of \ccc{p} is also +computed and returned by the function. If \ccc{p} lies outside the +convex hull, the coordinate values cannot be computed and the third +value of the result triple is set to \ccc{false}. \ccIndexSubitemEnd{Interpolation}{natural_neighbor_coordinates_2} \end{ccRefFunction} diff --git a/Packages/Interpolation/doc_tex/basic/Interpolation_ref/regular_neighbor_coordinates_2.tex b/Packages/Interpolation/doc_tex/basic/Interpolation_ref/regular_neighbor_coordinates_2.tex index 2d558925e95..a22b87a6b6b 100644 --- a/Packages/Interpolation/doc_tex/basic/Interpolation_ref/regular_neighbor_coordinates_2.tex +++ b/Packages/Interpolation/doc_tex/basic/Interpolation_ref/regular_neighbor_coordinates_2.tex @@ -24,11 +24,11 @@ coordinates regular neighbor coordinates. \ccInclude{CGAL/regular_neighbor_coordinates_2.h} -\ccFunction{template - std::pair< OutputIterator, typename Traits::FT > +\ccFunction{template < class Rt, class OutputIterator > CGAL::Triple< + OutputIterator, typename Rt::Geom_traits::FT, bool > regular_neighbor_coordinates_2(const Rt& rt, const typename - Traits::Weighted_point& p, OutputIterator out, const Traits& traits, - typename Rt::Face_handle start = typename Rt::Face_handle(NULL));} { + Rt::Geom_traits::Weighted_point& p, OutputIterator out, typename + Rt::Face_handle start = typename Rt::Face_handle());} { computes the regular neighbor coordinates for \ccc{p} with respect to the weighted points in the two-dimensional regular triangulation \ccc{rt}. The template class \ccc{Rt} should be of type @@ -36,33 +36,22 @@ coordinates regular neighbor coordinates. \ccc{OutputIterator} is a pair of \ccc{Rt::Weighted_point} and the coordinate value of type \ccc{Rt::Geom_traits::FT}. The sequence of point/coordinate pairs that is computed by the function is placed - starting at \ccc{out}. The function returns a pair with an iterator - that is placed past-the-end of the resulting sequence of - point/coordinate pairs and the normalization factor of the - coordinates. - \ccPrecond % - \ccc{p} lies in the convex hull of the - points in \ccc{rt}. + starting at \ccc{out}. The function returns a triple with an + iterator that is placed past-the-end of the resulting sequence of + point/coordinate pairs, the normalization factor of the coordinates + and a boolean value which is set to true iff the coordinate + computation was successful, i.e. if \ccc{p} lies inside the + convex hull of the points in \ccc{rt}. } -\ccFunction{template < class Rt, class OutputIterator > std::pair< - OutputIterator, typename Rt::Geom_traits::FT > - regular_neighbor_coordinates_2(const Rt& rt, const typename - Rt::Geom_traits::Weighted_point& p, OutputIterator out, typename - Rt::Face_handle start = typename Rt::Face_handle(NULL));} -% -{The same as above. This function instantiates the template parameter - \ccc{Traits} to be \ccc{Rt::Geom_traits}.} - - -\ccFunction{template std::pair< - OutputIterator, typename Traits::FT > +\ccFunction{template CGAL::Triple< + OutputIterator, typename Traits::FT, bool > regular_neighbor_coordinates_2(const Rt& rt, const typename Traits::Weighted_point& p, OutputIterator out, EdgeIterator hole_begin, EdgeIterator hole_end, VertexIterator - hidden_vertices_begin, VertexIterator hidden_vertices_end, const - Traits& traits);} { The same as above. \ccc{hole_begin} and + hidden_vertices_begin, VertexIterator hidden_vertices_end);} +{ The same as above. \ccc{hole_begin} and \ccc{hole_end} determines the iterator range over the boundary edges of the conflict zone of \ccc{p} in the triangulation \ccc{rt}. \ccc{hidden_vertices_begin} and \ccc{hidden_vertices_end} determines @@ -73,39 +62,35 @@ coordinates regular neighbor coordinates. start)}, see \ccc{Regular_triangulation_2}.} -\ccFunction{template - std::pair< OutputIterator, typename Rt::Geom_traits::FT > +\ccFunction{template + CGAL::Triple< OutputIterator, typename Rt::Geom_traits::FT, bool > regular_neighbor_coordinates_2(const Rt& rt, typename Rt::Vertex_handle vh, OutputIterator out);}{This function computes the regular neighbor coordinates of the point \ccc{vh->point()} with respect to the vertices of \ccc{rt} excluding \ccc{vh->point()}. The same as above for the remaining parameters.} -\ccFunction{template - std::pair< OutputIterator, typename Rt::Geom_traits::FT > - regular_neighbor_coordinates_2(const Rt& rt, - typename Rt::Vertex_handle vh, OutputIterator out);}{The template - parameter \ccc{Traits} of the function above is instantiated to - \ccc{Rt::Geom_traits}.} - \ccHeading{Requirements} \begin{enumerate} \item \ccc{Rt} are equivalent to the class \ccc{Regular_triangulation_2}. +\item The traits class \ccc{Traits} of \ccc{Rt} is a model of the + concept \ccc{RegularTriangulationTraits_2}. It provides the number + type \ccc{FT} which is a model for \ccc{FieldNumberType} and it must + meet the requirements for the traits class of the + \ccc{polygon_area_2} function. A model of this traits class is + \ccc{Regular_triangulation_euclidean_traits_2}. \item \ccc{OutputIterator::value_type} is equivalent to \ccc{std::pair}, i.e.\ a pair associating a point and its regular neighbor coordinate. -\item \ccc{Traits} provides the number type \ccc{FT} which is a model - for \ccc{FieldNumberType} and it must meet the requirements for the - traits class of the \ccc{polygon_area_2} function. A model of this - traits class is \ccc{Regular_neighbor_coordinate_traits_2}. \end{enumerate} \ccImplementation This function computes the areas stolen from the Voronoi cells of points in \ccc{rt} by the insertion of \ccc{p}. The total area of the Voronoi cell of \ccc{p} is also computed and -returned by the function. +returned by the function. If \ccc{p} lies outside the convex hull, the +coordinate values cannot be computed and the third value of the result +triple is set to \ccc{false}. \ccSeeAlso \ccRefIdfierPage{CGAL::natural_neighbor_coordinates_2} \\ diff --git a/Packages/Interpolation/doc_tex/basic/Interpolation_ref/sibson_gradient_fitting.tex b/Packages/Interpolation/doc_tex/basic/Interpolation_ref/sibson_gradient_fitting.tex index c6cdc7d08bc..ef984a91bb5 100644 --- a/Packages/Interpolation/doc_tex/basic/Interpolation_ref/sibson_gradient_fitting.tex +++ b/Packages/Interpolation/doc_tex/basic/Interpolation_ref/sibson_gradient_fitting.tex @@ -77,7 +77,7 @@ coordinates. \ccc{OutputIterator::value_type} is a pair associating a point to a vector. The sequence of point/gradient pairs computed by this function is placed starting at \ccc{out}. The function returns an - iterator that is placed past-the-end of the resulting sequence.The + iterator that is placed past-the-end of the resulting sequence. The requirements are the same as above. The template class \ccc{Rt} must be equivalent to \ccc{Regular_triangulation_2}.} @@ -94,10 +94,7 @@ coordinates. \ccImplementation This function implements Sibson's gradient estimation method based on natural neighbor coordinates -\cite{s-bdnni-81}. It computes the weighted sum of matrices and -vectors. The vector is the multiplied with the inverse matrix yielding -the result. - +\cite{s-bdnni-81}. \ccIndexSubitemEnd{Interpolation}{sibson_gradient_fitting} \end{ccRefFunction} diff --git a/Packages/Interpolation/doc_tex/basic/Interpolation_ref/surface_neighbor_coordinates_3.tex b/Packages/Interpolation/doc_tex/basic/Interpolation_ref/surface_neighbor_coordinates_3.tex index 7647ecae827..bb6641346c0 100644 --- a/Packages/Interpolation/doc_tex/basic/Interpolation_ref/surface_neighbor_coordinates_3.tex +++ b/Packages/Interpolation/doc_tex/basic/Interpolation_ref/surface_neighbor_coordinates_3.tex @@ -20,7 +20,7 @@ surface points associated to a finite set of sample points issued from the surface. The coordinates are computed from the intersection of the Voronoi cell of the query point \ccc{p} with the tangent plane to the surface at \ccc{p}. If the sampling is sufficiently dense, the -coordinate systems meets the properties described in the manual pages +coordinate system meets the properties described in the manual pages and in \cite{bf-lcss-02},\cite{prisme-these-flototto}. The query point \ccc{p} needs to lie inside the convex hull of the projection of the sample points onto the tangent plane at \ccc{p}. @@ -28,7 +28,7 @@ the sample points onto the tangent plane at \ccc{p}. \ccInclude{CGAL/surface_neighbor_coordinates_3.h} \ccFunction{template std::pair< OutputIterator, typename Kernel::FT > + Kernel> CGAL::Triple< OutputIterator, typename Kernel::FT, bool > surface_neighbor_coordinates_3(InputIterator first, InputIterator beyond, const typename Kernel::Point_3& p, const typename Kernel::Vector_3& normal, OutputIterator out, const Kernel& K);}{ @@ -36,24 +36,24 @@ the sample points onto the tangent plane at \ccc{p}. $\left[\right.$\ccc{first}, \ccc{beyond}$\left.\right)$. \ccc{InputIterator::value_type} is the point type \ccc{Kernel::Point_3}. The tangent plane is defined by the point - \ccc{p} and the vector \ccc{normal}. The - parameter \ccc{K} determines the kernel type that will instantiate + \ccc{p} and the vector \ccc{normal}. The parameter \ccc{K} + determines the kernel type that will instantiate the template parameter of \ccc{Voronoi_intersection_2_traits_3}. \\ The natural neighbor coordinates for \ccc{p} are computed in the power diagram that results from the intersection of the $3D$ Voronoi diagram of $\mathcal{P}$ with the tangent plane. The sequence of point/coordinate pairs that is computed by the function is placed - starting at \ccc{out}. The function returns a pair with an iterator - that is placed past-the-end of the resulting sequence of - point/coordinate pairs and the normalization factor of the - coordinates. - \ccPrecond % - \ccc{p} lies in the convex hull of the projection of the points - $\mathcal{P}$ onto the tangent plane.} + starting at \ccc{out}. The function returns a triple with an + iterator that is placed past-the-end of the resulting sequence of + point/coordinate pairs, the normalization factor of the coordinates + and a boolean value which is set to true iff the coordinate + computation was successful, i.e. if \ccc{p} lies inside the convex + hull of the projection of the points $\mathcal{P}$ onto the tangent + plane.} \ccFunction{template std::pair< OutputIterator, typename ITraits::FT > + ITraits> CGAL::Triple< OutputIterator, typename ITraits::FT, bool > surface_neighbor_coordinates_3(InputIterator first, InputIterator beyond, const typename ITraits::Point_2& p,OutputIterator out, const ITraits& traits);}{ the same as above only that the traits class @@ -61,40 +61,40 @@ the sample points onto the tangent plane at \ccc{p}. to \ccc{Voronoi_intersection_2_traits_3}.} -The next functions return, in addition, a boolean value that certifies -whether or not, the Voronoi cell of \ccc{p} can be affected by points -that lie outside the input range, i.e.\ outside the ball centered on \ccc{p} -passing through the -furthest sample point from \ccc{p} in the range +The next functions return, in addition, a second boolean value (the +fourth value of the quadrupel) that certifies whether or not, the +Voronoi cell of \ccc{p} can be affected by points that lie outside the +input range, i.e.\ outside the ball centered on \ccc{p} passing +through the furthest sample point from \ccc{p} in the range $\left[\right.$\ccc{first}, \ccc{beyond}$\left.\right)$. If the sample points are collected by a $k$-nearest neighbor or a range search query, this permits to check whether the neighborhood which has been considered is large enough. \ccFunction{template Triple< OutputIterator, typename Kernel::FT, bool > - surface_neighbor_coordinates_certified_3(InputIterator first, + Kernel> CGAL::Quadruple< OutputIterator, typename Kernel::FT, bool, + bool > surface_neighbor_coordinates_certified_3(InputIterator first, InputIterator beyond, const typename Kernel::Point_3& p, const typename Kernel::Vector_3& normal, OutputIterator out, const Kernel& - K);}{Similar to the first function. The additional third return + K);}{Similar to the first function. The additional fourth return value is \ccc{true} if the furthest point in the range $\left[\right.$\ccc{first}, \ccc{beyond}$\left.\right)$ is further away from \ccc{p} than twice the distance from \ccc{p} to the furthest vertex of the intersection of the Voronoi cell of \ccc{p} with the tangent plane defined by \ccc{(p,normal)}. It is \ccc{false} otherwise.} \ccFunction{template Triple< OutputIterator, typename - Kernel::FT, bool > + class InputIterator, class Kernel> CGAL::Quadruple< OutputIterator, + typename Kernel::FT, bool, bool > surface_neighbor_coordinates_certified_3(InputIterator first, InputIterator beyond, const typename Kernel::Point_2& p, const typename Kernel::FT& max_distance, OutputIterator out, const Kernel& kernel);} { The same as above except that this function takes the maximal distance from p to the points in the range - $\left[\right.$\ccc{first}, \ccc{beyond}$\left.\right)$ as additional - parameter.} + $\left[\right.$\ccc{first}, \ccc{beyond}$\left.\right)$ as + additional parameter.} \ccFunction{template Triple< OutputIterator, typename ITraits::FT, bool > + ITraits> CGAL::Quadruple< OutputIterator, typename ITraits::FT, bool, bool > surface_neighbor_coordinates_certified_3(InputIterator first, InputIterator beyond, const typename ITraits::Point_2& p, OutputIterator out, const ITraits& traits);}{The same as above only @@ -103,7 +103,7 @@ considered is large enough. to \ccc{Voronoi_intersection_2_traits_3}.} \ccFunction{template Triple< OutputIterator, typename ITraits::FT, bool > + ITraits> CGAL::Quadruple< OutputIterator, typename ITraits::FT, bool, bool > surface_neighbor_coordinates_certified_3(InputIterator first, InputIterator beyond, const typename ITraits::Point_2& p, const typename ITraits::FT& max_distance, OutputIterator out, const @@ -117,11 +117,11 @@ necessarily neighbors in the Delaunay triangulation of $\mathcal{P} \cup \{p\}$. \ccFunction{template < class Dt, class OutputIterator > - std::pair< OutputIterator, typename Dt::Geom_traits::FT > + CGAL::Triple< OutputIterator, typename Dt::Geom_traits::FT, bool > surface_neighbor_coordinates_3(const Dt& dt, const typename Dt::Geom_traits::Point_2& p, const typename Dt::Geom_traits::Vector_3& normal, OutputIterator out, typename - Dt::Face_handle start = typename Dt::Face_handle(NULL));} {computes + Dt::Face_handle start = typename Dt::Face_handle());} {computes the surface neighbor coordinates with respect to the points that are vertices of the Delaunay triangulation \ccc{dt}. The type \ccc{Dt} must be equivalent to \ccc{Delaunay_triangulation_3}. The @@ -133,11 +133,11 @@ necessarily neighbors in the Delaunay triangulation of $\mathcal{P} \ccFunction{template < class Dt, class OutputIterator, - class ITraits> std::pair< OutputIterator, typename - Dt::Geom_traits::FT > surface_neighbor_coordinates_3(const Dt& dt, + class ITraits> CGAL::Triple< OutputIterator, typename + Dt::Geom_traits::FT, bool > surface_neighbor_coordinates_3(const Dt& dt, const typename Dt::Geom_traits::Point_2& p, OutputIterator out, const ITraits& traits, typename Dt::Face_handle start = typename - Dt::Face_handle(NULL));} + Dt::Face_handle());} % {The same as above only that the parameter \ccc{traits} instantiates the geometric traits class. Its type \ccc{ITraits} must be @@ -163,7 +163,8 @@ necessarily neighbors in the Delaunay triangulation of $\mathcal{P} \ccImplementation This functions construct the regular triangulation of the input points instantiated with \ccc{Voronoi_intersection_2_traits_3} or \ccc{ITraits} if provided. They return the result of the function call -\ccc{regular_neighbor_coordinates_2} with the regular triangulation and \ccc{p} as arguments. +\ccc{regular_neighbor_coordinates_2} +with the regular triangulation and \ccc{p} as arguments. \ccIndexSubitemEnd{Interpolation}{surface_neighbor_coordinates_3} \end{ccRefFunction} diff --git a/Packages/Interpolation/doc_tex/basic/Interpolation_ref/surface_neighbors_3.tex b/Packages/Interpolation/doc_tex/basic/Interpolation_ref/surface_neighbors_3.tex index ceae6366b32..d1bb4c775ff 100644 --- a/Packages/Interpolation/doc_tex/basic/Interpolation_ref/surface_neighbors_3.tex +++ b/Packages/Interpolation/doc_tex/basic/Interpolation_ref/surface_neighbors_3.tex @@ -115,7 +115,7 @@ necessarily neighbors in the Delaunay triangulation of $\mathcal{P} surface_neighbors_3(const Dt& dt, const typename Dt::Geom_traits::Point_2& p, const typename Dt::Geom_traits::Vector_3& normal, OutputIterator out, typename - Dt::Face_handle start = typename Dt::Face_handle(NULL));} {computes + Dt::Face_handle start = typename Dt::Face_handle());} {computes the surface neighbor coordinates with respect to the points that are vertices of the Delaunay triangulation \ccc{dt}. The type \ccc{Dt} must be equivalent to \ccc{Delaunay_triangulation_3}. The @@ -131,7 +131,7 @@ necessarily neighbors in the Delaunay triangulation of $\mathcal{P} OutputIterator surface_neighbors_3(const Dt& dt, const typename Dt::Geom_traits::Point_2& p, OutputIterator out, const ITraits& traits, typename Dt::Face_handle start = typename - Dt::Face_handle(NULL));} + Dt::Face_handle());} % {The same as above only that the parameter \ccc{traits} instantiates the geometric traits class. Its type \ccc{ITraits} must be diff --git a/Packages/Interpolation/examples/Interpolation/surface_neighbor_coordinates_3.C b/Packages/Interpolation/examples/Interpolation/surface_neighbor_coordinates_3.C index 97134b444bf..a37651c3233 100644 --- a/Packages/Interpolation/examples/Interpolation/surface_neighbor_coordinates_3.C +++ b/Packages/Interpolation/examples/Interpolation/surface_neighbor_coordinates_3.C @@ -15,6 +15,8 @@ struct K : CGAL::Exact_predicates_inexact_constructions_kernel {}; typedef K::FT Coord_type; typedef K::Point_3 Point_3; typedef K::Vector_3 Vector_3; +typedef std::vector< std::pair< Point_3, K::FT > > + Point_coordinate_vector; int main() { @@ -32,12 +34,20 @@ int main() Vector_3 normal(p-CGAL::ORIGIN); std::cout << "Compute surface neighbor coordinates for " << p << std::endl; - std::vector< std::pair< Point_3, Coord_type > > coords; - Coord_type norm = + Point_coordinate_vector coords; + CGAL::Triple< std::back_insert_iterator, + K::FT, bool> result = CGAL::surface_neighbor_coordinates_3(points.begin(), points.end(), p, normal, std::back_inserter(coords), - K()).second; + K()); + if(!result.third){ + //Undersampling: + std::cout << "The coordinate computation was not successful." + << std::endl; + return 0; + } + K::FT norm = result.second; std::cout << "Testing the barycentric property " << std::endl; Point_3 b(0, 0,0); diff --git a/Packages/Interpolation/include/CGAL/Interpolation_gradient_fitting_traits_2.h b/Packages/Interpolation/include/CGAL/Interpolation_gradient_fitting_traits_2.h index f9629881928..a408ec5b279 100644 --- a/Packages/Interpolation/include/CGAL/Interpolation_gradient_fitting_traits_2.h +++ b/Packages/Interpolation/include/CGAL/Interpolation_gradient_fitting_traits_2.h @@ -1,4 +1,4 @@ -// Copyright (c) 1997 INRIA Sophia-Antipolis (France). +// Copyright (c) 2003 INRIA Sophia-Antipolis (France). // All rights reserved. // // This file is part of CGAL (www.cgal.org); you may redistribute it under diff --git a/Packages/Interpolation/include/CGAL/Interpolation_traits_2.h b/Packages/Interpolation/include/CGAL/Interpolation_traits_2.h index 0bb2c588f93..352ed8eb18f 100644 --- a/Packages/Interpolation/include/CGAL/Interpolation_traits_2.h +++ b/Packages/Interpolation/include/CGAL/Interpolation_traits_2.h @@ -1,4 +1,4 @@ -// Copyright (c) 1997 INRIA Sophia-Antipolis (France). +// Copyright (c) 2003 INRIA Sophia-Antipolis (France). // All rights reserved. // // This file is part of CGAL (www.cgal.org); you may redistribute it under diff --git a/Packages/Interpolation/include/CGAL/Regular_neighbor_coordinates_traits_2.h b/Packages/Interpolation/include/CGAL/Regular_neighbor_coordinates_traits_2.h deleted file mode 100644 index f6a412f07ba..00000000000 --- a/Packages/Interpolation/include/CGAL/Regular_neighbor_coordinates_traits_2.h +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright (c) 1997 INRIA Sophia-Antipolis (France). -// All rights reserved. -// -// This file is part of CGAL (www.cgal.org); you may redistribute it under -// the terms of the Q Public License version 1.0. -// See the file LICENSE.QPL distributed with CGAL. -// -// Licensees holding a valid commercial license may use this file in -// accordance with the commercial license agreement provided with the software. -// -// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE -// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. -// -// $Source$ -// $Revision$ $Date$ -// $Name$ -// -// Author(s) : Julia -// extended class for regular_neighbor_coordinates computation - - -#ifndef CGAL_REGULAR_NEIGHBOR_COORDINATES_TRAITS_2_H -#define CGAL_REGULAR_NEIGHBOR_COORDINATES_TRAITS_2_H - -#include - -CGAL_BEGIN_NAMESPACE - -template < class R, class W = typename R::RT> -class Regular_neighbor_coordinates_traits_2 - : public Regular_triangulation_euclidean_traits_2 -{ -public: - typedef R Rep; - typedef typename R::FT FT; - typedef typename Rep::Compute_area_2 Compute_area_2; - - Compute_area_2 compute_area_2_object() const - {return Compute_area_2();} -}; - -CGAL_END_NAMESPACE - -#endif // CGAL_REGULAR_NEIGHBOR_COORDINATES_TRAITS_2_H diff --git a/Packages/Interpolation/include/CGAL/Voronoi_intersection_2_traits_3.h b/Packages/Interpolation/include/CGAL/Voronoi_intersection_2_traits_3.h index 836d4e06cde..34bd85b0df1 100644 --- a/Packages/Interpolation/include/CGAL/Voronoi_intersection_2_traits_3.h +++ b/Packages/Interpolation/include/CGAL/Voronoi_intersection_2_traits_3.h @@ -241,7 +241,6 @@ class Compute_area_3 //-> if no sqrt is supported, cast to double public: typedef typename R::FT FT; - typedef typename R::Triangle_3 Triangle; typedef typename R::Point_3 Point; typedef typename R::Compute_squared_area_3 Compute_squared_area_3; diff --git a/Packages/Interpolation/include/CGAL/constructions/constructions_for_voronoi_intersection_cartesian_2_3.h b/Packages/Interpolation/include/CGAL/constructions/constructions_for_voronoi_intersection_cartesian_2_3.h index b4861b5aea4..4dcaf55e79b 100644 --- a/Packages/Interpolation/include/CGAL/constructions/constructions_for_voronoi_intersection_cartesian_2_3.h +++ b/Packages/Interpolation/include/CGAL/constructions/constructions_for_voronoi_intersection_cartesian_2_3.h @@ -1,4 +1,4 @@ -// Copyright (c) 1997 INRIA Sophia-Antipolis (France). +// Copyright (c) 2003 INRIA Sophia-Antipolis (France). // All rights reserved. // // This file is part of CGAL (www.cgal.org); you may redistribute it under diff --git a/Packages/Interpolation/include/CGAL/interpolation_functions.h b/Packages/Interpolation/include/CGAL/interpolation_functions.h index 6f3bc425da5..32d8acac5c7 100644 --- a/Packages/Interpolation/include/CGAL/interpolation_functions.h +++ b/Packages/Interpolation/include/CGAL/interpolation_functions.h @@ -1,4 +1,4 @@ -// Copyright (c) 1997 INRIA Sophia-Antipolis (France). +// Copyright (c) 2003 INRIA Sophia-Antipolis (France). // All rights reserved. // // This file is part of CGAL (www.cgal.org); you may redistribute it under diff --git a/Packages/Interpolation/include/CGAL/natural_neighbor_coordinates_2.h b/Packages/Interpolation/include/CGAL/natural_neighbor_coordinates_2.h index 90c2026b880..b0c4ebbc1c0 100644 --- a/Packages/Interpolation/include/CGAL/natural_neighbor_coordinates_2.h +++ b/Packages/Interpolation/include/CGAL/natural_neighbor_coordinates_2.h @@ -34,7 +34,7 @@ CGAL_BEGIN_NAMESPACE // const typename Traits::Point_2& p, // OutputIterator out, const Traits& traits, // typename Dt::Face_handle start -// = typename Dt::Face_handle(NULL)) +// = typename Dt::Face_handle()) // //template //Triple< OutputIterator, typename Traits::FT, bool > @@ -47,7 +47,7 @@ Triple< OutputIterator, typename Dt::Geom_traits::FT, bool > natural_neighbor_coordinates_2(const Dt& dt, const typename Dt::Geom_traits::Point_2& p, OutputIterator out, typename Dt::Face_handle start - = typename Dt::Face_handle(NULL)) + = typename Dt::Face_handle()) { typedef typename Dt::Geom_traits Traits; diff --git a/Packages/Interpolation/include/CGAL/predicates/predicates_for_voronoi_intersection_cartesian_2_3.h b/Packages/Interpolation/include/CGAL/predicates/predicates_for_voronoi_intersection_cartesian_2_3.h index beaa80b7c95..aa182509853 100644 --- a/Packages/Interpolation/include/CGAL/predicates/predicates_for_voronoi_intersection_cartesian_2_3.h +++ b/Packages/Interpolation/include/CGAL/predicates/predicates_for_voronoi_intersection_cartesian_2_3.h @@ -1,4 +1,4 @@ -// Copyright (c) 1997 INRIA Sophia-Antipolis (France). +// Copyright (c) 2003 INRIA Sophia-Antipolis (France). // All rights reserved. // // This file is part of CGAL (www.cgal.org); you may redistribute it under diff --git a/Packages/Interpolation/include/CGAL/regular_neighbor_coordinates_2.h b/Packages/Interpolation/include/CGAL/regular_neighbor_coordinates_2.h index 8fa84bbbebb..d728426393e 100644 --- a/Packages/Interpolation/include/CGAL/regular_neighbor_coordinates_2.h +++ b/Packages/Interpolation/include/CGAL/regular_neighbor_coordinates_2.h @@ -38,7 +38,7 @@ regular_neighbor_coordinates_2(const Rt& rt, Weighted_point& p, OutputIterator out){ return regular_neighbor_coordinates_2(rt, p, out, - typename Rt::Face_handle(NULL)); + typename Rt::Face_handle()); }; //Face_handle start is known: template diff --git a/Packages/Interpolation/include/CGAL/sibson_gradient_fitting.h b/Packages/Interpolation/include/CGAL/sibson_gradient_fitting.h index 16b672c8621..cb245aca98f 100644 --- a/Packages/Interpolation/include/CGAL/sibson_gradient_fitting.h +++ b/Packages/Interpolation/include/CGAL/sibson_gradient_fitting.h @@ -1,4 +1,4 @@ -// Copyright (c) 1997 INRIA Sophia-Antipolis (France). +// Copyright (c) 2003 INRIA Sophia-Antipolis (France). // All rights reserved. // // This file is part of CGAL (www.cgal.org); you may redistribute it under diff --git a/Packages/Interpolation/include/CGAL/surface_neighbor_coordinates_3.h b/Packages/Interpolation/include/CGAL/surface_neighbor_coordinates_3.h index 5fa5e918c84..2ff36283450 100644 --- a/Packages/Interpolation/include/CGAL/surface_neighbor_coordinates_3.h +++ b/Packages/Interpolation/include/CGAL/surface_neighbor_coordinates_3.h @@ -1,4 +1,4 @@ -// Copyright (c) 1997 INRIA Sophia-Antipolis (France). +// Copyright (c) 2003 INRIA Sophia-Antipolis (France). // All rights reserved. // // This file is part of CGAL (www.cgal.org); you may redistribute it under @@ -35,7 +35,7 @@ CGAL_BEGIN_NAMESPACE //------------------------------------------------------------------- template -std::pair< OutputIterator, typename Kernel::FT > +Triple< OutputIterator, typename Kernel::FT, bool > surface_neighbor_coordinates_3(InputIterator first, InputIterator beyond, const typename Kernel::Point_3& p, @@ -50,7 +50,7 @@ surface_neighbor_coordinates_3(InputIterator template -std::pair< OutputIterator, typename ITraits::FT > +Triple< OutputIterator, typename ITraits::FT, bool > surface_neighbor_coordinates_3(InputIterator first, InputIterator beyond, const typename ITraits::Point_2& p, @@ -65,7 +65,7 @@ surface_neighbor_coordinates_3(InputIterator it.insert(first,beyond); return - regular_neighbor_coordinates_2(it, p, out, traits); + regular_neighbor_coordinates_2(it, p, out); } @@ -75,7 +75,7 @@ surface_neighbor_coordinates_3(InputIterator // Voronoi cell of p is not affected by any point outside the smallest // ball centered on p containing all points in [first,beyond) template -Triple< OutputIterator, typename Kernel::FT, bool > +Quadruple< OutputIterator, typename Kernel::FT, bool, bool > surface_neighbor_coordinates_certified_3(InputIterator first, InputIterator beyond, const typename Kernel::Point_3& p, @@ -92,7 +92,7 @@ surface_neighbor_coordinates_certified_3(InputIterator // containing the points in [first, beyond] (i.e. the maximal // distance from p to [first,beyond) as add. parameter: template -Triple< OutputIterator, typename Kernel::FT, bool > +Quadruple< OutputIterator, typename Kernel::FT, bool, bool > surface_neighbor_coordinates_certified_3(InputIterator first, InputIterator beyond, const typename Kernel::Point_3& p, @@ -132,7 +132,7 @@ private: }; // Versions with instantiated traits class: template -Triple< OutputIterator, typename ITraits::FT, bool > +Quadruple< OutputIterator, typename ITraits::FT, bool, bool > surface_neighbor_coordinates_certified_3(InputIterator first, InputIterator beyond, const typename ITraits::Point_2& p, @@ -154,7 +154,7 @@ surface_neighbor_coordinates_certified_3(InputIterator //with radius(maximal distance from p to [first,beyond)) as // add. parameter: template -Triple< OutputIterator, typename ITraits::FT, bool > +Quadruple< OutputIterator, typename ITraits::FT, bool, bool > surface_neighbor_coordinates_certified_3(InputIterator first, InputIterator beyond, const typename @@ -175,9 +175,13 @@ surface_neighbor_coordinates_certified_3(InputIterator //determine the furthest distance from p to the boundary of its cell std::vector< typename ITraits::Point_2 > vor_vertices; - std::pair< OutputIterator, typename ITraits::FT > + //unfortunately, there is no function call without Face_handle + // "start" because this would cause type conflicts because + // of resembling function signatures (-> default constructor) + Triple< OutputIterator, typename ITraits::FT, bool > res = regular_neighbor_coordinates_2 - (it, p, out, std::back_inserter(vor_vertices),traits); + (it, p, out, std::back_inserter(vor_vertices), + typename I_triangulation::Face_handle()); typename ITraits::Point_2 furthest = *std::max_element(vor_vertices.begin(), vor_vertices.end(), @@ -187,9 +191,9 @@ surface_neighbor_coordinates_certified_3(InputIterator // might be found: return false if(radius < 4* traits.compute_squared_distance_2_object() (p, furthest)) - return make_triple(res.first, res.second, false); + return make_quadruple(res.first, res.second, res.third, false); - return make_triple(res.first, res.second, true); + return make_quadruple(res.first, res.second,res.third, true); } //Sylvain: //this class should probably be moved to CGAL/function_objects.h @@ -214,14 +218,14 @@ struct Project_vertex_iterator_to_point { //using Delaunay triangulation for candidate point filtering: // => no certification is necessary template -std::pair< OutputIterator, typename Dt::Geom_traits::FT > +Triple< OutputIterator, typename Dt::Geom_traits::FT, bool > surface_neighbor_coordinates_3(const Dt& dt, const typename Dt::Geom_traits::Point_3& p, const typename Dt::Geom_traits::Vector_3& normal, OutputIterator out, typename Dt::Cell_handle start - = typename Dt::Cell_handle(NULL)){ + = typename Dt::Cell_handle()){ typedef Voronoi_intersection_2_traits_3 I_gt; return surface_neighbor_coordinates_3(dt, p, out, I_gt(p,normal),start); @@ -229,12 +233,12 @@ surface_neighbor_coordinates_3(const Dt& dt, }; template -std::pair< OutputIterator, typename ITraits::FT > +Triple< OutputIterator, typename ITraits::FT, bool > surface_neighbor_coordinates_3(const Dt& dt, const typename ITraits::Point_2& p, OutputIterator out, const ITraits& traits, typename Dt::Cell_handle start - = typename Dt::Cell_handle(NULL)){ + = typename Dt::Cell_handle()){ typedef typename ITraits::FT Coord_type; typedef typename ITraits::Point_2 Point_3; @@ -262,7 +266,7 @@ surface_neighbor_coordinates_3(const Dt& dt, if(lt == Dt::VERTEX){ *out++= std::make_pair(c->vertex(li)->point(), Coord_type(1)); - return( std::make_pair(out, Coord_type(1))); + return( make_triple(out, Coord_type(1), true)); } //the candidate points are the points of dt in conflict with p: diff --git a/Packages/Interpolation/include/CGAL/surface_neighbors_3.h b/Packages/Interpolation/include/CGAL/surface_neighbors_3.h index 8009bb51799..1027565c884 100644 --- a/Packages/Interpolation/include/CGAL/surface_neighbors_3.h +++ b/Packages/Interpolation/include/CGAL/surface_neighbors_3.h @@ -1,4 +1,4 @@ -// Copyright (c) 1997 INRIA Sophia-Antipolis (France). +// Copyright (c) 2003 INRIA Sophia-Antipolis (France). // All rights reserved. // // This file is part of CGAL (www.cgal.org); you may redistribute it under @@ -208,7 +208,7 @@ surface_neighbors_3(const Dt& dt, normal, OutputIterator out, typename Dt::Cell_handle start - = typename Dt::Cell_handle(NULL)){ + = typename Dt::Cell_handle()){ typedef Voronoi_intersection_2_traits_3 I_gt; return surface_neighbors_3(dt, p, out, I_gt(p,normal),start); @@ -221,7 +221,7 @@ surface_neighbors_3(const Dt& dt, const typename ITraits::Point_2& p, OutputIterator out, const ITraits& traits, typename Dt::Cell_handle start - = typename Dt::Cell_handle(NULL)){ + = typename Dt::Cell_handle()){ typedef typename ITraits::FT Coord_type; typedef typename ITraits::Point_2 Point_3; diff --git a/Packages/Interpolation/test/Interpolation/include/CGAL/_test_surface_neighbors_3.C b/Packages/Interpolation/test/Interpolation/include/CGAL/_test_surface_neighbors_3.C index 4448dd671d6..a4dedd22560 100644 --- a/Packages/Interpolation/test/Interpolation/include/CGAL/_test_surface_neighbors_3.C +++ b/Packages/Interpolation/test/Interpolation/include/CGAL/_test_surface_neighbors_3.C @@ -202,11 +202,11 @@ test_coords(const Triangul& T, const typename Triangul::Geom_traits> I_traits; //coordinate computation result types - typedef std::pair< OutputIterator, - typename Triangul::Geom_traits::FT > Result_pair; - //the result type of the certified version: typedef CGAL::Triple< OutputIterator, typename Triangul::Geom_traits::FT, bool > Result_triple; + //the result type of the certified version: + typedef CGAL::Quadruple< OutputIterator, + typename Triangul::Geom_traits::FT, bool, bool > Result_quadruple; typename Triangul::Cell_handle start; @@ -214,54 +214,59 @@ test_coords(const Triangul& T, const typename //test different function calls switch(version){ case 0:{ - Result_pair result + Result_triple result = CGAL::surface_neighbor_coordinates_3(T, p,n,out); + assert(result.third); norm = result.second; break;} case 1: { - Result_pair result = + Result_triple result = CGAL::surface_neighbor_coordinates_3(T, p,out,I_traits(p,n)); + assert(result.third); norm = result.second; break;} //both versions with locate: case 2:{ start = T.locate(p); - Result_pair result = CGAL::surface_neighbor_coordinates_3(T, p,n, + Result_triple result = CGAL::surface_neighbor_coordinates_3(T, p,n, out, start); + assert(result.third); norm = result.second; break;} case 3: { start = T.locate(p); - Result_pair result = - CGAL::surface_neighbor_coordinates_3(T, p,out, I_traits(p,n),start); - + Result_triple result = + CGAL::surface_neighbor_coordinates_3(T, p,out, I_traits(p,n),start); + assert(result.third); norm = result.second; break;} //taking all points: case 4: { - Result_pair result + Result_triple result = CGAL::surface_neighbor_coordinates_3(T.points_begin(), T.points_end(),p,n, out, T.geom_traits()); + assert(result.third); norm = result.second; break;} case 5: { - Result_pair result + Result_triple result = CGAL::surface_neighbor_coordinates_3(T.points_begin(), T.points_end(),p, out ,I_traits(p,n)); + assert(result.third); norm = result.second; break;} //the last two with certification: case 6: { - Result_triple + Result_quadruple result = CGAL::surface_neighbor_coordinates_certified_3 (T.points_begin(), T.points_end(),p,n, out, T.geom_traits()); - assert(result.third); + assert(result.third && result.fourth); norm = result.second; break; } case 7: { - Result_triple + Result_quadruple result = CGAL::surface_neighbor_coordinates_certified_3 (T.points_begin(), T.points_end(),p, out ,I_traits(p,n)); - assert(result.third); + assert(result.third && result.fourth); norm = result.second; break; } @@ -270,7 +275,7 @@ test_coords(const Triangul& T, const typename std::endl; } assert(norm>0); - + return std::make_pair(out,norm); } diff --git a/Packages/Interpolation/test/Interpolation/test_regular_neighbors_2.C b/Packages/Interpolation/test/Interpolation/test_regular_neighbors_2.C index 790fcabdabb..7e2f677f94b 100644 --- a/Packages/Interpolation/test/Interpolation/test_regular_neighbors_2.C +++ b/Packages/Interpolation/test/Interpolation/test_regular_neighbors_2.C @@ -24,7 +24,7 @@ #include #include -#include +#include #include #include @@ -33,7 +33,7 @@ struct K : CGAL::Exact_predicates_exact_constructions_kernel {}; typedef double W; -typedef CGAL::Regular_neighbor_coordinates_traits_2 Gt1; +typedef CGAL::Regular_triangulation_euclidean_traits_2 Gt1; typedef CGAL::Regular_triangulation_2 Rt1; int main()