Salome HOME
untabify
[modules/geom.git] / src / GEOMAlgo / GEOMAlgo_Gluer.cxx
index fbb560ab90251e71d7b6c168c2f76575d0e5e4ae..88f1c6d8ff96aadd7fcfd97b86f07907846cca83 100755 (executable)
 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
-// File:       GEOMAlgo_Gluer.cxx
-// Created:    Sat Dec 04 12:45:53 2004
-// Author:     Peter KURNEV
-//             <peter@PREFEX>
+// File:        GEOMAlgo_Gluer.cxx
+// Created:     Sat Dec 04 12:45:53 2004
+// Author:      Peter KURNEV
+//              <peter@PREFEX>
 //
 #include <GEOMAlgo_Gluer.hxx>
 
@@ -96,7 +96,7 @@
 //
 static
   void GetSubShapes(const TopoDS_Shape& aS,
-                   TopTools_IndexedMapOfShape& aMSS);
+                    TopTools_IndexedMapOfShape& aMSS);
 
 //=======================================================================
 //function : GEOMAlgo_Gluer
@@ -278,53 +278,53 @@ void GEOMAlgo_Gluer::MakeVertices()
       aNbIP=aMIP.Extent();
       aIt1.Initialize(aMIP);
       for(; aIt1.More(); aIt1.Next()) {
-       aIP=aIt1.Key();
-       if (aMIPC.Contains(aIP)) {
-         continue;
-       }
-       //
-       const TopoDS_Shape& aVP=aMIS.FindFromKey(aIP);
-       //modified by NIZNHY-PKV Thu Jan 21 10:04:09 2010f
-       const NMTDS_BndSphere& aBoxVP=aMSB.FindFromKey(aVP);
-       //const Bnd_Box& aBoxVP=aMSB.FindFromKey(aVP);
-       //modified by NIZNHY-PKV Thu Jan 21 10:04:11 2010t
-       //
-       aSelector.Clear();
-       aSelector.SetBox(aBoxVP);
-       //
-       aNbVSD=aBBTree.Select(aSelector);
-       if (!aNbVSD) {
-         continue;  // it must not be
-       }
-       //
-       const TColStd_ListOfInteger& aLI=aSelector.Indices();
-       //
-       aIt.Initialize(aLI);
-       for (; aIt.More(); aIt.Next()) {
-         aIP1=aIt.Value();
-         if (aMIP.Contains(aIP1)) {
-           continue;
-         }
-         aMIP1.Add(aIP1);
-       } //for (; aIt.More(); aIt.Next()) {
+        aIP=aIt1.Key();
+        if (aMIPC.Contains(aIP)) {
+          continue;
+        }
+        //
+        const TopoDS_Shape& aVP=aMIS.FindFromKey(aIP);
+        //modified by NIZNHY-PKV Thu Jan 21 10:04:09 2010f
+        const NMTDS_BndSphere& aBoxVP=aMSB.FindFromKey(aVP);
+        //const Bnd_Box& aBoxVP=aMSB.FindFromKey(aVP);
+        //modified by NIZNHY-PKV Thu Jan 21 10:04:11 2010t
+        //
+        aSelector.Clear();
+        aSelector.SetBox(aBoxVP);
+        //
+        aNbVSD=aBBTree.Select(aSelector);
+        if (!aNbVSD) {
+          continue;  // it must not be
+        }
+        //
+        const TColStd_ListOfInteger& aLI=aSelector.Indices();
+        //
+        aIt.Initialize(aLI);
+        for (; aIt.More(); aIt.Next()) {
+          aIP1=aIt.Value();
+          if (aMIP.Contains(aIP1)) {
+            continue;
+          }
+          aMIP1.Add(aIP1);
+        } //for (; aIt.More(); aIt.Next()) {
       }//for(; aIt1.More(); aIt1.Next()) {
       //
       aNbIP1=aMIP1.Extent();
       if (!aNbIP1) {
-       break;
+        break;
       }
       //
       aIt1.Initialize(aMIP);
       for(; aIt1.More(); aIt1.Next()) {
-       aIP=aIt1.Key();
-       aMIPC.Add(aIP);
+        aIP=aIt1.Key();
+        aMIPC.Add(aIP);
       }
       //
       aMIP.Clear();
       aIt1.Initialize(aMIP1);
       for(; aIt1.More(); aIt1.Next()) {
-       aIP=aIt1.Key();
-       aMIP.Add(aIP);
+        aIP=aIt1.Key();
+        aMIP.Add(aIP);
       }
       aMIP1.Clear();
     }// while(1)
