0024510: Remove unused local variables
[occt.git] / src / DrawTrSurf / DrawTrSurf.cxx
old mode 100755 (executable)
new mode 100644 (file)
index cd29b05..2197fdf
@@ -1,7 +1,18 @@
-// File:       DrawTrSurf.cxx
-// Created:    Thu Aug 12 19:05:42 1993
-// Author:     Bruno DUMORTIER
-//             <dub@topsn3>
+// Created on: 1993-08-12
+// Created by: Bruno DUMORTIER
+// Copyright (c) 1993-1999 Matra Datavision
+// 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 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.
 
 #ifdef HAVE_CONFIG_H
 # include <config.h>
@@ -168,21 +179,6 @@ static Handle(DrawTrSurf_BSplineSurface) GetBSplineSurface(Standard_CString& Nam
   return Dr;
 }
 
-#ifdef DEB
-//=======================================================================
-//function : GetCurve
-//purpose  : 
-//=======================================================================
-static Handle(DrawTrSurf_Curve) GetCurve(Standard_CString& Name)
-{
-  Handle(Draw_Drawable3D) D = Draw::Get(Name);
-  Handle(DrawTrSurf_Curve) Dr;
-  if (!D.IsNull()) 
-    Dr = Handle(DrawTrSurf_Curve)::DownCast(D);
-  return Dr;
-}
-#endif
-
 //=======================================================================
 //function : GetBezierCurve
 //purpose  : 
