0021345: EDF 1936 : Problem in submeshes management

In ProcessEvent(), fix detection of algo removal
This commit is contained in:
eap 2011-08-19 12:38:38 +00:00
parent 2d61b98c65
commit 2edfe63af3

View File

@ -166,17 +166,24 @@ namespace {
EventListenerData* data, EventListenerData* data,
const SMESH_Hypothesis* /*hyp*/) const SMESH_Hypothesis* /*hyp*/)
{ {
bool hypRemoved = ( eventType == SMESH_subMesh::ALGO_EVENT && if ( data && eventType == SMESH_subMesh::ALGO_EVENT )
subMesh->GetAlgoState() != SMESH_subMesh::HYP_OK );
if ( hypRemoved && data )
{ {
list<SMESH_subMesh*>::iterator smIt = data->mySubMeshes.begin(); bool hypRemoved;
for ( ; smIt != data->mySubMeshes.end(); ++smIt ) if ( subMesh->GetAlgoState() != SMESH_subMesh::HYP_OK )
hypRemoved = true;
else {
SMESH_Gen * gen = subMesh->GetFather()->GetGen();
SMESH_Algo* algo = gen->GetAlgo( *subMesh->GetFather(), subMesh->GetSubShape() );
hypRemoved = ( string( algo->GetName() ) != StdMeshers_CompositeSegment_1D::AlgoName());
}
if ( hypRemoved )
{ {
if ( SMESH_subMesh* sm = *smIt ) { list<SMESH_subMesh*>::iterator smIt = data->mySubMeshes.begin();
sm->SetIsAlwaysComputed( false ); for ( ; smIt != data->mySubMeshes.end(); ++smIt )
sm->ComputeStateEngine( SMESH_subMesh::CHECK_COMPUTE_STATE ); if ( SMESH_subMesh* sm = *smIt ) {
} sm->SetIsAlwaysComputed( false );
sm->ComputeStateEngine( SMESH_subMesh::CHECK_COMPUTE_STATE );
}
} }
} }
// at study restoration: // at study restoration:
@ -223,10 +230,19 @@ StdMeshers_CompositeSegment_1D::StdMeshers_CompositeSegment_1D(int hypId
:StdMeshers_Regular_1D(hypId, studyId, gen) :StdMeshers_Regular_1D(hypId, studyId, gen)
{ {
MESSAGE("StdMeshers_CompositeSegment_1D::StdMeshers_CompositeSegment_1D"); MESSAGE("StdMeshers_CompositeSegment_1D::StdMeshers_CompositeSegment_1D");
_name = "CompositeSegment_1D"; _name = AlgoName();
_EventListener = new VertexNodesRestoringListener(); _EventListener = new VertexNodesRestoringListener();
} }
//=======================================================================
//function : AlgoName
//purpose : Returns algo type name
//=======================================================================
std::string StdMeshers_CompositeSegment_1D::AlgoName()
{
return "CompositeSegment_1D";
}
//============================================================================= //=============================================================================
/*! /*!
* *