Introduce ArrayKernel::clean_keep_reservation().

This commit is contained in:
Hans-Christian Ebke
2015-11-24 01:45:44 +01:00
parent 201dee45fb
commit ec8936bfa6
2 changed files with 18 additions and 0 deletions

View File

@@ -177,6 +177,16 @@ void ArrayKernel::garbage_collection(bool _v, bool _e, bool _f)
garbage_collection( empty_vh,empty_hh,empty_fh,_v, _e, _f);
}
void ArrayKernel::clean_keep_reservation()
{
vertices_.clear();
edges_.clear();
faces_.clear();
}
void ArrayKernel::clean()
{

View File

@@ -306,6 +306,14 @@ public:
*/
void clean();
/** \brief Reset the whole mesh
*
* This will remove all elements from the mesh but keeps the properties.
* In contrast to clean() the memory used for the elements will remain
* allocated.
*/
void clean_keep_reservation();
// --- number of items ---
size_t n_vertices() const { return vertices_.size(); }
size_t n_halfedges() const { return 2*edges_.size(); }