Salome HOME
Merge from V5_1_main 14/05/2010
[modules/geom.git] / src / GEOMAlgo / GEOMAlgo_Builder_4.cxx
index 8465cebbaf5f6a920a7ae61bca0737cb0d96e31e..9b94938f1115ef3bf5ee8420bf621ce300227039 100755 (executable)
@@ -1,26 +1,29 @@
-// Copyright (C) 2005  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2010  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
-// File:       GEOMAlgo_Builder_4.cxx
-// Created:    
-// Author:     Peter KURNEV 
 
+// File:        GEOMAlgo_Builder_4.cxx
+// Created:     
+// Author:      Peter KURNEV 
+//
 #include <GEOMAlgo_Builder.hxx>
 
 #include <TopoDS_Iterator.hxx>
@@ -40,7 +43,7 @@
 
 static
   void MapShapes(const TopoDS_Shape& aS,
-                TopTools_MapOfShape& aM);
+                 TopTools_MapOfShape& aM);
 
 //=======================================================================
 //function : Generated
@@ -76,21 +79,21 @@ static
     for (; aIt.More(); aIt.Next()) {
       const TopoDS_Shape& aSp=aIt.Value();
       if (mySameDomainShapes.Contains(aSp)) {
-       if (myMapShape.Contains(aSp)) {
-         TopoDS_Shape aSpR=mySameDomainShapes.FindFromKey(aSp);
-         //
-         if (aType==TopAbs_VERTEX || aType==TopAbs_SOLID) {
-           aSpR.Orientation(theS.Orientation());
-         }
-         else {
-           bToReverse=GEOMAlgo_Tools3D::IsSplitToReverse(aSpR, theS, aCtx);
-           if (bToReverse) {
-             aSpR.Reverse();
-           }
-         }
-         //
-         myHistShapes.Append(aSpR);
-       }
+        if (myMapShape.Contains(aSp)) {
+          TopoDS_Shape aSpR=mySameDomainShapes.FindFromKey(aSp);
+          //
+          if (aType==TopAbs_VERTEX || aType==TopAbs_SOLID) {
+            aSpR.Orientation(theS.Orientation());
+          }
+          else {
+            bToReverse=GEOMAlgo_Tools3D::IsSplitToReverse(aSpR, theS, aCtx);
+            if (bToReverse) {
+              aSpR.Reverse();
+            }
+          }
+          //
+          myHistShapes.Append(aSpR);
+        }
       }
     }
   }
@@ -131,20 +134,20 @@ static
     for (; aIt.More(); aIt.Next()) {
       TopoDS_Shape aSp=aIt.Value();
       if (!mySameDomainShapes.Contains(aSp)) {
-       if (myMapShape.Contains(aSp)) {
-         //
-         if (aType==TopAbs_VERTEX || aType==TopAbs_SOLID) {
-           aSp.Orientation(theS.Orientation());
-         }
-         else {
-           bToReverse=GEOMAlgo_Tools3D::IsSplitToReverse(aSp, theS, aCtx);
-           if (bToReverse) {
-             aSp.Reverse();
-           }
-         }
-         //
-         myHistShapes.Append(aSp);
-       }
+        if (myMapShape.Contains(aSp)) {
+          //
+          if (aType==TopAbs_VERTEX || aType==TopAbs_SOLID) {
+            aSp.Orientation(theS.Orientation());
+          }
+          else {
+            bToReverse=GEOMAlgo_Tools3D::IsSplitToReverse(aSp, theS, aCtx);
+            if (bToReverse) {
+              aSp.Reverse();
+            }
+          }
+          //
+          myHistShapes.Append(aSp);
+        }
       }
     }
   }
