+//modified by NIZNHY-PKV Mon Dec 4 12:55:50 2006t
+/*
+static
+ Standard_Boolean IsPairFound(const Standard_Integer nF1,
+ const Standard_Integer nF2,
+ BOPTools_InterferencePool* myIntrPool,
+ BOPTColStd_IndexedDataMapOfIntegerIndexedMapOfInteger& aMapWhat,
+ BOPTColStd_IndexedDataMapOfIntegerIndexedMapOfInteger& aMapWith);
+
+static
+ void FMapWhat(const Standard_Integer nF,
+ BOPTools_InterferencePool* myIntrPool,
+ TColStd_IndexedMapOfInteger& aMapWhat);
+static
+ void FMapWith(const Standard_Integer nF,
+ BOPTools_InterferencePool* myIntrPool,
+ TColStd_IndexedMapOfInteger& aMapWith);
+static
+ Standard_Boolean IsFound(const TColStd_IndexedMapOfInteger& aMapWhat,
+ const TColStd_IndexedMapOfInteger& aMapWith);
+
+//=======================================================================
+// function: IsPairFound
+// purpose:
+//=======================================================================
+Standard_Boolean IsPairFound(const Standard_Integer nF1,
+ const Standard_Integer nF2,
+ BOPTools_InterferencePool* myIntrPool,
+ BOPTColStd_IndexedDataMapOfIntegerIndexedMapOfInteger& aMapWhat,
+ BOPTColStd_IndexedDataMapOfIntegerIndexedMapOfInteger& aMapWith)
+{
+ Standard_Boolean bIsFound;
+ //
+ if (!aMapWhat.Contains(nF1)) {
+ TColStd_IndexedMapOfInteger aMWhat;
+ FMapWhat(nF1, myIntrPool, aMWhat);
+ aMapWhat.Add(nF1, aMWhat);
+ }
+ //
+ if (!aMapWith.Contains(nF2)) {
+ TColStd_IndexedMapOfInteger aMWith;
+ FMapWith(nF2, myIntrPool, aMWith);
+ aMapWith.Add(nF2, aMWith);
+ }
+ //
+ const TColStd_IndexedMapOfInteger& aMWht=aMapWhat.FindFromKey(nF1);
+ const TColStd_IndexedMapOfInteger& aMWit=aMapWith.FindFromKey(nF2);
+ //
+ bIsFound=IsFound(aMWht, aMWit);
+ //
+ return bIsFound;
+}
+//=======================================================================
+// function: FMapWhat
+// purpose:
+//=======================================================================
+void FMapWhat(const Standard_Integer nF,
+ BOPTools_InterferencePool* myIntrPool,
+ TColStd_IndexedMapOfInteger& aMapWhat)
+
+{
+ Standard_Integer nE, nV;
+ //
+ BooleanOperations_ShapesDataStructure* myDS=myIntrPool->DS();
+ BooleanOperations_OnceExplorer aExp(*myDS);
+ //
+ // What
+ aMapWhat.Add(nF);
+ aExp.Init(nF, TopAbs_VERTEX);
+ for (; aExp.More(); aExp.Next()) {
+ nV=aExp.Current();
+ aMapWhat.Add(nV);
+ }
+ //
+ aExp.Init(nF, TopAbs_EDGE);
+ for (; aExp.More(); aExp.Next()) {
+ nE=aExp.Current();
+ aMapWhat.Add(nE);
+ }
+}
+//=======================================================================
+// function: FMapWith
+// purpose:
+//=======================================================================
+void FMapWith(const Standard_Integer nF,
+ BOPTools_InterferencePool* myIntrPool,
+ TColStd_IndexedMapOfInteger& aMapWith)
+{
+ TColStd_IndexedMapOfInteger aMapWhat;
+
+ FMapWhat(nF, myIntrPool, aMapWhat);
+ //
+ // With
+ Standard_Integer i, aNb, anIndex, aWhat, aWith;
+ BOPTools_ListIteratorOfListOfInterference anIt;
+
+ const BOPTools_CArray1OfInterferenceLine& anArrIL= myIntrPool->InterferenceTable();
+
+ aNb=aMapWhat.Extent();
+ for (i=1; i<=aNb; i++) {
+ aWhat=aMapWhat(i);
+
+ const BOPTools_InterferenceLine& aWithLine=anArrIL(aWhat);
+
+ const BOPTools_ListOfInterference& aLI=aWithLine.List();
+ anIt.Initialize(aLI);
+ for (; anIt.More(); anIt.Next()) {
+ const BOPTools_Interference& anIntf=anIt.Value();
+ anIndex=anIntf.Index();
+ if (anIndex) {
+ aWith=anIntf.With();
+ aMapWith.Add(aWith);
+ }
+ }
+ }
+}
+//=======================================================================
+// function: IsFound
+// purpose:
+//=======================================================================
+Standard_Boolean IsFound(const TColStd_IndexedMapOfInteger& aMapWhat,
+ const TColStd_IndexedMapOfInteger& aMapWith)
+{
+ Standard_Boolean bFlag=Standard_False;
+ Standard_Integer i, aNb, aWhat;
+
+ aNb=aMapWhat.Extent();
+ for (i=1; i<=aNb; i++) {
+ aWhat=aMapWhat(i);
+ if (aMapWith.Contains(aWhat)) {
+ return !bFlag;
+ }
+ }
+ return bFlag;
+}
+*/