Salome HOME
PAL13473 (Build repetitive mesh):
authoreap <eap@opencascade.com>
Wed, 6 Dec 2006 16:03:57 +0000 (16:03 +0000)
committereap <eap@opencascade.com>
Wed, 6 Dec 2006 16:03:57 +0000 (16:03 +0000)
add BAD_PARAM_VALUE algo error

src/SMESH/SMESH_Gen.cxx
src/SMESH/SMESH_Gen.hxx

index 1febbb03a9c115e3def980976eb6cb06f5c914e6..9fa10ca3e8e66722e78f319d4593beb0e3404d59 100644 (file)
@@ -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 <const SMESHDS_Hypothesis * >::iterator algo = algoList.begin();
-//     for ( ; algo != algoList.end(); ++algo )
-//       if ( (*algo) != algoList.front() &&
-//            (*algo)->GetName() != algoList.front()->GetName() )
-//         return NULL;
-//   }
-
   return const_cast<SMESH_Algo*> ( static_cast<const SMESH_Algo* >( algoList.front() ));
 }
 
index f2887c0443a22986355b7b6da4d7346c6b23e141..58d03e6f5d0a7d5f603a895fbddb3e2751ef7b8f 100644 (file)
@@ -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;