From: eap Date: Mon, 13 Oct 2008 08:10:22 +0000 (+0000) Subject: 19997: Compute does not work in script, ok in GUI X-Git-Tag: RELIQUAT_4x_25102008~10 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=f705b9c3542d0dc04cc3ec1f056575a178a0aadf;p=modules%2Fsmesh.git 19997: Compute does not work in script, ok in GUI fix MakeComputed() for group projection --- diff --git a/src/SMESH/SMESH_Pattern.cxx b/src/SMESH/SMESH_Pattern.cxx index b8dd698a1..292af478f 100644 --- a/src/SMESH/SMESH_Pattern.cxx +++ b/src/SMESH/SMESH_Pattern.cxx @@ -3804,11 +3804,9 @@ static bool clearSubMesh( SMESH_Mesh* theMesh, bool removed = false; if ( SMESH_subMesh * aSubMesh = theMesh->GetSubMeshContaining( theShape )) { - if ( aSubMesh->GetSubMeshDS() ) { - removed = - aSubMesh->GetSubMeshDS()->NbElements() || aSubMesh->GetSubMeshDS()->NbNodes(); + removed = !aSubMesh->IsEmpty(); + if ( removed ) aSubMesh->ComputeStateEngine( SMESH_subMesh::CLEAN ); - } } else { SMESHDS_Mesh* aMeshDS = theMesh->GetMeshDS(); diff --git a/src/StdMeshers/StdMeshers_ProjectionUtils.cxx b/src/StdMeshers/StdMeshers_ProjectionUtils.cxx index 550ecb2e5..8c858e94d 100644 --- a/src/StdMeshers/StdMeshers_ProjectionUtils.cxx +++ b/src/StdMeshers/StdMeshers_ProjectionUtils.cxx @@ -1635,7 +1635,17 @@ bool StdMeshers_ProjectionUtils::MakeComputed(SMESH_subMesh * sm, const int iter SMESH_Gen* gen = mesh->GetGen(); SMESH_Algo* algo = gen->GetAlgo( *mesh, sm->GetSubShape() ); if ( !algo ) - RETURN_BAD_RESULT("No algo assigned to submesh " << sm->GetId()); + { + if ( sm->GetSubShape().ShapeType() != TopAbs_COMPOUND ) + RETURN_BAD_RESULT("No algo assigned to submesh " << sm->GetId()); + // group + bool computed = true; + for ( TopoDS_Iterator grMember( sm->GetSubShape() ); grMember.More(); grMember.Next()) + if ( SMESH_subMesh* grSub = mesh->GetSubMesh( grMember.Value() )) + if ( !MakeComputed( grSub, iterationNb + 1 )) + computed = false; + return computed; + } string algoType = algo->GetName(); if ( algoType.substr(0, 11) != "Projection_") @@ -1679,7 +1689,10 @@ bool StdMeshers_ProjectionUtils::MakeComputed(SMESH_subMesh * sm, const int iter if ( !srcMesh ) srcMesh = mesh; - return MakeComputed( srcMesh->GetSubMesh( srcShape ), iterationNb + 1 ); + if ( MakeComputed( srcMesh->GetSubMesh( srcShape ), iterationNb + 1 )) + return gen->Compute( *mesh, sm->GetSubShape() ); + + return false; } //================================================================================