Salome HOME
0021153: [CEA] non regression test fails
authoreap <eap@opencascade.com>
Thu, 10 Feb 2011 13:31:17 +0000 (13:31 +0000)
committereap <eap@opencascade.com>
Thu, 10 Feb 2011 13:31:17 +0000 (13:31 +0000)
         Fix RemoveNode() and RemoveElement(): erase only elements
         belonging to this sub-mesh

src/SMESHDS/SMESHDS_SubMesh.cxx

index 257e092e019a6529692a8dd5c1bc27ccf75ee52b..78fcd528203f64424f54e7763632e606a3d2304e 100644 (file)
@@ -126,8 +126,8 @@ bool SMESHDS_SubMesh::RemoveElement(const SMDS_MeshElement * ME, bool isElemDele
   //MESSAGE("-----------------> RemoveElement "<< ME->GetID() << " " << isElemDeleted);
   if (!IsComplexSubmesh())
     {
-      //      if (!isElemDeleted) // alive element has valid ID and can be found
-      //  {
+      if ( ME->getshapeId() != myIndex )
+        return false;
       int idInSubShape = ME->getIdInShape();
       //MESSAGE("in "<< myIndex << " RemoveElement " << ME->GetID() << " " << idInSubShape << " " << myUnusedIdElements);
       SMDS_MeshElement* elem = (SMDS_MeshElement*) (ME);
@@ -182,6 +182,8 @@ bool SMESHDS_SubMesh::RemoveNode(const SMDS_MeshNode * N, bool isNodeDeleted)
     {
       // if (!isNodeDeleted) // alive node has valid ID and can be found
       // {
+      if ( N->getshapeId() != myIndex )
+        return false;
       int idInSubShape = N->getIdInShape();
       //int shapeId = N->getshapeId();
       //MESSAGE("in "<< myIndex << " RemoveNode " << shapeId << " " << idInSubShape << " " << N->GetID());