From 4b5c150fd145606f063136e90ce9f546acc44cfc Mon Sep 17 00:00:00 2001 From: eap Date: Wed, 11 Mar 2009 15:20:49 +0000 Subject: [PATCH] 0020206: EDF SMESH 987: Netgen1D2D3D +submesh clear mesh if an added local algorithm hides a global all-dimensional one --- src/SMESH/SMESH_subMesh.cxx | 23 ++++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/src/SMESH/SMESH_subMesh.cxx b/src/SMESH/SMESH_subMesh.cxx index 6c484c80a..5a8f63ebf 100644 --- a/src/SMESH/SMESH_subMesh.cxx +++ b/src/SMESH/SMESH_subMesh.cxx @@ -23,7 +23,6 @@ // File : SMESH_subMesh.cxx // Author : Paul RASCLE, EDF // Module : SMESH -// $Header$ // #include "SMESH_subMesh.hxx" @@ -609,6 +608,7 @@ SMESH_Hypothesis::Hypothesis_Status int oldAlgoState = _algoState; bool modifiedHyp = (event == MODIF_HYP); // if set to true, force event MODIF_ALGO_STATE + bool needFullClean = false; bool isApplicableHyp = IsApplicableHypotesis( anHyp ); @@ -625,6 +625,15 @@ SMESH_Hypothesis::Hypothesis_Status // ---------------------- if (isApplicableHyp && !_father->IsNotConformAllowed() && !IsConform( algo )) return SMESH_Hypothesis::HYP_NOTCONFORM; + + // check if all-dimensional algo is hidden by other local one + if ( event == ADD_ALGO ) { + SMESH_HypoFilter filter( SMESH_HypoFilter::HasType( algo->GetType() )); + filter.Or( SMESH_HypoFilter::HasType( algo->GetType()+1 )); + filter.Or( SMESH_HypoFilter::HasType( algo->GetType()+2 )); + if ( SMESH_Algo * curAlgo = (SMESH_Algo*) _father->GetHypothesis( _subShape, filter, true )) + needFullClean = ( !curAlgo->NeedDescretBoundary() ); + } } // ---------------------------------- @@ -658,10 +667,7 @@ SMESH_Hypothesis::Hypothesis_Status // clean all mesh in the tree of the current submesh; // we must perform it now because later // we will have no information about the type of the removed algo - CleanDependants(); - ComputeStateEngine( CLEAN ); - CleanDependsOn(); - ComputeSubMeshStateEngine( CHECK_COMPUTE_STATE ); + needFullClean = true; } } } @@ -1012,6 +1018,13 @@ SMESH_Hypothesis::Hypothesis_Status } } + if ( needFullClean ) { + // added or removed algo is all-dimensional + ComputeStateEngine( CLEAN ); + CleanDependsOn(); + ComputeSubMeshStateEngine( CHECK_COMPUTE_STATE ); + } + if (stateChange || modifiedHyp) ComputeStateEngine(MODIF_ALGO_STATE); -- 2.39.2