From b293f7af3150e657c0137659dd2164151f619e39 Mon Sep 17 00:00:00 2001 From: eap Date: Thu, 22 Aug 2013 15:37:59 +0000 Subject: [PATCH] compact as soon as all elements removed --- src/SMESHDS/SMESHDS_SubMesh.cxx | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/SMESHDS/SMESHDS_SubMesh.cxx b/src/SMESHDS/SMESHDS_SubMesh.cxx index 10a132791..7bf00c99d 100644 --- a/src/SMESHDS/SMESHDS_SubMesh.cxx +++ b/src/SMESHDS/SMESHDS_SubMesh.cxx @@ -140,7 +140,11 @@ bool SMESHDS_SubMesh::RemoveElement(const SMDS_MeshElement * ME, bool isElemDele if ((idInSubShape >= 0) && (idInSubShape < myElements.size())) { myElements[idInSubShape] = 0; // this vector entry is no more used - myUnusedIdElements++; + if ( ++myUnusedIdElements == (int) myElements.size() ) + { + clearVector( myElements ); + myUnusedIdElements = 0; + } return true; } return false; @@ -195,7 +199,11 @@ bool SMESHDS_SubMesh::RemoveNode(const SMDS_MeshNode * N, bool isNodeDeleted) if ((idInSubShape >= 0) && (idInSubShape < myNodes.size())) { myNodes[idInSubShape] = 0; // this vector entry is no more used - myUnusedIdNodes++; + if ( ++myUnusedIdNodes == (int) myNodes.size() ) + { + clearVector( myNodes ); + myUnusedIdNodes = 0; + } return true; } return false; -- 2.39.2