From e74e528833e0da6b1e2c8ee818434b760d003031 Mon Sep 17 00:00:00 2001 From: eap Date: Mon, 22 Jul 2013 14:08:46 +0000 Subject: [PATCH] In RemoveElement(), find sub-mesh by elt->getshapeId() --- src/SMESHDS/SMESHDS_Mesh.cxx | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/SMESHDS/SMESHDS_Mesh.cxx b/src/SMESHDS/SMESHDS_Mesh.cxx index 885a76107..f36c28b94 100644 --- a/src/SMESHDS/SMESHDS_Mesh.cxx +++ b/src/SMESHDS/SMESHDS_Mesh.cxx @@ -915,11 +915,12 @@ void SMESHDS_Mesh::RemoveElement(const SMDS_MeshElement * elt) if (!hasConstructionEdges() && !hasConstructionFaces()) { SMESHDS_SubMesh* subMesh=0; - map::iterator SubIt = myShapeIndexToSubMesh.begin(); - for ( ; !subMesh && SubIt != myShapeIndexToSubMesh.end(); SubIt++ ) - if (!SubIt->second->IsComplexSubmesh() && SubIt->second->Contains( elt )) + if ( elt->getshapeId() > 0 ) + { + map::iterator SubIt = myShapeIndexToSubMesh.find( elt->getshapeId() ); + if ( SubIt != myShapeIndexToSubMesh.end() ) subMesh = SubIt->second; - //MESSAGE("subMesh " << elt->getshapeId()); + } RemoveFreeElement( elt, subMesh, true); return; } -- 2.39.2