From b2f1b14274f89f09036bb579b4b1523ce8fb0c48 Mon Sep 17 00:00:00 2001 From: jfa Date: Thu, 19 Mar 2009 14:45:23 +0000 Subject: [PATCH] Bug 0016617: Regression in V5.1.1rc3: the groups are not generated. --- src/SMESHDS/SMESHDS_Mesh.cxx | 4 ++-- src/SMESHDS/SMESHDS_SubMesh.cxx | 18 +++++++++--------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/SMESHDS/SMESHDS_Mesh.cxx b/src/SMESHDS/SMESHDS_Mesh.cxx index 61db43a74..25c772b21 100644 --- a/src/SMESHDS/SMESHDS_Mesh.cxx +++ b/src/SMESHDS/SMESHDS_Mesh.cxx @@ -701,7 +701,7 @@ void SMESHDS_Mesh::RemoveNode(const SMDS_MeshNode * n) else SubIt = myShapeIndexToSubMesh.begin(); for ( ; !subMesh && SubIt != myShapeIndexToSubMesh.end(); SubIt++ ) - if ( SubIt->second->Contains( n )) + if (!SubIt->second->IsComplexSubmesh() && SubIt->second->Contains( n )) subMesh = SubIt->second; RemoveFreeNode( n, subMesh, true); @@ -764,7 +764,7 @@ void SMESHDS_Mesh::RemoveElement(const SMDS_MeshElement * elt) SMESHDS_SubMesh* subMesh=0; map::iterator SubIt = myShapeIndexToSubMesh.begin(); for ( ; !subMesh && SubIt != myShapeIndexToSubMesh.end(); SubIt++ ) - if ( SubIt->second->Contains( elt )) + if (!SubIt->second->IsComplexSubmesh() && SubIt->second->Contains( elt )) subMesh = SubIt->second; RemoveFreeElement( elt, subMesh, true); diff --git a/src/SMESHDS/SMESHDS_SubMesh.cxx b/src/SMESHDS/SMESHDS_SubMesh.cxx index 6d9ba0835..b423600dc 100644 --- a/src/SMESHDS/SMESHDS_SubMesh.cxx +++ b/src/SMESHDS/SMESHDS_SubMesh.cxx @@ -243,17 +243,17 @@ SMDS_NodeIteratorPtr SMESHDS_SubMesh::GetNodes() const bool SMESHDS_SubMesh::Contains(const SMDS_MeshElement * ME) const { // DO NOT TRY TO FIND A REMOVED ELEMENT !! - if ( IsComplexSubmesh() || !ME ) + if ( !ME ) return false; -// if ( IsComplexSubmesh() ) -// { -// set::const_iterator aSubIt = mySubMeshes.begin(); -// for ( ; aSubIt != mySubMeshes.end(); aSubIt++ ) -// if ( (*aSubIt)->Contains( ME )) -// return true; -// return false; -// } + if ( IsComplexSubmesh() ) + { + set::const_iterator aSubIt = mySubMeshes.begin(); + for ( ; aSubIt != mySubMeshes.end(); aSubIt++ ) + if ( (*aSubIt)->Contains( ME )) + return true; + return false; + } if ( ME->GetType() == SMDSAbs_Node ) return ( myNodes.find( ME ) != myNodes.end() );