@@ -340,13 +340,13 @@ void GEOMAlgo_Gluer::MakeVertices()
     else { // SD vertices founded [ aMIPC ]
       aIt1.Initialize(aMIPC);
       for(j=0; aIt1.More(); aIt1.Next(), ++j) {
-       aIP=aIt1.Key();
-       const TopoDS_Shape& aVP=aMIS.FindFromKey(aIP);
-       if (!j) {
-         aVF=aVP;
-       }
-       aLVSD.Append(aVP);
-       aMVProcessed.Add(aVP);
+        aIP=aIt1.Key();
+        const TopoDS_Shape& aVP=aMIS.FindFromKey(aIP);
+        if (!j) {
+          aVF=aVP;
+        }
+        aLVSD.Append(aVP);
+        aMVProcessed.Add(aVP);
       }
     }
     myImages.Bind(aVF, aLVSD);
@@ -391,7 +391,7 @@ void GEOMAlgo_Gluer::MakeVertices()
     for (; aItS.More(); aItS.Next()) {
       const TopoDS_Shape& aVSD=aItS.Value();
       if (!myOrigins.IsBound(aVSD)) {
-       myOrigins.Bind(aVSD, aV);
+        myOrigins.Bind(aVSD, aV);
       }
     }
   }
@@ -556,12 +556,12 @@ void GEOMAlgo_Gluer::MakeShells()
       const TopoDS_Face& aF=TopoDS::Face(aExp.Current());
       aFR=TopoDS::Face(myOrigins.Find(aF));
       if (aFR.IsSame(aF)) {
-       aBB.Add(aNewShell, aF);
-       continue;
+        aBB.Add(aNewShell, aF);
+        continue;
       }
       bIsToReverse=IsToReverse(aFR, aF);
       if (bIsToReverse) {
-       aFR.Reverse();
+        aFR.Reverse();
       }
       aBB.Add(aNewShell, aFR);
     }
@@ -662,25 +662,25 @@ void GEOMAlgo_Gluer::MakeShapes(const TopAbs_ShapeEnum aType)
     if (aNbSDF==1) {
       bHasNewSubShape=HasNewSubShape(aS1);
       if (!bHasNewSubShape) {
-       aNewShape=aS1;
-       aNewShape.Orientation(TopAbs_FORWARD);
+        aNewShape=aS1;
+        aNewShape.Orientation(TopAbs_FORWARD);
       }
     }
     //
     if (bHasNewSubShape) {
       if (aType==TopAbs_FACE) {
-       TopoDS_Face aNewFace;
-       //
-       const TopoDS_Face& aF1=TopoDS::Face(aS1);
-       MakeFace(aF1, aNewFace);
-       aNewShape=aNewFace;
+        TopoDS_Face aNewFace;
+        //
+        const TopoDS_Face& aF1=TopoDS::Face(aS1);
+        MakeFace(aF1, aNewFace);
+        aNewShape=aNewFace;
       }
       else if (aType==TopAbs_EDGE) {
-       TopoDS_Edge aNewEdge;
-       //
-       const TopoDS_Edge& aE1=TopoDS::Edge(aS1);
-       MakeEdge(aE1, aNewEdge);
-       aNewShape=aNewEdge;
+        TopoDS_Edge aNewEdge;
+        //
+        const TopoDS_Edge& aE1=TopoDS::Edge(aS1);
+        MakeEdge(aE1, aNewEdge);
+        aNewShape=aNewEdge;
       }
     }
     //
@@ -690,7 +690,7 @@ void GEOMAlgo_Gluer::MakeShapes(const TopAbs_ShapeEnum aType)
     for (; aItS.More(); aItS.Next()) {
       const TopoDS_Shape& aFSD=aItS.Value();
       if (!myOrigins.IsBound(aFSD)) {
-       myOrigins.Bind(aFSD, aNewShape);
+        myOrigins.Bind(aFSD, aNewShape);
       }
     }
   }
@@ -730,12 +730,12 @@ void GEOMAlgo_Gluer::CheckResult()
     for (j=1; j<=aNbFS; ++j) {
       const TopoDS_Shape& aFS=aMFS(j);
       if (aMFR.Contains(aFS)) {
-       const TopTools_ListOfShape& aLSx=aMFR.FindFromKey(aFS);
-       aNbSx=aLSx.Extent();
-       if (aNbSx==2) {
-         bFound=!bFound;
-         break;
-       }
+        const TopTools_ListOfShape& aLSx=aMFR.FindFromKey(aFS);
+        aNbSx=aLSx.Extent();
+        if (aNbSx==2) {
+          bFound=!bFound;
+          break;
+        }
       }
     }
     //