@@ -186,15 +189,15 @@ static
       TopoDS_Shape aSp=aIt.Value();
       //
       if (!mySameDomainShapes.Contains(aSp)) {
-       if (myMapShape.Contains(aSp)) {
-         return bRet; //false
-       }
+        if (myMapShape.Contains(aSp)) {
+          return bRet; //false
+        }
       }
       else {
-       TopoDS_Shape aSpR=mySameDomainShapes.FindFromKey(aSp);
-       if (myMapShape.Contains(aSpR)) {
-         return bRet; //false
-       }
+        TopoDS_Shape aSpR=mySameDomainShapes.FindFromKey(aSp);
+        if (myMapShape.Contains(aSpR)) {
+          return bRet; //false
+        }
       }
     }
   }
@@ -242,18 +245,18 @@ static
     bHasImage=myImages.HasImage(aSx);
     if (!bHasImage) {
       if (myMapShape.Contains(aSx)) {
-       aLSx.Append(aSx);
-       myImagesResult.Add(aSx, aLSx);
+        aLSx.Append(aSx);
+        myImagesResult.Add(aSx, aLSx);
       }
     }
     else {
       const TopTools_ListOfShape& aLSp=myImages.Image(aSx);
       aIt.Initialize(aLSp);
       for (; aIt.More(); aIt.Next()) {
-       const TopoDS_Shape& aSp=aIt.Value();
-       if (myMapShape.Contains(aSp)) {
-         aLSx.Append(aSp);
-       }
+        const TopoDS_Shape& aSp=aIt.Value();
+        if (myMapShape.Contains(aSp)) {
+          aLSx.Append(aSp);
+        }
       }
       myImagesResult.Add(aSx, aLSx);
     }
@@ -267,32 +270,32 @@ static
     //
     if (!myHasGenerated || !myHasModified) {
       if (aType==TopAbs_EDGE   || aType==TopAbs_FACE || 
-         aType==TopAbs_VERTEX || aType==TopAbs_SOLID) {
-       //modified by NIZNHY-PKV Thu Dec  7 11:53:01 2006f
-       //bHasImage=myImages.HasImage(aSx);
-       //modified by NIZNHY-PKV Thu Dec  7 11:53:04 2006t
-       if (bHasImage) {
-         const TopTools_ListOfShape& aLSp=myImages.Image(aSx);
-         aIt.Initialize(aLSp);
-         for (; aIt.More(); aIt.Next()) {
-           const TopoDS_Shape& aSp=aIt.Value();
-           //
-           if (myMapShape.Contains(aSp)) {
-             bContainsSD=mySameDomainShapes.Contains(aSp);
-             //
-             if (!myHasGenerated) {
-               if (bContainsSD) {
-                 myHasGenerated=Standard_True;
-               }
-             }
-             if (!myHasModified) {
-               if (!bContainsSD) {
-                 myHasModified=Standard_True;
-               }
-             }
-           } // if (myMapShape.Contains(aSp))
-         }
-       }
+          aType==TopAbs_VERTEX || aType==TopAbs_SOLID) {
+        //modified by NIZNHY-PKV Thu Dec  7 11:53:01 2006f
+        //bHasImage=myImages.HasImage(aSx);
+        //modified by NIZNHY-PKV Thu Dec  7 11:53:04 2006t
+        if (bHasImage) {
+          const TopTools_ListOfShape& aLSp=myImages.Image(aSx);
+          aIt.Initialize(aLSp);
+          for (; aIt.More(); aIt.Next()) {
+            const TopoDS_Shape& aSp=aIt.Value();
+            //
+            if (myMapShape.Contains(aSp)) {
+              bContainsSD=mySameDomainShapes.Contains(aSp);
+              //
+              if (!myHasGenerated) {
+                if (bContainsSD) {
+                  myHasGenerated=Standard_True;
+                }
+              }
+              if (!myHasModified) {
+                if (!bContainsSD) {
+                  myHasModified=Standard_True;
+                }
+              }
+            } // if (myMapShape.Contains(aSp))
+          }
+        }
       } 
     }
   }
@@ -303,7 +306,7 @@ static
 //purpose  : 
 //=======================================================================
   void MapShapes(const TopoDS_Shape& theS,
-                TopTools_MapOfShape& theM)
+                 TopTools_MapOfShape& theM)
 {
   theM.Add(theS);
   TopoDS_Iterator anIt;