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();
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_")
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;
}
//================================================================================