@@ -797,7 +797,7 @@ void GEOMAlgo_Gluer::InnerTolerance()
 //purpose  :
 //=======================================================================
 void GEOMAlgo_Gluer::FacePassKey(const TopoDS_Face& aF,
-                                GEOMAlgo_PassKeyShape& aPK)
+                                 GEOMAlgo_PassKeyShape& aPK)
 {
   Standard_Integer i, aNbE;
   TopTools_ListOfShape aLE;
@@ -822,7 +822,7 @@ void GEOMAlgo_Gluer::FacePassKey(const TopoDS_Face& aF,
 //purpose  :
 //=======================================================================
 void GEOMAlgo_Gluer::EdgePassKey(const TopoDS_Edge& aE,
-                                GEOMAlgo_PassKeyShape& aPK)
+                                 GEOMAlgo_PassKeyShape& aPK)
 {
   TopoDS_Vertex aV1, aV2;
   //
@@ -841,7 +841,7 @@ void GEOMAlgo_Gluer::EdgePassKey(const TopoDS_Edge& aE,
 //purpose  :
 //=======================================================================
 void GEOMAlgo_Gluer::MakeVertex(const TopTools_ListOfShape& aLV,
-                               TopoDS_Vertex& aNewVertex)
+                                TopoDS_Vertex& aNewVertex)
 {
   Standard_Integer aNbV;
   Standard_Real aTolV, aD, aDmax;
@@ -887,7 +887,7 @@ void GEOMAlgo_Gluer::MakeVertex(const TopTools_ListOfShape& aLV,
 //purpose  :
 //=======================================================================
 void GEOMAlgo_Gluer::MakeEdge(const TopoDS_Edge& aE,
-                             TopoDS_Edge& aNewEdge)
+                              TopoDS_Edge& aNewEdge)
 {
   myErrorStatus=0;
   //
@@ -941,7 +941,7 @@ void GEOMAlgo_Gluer::MakeEdge(const TopoDS_Edge& aE,
 //purpose  :
 //=======================================================================
 void GEOMAlgo_Gluer::MakeFace(const TopoDS_Face& aF,
-                             TopoDS_Face& aNewFace)
+                              TopoDS_Face& aNewFace)
 {
   myErrorStatus=0;
   //
@@ -977,20 +977,20 @@ void GEOMAlgo_Gluer::MakeFace(const TopoDS_Face& aF,
       //
       aER.Orientation(TopAbs_FORWARD);
       if (!BRep_Tool::Degenerated(aER)) {
-       // build p-curve
-       if (bIsUPeriodic) {
-         GEOMAlgo_Tools::RefinePCurveForEdgeOnFace(aER, aFFWD, aUMin, aUMax);
-       }
-       BOPTools_Tools2D::BuildPCurveForEdgeOnFace(aER, aFFWD);
+        // build p-curve
+        if (bIsUPeriodic) {
+          GEOMAlgo_Tools::RefinePCurveForEdgeOnFace(aER, aFFWD, aUMin, aUMax);
+        }
+        BOPTools_Tools2D::BuildPCurveForEdgeOnFace(aER, aFFWD);
 
-       // orient image
-       bIsToReverse=BOPTools_Tools3D::IsSplitToReverse1(aER, aE, myContext);
-       if (bIsToReverse) {
-         aER.Reverse();
-       }
+        // orient image
+        bIsToReverse=BOPTools_Tools3D::IsSplitToReverse1(aER, aE, myContext);
+        if (bIsToReverse) {
+          aER.Reverse();
+        }
       }
       else {
-       aER.Orientation(aE.Orientation());
+        aER.Orientation(aE.Orientation());
       }
       //
       aBB.Add(newWire, aER);
@@ -1011,7 +1011,7 @@ void GEOMAlgo_Gluer::MakeFace(const TopoDS_Face& aF,
 //purpose  :
 //=======================================================================
 Standard_Boolean GEOMAlgo_Gluer::IsToReverse(const TopoDS_Face& aFR,
-                                            const TopoDS_Face& aF)
+                                             const TopoDS_Face& aF)
 {
   Standard_Boolean bRet;
   Standard_Real aT, aT1, aT2, aTR, aScPr;
@@ -1090,7 +1090,7 @@ Standard_Boolean GEOMAlgo_Gluer::HasNewSubShape(const TopoDS_Shape& aS)const
 //purpose  :
 //=======================================================================
 void GetSubShapes(const TopoDS_Shape& aS,
-                 TopTools_IndexedMapOfShape& aMSS)
+                  TopTools_IndexedMapOfShape& aMSS)
 {
   Standard_Integer aR;
   TopAbs_ShapeEnum aType;
@@ -1129,7 +1129,7 @@ const TopTools_ListOfShape& GEOMAlgo_Gluer::Modified (const TopoDS_Shape& aS)
     if(myOrigins.IsBound(aS)) {
       const TopoDS_Shape& aSnew=myOrigins.Find(aS);
       if (!aSnew.IsSame(aS)) {
-       myGenerated.Append(aSnew);
+        myGenerated.Append(aSnew);
       }
     }
   }