From 608c27e671aa5cb43d7a19eafbdb00399cedf1d6 Mon Sep 17 00:00:00 2001 From: eap Date: Wed, 18 Apr 2007 06:57:04 +0000 Subject: [PATCH] PAL13639 (Create "0D Hypothesis") ensure recompute after 0D hypothesis assignment/removal --- src/SMESH/SMESH_subMesh.cxx | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/src/SMESH/SMESH_subMesh.cxx b/src/SMESH/SMESH_subMesh.cxx index 7c9cba60f..3af807281 100644 --- a/src/SMESH/SMESH_subMesh.cxx +++ b/src/SMESH/SMESH_subMesh.cxx @@ -559,13 +559,18 @@ SMESH_Hypothesis::Hypothesis_Status return SMESH_Hypothesis::HYP_OK; } // 0D hypothesis - else if ( _algoState == HYP_OK ) { // update default _algoState - _algoState = NO_ALGO; - algo = gen->GetAlgo(*_father, _subShape); - if ( algo ) { - _algoState = MISSING_HYP; - if ( algo->CheckHypothesis(*_father,_subShape, aux_ret)) - _algoState = HYP_OK; + else if ( _algoState == HYP_OK ) { + // update default _algoState + if ( event != REMOVE_FATHER_ALGO ) + { + _algoState = NO_ALGO; + algo = gen->GetAlgo(*_father, _subShape); + if ( algo ) { + _algoState = MISSING_HYP; + if ( event == REMOVE_FATHER_HYP || + algo->CheckHypothesis(*_father,_subShape, aux_ret)) + _algoState = HYP_OK; + } } } } @@ -705,6 +710,7 @@ SMESH_Hypothesis::Hypothesis_Status CleanDependants(); ComputeStateEngine( CLEAN ); CleanDependsOn(); + ComputeSubMeshStateEngine( CHECK_COMPUTE_STATE ); } } } @@ -1134,7 +1140,7 @@ SMESH_Hypothesis::Hypothesis_Status SMESH_Hypothesis::Hypothesis_Status ret = SMESH_Hypothesis::HYP_OK; //EAP: a wire (dim==1) should notify edges (dim==1) //EAP: int dim = SMESH_Gen::GetShapeDim(_subShape); - if (_subShape.ShapeType() < TopAbs_EDGE ) // wire,face etc + //if (_subShape.ShapeType() < TopAbs_EDGE ) // wire,face etc { SMESH_subMeshIteratorPtr smIt = getDependsOnIterator(false,false); while ( smIt->more() ) { @@ -1425,7 +1431,7 @@ bool SMESH_subMesh::ComputeStateEngine(int event) if ( ret && _computeError && !_computeError->IsOK() ) { ret = false; } - if (ret) { // check if anything was built + if (ret && !_alwaysComputed) { // check if anything was built ret = ( GetSubMeshDS() && ( GetSubMeshDS()->NbElements() || GetSubMeshDS()->NbNodes() )); } if (!ret) -- 2.39.2