Warnings on vc14 were eliminated
[occt.git] / src / UnitsMethods / UnitsMethods.cxx
index 027f69e..f73b3ce 100644 (file)
@@ -2,8 +2,8 @@
 //
 // This file is part of Open CASCADE Technology software library.
 //
-// This library is free software; you can redistribute it and / or modify it
-// under the terms of the GNU Lesser General Public version 2.1 as published
+// This library is free software; you can redistribute it and/or modify it under
+// the terms of the GNU Lesser General Public License version 2.1 as published
 // by the Free Software Foundation, with special exception defined in the file
 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
 // distribution for complete text of the license and disclaimer of any warranty.
 // Alternatively, this file may be used under the terms of Open CASCADE
 // commercial license or contractual agreement.
 
-#include <UnitsMethods.ixx>
 
-#include <Geom_Plane.hxx>
-#include <Geom_Surface.hxx>
-#include <Geom_ConicalSurface.hxx>
-#include <Geom_CylindricalSurface.hxx>
-#include <Geom_SphericalSurface.hxx>
-#include <Geom_ToroidalSurface.hxx>
-#include <Geom_SurfaceOfRevolution.hxx>
-#include <Geom2dConvert.hxx>
+#include <Geom2d_BoundedCurve.hxx>
 #include <Geom2d_BSplineCurve.hxx>
 #include <Geom2d_Circle.hxx>
+#include <Geom2d_Conic.hxx>
 #include <Geom2d_Curve.hxx>
 #include <Geom2d_Ellipse.hxx>
 #include <Geom2d_Hyperbola.hxx>
 #include <Geom2d_Line.hxx>
 #include <Geom2d_Parabola.hxx>
+#include <Geom2dConvert.hxx>
+#include <Geom_ConicalSurface.hxx>
+#include <Geom_CylindricalSurface.hxx>
+#include <Geom_Plane.hxx>
+#include <Geom_SphericalSurface.hxx>
+#include <Geom_Surface.hxx>
+#include <Geom_SurfaceOfRevolution.hxx>
+#include <Geom_ToroidalSurface.hxx>
 #include <gp.hxx>
+#include <gp_Dir2d.hxx>
 #include <gp_GTrsf2d.hxx>
-#include <gp_Trsf2d.hxx>
 #include <gp_Pnt2d.hxx>
-#include <gp_Dir2d.hxx>
+#include <gp_Trsf2d.hxx>
+#include <UnitsMethods.hxx>
 
 static Standard_Real theLengthFactor     = 1.;
 static Standard_Real thePlaneAngleFactor = 1.;
@@ -191,13 +193,13 @@ Handle(Geom2d_Curve) UnitsMethods::RadianToDegree
       aCurve2d = aBSpline2d;
     } 
     else if (aCurve2d->IsKind(STANDARD_TYPE(Geom2d_Parabola))) {
-#ifdef DEBUG
+#ifdef OCCT_DEBUG
       cout << "PCURVE of Parabola type in U or V Periodic Surface" << endl;
       cout << "Parameters Not transformed to Degree" << endl;
 #endif
     }
     else if (aCurve2d->IsKind(STANDARD_TYPE(Geom2d_Hyperbola))) {
-#ifdef DEBUG
+#ifdef OCCT_DEBUG
       cout << "PCURVE of Hyperbola type in U or V Periodic Surface" << endl;
       cout << "Parameters Not transformed to Degree" << endl;
 #endif
@@ -226,7 +228,7 @@ Handle(Geom2d_Curve) UnitsMethods::RadianToDegree
       return myNewBSpline2d;
     }
     else {
-#ifdef DEBUG
+#ifdef OCCT_DEBUG
       cout << "PCURVE of Other Types of Bounded Curve in U or V Periodic Surface" << endl;
       cout << "Parameters Not transformed to Degree" << endl;
 #endif
@@ -302,14 +304,14 @@ Handle(Geom2d_Curve) UnitsMethods::DegreeToRadian
       aPcurve = aBSpline2d;
     }
     else if (aPcurve->IsKind(STANDARD_TYPE(Geom2d_Parabola))) {
-#ifdef DEBUG
+#ifdef OCCT_DEBUG
       cout << "PCURVE of Parabola type" << endl;
       cout << "Parameters Not Yet transformed according to LenghtUnit" << endl;
 #endif
       return aPcurve;
     }
     else if (aPcurve->IsKind(STANDARD_TYPE(Geom2d_Hyperbola))) {
-#ifdef DEBUG
+#ifdef OCCT_DEBUG
       cout << "PCURVE of Hyperbola type" << endl;
       cout << "Parameters Not Yet transformed according to LenghtUnit" << endl;
 #endif
@@ -356,7 +358,7 @@ Handle(Geom2d_Curve) UnitsMethods::DegreeToRadian
     aPcurve = aBSpline2d;
   }
   else {
-#ifdef DEBUG
+#ifdef OCCT_DEBUG
     cout << "DegreeToRadian : Type " << aPcurve->DynamicType();
     cout << " not yet implemented" << endl;
 #endif
@@ -412,17 +414,17 @@ void UnitsMethods::SetCasCadeLengthUnit (const Standard_Integer unit)
 Standard_Real UnitsMethods::GetLengthFactorValue (const Standard_Integer par) 
 {
   switch ( par ) {
-  case  1 : return 25.4;
-  case  2 : return 1.;
+  case  1 : return 25.4; // inch
+  case  2 : return 1.; // millimeter
   
-  case  4 : return 304.8;
-  case  5 : return 1609270.;
-  case  6 : return 1000.;
-  case  7 : return 1000000.;
-  case  8 : return 0.0254;
-  case  9 : return 0.001;
-  case 10 : return 10.;
-  case 11 : return 0.0000254;
+  case  4 : return 304.8; // foot
+  case  5 : return 1609344.; // mile
+  case  6 : return 1000.; // meter
+  case  7 : return 1000000.; // kilometer
+  case  8 : return 0.0254; // mil (0.001 inch)
+  case  9 : return 0.001; // micron
+  case 10 : return 10.; // centimeter
+  case 11 : return 0.0000254; // microinch
   default : return 1.;
   }
 }