From b70b7f4e00ae51b80819e32cc1b4d8d88791e361 Mon Sep 17 00:00:00 2001 From: eap Date: Wed, 6 Dec 2006 16:03:57 +0000 Subject: [PATCH] PAL13473 (Build repetitive mesh): add BAD_PARAM_VALUE algo error --- src/SMESH/SMESH_Gen.cxx | 25 ++++++++++++------------- src/SMESH/SMESH_Gen.hxx | 6 +++++- 2 files changed, 17 insertions(+), 14 deletions(-) diff --git a/src/SMESH/SMESH_Gen.cxx b/src/SMESH/SMESH_Gen.cxx index 1febbb03a..9fa10ca3e 100644 --- a/src/SMESH/SMESH_Gen.cxx +++ b/src/SMESH/SMESH_Gen.cxx @@ -373,12 +373,21 @@ static bool checkMissing(SMESH_Gen* aGen, bool IsGlobalHypothesis = aGen->IsGlobalHypothesis( algo, aMesh ); if (!IsGlobalHypothesis || !globalChecked[ algo->GetDim() ]) { - INFOS( "ERROR: " << (IsGlobalHypothesis ? "Global " : "Local ") - << "<" << algo->GetName() << "> misses some hypothesis"); + SMESH_Gen::TAlgoStateErrorName errName = SMESH_Gen::MISSING_HYPO; + SMESH_Hypothesis::Hypothesis_Status status; + algo->CheckHypothesis( aMesh, aSubMesh->GetSubShape(), status ); + if ( status == SMESH_Hypothesis::HYP_BAD_PARAMETER ) { + INFOS( "ERROR: hypothesis of " << (IsGlobalHypothesis ? "Global " : "Local ") + << "<" << algo->GetName() << "> has a bad parameter value"); + errName = SMESH_Gen::BAD_PARAM_VALUE; + } else { + INFOS( "ERROR: " << (IsGlobalHypothesis ? "Global " : "Local ") + << "<" << algo->GetName() << "> misses some hypothesis"); + } if (IsGlobalHypothesis) globalChecked[ algo->GetDim() ] = true; theErrors.push_back( SMESH_Gen::TAlgoStateError() ); - theErrors.back().Set( SMESH_Gen::MISSING_HYPO, algo, IsGlobalHypothesis ); + theErrors.back().Set( errName, algo, IsGlobalHypothesis ); } ret = false; break; @@ -613,7 +622,6 @@ bool SMESH_Gen::IsGlobalHypothesis(const SMESH_Hypothesis* theHyp, SMESH_Mesh& a SMESH_Algo *SMESH_Gen::GetAlgo(SMESH_Mesh & aMesh, const TopoDS_Shape & aShape) { -// MESSAGE("SMESH_Gen::GetAlgo"); SMESH_HypoFilter filter( SMESH_HypoFilter::IsAlgo() ); filter.And( filter.IsApplicableTo( aShape )); @@ -624,15 +632,6 @@ SMESH_Algo *SMESH_Gen::GetAlgo(SMESH_Mesh & aMesh, const TopoDS_Shape & aShape) if ( algoList.empty() ) return NULL; - // Now it is checked in SMESH_Mesh::GetHypotheses() -// if (algoList.size() > 1 ) { // check if there is one algo several times -// list ::iterator algo = algoList.begin(); -// for ( ; algo != algoList.end(); ++algo ) -// if ( (*algo) != algoList.front() && -// (*algo)->GetName() != algoList.front()->GetName() ) -// return NULL; -// } - return const_cast ( static_cast( algoList.front() )); } diff --git a/src/SMESH/SMESH_Gen.hxx b/src/SMESH/SMESH_Gen.hxx index f2887c044..58d03e6f5 100644 --- a/src/SMESH/SMESH_Gen.hxx +++ b/src/SMESH/SMESH_Gen.hxx @@ -69,7 +69,11 @@ class SMESH_Gen // if Compute() would fail because of some algo bad state - enum TAlgoStateErrorName { NONE=0, MISSING_ALGO, MISSING_HYPO, NOT_CONFORM_MESH }; + enum TAlgoStateErrorName { NONE=0, + MISSING_ALGO, + MISSING_HYPO, + NOT_CONFORM_MESH, + BAD_PARAM_VALUE }; struct TAlgoStateError { TAlgoStateErrorName _name; -- 2.39.2