diff --git a/Point_set_3/doc/Point_set_3/PackageDescription.txt b/Point_set_3/doc/Point_set_3/PackageDescription.txt index b51320f00ad..d9b338cc08c 100644 --- a/Point_set_3/doc/Point_set_3/PackageDescription.txt +++ b/Point_set_3/doc/Point_set_3/PackageDescription.txt @@ -38,7 +38,7 @@ The overloads, available after including `CGAL/Point_set_3/Point_set_processing_3.h`, all follow the same pattern based on the original point set processing functions: -- Iterators and property maps of the original function are replaced +- Iterators and property maps of the original functions are replaced with a single parameter `CGAL::Point_set_3` - The other parameters (and their potential default values) are @@ -61,8 +61,8 @@ Input functions instanciate all the necessary property maps: - if found in the input, normal vectors are stored in the usual `CGAL::Point_set_3` property `normal` with template type `Vector` -- for PLY input only, other properties are stored on point set -properties with the name and type given by the PLY header +- for PLY input only, other properties are stored as properties in the +`Point_set_3` class with the name and type given by the PLY header For a complete documentation of these functions, please refer to the \ref PkgPointSetProcessing manual. diff --git a/Point_set_3/doc/Point_set_3/Point_set_3.txt b/Point_set_3/doc/Point_set_3/Point_set_3.txt index 65895bfb183..a59b808f994 100644 --- a/Point_set_3/doc/Point_set_3/Point_set_3.txt +++ b/Point_set_3/doc/Point_set_3/Point_set_3.txt @@ -20,14 +20,9 @@ labels, and to call \cgal algorithms on them. \section Point_set_3_Principle General Principle -`CGAL::Point_set_3` is a vector based data structure that -contains two properties by default: - -- A property named _index_ with \ref CGAL::Point_set_3::Index "Index" -type used to easily change the order of the points without -having to move all the properties. - -- A property named _point_ with template `Point` type +`CGAL::Point_set_3` is a vector based data structure +that contains by default a property named _point_ with template +`Point` type. Any property the user needs can be easily added, modified and removed. A property is identified by a unique name and a @@ -59,9 +54,9 @@ normal property, set the normal values, add or remove an item, etc. \section Point_set_3_Properties Using Additional Properties Every information in the point set is a property. A raw point set -comes with _index_ and _point_ properties. As we saw in the previous -section, the user can easily add a _normal_ property. But this -mechanism is generalized to any type of property. +comes with a _point_ property only. As we saw in the previous section, +the user can easily add a _normal_ property. But this mechanism is +generalized to any type of property. The following example shows how to define a color property and an intensity property, and how to modify the point set according to this. diff --git a/Point_set_3/include/CGAL/Point_set_3.h b/Point_set_3/include/CGAL/Point_set_3.h index 8791e108af6..ba4da9d0d74 100644 --- a/Point_set_3/include/CGAL/Point_set_3.h +++ b/Point_set_3/include/CGAL/Point_set_3.h @@ -551,10 +551,7 @@ public: the memory. `collect_garbage()` should be called if the memory needs to be freed. - \note The end iterator is invalidated. Other iterators are still - valid but not guaranteed to keep referring to the same elements - they were referring to before the call. - + \note All iterators, pointers and references related to the container are invalidated. */ void remove (iterator it) { @@ -562,6 +559,21 @@ public: ++ m_nb_removed; } + /*! + \brief Marks element specified by `Index` as removed. + + \note The element is just marked as removed and is not erased from + the memory. `collect_garbage()` should be called if the memory + needs to be freed. + + \note All iterators, pointers and references related to the container are invalidated. + */ + void remove (const Index& index) + { + std::swap (index, *(end() - 1)); + ++ m_nb_removed; + } + /// @} @@ -802,7 +814,10 @@ public: */ std::vector properties() const { - return m_base.properties(); + std::vector out = m_base.properties(); + out.remove (out.begin()); // remove "index" + out.remove (out.begin()); // remove "point" + return out; } /// \cond SKIP_IN_MANUAL