-// Copyright (c) 1999-2012 OPEN CASCADE SAS
+// Copyright (c) 1999-2014 OPEN CASCADE SAS
//
-// The content of this file is subject to the Open CASCADE Technology Public
-// License Version 6.5 (the "License"). You may not use the content of this file
-// except in compliance with the License. Please obtain a copy of the License
-// at http://www.opencascade.org and read it completely before using this file.
+// This file is part of Open CASCADE Technology software library.
//
-// The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
-// main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
+// 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.
//
-// The Original Code and all software distributed under the License is
-// distributed on an "AS IS" basis, without warranty of any kind, and the
-// Initial Developer hereby disclaims all such warranties, including without
-// limitation, any warranties of merchantability, fitness for a particular
-// purpose or non-infringement. Please see the License for the specific terms
-// and conditions governing the rights and limitations under the License.
+// 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.;
}
else {
// debug
-// cout <<"UnitsMethods: SurfType = "<< aSurface->DynamicType();
+// std::cout <<"UnitsMethods: SurfType = "<< aSurface->DynamicType();
return aCurve2d;
}
aCurve2d = aBSpline2d;
}
else if (aCurve2d->IsKind(STANDARD_TYPE(Geom2d_Parabola))) {
-#ifdef DEBUG
- cout << "PCURVE of Parabola type in U or V Periodic Surface" << endl;
- cout << "Parameters Not transformed to Degree" << endl;
+#ifdef OCCT_DEBUG
+ std::cout << "PCURVE of Parabola type in U or V Periodic Surface" << std::endl;
+ std::cout << "Parameters Not transformed to Degree" << std::endl;
#endif
}
else if (aCurve2d->IsKind(STANDARD_TYPE(Geom2d_Hyperbola))) {
-#ifdef DEBUG
- cout << "PCURVE of Hyperbola type in U or V Periodic Surface" << endl;
- cout << "Parameters Not transformed to Degree" << endl;
+#ifdef OCCT_DEBUG
+ std::cout << "PCURVE of Hyperbola type in U or V Periodic Surface" << std::endl;
+ std::cout << "Parameters Not transformed to Degree" << std::endl;
#endif
}
return myNewBSpline2d;
}
else {
-#ifdef DEBUG
- cout << "PCURVE of Other Types of Bounded Curve in U or V Periodic Surface" << endl;
- cout << "Parameters Not transformed to Degree" << endl;
+#ifdef OCCT_DEBUG
+ std::cout << "PCURVE of Other Types of Bounded Curve in U or V Periodic Surface" << std::endl;
+ std::cout << "Parameters Not transformed to Degree" << std::endl;
#endif
}
}
}
else {
// debug
-// cout <<"UnitsMethods: SurfType = "<< aSurface->DynamicType();
+// std::cout <<"UnitsMethods: SurfType = "<< aSurface->DynamicType();
return aPcurve;
}
aPcurve = aBSpline2d;
}
else if (aPcurve->IsKind(STANDARD_TYPE(Geom2d_Parabola))) {
-#ifdef DEBUG
- cout << "PCURVE of Parabola type" << endl;
- cout << "Parameters Not Yet transformed according to LenghtUnit" << endl;
+#ifdef OCCT_DEBUG
+ std::cout << "PCURVE of Parabola type" << std::endl;
+ std::cout << "Parameters Not Yet transformed according to LenghtUnit" << std::endl;
#endif
return aPcurve;
}
else if (aPcurve->IsKind(STANDARD_TYPE(Geom2d_Hyperbola))) {
-#ifdef DEBUG
- cout << "PCURVE of Hyperbola type" << endl;
- cout << "Parameters Not Yet transformed according to LenghtUnit" << endl;
+#ifdef OCCT_DEBUG
+ std::cout << "PCURVE of Hyperbola type" << std::endl;
+ std::cout << "Parameters Not Yet transformed according to LenghtUnit" << std::endl;
#endif
return aPcurve;
}
aPcurve = aBSpline2d;
}
else {
-#ifdef DEBUG
- cout << "DegreeToRadian : Type " << aPcurve->DynamicType();
- cout << " not yet implemented" << endl;
+#ifdef OCCT_DEBUG
+ std::cout << "DegreeToRadian : Type " << aPcurve->DynamicType();
+ std::cout << " not yet implemented" << std::endl;
#endif
}
return aPcurve;
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.;
}
}