Actualized traits concepts

This commit is contained in:
Mael Rouxel-Labbé 2018-01-16 17:29:53 +01:00
parent a5b773b12d
commit 52dd29a635
2 changed files with 73 additions and 54 deletions

View File

@ -15,9 +15,7 @@ concept `GradientFittingTraits` defines this common set of requirements.
\sa `CGAL::sibson_c1_interpolation()` \sa `CGAL::sibson_c1_interpolation()`
\sa `CGAL::farin_c1_interpolation()` \sa `CGAL::farin_c1_interpolation()`
\sa `CGAL::quadratic_interpolation()` \sa `CGAL::quadratic_interpolation()`
*/ */
class GradientFittingTraits class GradientFittingTraits
{ {
public: public:
@ -26,14 +24,12 @@ public:
/// @{ /// @{
/*! /*!
The number type must follow the model The number type must follow the model `FieldNumberType`.
`FieldNumberType`.
*/ */
typedef unspecified_type FT; typedef unspecified_type FT;
/*! /*!
The point type on The (weightless) point type.
which the function is defined and interpolated.
*/ */
typedef unspecified_type Point_d; typedef unspecified_type Point_d;
@ -48,15 +44,11 @@ The corresponding vector type.
typedef unspecified_type Vector_d; typedef unspecified_type Vector_d;
/*! /*!
defines a defines a matrix type. Must provide the following member functions :
matrix type.
Must provide the following member functions :
`Aff_transformation tr.inverse ()` which gives the inverse `Aff_transformation tr.inverse ()`, which gives the inverse transformation, and
transformation, and
`Aff_transformation tr.transform( Vector v)` which returns the `Aff_transformation tr.transform(Vector v)`, which returns the multiplication of `tr` with `v`.
multiplication of `tr` with `v`.
*/ */
typedef unspecified_type Aff_transformation_d; typedef unspecified_type Aff_transformation_d;
@ -65,9 +57,9 @@ typedef unspecified_type Aff_transformation_d;
A constructor object for `Point_d`. A constructor object for `Point_d`.
Provides : Provides :
`Point_d operator() (Point_d p)` which simply returns `p` `Point_d operator() (Point_d p)`, which simply returns `p`
`Point_d operator() (Weighted_point wp)` which returns the bare point contained in `wp`. `Point_d operator() (Weighted_point_d wp)`, which returns the bare point contained in `wp`.
*/ */
typedef unspecified_type Construct_point_d; typedef unspecified_type Construct_point_d;
@ -76,11 +68,9 @@ A constructor object for
`Vector_d`. `Vector_d`.
Provides : Provides :
`Vector_d operator() (Point_d a, Point_d b)` which produces the `Vector_d operator() (Point_d p, Point_d q)`, which produces the vector `q - p` and
vector `b - a` and
`Vector_d operator() (Null_vector NULL_VECTOR)` which introduces `Vector_d operator() (Null_vector NULL_VECTOR)`, which introduces the null vector.
the null vector.
*/ */
typedef unspecified_type Construct_vector_d; typedef unspecified_type Construct_vector_d;
@ -89,44 +79,45 @@ Constructor object for
`Vector_d`. `Vector_d`.
Provides : Provides :
`Vector_d operator() (Vector_d v,FT scale)` which produces the `Vector_d operator() (Vector_d v, FT scale)`, which produces the vector `v` scaled by a factor `scale`.
vector `v` scaled by a factor `scale`.
*/ */
typedef unspecified_type Construct_scaled_vector_d; typedef unspecified_type Construct_scaled_vector_d;
/*! /*!
Constructor object for Constructor object for `FT`. Provides the operator:
`Aff_transformation_d`. Provides :
`Aff_transformation_d operator()()` which introduces an affine `FT operator() (Point_d p, Point_d q)`, which the squared distance between `p` and `q`.
transformation whose matrix has only zero entries. */
typedef unspecified_type Compute_squared_distance_d;
/*!
Constructor object for `Aff_transformation_d`. Provides :
`Aff_transformation_d operator()()`, which introduces an affine transformation
whose matrix has only zero entries.
*/ */
typedef unspecified_type Construct_null_matrix_d; typedef unspecified_type Construct_null_matrix_d;
/*! /*!
Constructor object for Constructor object for `Aff_transformation_d`. Provides :
`Aff_transformation_d`. Provides :
`Aff_transformation_d operator()(FT scale)` which introduces a `Aff_transformation_d operator()(FT scale)`, which introduces a scaling by a scale factor `scale`.
scaling by a scale factor `scale`.
*/ */
typedef unspecified_type Construct_scaling_matrix_d; typedef unspecified_type Construct_scaling_matrix_d;
/*! /*!
Constructor object for Constructor object for `Aff_transformation_d`. Provides :
`Aff_transformation_d`. Provides :
`Aff_transformation_d operator()(Aff_transformation_d tr1, Aff_transformation_d tr2)` which returns the sum of the two matrices `Aff_transformation_d operator()(Aff_transformation_d tr1, Aff_transformation_d tr2)`,
representing `tr1` and `tr2`. which returns the sum of the two matrices representing `tr1` and `tr2`.
*/ */
typedef unspecified_type Construct_sum_matrix_d; typedef unspecified_type Construct_sum_matrix_d;
/*! /*!
Constructor object for Constructor object for `Aff_transformation_d`. Provides :
`Aff_transformation_d`. Provides :
`Aff_transformation_d operator()(Vector v)` which returns the `Aff_transformation_d operator()(Vector v)`, which returns the outer product,
outer product, i.e.\ the quadratic matrix `v`\f$ ^t\f$`v`. i.e.\ the quadratic matrix `v`\f$ ^t\f$`v`.
*/ */
typedef unspecified_type Construct_outer_product_d; typedef unspecified_type Construct_outer_product_d;
@ -149,6 +140,11 @@ GradientFittingTraits();
/*! /*!
*/
Construct_vector_d construct_point_d_object();
/*!
*/ */
Construct_vector_d construct_vector_d_object(); Construct_vector_d construct_vector_d_object();
@ -159,9 +155,20 @@ Construct_scaled_vector_d construct_scaled_vector_d_object();
/*! /*!
*/
Compute_squared_distance_d compute_squared_distance_d_object();
/*!
*/ */
Construct_null_matrix_d construct_null_matrix_d_object(); Construct_null_matrix_d construct_null_matrix_d_object();
/*!
*/
Construct_scaling_matrix_d construct_scaling_matrix_d_object();
/*! /*!
*/ */

View File

@ -25,14 +25,17 @@ public:
/// @{ /// @{
/*! /*!
The number type must follow the model The number type must follow the model `FieldNumberType`.
`FieldNumberType`.
*/ */
typedef unspecified_type FT; typedef unspecified_type FT;
/*! /*!
The point type on The (weightless) point type.
which the function is defined and interpolated. */
typedef unspecified_type Point_d;
/*!
The weighted point type.
*/ */
typedef unspecified_type Point_d; typedef unspecified_type Point_d;
@ -42,12 +45,19 @@ The corresponding vector type.
typedef unspecified_type Vector_d; typedef unspecified_type Vector_d;
/*! /*!
A constructor object for A constructor object for `Point_d`. Provides :
`Vector_d`.
Provides :
`Vector_d operator() (Point_d a, Point_d b)` which produces the `Point_d operator() (Point_d p)` which returns the point itself.
vector `b - a` and
`Point_d operator() (Weighted_point_d wp)` which extracts the bare point from the weighted point.
*/
typedef unspecified_type Construct_point_d;
/*!
A constructor object for `Vector_d`. Provides :
`Vector_d operator() (Point_d p, Point_d q)` which produces the
vector `q - p` and
`Vector_d operator() (Null_vector NULL_VECTOR)` which introduces `Vector_d operator() (Null_vector NULL_VECTOR)` which introduces
the null vector. the null vector.
@ -55,21 +65,18 @@ the null vector.
typedef unspecified_type Construct_vector_d; typedef unspecified_type Construct_vector_d;
/*! /*!
Constructor object for Constructor object for `Vector_d`. Provides :
`Vector_d`.
Provides :
`Vector_d operator() (Vector_d v,FT scale)` which produces the `Vector_d operator() (Vector_d v, FT scale)` which produces the
vector `v` scaled by a factor `scale`. vector `v` scaled by a factor `scale`.
*/ */
typedef unspecified_type Construct_scaled_vector_d; typedef unspecified_type Construct_scaled_vector_d;
/*! /*!
Constructor Constructor object for `FT`. Provides the operator:
object for `FT`. Provides the operator:
`FT operator() (Point_d a, Point_d b)` returning the squared `FT operator() (Point_d p, Point_d q)` returning the squared
distance between `a` and `b`. distance between `p` and `q`.
*/ */
typedef unspecified_type Compute_squared_distance_d; typedef unspecified_type Compute_squared_distance_d;
@ -87,6 +94,11 @@ InterpolationTraits();
/*! /*!
*/
Construct_vector_d construct_point_d_object();
/*!
*/ */
Construct_vector_d construct_vector_d_object(); Construct_vector_d construct_vector_d_object();