Doc improvements

This commit is contained in:
Mael Rouxel-Labbé 2018-02-14 11:57:28 +01:00
parent 0f787d4b28
commit 10c073b8df
12 changed files with 113 additions and 119 deletions

View File

@ -66,26 +66,27 @@ std::pair<Data_type, bool> operator()(const Key_type& p);
The function `linear_interpolation()` computes the weighted sum of the function The function `linear_interpolation()` computes the weighted sum of the function
values which must be provided via a functor. values which must be provided via a functor.
\tparam CoordinateIterator must be a model of `ForwardIterator` and \tparam CoordinateInputIterator must be a model of `ForwardIterator` and
must have as value type a pair associating an entity, e.g. the `Vertex_handle` or `Point` must have as value type a pair associating an entity, e.g. the `Vertex_handle` or `Point`
types of a triangulation, to a (non-normalized) barycentric coordinate. types of a triangulation, to a (non-normalized) barycentric coordinate.
\tparam ValueFunctor must be a functor such that `ValueFunctor::result_type` \tparam ValueFunctor must be a functor where `ValueFunctor::argument_type` must be equivalent to
is a pair of the function value type and a Boolean value. `std::iterator_traits<CoordinateInputIterator>::%value_type::first_type` and
The function value type must provide a multiplication and addition operation with the field number type `ValueFunctor::result_type` is a pair of the function value type and a Boolean.
`std::iterator_traits<CoordinateIterator>::%value_type::second_type` and a constructor The function value type must provide a multiplication and addition operation with the type
with argument `0`. <br> `Traits::FT` as well as a constructor with argument `0`.
A model of this functor is provided by the struct `CGAL::Data_access` instantiated
A model of the functor `ValueFunctor` is provided by the struct `CGAL::Data_access` instantiated
with an associative container (e.g. `std::map`) and having: with an associative container (e.g. `std::map`) and having:
- `std::iterator_traits<CoordinateIterator>::%value_type::first_type` (the entity type) as `key_type` - `std::iterator_traits<CoordinateInputIterator>::%value_type::first_type` (the entity type) as `key_type`
- `std::iterator_traits<CoordinateIterator>::%value_type::second_type` (the coordinate type) as `mapped_type`. - `std::iterator_traits<CoordinateInputIterator>::%value_type::second_type` (the coordinate type) as `mapped_type`.
The two template parameters must satisfy the following conditions: The two template parameters must satisfy the following conditions:
- `std::iterator_traits<CoordinateIterator>::%value_type::first_type` (the entity type) is equivalent to a - `std::iterator_traits<CoordinateInputIterator>::%value_type::first_type` (the entity type) is equivalent to a
`ValueFunctor::argument_type`. `ValueFunctor::argument_type`.
- `std::iterator_traits<CoordinateIterator>::%value_type::second_type` (the coordinate type) is a field number type - `std::iterator_traits<CoordinateInputIterator>::%value_type::second_type` (the coordinate type) is a field number type
that is equivalent to `ValueFunctor::result_type::first_type`. that is equivalent to `ValueFunctor::result_type::first_type`.
For example, if `CoordinateIterator` is an output iterator with value type For example, if `CoordinateInputIterator` is an iterator with value type
`std::pair<Vertex_handle, double>`, then the `ValueFunctor` must have argument `std::pair<Vertex_handle, double>`, then the `ValueFunctor` must have argument
type `Vertex_handle` (or convertible to) and return type `std::pair<double, bool>`. type `Vertex_handle` (or convertible to) and return type `std::pair<double, bool>`.
@ -105,10 +106,10 @@ corresponding to each entry of the entity/coordinate pairs in the range `[first,
\sa `PkgInterpolationRegularNeighborCoordinates2` \sa `PkgInterpolationRegularNeighborCoordinates2`
\sa `PkgInterpolationSurfaceNeighborCoordinates3` \sa `PkgInterpolationSurfaceNeighborCoordinates3`
*/ */
template < class CoordinateIterator, class ValueFunctor > template < class CoordinateInputIterator, class ValueFunctor >
typename ValueFunctor::result_type::first_type typename ValueFunctor::result_type::first_type
linear_interpolation(CoordinateIterator first, CoordinateIterator beyond, linear_interpolation(CoordinateInputIterator first, CoordinateInputIterator beyond,
const typename std::iterator_traits<CoordinateIterator>::value_type::second_type& norm, const typename std::iterator_traits<CoordinateInputIterator>::value_type::second_type& norm,
ValueFunctor value_function); ValueFunctor value_function);
/*! /*!
@ -126,30 +127,30 @@ Otherwise, the second value will be `false`.
\tparam Traits must be a model of `InterpolationTraits`. \tparam Traits must be a model of `InterpolationTraits`.
Note that, contrary to some other interpolation methods, the number type `FT` provided Note that, contrary to some other interpolation methods, the number type `FT` provided
by `Traits` does not need to provide the square root operation. by `Traits` does not need to provide the square root operation.
\tparam CoordinateIterator must be a model of `ForwardIterator` and must have as \tparam CoordinateInputIterator must be a model of `ForwardIterator` and must have as
value type a pair associating an entity to a (non-normalized) barycentric coordinate. value type a pair associating an entity to a (non-normalized) barycentric coordinate.
More precisely, `std::iterator_traits<CoordinateIterator>::%value_type::first_type` More precisely, `std::iterator_traits<CoordinateInputIterator>::%value_type::first_type`
can be of the following types: can be of the following types:
<ul> <ul>
<li> a type equivalent to `Traits::Point_d` or `Traits::Weighted_point_d` </li> <li> a type equivalent to `Traits::Point_d` or `Traits::Weighted_point_d` </li>
<li> an iterator type providing a `point()` function returning a type equivalent to `Traits::Point_d` or `Traits::Weighted_point_d`; </li> <li> an iterator type providing a `point()` function returning a type equivalent to `Traits::Point_d` or `Traits::Weighted_point_d`; </li>
</ul> </ul>
and `std::iterator_traits<CoordinateIterator>::%value_type::second_type` must be equivalent to and `std::iterator_traits<CoordinateInputIterator>::%value_type::second_type` must be equivalent to
`Traits::FT`. `Traits::FT`.
\tparam ValueFunctor must be a functor where `ValueFunctor::argument_type` must be equivalent to \tparam ValueFunctor must be a functor where `ValueFunctor::argument_type` must be equivalent to
`std::iterator_traits<CoordinateIterator>::%value_type::first_type` and `std::iterator_traits<CoordinateInputIterator>::%value_type::first_type` and
`ValueFunctor::result_type` is a pair of the function value type and a Boolean. `ValueFunctor::result_type` is a pair of the function value type and a Boolean.
The function value type must provide a multiplication and addition operation with the type The function value type must provide a multiplication and addition operation with the type
`Traits::FT` as well as a constructor with argument `0`. `Traits::FT` as well as a constructor with argument `0`.
\tparam GradFunctor must be a functor where `GradFunctor::argument_type` must be equivalent to \tparam GradFunctor must be a functor where `GradFunctor::argument_type` must be equivalent to
`std::iterator_traits<CoordinateIterator>::%value_type::first_type` and `std::iterator_traits<CoordinateInputIterator>::%value_type::first_type` and
`Functor::result_type` is a pair of the function's gradient type and a Boolean. `Functor::result_type` is a pair of the function's gradient type and a Boolean.
The function gradient type must provide a multiplication operation with `Traits::Vector_d`. The function gradient type must provide a multiplication operation with `Traits::Vector_d`.
\tparam Point must be equivalent to `Traits::Point_d` or `Traits::Weighted_point_d`. \tparam Point must be equivalent to `Traits::Point_d` or `Traits::Weighted_point_d`.
A model of the functor types `ValueFunctor` (resp. `GradFunctor`) is provided A model of the functor types `ValueFunctor` (resp. `GradFunctor`) is provided
by the struct `CGAL::Data_access`. It must be instantiated accordingly with an associative container by the struct `CGAL::Data_access`. It must be instantiated accordingly with an associative container
(e.g. `std::map`) having `std::iterator_traits<CoordinateIterator>::%value_type::first_type` as `key_type` (e.g. `std::map`) having `std::iterator_traits<CoordinateInputIterator>::%value_type::first_type` as `key_type`
and the function value type (resp. the function gradient type) as `mapped_type`. and the function value type (resp. the function gradient type) as `mapped_type`.
\param first, beyond is the iterator range of the barycentric coordinates for the query point `p`. \param first, beyond is the iterator range of the barycentric coordinates for the query point `p`.
@ -170,10 +171,10 @@ the function returns a pair where the Boolean is set to `false`.
\sa `PkgInterpolationRegularNeighborCoordinates2` \sa `PkgInterpolationRegularNeighborCoordinates2`
\sa `PkgInterpolationSurfaceNeighborCoordinates3` \sa `PkgInterpolationSurfaceNeighborCoordinates3`
*/ */
template < class CoordinateIterator, class ValueFunctor, class GradFunctor, class Traits, class Point > template < class CoordinateInputIterator, class ValueFunctor, class GradFunctor, class Traits, class Point >
typename ValueFunctor::result_type typename ValueFunctor::result_type
quadratic_interpolation(CoordinateIterator first, CoordinateIterator beyond, quadratic_interpolation(CoordinateInputIterator first, CoordinateInputIterator beyond,
const typename std::iterator_traits<CoordinateIterator>::value_type::second_type& norm, const typename std::iterator_traits<CoordinateInputIterator>::value_type::second_type& norm,
const Point& p, const Point& p,
ValueFunctor value_function, ValueFunctor value_function,
GradFunctor gradient_function, GradFunctor gradient_function,
@ -192,30 +193,30 @@ Otherwise, `false` is returned as second value.
\tparam Traits must be a model of `InterpolationTraits`. \tparam Traits must be a model of `InterpolationTraits`.
The number type `FT` provided by `Traits` must support the square root operation `sqrt()`. The number type `FT` provided by `Traits` must support the square root operation `sqrt()`.
\tparam CoordinateIterator must be a model of `ForwardIterator` and must have as \tparam CoordinateInputIterator must be a model of `ForwardIterator` and must have as
value type a pair associating an entity to a (non-normalized) barycentric coordinate. value type a pair associating an entity to a (non-normalized) barycentric coordinate.
More precisely, `std::iterator_traits<CoordinateIterator>::%value_type::first_type` More precisely, `std::iterator_traits<CoordinateInputIterator>::%value_type::first_type`
can be of the following types: can be of the following types:
<ul> <ul>
<li> a type equivalent to `Traits::Point_d` or `Traits::Weighted_point_d` </li> <li> a type equivalent to `Traits::Point_d` or `Traits::Weighted_point_d` </li>
<li> an iterator type providing a `point()` function returning a type equivalent to `Traits::Point_d` or `Traits::Weighted_point_d`; </li> <li> an iterator type providing a `point()` function returning a type equivalent to `Traits::Point_d` or `Traits::Weighted_point_d`; </li>
</ul> </ul>
and `std::iterator_traits<CoordinateIterator>::%value_type::second_type` must be equivalent to and `std::iterator_traits<CoordinateInputIterator>::%value_type::second_type` must be equivalent to
`Traits::FT`. `Traits::FT`.
\tparam ValueFunctor must be a functor where `ValueFunctor::argument_type` must be equivalent to \tparam ValueFunctor must be a functor where `ValueFunctor::argument_type` must be equivalent to
`std::iterator_traits<CoordinateIterator>::%value_type::first_type` and `std::iterator_traits<CoordinateInputIterator>::%value_type::first_type` and
`ValueFunctor::result_type` is a pair of the function value type and a Boolean. `ValueFunctor::result_type` is a pair of the function value type and a Boolean.
The function value type must provide a multiplication and addition operation with the type The function value type must provide a multiplication and addition operation with the type
`Traits::FT` as well as a constructor with argument `0`. `Traits::FT` as well as a constructor with argument `0`.
\tparam GradFunctor must be a functor where `GradFunctor::argument_type` must be equivalent to \tparam GradFunctor must be a functor where `GradFunctor::argument_type` must be equivalent to
`std::iterator_traits<CoordinateIterator>::%value_type::first_type` and `std::iterator_traits<CoordinatetCoordinateInputIteratorIterator>::%value_type::first_type` and
`Functor::result_type` is a pair of the function's gradient type and a Boolean. `Functor::result_type` is a pair of the function's gradient type and a Boolean.
The function gradient type must provide a multiplication operation with `Traits::Vector_d`. The function gradient type must provide a multiplication operation with `Traits::Vector_d`.
\tparam Point must be equivalent to `Traits::Point_d` or `Traits::Weighted_point_d`. \tparam Point must be equivalent to `Traits::Point_d` or `Traits::Weighted_point_d`.
A model of the functor types `ValueFunctor` (resp. `GradFunctor`) is provided A model of the functor types `ValueFunctor` (resp. `GradFunctor`) is provided
by the struct `CGAL::Data_access`. It must be instantiated accordingly with an associative container by the struct `CGAL::Data_access`. It must be instantiated accordingly with an associative container
(e.g. `std::map`) having `std::iterator_traits<CoordinateIterator>::%value_type::first_type` as `key_type` (e.g. `std::map`) having `std::iterator_traits<CoordinateInputIterator>::%value_type::first_type` as `key_type`
and the function value type (resp. the function gradient type) as `mapped_type`. and the function value type (resp. the function gradient type) as `mapped_type`.
\param first, beyond is the iterator range of the barycentric coordinates for the query point `p`. \param first, beyond is the iterator range of the barycentric coordinates for the query point `p`.
@ -236,10 +237,10 @@ the function returns a pair where the Boolean is set to `false`.
\sa `PkgInterpolationRegularNeighborCoordinates2` \sa `PkgInterpolationRegularNeighborCoordinates2`
\sa PkgInterpolationSurfaceNeighborCoordinates3 \sa PkgInterpolationSurfaceNeighborCoordinates3
*/ */
template < class ForwardIterator, class ValueFunctor, class GradFunctor, class Traits, class Point > template < class CoordinateInputIterator, class ValueFunctor, class GradFunctor, class Traits, class Point >
std::pair<typename ValueFunctor::result_type, bool> std::pair<typename ValueFunctor::result_type, bool>
sibson_c1_interpolation(CoordinateIterator first, CoordinateIterator beyond, sibson_c1_interpolation(CoordinateInputIterator first, CoordinateInputIterator beyond,
const typename std::iterator_traits<CoordinateIterator>::value_type::second_type& norm, const typename std::iterator_traits<CoordinateInputIterator>::value_type::second_type& norm,
const Point& p, const Point& p,
ValueFunctor value_function, ValueFunctor value_function,
GradFunctor gradient_function, GradFunctor gradient_function,
@ -248,15 +249,15 @@ sibson_c1_interpolation(CoordinateIterator first, CoordinateIterator beyond,
/*! /*!
\ingroup PkgInterpolation2Interpolation \ingroup PkgInterpolation2Interpolation
The same as `sibson_c1_interpolation()`, except that no square root operation is required Same as `sibson_c1_interpolation()`, except that no square root operation is required
for the number type `Traits::FT`. for the number type `Traits::FT`.
\sa `CGAL::sibson_c1_interpolation()` \sa `CGAL::sibson_c1_interpolation()`
*/ */
template < class CoordinateIterator, class ValueFunctor, class GradFunctor, class Traits, class Point > template < class CoordinateInputIterator, class ValueFunctor, class GradFunctor, class Traits, class Point >
typename ValueFunctor::result_type typename ValueFunctor::result_type
sibson_c1_interpolation_square(CoordinateIterator first, CoordinateIterator beyond, sibson_c1_interpolation_square(CoordinateInputIterator first, CoordinateInputIterator beyond,
const typename std::iterator_traits<CoordinateIterator>::value_type::second_type& norm, const typename std::iterator_traits<CoordinateInputIterator>::value_type::second_type& norm,
const Point& p, const Point& p,
ValueFunctor value_function, ValueFunctor value_function,
GradFunctor gradient_function, GradFunctor gradient_function,
@ -265,7 +266,7 @@ sibson_c1_interpolation_square(CoordinateIterator first, CoordinateIterator beyo
/*! /*!
\ingroup PkgInterpolation2Interpolation \ingroup PkgInterpolation2Interpolation
generates the interpolated function value computed by Farin's interpolant. Generates the interpolated function value computed by Farin's interpolant.
\cgalHeading{Requirements} \cgalHeading{Requirements}
@ -279,10 +280,10 @@ gradients that are provided by functors using the method described in \cgalCite{
\sa `CGAL::sibson_c1_interpolation()` \sa `CGAL::sibson_c1_interpolation()`
*/ */
template < class CoordinateIterator, class ValueFunctor, class GradFunctor, class Traits, class Point> template < class CoordinateInputIterator, class ValueFunctor, class GradFunctor, class Traits, class Point>
typename ValueFunctor::result_type typename ValueFunctor::result_type
farin_c1_interpolation(CoordinateIterator first, CoordinateIterator beyond, farin_c1_interpolation(CoordinateInputIterator first, CoordinateInputIterator beyond,
const typename std::iterator_traits<CoordinateIterator>::value_type::second_type& norm, const typename std::iterator_traits<CoordinateInputIterator>::value_type::second_type& norm,
const Point& p, const Point& p,
ValueFunctor value_function, ValueFunctor value_function,
GradFunctor gradient_function, GradFunctor gradient_function,

View File

@ -51,17 +51,15 @@ must then have value type `std::pair<Dt::Point, Dt::Geom_traits::FT>`.
/// @{ /// @{
/*! /*!
computes the natural neighbor coordinates for `p` with respect to the points Computes the natural neighbor coordinates for `p` with respect to the points
in the two-dimensional Delaunay triangulation `dt`. in the two-dimensional Delaunay triangulation `dt`.
\tparam Dt must be of type `Delaunay_triangulation_2<Traits, Tds>`. \tparam Dt must be of type `Delaunay_triangulation_2<Traits, Tds>`.
`Traits` must be a model of the concepts `DelaunayTriangulationTraits_2` and `PolygonTraits_2`. `Traits` must be a model of the concepts `DelaunayTriangulationTraits_2` and `PolygonTraits_2`.
\tparam CoordinateOutputIterator must be a model of `OutputIterator` and have the value type OutputFunctor::result_type. \tparam CoordinateOutputIterator must be a model of `OutputIterator` and have the value type `OutputFunctor::result_type`.
The output computed by the function is placed starting at `out`. The output computed by the function is placed starting at `out`.
\tparam OutputFunctor must be a functor with argument type `std::pair<Dt::Vertex_handle, Dt::Geom_traits::FT>`. \tparam OutputFunctor must be a functor with argument type `std::pair<Dt::Vertex_handle, Dt::Geom_traits::FT>`.
See \link PkgInterpolationNaturalNeighborCoordinates2 above \endlink for a detailed explanation on the usage of `OutputFunctor`.
See \link PkgInterpolationNaturalNeighborCoordinates2 above \endlink
for a detailed explanation on the usage of `OutputFunctor`.
\param dt is the Delaunay triangulation. \param dt is the Delaunay triangulation.
\param p is the query point. \param p is the query point.
@ -70,7 +68,7 @@ for a detailed explanation on the usage of `OutputFunctor`.
\param start is an optional argument that is used as a hint of where the locate process has to start its search. \param start is an optional argument that is used as a hint of where the locate process has to start its search.
\return A triple consisting of: \return A triple consisting of:
- a sequence of object of types OutputFunctor::result_type, starting at `out`. - a sequence of objects of types `OutputFunctor::result_type`, starting at `out`.
- the normalization factor of the coordinates. - the normalization factor of the coordinates.
- a Boolean value which is set to `true` if the coordinate computation was successful, - a Boolean value which is set to `true` if the coordinate computation was successful,
and `false` otherwise. and `false` otherwise.
@ -84,7 +82,7 @@ natural_neighbor_coordinates_2(const Dt& dt,
typename Dt::Face_handle start = typename Dt::Face_handle()); typename Dt::Face_handle start = typename Dt::Face_handle());
/*! /*!
computes the natural neighbor coordinates for `p` with respect to the points Computes the natural neighbor coordinates for `p` with respect to the points
in the two-dimensional Delaunay triangulation `dt`. in the two-dimensional Delaunay triangulation `dt`.
The iterator range `[hole_begin, hole_end)` determines the boundary edges The iterator range `[hole_begin, hole_end)` determines the boundary edges
@ -104,7 +102,7 @@ natural_neighbor_coordinates_2(const Dt& dt,
EdgeIterator hole_begin, EdgeIterator hole_end); EdgeIterator hole_begin, EdgeIterator hole_end);
/*! /*!
computes the natural neighbor coordinates of the point `vh->point()` Computes the natural neighbor coordinates of the point `vh->point()`
with respect to the vertices of `dt` excluding `vh->point()`. with respect to the vertices of `dt` excluding `vh->point()`.
\cgalHeading{Requirements} \cgalHeading{Requirements}

View File

@ -21,7 +21,7 @@ computed and the third value of the result triple is set to `false`.
\cgalHeading{Output Format} \cgalHeading{Output Format}
The return type is identical for all overloads of `CGAL::regular_neighbor_coordinates_2()`: The return type is identical for all overloads of `CGAL::regular_neighbor_coordinates_2()`:
it is `CGAL::Triple<CoordinateIterator, Rt::Geom_traits::FT, bool >` it is `CGAL::Triple<CoordinateOutputIterator, Rt::Geom_traits::FT, bool >`
Regular neighbor coordinates are output in the first value of the triple, Regular neighbor coordinates are output in the first value of the triple,
using an output iterator (see the concept `OutputIterator`). using an output iterator (see the concept `OutputIterator`).
@ -51,12 +51,12 @@ must then have value type `std::pair<Rt::Weighted_point, Rt::Geom_traits::FT>`.
/// @{ /// @{
/*! /*!
computes the regular neighbor coordinates for `p` with respect Computes the regular neighbor coordinates for `p` with respect
to the weighted points in the two-dimensional regular triangulation `rt`. to the weighted points in the two-dimensional regular triangulation `rt`.
\tparam Rt must be a `Regular_triangulation_2<Traits, Tds>`. \tparam Rt must be a `Regular_triangulation_2<Traits, Tds>`.
`Traits` must be a model of the concepts `RegularTriangulationTraits_2` and `PolygonTraits_2`. `Traits` must be a model of the concepts `RegularTriangulationTraits_2` and `PolygonTraits_2`.
\tparam CoordinateOutputIterator must be a model of `OutputIterator` and have the value type OutputFunctor::result_type. \tparam CoordinateOutputIterator must be a model of `OutputIterator` and have the value type `OutputFunctor::result_type`.
The output computed by the function is placed starting at `out`. The output computed by the function is placed starting at `out`.
\tparam OutputFunctor must be a functor with argument type `std::pair<Rt::Vertex_handle, Rt::Geom_traits::FT>`. \tparam OutputFunctor must be a functor with argument type `std::pair<Rt::Vertex_handle, Rt::Geom_traits::FT>`.
@ -70,7 +70,7 @@ for a detailed explanation on the usage of `OutputFunctor`.
\param start is an optional argument that is used as a hint of where the locate process has to start its search. \param start is an optional argument that is used as a hint of where the locate process has to start its search.
\return A triple consisting of: \return A triple consisting of:
- a sequence of object of types OutputFunctor::result_type, starting at `out`. - a sequence of objects of types `OutputFunctor::result_type`, starting at `out`.
- the normalization factor of the coordinates. - the normalization factor of the coordinates.
- a Boolean value which is set to `true` if the coordinate computation was successful, - a Boolean value which is set to `true` if the coordinate computation was successful,
and `false` otherwise. and `false` otherwise.
@ -89,7 +89,7 @@ regular_neighbor_coordinates_2(const Rt& rt,
typename Rt::Face_handle start = typename Rt::Face_handle()); typename Rt::Face_handle start = typename Rt::Face_handle());
/*! /*!
computes the regular neighbor coordinates for `p` with respect Computes the regular neighbor coordinates for `p` with respect
to the weighted points in the two-dimensional regular triangulation `rt`. to the weighted points in the two-dimensional regular triangulation `rt`.
The iterator range `[hole_begin, hole_end)` determines the boundary edges The iterator range `[hole_begin, hole_end)` determines the boundary edges
@ -115,7 +115,7 @@ regular_neighbor_coordinates_2(const Rt& rt,
VertexIterator hidden_vertices_begin, VertexIterator hidden_vertices_end); VertexIterator hidden_vertices_begin, VertexIterator hidden_vertices_end);
/*! /*!
computes the regular neighbor coordinates of the point `vh->point()` with respect Computes the regular neighbor coordinates of the point `vh->point()` with respect
to the vertices of `rt` excluding `vh->point()`. to the vertices of `rt` excluding `vh->point()`.
\cgalHeading{Requirements} \cgalHeading{Requirements}

View File

@ -32,25 +32,20 @@ which use the same mechanism to allow flexible output.
/// @{ /// @{
/*! /*!
estimates the gradient of a function at a query point, given neighbor Estimates the gradient of a function at a query point.
coordinates of this point.
in the range `[first, beyond)` and the function values of the neighbors
provided by the functor `f`. `norm` is the normalization
factor of the barycentric coordinates.
\tparam CoordinateInputIterator must be a model of `ForwardIterator` and must have as \tparam CoordinateInputIterator must be a model of `ForwardIterator` and must have as
value type a pair associating an entity to a (non-normalized) barycentric coordinate. value type a pair associating an entity to a (non-normalized) barycentric coordinate.
More precisely, `std::iterator_traits<CoordinateIterator>::%value_type::first_type` More precisely, `std::iterator_traits<CoordinateInputIterator>::%value_type::first_type`
can be of the following types: can be of the following types:
<ul> <ul>
<li> a type equivalent to `Traits::Point_d` or `Traits::Weighted_point_d` </li> <li> a type equivalent to `Traits::Point_d` or `Traits::Weighted_point_d` </li>
<li> an iterator type providing a `point()` function returning a type equivalent to `Traits::Point_d` or `Traits::Weighted_point_d`; </li> <li> an iterator type providing a `point()` function returning a type equivalent to `Traits::Point_d` or `Traits::Weighted_point_d`; </li>
</ul> </ul>
and `std::iterator_traits<CoordinateIterator>::%value_type::second_type` must be equivalent to and `std::iterator_traits<CoordinateInputIterator>::%value_type::second_type` must be equivalent to
`Traits::FT`. `Traits::FT`.
\tparam ValueFunctor must be a functor where `ValueFunctor::argument_type` must be equivalent to \tparam ValueFunctor must be a functor where `ValueFunctor::argument_type` must be equivalent to
`std::iterator_traits<CoordinateIterator>::%value_type::first_type` and `std::iterator_traits<CoordinateInputIterator>::%value_type::first_type` and
`ValueFunctor::result_type` is a pair of the function value type and a Boolean. `ValueFunctor::result_type` is a pair of the function value type and a Boolean.
The function value type must provide a multiplication and addition operation with the type The function value type must provide a multiplication and addition operation with the type
`Traits::FT` as well as a constructor with argument `0`. `Traits::FT` as well as a constructor with argument `0`.
@ -80,15 +75,16 @@ sibson_gradient_fitting(CoordinateInputIterator first, CoordinateInputIterator b
const Traits& traits); const Traits& traits);
/*! /*!
estimates the function gradients at all vertices of the Delaunay triangulation `dt` Estimates the function gradients at all vertices of the Delaunay triangulation `dt`
that lie inside the convex hull, using the coordinates computed by the that lie inside the convex hull, using the coordinates computed by the
function `PkgInterpolationNaturalNeighborCoordinates2`. function `PkgInterpolationNaturalNeighborCoordinates2`.
\tparam Dt must be of type `Delaunay_triangulation_2<Traits, Tds>`. \tparam Dt must be of type `Delaunay_triangulation_2<Dt_Traits, Tds>`.
`Traits` must be a model of the concepts `DelaunayTriangulationTraits_2` and `PolygonTraits_2`. `Dt_Traits` must be a model of the concepts `DelaunayTriangulationTraits_2` and `PolygonTraits_2`.
\tparam GradientOutputIterator must be a model of `OutputIterator` with value type \tparam GradientOutputIterator must be a model of `OutputIterator` with value type
OutputFunctor::result_type. `OutputFunctor::result_type`.
\tparam OutputFunctor must be a functor with argument type `std::pair<Dt::Vertex_handle, Traits::Vector_d>`. \tparam OutputFunctor must be a functor with argument type `std::pair<Dt::Vertex_handle, Traits::Vector_d>`.
Note that the result type of the functor is not specified and is chosen by users to fit their needs.
\tparam ValueFunctor must be a functor where: \tparam ValueFunctor must be a functor where:
- `ValueFunctor::argument_type` must be either `std::pair<Dt::Vertex_handle, Dt::Geom_traits::FT>` - `ValueFunctor::argument_type` must be either `std::pair<Dt::Vertex_handle, Dt::Geom_traits::FT>`
or `std::pair<Dt::Point, Dt::Geom_traits::FT>`. or `std::pair<Dt::Point, Dt::Geom_traits::FT>`.
@ -98,7 +94,7 @@ The function value type must provide a multiplication and addition operation wit
\tparam Traits must be a model of `GradientFittingTraits`. \tparam Traits must be a model of `GradientFittingTraits`.
\param dt is the Delaunay triangulation. \param dt is the Delaunay triangulation.
\param out is an object of type `CoordinateOutputIterator`. \param out is an object of type `GradientOutputIterator`.
\param fct is an object of type `OutputFunctor`. \param fct is an object of type `OutputFunctor`.
\param value_function is a functor of type `ValueFunctor` that gives access to \param value_function is a functor of type `ValueFunctor` that gives access to
the values of the function at points of the triangulation. the values of the function at points of the triangulation.
@ -117,15 +113,16 @@ sibson_gradient_fitting_nn_2(const Dt& dt,
const Traits& traits); const Traits& traits);
/*! /*!
estimates the function gradients at all vertices of `rt` that lie Estimates the function gradients at all vertices of `rt` that lie
inside the convex hull using the coordinates computed by the inside the convex hull using the coordinates computed by the
functions `PkgInterpolationRegularNeighborCoordinates2`. functions `PkgInterpolationRegularNeighborCoordinates2`.
\tparam Rt must be of type `Regular_triangulation_2<Traits, Tds>`. \tparam Rt must be of type `Regular_triangulation_2<Rt_Traits, Tds>`.
`Traits` must be a model of the concepts `RegularTriangulationTraits_2` and `PolygonTraits_2`. `Rt_Traits` must be a model of the concepts `RegularTriangulationTraits_2` and `PolygonTraits_2`.
\tparam GradientOutputIterator must be a model of `OutputIterator` with value type \tparam GradientOutputIterator must be a model of `OutputIterator` with value type
OutputFunctor::result_type. `OutputFunctor::result_type`.
\tparam OutputFunctor must be a functor with argument type `std::pair<Rt::Vertex_handle, Traits::Vector_d>`. \tparam OutputFunctor must be a functor with argument type `std::pair<Rt::Vertex_handle, Traits::Vector_d>`.
Note that the result type of the functor is not specified and is chosen by users to fit their needs.
\tparam ValueFunctor must be a functor where: \tparam ValueFunctor must be a functor where:
- `ValueFunctor::argument_type` must be either `std::pair<Rt::Vertex_handle, Rt::Geom_traits::FT>` - `ValueFunctor::argument_type` must be either `std::pair<Rt::Vertex_handle, Rt::Geom_traits::FT>`
or `std::pair<Rt::Weighted_point, Rt::Geom_traits::FT>`. or `std::pair<Rt::Weighted_point, Rt::Geom_traits::FT>`.
@ -135,7 +132,7 @@ The function value type must provide a multiplication and addition operation wit
\tparam Traits must be a model of `GradientFittingTraits`. \tparam Traits must be a model of `GradientFittingTraits`.
\param rt is the regular triangulation. \param rt is the regular triangulation.
\param out is an object of type `CoordinateOutputIterator`. \param out is an object of type `GradientOutputIterator`.
\param fct is an object of type `OutputFunctor`. \param fct is an object of type `OutputFunctor`.
\param value_function is a functor of type `ValueFunctor` that gives access to \param value_function is a functor of type `ValueFunctor` that gives access to
the values of the function at points of the triangulation. the values of the function at points of the triangulation.

View File

@ -81,9 +81,8 @@ surface_neighbor_coordinates_3(InputIterator first, InputIterator beyond,
const Kernel& K); const Kernel& K);
/*! /*!
the same as above only that the traits class Same as above only that the traits class must be instantiated by the user.
must be instantiated by the user. `ITraits` must be equivalent `ITraits` must be equivalent to `Voronoi_intersection_2_traits_3<K>`.
to `Voronoi_intersection_2_traits_3<K>`.
*/ */
template < class OutputIterator, class InputIterator, class ITraits > template < class OutputIterator, class InputIterator, class ITraits >
CGAL::Triple< OutputIterator, typename ITraits::FT, bool > CGAL::Triple< OutputIterator, typename ITraits::FT, bool >
@ -110,7 +109,7 @@ surface_neighbor_coordinates_certified_3(InputIterator first, InputIterator beyo
const Kernel& K); const Kernel& K);
/*! /*!
The same as above except that this function takes the Same as above except that this function takes the
maximal distance from p to the points in the range maximal distance from p to the points in the range
`[first, beyond)` as additional parameter. `[first, beyond)` as additional parameter.
*/ */
@ -123,8 +122,7 @@ surface_neighbor_coordinates_certified_3(InputIterator first, InputIterator beyo
const Kernel& kernel); const Kernel& kernel);
/*! /*!
The same as above only Same as above only that the traits class must be instantiated by the user and without
that the traits class must be instantiated by the user and without
the parameter `max_distance`. `ITraits` must be equivalent the parameter `max_distance`. `ITraits` must be equivalent
to `Voronoi_intersection_2_traits_3<K>`. to `Voronoi_intersection_2_traits_3<K>`.
*/ */
@ -136,8 +134,7 @@ surface_neighbor_coordinates_certified_3(InputIterator first, InputIterator beyo
const ITraits& traits); const ITraits& traits);
/*! /*!
The same as above with the parameter Same as above with the parameter `max_distance`.
`max_distance`.
*/ */
template <class OutputIterator, class InputIterator, class ITraits> template <class OutputIterator, class InputIterator, class ITraits>
CGAL::Quadruple< OutputIterator, typename ITraits::FT, bool, bool > CGAL::Quadruple< OutputIterator, typename ITraits::FT, bool, bool >
@ -148,7 +145,7 @@ surface_neighbor_coordinates_certified_3(InputIterator first, InputIterator beyo
const ITraits& traits); const ITraits& traits);
/*! /*!
computes the surface neighbor coordinates with respect to the points Computes the surface neighbor coordinates with respect to the points
that are vertices of the Delaunay triangulation `dt`. The type `Dt` that are vertices of the Delaunay triangulation `dt`. The type `Dt`
must be equivalent to `Delaunay_triangulation_3<Gt, Tds>`. The must be equivalent to `Delaunay_triangulation_3<Gt, Tds>`. The
optional parameter `start` is used as a starting place for the search optional parameter `start` is used as a starting place for the search
@ -171,7 +168,7 @@ surface_neighbor_coordinates_3(const Dt& dt,
typename Dt::Cell_handle start = typename Dt::Cell_handle()); typename Dt::Cell_handle start = typename Dt::Cell_handle());
/*! /*!
The same as above only that the parameter traits instantiates Same as above only that the parameter traits instantiates
the geometric traits class. Its type `ITraits` must be the geometric traits class. Its type `ITraits` must be
equivalent to `Voronoi_intersection_2_traits_3<K>`. equivalent to `Voronoi_intersection_2_traits_3<K>`.
*/ */

View File

@ -73,7 +73,7 @@ surface_neighbors_3(InputIterator first, InputIterator beyond,
const Kernel& K); const Kernel& K);
/*! /*!
The same as above only that the traits class must be instantiated by Same as above only that the traits class must be instantiated by
the user. `ITraits` must be equivalent to the user. `ITraits` must be equivalent to
`Voronoi_intersection_2_traits_3<K>`. `Voronoi_intersection_2_traits_3<K>`.
*/ */
@ -101,7 +101,7 @@ surface_neighbors_certified_3(InputIterator first, InputIterator beyond,
const Kernel& K); const Kernel& K);
/*! /*!
The same as above except that this function Same as above except that this function
takes the maximal distance from `p` to the points in the range takes the maximal distance from `p` to the points in the range
`[first, beyond)` as additional parameter. `[first, beyond)` as additional parameter.
*/ */
@ -115,9 +115,8 @@ surface_neighbors_certified_3(InputIterator first, InputIterator beyond,
const Kernel& kernel); const Kernel& kernel);
/*! /*!
The same as above only that the traits Same as above only that the traits class must be instantiated by the user.
class must be instantiated by the user. `ITraits` must be `ITraits` must be equivalent to `Voronoi_intersection_2_traits_3<K>`. There is no
equivalent to `Voronoi_intersection_2_traits_3<K>`. There is no
parameter `max_distance`. parameter `max_distance`.
*/ */
template <class OutputIterator, class InputIterator, class ITraits> template <class OutputIterator, class InputIterator, class ITraits>
@ -128,8 +127,7 @@ surface_neighbors_certified_3(InputIterator first, InputIterator beyond,
const ITraits& traits); const ITraits& traits);
/*! /*!
The same as above with the parameter Same as above with the parameter `max_distance`.
`max_distance`.
*/ */
template <class OutputIterator, class InputIterator, class ITraits> template <class OutputIterator, class InputIterator, class ITraits>
std::pair< OutputIterator, bool > std::pair< OutputIterator, bool >
@ -140,7 +138,7 @@ surface_neighbors_certified_3(InputIterator first, InputIterator beyond,
const ITraits& traits); const ITraits& traits);
/*! /*!
computes the surface neighbor coordinates with respect to the points Computes the surface neighbor coordinates with respect to the points
that are vertices of the Delaunay triangulation `dt`. The type `Dt` that are vertices of the Delaunay triangulation `dt`. The type `Dt`
must be equivalent to `Delaunay_triangulation_3<Gt, Tds>`. The must be equivalent to `Delaunay_triangulation_3<Gt, Tds>`. The
optional parameter `start` is used for the used as a starting place optional parameter `start` is used for the used as a starting place
@ -163,7 +161,7 @@ surface_neighbors_3(const Dt& dt,
typename Dt::Cell_handle start = typename Dt::Cell_handle()); typename Dt::Cell_handle start = typename Dt::Cell_handle());
/*! /*!
The same as above only that the parameter `traits` instantiates Same as above only that the parameter `traits` instantiates
the geometric traits class. Its type `ITraits` must be the geometric traits class. Its type `ITraits` must be
equivalent to `Voronoi_intersection_2_traits_3<K>`. equivalent to `Voronoi_intersection_2_traits_3<K>`.
*/ */

View File

@ -86,7 +86,7 @@ typedef unspecified_type Construct_scaled_vector_d;
/*! /*!
Constructor object for `FT`. Provides the operator: Constructor object for `FT`. Provides the operator:
`FT operator() (Point_d p, Point_d q)`, which the squared distance between `p` and `q`. `FT operator() (Point_d p, Point_d q)`, which returns the squared distance between `p` and `q`.
*/ */
typedef unspecified_type Compute_squared_distance_d; typedef unspecified_type Compute_squared_distance_d;

View File

@ -37,7 +37,7 @@ typedef unspecified_type Point_d;
/*! /*!
The weighted point type. The weighted point type.
*/ */
typedef unspecified_type Point_d; typedef unspecified_type Weighted_point_d;
/*! /*!
The corresponding vector type. The corresponding vector type.

View File

@ -107,7 +107,7 @@ square root of the weight of the point.
\warning Contrary to Voronoi diagrams, a weighted point \f$ p_i\f$ does not necessarily \warning Contrary to Voronoi diagrams, a weighted point \f$ p_i\f$ does not necessarily
possess a non-empty cell in the power diagram of \f$ \mathcal{P}\f$ (with possess a non-empty cell in the power diagram of \f$ \mathcal{P}\f$ (with
\f$ p_i\in\mathcal{P}\f$). When this is the case, that point is then said to be <em>hidden</em> \f$ p_i\in\mathcal{P}\f$). When this is the case, that point is then said to be <em>hidden</em>
and all of its regular neighboring coordinates are null. and all of its regular neighbor coordinates are null.
\subsection InterpolationImplementation Implementation \subsection InterpolationImplementation Implementation
@ -125,7 +125,7 @@ Section \ref secsurface and the reference page
Given a Delaunay triangulation or a regular triangulation, our implementation Given a Delaunay triangulation or a regular triangulation, our implementation
computes natural and regular neighbor coordinates in two steps. computes natural and regular neighbor coordinates in two steps.
Firstly, the vertices in conflict with the query point (that is, the vertices Firstly, the vertices in conflict with the query point (that is, the vertices
from which the query point will "steal") are first determined. Then, the areas from which the query point will "steal") are determined. Then, the areas
\f$ \pi_i(\mathbf{x})\f$ are computed by triangulating the Voronoi \f$ \pi_i(\mathbf{x})\f$ are computed by triangulating the Voronoi
sub-cells. The output is threefold: sub-cells. The output is threefold:
- points (or vertices) with a non-null coordinate along with these coordinates \f$ \pi_i(\mathbf{x})\f$, - points (or vertices) with a non-null coordinate along with these coordinates \f$ \pi_i(\mathbf{x})\f$,
@ -172,11 +172,12 @@ By default and for backward compatibility reasons, this output is converted
into objects of type `std::pair<Point, Coord_type>`, where `Point` is a bare into objects of type `std::pair<Point, Coord_type>`, where `Point` is a bare
(weightless) point. (weightless) point.
It is however possible to collect the output as objects of type It is however possible to collect the output as objects of any desired
`std::pair<Vertex_handle, Coord_type>` or any other type provided type, for example the simple `Point` type, by passing a functor as extra parameter
that a functor with argument type `std::pair<Vertex_handle, Coord_type>` of the coordinates computation function.
is passed to the coordinate computation function. The argument type of this functor must be `std::pair<Vertex_handle, Coord_type>`
Usage of this parameter is shown in the example below, where the output is and the result type is chosen by the user, but must be consistent with the output iterator.
Usage of this parameter is demonstrated in the example below, where the output is
kept as objects of type `std::pair<Vertex_handle, Coord_type>`, which allows kept as objects of type `std::pair<Vertex_handle, Coord_type>`, which allows
us to then store the coordinate in the vertex, using the class us to then store the coordinate in the vertex, using the class
`CGAL::Triangulation_vertex_base_with_info_2`. `CGAL::Triangulation_vertex_base_with_info_2`.
@ -357,7 +358,7 @@ computation needed to compute the distance \f$ \|\mathbf{x} -
\mathbf{p_i}\|\f$. The theoretical guarantees are the same (see \mathbf{p_i}\|\f$. The theoretical guarantees are the same (see
\cgalCite{cgal:f-csapc-03}). Simply, the smaller the slope of \f$ f\f$ \cgalCite{cgal:f-csapc-03}). Simply, the smaller the slope of \f$ f\f$
around \f$ f(0)\f$, the faster the interpolant approaches \f$ \xi_i\f$ as around \f$ f(0)\f$, the faster the interpolant approaches \f$ \xi_i\f$ as
\f$ \mathbf{x} \rightarrow \mathbf{p_i}\f$. \f$ \mathbf{x} \f$ goes to \f$ \mathbf{p_i}\f$.
\subsubsection InterpolationFarin Farin's C^1 Continuous Interpolant \subsubsection InterpolationFarin Farin's C^1 Continuous Interpolant
@ -419,14 +420,14 @@ compatible with the function.
\cgalExample{Interpolation/sibson_interpolation_2.cpp} \cgalExample{Interpolation/sibson_interpolation_2.cpp}
Additional examples compare numerically the errors of the different The example \link Interpolation/interpolation_2.cpp interpolation_2.cpp \endlink
interpolation functions with respect to a known function. compares numerically the errors of the different interpolation functions
They can be found in the `examples` directory of the distribution. with respect to a known function.
\subsection InterpolationExampleVertices Example for Storing Values and Gradients in Vertices \subsection InterpolationExampleVertices Example for Storing Values and Gradients in Vertices
In the previous examples, we stored the values and gradients in a `std::map` and wrapped them in In the previous examples, we have stored the values and gradients in a `std::map`
a `CGAL::Data_access` object. We can avoid this "external" storage by and wrapped them in a `CGAL::Data_access` object. We can avoid this "external" storage by
using the class `Triangulation_vertex_base_with_info_2` provided by the triangulation package: using the class `Triangulation_vertex_base_with_info_2` provided by the triangulation package:
values and gradients can be stored directly in the vertices of the triangulation. values and gradients can be stored directly in the vertices of the triangulation.
Functors and output iterators requested by the gradient fitting and interpolation functions Functors and output iterators requested by the gradient fitting and interpolation functions

View File

@ -41,7 +41,7 @@ function gradients are known, we can exactly interpolate quadratic
functions given barycentric coordinates. Any further properties of functions given barycentric coordinates. Any further properties of
these interpolation functions depend on the properties of the these interpolation functions depend on the properties of the
barycentric coordinates. They are provided in this package under the barycentric coordinates. They are provided in this package under the
name `linear_interpolation()` and `quadratic_interpolation()`. names `linear_interpolation()` and `quadratic_interpolation()`.
## Natural Neighbor Interpolation ## ## Natural Neighbor Interpolation ##
@ -79,23 +79,23 @@ User Manual \endlink.
- `GradientFittingTraits` - `GradientFittingTraits`
## Interpolation Functions ## ## Interpolation Functions ##
- `CGAL::linear_interpolation` - `CGAL::linear_interpolation()`
- `CGAL::sibson_c1_interpolation` - `CGAL::sibson_c1_interpolation()`
- `CGAL::farin_c1_interpolation` - `CGAL::farin_c1_interpolation()`
- `CGAL::quadratic_interpolation` - `CGAL::quadratic_interpolation()`
- `CGAL::sibson_gradient_fitting` - `CGAL::sibson_gradient_fitting()`
- `CGAL::Interpolation_traits_2<K>` - `CGAL::Interpolation_traits_2<K>`
- `CGAL::Interpolation_gradient_fitting_traits_2<K>` - `CGAL::Interpolation_gradient_fitting_traits_2<K>`
## Natural neighbor coordinate computation ## ## Natural neighbor coordinate computation ##
- `CGAL::natural_neighbor_coordinates_2` - `CGAL::natural_neighbor_coordinates_2()`
- `CGAL::regular_neighbor_coordinates_2` - `CGAL::regular_neighbor_coordinates_2()`
## Surface neighbor and surface neighbor coordinate computation ## ## Surface neighbor and surface neighbor coordinate computation ##
- `CGAL::Voronoi_intersection_2_traits_3<K>` - `CGAL::Voronoi_intersection_2_traits_3<K>`
- `CGAL::surface_neighbor_coordinates_3` - `CGAL::surface_neighbor_coordinates_3()`
- `CGAL::surface_neighbors_3` - `CGAL::surface_neighbors_3()`
*/ */

View File

@ -1,4 +1,5 @@
/*! /*!
\example Interpolation/interpolation_2.cpp
\example Interpolation/nn_coordinates_2.cpp \example Interpolation/nn_coordinates_2.cpp
\example Interpolation/nn_coordinates_with_info_2.cpp \example Interpolation/nn_coordinates_with_info_2.cpp
\example Interpolation/rn_coordinates_2.cpp \example Interpolation/rn_coordinates_2.cpp

View File

@ -1,6 +1,7 @@
#include <CGAL/Exact_predicates_inexact_constructions_kernel.h> #include <CGAL/Exact_predicates_inexact_constructions_kernel.h>
#include <CGAL/Triangulation_vertex_base_with_info_2.h> #include <CGAL/Triangulation_vertex_base_with_info_2.h>
#include <CGAL/Triangulation_data_structure_2.h>
#include <CGAL/Delaunay_triangulation_2.h> #include <CGAL/Delaunay_triangulation_2.h>
#include <CGAL/natural_neighbor_coordinates_2.h> #include <CGAL/natural_neighbor_coordinates_2.h>