From 1c0043f21f612de4e6fa828c1fb04f55988cb596 Mon Sep 17 00:00:00 2001 From: Simon Giraudot Date: Tue, 3 May 2016 07:54:43 +0200 Subject: [PATCH] Reset Properties to initial state in Surface_mesh --- .../include/CGAL/Surface_mesh/Properties.h | 32 +++---------------- 1 file changed, 4 insertions(+), 28 deletions(-) diff --git a/Surface_mesh/include/CGAL/Surface_mesh/Properties.h b/Surface_mesh/include/CGAL/Surface_mesh/Properties.h index db0c09ca21b..8f3d58ef9ea 100644 --- a/Surface_mesh/include/CGAL/Surface_mesh/Properties.h +++ b/Surface_mesh/include/CGAL/Surface_mesh/Properties.h @@ -33,8 +33,6 @@ namespace CGAL { /// /// @{ -namespace Properties { - /// @cond CGAL_DOCUMENT_INTERNALS class Base_property_array { @@ -63,9 +61,6 @@ public: /// Let two elements swap their storage place. virtual void swap(size_t i0, size_t i1) = 0; - /// Erase range - virtual void erase(size_t first, size_t beyond) = 0; - /// Return a deep copy of self. virtual Base_property_array* clone () const = 0; @@ -139,11 +134,6 @@ public: // virtual interface of Base_property_array data_[i1]=d; } - virtual void erase(size_t first, size_t beyond) - { - data_.erase (data_.begin() + first, data_.begin() + beyond); - } - virtual Base_property_array* clone() const { Property_array* p = new Property_array(this->name_, this->value_); @@ -153,11 +143,6 @@ public: // virtual interface of Base_property_array virtual const std::type_info& type() { return typeid(T); } - typename vector_type::iterator begin () { return data_.begin (); } - typename vector_type::iterator end () { return data_.end (); } - typename vector_type::const_iterator begin () const { return data_.begin (); } - typename vector_type::const_iterator end () const { return data_.end (); } - public: @@ -360,13 +345,6 @@ public: } - // erase elements from each vector - void erase (size_t first, size_t beyond) - { - for (unsigned int i=0; ierase(first, beyond); - size_ -= (beyond-first); - } // reserve memory for n entries in all arrays void reserve(size_t n) const { @@ -404,6 +382,7 @@ public: parrays_[i]->swap(i0, i1); } + private: std::vector parrays_; size_t size_; @@ -436,8 +415,7 @@ public: typedef I key_type; typedef T value_type; typedef boost::lvalue_property_map_tag category; - typedef Property_array Array; - + #ifndef DOXYGEN_RUNNING typedef typename Property_array::reference reference; @@ -512,6 +490,7 @@ public: } //@} +private: Property_array& array() { @@ -524,13 +503,10 @@ public: CGAL_assertion(parray_ != NULL); return *parray_; } -private: + Property_array* parray_; }; - - - #endif // DOXYGEN_RUNNING ///@}