-// 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>
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 :
{
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;
}
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();
}
}
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)
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;
}
}
}
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();
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') {
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);
}
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));
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);
}
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()) {
{
Standard_Integer is3d;
is >> is3d;
- Standard_Real x,y,z;
+ Standard_Real x,y,z = 0.;
if (is3d)
is >> x >> y >> z;
else
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)
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)
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)