From fa1940382f3faf1fb30e06294f17145ed1f3d485 Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Thu, 27 Dec 2012 18:01:55 +0100 Subject: [PATCH] polish doc, and add implementation of trivial getter (remark of Pierre) --- .../doc/Stream_lines_2/CGAL/Stream_lines_2.h | 4 ++-- .../doc/Stream_lines_2/CGAL/Triangular_field_2.h | 14 +++++++------- .../doc/Stream_lines_2/Concepts/VectorField_2.h | 15 +++++++-------- Stream_lines_2/include/CGAL/Stream_lines_2.h | 11 +++++++++++ 4 files changed, 27 insertions(+), 17 deletions(-) diff --git a/Stream_lines_2/doc/Stream_lines_2/CGAL/Stream_lines_2.h b/Stream_lines_2/doc/Stream_lines_2/CGAL/Stream_lines_2.h index 50781d02c8c..e4ef0a24f82 100644 --- a/Stream_lines_2/doc/Stream_lines_2/CGAL/Stream_lines_2.h +++ b/Stream_lines_2/doc/Stream_lines_2/CGAL/Stream_lines_2.h @@ -101,12 +101,12 @@ void update(); /*! returns the separating distance. */ -void get_separating_distance(); +FT get_separating_distance() const; /*! 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. diff --git a/Stream_lines_2/doc/Stream_lines_2/CGAL/Triangular_field_2.h b/Stream_lines_2/doc/Stream_lines_2/CGAL/Triangular_field_2.h index 9f96801a587..215f8a59bee 100644 --- a/Stream_lines_2/doc/Stream_lines_2/CGAL/Triangular_field_2.h +++ b/Stream_lines_2/doc/Stream_lines_2/CGAL/Triangular_field_2.h @@ -6,7 +6,7 @@ namespace CGAL { 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 -`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 vertices of the face `f`. @@ -45,13 +45,13 @@ typedef StreamLinesTraits_2::Vector_2 Vector_2; /// @{ /*! -Defines the points in the range -`[first_point, `last_point) -as the sample points of the grid, with the corresponding number of vectors started at `first_vector`. -\pre The `value_type` of `InputIterator1` is `Point_2`. -\pre The `value_type` of `InputIterator2` is `Vector_2`. +Defines the points in the range `[first_point, last_point)` +as the sample points of the triangular field, with the corresponding number of vectors started at `first_vector`. +\tparam PointInputIterator must be an input iterator with the value type `Point_2`. +\tparam VectorInputIterator must be an input iterator with the value type `Vector_2`. */ -Triangular_field_2( InputIterator1 first_point, InputIterator1 last_point, InputIterator2 first_vector); +mplate +Triangular_field_2( PointInputIterator first_point, PointInputIterator last_point, VectorInputIterator first_vector); /// @} diff --git a/Stream_lines_2/doc/Stream_lines_2/Concepts/VectorField_2.h b/Stream_lines_2/doc/Stream_lines_2/Concepts/VectorField_2.h index 7a0daafc6fe..ab2fb396528 100644 --- a/Stream_lines_2/doc/Stream_lines_2/Concepts/VectorField_2.h +++ b/Stream_lines_2/doc/Stream_lines_2/Concepts/VectorField_2.h @@ -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(); @@ -56,26 +56,25 @@ VectorField_2(); /// @{ /*! -returns -the bounding box of the whole domain. +returns the bounding box of the whole domain. */ Geom_traits::Iso_rectangle_2 bbox(); /*! 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 get_field(Point_2 p); /*! -returns true if the point p -is inside the domain boundaries, false otherwise. +returns `true` if the point `p` +is inside the domain boundaries, `false` otherwise. */ 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.). -\pre `is_in_domain(p)` must be true. +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`. */ FT get_integration_step(Point_2 p); diff --git a/Stream_lines_2/include/CGAL/Stream_lines_2.h b/Stream_lines_2/include/CGAL/Stream_lines_2.h index 96d229970d4..2b2aeda59a9 100644 --- a/Stream_lines_2/include/CGAL/Stream_lines_2.h +++ b/Stream_lines_2/include/CGAL/Stream_lines_2.h @@ -107,6 +107,17 @@ protected: public: void set_separating_distance(FT new_value){separating_distance = 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() { ir = il = 0; // initialization