+ }
+
+ const map<int, SMESH_subMesh*>& smMap = sm->DependsOn();
+ map<int, SMESH_subMesh*>::const_reverse_iterator revItSub = smMap.rbegin();
+ map<int, SMESH_subMesh*> aCheckedMap;
+ bool checkConform = ( !aMesh.IsNotConformAllowed() );
+ int aKey = 1;
+ SMESH_subMesh* smToCheck = sm;
+
+ // loop on aShape and its sub-shapes
+ while ( smToCheck )
+ {
+ if ( smToCheck->GetSubShape().ShapeType() == TopAbs_VERTEX)
+ break;
+
+ if ( aCheckedMap.find( aKey ) == aCheckedMap.end() )
+ if (!checkConformIgnoredAlgos (aMesh, smToCheck, aGlobIgnoAlgo,
+ 0, checkConform, aCheckedMap))
+ ret = false;
+
+ if ( smToCheck->GetAlgoState() != SMESH_subMesh::NO_ALGO )
+ hasAlgo = true;
+
+ // next subMesh
+ if (revItSub != smMap.rend())
+ {
+ aKey = (*revItSub).first;
+ smToCheck = (*revItSub).second;
+ revItSub++;
+ }
+ else
+ {
+ smToCheck = 0;
+ }
+
+ }
+
+ // ----------------------------------------------------------------
+ // info on missing hypothesis and find out if all needed algos are
+ // well defined
+ // ----------------------------------------------------------------
+
+ //MESSAGE( "---info on missing hypothesis and find out if all needed algos are");
+
+ // find max dim of global algo
+ int aTopAlgoDim = 0;
+ for (dim = 3; dim > 0; dim--)
+ {
+ if (aGlobAlgoArr[ dim ])
+ {
+ aTopAlgoDim = dim;
+ break;
+ }
+ }
+ aCheckedMap.clear();
+ smToCheck = sm;
+ revItSub = smMap.rbegin();
+ bool checkNoAlgo = (bool) aTopAlgoDim;
+ bool globalChecked[] = { false, false, false, false };
+
+ // loop on aShape and its sub-shapes
+ while ( smToCheck )
+ {
+ if ( smToCheck->GetSubShape().ShapeType() == TopAbs_VERTEX)
+ break;
+
+ if ( aCheckedMap.find( aKey ) == aCheckedMap.end() )
+ if (!checkMissing (this, aMesh, smToCheck, aTopAlgoDim,
+ globalChecked, checkNoAlgo, aCheckedMap))
+ {
+ ret = false;
+ if (smToCheck->GetAlgoState() == SMESH_subMesh::NO_ALGO )
+ checkNoAlgo = false;
+ }
+
+ // next subMesh
+ if (revItSub != smMap.rend())
+ {
+ aKey = (*revItSub).first;
+ smToCheck = (*revItSub).second;
+ revItSub++;
+ }
+ else
+ smToCheck = 0;
+ }
+
+ if ( !hasAlgo )
+ INFOS( "None algorithm attached" );
+
+ return ( ret && hasAlgo );
+}
+
+//=======================================================================
+//function : IsGlobalHypothesis
+//purpose : check if theAlgo is attached to the main shape
+//=======================================================================
+
+bool SMESH_Gen::IsGlobalHypothesis(const SMESH_Hypothesis* theHyp, SMESH_Mesh& aMesh)
+{
+ SMESH_HypoFilter filter( SMESH_HypoFilter::Is( theHyp ));
+ return aMesh.GetHypothesis( aMesh.GetMeshDS()->ShapeToMesh(), filter, false );