From 4a2b6b75181f0f4ad0cde1cf2032242ef2f6a6b8 Mon Sep 17 00:00:00 2001 From: eap Date: Tue, 10 Apr 2007 14:06:46 +0000 Subject: [PATCH] PAL13330( When mesh generation does not success, trace where ) use aSubMesh->getDependsOnIterator() --- src/SMESH/SMESH_MeshEditor.cxx | 45 +++++++++++++--------------------- 1 file changed, 17 insertions(+), 28 deletions(-) diff --git a/src/SMESH/SMESH_MeshEditor.cxx b/src/SMESH/SMESH_MeshEditor.cxx index 889ea2f02..bc045f7f2 100644 --- a/src/SMESH/SMESH_MeshEditor.cxx +++ b/src/SMESH/SMESH_MeshEditor.cxx @@ -6401,19 +6401,17 @@ void SMESH_MeshEditor::ConvertToQuadratic(const bool theForce3d) SMESH_MesherHelper aHelper(*myMesh); aHelper.SetIsQuadratic( true ); - const TopoDS_Shape& aShape = meshDS->ShapeToMesh(); - if ( !aShape.IsNull() && GetMesh()->GetSubMeshContaining(aShape) ) + if ( myMesh->HasShapeToMesh() ) { - SMESH_subMesh *aSubMesh = GetMesh()->GetSubMeshContaining(aShape); - - const map < int, SMESH_subMesh * >& aMapSM = aSubMesh->DependsOn(); - map < int, SMESH_subMesh * >::const_iterator itsub; - for (itsub = aMapSM.begin(); itsub != aMapSM.end(); itsub++) - { - SMESHDS_SubMesh *sm = ((*itsub).second)->GetSubMeshDS(); - aHelper.SetSubShape( (*itsub).second->GetSubShape() ); - ConvertElemToQuadratic(sm, aHelper, theForce3d); + SMESH_subMesh *aSubMesh = myMesh->GetSubMesh(myMesh->GetShapeToMesh()); + SMESH_subMeshIteratorPtr smIt = aSubMesh->getDependsOnIterator(false,false); + while ( smIt->more() ) { + SMESH_subMesh* sm = smIt->next(); + if ( SMESHDS_SubMesh *smDS = sm->GetSubMeshDS() ) { + aHelper.SetSubShape( sm->GetSubShape() ); + ConvertElemToQuadratic(smDS, aHelper, theForce3d); + } } aHelper.SetSubShape( aSubMesh->GetSubShape() ); ConvertElemToQuadratic(aSubMesh->GetSubMeshDS(), aHelper, theForce3d); @@ -6583,29 +6581,20 @@ void SMESH_MeshEditor::RemoveQuadElem(SMESHDS_SubMesh * theSm, //======================================================================= bool SMESH_MeshEditor::ConvertFromQuadratic() { - SMESHDS_Mesh* meshDS = GetMeshDS(); - const TopoDS_Shape& aShape = meshDS->ShapeToMesh(); - - if ( !aShape.IsNull() && GetMesh()->GetSubMeshContaining(aShape) ) + if ( myMesh->HasShapeToMesh() ) { - SMESH_subMesh *aSubMesh = GetMesh()->GetSubMeshContaining(aShape); - - const map < int, SMESH_subMesh * >& aMapSM = aSubMesh->DependsOn(); - map < int, SMESH_subMesh * >::const_iterator itsub; - for (itsub = aMapSM.begin(); itsub != aMapSM.end(); itsub++) - { - SMESHDS_SubMesh *sm = ((*itsub).second)->GetSubMeshDS(); - if( sm ) - RemoveQuadElem( sm, sm->GetElements(), itsub->second->GetId() ); + SMESH_subMesh *aSubMesh = myMesh->GetSubMesh(myMesh->GetShapeToMesh()); + SMESH_subMeshIteratorPtr smIt = aSubMesh->getDependsOnIterator(true,false); + while ( smIt->more() ) { + SMESH_subMesh* sm = smIt->next(); + if ( SMESHDS_SubMesh *smDS = sm->GetSubMeshDS() ) + RemoveQuadElem( smDS, smDS->GetElements(), sm->GetId() ); } - SMESHDS_SubMesh *Sm = aSubMesh->GetSubMeshDS(); - if( Sm ) - RemoveQuadElem( Sm, Sm->GetElements(), aSubMesh->GetId() ); } else { SMESHDS_SubMesh *aSM = 0; - RemoveQuadElem( aSM, meshDS->elementsIterator(), 0 ); + RemoveQuadElem( aSM, GetMeshDS()->elementsIterator(), 0 ); } return true; -- 2.39.2