Update with latest review

This commit is contained in:
Simon Giraudot 2016-10-14 14:16:26 +02:00
parent 751b407895
commit 17b25a50ac
3 changed files with 29 additions and 19 deletions

View File

@ -38,7 +38,7 @@ The overloads, available after including
`CGAL/Point_set_3/Point_set_processing_3.h`, all follow the same `CGAL/Point_set_3/Point_set_processing_3.h`, all follow the same
pattern based on the original point set processing functions: 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<Point,Vector>` with a single parameter `CGAL::Point_set_3<Point,Vector>`
- The other parameters (and their potential default values) are - 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 - if found in the input, normal vectors are stored in the usual
`CGAL::Point_set_3` property `normal` with template type `Vector` `CGAL::Point_set_3` property `normal` with template type `Vector`
- for PLY input only, other properties are stored on point set - for PLY input only, other properties are stored as properties in the
properties with the name and type given by the PLY header `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 For a complete documentation of these functions, please refer to the
\ref PkgPointSetProcessing manual. \ref PkgPointSetProcessing manual.

View File

@ -20,14 +20,9 @@ labels, and to call \cgal algorithms on them.
\section Point_set_3_Principle General Principle \section Point_set_3_Principle General Principle
`CGAL::Point_set_3<Point,Vector>` is a vector based data structure that `CGAL::Point_set_3<Point,Vector>` is a vector based data structure
contains two properties by default: that contains by default a property named _point_ with template
`Point` type.
- 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
Any property the user needs can be easily added, modified and Any property the user needs can be easily added, modified and
removed. A property is identified by a unique name and a 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 \section Point_set_3_Properties Using Additional Properties
Every information in the point set is a property. A raw point set 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 comes with a _point_ property only. As we saw in the previous section,
section, the user can easily add a _normal_ property. But this the user can easily add a _normal_ property. But this mechanism is
mechanism is generalized to any type of property. generalized to any type of property.
The following example shows how to define a color property and an The following example shows how to define a color property and an
intensity property, and how to modify the point set according to this. intensity property, and how to modify the point set according to this.

View File

@ -551,10 +551,7 @@ public:
the memory. `collect_garbage()` should be called if the memory the memory. `collect_garbage()` should be called if the memory
needs to be freed. needs to be freed.
\note The end iterator is invalidated. Other iterators are still \note All iterators, pointers and references related to the container are invalidated.
valid but not guaranteed to keep referring to the same elements
they were referring to before the call.
*/ */
void remove (iterator it) void remove (iterator it)
{ {
@ -562,6 +559,21 @@ public:
++ m_nb_removed; ++ 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<std::string> properties() const std::vector<std::string> properties() const
{ {
return m_base.properties(); std::vector<std::string> out = m_base.properties();
out.remove (out.begin()); // remove "index"
out.remove (out.begin()); // remove "point"
return out;
} }
/// \cond SKIP_IN_MANUAL /// \cond SKIP_IN_MANUAL