X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FSMESH%2FSMESH_Gen.cxx;h=29f896bf8286b943690b9ac94ee731b5db3a0abc;hb=64c772da5a9dd285f16f1f7efa07bb4c7fbdd4c3;hp=3c34f2e63ef77685268dade7d3f02e6b4c8c672a;hpb=358f8ddd54e7ed553eecc22ca665575e4019e3a0;p=modules%2Fsmesh.git diff --git a/src/SMESH/SMESH_Gen.cxx b/src/SMESH/SMESH_Gen.cxx index 3c34f2e63..29f896bf8 100644 --- a/src/SMESH/SMESH_Gen.cxx +++ b/src/SMESH/SMESH_Gen.cxx @@ -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;