Salome HOME
Fix regression: storeViewParameters() does not work for OCC view
[modules/geom.git] / src / GEOMAlgo / GEOMAlgo_SurfaceTools.cxx
index 436d05f1df91a6f666fd8ab60f4a9383e6029a19..dea6730fa48752bc793d69d8cb7053565c460c0d 100644 (file)
@@ -1,28 +1,30 @@
-// 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/
+//  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_SurfaceTools.cxx
-// Created:    Thu Jan 27 11:05:16 2005
-// Author:     Peter KURNEV
-//             <pkv@irinox>
-
 
+// File:        GEOMAlgo_SurfaceTools.cxx
+// Created:     Thu Jan 27 11:05:16 2005
+// Author:      Peter KURNEV
+//              <pkv@irinox>
+//
 #include <GEOMAlgo_SurfaceTools.ixx>
 
 #include <math.h>
@@ -46,9 +48,9 @@
 //purpose  : 
 //=======================================================================
  Standard_Integer GEOMAlgo_SurfaceTools::GetState(const gp_Pnt& aP,
-                                                 const GeomAdaptor_Surface& aGAS,
-                                                 const Standard_Real aTol,
-                                                 TopAbs_State& aState)
+                                                  const GeomAdaptor_Surface& aGAS,
+                                                  const Standard_Real aTol,
+                                                  TopAbs_State& aState)
 {
   Standard_Integer iErr;
   Standard_Real aDp, aR;
 //purpose  : 
 //=======================================================================
  Standard_Integer GEOMAlgo_SurfaceTools::GetState(const gp_Pnt& aP,
-                                                 const Handle(Geom_Surface)& aSurf,
-                                                 const Standard_Real aTol,
-                                                 TopAbs_State& aState)
+                                                  const Handle(Geom_Surface)& aSurf,
+                                                  const Standard_Real aTol,
+                                                  TopAbs_State& aState)
 {
   Standard_Integer iErr;
   GeomAdaptor_Surface aGAS;
 //purpose  : 
 //=======================================================================
 Standard_Real GEOMAlgo_SurfaceTools::Distance(const gp_Pnt& aP, 
-                                             const gp_Sphere& aSph)
+                                              const gp_Sphere& aSph)
 {
   Standard_Real aD;
   //
@@ -156,7 +158,7 @@ Standard_Real GEOMAlgo_SurfaceTools::Distance(const gp_Pnt& aP,
 //purpose  : 
 //=======================================================================
 Standard_Real GEOMAlgo_SurfaceTools::Distance(const gp_Pnt& aP, 
-                                             const gp_Cylinder& aCyl)
+                                              const gp_Cylinder& aCyl)
 {
   Standard_Real aD;
   //
@@ -171,7 +173,7 @@ Standard_Real GEOMAlgo_SurfaceTools::Distance(const gp_Pnt& aP,
 //purpose  : 
 //=======================================================================
 Standard_Real GEOMAlgo_SurfaceTools::Distance(const gp_Pnt& aP, 
-                                             const gp_Pln& aPL)
+                                              const gp_Pln& aPL)
 {
   Standard_Real aD;
   //
@@ -189,9 +191,9 @@ Standard_Real GEOMAlgo_SurfaceTools::Distance(const gp_Pnt& aP,
 //purpose  : 
 //=======================================================================
 Standard_Boolean GEOMAlgo_SurfaceTools::IsCoaxial(const gp_Pnt& aP1,
-                                                 const gp_Pnt& aP2,
-                                                 const gp_Cylinder& aCyl,
-                                                 const Standard_Real aTol)
+                                                  const gp_Pnt& aP2,
+                                                  const gp_Cylinder& aCyl,
+                                                  const Standard_Real aTol)
 {
   Standard_Boolean bRet=Standard_False;
   Standard_Real aSM;
@@ -222,8 +224,8 @@ Standard_Boolean GEOMAlgo_SurfaceTools::IsAnalytic(const Handle(Geom_Surface)& a
   aGAS.Load(aSurf);
   aType=aGAS.GetType();
   bRet=(aType==GeomAbs_Plane || 
-       aType==GeomAbs_Cylinder ||
-       aType==GeomAbs_Sphere);
+        aType==GeomAbs_Cylinder ||
+        aType==GeomAbs_Sphere);
   return bRet;
 }
 //=======================================================================
@@ -231,34 +233,34 @@ Standard_Boolean GEOMAlgo_SurfaceTools::IsAnalytic(const Handle(Geom_Surface)& a
 //purpose  : 
 //=======================================================================
 Standard_Boolean GEOMAlgo_SurfaceTools::IsConformState(const TopAbs_State aST1,
-                                                      const GEOMAlgo_State aST2)
+                                                       const GEOMAlgo_State aST2)
 {
   Standard_Boolean bRet=Standard_False;
   //
   switch (aST2) {
     case GEOMAlgo_ST_IN:
       if (aST1==TopAbs_IN) {
-       bRet=!bRet;
+        bRet=!bRet;
       }
       break;
     case GEOMAlgo_ST_OUT:
       if (aST1==TopAbs_OUT) {
-       bRet=!bRet;
+        bRet=!bRet;
       }
       break;
     case GEOMAlgo_ST_ON:
       if (aST1==TopAbs_ON) {
-       bRet=!bRet;
+        bRet=!bRet;
       }
       break;
     case GEOMAlgo_ST_ONIN:
       if (aST1==TopAbs_ON || aST1==TopAbs_IN) {
-       bRet=!bRet;
+        bRet=!bRet;
       }
       break;
     case GEOMAlgo_ST_ONOUT:
       if (aST1==TopAbs_ON || aST1==TopAbs_OUT) {
-       bRet=!bRet;
+        bRet=!bRet;
       }
       break;
     default: