+ else
+ {
+ TopoDS_Vertex V1 = TopoDS::Vertex(subShape);
+ gp_Pnt P1 = BRep_Tool::Pnt(V1);
+ SMESHDS_Mesh * meshDS = aMesh.GetMeshDS();
+ SMDS_MeshNode * node = meshDS->AddNode(P1.X(), P1.Y(), P1.Z());
+ if ( node ) { // san - increase robustness
+ meshDS->SetNodeOnVertex(node, V1);
+ smToCompute->ComputeStateEngine(SMESH_subMesh::COMPUTE);
+ }
+ }
+ smToCompute = sm->GetFirstToCompute();
+ }
+
+ if (!ret) return false;
+
+ // JFA for PAL6524: if there are failed sub-meshes, return Standard_False
+ const map < int, SMESH_subMesh * >&subMeshes = sm->DependsOn();
+ map < int, SMESH_subMesh * >::const_iterator itsub;
+ for (itsub = subMeshes.begin(); itsub != subMeshes.end(); itsub++) {
+ SMESH_subMesh *smi = (*itsub).second;
+ if (smi->GetComputeState() == SMESH_subMesh::FAILED_TO_COMPUTE) return false;
+ }
+ if (sm->GetComputeState() == SMESH_subMesh::FAILED_TO_COMPUTE) return false;
+
+ MESSAGE( "VSR - SMESH_Gen::Compute() finished" );
+ return true;
+}
+
+
+//=======================================================================
+//function : checkConformIgnoredAlgos
+//purpose :
+//=======================================================================
+
+static bool checkConformIgnoredAlgos(SMESH_Mesh& aMesh,
+ SMESH_subMesh* aSubMesh,
+ const SMESH_Algo* aGlobIgnoAlgo,
+ const SMESH_Algo* aLocIgnoAlgo,
+ bool & checkConform,
+ map<int, SMESH_subMesh*>& aCheckedMap)
+{
+ ASSERT( aSubMesh );
+ if ( aSubMesh->GetSubShape().ShapeType() == TopAbs_VERTEX)
+ return true;
+
+
+ bool ret = true;
+
+ const list<const SMESHDS_Hypothesis*>& listHyp =
+ aMesh.GetMeshDS()->GetHypothesis( aSubMesh->GetSubShape() );
+ list<const SMESHDS_Hypothesis*>::const_iterator it=listHyp.begin();
+ for ( ; it != listHyp.end(); it++)
+ {
+ const SMESHDS_Hypothesis * aHyp = *it;
+ if (aHyp->GetType() == SMESHDS_Hypothesis::PARAM_ALGO)
+ continue;
+
+ const SMESH_Algo* algo = dynamic_cast<const SMESH_Algo*> (aHyp);
+ ASSERT ( algo );
+
+ if ( aLocIgnoAlgo ) // algo is hidden by a local algo of upper dim
+ {
+ INFOS( "Local <" << algo->GetName() << "> is hidden by local <"
+ << aLocIgnoAlgo->GetName() << ">");
+ }
+ else
+ {
+ bool isGlobal = (aMesh.IsMainShape( aSubMesh->GetSubShape() ));
+ int dim = algo->GetDim();
+ int aMaxGlobIgnoDim = ( aGlobIgnoAlgo ? aGlobIgnoAlgo->GetDim() : -1 );
+
+ if ( dim < aMaxGlobIgnoDim )
+ {
+ // algo is hidden by a global algo
+ INFOS( ( isGlobal ? "Global" : "Local" )
+ << " <" << algo->GetName() << "> is hidden by global <"
+ << aGlobIgnoAlgo->GetName() << ">");
+ }
+ else if ( !algo->NeedDescretBoundary() && !isGlobal)
+ {
+ // local algo is not hidden and hides algos on sub-shapes
+ if (checkConform && !aSubMesh->IsConform( algo ))
+ {
+ ret = false;
+ checkConform = false; // no more check conformity
+ INFOS( "ERROR: Local <" << algo->GetName() <<
+ "> would produce not conform mesh: "
+ "<Not Conform Mesh Allowed> hypotesis is missing");
+ }
+
+ // sub-algos will be hidden by a local <algo>
+ const map<int, SMESH_subMesh*>& smMap = aSubMesh->DependsOn();
+ map<int, SMESH_subMesh*>::const_reverse_iterator revItSub;
+ bool checkConform2 = false;
+ for ( revItSub = smMap.rbegin(); revItSub != smMap.rend(); revItSub++)
+ {
+ checkConformIgnoredAlgos (aMesh, (*revItSub).second, aGlobIgnoAlgo,
+ algo, checkConform2, aCheckedMap);
+ int key = (*revItSub).first;
+ SMESH_subMesh* sm = (*revItSub).second;
+ if ( aCheckedMap.find( key ) == aCheckedMap.end() )
+ {
+ aCheckedMap[ key ] = sm;
+ }
+ }
+ }
+ }
+ }