polish doc, and add implementation of trivial getter (remark of Pierre)

This commit is contained in:
Andreas Fabri 2012-12-27 18:01:55 +01:00
parent bf4bdda1e3
commit fa1940382f
4 changed files with 27 additions and 17 deletions

View File

@ -101,12 +101,12 @@ void update();
/*! /*!
returns the separating distance. returns the separating distance.
*/ */
void get_separating_distance(); FT get_separating_distance() const;
/*! /*!
returns the saturation ratio. returns the saturation ratio.
*/ */
void get_saturation_ratio(); FT get_saturation_ratio() const;
/*! /*!
prints the streamlines to an ASCII file: line by line, and point by point. prints the streamlines to an ASCII file: line by line, and point by point.

View File

@ -6,7 +6,7 @@ namespace CGAL {
This class provides a vector field specified by a set of sample points This class provides a vector field specified by a set of sample points
defined on a triangulated domain. All sample points are inserted to a defined on a triangulated domain. All sample points are inserted to a
`Delaunay triangulation`, and for each point `p` in the domain Delaunay triangulation, and for each point `p` in the domain
located in a face `f`, its vector value is interpolated from the located in a face `f`, its vector value is interpolated from the
vertices of the face `f`. vertices of the face `f`.
@ -45,13 +45,13 @@ typedef StreamLinesTraits_2::Vector_2 Vector_2;
/// @{ /// @{
/*! /*!
Defines the points in the range Defines the points in the range `[first_point, last_point)`
`[first_point, `last_point) as the sample points of the triangular field, with the corresponding number of vectors started at `first_vector`.
as the sample points of the grid, with the corresponding number of vectors started at `first_vector`. \tparam PointInputIterator must be an input iterator with the value type `Point_2`.
\pre The `value_type` of `InputIterator1` is `Point_2`. \tparam VectorInputIterator must be an input iterator with the value type `Vector_2`.
\pre The `value_type` of `InputIterator2` is `Vector_2`.
*/ */
Triangular_field_2( InputIterator1 first_point, InputIterator1 last_point, InputIterator2 first_vector); mplate <class PointIterator1, class VectorInputIterator>
Triangular_field_2( PointInputIterator first_point, PointInputIterator last_point, VectorInputIterator first_vector);
/// @} /// @}

View File

@ -46,7 +46,7 @@ typedef Hidden_type Vector_2;
/// @{ /// @{
/*! /*!
Any constructor has to allow the user to fill the vector values (i.e. assign a vector to each position within the domain). Any constructor has to allow the user to fill the vector values, i.e., assign a vector to each position within the domain.
*/ */
VectorField_2(); VectorField_2();
@ -56,26 +56,25 @@ VectorField_2();
/// @{ /// @{
/*! /*!
returns returns the bounding box of the whole domain.
the bounding box of the whole domain.
*/ */
Geom_traits::Iso_rectangle_2 bbox(); Geom_traits::Iso_rectangle_2 bbox();
/*! /*!
returns the vector field value and the local density. returns the vector field value and the local density.
\pre `is_in_domain(p)` must be true. \pre `is_in_domain(p)` must be `true`.
*/ */
std::pair<Vector_2,FT> get_field(Point_2 p); std::pair<Vector_2,FT> get_field(Point_2 p);
/*! /*!
returns true if the point p returns `true` if the point `p`
is inside the domain boundaries, false otherwise. is inside the domain boundaries, `false` otherwise.
*/ */
bool is_in_domain(Point_2 p); bool is_in_domain(Point_2 p);
/*! /*!
returns the integration step at the point p (i.e. the distance between `p` and the next point in the polyline.). returns the integration step at the point `p`, i.e., the distance between `p` and the next point in the polyline.
\pre `is_in_domain(p)` must be true. \pre `is_in_domain(p)` must be `true`.
*/ */
FT get_integration_step(Point_2 p); FT get_integration_step(Point_2 p);

View File

@ -107,6 +107,17 @@ protected:
public: public:
void set_separating_distance(FT new_value){separating_distance = new_value;} void set_separating_distance(FT new_value){separating_distance = new_value;}
void set_saturation_ratio(FT new_value){ saturation_ratio = new_value;} void set_saturation_ratio(FT new_value){ saturation_ratio = new_value;}
FT get_separating_distance() const
{
return separating_distance;
}
FT get_saturation_ratio() const
{
return saturation_ratio;
}
void update() void update()
{ {
ir = il = 0; // initialization ir = il = 0; // initialization