]> SALOME platform Git repositories - modules/smesh.git/commitdiff
Salome HOME
In RemoveElement(), find sub-mesh by elt->getshapeId()
authoreap <eap@opencascade.com>
Mon, 22 Jul 2013 14:08:46 +0000 (14:08 +0000)
committereap <eap@opencascade.com>
Mon, 22 Jul 2013 14:08:46 +0000 (14:08 +0000)
src/SMESHDS/SMESHDS_Mesh.cxx

index 885a76107185f07d7b76209a5139f64335f1d292..f36c28b94d19f71a363710cc7e6c8daf4455a02a 100644 (file)
@@ -915,11 +915,12 @@ void SMESHDS_Mesh::RemoveElement(const SMDS_MeshElement * elt)
   if (!hasConstructionEdges() && !hasConstructionFaces())
   {
     SMESHDS_SubMesh* subMesh=0;
-    map<int,SMESHDS_SubMesh*>::iterator SubIt = myShapeIndexToSubMesh.begin();
-    for ( ; !subMesh && SubIt != myShapeIndexToSubMesh.end(); SubIt++ )
-      if (!SubIt->second->IsComplexSubmesh() && SubIt->second->Contains( elt ))
+    if ( elt->getshapeId() > 0 )
+    {
+      map<int,SMESHDS_SubMesh*>::iterator SubIt = myShapeIndexToSubMesh.find( elt->getshapeId() );
+      if ( SubIt != myShapeIndexToSubMesh.end() )
         subMesh = SubIt->second;
-    //MESSAGE("subMesh " << elt->getshapeId());
+    }
     RemoveFreeElement( elt, subMesh, true);
     return;
   }