From: eap Date: Thu, 22 Aug 2013 15:37:59 +0000 (+0000) Subject: compact as soon as all elements removed X-Git-Tag: V7_3_0a1~193 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=b293f7af3150e657c0137659dd2164151f619e39;p=modules%2Fsmesh.git compact as soon as all elements removed --- 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;