19997: Compute does not work in script, ok in GUI

in clearSubMesh() call ComputeStateEngine() only on not empty submesh
This commit is contained in:
eap 2008-10-13 08:12:34 +00:00
parent 40fa3efd39
commit b45fb08505

View File

@ -3804,12 +3804,10 @@ static bool clearSubMesh( SMESH_Mesh* theMesh,
bool removed = false; bool removed = false;
if ( SMESH_subMesh * aSubMesh = theMesh->GetSubMeshContaining( theShape )) if ( SMESH_subMesh * aSubMesh = theMesh->GetSubMeshContaining( theShape ))
{ {
if ( aSubMesh->GetSubMeshDS() ) { removed = !aSubMesh->IsEmpty();
removed = if ( removed )
aSubMesh->GetSubMeshDS()->NbElements() || aSubMesh->GetSubMeshDS()->NbNodes();
aSubMesh->ComputeStateEngine( SMESH_subMesh::CLEAN ); aSubMesh->ComputeStateEngine( SMESH_subMesh::CLEAN );
} }
}
else { else {
SMESHDS_Mesh* aMeshDS = theMesh->GetMeshDS(); SMESHDS_Mesh* aMeshDS = theMesh->GetMeshDS();
if ( SMESHDS_SubMesh* aSubMeshDS = aMeshDS->MeshElements( theShape )) if ( SMESHDS_SubMesh* aSubMeshDS = aMeshDS->MeshElements( theShape ))