0028778: Coding Rules - clean up confusing code from Select3D
[occt.git] / src / Select3D / Select3D_SensitiveCircle.cxx
index 16fff0f..0682950 100644 (file)
 // Alternatively, this file may be used under the terms of Open CASCADE
 // commercial license or contractual agreement.
 
-#include <Geom_Circle.hxx>
-
-#include <Select3D_Pnt.hxx>
-#include <Select3D_SensitiveTriangle.hxx>
-#include <Precision.hxx>
-
 #include <Select3D_SensitiveCircle.hxx>
 
+#include <Geom_Circle.hxx>
+#include <Precision.hxx>
+#include <Select3D_SensitiveTriangle.hxx>
 
 IMPLEMENT_STANDARD_RTTIEXT(Select3D_SensitiveCircle,Select3D_SensitivePoly)
 
-static Standard_Integer GetCircleNbPoints (const Handle(Geom_Circle)& theCircle,
-                                           const Standard_Integer theNbPnts)
+namespace
 {
-  // Check if number of points is invalid.
-  // In this case myPolyg raises Standard_ConstructionError
-  // exception (look constructor bellow).
-  if (theNbPnts <= 0)
-    return 0;
+  static Standard_Integer GetCircleNbPoints (const Handle(Geom_Circle)& theCircle,
+                                             const Standard_Integer theNbPnts)
+  {
+    // Check if number of points is invalid.
+    // In this case myPolyg raises Standard_ConstructionError
+    // exception (look constructor bellow).
+    if (theNbPnts <= 0)
+      return 0;
 
-  if (theCircle->Radius() > Precision::Confusion())
-    return 2 * theNbPnts + 1;
+    if (theCircle->Radius() > Precision::Confusion())
+      return 2 * theNbPnts + 1;
 
-  // The radius is too small and circle degenerates into point
-  return 1;
-}
+    // The radius is too small and circle degenerates into point
+    return 1;
+  }
 
-static Standard_Integer GetArcNbPoints (const Handle(Geom_Circle)& theCircle,
-                                        const Standard_Integer theNbPnts)
-{
-  // There is no need to check number of points here.
-  // In case of invalid number of points this method returns
-  // -1 or smaller value.
-  if (theCircle->Radius() > Precision::Confusion())
-    return 2 * theNbPnts - 1;
-
-  // The radius is too small and circle degenerates into point
-  return 1;
+  static Standard_Integer GetArcNbPoints (const Handle(Geom_Circle)& theCircle,
+                                          const Standard_Integer theNbPnts)
+  {
+    // There is no need to check number of points here.
+    // In case of invalid number of points this method returns
+    // -1 or smaller value.
+    if (theCircle->Radius() > Precision::Confusion())
+      return 2 * theNbPnts - 1;
+
+    // The radius is too small and circle degenerates into point
+    return 1;
+  }
 }
 
 //=======================================================================