Salome HOME
Color Number (Color Group) parameter is returned for compatibility
[modules/smesh.git] / src / SMESH / SMESH_Gen.cxx
index 3c34f2e63ef77685268dade7d3f02e6b4c8c672a..29f896bf8286b943690b9ac94ee731b5db3a0abc 100644 (file)
@@ -29,6 +29,7 @@
 #include "SMESH_Gen.hxx"
 #include "SMESH_subMesh.hxx"
 #include "SMESH_HypoFilter.hxx"
+#include "SMESHDS_Document.hxx"
 #include "SMDS_MeshElement.hxx"
 #include "SMDS_MeshNode.hxx"
 
@@ -162,6 +163,14 @@ bool SMESH_Gen::Compute(SMESH_Mesh & aMesh, const TopoDS_Shape & aShape)
       if (smToCompute->GetComputeState() == SMESH_subMesh::FAILED_TO_COMPUTE)
         ret = false;;
     }
+    if ((algo && !aMesh.HasShapeToMesh()))
+    {
+      if (smToCompute->GetComputeState() == SMESH_subMesh::READY_TO_COMPUTE)
+        smToCompute->ComputeStateEngine( SMESH_subMesh::COMPUTE );
+      
+      if (smToCompute->GetComputeState() == SMESH_subMesh::FAILED_TO_COMPUTE)
+        ret = false;;
+    }
   }
 
   // -----------------------------------------------
@@ -301,7 +310,7 @@ static bool checkMissing(SMESH_Gen*                aGen,
       int shapeDim = SMESH_Gen::GetShapeDim( aSubMesh->GetSubShape() );
       if (aTopAlgoDim > shapeDim)
       {
-        INFOS( "ERROR: " << shapeDim << "D algorithm is missing" );
+        MESSAGE( "ERROR: " << shapeDim << "D algorithm is missing" );
         ret = false;
         theErrors.push_back( SMESH_Gen::TAlgoStateError() );
         theErrors.back().Set( SMESH_Hypothesis::HYP_MISSING, shapeDim, true );
@@ -320,12 +329,16 @@ static bool checkMissing(SMESH_Gen*                aGen,
       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_Hypothesis::HYP_BAD_PARAMETER;
+        MESSAGE( "ERROR: hypothesis of " << (IsGlobalHypothesis ? "Global " : "Local ")
+                 << "<" << algo->GetName() << "> has a bad parameter value");
+        errName = status;
+      } else if ( status == SMESH_Hypothesis::HYP_BAD_GEOMETRY ) {
+        MESSAGE( "ERROR: " << (IsGlobalHypothesis ? "Global " : "Local ")
+                 << "<" << algo->GetName() << "> assigned to mismatching geometry");
+        errName = status;
       } else {
-        INFOS( "ERROR: " << (IsGlobalHypothesis ? "Global " : "Local ")
-               << "<" << algo->GetName() << "> misses some hypothesis");
+        MESSAGE( "ERROR: " << (IsGlobalHypothesis ? "Global " : "Local ")
+                 << "<" << algo->GetName() << "> misses some hypothesis");
       }
       if (IsGlobalHypothesis)
         globalChecked[ algo->GetDim() ] = true;