+//=======================================================================
+//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;
+ }
+ }
+ }
+ }
+ }
+
+ return ret;
+}
+
+//=======================================================================
+//function : checkMissing
+//purpose : notify on missing hypothesis
+// Return false if algo or hipothesis is missing
+//=======================================================================
+
+static bool checkMissing(SMESH_Gen* aGen,
+ SMESH_Mesh& aMesh,
+ SMESH_subMesh* aSubMesh,
+ const int aTopAlgoDim,
+ bool* globalChecked,
+ const bool checkNoAlgo,
+ map<int, SMESH_subMesh*>& aCheckedMap)