@@ -244,8 +240,8 @@ static Standard_Integer nbiso (Draw_Interpretor& di, Standard_Integer n, const c
 {
   if (n < 4) {
     if (n == 3) {
-      NbUIsos = atoi(a[1]);
-      NbVIsos = atoi(a[2]);
+      NbUIsos = Draw::Atoi(a[1]);
+      NbVIsos = Draw::Atoi(a[2]);
     }
     di << NbUIsos << " " << NbVIsos;
   }
@@ -253,7 +249,7 @@ static Standard_Integer nbiso (Draw_Interpretor& di, Standard_Integer n, const c
     for (Standard_Integer i = 1; i < n - 2; i++) {
       Handle(DrawTrSurf_Surface) DS = GetSurface(a[i]);
       if (!DS.IsNull()) {
-       DS->ShowIsos(atoi(a[n-2]),atoi(a[n-1]));
+       DS->ShowIsos(Draw::Atoi(a[n-2]),Draw::Atoi(a[n-1]));
        Draw::Repaint();
       }
     }
@@ -396,8 +392,6 @@ static Standard_Integer draw (Draw_Interpretor& di, Standard_Integer n, const ch
   if (n <= 2) {
        if (!strcmp(a[0],"dmode")) {
          if (n == 2) {
-           Standard_Integer mod = 0;
-           if ((*a[n-1] == 'U')||(*a[n-1] == 'u')) mod = 1;
            DrawMode = 1;
          }
          if (DrawMode)
@@ -408,13 +402,13 @@ static Standard_Integer draw (Draw_Interpretor& di, Standard_Integer n, const ch
        
        else if (!strcmp(a[0],"discr")) {
          if (n == 2)
-           Discret = atoi(a[n-1]);
+           Discret = Draw::Atoi(a[n-1]);
          di << Discret;
        }
        
        else if (!strcmp(a[0],"defle")) {
          if (n == 2)
-           Deflection = atof(a[n-1]);
+           Deflection = Draw::Atof(a[n-1]);
          di << Deflection;
        }
   }
@@ -429,11 +423,11 @@ static Standard_Integer draw (Draw_Interpretor& di, Standard_Integer n, const ch
        }
        
        else if (!strcmp(a[0],"discr")) {
-         D->SetDiscretisation(atoi(a[n-1]));
+         D->SetDiscretisation(Draw::Atoi(a[n-1]));
        }
        
        else if (!strcmp(a[0],"defle")) {
-         D->SetDeflection(atof(a[n-1]));
+         D->SetDeflection(Draw::Atof(a[n-1]));
        }
        
        Draw::Repaint();
@@ -454,22 +448,22 @@ static Standard_Integer transform (Draw_Interpretor& di, Standard_Integer n, con
   gp_Trsf T;
   Standard_Integer i,last = n-1;
   if (!strcmp(a[0],"pscale")) {
-    Standard_Real s = atof(a[last]);
+    Standard_Real s = Draw::Atof(a[last]);
     last--;
     if (last < 4) return 1;
-    gp_Pnt P(atof(a[last-2]),atof(a[last-1]),atof(a[last]));
+    gp_Pnt P(Draw::Atof(a[last-2]),Draw::Atof(a[last-1]),Draw::Atof(a[last]));
     T.SetScale(P,s);
   }
   else if (!strcmp(a[0]+1,"mirror")) {
     if (last < 4) return 1;
-    gp_Pnt P(atof(a[last-2]),atof(a[last-1]),atof(a[last]));
+    gp_Pnt P(Draw::Atof(a[last-2]),Draw::Atof(a[last-1]),Draw::Atof(a[last]));
     if (*a[0] == 'p') {
       T.SetMirror(P);
     }
     else {
       last -= 3;
       if (last < 4) return 1;
-      gp_Pnt O(atof(a[last-2]),atof(a[last-1]),atof(a[last]));
+      gp_Pnt O(Draw::Atof(a[last-2]),Draw::Atof(a[last-1]),Draw::Atof(a[last]));
       last -= 3;
       gp_Dir D(P.X(),P.Y(),P.Z());
       if (*a[0] == 'l') {
@@ -484,18 +478,18 @@ static Standard_Integer transform (Draw_Interpretor& di, Standard_Integer n, con
 
   else if (!strcmp(a[0],"translate")) {
     if (last < 4) return 1;
-    gp_Vec V(atof(a[last-2]),atof(a[last-1]),atof(a[last]));
+    gp_Vec V(Draw::Atof(a[last-2]),Draw::Atof(a[last-1]),Draw::Atof(a[last]));
     last -= 3;
     T.SetTranslation(V);
   }
 
   else if (!strcmp(a[0],"rotate")) {
     if (last < 8) return 1;
-    Standard_Real ang = atof(a[last]) * (M_PI / 180.0);
+    Standard_Real ang = Draw::Atof(a[last]) * (M_PI / 180.0);
     last --;
-    gp_Dir D(atof(a[last-2]),atof(a[last-1]),atof(a[last]));
+    gp_Dir D(Draw::Atof(a[last-2]),Draw::Atof(a[last-1]),Draw::Atof(a[last]));
     last -= 3;
-    gp_Pnt P(atof(a[last-2]),atof(a[last-1]),atof(a[last]));
+    gp_Pnt P(Draw::Atof(a[last-2]),Draw::Atof(a[last-1]),Draw::Atof(a[last]));
     last -= 3;
     T.SetRotation(gp_Ax1(P,D),ang);
   }
@@ -529,23 +523,23 @@ static Standard_Integer d2transform (Draw_Interpretor& di, Standard_Integer n, c
   gp_Trsf2d T;
   Standard_Integer i,last = n-1;
   if (!strcmp(a[0],"2dpscale")) {
-    Standard_Real s = atof(a[last]);
+    Standard_Real s = Draw::Atof(a[last]);
     last--;
     if (last < 3) return 1;
-    gp_Pnt2d P(atof(a[last-1]),atof(a[last]));
+    gp_Pnt2d P(Draw::Atof(a[last-1]),Draw::Atof(a[last]));
     T.SetScale(P,s);
   }
   else if ( (!strcmp(a[0],"2dpmirror")) || 
            (!strcmp(a[0],"2dlmirror"))   ) {
     if (last < 3) return 1;
-    gp_Pnt2d P(atof(a[last-1]),atof(a[last]));
+    gp_Pnt2d P(Draw::Atof(a[last-1]),Draw::Atof(a[last]));
     if (!strcmp(a[0],"2dpmirror")) {
       T.SetMirror(P);
     }
     else {
       last -= 2;
       if (last < 3) return 1;
-      gp_Pnt2d O(atof(a[last-1]),atof(a[last]));
+      gp_Pnt2d O(Draw::Atof(a[last-1]),Draw::Atof(a[last]));
       last -= 2;
       gp_Dir2d D(P.X(),P.Y());
       T.SetMirror(gp_Ax2d(O,D));
@@ -554,16 +548,16 @@ static Standard_Integer d2transform (Draw_Interpretor& di, Standard_Integer n, c
 
   else if (!strcmp(a[0],"2dtranslate")) {
     if (last < 3) return 1;
-    gp_Vec2d V(atof(a[last-1]),atof(a[last]));
+    gp_Vec2d V(Draw::Atof(a[last-1]),Draw::Atof(a[last]));
     last -= 2;
     T.SetTranslation(V);
   }
 
   else if (!strcmp(a[0],"2drotate")) {
     if (last < 4) return 1;
-    Standard_Real ang = atof(a[last]) * (M_PI / 180.0);
+    Standard_Real ang = Draw::Atof(a[last]) * (M_PI / 180.0);
     last --;
-    gp_Pnt2d P(atof(a[last-1]),atof(a[last]));
+    gp_Pnt2d P(Draw::Atof(a[last-1]),Draw::Atof(a[last]));
     last -= 2;
     T.SetRotation(P,ang);
   }
@@ -1753,7 +1747,7 @@ static void pntsave(const Handle(Draw_Drawable3D)&d, ostream& OS)
   OS.precision(15);
 #else
   long form = OS.setf(ios::scientific);
-  int  prec = OS.precision(15);
+  std::streamsize prec = OS.precision(15);
 #endif
   gp_Pnt P = N->Point();
   if (N->Is3D()) {
@@ -1776,7 +1770,7 @@ static Handle(Draw_Drawable3D) pntrestore (istream& is)
 {
   Standard_Integer is3d;
   is >> is3d;
-  Standard_Real x,y,z;
+  Standard_Real x,y,z = 0.;
   if (is3d)
     is >> x >> y >> z;
   else
@@ -1815,7 +1809,7 @@ static void triasave(const Handle(Draw_Drawable3D)&d, ostream& OS)
   OS.precision(15);
 #else
   long form = OS.setf(ios::scientific);
-  int  prec = OS.precision(15);
+  std::streamsize prec = OS.precision(15);
 #endif
   Poly::Write(T->Triangulation(),OS);
 #if defined(HAVE_IOS) && !defined(__sgi) && !defined(IRIX)
@@ -1856,7 +1850,7 @@ static void poly3dsave(const Handle(Draw_Drawable3D)&d, ostream& OS)
   OS.precision(15);
 #else
   long form = OS.setf(ios::scientific);
-  int  prec = OS.precision(15);
+  std::streamsize prec = OS.precision(15);
 #endif
   Poly::Write(T->Polygon3D(),OS);
 #if defined(HAVE_IOS) && !defined(__sgi) && !defined(IRIX)
@@ -1896,7 +1890,7 @@ static void poly2dsave(const Handle(Draw_Drawable3D)&d, ostream& OS)
   OS.precision(15);
 #else
   long form = OS.setf(ios::scientific);
-  int  prec = OS.precision(15);
+  std::streamsize prec = OS.precision(15);
 #endif
   Poly::Write(T->Polygon2D(),OS);
 #if defined(HAVE_IOS) && !defined(__sgi) && !defined(IRIX)