0030675: Visualization - remove redundant proxy classes in hierarchy of PrsMgr_Presen...
[occt.git] / src / IntTools / IntTools_TopolTool.cxx
old mode 100755 (executable)
new mode 100644 (file)
index 51c01d7..863e068
@@ -1,16 +1,35 @@
-#include <IntTools_TopolTool.ixx>
-
-#include <Standard_NotImplemented.hxx>
-#include <Precision.hxx>
-#include <TColgp_Array2OfPnt.hxx>
-#include <Geom_BSplineSurface.hxx>
+// Copyright (c) 1999-2014 OPEN CASCADE SAS
+//
+// 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 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 <Adaptor3d_HSurface.hxx>
+#include <ElSLib.hxx>
 #include <Geom_BezierSurface.hxx>
+#include <Geom_BSplineSurface.hxx>
 #include <gp_Circ.hxx>
 #include <gp_Cone.hxx>
-#include <ElSLib.hxx>
-
+#include <gp_Pnt.hxx>
+#include <gp_Pnt2d.hxx>
+#include <IntTools_TopolTool.hxx>
+#include <Precision.hxx>
+#include <Standard_DomainError.hxx>
+#include <Standard_NotImplemented.hxx>
+#include <Standard_Type.hxx>
+#include <TColgp_Array2OfPnt.hxx>
 #include <TColStd_HArray1OfReal.hxx>
 
+IMPLEMENT_STANDARD_RTTIEXT(IntTools_TopolTool,Adaptor3d_TopolTool)
+
 static void Analyse(const TColgp_Array2OfPnt& array2,
                    Standard_Integer&         theNbSamplesU,
                    Standard_Integer&         theNbSamplesV);
@@ -46,7 +65,7 @@ IntTools_TopolTool::IntTools_TopolTool(const Handle(Adaptor3d_HSurface)& theSurf
 // =====================================================================================
 void IntTools_TopolTool::Initialize() 
 {
-  Standard_NotImplemented::Raise("IntTools_TopolTool::Initialize ()");
+  throw Standard_NotImplemented("IntTools_TopolTool::Initialize ()");
 }
 
 // =====================================================================================
@@ -94,7 +113,7 @@ void IntTools_TopolTool::ComputeSamplePoints()
   myU0 = uinf;
   myV0 = vinf;
 
-  Standard_Integer nbsu,nbsv;
+  Standard_Integer nbsu = 0,nbsv = 0;
   GeomAbs_SurfaceType typS = myS->GetType();
 
   switch(typS) {
@@ -104,7 +123,7 @@ void IntTools_TopolTool::ComputeSamplePoints()
     break;
   case GeomAbs_Cylinder: {
     Standard_Real aRadius = myS->Cylinder().Radius();
-    Standard_Real aMaxAngle = Standard_PI * 0.5;
+    Standard_Real aMaxAngle = M_PI * 0.5;
     Standard_Real aDeflection = 1.e-02;
 
     if(aRadius > aDeflection) {
@@ -133,7 +152,7 @@ void IntTools_TopolTool::ComputeSamplePoints()
 
     if(aRadius < aCircle.Radius())
       aRadius = aCircle.Radius();
-    Standard_Real aMaxAngle = Standard_PI * 0.5;
+    Standard_Real aMaxAngle = M_PI * 0.5;
     Standard_Real aDeflection = 1.e-02;
 
     if(aRadius > aDeflection) {
@@ -177,7 +196,7 @@ void IntTools_TopolTool::ComputeSamplePoints()
       aRadius1 = aSphere.Radius();
       aRadius2 = aSphere.Radius();
     }
-    Standard_Real aMaxAngle = Standard_PI * 0.5;
+    Standard_Real aMaxAngle = M_PI * 0.5;
     Standard_Real aDeflection = 1.e-02;
     
     if(aRadius1 > aDeflection) {
@@ -187,7 +206,7 @@ void IntTools_TopolTool::ComputeSamplePoints()
     if(aMaxAngle > Precision::Angular()) {
       nbsu = Standard_Integer((usup - uinf) / aMaxAngle);
     }
-    aMaxAngle = Standard_PI * 0.5;
+    aMaxAngle = M_PI * 0.5;
 
     if(aRadius2 > aDeflection) {
       aMaxAngle = ACos(1. - aDeflection / aRadius2) * 2.;