1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-04-03 17:56:21 +03:00

0022898: IGES import fails in german environment

Added DRAW command dlocale to set and query current locale of the C subsystem
Equivalents of C functions working with conversions of strings to/from reals added in Standard_CString, providing locale-independent behavior (using always "C" locale)
In DRAW packages, calls to atof() and atoi() are replaced by direct calls to Draw::Atof() and Draw::Atoi(), respectively, instead of substituting by #define
Use of atof(), strtod(), and *scanf() involving floating point conversions in OCCT code replaced by locale-independent Atof() and Strtod()
Calls to sprintf() involving floating point in OCCT code are replaced by call to locale-independent Sprintf(), except a few places where converted strings are used immediately for display in the 3d viewer
Changes of global locale are eliminated throughout OCCT code
Proposed correction for GNU libC where v*printf_l functions are absent
Added test case (bugs xde bug22898) for data exchange operations with non-standard locale
Use xlocale on Mac OS X and within glibc
Corrected strtod_l wrapper
Generate error rather than warning
Introduce Standard_CLocaleSentry replacement for removed OSD_Localizer
Standard_CLocaleSentry - copy locale string
Standard_CLocaleSentry - use _configthreadlocale on Windows
Standard_CLocaleSentry::GetCLocale() - return locale_t rather than void*
Corrected misprint in ~Standard_CLocaleSentry()
Use French locale in bug22898 test case
Mark test case as skipped if locale is unavailable on tested system.
Use fr_FR locale for tests on Mac OS X
This commit is contained in:
abv 2013-02-01 18:41:16 +04:00
parent 3bea4c165c
commit 91322f44fd
203 changed files with 2707 additions and 2807 deletions

View File

@ -570,7 +570,7 @@ void Approx_SameParameter::Build(const Standard_Real Tolerance)
}
Handle(Geom2d_BSplineCurve) DEBBS =
new Geom2d_BSplineCurve(DEBP2d,DEBKnots,DEBMults,1);
sprintf(Name,"DEBC2d_%d",++NbCurve);
Sprintf(Name,"DEBC2d_%d",++NbCurve);
#ifdef DRAW
DrawTrSurf::Set(Name,DEBBS);
#endif
@ -651,7 +651,7 @@ void Approx_SameParameter::Build(const Standard_Real Tolerance)
Handle(Geom2d_BSplineCurve) DEBBS =
new Geom2d_BSplineCurve(DEBP2d,DEBKnots,DEBMults,1);
sprintf(Name,"DEBC2d_%d_%d",NbCurve,nbcoups );
Sprintf(Name,"DEBC2d_%d_%d",NbCurve,nbcoups );
#ifdef DRAW
DrawTrSurf::Set(Name,DEBBS);
#endif

View File

@ -1496,8 +1496,8 @@ Standard_Integer bopsinf (Draw_Interpretor& di,
const BooleanOperations_ShapesDataStructure& aDS=pDF->DS();
Standard_Integer nSp=0, nF1, nF2, anExistFlag=0;
nF1=atoi(a[1]);
nF2=atoi(a[2]);
nF1=Draw::Atoi(a[1]);
nF2=Draw::Atoi(a[2]);
const TopoDS_Shape& aS1=aDS.GetShape(nF1);
const TopoDS_Shape& aS2=aDS.GetShape(nF2);
@ -1558,8 +1558,8 @@ Standard_Integer bopsonf (Draw_Interpretor& di,
const BooleanOperations_ShapesDataStructure& aDS=pDF->DS();
Standard_Integer nSp=0, nF1, nF2, anExistFlag=0;
nF1=atoi(a[1]);
nF2=atoi(a[2]);
nF1=Draw::Atoi(a[1]);
nF2=Draw::Atoi(a[2]);
const TopoDS_Shape& aS1=aDS.GetShape(nF1);
const TopoDS_Shape& aS2=aDS.GetShape(nF2);
@ -1621,7 +1621,7 @@ Standard_Integer bopwho (Draw_Interpretor& di,
Standard_Boolean bIsNewShape;
Standard_Integer iNum, i, aNbLines, aNbObj, aNewShape, aWhat, aWith;
//
iNum=atoi(a[1]);
iNum=Draw::Atoi(a[1]);
if (iNum<=0) {
di << " Shape Index must be >0 .\n";
return 1;

View File

@ -35,6 +35,7 @@
#include <Geom_Curve.hxx>
#include <DrawTrSurf.hxx>
#include <Draw.hxx>
#include <DBRep.hxx>
#include <IntTools_Tools.hxx>
@ -182,7 +183,7 @@ Standard_Integer bopcurves (Draw_Interpretor& di,
aTol=1.e-7;
if (n>2) {
aTol=atof(a[2]);
aTol=Draw::Atof(a[2]);
if (aTol<=0.) {
aTol=1.e-7;
}

View File

@ -23,6 +23,7 @@
#include <stdio.h>
#include <Draw.hxx>
#include <Draw_Interpretor.hxx>
#include <TopoDS.hxx>
@ -70,15 +71,15 @@ static Standard_Integer bef (Draw_Interpretor& di,
Standard_Real aTol=.0000001, aDeflection=.01, aFrom, aTo;
if (n>=4) {
aDiscr=atoi (a[3]);
aDiscr=Draw::Atoi (a[3]);
}
if (n>=5) {
aTol=atof (a[4]);
aTol=Draw::Atof (a[4]);
}
if (n>=6) {
aDeflection=atof (a[5]);
aDeflection=Draw::Atof (a[5]);
}
di << " bef: ===Begin===\n";

View File

@ -55,6 +55,7 @@
#include <TopAbs.hxx>
#include <TopAbs_State.hxx>
#include <Draw.hxx>
#include <DBRep.hxx>
#include <DrawTrSurf.hxx>
@ -464,8 +465,8 @@ Standard_Integer baddve (Draw_Interpretor& di, Standard_Integer n, const char**
Standard_Real p1, p2;
p1=atof(a[4]);
p2=atof(a[5]);
p1=Draw::Atof(a[4]);
p2=Draw::Atof(a[5]);
TopoDS_Edge E=aE;
E.EmptyCopy();
@ -552,7 +553,7 @@ static Standard_Integer bexplode(Draw_Interpretor& di,
TopoDS_Iterator itr(S);
while (itr.More()) {
i++;
sprintf(p,"%d",i);
Sprintf(p,"%d",i);
DBRep::Set(newname,itr.Value());
di.AppendElement(newname);
itr.Next();
@ -610,7 +611,7 @@ static Standard_Integer bexplode(Draw_Interpretor& di,
for (; ex.More(); ex.Next()) {
const TopoDS_Shape& aS = ex.Current();
i++;
sprintf(p,"%d",i);
Sprintf(p,"%d",i);
DBRep::Set(newname,aS);
di.AppendElement(newname);
}
@ -629,20 +630,20 @@ Standard_Integer bclassify (Draw_Interpretor& aDI,
char sbf[512];
if (n < 3) {
sprintf(sbf, " Use >bclassify Solid Point [Tolerance=1.e-7]\n");
Sprintf(sbf, " Use >bclassify Solid Point [Tolerance=1.e-7]\n");
aDI<<sbf;
return 1;
}
TopoDS_Shape aS = DBRep::Get(a[1]);
if (aS.IsNull()) {
sprintf(sbf, " Null Shape is not allowed here\n");
Sprintf(sbf, " Null Shape is not allowed here\n");
aDI<<sbf;
return 1;
}
if (aS.ShapeType()!=TopAbs_SOLID) {
sprintf(sbf, " Shape type must be SOLID\n");
Sprintf(sbf, " Shape type must be SOLID\n");
aDI<<sbf;
return 1;
}
@ -655,7 +656,7 @@ Standard_Integer bclassify (Draw_Interpretor& aDI,
aTol=1.e-7;
if (n==4) {
aTol=atof(a[3]);
aTol=Draw::Atof(a[3]);
}
//
BRepClass3d_SolidClassifier aSC(aS);
@ -679,20 +680,20 @@ Standard_Integer b2dclassify (Draw_Interpretor& aDI,
char sbf[512];
if (n < 3) {
sprintf(sbf, " Use >bclassify Face Point2d [Tol2D=Tol(Face)]\n");
Sprintf(sbf, " Use >bclassify Face Point2d [Tol2D=Tol(Face)]\n");
aDI<<sbf;
return 1;
}
TopoDS_Shape aS = DBRep::Get(a[1]);
if (aS.IsNull()) {
sprintf(sbf, " Null Shape is not allowed here\n");
Sprintf(sbf, " Null Shape is not allowed here\n");
aDI<<sbf;
return 1;
}
if (aS.ShapeType()!=TopAbs_FACE) {
sprintf(sbf, " Shape type must be FACE\n");
Sprintf(sbf, " Shape type must be FACE\n");
aDI<<sbf;
return 1;
}
@ -706,7 +707,7 @@ Standard_Integer b2dclassify (Draw_Interpretor& aDI,
const TopoDS_Face& aF=TopoDS::Face(aS);
aTol=BRep_Tool::Tolerance(aF);
if (n==4) {
aTol=atof(a[3]);
aTol=Draw::Atof(a[3]);
}
//
BRepClass_FaceClassifier aClassifier;
@ -728,28 +729,28 @@ void PrintState (Draw_Interpretor& aDI,
char sbf[512];
TCollection_AsciiString sIN("IN"), sOUT("OUT of"), sON("ON"), sUNKNOWN("UNKNOWN");
//
sprintf(sbf, "The point is "); aDI<<sbf;
Sprintf(sbf, "The point is "); aDI<<sbf;
//
switch (aState) {
case TopAbs_IN:
sprintf(sbf, sIN.ToCString());
Sprintf(sbf, sIN.ToCString());
break;
case TopAbs_OUT:
sprintf(sbf, sOUT.ToCString());
Sprintf(sbf, sOUT.ToCString());
break;
case TopAbs_ON:
sprintf(sbf, sON.ToCString());
Sprintf(sbf, sON.ToCString());
break;
case TopAbs_UNKNOWN:
sprintf(sbf, sUNKNOWN.ToCString());
Sprintf(sbf, sUNKNOWN.ToCString());
break;
default:
sprintf(sbf, sUNKNOWN.ToCString());
Sprintf(sbf, sUNKNOWN.ToCString());
break;
}
aDI<<sbf;
//
sprintf(sbf, " shape\n");
Sprintf(sbf, " shape\n");
aDI<<sbf;
}
@ -765,20 +766,20 @@ Standard_Integer bhole (Draw_Interpretor& aDI,
char sbf[512];
if (n!=2) {
sprintf(sbf, " Use bhole Face\n");
Sprintf(sbf, " Use bhole Face\n");
aDI<<sbf;
return 1;
}
TopoDS_Shape aS = DBRep::Get(a[1]);
if (aS.IsNull()) {
sprintf(sbf, " Null Shape is not allowed here\n");
Sprintf(sbf, " Null Shape is not allowed here\n");
aDI<<sbf;
return 1;
}
if (aS.ShapeType()!=TopAbs_FACE) {
sprintf(sbf, " Shape type must be FACE\n");
Sprintf(sbf, " Shape type must be FACE\n");
aDI<<sbf;
return 1;
}
@ -851,24 +852,24 @@ Standard_Integer bxhole (Draw_Interpretor& aDI,
Standard_Integer aNbIter;
//
if (n!=3) {
sprintf(sbf, " Use bxhole Face NbIter\n");
Sprintf(sbf, " Use bxhole Face NbIter\n");
aDI<<sbf;
return 1;
}
TopoDS_Shape aS = DBRep::Get(a[1]);
if (aS.IsNull()) {
sprintf(sbf, " Null Shape is not allowed here\n");
Sprintf(sbf, " Null Shape is not allowed here\n");
aDI<<sbf;
return 1;
}
if (aS.ShapeType()!=TopAbs_FACE) {
sprintf(sbf, " Shape type must be FACE\n");
Sprintf(sbf, " Shape type must be FACE\n");
aDI<<sbf;
return 1;
}
//
aNbIter=atoi(a[2]);
aNbIter=Draw::Atoi(a[2]);
if (aNbIter<1) {
aNbIter=1;
}

View File

@ -23,6 +23,7 @@
#include <stdio.h>
#include <Draw.hxx>
#include <Draw_Interpretor.hxx>
#include <TopoDS_Shape.hxx>
#include <DBRep.hxx>
@ -67,10 +68,10 @@ static Standard_Integer bbedge (Draw_Interpretor& di,
Standard_Real aTol=.0000001, aDeflection=.01;
Standard_Real f1, l1, f2, l2;
f1=atof (a[3]);
l1=atof (a[4]);
f2=atof (a[5]);
l2=atof (a[6]);
f1=Draw::Atof (a[3]);
l1=Draw::Atof (a[4]);
f2=Draw::Atof (a[5]);
l2=Draw::Atof (a[6]);
IntTools_Range aR1, aR2;
aR1.SetFirst(f1); aR1.SetLast(l1);
@ -172,15 +173,15 @@ static Standard_Integer bedge (Draw_Interpretor& di,
aR2.SetFirst(f2); aR2.SetLast(l2);
if (n>=4) {
aDiscr=atoi (a[3]);
aDiscr=Draw::Atoi (a[3]);
}
if (n>=5) {
aTol=atof (a[4]);
aTol=Draw::Atof (a[4]);
}
if (n>=6) {
aDeflection=atof (a[5]);
aDeflection=Draw::Atof (a[5]);
}
di << " bedge: ===Begin===\n";

View File

@ -25,6 +25,7 @@
#include <TColStd_IndexedMapOfTransient.hxx>
#include <TopoDS_Shape.hxx>
#include <TopoDS_Vertex.hxx>
#include <Draw.hxx>
#include <DBRep.hxx>
#include <gp_Pnt2d.hxx>
@ -124,7 +125,7 @@ Standard_Integer btolx(Draw_Interpretor& di, Standard_Integer n, const char**
//
Standard_Real aTolEMin=1.e-7;
if (n==3) {
aTolEMin=atof(a[2]);
aTolEMin=Draw::Atof(a[2]);
}
//
// Edge Tolerances

View File

@ -242,7 +242,7 @@ void BOPTools_Checker::PerformVV()
if (!aFlag) {
char buf[512];
sprintf (buf, "VV: (%d, %d)", n1, n2);
Sprintf (buf, "VV: (%d, %d)", n1, n2);
BOPTools_CheckResult aChRes;
aChRes.AddShape(aV1);
@ -308,7 +308,7 @@ void BOPTools_Checker::PerformVE()
//
if (!aFlag) {
char buf[512];
sprintf (buf, "VE: (%d, %d)", aWhat, aWith);
Sprintf (buf, "VE: (%d, %d)", aWhat, aWith);
BOPTools_CheckResult aChRes;
aChRes.AddShape(aV1);
@ -369,7 +369,7 @@ void BOPTools_Checker::PerformVF()
//
if (!aFlag) {
char buf[512];
sprintf (buf, "VF: (%d, %d)", aWhat, aWith);
Sprintf (buf, "VF: (%d, %d)", aWhat, aWith);
BOPTools_CheckResult aChRes;
aChRes.AddShape(aV1);
@ -530,7 +530,7 @@ void BOPTools_Checker::PerformEE()
}
//
char buf[512];
sprintf (buf, "EE: (%d, %d), vertex at t1=%f, t2=%f", aWhat, aWith, aT1, aT2);
Sprintf (buf, "EE: (%d, %d), vertex at t1=%f, t2=%f", aWhat, aWith, aT1, aT2);
//
gp_Pnt aPnt;
BOPTools_Tools::PointOnEdge(aEWhat, aT1, aPnt);
@ -570,7 +570,7 @@ void BOPTools_Checker::PerformEE()
}
//
char buf[512];
sprintf (buf, "EE: (%d, %d), common block ", aWhat, aWith);
Sprintf (buf, "EE: (%d, %d), common block ", aWhat, aWith);
BOPTools_CheckResult aChRes;
aChRes.AddShape(aE1);
@ -704,7 +704,7 @@ void BOPTools_Checker::PerformEF()
}
//
char buf[512];
sprintf (buf, "EF: (%d, %d), vertex at t=%f", nE, nF, aT);
Sprintf (buf, "EF: (%d, %d), vertex at t=%f", nE, nF, aT);
//
gp_Pnt aPnt;
BOPTools_Tools::PointOnEdge(aE, aT, aPnt);
@ -734,7 +734,7 @@ void BOPTools_Checker::PerformEF()
}
//
char buf[512];
sprintf (buf, "EF: (%d, %d), common block ", nE, nF);
Sprintf (buf, "EF: (%d, %d), common block ", nE, nF);
BOPTools_CheckResult aChRes;
aChRes.AddShape(aE);
@ -846,7 +846,7 @@ void BOPTools_Checker::PerformEF()
if (aNbPoints) {
char buf[512];
sprintf (buf, "FF: (%d, %d) ", nF1, nF2);
Sprintf (buf, "FF: (%d, %d) ", nF1, nF2);
//
const IntTools_PntOn2Faces& aPntOn2Faces=aPnts(1);
const IntTools_PntOnFace& aPntOnFace=aPntOn2Faces.P1();
@ -881,7 +881,7 @@ void BOPTools_Checker::PerformEF()
//
if (bValid) {
char buf[512];
sprintf (buf, "FF: (%d, %d) ", nF1, nF2);
Sprintf (buf, "FF: (%d, %d) ", nF1, nF2);
//
Handle (Geom_Curve) aC3D=aC.Curve();
Handle (Geom_TrimmedCurve) aTC3D=Handle (Geom_TrimmedCurve)::DownCast(aC3D);
@ -1036,7 +1036,7 @@ void BOPTools_Checker::PerformEF()
char buf[512];
if (!aSR.IsDone()) {
sprintf (buf, "Can not obtain ShrunkRange for Edge %d", nE);
Sprintf (buf, "Can not obtain ShrunkRange for Edge %d", nE);
BOPTools_CheckResult aChRes;
aChRes.AddShape(aE);
@ -1048,7 +1048,7 @@ void BOPTools_Checker::PerformEF()
}
//
if (anErrorStatus==6) {
sprintf(buf,
Sprintf(buf,
"Warning: [PreparePaveBlocks()] Max.Dummy Shrunk Range for Edge %d\n", nE);
BOPTools_CheckResult aChRes;

View File

@ -77,7 +77,7 @@ static Standard_Integer addpcurve(Draw_Interpretor& , Standard_Integer n, const
TopoDS_Shape F = DBRep::Get(a[3]);
Standard_Real tol = 1.e-7;
if (n > 4) {
tol = atof(a[4]);
tol = Draw::Atof(a[4]);
}
BRep_Builder BB;
BB.UpdateEdge(TopoDS::Edge(E), PC, TopoDS::Face(F),tol);
@ -108,25 +108,25 @@ static Standard_Integer transform(Draw_Interpretor& di,Standard_Integer n,const
}
else if (!strcmp(a[0],"ttranslate")) {
if (n < 5) return 1;
T.SetTranslation(gp_Vec(atof(a[n-3]),atof(a[n-2]),atof(a[n-1])));
T.SetTranslation(gp_Vec(Draw::Atof(a[n-3]),Draw::Atof(a[n-2]),Draw::Atof(a[n-1])));
last = n-3;
}
else if (!strcmp(a[0],"trotate")) {
if (n < 9) return 1;
T.SetRotation(gp_Ax1(gp_Pnt(atof(a[n-7]),atof(a[n-6]),atof(a[n-5])),
gp_Vec(atof(a[n-4]),atof(a[n-3]),atof(a[n-2]))),
atof(a[n-1])* (M_PI / 180.0));
T.SetRotation(gp_Ax1(gp_Pnt(Draw::Atof(a[n-7]),Draw::Atof(a[n-6]),Draw::Atof(a[n-5])),
gp_Vec(Draw::Atof(a[n-4]),Draw::Atof(a[n-3]),Draw::Atof(a[n-2]))),
Draw::Atof(a[n-1])* (M_PI / 180.0));
last = n-7;
}
else if (!strcmp(a[0],"tmirror")) {
if (n < 8) return 1;
T.SetMirror(gp_Ax2(gp_Pnt(atof(a[n-6]),atof(a[n-5]),atof(a[n-4])),
gp_Vec(atof(a[n-3]),atof(a[n-2]),atof(a[n-1]))));
T.SetMirror(gp_Ax2(gp_Pnt(Draw::Atof(a[n-6]),Draw::Atof(a[n-5]),Draw::Atof(a[n-4])),
gp_Vec(Draw::Atof(a[n-3]),Draw::Atof(a[n-2]),Draw::Atof(a[n-1]))));
last = n-6;
}
else if (!strcmp(a[0],"tscale")) {
if (n < 6) return 1;
T.SetScale(gp_Pnt(atof(a[n-4]),atof(a[n-3]),atof(a[n-2])),atof(a[n-1]));
T.SetScale(gp_Pnt(Draw::Atof(a[n-4]),Draw::Atof(a[n-3]),Draw::Atof(a[n-2])),Draw::Atof(a[n-1]));
last = n-4;
}
@ -180,8 +180,8 @@ static Standard_Integer deform(Draw_Interpretor& di,Standard_Integer n,const cha
gp_Trsf T;
gp_GTrsf GT(T);
// gp_Mat rot(atof(a[last-3]),0,0,0,atof(a[last-2]),0,0,0,atof(a[last-1]));
gp_Mat rot(atof(a[3]),0,0,0,atof(a[4]),0,0,0,atof(a[5]));
// gp_Mat rot(Draw::Atof(a[last-3]),0,0,0,Draw::Atof(a[last-2]),0,0,0,Draw::Atof(a[last-1]));
gp_Mat rot(Draw::Atof(a[3]),0,0,0,Draw::Atof(a[4]),0,0,0,Draw::Atof(a[5]));
GT.SetVectorialPart(rot);
last -= 3;
BRepBuilderAPI_GTransform gtrf(GT);
@ -278,7 +278,7 @@ static Standard_Integer mkedgecurve (Draw_Interpretor& ,Standard_Integer n,const
Standard_Boolean CurveDone ;
if (n < 3) return 1;
Standard_Real Tolerance = atof(a[2]) ;
Standard_Real Tolerance = Draw::Atof(a[2]) ;
TopoDS_Shape S = DBRep::Get(a[1]);
@ -301,7 +301,7 @@ static Standard_Integer sameparameter(Draw_Interpretor& ,Standard_Integer n,cons
TopoDS_Shape S = DBRep::Get(a[1]);
if (S.IsNull()) return 1;
Standard_Boolean force = !strcmp(a[0],"fsameparameter");
if (n == 3) tol = atof(a[2]);
if (n == 3) tol = Draw::Atof(a[2]);
BRepLib::SameParameter(S,tol,force);
@ -390,12 +390,12 @@ static Standard_Integer bounding(Draw_Interpretor& di,Standard_Integer n,const c
di << axmin<<" "<< aymin<<" "<< azmin<<" "<< axmax<<" "<< aymax<<" "<< azmax;
}
else if (n == 7) {
axmin=atof(a[1]);
aymin=atof(a[2]);
azmin=atof(a[3]);
axmax=atof(a[4]);
aymax=atof(a[5]);
azmax=atof(a[6]);
axmin=Draw::Atof(a[1]);
aymin=Draw::Atof(a[2]);
azmin=Draw::Atof(a[3]);
axmax=Draw::Atof(a[4]);
aymax=Draw::Atof(a[5]);
azmax=Draw::Atof(a[6]);
DB = new Draw_Box(gp_Pnt(axmin,aymin,azmin),gp_Pnt(axmax,aymax,azmax),Draw_orange);
dout<<DB;
}
@ -434,7 +434,7 @@ static Standard_Integer precision(Draw_Interpretor& di,Standard_Integer n,const
di << " Current Precision = " << BRepBuilderAPI::Precision() << "\n";
}
else {
BRepBuilderAPI::Precision(atof(a[1]));
BRepBuilderAPI::Precision(Draw::Atof(a[1]));
}
return 0;
}
@ -707,26 +707,26 @@ static Standard_Integer vecdc(Draw_Interpretor& di,Standard_Integer ,const char*
if (!strcmp(a[arg],"-d")) {
arg++;
if(n > arg)
MaxDistance = atof(a[arg++]);
MaxDistance = Draw::Atof(a[arg++]);
OrtProj.SetMaxDistance(MaxDistance);
}
if(n > arg) {
Tol = Max(atof(a[arg++]),1.e-10);
Tol = Max(Draw::Atof(a[arg++]),1.e-10);
}
if(n > arg) {
if (atoi(a[arg]) == 0) Continuity = GeomAbs_C0;
else if (atoi(a[arg]) == 1) Continuity = GeomAbs_C1;
if (Draw::Atoi(a[arg]) == 0) Continuity = GeomAbs_C0;
else if (Draw::Atoi(a[arg]) == 1) Continuity = GeomAbs_C1;
arg++;
}
if(n > arg) {
MaxDeg = atoi(a[arg++]);
MaxDeg = Draw::Atoi(a[arg++]);
if (MaxDeg<1 || MaxDeg>14) MaxDeg = 14;
}
if(n > arg) MaxSeg = atoi(a[arg]);
if(n > arg) MaxSeg = Draw::Atoi(a[arg]);
Tol2d = Pow(Tol, 2./3);
@ -766,7 +766,7 @@ static Standard_Integer wexplo (Draw_Interpretor&,
Standard_Integer k = 1;
while (we.More()) {
TopoDS_Edge E = we.Current();
sprintf(name,"WEDGE_%d",k);
Sprintf(name,"WEDGE_%d",k);
DBRep::Set(name,E);
we.Next();
k++;
@ -782,9 +782,9 @@ static Standard_Integer scalexyz(Draw_Interpretor& di, Standard_Integer n, const
TopoDS_Shape aShapeBase = DBRep::Get(a[2]);
if (aShapeBase.IsNull()) return 1;
Standard_Real aFactorX = atof(a[3]);
Standard_Real aFactorY = atof(a[4]);
Standard_Real aFactorZ = atof(a[5]);
Standard_Real aFactorX = Draw::Atof(a[3]);
Standard_Real aFactorY = Draw::Atof(a[4]);
Standard_Real aFactorZ = Draw::Atof(a[5]);
gp_GTrsf aGTrsf;
gp_Mat rot (aFactorX, 0, 0,

View File

@ -25,6 +25,7 @@
#include <Draw_Interpretor.hxx>
#include <BRepTest.hxx>
#include <Draw.hxx>
#include <DBRep.hxx>
#include <BRepFilletAPI_MakeChamfer.hxx>
#include <TopAbs_ShapeEnum.hxx>
@ -97,7 +98,7 @@ static Standard_Integer chamfer(Draw_Interpretor& di,
// F = TopoDS::Face(DBRep::Get(a[i + 1], TopAbs_FACE));
if (Method == 0) {
if (!E.IsNull() && !F.IsNull() && (aMCh.Contour(E) == 0) ) {
d1 = atof(a[i + 3]);
d1 = Draw::Atof(a[i + 3]);
if ( d1 > Precision::Confusion())
aMCh.Add(d1,E ,F);
@ -106,8 +107,8 @@ static Standard_Integer chamfer(Draw_Interpretor& di,
}
else if (Method == 1) {
if (!E.IsNull() && !F.IsNull() && (aMCh.Contour(E) == 0) ) {
d1 = atof(a[i + 2]);
d2 = atof(a[i + 3]);
d1 = Draw::Atof(a[i + 2]);
d2 = Draw::Atof(a[i + 3]);
if ( (d1 > Precision::Confusion())
&& (d2 > Precision::Confusion()) )
@ -117,8 +118,8 @@ static Standard_Integer chamfer(Draw_Interpretor& di,
}
else {
if (!E.IsNull() && !F.IsNull() && (aMCh.Contour(E) == 0) ) {
d1 = atof(a[i + 3]);
angle = atof(a[i + 4]);
d1 = Draw::Atof(a[i + 3]);
angle = Draw::Atof(a[i + 4]);
angle *= M_PI / 180.;
if ( (d1 > Precision::Confusion())

View File

@ -171,7 +171,7 @@ static void PrintSub(Standard_OStream& OS,
if (!FindNamed(sub,Name)) {
nbfaulty++;
Name = (char*)malloc(18*sizeof(char));
sprintf(Name,"%s%d",checkfaultyname,nbfaulty);
Sprintf(Name,"%s%d",checkfaultyname,nbfaulty);
DBRep::Set(Name,sub);
lfaulty.Append(Draw::Get((Standard_CString&)Name));
}
@ -179,7 +179,7 @@ static void PrintSub(Standard_OStream& OS,
if (!FindNamed(S,Name)) {
nbfaulty++;
Name = (char*)malloc(18*sizeof(char));
sprintf(Name,"%s%d",checkfaultyname,nbfaulty);
Sprintf(Name,"%s%d",checkfaultyname,nbfaulty);
DBRep::Set(Name,S);
lfaulty.Append(Draw::Get((Standard_CString&)Name));
}
@ -215,7 +215,7 @@ static void Print(Standard_OStream& OS,
if (!FindNamed(S,Name)) {
nbfaulty++;
Name = (char*)malloc(18*sizeof(char));
sprintf(Name,"%s%d",checkfaultyname,nbfaulty);
Sprintf(Name,"%s%d",checkfaultyname,nbfaulty);
DBRep::Set(Name,S);
lfaulty.Append(Draw::Get((Standard_CString&)Name));
}
@ -318,7 +318,7 @@ static Standard_Integer checksection(Draw_Interpretor& di,
TopTools_MapIteratorOfMapOfShape itvx;
for (itvx.Initialize(theVertices); itvx.More(); itvx.Next()) {
ipp++;
sprintf(Name,"alone_%d",ipp);
Sprintf(Name,"alone_%d",ipp);
DBRep::Set(Name, itvx.Key());
//cout << Name << " " ;
di << Name << " " ;
@ -339,7 +339,7 @@ static Standard_Integer checkdiff(Draw_Interpretor& di,
const char* syntaxe = "checkdiff arg1 [arg2..argn] result [closedSolid (0/1)] [geomCtrl (1/0)]";
if (narg < 3) {
if (narg==2) {
Standard_Integer bcrtrace=atoi(a[narg-1]);
Standard_Integer bcrtrace=Draw::Atoi(a[narg-1]);
bcrtrace=BRepCheck_Trace(bcrtrace);
//cout << "BRepCheck_Trace : " << bcrtrace << endl;
di << "BRepCheck_Trace : " << bcrtrace << "\n";
@ -362,7 +362,7 @@ static Standard_Integer checkdiff(Draw_Interpretor& di,
di << syntaxe << "\n";
return 1;
}
closedSolid=atoi(a[narg-1]);
closedSolid=Draw::Atoi(a[narg-1]);
resu = DBRep::Get(a[narg-2]);
lastArg=narg-3;
if (resu.IsNull()) {
@ -372,7 +372,7 @@ static Standard_Integer checkdiff(Draw_Interpretor& di,
return 1;
}
geomCtrl=closedSolid;
closedSolid=atoi(a[narg-2]);
closedSolid=Draw::Atoi(a[narg-2]);
resu = DBRep::Get(a[narg-3]);
lastArg=narg-4;
if (resu.IsNull()) {
@ -820,7 +820,7 @@ void StructuralDump(Draw_Interpretor& theCommands,
for(i=1; i<=nb; i++)
B.Add(comp,slv->Value(i));
char aName[20];
sprintf(aName,"%s_v",Pref);
Sprintf(aName,"%s_v",Pref);
DBRep::Set(aName,comp);
//cout<<"VERTEX"<<" : "<<(nb > 9 ? "" : " ")<<nb<<" Items -> compound named "<<aName<<endl;
if (nb > 9)
@ -835,7 +835,7 @@ void StructuralDump(Draw_Interpretor& theCommands,
for(i=1; i<=nb; i++)
B.Add(comp,sle->Value(i));
char aName[20];
sprintf(aName,"%s_e",Pref);
Sprintf(aName,"%s_e",Pref);
DBRep::Set(aName,comp);
//cout<<"EDGE"<<" : "<<(nb > 9 ? "" : " ")<<nb<<" Items -> compound named "<<aName<<endl;
if (nb > 9)
@ -850,7 +850,7 @@ void StructuralDump(Draw_Interpretor& theCommands,
for(i=1; i<=nb; i++)
B.Add(comp,slw->Value(i));
char aName[20];
sprintf(aName,"%s_w",Pref);
Sprintf(aName,"%s_w",Pref);
DBRep::Set(aName,comp);
//cout<<"WIRE"<<" : "<<(nb > 9 ? "" : " ")<<nb<<" Items -> compound named "<<aName<<endl;
if (nb > 9)
@ -865,7 +865,7 @@ void StructuralDump(Draw_Interpretor& theCommands,
for(i=1; i<=nb; i++)
B.Add(comp,slf->Value(i));
char aName[20];
sprintf(aName,"%s_f",Pref);
Sprintf(aName,"%s_f",Pref);
DBRep::Set(aName,comp);
//cout<<"FACE"<<" : "<<(nb > 9 ? "" : " ")<<nb<<" Items -> compound named "<<aName<<endl;
if (nb > 9)
@ -880,7 +880,7 @@ void StructuralDump(Draw_Interpretor& theCommands,
for(i=1; i<=nb; i++)
B.Add(comp,sls->Value(i));
char aName[20];
sprintf(aName,"%s_s",Pref);
Sprintf(aName,"%s_s",Pref);
DBRep::Set(aName,comp);
//cout<<"SHELL"<<" : "<<(nb > 9 ? "" : " ")<<nb<<" Items -> compound named "<<aName<<endl;
if (nb > 9)
@ -895,7 +895,7 @@ void StructuralDump(Draw_Interpretor& theCommands,
for(i=1; i<=nb; i++)
B.Add(comp,slo->Value(i));
char aName[20];
sprintf(aName,"%s_o",Pref);
Sprintf(aName,"%s_o",Pref);
DBRep::Set(aName,comp);
//cout<<"SOLID"<<" : "<<(nb > 9 ? "" : " ")<<nb<<" Items -> compound named "<<aName<<endl;
if (nb > 9)
@ -1105,12 +1105,12 @@ static Standard_Integer shapeG1continuity (Draw_Interpretor& di, Standard_Intege
nbeval = (Standard_Integer ) atof( a[3]);
nbeval = (Standard_Integer ) Draw::Atof( a[3]);
switch(n)
{ case 7 : epsG1 = atof(a[6]);
case 6 : epsC0 = atof(a[5]);
case 5 : epsnl = atof(a[4]);
{ case 7 : epsG1 = Draw::Atof(a[6]);
case 6 : epsC0 = Draw::Atof(a[5]);
case 5 : epsnl = Draw::Atof(a[4]);
case 4 : {} break;
default : return 1;
}
@ -1230,11 +1230,11 @@ static Standard_Integer shapeG0continuity (Draw_Interpretor& di, Standard_Intege
nbeval = (Standard_Integer ) atof( a[3]);
nbeval = (Standard_Integer ) Draw::Atof( a[3]);
switch(n)
{ case 6 : epsC0 = atof(a[5]);
case 5 : epsnl = atof(a[4]);
{ case 6 : epsC0 = Draw::Atof(a[5]);
case 5 : epsnl = Draw::Atof(a[4]);
case 4 : {} break;
default : return 1;
}
@ -1351,15 +1351,15 @@ static Standard_Integer shapeG2continuity (Draw_Interpretor& di, Standard_Intege
nbeval = (Standard_Integer ) atof( a[3]);
nbeval = (Standard_Integer ) Draw::Atof( a[3]);
switch(n)
{
case 9 : maxlen = atof(a[8]);
case 8 : percent = atof(a[7]);
case 7 : epsG1 = atof(a[6]);
case 6 : epsC0 = atof(a[5]);
case 5 : epsnl = atof(a[4]);
case 9 : maxlen = Draw::Atof(a[8]);
case 8 : percent = Draw::Atof(a[7]);
case 7 : epsG1 = Draw::Atof(a[6]);
case 6 : epsC0 = Draw::Atof(a[5]);
case 5 : epsnl = Draw::Atof(a[4]);
case 4 : {} break;
default : return 1;
}
@ -1454,7 +1454,7 @@ static Standard_Integer clintedge(Draw_Interpretor& di,
Standard_Integer i = 1;
char* temp = newname;
sprintf(newname,"%s_%d",a[1],i);
Sprintf(newname,"%s_%d",a[1],i);
DBRep::Set(temp,mypurgealgo.Shape());
//cout<<newname<<" ";
di<<newname<<" ";
@ -1495,7 +1495,7 @@ static Standard_Integer facintedge(Draw_Interpretor& di,
TopTools_DataMapIteratorOfDataMapOfShapeListOfShape itFacEdg;
for (itFacEdg.Initialize(mymap); itFacEdg.More(); itFacEdg.Next()) {
sprintf(newname,"%s_%d",a[1],i);
Sprintf(newname,"%s_%d",a[1],i);
DBRep::Set(temp,itFacEdg.Key());
//cout<<newname<<" ";
di<<newname<<" ";
@ -1539,7 +1539,7 @@ static Standard_Integer fuseedge(Draw_Interpretor& di,
Standard_Integer i = 1;
char* temp = newname;
sprintf(newname,"%s_%d",a[1],i);
Sprintf(newname,"%s_%d",a[1],i);
DBRep::Set(temp,myfusealgo.Shape());
//cout<<newname<<" ";
di<<newname<<" ";
@ -1585,7 +1585,7 @@ static Standard_Integer listfuseedge(Draw_Interpretor& di,
TopTools_ListIteratorOfListOfShape itEdg;
i = 1;
for (itEdg.Initialize(LmapEdg); itEdg.More(); itEdg.Next()) {
sprintf(newname,"%s_%d_%d",a[1],iLst,i);
Sprintf(newname,"%s_%d_%d",a[1],iLst,i);
DBRep::Set(temp,itEdg.Value());
//cout<<newname<<" ";
di<<newname<<" ";

View File

@ -88,7 +88,7 @@ static Standard_Integer vertex(Draw_Interpretor& , Standard_Integer n, const cha
if (n < 4) return 1;
if (n >= 5) {
DBRep::Set(a[1],
BRepBuilderAPI_MakeVertex(gp_Pnt(atof(a[2]),atof(a[3]),atof(a[4]))));
BRepBuilderAPI_MakeVertex(gp_Pnt(Draw::Atof(a[2]),Draw::Atof(a[3]),Draw::Atof(a[4]))));
}
else {
TopoDS_Shape S = DBRep::Get(a[3]);
@ -96,7 +96,7 @@ static Standard_Integer vertex(Draw_Interpretor& , Standard_Integer n, const cha
if (S.ShapeType() != TopAbs_EDGE) return 0;
BRepAdaptor_Curve C(TopoDS::Edge(S));
gp_Pnt P;
C.D0(atof(a[2]),P);
C.D0(Draw::Atof(a[2]),P);
DBRep::Set(a[1], BRepBuilderAPI_MakeVertex(P));
}
return 0;
@ -113,8 +113,8 @@ static Standard_Integer range(Draw_Interpretor& , Standard_Integer n, const char
TopoDS_Edge E = TopoDS::Edge(aLocalShape);
// TopoDS_Edge E = TopoDS::Edge(DBRep::Get(a[1],TopAbs_EDGE));
if (E.IsNull()) return 1;
Standard_Real f = atof(a[n-2]);
Standard_Real l = atof(a[n-1]);
Standard_Real f = Draw::Atof(a[n-2]);
Standard_Real l = Draw::Atof(a[n-1]);
BRep_Builder B;
if (n == 4)
B.Range(E,f,l);
@ -188,7 +188,7 @@ static Standard_Integer polyline(Draw_Interpretor& , Standard_Integer n, const c
BRepBuilderAPI_MakePolygon W;
j = 2;
for (i = 1; i <= np; i ++) {
W.Add(gp_Pnt(atof(a[j]),atof(a[j+1]),atof(a[j+2])));
W.Add(gp_Pnt(Draw::Atof(a[j]),Draw::Atof(a[j+1]),Draw::Atof(a[j+2])));
j += 3;
}
DBRep::Set(a[1],W.Wire());
@ -277,11 +277,11 @@ static Standard_Integer mkedge(Draw_Interpretor& di, Standard_Integer n, const c
if (n == 5+i) {
if (V1.IsNull()) {
if (!C.IsNull())
edge = BRepBuilderAPI_MakeEdge(C,atof(a[3]),atof(a[4]));
edge = BRepBuilderAPI_MakeEdge(C,Draw::Atof(a[3]),Draw::Atof(a[4]));
else if (S.IsNull())
edge = BRepBuilderAPI_MakeEdge2d(C2d,atof(a[3]),atof(a[4]));
edge = BRepBuilderAPI_MakeEdge2d(C2d,Draw::Atof(a[3]),Draw::Atof(a[4]));
else
edge = BRepBuilderAPI_MakeEdge(C2d,S,atof(a[4]),atof(a[5]));
edge = BRepBuilderAPI_MakeEdge(C2d,S,Draw::Atof(a[4]),Draw::Atof(a[5]));
}
else {
aLocalShape = DBRep::Get(a[4+i],TopAbs_VERTEX);
@ -300,11 +300,11 @@ static Standard_Integer mkedge(Draw_Interpretor& di, Standard_Integer n, const c
TopoDS_Vertex V2 = TopoDS::Vertex(aLocalShape);
// TopoDS_Vertex V2 = TopoDS::Vertex(DBRep::Get(a[5+i],TopAbs_VERTEX));
if (!C.IsNull())
edge = BRepBuilderAPI_MakeEdge(C,V1,V2,atof(a[4]),atof(a[6]));
edge = BRepBuilderAPI_MakeEdge(C,V1,V2,Draw::Atof(a[4]),Draw::Atof(a[6]));
else if (S.IsNull())
edge = BRepBuilderAPI_MakeEdge2d(C2d,V1,V2,atof(a[4]),atof(a[6]));
edge = BRepBuilderAPI_MakeEdge2d(C2d,V1,V2,Draw::Atof(a[4]),Draw::Atof(a[6]));
else
edge = BRepBuilderAPI_MakeEdge(C2d,S,V1,V2,atof(a[5]),atof(a[7]));
edge = BRepBuilderAPI_MakeEdge(C2d,S,V1,V2,Draw::Atof(a[5]),Draw::Atof(a[7]));
}
else
return 1;
@ -442,9 +442,9 @@ static Standard_Integer isoedge(Draw_Interpretor& , Standard_Integer n, const ch
if (n < 6) return 1;
Standard_Boolean uiso = *a[0] == 'u';
Standard_Real p = atof(a[3]);
Standard_Real p1 = atof(a[4]);
Standard_Real p2 = atof(a[5]);
Standard_Real p = Draw::Atof(a[3]);
Standard_Real p1 = Draw::Atof(a[4]);
Standard_Real p2 = Draw::Atof(a[5]);
TopoDS_Shape Sh = DBRep::Get(a[2],TopAbs_FACE);
if (Sh.IsNull()) return 1;
TopLoc_Location Loc;
@ -603,8 +603,8 @@ static Standard_Integer profile(Draw_Interpretor& di,
di << "profile: The F instruction must precede all moves";
return 1;
}
x0 = x = atof(a[i-1]);
y0 = y = atof(a[i]);
x0 = x = Draw::Atof(a[i-1]);
y0 = y = Draw::Atof(a[i]);
stayfirst = Standard_True;
break;
@ -612,7 +612,7 @@ static Standard_Integer profile(Draw_Interpretor& di,
case 'o':
i += 3;
if (i >= n) goto badargs;
P.SetLocation(gp_Pnt(atof(a[i-2]),atof(a[i-1]),atof(a[i])));
P.SetLocation(gp_Pnt(Draw::Atof(a[i-2]),Draw::Atof(a[i-1]),Draw::Atof(a[i])));
stayfirst = Standard_True;
break;
@ -621,8 +621,8 @@ static Standard_Integer profile(Draw_Interpretor& di,
i += 6;
if (i >= n) goto badargs;
{
gp_Vec vn(atof(a[i-5]),atof(a[i-4]),atof(a[i-3]));
gp_Vec vx(atof(a[i-2]),atof(a[i-1]),atof(a[i]));
gp_Vec vn(Draw::Atof(a[i-5]),Draw::Atof(a[i-4]),Draw::Atof(a[i-3]));
gp_Vec vx(Draw::Atof(a[i-2]),Draw::Atof(a[i-1]),Draw::Atof(a[i]));
if (vn.Magnitude() <= Precision::Confusion()) {
di << "profile : null direction";
return 1;
@ -664,7 +664,7 @@ static Standard_Integer profile(Draw_Interpretor& di,
case 'x':
i++;
if (i >= n) goto badargs;
length = atof(a[i]);
length = Draw::Atof(a[i]);
if ((a[i-1][1] == 'X') || (a[i-1][1] == 'x')) {
length -= x;
}
@ -676,7 +676,7 @@ static Standard_Integer profile(Draw_Interpretor& di,
case 'y':
i++;
if (i >= n) goto badargs;
length = atof(a[i]);
length = Draw::Atof(a[i]);
if ((a[i-1][1] == 'Y') || (a[i-1][1] == 'y')) {
length -= y;
}
@ -688,7 +688,7 @@ static Standard_Integer profile(Draw_Interpretor& di,
case 'l':
i++;
if (i >= n) goto badargs;
length = atof(a[i]);
length = Draw::Atof(a[i]);
move = line;
break;
@ -697,8 +697,8 @@ static Standard_Integer profile(Draw_Interpretor& di,
i += 2;
if (i >= n) goto badargs;
{
Standard_Real vx = atof(a[i-1]);
Standard_Real vy = atof(a[i]);
Standard_Real vx = Draw::Atof(a[i-1]);
Standard_Real vy = Draw::Atof(a[i]);
if ((a[i-2][1] == 'T') || (a[i-2][1] == 't')) {
vx -= x;
vy -= y;
@ -716,7 +716,7 @@ static Standard_Integer profile(Draw_Interpretor& di,
case 'r':
i++;
if (i >= n) goto badargs;
angle = atof(a[i]) * (M_PI / 180.0);
angle = Draw::Atof(a[i]) * (M_PI / 180.0);
if ((a[i-1][1] == 'R') || (a[i-1][1] == 'r')) {
dx = Cos(angle);
dy = Sin(angle);
@ -735,8 +735,8 @@ static Standard_Integer profile(Draw_Interpretor& di,
i += 2;
if (i >= n) goto badargs;
{
Standard_Real vx = atof(a[i-1]);
Standard_Real vy = atof(a[i]);
Standard_Real vx = Draw::Atof(a[i-1]);
Standard_Real vy = Draw::Atof(a[i]);
length = Sqrt(vx*vx+vy*vy);
if (length > Precision::Confusion()) {
// move = line; DUB
@ -750,9 +750,9 @@ static Standard_Integer profile(Draw_Interpretor& di,
case 'c':
i += 2;
if (i >= n) goto badargs;
radius = atof(a[i-1]);
radius = Draw::Atof(a[i-1]);
if (Abs(radius) > Precision::Confusion()) {
angle = atof(a[i]) * (M_PI / 180.0);
angle = Draw::Atof(a[i]) * (M_PI / 180.0);
move = circle;
}
break;
@ -761,7 +761,7 @@ static Standard_Integer profile(Draw_Interpretor& di,
case 'i':
i++;
if (i >= n) goto badargs;
length = atof(a[i]);
length = Draw::Atof(a[i]);
if ((a[i-1][1] == 'X') || (a[i-1][1] == 'x')) {
if (Abs(dx) < Precision::Confusion()) {
di << "Profile : cannot intersect, arg " << i-1;
@ -1242,8 +1242,8 @@ static Standard_Integer profile2d(Draw_Interpretor& di,
di << "profile: The F instruction must precede all moves";
return 1;
}
x0 = x = atof(a[i-1]);
y0 = y = atof(a[i]);
x0 = x = Draw::Atof(a[i-1]);
y0 = y = Draw::Atof(a[i]);
stayfirst = Standard_True;
break;
@ -1251,7 +1251,7 @@ static Standard_Integer profile2d(Draw_Interpretor& di,
case 'x':
i++;
if (i >= n) goto badargs;
length = atof(a[i]);
length = Draw::Atof(a[i]);
if ((a[i-1][1] == 'X') || (a[i-1][1] == 'x')) {
length -= x;
}
@ -1263,7 +1263,7 @@ static Standard_Integer profile2d(Draw_Interpretor& di,
case 'y':
i++;
if (i >= n) goto badargs;
length = atof(a[i]);
length = Draw::Atof(a[i]);
if ((a[i-1][1] == 'Y') || (a[i-1][1] == 'y')) {
length -= y;
}
@ -1275,7 +1275,7 @@ static Standard_Integer profile2d(Draw_Interpretor& di,
case 'l':
i++;
if (i >= n) goto badargs;
length = atof(a[i]);
length = Draw::Atof(a[i]);
move = line;
break;
@ -1284,8 +1284,8 @@ static Standard_Integer profile2d(Draw_Interpretor& di,
i += 2;
if (i >= n) goto badargs;
{
Standard_Real vx = atof(a[i-1]);
Standard_Real vy = atof(a[i]);
Standard_Real vx = Draw::Atof(a[i-1]);
Standard_Real vy = Draw::Atof(a[i]);
if ((a[i-2][1] == 'T') || (a[i-2][1] == 't')) {
vx -= x;
vy -= y;
@ -1303,7 +1303,7 @@ static Standard_Integer profile2d(Draw_Interpretor& di,
case 'r':
i++;
if (i >= n) goto badargs;
angle = atof(a[i]) * (M_PI / 180.0);
angle = Draw::Atof(a[i]) * (M_PI / 180.0);
if ((a[i-1][1] == 'R') || (a[i-1][1] == 'r')) {
dx = Cos(angle);
dy = Sin(angle);
@ -1322,8 +1322,8 @@ static Standard_Integer profile2d(Draw_Interpretor& di,
i += 2;
if (i >= n) goto badargs;
{
Standard_Real vx = atof(a[i-1]);
Standard_Real vy = atof(a[i]);
Standard_Real vx = Draw::Atof(a[i-1]);
Standard_Real vy = Draw::Atof(a[i]);
length = Sqrt(vx*vx+vy*vy);
if (length > Precision::Confusion()) {
// move = line; DUB
@ -1337,9 +1337,9 @@ static Standard_Integer profile2d(Draw_Interpretor& di,
case 'c':
i += 2;
if (i >= n) goto badargs;
radius = atof(a[i-1]);
radius = Draw::Atof(a[i-1]);
if (Abs(radius) > Precision::Confusion()) {
angle = atof(a[i]) * (M_PI / 180.0);
angle = Draw::Atof(a[i]) * (M_PI / 180.0);
move = circle;
}
break;
@ -1348,7 +1348,7 @@ static Standard_Integer profile2d(Draw_Interpretor& di,
case 'i':
i++;
if (i >= n) goto badargs;
length = atof(a[i]);
length = Draw::Atof(a[i]);
if ((a[i-1][1] == 'X') || (a[i-1][1] == 'x')) {
if (Abs(dx) < Precision::Confusion()) {
di << "Profile : cannot intersect, arg " << i-1;
@ -1394,7 +1394,7 @@ static Standard_Integer profile2d(Draw_Interpretor& di,
Handle(Geom2d_TrimmedCurve) ct =
new Geom2d_TrimmedCurve(l,0,length);
NbCurves++;
sprintf(name,"%s_%d",a[1],NbCurves);
Sprintf(name,"%s_%d",a[1],NbCurves);
DrawTrSurf::Set(name,ct);
di.AppendElement(name);
x += length*dx;
@ -1420,7 +1420,7 @@ static Standard_Integer profile2d(Draw_Interpretor& di,
Handle(Geom2d_TrimmedCurve) ct =
new Geom2d_TrimmedCurve(c,0,angle);
NbCurves++;
sprintf(name,"%s_%d",a[1],NbCurves);
Sprintf(name,"%s_%d",a[1],NbCurves);
DrawTrSurf::Set(name,ct);
di.AppendElement(name);
gp_Pnt2d p;
@ -1508,11 +1508,11 @@ Standard_Integer mkoffset(Draw_Interpretor& di,
Standard_Real U, dU;
Standard_Integer Nb;
dU = atof(a[4]);
Nb = atoi(a[3]);
dU = Draw::Atof(a[4]);
Nb = Draw::Atoi(a[3]);
Standard_Real Alt = 0.;
if ( n == 6) Alt = atof(a[5]);
if ( n == 6) Alt = Draw::Atof(a[5]);
Standard_Integer Compt = 1;
for ( Standard_Integer i = 1; i <= Nb; i++) {
@ -1523,7 +1523,7 @@ Standard_Integer mkoffset(Draw_Interpretor& di,
di << " Parali aux fraises" << "\n";
}
else {
sprintf(name,"%s_%d", a[1], Compt++);
Sprintf(name,"%s_%d", a[1], Compt++);
char* temp = name; // portage WNT
DBRep::Set(temp,Paral.Shape());
}
@ -1545,7 +1545,7 @@ Standard_Integer pickface(Draw_Interpretor& di,
if (S.IsNull()) return 1;
char* name = new char[100];
sprintf(name,"PickedFace %s",pick_name);
Sprintf(name,"PickedFace %s",pick_name);
DBRep::Set(name,S);
di.AppendElement(name);
return 0;
@ -1578,7 +1578,7 @@ Standard_Integer edgeintersector(Draw_Interpretor& di,
//-----------------------------------------------------
EInter.SetFaces(F,F);
Standard_Real TolInter = 1.e-7;
if (n == 6) TolInter = atof(a[5]);
if (n == 6) TolInter = Draw::Atof(a[5]);
EInter.ForceTolerances(TolInter,TolInter);
Standard_Boolean reducesegments = Standard_True;
EInter.Perform (E[0],E[1],reducesegments);
@ -1601,7 +1601,7 @@ Standard_Integer edgeintersector(Draw_Interpretor& di,
gp_Pnt P = P2D.Value();
TopoDS_Vertex V = BRepLib_MakeVertex(P);
NbV ++;
sprintf(name,"%s_%d",a[1],NbV);
Sprintf(name,"%s_%d",a[1],NbV);
DBRep::Set(name,V);
for (Standard_Integer i = 1; i <= 2; i++) {
//---------------------------------------------------------------
@ -1687,7 +1687,7 @@ Standard_Integer build3d(Draw_Interpretor& di,
if (S.IsNull()) return 1;
if (n==2) { Ok = BRepLib::BuildCurves3d(S); }
else { Ok = BRepLib::BuildCurves3d(S,atof(a[2])); }
else { Ok = BRepLib::BuildCurves3d(S,Draw::Atof(a[2])); }
//if (!Ok) {cout << " one of the computation failed" << endl;}
if (!Ok) {di << " one of the computation failed" << "\n";}

View File

@ -64,7 +64,7 @@ static Standard_Integer DEP(Draw_Interpretor& theCommands,
TopoDS_Shape V = DBRep::Get(a[2]);
BRepOffsetAPI_DraftAngle drft(V);
gp_Dir Dirextract(atof(a[3]),atof(a[4]),atof(a[5]));
gp_Dir Dirextract(Draw::Atof(a[3]),Draw::Atof(a[4]),Draw::Atof(a[5]));
TopoDS_Face F;
Standard_Real Angle;
@ -74,9 +74,9 @@ static Standard_Integer DEP(Draw_Interpretor& theCommands,
TopoDS_Shape aLocalShape(DBRep::Get(a[8*ii+6],TopAbs_FACE));
F = TopoDS::Face(aLocalShape);
// F = TopoDS::Face(DBRep::Get(a[8*ii+6],TopAbs_FACE));
Angle = atof(a[8*ii+7])*M_PI/180.;
Pax.SetCoord(atof(a[8*ii+8]),atof(a[8*ii+9]),atof(a[8*ii+10]));
Dax.SetCoord(atof(a[8*ii+11]),atof(a[8*ii+12]),atof(a[8*ii+13]));
Angle = Draw::Atof(a[8*ii+7])*M_PI/180.;
Pax.SetCoord(Draw::Atof(a[8*ii+8]),Draw::Atof(a[8*ii+9]),Draw::Atof(a[8*ii+10]));
Dax.SetCoord(Draw::Atof(a[8*ii+11]),Draw::Atof(a[8*ii+12]),Draw::Atof(a[8*ii+13]));
drft.Add(F,Dirextract,Angle,gp_Pln(Pax,Dax));
if (!drft.AddDone()) {
break;
@ -115,7 +115,7 @@ static Standard_Integer NDEP(Draw_Interpretor& theCommands,
BRepOffsetAPI_DraftAngle drft(V);
gp_Dir Dirextract(atof(a[3]),atof(a[4]),atof(a[5]));
gp_Dir Dirextract(Draw::Atof(a[3]),Draw::Atof(a[4]),Draw::Atof(a[5]));
TopoDS_Face F;
Standard_Real Angle;
@ -134,13 +134,13 @@ static Standard_Integer NDEP(Draw_Interpretor& theCommands,
}
//#ifdef DEB
// Flag = atof(a[9*ii+7]); // BUG?? Real -> Boolean ???
// Flag = Draw::Atof(a[9*ii+7]); // BUG?? Real -> Boolean ???
//#else
Flag = (Standard_Boolean ) atof(a[9*ii+7]);
Flag = (Standard_Boolean ) Draw::Atof(a[9*ii+7]);
//#endif
Angle = atof(a[9*ii+8])*M_PI/180.;
Pax.SetCoord(atof(a[9*ii+9]),atof(a[9*ii+10]),atof(a[9*ii+11]));
Dax.SetCoord(atof(a[9*ii+12]),atof(a[9*ii+13]),atof(a[9*ii+14]));
Angle = Draw::Atof(a[9*ii+8])*M_PI/180.;
Pax.SetCoord(Draw::Atof(a[9*ii+9]),Draw::Atof(a[9*ii+10]),Draw::Atof(a[9*ii+11]));
Dax.SetCoord(Draw::Atof(a[9*ii+12]),Draw::Atof(a[9*ii+13]),Draw::Atof(a[9*ii+14]));
drft.Add(F,Dirextract,Angle,gp_Pln(Pax,Dax), Flag);
if (!drft.AddDone()) {
break;
@ -175,10 +175,10 @@ static Standard_Integer draft (Draw_Interpretor& di,
Standard_Real x, y ,z, teta;
TopoDS_Shape SInit = DBRep::Get(a[2]);//shape d'arret
x = atof(a[3]);
y = atof(a[4]); // direction de depouille
z = atof(a[5]);
teta = atof(a[6]); //angle de depouille (teta)
x = Draw::Atof(a[3]);
y = Draw::Atof(a[4]); // direction de depouille
z = Draw::Atof(a[5]);
teta = Draw::Atof(a[6]); //angle de depouille (teta)
gp_Dir D(x,y,z);
@ -238,7 +238,7 @@ static Standard_Integer draft (Draw_Interpretor& di,
MkDraft.Perform(Surf, KeepInside);
}
else { // by Lenght
Standard_Real L = atof(a[7]);
Standard_Real L = Draw::Atof(a[7]);
if (L > 1.e-7) {
MkDraft.Perform(L);
}

View File

@ -84,7 +84,7 @@ static Standard_Integer distmini(Draw_Interpretor& di, Standard_Integer n, const
#endif
char named[100];
sprintf(named, "%s%s" ,ns0,"_val");
Sprintf(named, "%s%s" ,ns0,"_val");
char* tempd = named;
Draw::Set(tempd,dst.Value());
di << named << " ";
@ -99,8 +99,8 @@ static Standard_Integer distmini(Draw_Interpretor& di, Standard_Integer n, const
TopoDS_Vertex V =BRepLib_MakeVertex(P1);
char namev[100];
if (i1==1)
sprintf(namev, "%s" ,ns0);
else sprintf(namev, "%s%d" ,ns0,i1);
Sprintf(namev, "%s" ,ns0);
else Sprintf(namev, "%s%d" ,ns0,i1);
char* tempv = namev;
DBRep::Set(tempv,V);
di << namev << " ";
@ -109,8 +109,8 @@ static Standard_Integer distmini(Draw_Interpretor& di, Standard_Integer n, const
{char name[100];
TopoDS_Edge E = BRepLib_MakeEdge (P1, P2);
if (i1==1)
{sprintf(name,"%s",ns0);}
else {sprintf(name,"%s%d",ns0,i1);}
{Sprintf(name,"%s",ns0);}
else {Sprintf(name,"%s%d",ns0,i1);}
char* temp = name;
DBRep::Set(temp,E);
di << name << " " ;

View File

@ -172,7 +172,7 @@ static Standard_Integer Loc(Draw_Interpretor& theCommands,
i = 0;
for (; its.More(); its.Next()) {
i++;
sprintf(p,"%d",i);
Sprintf(p,"%d",i);
DBRep::Set(newname,its.Value());
}
if (i >= 2) {
@ -223,10 +223,10 @@ static Standard_Integer HOLE1(Draw_Interpretor& theCommands,
if (narg<10 || narg == 11) return 1;
TopoDS_Shape S = DBRep::Get(a[2]);
gp_Pnt Or(atof(a[3]),atof(a[4]),atof(a[5]));
gp_Dir Di(atof(a[6]),atof(a[7]),atof(a[8]));
gp_Pnt Or(Draw::Atof(a[3]),Draw::Atof(a[4]),Draw::Atof(a[5]));
gp_Dir Di(Draw::Atof(a[6]),Draw::Atof(a[7]),Draw::Atof(a[8]));
Standard_Real Radius = atof(a[9]);
Standard_Real Radius = Draw::Atof(a[9]);
theHole.Init(S,gp_Ax1(Or,Di));
@ -234,8 +234,8 @@ static Standard_Integer HOLE1(Draw_Interpretor& theCommands,
theHole.Perform(Radius);
}
else {
Standard_Real pfrom = atof(a[10]);
Standard_Real pto = atof(a[11]);
Standard_Real pfrom = Draw::Atof(a[10]);
Standard_Real pto = Draw::Atof(a[11]);
theHole.Perform(Radius,pfrom,pto,WithControl);
}
@ -257,10 +257,10 @@ static Standard_Integer HOLE2(Draw_Interpretor& theCommands,
if (narg<10) return 1;
TopoDS_Shape S = DBRep::Get(a[2]);
gp_Pnt Or(atof(a[3]),atof(a[4]),atof(a[5]));
gp_Dir Di(atof(a[6]),atof(a[7]),atof(a[8]));
gp_Pnt Or(Draw::Atof(a[3]),Draw::Atof(a[4]),Draw::Atof(a[5]));
gp_Dir Di(Draw::Atof(a[6]),Draw::Atof(a[7]),Draw::Atof(a[8]));
Standard_Real Radius = atof(a[9]);
Standard_Real Radius = Draw::Atof(a[9]);
theHole.Init(S,gp_Ax1(Or,Di));
theHole.PerformThruNext(Radius,WithControl);
@ -283,10 +283,10 @@ static Standard_Integer HOLE3(Draw_Interpretor& theCommands,
if (narg<10) return 1;
TopoDS_Shape S = DBRep::Get(a[2]);
gp_Pnt Or(atof(a[3]),atof(a[4]),atof(a[5]));
gp_Dir Di(atof(a[6]),atof(a[7]),atof(a[8]));
gp_Pnt Or(Draw::Atof(a[3]),Draw::Atof(a[4]),Draw::Atof(a[5]));
gp_Dir Di(Draw::Atof(a[6]),Draw::Atof(a[7]),Draw::Atof(a[8]));
Standard_Real Radius = atof(a[9]);
Standard_Real Radius = Draw::Atof(a[9]);
theHole.Init(S,gp_Ax1(Or,Di));
theHole.PerformUntilEnd(Radius,WithControl);
@ -309,11 +309,11 @@ static Standard_Integer HOLE4(Draw_Interpretor& theCommands,
if (narg<11) return 1;
TopoDS_Shape S = DBRep::Get(a[2]);
gp_Pnt Or(atof(a[3]),atof(a[4]),atof(a[5]));
gp_Dir Di(atof(a[6]),atof(a[7]),atof(a[8]));
gp_Pnt Or(Draw::Atof(a[3]),Draw::Atof(a[4]),Draw::Atof(a[5]));
gp_Dir Di(Draw::Atof(a[6]),Draw::Atof(a[7]),Draw::Atof(a[8]));
Standard_Real Radius = atof(a[9]);
Standard_Real Length = atof(a[10]);
Standard_Real Radius = Draw::Atof(a[9]);
Standard_Real Length = Draw::Atof(a[10]);
theHole.Init(S,gp_Ax1(Or,Di));
theHole.PerformBlind(Radius,Length,WithControl);
@ -378,19 +378,19 @@ static Standard_Integer PRW(Draw_Interpretor& theCommands,
if (narg < 11) {
return 1;
}
V.SetCoord(atof(a[6]),atof(a[7]),atof(a[8]));
V.SetCoord(Draw::Atof(a[6]),Draw::Atof(a[7]),Draw::Atof(a[8]));
FFrom = DBRep::Get(a[4],TopAbs_SHAPE);
FUntil = DBRep::Get(a[5],TopAbs_SHAPE);
borne = 9;
}
else {
V.SetCoord(atof(a[5]),atof(a[6]),atof(a[7]));
V.SetCoord(Draw::Atof(a[5]),Draw::Atof(a[6]),Draw::Atof(a[7]));
FUntil = DBRep::Get(a[4],TopAbs_SHAPE);
borne = 8;
}
}
else {
V.SetCoord(atof(a[4]),atof(a[5]),atof(a[6]));
V.SetCoord(Draw::Atof(a[4]),Draw::Atof(a[5]),Draw::Atof(a[6]));
borne = 7;
}
Standard_Real Length = V.Magnitude();
@ -554,19 +554,19 @@ static Standard_Integer PRF(Draw_Interpretor& theCommands,
return 1;
}
borne = 9;
V.SetCoord(atof(a[6]),atof(a[7]),atof(a[8]));
V.SetCoord(Draw::Atof(a[6]),Draw::Atof(a[7]),Draw::Atof(a[8]));
FFrom = DBRep::Get(a[4],TopAbs_SHAPE);
FUntil = DBRep::Get(a[5],TopAbs_SHAPE);
}
else {
borne = 8;
V.SetCoord(atof(a[5]),atof(a[6]),atof(a[7]));
V.SetCoord(Draw::Atof(a[5]),Draw::Atof(a[6]),Draw::Atof(a[7]));
FUntil = DBRep::Get(a[4],TopAbs_SHAPE);
}
}
else {
borne = 7;
V.SetCoord(atof(a[4]),atof(a[5]),atof(a[6]));
V.SetCoord(Draw::Atof(a[4]),Draw::Atof(a[5]),Draw::Atof(a[6]));
}
Standard_Real Length = V.Magnitude();
if (Length < Precision::Confusion()) {
@ -813,7 +813,7 @@ Standard_Integer thickshell(Draw_Interpretor& ,
TopoDS_Shape S = DBRep::Get(a[2]);
if (S.IsNull()) return 1;
Standard_Real Of = atof(a[3]);
Standard_Real Of = Draw::Atof(a[3]);
GeomAbs_JoinType JT= GeomAbs_Arc;
if (n > 4)
@ -827,7 +827,7 @@ Standard_Integer thickshell(Draw_Interpretor& ,
Standard_Boolean Inter = Standard_False; //Standard_True;
Standard_Real Tol = Precision::Confusion();
if (n > 5)
Tol = atof(a[5]);
Tol = Draw::Atof(a[5]);
BRepOffset_MakeOffset B;
B.Initialize(S,Of,Tol,BRepOffset_Skin,Inter,0,JT, Standard_True);
@ -859,7 +859,7 @@ Standard_Integer offsetshape(Draw_Interpretor& ,
TopoDS_Shape S = DBRep::Get(a[2]);
if (S.IsNull()) return 1;
Standard_Real Of = atof(a[3]);
Standard_Real Of = Draw::Atof(a[3]);
Standard_Boolean Inter = (!strcmp(a[0],"offsetcompshape"));
GeomAbs_JoinType JT= GeomAbs_Arc;
if (!strcmp(a[0],"offsetinter")) {
@ -874,7 +874,7 @@ Standard_Integer offsetshape(Draw_Interpretor& ,
TopoDS_Shape SF = DBRep::Get(a[4],TopAbs_FACE);
if (SF.IsNull()) {
IB = 5;
Tol = atof(a[4]);
Tol = Draw::Atof(a[4]);
}
}
B.Initialize(S,Of,Tol,BRepOffset_Skin,Inter,0,JT);
@ -947,7 +947,7 @@ Standard_Integer offsetparameter(Draw_Interpretor& di,
if ( n < 4 ) return 1;
TheTolerance = atof(a[1]);
TheTolerance = Draw::Atof(a[1]);
TheInter = strcmp(a[2],"p");
if ( !strcmp(a[3],"a")) TheJoin = GeomAbs_Arc;
@ -970,7 +970,7 @@ Standard_Integer offsetload(Draw_Interpretor& ,
TopoDS_Shape S = DBRep::Get(a[1]);
if (S.IsNull()) return 1;
Standard_Real Of = atof(a[2]);
Standard_Real Of = Draw::Atof(a[2]);
TheRadius = Of;
// Standard_Boolean Inter = Standard_True;
@ -1003,7 +1003,7 @@ Standard_Integer offsetonface(Draw_Interpretor&, Standard_Integer n, const char*
for (Standard_Integer i = 1 ; i < n; i+=2) {
TopoDS_Shape SF = DBRep::Get(a[i],TopAbs_FACE);
if (!SF.IsNull()) {
Standard_Real Of = atof(a[i+1]);
Standard_Real Of = Draw::Atof(a[i+1]);
TheOffset.SetOffsetOnFace(TopoDS::Face(SF),Of);
}
}
@ -1123,7 +1123,7 @@ static Standard_Integer ROW(Draw_Interpretor& theCommands,
FFrom = DBRep::Get(a[4],TopAbs_SHAPE);
if (FFrom.IsNull()) {
Angle = atof(a[4]);
Angle = Draw::Atof(a[4]);
Angle *=M_PI/180.;
i = 5;
}
@ -1144,8 +1144,8 @@ static Standard_Integer ROW(Draw_Interpretor& theCommands,
}
borne = i+6;
Or.SetCoord(atof(a[i]),atof(a[i+1]),atof(a[i+2]));
D.SetCoord(atof(a[i+3]),atof(a[i+4]),atof(a[i+5]));
Or.SetCoord(Draw::Atof(a[i]),Draw::Atof(a[i+1]),Draw::Atof(a[i+2]));
D.SetCoord(Draw::Atof(a[i+3]),Draw::Atof(a[i+4]),Draw::Atof(a[i+5]));
gp_Ax1 theAxis(Or,D);
TopoDS_Shape aLocalShape(DBRep::Get(a[borne],TopAbs_FACE));
@ -1284,7 +1284,7 @@ static Standard_Integer ROF(Draw_Interpretor& theCommands,
FFrom = DBRep::Get(a[4],TopAbs_SHAPE);
if (FFrom.IsNull()) {
Angle = atof(a[4]);
Angle = Draw::Atof(a[4]);
Angle *=M_PI/180.;
i = 5;
}
@ -1305,8 +1305,8 @@ static Standard_Integer ROF(Draw_Interpretor& theCommands,
}
borne = i+6;
Or.SetCoord(atof(a[i]),atof(a[i+1]),atof(a[i+2]));
D.SetCoord(atof(a[i+3]),atof(a[i+4]),atof(a[i+5]));
Or.SetCoord(Draw::Atof(a[i]),Draw::Atof(a[i+1]),Draw::Atof(a[i+2]));
D.SetCoord(Draw::Atof(a[i+3]),Draw::Atof(a[i+4]),Draw::Atof(a[i+5]));
gp_Ax1 theAxis(Or,D);
TopoDS_Shape ToRotate;
@ -1501,8 +1501,8 @@ static Standard_Integer DEFIN(Draw_Interpretor& theCommands,
theCommands << "null basis shape";
return 1;
}
Standard_Integer Ifuse = atoi(a[narg-2]);
Standard_Integer Imodif = atoi(a[narg-1]);
Standard_Integer Ifuse = Draw::Atoi(a[narg-2]);
Standard_Integer Imodif = Draw::Atoi(a[narg-1]);
Standard_Integer Fuse = Ifuse;
Standard_Boolean Modify = (Imodif!=0);
@ -1547,9 +1547,9 @@ static Standard_Integer DEFIN(Draw_Interpretor& theCommands,
if (narg == 9 || narg == 12 || narg == 14) {
// Standard_Real X,Y,Z,X1,Y1,Z1;
Standard_Real X,Y,Z;
X = atof(a[4]);
Y = atof(a[5]);
Z = atof(a[6]);
X = Draw::Atof(a[4]);
Y = Draw::Atof(a[5]);
Z = Draw::Atof(a[6]);
if (narg == 9) { // prism
prdef = Standard_True;
@ -1558,11 +1558,11 @@ static Standard_Integer DEFIN(Draw_Interpretor& theCommands,
else if(narg == 14) {
rfdef = Standard_True;
gp_Pnt Or(X, Y, Z);
X = atof(a[7]);
Y = atof(a[8]);
Z = atof(a[9]);
Standard_Real H1 = atof(a[10]);
Standard_Real H2 = atof(a[11]);
X = Draw::Atof(a[7]);
Y = Draw::Atof(a[8]);
Z = Draw::Atof(a[9]);
Standard_Real H1 = Draw::Atof(a[10]);
Standard_Real H2 = Draw::Atof(a[11]);
gp_Ax1 ax1(Or, gp_Dir(X, Y, Z));
theRF.Init(Sbase, W, P, ax1, H1, H2, Fuse, Modify);
if (!theRF.IsDone()) {
@ -1577,18 +1577,18 @@ static Standard_Integer DEFIN(Draw_Interpretor& theCommands,
else if(narg == 12 && strcasecmp(a[0],"FEATLF")) {
rvdef = Standard_True;
gp_Pnt Or(X,Y,Z);
X = atof(a[7]);
Y = atof(a[8]);
Z = atof(a[9]);
X = Draw::Atof(a[7]);
Y = Draw::Atof(a[8]);
Z = Draw::Atof(a[9]);
theRevol.Init(Sbase,Pbase,Skface,gp_Ax1(Or,gp_Dir(X,Y,Z)),
Fuse,Modify);
}
else {
lfdef = Standard_True;
gp_Vec Direct(X,Y,Z);
X = atof(a[7]);
Y = atof(a[8]);
Z = atof(a[9]);
X = Draw::Atof(a[7]);
Y = Draw::Atof(a[8]);
Z = Draw::Atof(a[9]);
theLF.Init(Sbase, W, P, Direct, gp_Vec(X,Y,Z), Fuse,Modify);
if (!theLF.IsDone()) {
se = theLF.CurrentStatusError();
@ -1606,7 +1606,7 @@ static Standard_Integer DEFIN(Draw_Interpretor& theCommands,
theCommands << "Invalid DPrism base";
return 1;
}
Standard_Real Angle = atof(a[4])*M_PI/360;
Standard_Real Angle = Draw::Atof(a[4])*M_PI/360;
dprdef = Standard_True;
theDPrism.Init(Sbase,TopoDS::Face(Pbase),Skface,Angle,Fuse,Modify);
}
@ -1785,7 +1785,7 @@ static Standard_Integer PERF(Draw_Interpretor& theCommands,
return 1;
}
if (narg == 4) {
Standard_Real Val = atof(a[3]);
Standard_Real Val = Draw::Atof(a[3]);
if (Kas == 1) {
thePrism.Perform(Val);
}
@ -1806,7 +1806,7 @@ static Standard_Integer PERF(Draw_Interpretor& theCommands,
}
}
else if(narg == 5) {
Standard_Real Val = atof(a[3]);
Standard_Real Val = Draw::Atof(a[3]);
TopoDS_Shape FUntil = DBRep::Get(a[4],TopAbs_SHAPE);
if (Kas == 1) {
thePrism.PerformUntilHeight(FUntil, Val);
@ -2059,14 +2059,14 @@ static Standard_Integer BOSS(Draw_Interpretor& theCommands,
Standard_Integer dprsig=0;
if (!strcasecmp("ENDEDGES",a[0])) {
Kas = 1;
dprsig = atoi(a[4]);
dprsig = Draw::Atoi(a[4]);
}
else if (!strcasecmp("FILLET",a[0])) {
Kas = 2;
}
else if (!strcasecmp("BOSSAGE",a[0])) {
Kas = 3;
dprsig = atoi(a[5]);
dprsig = Draw::Atoi(a[5]);
}
TopoDS_Shape theShapeTop;
@ -2137,7 +2137,7 @@ static Standard_Integer BOSS(Draw_Interpretor& theCommands,
if (Kas == 2) {
for (Standard_Integer ii = 1; ii < (narg-1)/2; ii++){
Rad = atof(a[2*ii + 1]);
Rad = Draw::Atof(a[2*ii + 1]);
if (Rad == 0.) continue;
S = DBRep::Get(a[(2*ii+2)],TopAbs_SHAPE);
TopExp_Explorer exp;
@ -2151,7 +2151,7 @@ static Standard_Integer BOSS(Draw_Interpretor& theCommands,
}
}
else if (Kas == 3) {
Rad = atof(a[3]);
Rad = Draw::Atof(a[3]);
if (Rad != 0.) {
S = theShapeTop;
TopExp_Explorer exp;
@ -2163,7 +2163,7 @@ static Standard_Integer BOSS(Draw_Interpretor& theCommands,
}
}
}
Rad = atof(a[4]);
Rad = Draw::Atof(a[4]);
if (Rad != 0.) {
S = theShapeBottom;
TopExp_Explorer exp;

View File

@ -103,7 +103,7 @@ static Standard_Integer chfi2d(Draw_Interpretor& di, Standard_Integer n, const c
return 1;
}
Standard_Real p1 = atof(a[i+1]);
Standard_Real p1 = Draw::Atof(a[i+1]);
if (*a[i] == 'F') {
MF.AddFillet(V,p1);
}
@ -116,7 +116,7 @@ static Standard_Integer chfi2d(Draw_Interpretor& di, Standard_Integer n, const c
}
return 1;
}
Standard_Real p2 = atof(a[i+2]);
Standard_Real p2 = Draw::Atof(a[i+2]);
if (a[i][2] == 'D') {
MF.AddChamfer(E1,E2,p1,p2);
}

View File

@ -109,7 +109,7 @@ static Standard_Integer contblend(Draw_Interpretor& di, Standard_Integer narg, c
}
else {
if (narg >3) return 1;
if (narg == 3) { tapp_angle = Abs(atof(a[2])); }
if (narg == 3) { tapp_angle = Abs(Draw::Atof(a[2])); }
char c=a[1][1];
switch (c) {
case '0':
@ -149,10 +149,10 @@ static Standard_Integer tolblend(Draw_Interpretor& di, Standard_Integer narg, co
return 0;
}
else if(narg == 5){
ta = atof(a[1]);
t3d = atof(a[2]);
t2d = atof(a[3]);
fl = atof(a[4]);
ta = Draw::Atof(a[1]);
t3d = Draw::Atof(a[2]);
t2d = Draw::Atof(a[3]);
fl = Draw::Atof(a[4]);
return 0;
}
return 1;
@ -180,7 +180,7 @@ static Standard_Integer BLEND(Draw_Interpretor& di, Standard_Integer narg, const
TopoDS_Edge E;
Standard_Integer nbedge = 0;
for (Standard_Integer ii = 1; ii < (narg-1)/2; ii++){
Rad = atof(a[2*ii + 1]);
Rad = Draw::Atof(a[2*ii + 1]);
TopoDS_Shape aLocalEdge(DBRep::Get(a[(2*ii+2)],TopAbs_EDGE));
E = TopoDS::Edge(aLocalEdge);
// E = TopoDS::Edge(DBRep::Get(a[(2*ii+2)],TopAbs_EDGE));
@ -207,13 +207,13 @@ static void PrintHist(const TopoDS_Shape& S,
B.Add(C,S);
char localname[100];
if(nbgen<10){
sprintf(localname,"generated_00%d", nbgen++);
Sprintf(localname,"generated_00%d", nbgen++);
}
else if(nbgen<100){
sprintf(localname,"generated_0%d", nbgen++);
Sprintf(localname,"generated_0%d", nbgen++);
}
else {
sprintf(localname,"generated_%d", nbgen++);
Sprintf(localname,"generated_%d", nbgen++);
}
for(; It.More(); It.Next()){
B.Add(C,It.Value());
@ -299,8 +299,8 @@ static Standard_Integer UPDATEVOL(Draw_Interpretor& di,
TopoDS_Edge E = TopoDS::Edge(aLocalEdge);
// TopoDS_Edge E = TopoDS::Edge(DBRep::Get(a[1],TopAbs_EDGE));
for (Standard_Integer ii = 1; ii <= (narg/2)-1; ii++){
Par = atof(a[2*ii]);
Rad = atof(a[2*ii + 1]);
Par = Draw::Atof(a[2*ii]);
Rad = Draw::Atof(a[2*ii + 1]);
uandr.ChangeValue(ii).SetCoord(Par,Rad);
}
Rake->Add(uandr,E);
@ -341,7 +341,7 @@ Standard_Integer topoblend(Draw_Interpretor& di, Standard_Integer narg, const ch
Standard_Boolean fuse = !strcmp(a[0],"fubl");
TopoDS_Shape S1 = DBRep::Get(a[2]);
TopoDS_Shape S2 = DBRep::Get(a[3]);
Standard_Real Rad = atof(a[4]);
Standard_Real Rad = Draw::Atof(a[4]);
BRepAlgo_BooleanOperation* BC;
if(fuse){
BC = new BRepAlgo_Fuse(S1,S2);
@ -402,7 +402,7 @@ Standard_Integer boptopoblend(Draw_Interpretor& di, Standard_Integer narg, const
printf(" Null shapes are not allowed \n");
return 1;
}
Standard_Real Rad = atof(a[4]);
Standard_Real Rad = Draw::Atof(a[4]);
BOPTools_DSFiller theDSFiller;
@ -476,7 +476,7 @@ static Standard_Integer blend1(Draw_Interpretor& di, Standard_Integer narg, cons
Standard_Real Rad;
Standard_Boolean simul=Standard_False;
const char *ns0=(a[1]);
Rad = atof(a[3]);
Rad = Draw::Atof(a[3]);
TopTools_ListOfShape E;
for (i=4; i <=(narg-1) ; i++){
TopoDS_Shape edge= DBRep::Get(a[i],TopAbs_EDGE);
@ -559,47 +559,47 @@ static Standard_Integer blend1(Draw_Interpretor& di, Standard_Integer narg, cons
di<<"precision "<< i << "= "<<Rakk.TolApp3d(i)<<"\n";
// display resulting surfaces
sprintf(localname, "%s%d" ,ns0,i);
Sprintf(localname, "%s%d" ,ns0,i);
temp = localname;
DrawTrSurf::Set(temp,Rakk.SurfaceFillet(i));
di << localname<< " ";
// display curves 3d
sprintf(localname, "%s%d" ,"courb1",i);
Sprintf(localname, "%s%d" ,"courb1",i);
temp =localname;
DrawTrSurf::Set(temp,Rakk.CurveOnFace1(i));
di << localname<< " ";
sprintf(localname, "%s%d" ,"courb2",i);
Sprintf(localname, "%s%d" ,"courb2",i);
temp =localname;
DrawTrSurf::Set(temp,Rakk.CurveOnFace2(i));
di << localname<< " ";
// display supports
sprintf(localname, "%s%d" ,"face1",i);
Sprintf(localname, "%s%d" ,"face1",i);
temp =localname ;
DBRep::Set(temp,Rakk.SupportFace1(i));
di << localname<< " ";
sprintf(localname, "%s%d" ,"face2",i);
Sprintf(localname, "%s%d" ,"face2",i);
temp =localname;
DBRep::Set(temp,Rakk.SupportFace2(i));
di << localname<< " ";
// display Pcurves on faces
sprintf(localname, "%s%d" ,"pcurveonface1",i);
Sprintf(localname, "%s%d" ,"pcurveonface1",i);
temp =localname ;
DrawTrSurf::Set(temp,Rakk.PCurveOnFace1(i));
di << localname<< " ";
sprintf(localname, "%s%d" ,"pcurveonface2",i);
Sprintf(localname, "%s%d" ,"pcurveonface2",i);
temp =localname;
DrawTrSurf::Set(temp,Rakk.PCurveOnFace2(i));
di << localname<< " ";
// display Pcurves on the fillet
sprintf(localname, "%s%d" ,"pcurveonconge1",i);
Sprintf(localname, "%s%d" ,"pcurveonconge1",i);
temp =localname;
DrawTrSurf::Set(temp,Rakk.PCurve1OnFillet(i));
di << localname<< " ";
sprintf(localname, "%s%d" ,"pcurveonconge2",i);
Sprintf(localname, "%s%d" ,"pcurveonconge2",i);
temp =localname;
DrawTrSurf::Set(temp,Rakk.PCurve2OnFillet(i));
di << localname<< " ";
@ -613,7 +613,7 @@ static Standard_Integer blend1(Draw_Interpretor& di, Standard_Integer narg, cons
for (j=1;j<=s;j++)
{Handle(Geom_TrimmedCurve Sec);
Rakk.Section(i,j,Sec);
sprintf(localname, "%s%d%d" ,"sec",i,j);
Sprintf(localname, "%s%d%d" ,"sec",i,j);
temp =localname;
DrawTrSurf::Set (temp,Sec);
di << localname<< " ";}
@ -633,7 +633,7 @@ Standard_Integer rollingball(Draw_Interpretor& di, Standard_Integer n, const cha
TopoDS_Shape S = DBRep::Get(a[2]);
if ( S.IsNull()) return 1;
Standard_Real Rad = atof(a[3]);
Standard_Real Rad = Draw::Atof(a[3]);
Standard_Real Tol = t3d; //the same as blend ! 1.e-7;
@ -708,7 +708,7 @@ Standard_Integer rollingball(Draw_Interpretor& di, Standard_Integer n, const cha
di << " " << From << " " << To << "\n";
for (Standard_Integer j = From; j <= To; j++) {
const TopoDS_Shape& CurF = Roll.Face(j);
sprintf(localname,"%s_%d_%d",a[1],i,j);
Sprintf(localname,"%s_%d_%d",a[1],i,j);
DBRep::Set(localname,CurF);
}
}

View File

@ -140,7 +140,7 @@ Standard_Integer MaxSegments = defMaxSegments;
static Standard_Integer plate (Draw_Interpretor & di,Standard_Integer n,const char** a)
{
if (n < 8 ) return 1;
Standard_Integer NbCurFront=atoi(a[3]);
Standard_Integer NbCurFront=Draw::Atoi(a[3]);
Handle(GeomPlate_HArray1OfHCurveOnSurface) Fronts = new GeomPlate_HArray1OfHCurveOnSurface(1,NbCurFront);
Handle(TColStd_HArray1OfInteger) Tang = new TColStd_HArray1OfInteger(1,NbCurFront);
Handle(TColStd_HArray1OfInteger) NbPtsCur = new TColStd_HArray1OfInteger(1,NbCurFront);
@ -158,9 +158,9 @@ static Standard_Integer plate (Draw_Interpretor & di,Standard_Integer n,const ch
TopoDS_Face F = TopoDS::Face(aLocalFace);
// TopoDS_Face F = TopoDS::Face(DBRep::Get(a[3*i+2],TopAbs_FACE));
if(F.IsNull()) return 1;
Standard_Integer T = atoi(a[3*i+3]);
Standard_Integer T = Draw::Atoi(a[3*i+3]);
Tang->SetValue(i,T);
NbPtsCur->SetValue(i,atoi(a[2]));
NbPtsCur->SetValue(i,Draw::Atoi(a[2]));
Handle(BRepAdaptor_HSurface) S = new BRepAdaptor_HSurface();
S->ChangeSurface().Initialize(F);
Handle(BRepAdaptor_HCurve2d) C = new BRepAdaptor_HCurve2d();
@ -204,7 +204,7 @@ static Standard_Integer plate (Draw_Interpretor & di,Standard_Integer n,const ch
B.UpdateVertex(TopExp::LastVertex(E), ErrG0);
BRepLib::BuildCurve3d(E);
char name[100];
sprintf(name,"Edge_%d", i);
Sprintf(name,"Edge_%d", i);
DBRep::Set(name, E);
MW.Add(E);
if (MW.IsDone()==Standard_False) {
@ -227,8 +227,8 @@ static Standard_Integer plate (Draw_Interpretor & di,Standard_Integer n,const ch
static Standard_Integer gplate (Draw_Interpretor & ,Standard_Integer n,const char** a)
{
if (n < 6 ) return 1;
Standard_Integer NbCurFront=atoi(a[2]),
NbPointConstraint=atoi(a[3]);
Standard_Integer NbCurFront=Draw::Atoi(a[2]),
NbPointConstraint=Draw::Atoi(a[3]);
GeomPlate_BuildPlateSurface Henri(3,15,2);
@ -251,7 +251,7 @@ static Standard_Integer gplate (Draw_Interpretor & ,Standard_Integer n,const cha
TopoDS_Edge E = TopoDS::Edge(aLocalShape);
// TopoDS_Edge E = TopoDS::Edge(DBRep::Get(a[Indice++],TopAbs_EDGE));
if(E.IsNull()) return 1;
Conti=atoi(a[Indice++]);
Conti=Draw::Atoi(a[Indice++]);
if ((Conti==0)||(Conti==-1))
{ Handle(BRepAdaptor_HCurve) C = new BRepAdaptor_HCurve();
C->ChangeCurve().Initialize(E);
@ -289,10 +289,10 @@ static Standard_Integer gplate (Draw_Interpretor & ,Standard_Integer n,const cha
Indice++;
}
else
{ Standard_Real u=atof(a[Indice++]),
v=atof(a[Indice++]);
{ Standard_Real u=Draw::Atof(a[Indice++]),
v=Draw::Atof(a[Indice++]);
Conti=atoi(a[Indice++]);
Conti=Draw::Atoi(a[Indice++]);
aLocalFace = DBRep::Get(a[Indice++],TopAbs_FACE);
TopoDS_Face F = TopoDS::Face(aLocalFace);
// TopoDS_Face F = TopoDS::Face(DBRep::Get(a[Indice++],TopAbs_FACE));
@ -339,8 +339,8 @@ static Standard_Integer gplate (Draw_Interpretor & ,Standard_Integer n,const cha
static Standard_Integer approxplate (Draw_Interpretor & di,Standard_Integer n,const char** a)
{
if (n < 9 ) return 1;
Standard_Integer NbMedium=atoi(a[2]);
Standard_Integer NbCurFront=atoi(a[3]);
Standard_Integer NbMedium=Draw::Atoi(a[2]);
Standard_Integer NbCurFront=Draw::Atoi(a[3]);
Handle(GeomPlate_HArray1OfHCurveOnSurface) Fronts = new GeomPlate_HArray1OfHCurveOnSurface(1,NbCurFront);
Handle(TColStd_HArray1OfInteger) Tang = new TColStd_HArray1OfInteger(1,NbCurFront);
Handle(TColStd_HArray1OfInteger) NbPtsCur = new TColStd_HArray1OfInteger(1,NbCurFront);
@ -357,7 +357,7 @@ static Standard_Integer approxplate (Draw_Interpretor & di,Standard_Integer n,co
TopoDS_Face F = TopoDS::Face(aLocalFace);
// TopoDS_Face F = TopoDS::Face(DBRep::Get(a[3*i+2],TopAbs_FACE));
if(F.IsNull()) return 1;
Standard_Integer T = atoi(a[3*i+3]);
Standard_Integer T = Draw::Atoi(a[3*i+3]);
Tang->SetValue(i,T);
NbPtsCur->SetValue(i,NbMedium);
Handle(BRepAdaptor_HSurface) S = new BRepAdaptor_HSurface();
@ -381,10 +381,10 @@ static Standard_Integer approxplate (Draw_Interpretor & di,Standard_Integer n,co
//cout<<" dist. max = "<<dmax<<" ; angle max = "<<anmax<<endl;
di<<" dist. max = "<<dmax<<" ; angle max = "<<anmax<<"\n";
Tol3d = atof(a[3*NbCurFront+4]);
Standard_Integer Nbmax = atoi(a[3*NbCurFront+5]);
Standard_Integer degmax = atoi(a[3*NbCurFront+6]);
Standard_Integer CritOrder = atoi(a[3*NbCurFront+7]);
Tol3d = Draw::Atof(a[3*NbCurFront+4]);
Standard_Integer Nbmax = Draw::Atoi(a[3*NbCurFront+5]);
Standard_Integer degmax = Draw::Atoi(a[3*NbCurFront+6]);
Standard_Integer CritOrder = Draw::Atoi(a[3*NbCurFront+7]);
Handle(GeomPlate_Surface) surf = Henri.Surface();
Handle(Geom_BSplineSurface) support;
@ -462,9 +462,9 @@ static Standard_Integer filling( Draw_Interpretor & di, Standard_Integer n, cons
#endif
if (n < 7) return 1;
Standard_Integer NbBounds = atoi( a[2] );
Standard_Integer NbConstraints = atoi( a[3] );
Standard_Integer NbPoints = atoi( a[4] );
Standard_Integer NbBounds = Draw::Atoi( a[2] );
Standard_Integer NbConstraints = Draw::Atoi( a[3] );
Standard_Integer NbPoints = Draw::Atoi( a[4] );
BRepOffsetAPI_MakeFilling MakeFilling( Degree,
NbPtsOnCur,
@ -502,7 +502,7 @@ static Standard_Integer filling( Draw_Interpretor & di, Standard_Integer n, cons
if (! F.IsNull())
i++;
Order = atoi( a[i++] );
Order = Draw::Atoi( a[i++] );
if (! E.IsNull() && ! F.IsNull())
MakeFilling.Add( E, F, (GeomAbs_Shape)Order );
@ -539,7 +539,7 @@ static Standard_Integer filling( Draw_Interpretor & di, Standard_Integer n, cons
if (! F.IsNull())
i++;
Order = atoi( a[i++] );
Order = Draw::Atoi( a[i++] );
if (F.IsNull())
MakeFilling.Add( E, (GeomAbs_Shape)Order, Standard_False );
@ -555,7 +555,7 @@ static Standard_Integer filling( Draw_Interpretor & di, Standard_Integer n, cons
}
else
{
Standard_Real U = atof( a[i++] ), V = atof( a[i++] );
Standard_Real U = Draw::Atof( a[i++] ), V = Draw::Atof( a[i++] );
//aLocalFace = DBRep::Get( a[i++], TopAbs_FACE );
//F = TopoDS::Face( aLocalFace);
F = TopoDS::Face( DBRep::Get(a[i++], TopAbs_FACE));
@ -565,7 +565,7 @@ static Standard_Integer filling( Draw_Interpretor & di, Standard_Integer n, cons
di<<"Wrong parameters"<<"\n";
return 1;
}
Order = atoi( a[i++] );
Order = Draw::Atoi( a[i++] );
MakeFilling.Add( U, V, F, (GeomAbs_Shape)Order );
}
@ -669,22 +669,22 @@ static Standard_Integer fillingparam( Draw_Interpretor & di, Standard_Integer n,
}
else if (strcmp( flag, "-r" ) == 0 && n == 6)
{
Degree = atoi( a[2] );
NbPtsOnCur = atoi( a[3] );
NbIter = atoi( a[4] );
Anisotropie = atoi( a[5] );
Degree = Draw::Atoi( a[2] );
NbPtsOnCur = Draw::Atoi( a[3] );
NbIter = Draw::Atoi( a[4] );
Anisotropie = Draw::Atoi( a[5] );
}
else if (strcmp( flag, "-c" ) == 0 && n == 6)
{
Tol2d = atof( a[2] );
Tol3d = atof( a[3] );
TolAng = atof( a[4] );
TolCurv = atof( a[5] );
Tol2d = Draw::Atof( a[2] );
Tol3d = Draw::Atof( a[3] );
TolAng = Draw::Atof( a[4] );
TolCurv = Draw::Atof( a[5] );
}
else if (strcmp( flag, "-a" ) == 0 && n == 4)
{
MaxDeg = atoi( a[2] );
MaxSegments = atoi( a[3] );
MaxDeg = Draw::Atoi( a[2] );
MaxSegments = Draw::Atoi( a[3] );
}
else
{

View File

@ -63,7 +63,7 @@ Standard_Integer props(Draw_Interpretor& di, Standard_Integer n, const char** a)
Standard_Real eps = 1.0;
Standard_Boolean witheps = Standard_False;
if(n > 2 && *a[2]=='c' || n > 3 && *a[3]=='c') onlyClosed = Standard_True;
if(n > 2 && *a[2]!='c' && n != 5) {eps = atof (a[2]); witheps = Standard_True;}
if(n > 2 && *a[2]!='c' && n != 5) {eps = Draw::Atof (a[2]); witheps = Standard_True;}
if (witheps){
if (Abs(eps) < Precision::Angular()) return 2;
@ -177,13 +177,13 @@ Standard_Integer vpropsgk(Draw_Interpretor& di, Standard_Integer n, const char**
//Standard_Real aDefaultTol = 1.e-3;
Standard_Integer mode = 0;
eps = atof(a[2]);
mode = atoi(a[3]);
eps = Draw::Atof(a[2]);
mode = Draw::Atoi(a[3]);
if(mode > 0) onlyClosed = Standard_True;
mode = atoi(a[4]);
mode = Draw::Atoi(a[4]);
if(mode > 0) isUseSpan = Standard_True;
mode = atoi(a[5]);
mode = Draw::Atoi(a[5]);
if(mode == 1 || mode == 3) CGFlag = Standard_True;
if(mode == 2 || mode == 3) IFlag = Standard_True;

View File

@ -21,6 +21,7 @@
#include <BRepTest.hxx>
#include <Draw.hxx>
#include <Draw_Interpretor.hxx>
#include <DBRep.hxx>
#include <DrawTrSurf.hxx>
@ -197,12 +198,12 @@ Standard_Integer subshape(Draw_Interpretor& di, Standard_Integer n, const char**
p++;
Standard_Integer i = 0;
if (n == 3) {
Standard_Integer isub = atoi(a[2]);
Standard_Integer isub = Draw::Atoi(a[2]);
TopoDS_Iterator itr(S);
while (itr.More()) {
i++;
if ( i == isub ) {
sprintf(p,"%d",i);
Sprintf(p,"%d",i);
DBRep::Set(newname,itr.Value());
di.AppendElement(newname);
break;
@ -254,7 +255,7 @@ Standard_Integer subshape(Draw_Interpretor& di, Standard_Integer n, const char**
return 1;
}
Standard_Integer isub = atoi(a[3]);
Standard_Integer isub = Draw::Atoi(a[3]);
TopTools_MapOfShape M;
M.Add(S);
TopExp_Explorer ex(S,typ);
@ -262,7 +263,7 @@ Standard_Integer subshape(Draw_Interpretor& di, Standard_Integer n, const char**
if (M.Add(ex.Current())) {
i++;
if ( i == isub ) {
sprintf(p,"%d",i);
Sprintf(p,"%d",i);
DBRep::Set(newname,ex.Current());
di.AppendElement(newname);
break;
@ -298,7 +299,7 @@ Standard_Integer brepintcs(Draw_Interpretor& , Standard_Integer n, const char**
nbpi++;
char name[64];
char* temp = name; // pour portage WNT
sprintf(temp, "%s_%d", "brics", nbpi);
Sprintf(temp, "%s_%d", "brics", nbpi);
DrawTrSurf::Set(temp, curp);
}
}
@ -315,7 +316,7 @@ Standard_Integer brepintcs(Draw_Interpretor& , Standard_Integer n, const char**
nbpi++;
char name[64];
char* temp = name; // pour portage WNT
sprintf(temp, "%s_%d", "brics", nbpi);
Sprintf(temp, "%s_%d", "brics", nbpi);
DrawTrSurf::Set(temp, curp);
}
}
@ -369,7 +370,7 @@ Standard_Integer MakeShell(Draw_Interpretor& , Standard_Integer , const char** a
TopoDS_Face F = TopoDS::Face(InputShape);
// TopoDS_Face F = TopoDS::Face(DBRep::Get( a[2] ));
Standard_Real Off = -atof( a[3] );
Standard_Real Off = -Draw::Atof( a[3] );
BRepOffset_MakeOffset Offset;
@ -455,7 +456,7 @@ Standard_Integer xclassify (Draw_Interpretor& aDI, Standard_Integer n, const cha
//
aTol=1.e-7;
if (n==3) {
aTol=atof(a[2]);
aTol=Draw::Atof(a[2]);
}
//
BRepClass3d_SolidClassifier aSC(aS);

View File

@ -46,17 +46,17 @@
static Standard_Integer box(Draw_Interpretor& , Standard_Integer n, const char** a)
{
if (n < 5) return 1;
Standard_Real dx = atof(a[n-3]);
Standard_Real dy = atof(a[n-2]);
Standard_Real dz = atof(a[n-1]);
Standard_Real dx = Draw::Atof(a[n-3]);
Standard_Real dy = Draw::Atof(a[n-2]);
Standard_Real dz = Draw::Atof(a[n-1]);
TopoDS_Solid S;
if (n > 5) {
if (n < 8) return 1;
Standard_Real x = atof(a[2]);
Standard_Real y = atof(a[3]);
Standard_Real z = atof(a[4]);
Standard_Real x = Draw::Atof(a[2]);
Standard_Real y = Draw::Atof(a[3]);
Standard_Real z = Draw::Atof(a[4]);
S = BRepPrimAPI_MakeBox(gp_Pnt(x,y,z),dx,dy,dz);
}
else {
@ -77,29 +77,29 @@ static Standard_Integer wedge(Draw_Interpretor& , Standard_Integer n, const char
// Standard_Integer i = 0;
if ( n == 15 || n == 18) {
gp_Pnt LocalP(atof(a[2]),atof(a[3]),atof(a[4]));
gp_Dir LocalN(atof(a[5]),atof(a[6]),atof(a[7]));
gp_Dir LocalVx(atof(a[8]),atof(a[9]),atof(a[10]));
gp_Pnt LocalP(Draw::Atof(a[2]),Draw::Atof(a[3]),Draw::Atof(a[4]));
gp_Dir LocalN(Draw::Atof(a[5]),Draw::Atof(a[6]),Draw::Atof(a[7]));
gp_Dir LocalVx(Draw::Atof(a[8]),Draw::Atof(a[9]),Draw::Atof(a[10]));
gp_Ax2 Axis(LocalP,LocalN,LocalVx);
// gp_Ax2 Axis(gp_Pnt(atof(a[2]),atof(a[3]),atof(a[4])),
// gp_Dir(atof(a[5]),atof(a[6]),atof(a[7])),
// gp_Dir(atof(a[8]),atof(a[9]),atof(a[10])));
// gp_Ax2 Axis(gp_Pnt(Draw::Atof(a[2]),Draw::Atof(a[3]),Draw::Atof(a[4])),
// gp_Dir(Draw::Atof(a[5]),Draw::Atof(a[6]),Draw::Atof(a[7])),
// gp_Dir(Draw::Atof(a[8]),Draw::Atof(a[9]),Draw::Atof(a[10])));
if ( n == 15) {
S = BRepPrimAPI_MakeWedge(Axis,
atof(a[11]),atof(a[12]),atof(a[13]),atof(a[14]));
Draw::Atof(a[11]),Draw::Atof(a[12]),Draw::Atof(a[13]),Draw::Atof(a[14]));
}
else {
S = BRepPrimAPI_MakeWedge(Axis,
atof(a[11]),atof(a[12]),atof(a[13]),
atof(a[14]),atof(a[15]),atof(a[16]),atof(a[17]));
Draw::Atof(a[11]),Draw::Atof(a[12]),Draw::Atof(a[13]),
Draw::Atof(a[14]),Draw::Atof(a[15]),Draw::Atof(a[16]),Draw::Atof(a[17]));
}
}
else if (n == 6) {
S = BRepPrimAPI_MakeWedge(atof(a[2]),atof(a[3]),atof(a[4]),atof(a[5]));
S = BRepPrimAPI_MakeWedge(Draw::Atof(a[2]),Draw::Atof(a[3]),Draw::Atof(a[4]),Draw::Atof(a[5]));
}
else if (n == 9){
S = BRepPrimAPI_MakeWedge(atof(a[2]),atof(a[3]),atof(a[4]),
atof(a[5]),atof(a[6]),atof(a[7]),atof(a[8]));
S = BRepPrimAPI_MakeWedge(Draw::Atof(a[2]),Draw::Atof(a[3]),Draw::Atof(a[4]),
Draw::Atof(a[5]),Draw::Atof(a[6]),Draw::Atof(a[7]),Draw::Atof(a[8]));
}
else
return 1;
@ -120,19 +120,19 @@ static Standard_Integer cylinder(Draw_Interpretor& , Standard_Integer n, const c
Handle(Geom_Plane)::DownCast(DrawTrSurf::Get(a[2]));
if (n == 4) {
S = BRepPrimAPI_MakeCylinder(atof(a[2]),atof(a[3]));
S = BRepPrimAPI_MakeCylinder(Draw::Atof(a[2]),Draw::Atof(a[3]));
}
else if (n == 5) {
if (P.IsNull())
S = BRepPrimAPI_MakeCylinder(atof(a[2]),atof(a[3]),atof(a[4]) * (M_PI / 180.0));
S = BRepPrimAPI_MakeCylinder(Draw::Atof(a[2]),Draw::Atof(a[3]),Draw::Atof(a[4]) * (M_PI / 180.0));
else
S = BRepPrimAPI_MakeCylinder(P->Pln().Position().Ax2(),atof(a[3]),atof(a[4]));
S = BRepPrimAPI_MakeCylinder(P->Pln().Position().Ax2(),Draw::Atof(a[3]),Draw::Atof(a[4]));
}
else if (n == 6) {
if (P.IsNull())
return 1;
else
S = BRepPrimAPI_MakeCylinder(P->Pln().Position().Ax2(),atof(a[3]),atof(a[4]),atof(a[5]) * (M_PI / 180.0));
S = BRepPrimAPI_MakeCylinder(P->Pln().Position().Ax2(),Draw::Atof(a[3]),Draw::Atof(a[4]),Draw::Atof(a[5]) * (M_PI / 180.0));
}
else
return 1;
@ -154,16 +154,16 @@ static Standard_Integer cone(Draw_Interpretor& , Standard_Integer n, const char*
Handle(Geom_Plane)::DownCast(DrawTrSurf::Get(a[2]));
if (n == 5) {
S = BRepPrimAPI_MakeCone(atof(a[2]),atof(a[3]),atof(a[4]));
S = BRepPrimAPI_MakeCone(Draw::Atof(a[2]),Draw::Atof(a[3]),Draw::Atof(a[4]));
}
else if (n == 6) {
if (P.IsNull())
S = BRepPrimAPI_MakeCone(atof(a[2]),atof(a[3]),atof(a[4]),atof(a[5]) * (M_PI / 180.0));
S = BRepPrimAPI_MakeCone(Draw::Atof(a[2]),Draw::Atof(a[3]),Draw::Atof(a[4]),Draw::Atof(a[5]) * (M_PI / 180.0));
else
S = BRepPrimAPI_MakeCone(P->Pln().Position().Ax2(),atof(a[3]),atof(a[4]),atof(a[5]));
S = BRepPrimAPI_MakeCone(P->Pln().Position().Ax2(),Draw::Atof(a[3]),Draw::Atof(a[4]),Draw::Atof(a[5]));
}
else if (n == 7) {
S = BRepPrimAPI_MakeCone(P->Pln().Position().Ax2(),atof(a[3]),atof(a[4]),atof(a[5]),atof(a[6]) * (M_PI / 180.0));
S = BRepPrimAPI_MakeCone(P->Pln().Position().Ax2(),Draw::Atof(a[3]),Draw::Atof(a[4]),Draw::Atof(a[5]),Draw::Atof(a[6]) * (M_PI / 180.0));
}
else
return 1;
@ -185,28 +185,28 @@ static Standard_Integer sphere(Draw_Interpretor& , Standard_Integer n, const cha
Handle(Geom_Plane)::DownCast(DrawTrSurf::Get(a[2]));
if (n == 3) {
S = BRepPrimAPI_MakeSphere(atof(a[2]));
S = BRepPrimAPI_MakeSphere(Draw::Atof(a[2]));
}
else if (n == 4) {
if (P.IsNull())
S = BRepPrimAPI_MakeSphere(atof(a[2]),atof(a[3]) * (M_PI / 180.0));
S = BRepPrimAPI_MakeSphere(Draw::Atof(a[2]),Draw::Atof(a[3]) * (M_PI / 180.0));
else
S = BRepPrimAPI_MakeSphere(P->Pln().Position().Ax2(),atof(a[3]));
S = BRepPrimAPI_MakeSphere(P->Pln().Position().Ax2(),Draw::Atof(a[3]));
}
else if (n == 5) {
if (P.IsNull())
S = BRepPrimAPI_MakeSphere(atof(a[2]),atof(a[3]) * (M_PI / 180.0),atof(a[4]) * (M_PI / 180.0));
S = BRepPrimAPI_MakeSphere(Draw::Atof(a[2]),Draw::Atof(a[3]) * (M_PI / 180.0),Draw::Atof(a[4]) * (M_PI / 180.0));
else
S = BRepPrimAPI_MakeSphere(P->Pln().Position().Ax2(),atof(a[3]),atof(a[4]) * (M_PI / 180.0));
S = BRepPrimAPI_MakeSphere(P->Pln().Position().Ax2(),Draw::Atof(a[3]),Draw::Atof(a[4]) * (M_PI / 180.0));
}
else if (n == 6) {
if (P.IsNull())
S = BRepPrimAPI_MakeSphere(atof(a[2]),atof(a[3]) * (M_PI / 180.0),atof(a[4]) * (M_PI / 180.0),atof(a[5]) * (M_PI / 180.0));
S = BRepPrimAPI_MakeSphere(Draw::Atof(a[2]),Draw::Atof(a[3]) * (M_PI / 180.0),Draw::Atof(a[4]) * (M_PI / 180.0),Draw::Atof(a[5]) * (M_PI / 180.0));
else
S = BRepPrimAPI_MakeSphere(P->Pln().Position().Ax2(),atof(a[3]),atof(a[4]) * (M_PI / 180.0),atof(a[5]) * (M_PI / 180.0));
S = BRepPrimAPI_MakeSphere(P->Pln().Position().Ax2(),Draw::Atof(a[3]),Draw::Atof(a[4]) * (M_PI / 180.0),Draw::Atof(a[5]) * (M_PI / 180.0));
}
else if (n == 7) {
S = BRepPrimAPI_MakeSphere(P->Pln().Position().Ax2(),atof(a[3]),atof(a[4]) * (M_PI / 180.0),atof(a[5]) * (M_PI / 180.0),atof(a[6]) * (M_PI / 180.0));
S = BRepPrimAPI_MakeSphere(P->Pln().Position().Ax2(),Draw::Atof(a[3]),Draw::Atof(a[4]) * (M_PI / 180.0),Draw::Atof(a[5]) * (M_PI / 180.0),Draw::Atof(a[6]) * (M_PI / 180.0));
}
else
return 1;
@ -228,33 +228,33 @@ static Standard_Integer torus(Draw_Interpretor& , Standard_Integer n, const char
Handle(Geom_Plane)::DownCast(DrawTrSurf::Get(a[2]));
if (n == 4) {
S = BRepPrimAPI_MakeTorus(atof(a[2]),atof(a[3]));
S = BRepPrimAPI_MakeTorus(Draw::Atof(a[2]),Draw::Atof(a[3]));
}
else if (n == 5) {
if (P.IsNull())
S = BRepPrimAPI_MakeTorus(atof(a[2]),atof(a[3]),atof(a[4]) * (M_PI / 180.0));
S = BRepPrimAPI_MakeTorus(Draw::Atof(a[2]),Draw::Atof(a[3]),Draw::Atof(a[4]) * (M_PI / 180.0));
else
S = BRepPrimAPI_MakeTorus(P->Pln().Position().Ax2(),atof(a[3]),atof(a[4]));
S = BRepPrimAPI_MakeTorus(P->Pln().Position().Ax2(),Draw::Atof(a[3]),Draw::Atof(a[4]));
}
else if (n == 6) {
if (P.IsNull())
S = BRepPrimAPI_MakeTorus(atof(a[2]),atof(a[3]),
atof(a[4]) * (M_PI / 180.0),atof(a[5]) * (M_PI / 180.0));
S = BRepPrimAPI_MakeTorus(Draw::Atof(a[2]),Draw::Atof(a[3]),
Draw::Atof(a[4]) * (M_PI / 180.0),Draw::Atof(a[5]) * (M_PI / 180.0));
else
S = BRepPrimAPI_MakeTorus(P->Pln().Position().Ax2(),
atof(a[3]),atof(a[4]),atof(a[5]) * (M_PI / 180.0));
Draw::Atof(a[3]),Draw::Atof(a[4]),Draw::Atof(a[5]) * (M_PI / 180.0));
}
else if (n == 7) {
if (P.IsNull())
S = BRepPrimAPI_MakeTorus(atof(a[2]),atof(a[3]),
atof(a[4]) * (M_PI / 180.0),atof(a[5]) * (M_PI / 180.0),atof(a[6]) * (M_PI / 180.0));
S = BRepPrimAPI_MakeTorus(Draw::Atof(a[2]),Draw::Atof(a[3]),
Draw::Atof(a[4]) * (M_PI / 180.0),Draw::Atof(a[5]) * (M_PI / 180.0),Draw::Atof(a[6]) * (M_PI / 180.0));
else
S = BRepPrimAPI_MakeTorus(P->Pln().Position().Ax2(),atof(a[3]),
atof(a[4]),atof(a[5]) * (M_PI / 180.0),atof(a[6]) * (M_PI / 180.0));
S = BRepPrimAPI_MakeTorus(P->Pln().Position().Ax2(),Draw::Atof(a[3]),
Draw::Atof(a[4]),Draw::Atof(a[5]) * (M_PI / 180.0),Draw::Atof(a[6]) * (M_PI / 180.0));
}
else if (n == 8) {
S = BRepPrimAPI_MakeTorus(P->Pln().Position().Ax2(),atof(a[3]),atof(a[4]),
atof(a[5]) * (M_PI / 180.0),atof(a[6]) * (M_PI / 180.0),atof(a[7]) * (M_PI / 180.0));
S = BRepPrimAPI_MakeTorus(P->Pln().Position().Ax2(),Draw::Atof(a[3]),Draw::Atof(a[4]),
Draw::Atof(a[5]) * (M_PI / 180.0),Draw::Atof(a[6]) * (M_PI / 180.0),Draw::Atof(a[7]) * (M_PI / 180.0));
}
else
return 1;

View File

@ -39,7 +39,7 @@ static Standard_Integer prj(Draw_Interpretor& di, Standard_Integer n, const char
if (n < 7) return 1;
TopoDS_Shape InpLine = DBRep::Get(a[2]);
TopoDS_Shape InpShape = DBRep::Get(a[3]);
Standard_Real DX=atof(a[4]),DY=atof(a[5]),DZ=atof(a[6]);
Standard_Real DX=Draw::Atof(a[4]),DY=Draw::Atof(a[5]),DZ=Draw::Atof(a[6]);
gp_Dir TD(DX,DY,DZ);
BRepProj_Projection Prj(InpLine,InpShape,TD);
Standard_Integer i = 1;
@ -48,7 +48,7 @@ static Standard_Integer prj(Draw_Interpretor& di, Standard_Integer n, const char
if (Prj.IsDone()) {
while (Prj.More()) {
sprintf(newname,"%s_%d",a[1],i);
Sprintf(newname,"%s_%d",a[1],i);
DBRep::Set(temp,Prj.Current());
//cout<<newname<<" ";
di<<newname<<" ";
@ -68,7 +68,7 @@ static Standard_Integer cprj(Draw_Interpretor& di, Standard_Integer n, const cha
if (n < 7) return 1;
TopoDS_Shape InpLine = DBRep::Get(a[2]);
TopoDS_Shape InpShape = DBRep::Get(a[3]);
Standard_Real PX=atof(a[4]),PY=atof(a[5]),PZ=atof(a[6]);
Standard_Real PX=Draw::Atof(a[4]),PY=Draw::Atof(a[5]),PZ=Draw::Atof(a[6]);
gp_Pnt P(PX,PY,PZ);
BRepProj_Projection Prj(InpLine,InpShape,P);
Standard_Integer i = 1;
@ -76,7 +76,7 @@ static Standard_Integer cprj(Draw_Interpretor& di, Standard_Integer n, const cha
if (Prj.IsDone()) {
while (Prj.More()) {
sprintf(newname,"%s_%d",a[1],i);
Sprintf(newname,"%s_%d",a[1],i);
DBRep::Set(temp,Prj.Current());
//cout<<newname<<" ";
di<<newname<<" ";

View File

@ -110,9 +110,9 @@ static Standard_Integer mkface(Draw_Interpretor& , Standard_Integer n, const cha
}
else {
if (mkface)
res = BRepBuilderAPI_MakeFace(S,atof(a[3]),atof(a[4]),atof(a[5]),atof(a[6]),Precision::Confusion());
res = BRepBuilderAPI_MakeFace(S,Draw::Atof(a[3]),Draw::Atof(a[4]),Draw::Atof(a[5]),Draw::Atof(a[6]),Precision::Confusion());
else
res = BRepBuilderAPI_MakeShell(S,atof(a[3]),atof(a[4]),atof(a[5]),atof(a[6]),
res = BRepBuilderAPI_MakeShell(S,Draw::Atof(a[3]),Draw::Atof(a[4]),Draw::Atof(a[5]),Draw::Atof(a[6]),
Segment);
}
@ -246,7 +246,7 @@ static Standard_Integer pcurve(Draw_Interpretor& , Standard_Integer n, const cha
col = DBRep_ColorOrientation(ex.Current().Orientation());
DrawTrSurf_CurveColor(col);
sprintf(name,"%s_%d",a[1],i);
Sprintf(name,"%s_%d",a[1],i);
DrawTrSurf::Set(name,new Geom2d_TrimmedCurve(c,f,l));
}
DrawTrSurf_CurveColor(savecol);
@ -309,9 +309,9 @@ static Standard_Integer sewing (Draw_Interpretor& theDi,
{
if (tolower(theArgv[i][2]) == 'i' && i+1 < theArgc)
{
if (atof (theArgv[i+1]))
if (Draw::Atof (theArgv[i+1]))
{
aMinTol = atof (theArgv[++i]);
aMinTol = Draw::Atof (theArgv[++i]);
aSetMinTol = Standard_True;
}
else
@ -322,8 +322,8 @@ static Standard_Integer sewing (Draw_Interpretor& theDi,
}
if (tolower(theArgv[i][2]) == 'a' && i+1 < theArgc)
{
if (atof (theArgv[i+1]))
aMaxTol = atof (theArgv[++i]);
if (Draw::Atof (theArgv[i+1]))
aMaxTol = Draw::Atof (theArgv[++i]);
else
{
theDi << "Error! max tolerance can't possess the null value" << "\n";
@ -351,8 +351,8 @@ static Standard_Integer sewing (Draw_Interpretor& theDi,
}
else
{
if (atof (theArgv[i]))
aTol = atof (theArgv[i]);
if (Draw::Atof (theArgv[i]))
aTol = Draw::Atof (theArgv[i]);
}
}
}
@ -430,7 +430,7 @@ static Standard_Integer continuity (Draw_Interpretor& ,
Standard_Integer i=1;
if (sh.IsNull()) {
if (n < 3) return (1);
Standard_Real tol = atof(a[1]);
Standard_Real tol = Draw::Atof(a[1]);
aFind.Init(tol, Standard_False);
i = 2;
}
@ -478,7 +478,7 @@ static Standard_Integer encoderegularity (Draw_Interpretor& ,
if (n==2)
BRepLib::EncodeRegularity(sh);
else {
Standard_Real Tol = atof(a[2]);
Standard_Real Tol = Draw::Atof(a[2]);
Tol *= M_PI/180.;
BRepLib::EncodeRegularity(sh, Tol);
}

View File

@ -76,7 +76,7 @@ static Standard_Integer prism(Draw_Interpretor& , Standard_Integer n, const char
TopoDS_Shape base = DBRep::Get(a[2]);
if (base.IsNull()) return 1;
gp_Vec V(atof(a[3]),atof(a[4]),atof(a[5]));
gp_Vec V(Draw::Atof(a[3]),Draw::Atof(a[4]),Draw::Atof(a[5]));
Standard_Boolean copy = Standard_False;
Standard_Boolean inf = Standard_False;
@ -113,11 +113,11 @@ static Standard_Integer revol(Draw_Interpretor& ,
TopoDS_Shape base = DBRep::Get(a[2]);
if (base.IsNull()) return 1;
gp_Pnt P(atof(a[3]),atof(a[4]),atof(a[5]));
gp_Dir D(atof(a[6]),atof(a[7]),atof(a[8]));
gp_Pnt P(Draw::Atof(a[3]),Draw::Atof(a[4]),Draw::Atof(a[5]));
gp_Dir D(Draw::Atof(a[6]),Draw::Atof(a[7]),Draw::Atof(a[8]));
gp_Ax1 A(P,D);
Standard_Real angle = atof(a[9]) * (M_PI / 180.0);
Standard_Real angle = Draw::Atof(a[9]) * (M_PI / 180.0);
Standard_Boolean copy = n > 10;
@ -166,7 +166,7 @@ static Standard_Integer geompipe(Draw_Interpretor& ,
Handle(GeomAdaptor_HCurve) aAdaptCurve = new GeomAdaptor_HCurve(SpineCurve,aSpFirst,aSpLast);
Standard_Boolean ByACR = Standard_False;
Standard_Boolean rotate = Standard_False;
Standard_Real Radius = atof(a[4]);
Standard_Real Radius = Draw::Atof(a[4]);
gp_Pnt ctr;
gp_Vec norm;
ProfileCurve->D1(aSpFirst,ctr,norm);
@ -175,9 +175,9 @@ static Standard_Integer geompipe(Draw_Interpretor& ,
Handle(Geom_Circle) cStart=new Geom_Circle(aAx2Start,Radius);
Standard_Integer k =5;
if(n > k)
ByACR = (atoi(a[k++]) ==1);
ByACR = (Draw::Atoi(a[k++]) ==1);
if(n > k)
rotate = (atoi(a[k++])==1);
rotate = (Draw::Atoi(a[k++])==1);
GeomFill_Pipe aPipe(ProfileCurve,aAdaptCurve,cStart,ByACR,rotate);
aPipe.Perform(Standard_True);
Handle(Geom_Surface) Sur=aPipe.Surface();
@ -340,8 +340,8 @@ Standard_Integer thrusections(Draw_Interpretor&, Standard_Integer n, const char*
TopoDS_Shape Shape;
Standard_Boolean issolid = ( atoi(a[index]) == 1 );
Standard_Boolean isruled = ( atoi(a[index+1]) == 1 );
Standard_Boolean issolid = ( Draw::Atoi(a[index]) == 1 );
Standard_Boolean isruled = ( Draw::Atoi(a[index+1]) == 1 );
BRepOffsetAPI_ThruSections Generator(issolid,isruled);
@ -471,7 +471,7 @@ static Standard_Integer setsweep(Draw_Interpretor& di,
di << "bad arguments !" << "\n";
return 1;
}
gp_Dir D(atof(a[2]), atof(a[3]), atof(a[4]));
gp_Dir D(Draw::Atof(a[2]), Draw::Atof(a[3]), Draw::Atof(a[4]));
Sweep->SetMode(D);;
}
else if (!strcmp(a[1],"-FX")) {
@ -480,9 +480,9 @@ static Standard_Integer setsweep(Draw_Interpretor& di,
di << "bad arguments !" << "\n";
return 1;
}
gp_Dir D(atof(a[2]), atof(a[3]), atof(a[4]));
gp_Dir D(Draw::Atof(a[2]), Draw::Atof(a[3]), Draw::Atof(a[4]));
if (n==8) {
gp_Dir DN(atof(a[5]), atof(a[6]), atof(a[7]));
gp_Dir DN(Draw::Atof(a[5]), Draw::Atof(a[6]), Draw::Atof(a[7]));
gp_Ax2 Axe(gp_Pnt(0., 0., 0.), D, DN);
Sweep->SetMode(Axe);
}
@ -502,7 +502,7 @@ static Standard_Integer setsweep(Draw_Interpretor& di,
else
{
TopoDS_Shape Guide = DBRep::Get(a[2],TopAbs_WIRE);
Sweep->SetMode(TopoDS::Wire(Guide), atoi(a[3]), atoi(a[4]));
Sweep->SetMode(TopoDS::Wire(Guide), Draw::Atoi(a[3]), Draw::Atoi(a[4]));
}
}
@ -591,8 +591,8 @@ static Standard_Integer addsweep(Draw_Interpretor& di,
Standard_Integer ii, L= nbreal/2;
TColgp_Array1OfPnt2d ParAndRad(1, L);
for (ii=1; ii<=L; ii++, cur+=2) {
ParAndRad(ii).SetX(atof(a[cur]));
ParAndRad(ii).SetY(atof(a[cur+1]));
ParAndRad(ii).SetX(Draw::Atof(a[cur]));
ParAndRad(ii).SetY(Draw::Atof(a[cur+1]));
}
thelaw = new (Law_Interpol) ();
thelaw->Set(ParAndRad,
@ -749,7 +749,7 @@ static Standard_Integer simulsweep(Draw_Interpretor& di,
TopTools_ListOfShape List;
TopTools_ListIteratorOfListOfShape it;
Standard_Integer N, ii;
N = atoi(a[2]);
N = Draw::Atoi(a[2]);
if (n>3) {
BRepBuilderAPI_TransitionMode Transition = BRepBuilderAPI_Transformed;
@ -766,7 +766,7 @@ static Standard_Integer simulsweep(Draw_Interpretor& di,
// Calculate the result
Sweep->Simulate(N, List);
for (ii=1, it.Initialize(List); it.More(); it.Next(), ii++) {
sprintf(name,"%s_%d",a[1],ii);
Sprintf(name,"%s_%d",a[1],ii);
DBRep::Set(name, it.Value());
}

View File

@ -196,7 +196,7 @@ static Standard_Integer halfspace(Draw_Interpretor& di,
if (n < 6) return 1;
// Le point indiquant le cote "matiere".
gp_Pnt RefPnt = gp_Pnt(atof(a[3]),atof(a[4]),atof(a[5]));
gp_Pnt RefPnt = gp_Pnt(Draw::Atof(a[3]),Draw::Atof(a[4]),Draw::Atof(a[5]));
TopoDS_Shape Face = DBRep::Get(a[2],TopAbs_FACE);
if ( Face.IsNull()) {

View File

@ -139,7 +139,7 @@ static Standard_Integer isos (Draw_Interpretor& di,
Standard_Boolean Change = Standard_False ;
if (!Characters (NbArg) && Float (NbArg)) return 1 ;
if (!Characters (NbArg)) {
NbIsos = atoi (Arg[NbArg]) ;
NbIsos = Draw::Atoi (Arg[NbArg]) ;
NbArg-- ;
Change = Standard_True ;
}
@ -233,7 +233,7 @@ static Standard_Integer hlr (Draw_Interpretor& di,
if (n >= 3 && !strcasecmp(a[1],"ang" )) {
nFirst = 3;
if (n == 3) {
Standard_Real ang = atof(a[2]);
Standard_Real ang = Draw::Atof(a[2]);
anglHLR = ang * M_PI / 180;
if (anglHLR < HAngMin) anglHLR = HAngMin;
if (anglHLR > HAngMax) anglHLR = HAngMax;
@ -279,7 +279,7 @@ static Standard_Integer hlr (Draw_Interpretor& di,
localRgN = Standard_True;
}
else if (!strcasecmp(a[1],"ang" )) {
Standard_Real ang = atof(a[2]);
Standard_Real ang = Draw::Atof(a[2]);
localAng = ang * M_PI / 180;
}
else return 1;
@ -332,7 +332,7 @@ static Standard_Integer discretisation(Draw_Interpretor& di,
if (n <= 1)
di << "Current number of points : "<<discret<<"\n";
else {
discret = atoi(a[1]);
discret = Draw::Atoi(a[1]);
}
return 0;
}
@ -496,7 +496,7 @@ static Standard_Integer explode(Draw_Interpretor& di,
TopoDS_Iterator itr(S);
while (itr.More()) {
i++;
sprintf(p,"%d",i);
Sprintf(p,"%d",i);
DBRep::Set(newname,itr.Value());
di.AppendElement(newname);
itr.Next();
@ -557,7 +557,7 @@ static Standard_Integer explode(Draw_Interpretor& di,
Standard_Boolean added = M.Add(Sx);
if (added) {
i++;
sprintf(p,"%d",i);
Sprintf(p,"%d",i);
DBRep::Set(newname,Sx);
di.AppendElement(newname);
}
@ -651,7 +651,7 @@ static Standard_Integer nexplode(Draw_Interpretor& di,
}
for (Index=1 ;Index <= MaxShapes; Index++) {
sprintf(p,"%d",Index);
Sprintf(p,"%d",Index);
DBRep::Set(newname,aShapes(OrderInd(Index)));
di.AppendElement(newname);
}
@ -680,7 +680,7 @@ static Standard_Integer exwire(Draw_Interpretor& ,
BRepTools_WireExplorer ex(TopoDS::Wire(S));
while (ex.More()) {
i++;
sprintf(p,"%d",i);
Sprintf(p,"%d",i);
DBRep::Set(newname,ex.Current());
ex.Next();
}
@ -1021,7 +1021,7 @@ static Standard_Integer normals(Draw_Interpretor& di,
if (n <= 1) return 1;
Standard_Real l = 1.;
if (n > 2)
l = atof(a[2]);
l = Draw::Atof(a[2]);
TopoDS_Shape S = DBRep::Get(a[1]);
if (S.IsNull()) return 1;

View File

@ -164,7 +164,7 @@ static Standard_Integer DFOpenAttribute (Draw_Interpretor& di,
Handle(DDF_Browser) browser =
Handle(DDF_Browser)::DownCast (Draw::Get(a[1], Standard_True));
const Standard_Integer index = atoi(a[2]);
const Standard_Integer index = Draw::Atoi(a[2]);
TCollection_AsciiString list = browser->OpenAttribute(index);
di<<list.ToCString();
return 0;

View File

@ -80,6 +80,7 @@ Storage_Error DDF_IOStream::Open(const TCollection_AsciiString& aName,const Stor
}
else {
myIStream->precision(17);
myIStream->imbue (std::locale::classic()); // always use C locale
SetOpenMode(aMode);
}
}
@ -91,6 +92,7 @@ Storage_Error DDF_IOStream::Open(const TCollection_AsciiString& aName,const Stor
}
else {
myOStream->precision(17);
myOStream->imbue (std::locale::classic()); // make sure to always use C locale
SetOpenMode(aMode);
}
}
@ -113,6 +115,7 @@ Storage_Error DDF_IOStream::Open(istream* anIStream)
SetOpenMode(Storage_VSRead);
myIStream = anIStream;
myIStream->precision(17);
myIStream->imbue (std::locale::classic()); // use always C locale
SetName("DDF_IOStream");
return Storage_VSOk; // ou Storage_VSAlreadyOpen ?
}
@ -128,6 +131,7 @@ Storage_Error DDF_IOStream::Open(ostream* anOStream)
SetOpenMode(Storage_VSWrite);
myOStream = anOStream;
myOStream->precision(17);
myOStream->imbue (std::locale::classic()); // use always C locale
SetName("DDF_IOStream");
return Storage_VSOk; // ou Storage_VSAlreadyOpen ?
}

View File

@ -112,7 +112,7 @@ static Standard_Integer CommitTran (Draw_Interpretor& di,
Handle(DDF_Transaction) tr = DDF_TStack.Top();
di<<"Commit transaction # "<<tr->Transaction()<<" # "<<DF->Transaction()<<"\n";
Standard_Boolean withDelta = Standard_False;
if (n > 2) withDelta = (atoi(a[2]) != 0);
if (n > 2) withDelta = (Draw::Atoi(a[2]) != 0);
DDF_LastDelta = tr->Commit(withDelta);
DDF_TStack.Pop();
}
@ -169,7 +169,7 @@ static Standard_Integer Undo (Draw_Interpretor& di,
Handle(TDF_Data) DF;
if (DDF::GetDF (a[1], DF)) {
Standard_Boolean withDelta = Standard_False;
if (n > 2) withDelta = (atoi(a[2]) != 0);
if (n > 2) withDelta = (Draw::Atoi(a[2]) != 0);
if (!DDF_LastDelta.IsNull()) {
if (DF->IsApplicable(DDF_LastDelta)) {
Handle(TDF_Delta) tmp = DF->Undo(DDF_LastDelta,withDelta);

View File

@ -113,7 +113,7 @@ static Standard_Integer DDataStd_SetInteger (Draw_Interpretor& di,
if (!DDF::GetDF(arg[1],DF)) return 1;
TDF_Label L;
DDF::AddLabel(DF, arg[2], L);
TDataStd_Integer::Set(L,atoi(arg[3]));
TDataStd_Integer::Set(L,Draw::Atoi(arg[3]));
return 0;
}
di << "DDataStd_SetInteger : Error" << "\n";
@ -134,7 +134,7 @@ static Standard_Integer DDataStd_SetReal (Draw_Interpretor& di,
if (!DDF::GetDF(arg[1],DF)) return 1;
TDF_Label L;
DDF::AddLabel(DF, arg[2], L);
TDataStd_Real::Set(L,atof(arg[3]));
TDataStd_Real::Set(L,Draw::Atof(arg[3]));
return 0;
}
di << "DDataStd_SetReal : Error" << "\n";
@ -441,14 +441,14 @@ static Standard_Integer DDataStd_SetIntArray (Draw_Interpretor& di,
if (!DDF::GetDF(arg[1],DF)) return 1;
TDF_Label label;
DDF::AddLabel(DF, arg[2], label);
Standard_Integer isDelta = atoi(arg[3]);
Standard_Integer From = atoi(arg[4]), To = atoi( arg[5] ), j;
Standard_Integer isDelta = Draw::Atoi(arg[3]);
Standard_Integer From = Draw::Atoi(arg[4]), To = Draw::Atoi( arg[5] ), j;
di << "Array of Standard_Integer with bounds from = " << From << " to = " << To << "\n";
Handle(TDataStd_IntegerArray) A = TDataStd_IntegerArray::Set(label, From, To, isDelta);
j = 6;
for(Standard_Integer i = From; i<=To; i++) {
A->SetValue(i, atoi(arg[j]) );
A->SetValue(i, Draw::Atoi(arg[j]) );
j++;
}
@ -510,8 +510,8 @@ static Standard_Integer DDataStd_ChangeIntArray (Draw_Interpretor& di,
di << "There is no TDataStd_IntegerArray at label" << "\n";
return 1;
}
Standard_Integer indx = atoi(arg[3]);
Standard_Integer val = atoi(arg[4]);
Standard_Integer indx = Draw::Atoi(arg[3]);
Standard_Integer val = Draw::Atoi(arg[4]);
Standard_Integer low = A->Lower(), up = A->Upper();
if(low <= indx && indx <= up)
A->SetValue(indx, val);
@ -559,8 +559,8 @@ static Standard_Integer DDataStd_SetIntArrayTest (Draw_Interpretor& di,
if (!DDF::GetDF(arg[1],DF)) return 1;
TDF_Label label;
DDF::AddLabel(DF, arg[2], label);
Standard_Integer isDelta = atoi(arg[3]);
Standard_Integer From = atoi(arg[4]), To = atoi( arg[5] ), j;
Standard_Integer isDelta = Draw::Atoi(arg[3]);
Standard_Integer From = Draw::Atoi(arg[4]), To = Draw::Atoi( arg[5] ), j;
di << "Array of Standard_Integer with bounds from = " << From << " to = " << To << "\n";
Handle(TDataStd_IntegerArray) A = TDataStd_IntegerArray::Set(label, From, To, isDelta);
@ -587,15 +587,15 @@ static Standard_Integer DDataStd_SetRealArray (Draw_Interpretor& di,
if (!DDF::GetDF(arg[1],DF)) return 1;
TDF_Label label;
DDF::AddLabel(DF, arg[2], label);
Standard_Integer isDelta = atoi(arg[3]);
Standard_Integer isDelta = Draw::Atoi(arg[3]);
Standard_Integer From = atoi(arg[4]), To = atoi( arg[5] ), j;
Standard_Integer From = Draw::Atoi(arg[4]), To = Draw::Atoi( arg[5] ), j;
di << " Array of Standard_Real with bounds from = " << From << " to = " << To << "\n";
Handle(TDataStd_RealArray) A = TDataStd_RealArray::Set(label, From, To, isDelta);
j = 6;
for(Standard_Integer i = From; i<=To; i++) {
A->SetValue(i, atof(arg[j]) );
A->SetValue(i, Draw::Atof(arg[j]) );
j++;
}
@ -658,8 +658,8 @@ static Standard_Integer DDataStd_ChangeRealArray (Draw_Interpretor& di,
di << "There is no TDataStd_RealArray at label" << "\n";
return 1;
}
Standard_Integer indx = atoi(arg[3]);
Standard_Real val = atof(arg[4]);
Standard_Integer indx = Draw::Atoi(arg[3]);
Standard_Real val = Draw::Atof(arg[4]);
Standard_Integer low = A->Lower(), up = A->Upper();
if(low <= indx && indx <= up)
A->SetValue(indx, val);
@ -712,7 +712,7 @@ static Standard_Integer DDataStd_SetVariable (Draw_Interpretor& di,
const char* aUnits = arg[4];
aV->Unit(Standard_CString(aUnits));
aV->Constant(Standard_Boolean(atoi(arg[3])));
aV->Constant(Standard_Boolean(Draw::Atoi(arg[3])));
return 0;
}
@ -854,7 +854,7 @@ static Standard_Integer DDataStd_SetFunction (Draw_Interpretor& di,
Standard_GUID guid (arg[3]);
Handle(TFunction_Function) aF = TFunction_Function::Set(label, guid);
int fail = atoi(arg[4]);
int fail = Draw::Atoi(arg[4]);
aF->SetFailure(fail);
return 0;
@ -914,9 +914,9 @@ static Standard_Integer DDataStd_SetExtStringArray (Draw_Interpretor& di,
if (!DDF::GetDF(arg[1],DF)) return 1;
TDF_Label label;
DDF::AddLabel(DF, arg[2], label);
Standard_Integer isDelta = atoi(arg[3]);
Standard_Integer isDelta = Draw::Atoi(arg[3]);
Standard_Integer From = atoi(arg[4]), To = atoi( arg[5] ), j;
Standard_Integer From = Draw::Atoi(arg[4]), To = Draw::Atoi( arg[5] ), j;
di << "Array of ExtString with bounds from = " << From << " to = " << To << "\n";
Handle(TDataStd_ExtStringArray) A = TDataStd_ExtStringArray::Set(label, From, To, isDelta);
@ -988,7 +988,7 @@ static Standard_Integer DDataStd_ChangeExtStrArray (Draw_Interpretor& di,
di << "There is no TDataStd_ExtStringArray at label" << "\n";
return 1;
}
Standard_Integer indx = atoi(arg[3]);
Standard_Integer indx = Draw::Atoi(arg[3]);
TCollection_ExtendedString val(arg[4]);
Standard_Integer low = A->Lower(), up = A->Upper();
if(low <= indx && indx <= up)
@ -1122,7 +1122,7 @@ static Standard_Integer DDataStd_GetUTFtoFile (Draw_Interpretor& di,
cout << "Error: problem with the file stream, rdstate = " <<anOS.rdstate() <<endl;
#endif
}
char prefix[4] = {0xEF,0xBB,0xBF, 0x00};
unsigned char prefix[4] = {0xEF,0xBB,0xBF, 0x00};
anOS.write( (char*)&prefix[0], 3);
Standard_Integer n = aES.LengthOfCString();
Standard_PCharacter aCstr = (Standard_PCharacter) Standard::Allocate(ROUNDMEM(n+1));
@ -1148,14 +1148,14 @@ static Standard_Integer DDataStd_SetByteArray (Draw_Interpretor& di,
if (!DDF::GetDF(arg[1],DF)) return 1;
TDF_Label label;
DDF::AddLabel(DF, arg[2], label);
Standard_Integer isDelta = atoi(arg[3]);
Standard_Integer From = atoi(arg[4]), To = atoi( arg[5] ), j;
Standard_Integer isDelta = Draw::Atoi(arg[3]);
Standard_Integer From = Draw::Atoi(arg[4]), To = Draw::Atoi( arg[5] ), j;
di << "Array of Standard_Integer with bounds from = " << From << " to = " << To << "\n";
Handle(TDataStd_ByteArray) A = TDataStd_ByteArray::Set(label, From, To, isDelta);
j = 6;
for(Standard_Integer i = From; i<=To; i++) {
Standard_Integer ival = atoi(arg[j]);
Standard_Integer ival = Draw::Atoi(arg[j]);
if(ival > 255) {
cout << "Bad value = " << ival<< endl;
return 1;
@ -1224,8 +1224,8 @@ static Standard_Integer DDataStd_ChangeByteArray (Draw_Interpretor& di,
di << "There is no TDataStd_ByteArray at label" << "\n";
return 1;
}
Standard_Integer indx = atoi(arg[3]);
Standard_Integer ival = atoi(arg[4]);
Standard_Integer indx = Draw::Atoi(arg[3]);
Standard_Integer ival = Draw::Atoi(arg[4]);
if (ival > 255 || ival < 0) {
di << "DDataStd_ChangeByteArray: Bad value = " <<ival << "\n";
return 1;
@ -1276,7 +1276,7 @@ static Standard_Integer DDataStd_SetIntPackedMap (Draw_Interpretor& di,
if (!DDF::GetDF(arg[1],DF)) return 1;
TDF_Label aLabel;
DDF::AddLabel(DF, arg[2], aLabel);
Standard_Integer isDelta = atoi(arg[3]);
Standard_Integer isDelta = Draw::Atoi(arg[3]);
Standard_Integer aNum = nb - 4;
Handle(TDataStd_IntPackedMap) anAtt;
if(!aLabel.FindAttribute(TDataStd_IntPackedMap::GetID(), anAtt))
@ -1288,7 +1288,7 @@ static Standard_Integer DDataStd_SetIntPackedMap (Draw_Interpretor& di,
Standard_Integer j = 4;
TColStd_PackedMapOfInteger aMap;
for(Standard_Integer i = 1; i<=aNum; i++) {
aMap.Add (atoi(arg[j]));
aMap.Add (Draw::Atoi(arg[j]));
j++;
}
const Handle(TColStd_HPackedMapOfInteger)& aHMap = new TColStd_HPackedMapOfInteger(aMap);
@ -1361,7 +1361,7 @@ static Standard_Integer DDataStd_ChangeIntPackedMap_Add (Draw_Interpretor& di,
if(!aHMap.IsNull()) {
ahMap->ChangeMap().Assign(aHMap->Map());
for(i=1; i<=aNum;i++) {
Standard_Integer val = atoi(arg[i+2]);
Standard_Integer val = Draw::Atoi(arg[i+2]);
if(!ahMap->Map().Contains(val))
ahMap->ChangeMap().Add(val);
}
@ -1404,7 +1404,7 @@ static Standard_Integer DDataStd_ChangeIntPackedMap_Rem (Draw_Interpretor& di,
if(!aHMap.IsNull()) {
ahMap->ChangeMap().Assign(aHMap->Map());
for(i=1; i<=aNum;i++) {
Standard_Integer val = atoi(arg[i+2]);
Standard_Integer val = Draw::Atoi(arg[i+2]);
if(ahMap->Map().Contains(val))
ahMap->ChangeMap().Remove(val);
}
@ -1447,7 +1447,7 @@ static Standard_Integer DDataStd_ChangeIntPackedMap_AddRem (Draw_Interpretor& di
if(!aHMap.IsNull()) {
ahMap->ChangeMap().Assign(aHMap->Map());
for(i=1; i<=aNum;i++) {
Standard_Integer val = atoi(arg[i+2]);
Standard_Integer val = Draw::Atoi(arg[i+2]);
if(!ahMap->Map().Contains(val))
ahMap->ChangeMap().Add(val);
else
@ -1476,8 +1476,8 @@ static Standard_Integer DDataStd_SetIntPHugeMap (Draw_Interpretor& di,
if (!DDF::GetDF(arg[1],DF)) return 1;
TDF_Label aLabel;
DDF::AddLabel(DF, arg[2], aLabel);
Standard_Integer isDelta = atoi(arg[3]);
Standard_Integer aNum = atoi(arg[4]);
Standard_Integer isDelta = Draw::Atoi(arg[3]);
Standard_Integer aNum = Draw::Atoi(arg[4]);
Handle(TDataStd_IntPackedMap) anAtt;
if(!aLabel.FindAttribute(TDataStd_IntPackedMap::GetID(), anAtt))
anAtt = TDataStd_IntPackedMap::Set(aLabel, isDelta);
@ -1512,7 +1512,7 @@ static Standard_Integer DDataStd_SetNDataIntegers2 (Draw_Interpretor& di,
if (!DDF::GetDF(arg[1],DF)) return 1;
TDF_Label aLabel;
DDF::AddLabel(DF, arg[2], aLabel);
Standard_Integer aNumP = atoi(arg[3]), j;
Standard_Integer aNumP = Draw::Atoi(arg[3]), j;
Handle(TDataStd_NamedData) anAtt;
if(!aLabel.FindAttribute(TDataStd_NamedData::GetID(), anAtt))
anAtt = TDataStd_NamedData::Set(aLabel);
@ -1551,7 +1551,7 @@ static Standard_Integer DDataStd_SetNDataIntAr2 (Draw_Interpretor& di,
Standard_Integer j;
TCollection_ExtendedString aKey(arg[3]);
Standard_Integer aNum = atoi(arg[4]);
Standard_Integer aNum = Draw::Atoi(arg[4]);
if (aNum <= 0) return 1;
Handle(TDataStd_NamedData) anAtt;
if(!aLabel.FindAttribute(TDataStd_NamedData::GetID(), anAtt))
@ -1655,7 +1655,7 @@ static Standard_Integer DDataStd_SetNDataIntegers (Draw_Interpretor& di,
// cout << "Value = |"<<aValue<<endl;
// cout << "aKey = " << aString << "|"<<endl;
//
Standard_Integer aNumP = atoi(arg[3]), j;
Standard_Integer aNumP = Draw::Atoi(arg[3]), j;
Handle(TDataStd_NamedData) anAtt;
if(!aLabel.FindAttribute(TDataStd_NamedData::GetID(), anAtt))
anAtt = TDataStd_NamedData::Set(aLabel);
@ -1666,7 +1666,7 @@ static Standard_Integer DDataStd_SetNDataIntegers (Draw_Interpretor& di,
j = 4;
for(Standard_Integer i = 1; i<=aNumP; i++) {
TCollection_ExtendedString aKey(arg[j]);
Standard_Integer aVal = atoi(arg[j+1]);
Standard_Integer aVal = Draw::Atoi(arg[j+1]);
anAtt->SetInteger(aKey, aVal);
j +=2;
}
@ -1765,7 +1765,7 @@ static Standard_Integer DDataStd_SetNDataReals (Draw_Interpretor& di,
TDF_Label aLabel;
DDF::AddLabel(DF, arg[2], aLabel);
Standard_Integer aNumP = atoi(arg[3]), j;
Standard_Integer aNumP = Draw::Atoi(arg[3]), j;
Handle(TDataStd_NamedData) anAtt;
if(!aLabel.FindAttribute(TDataStd_NamedData::GetID(), anAtt))
anAtt = TDataStd_NamedData::Set(aLabel);
@ -1776,7 +1776,7 @@ static Standard_Integer DDataStd_SetNDataReals (Draw_Interpretor& di,
j = 4;
for(Standard_Integer i = 1; i<=aNumP; i++) {
TCollection_ExtendedString aKey(arg[j]);
Standard_Real aVal = atof(arg[j+1]);
Standard_Real aVal = Draw::Atof(arg[j+1]);
anAtt->SetReal(aKey, aVal);
j +=2;
}
@ -1873,7 +1873,7 @@ static Standard_Integer DDataStd_SetNDataStrings (Draw_Interpretor& di,
TDF_Label aLabel;
DDF::AddLabel(DF, arg[2], aLabel);
Standard_Integer aNumP = atoi(arg[3]), j;
Standard_Integer aNumP = Draw::Atoi(arg[3]), j;
Handle(TDataStd_NamedData) anAtt;
if(!aLabel.FindAttribute(TDataStd_NamedData::GetID(), anAtt))
anAtt = TDataStd_NamedData::Set(aLabel);
@ -1983,7 +1983,7 @@ static Standard_Integer DDataStd_SetNDataBytes (Draw_Interpretor& di,
TDF_Label aLabel;
DDF::AddLabel(DF, arg[2], aLabel);
Standard_Integer aNumP = atoi(arg[3]), j;
Standard_Integer aNumP = Draw::Atoi(arg[3]), j;
Handle(TDataStd_NamedData) anAtt;
if(!aLabel.FindAttribute(TDataStd_NamedData::GetID(), anAtt))
anAtt = TDataStd_NamedData::Set(aLabel);
@ -1994,7 +1994,7 @@ static Standard_Integer DDataStd_SetNDataBytes (Draw_Interpretor& di,
j = 4;
for(Standard_Integer i = 1; i<=aNumP; i++) {
TCollection_ExtendedString aKey(arg[j]);
Standard_Byte aVal = (Standard_Byte)atoi(arg[j+1]);
Standard_Byte aVal = (Standard_Byte)Draw::Atoi(arg[j+1]);
anAtt->SetByte(aKey, aVal);
j +=2;
}
@ -2092,7 +2092,7 @@ static Standard_Integer DDataStd_SetNDataIntAr (Draw_Interpretor& di,
Standard_Integer j;
TCollection_ExtendedString aKey(arg[3]);
Standard_Integer aNum = atoi(arg[4]);
Standard_Integer aNum = Draw::Atoi(arg[4]);
if (aNum <= 0) return 1;
Handle(TDataStd_NamedData) anAtt;
if(!aLabel.FindAttribute(TDataStd_NamedData::GetID(), anAtt))
@ -2104,7 +2104,7 @@ static Standard_Integer DDataStd_SetNDataIntAr (Draw_Interpretor& di,
j = 5;
Handle(TColStd_HArray1OfInteger) anArr = new TColStd_HArray1OfInteger(1, aNum);
for(Standard_Integer i = 1; i<=aNum; i++) {
Standard_Integer aVal = atoi(arg[j]);
Standard_Integer aVal = Draw::Atoi(arg[j]);
anArr->SetValue(i, aVal);
j++;
}
@ -2222,7 +2222,7 @@ static Standard_Integer DDataStd_SetNDataRealAr (Draw_Interpretor& di,
Standard_Integer j;
TCollection_ExtendedString aKey(arg[3]);
Standard_Integer aNum = atoi(arg[4]);
Standard_Integer aNum = Draw::Atoi(arg[4]);
if (aNum <= 0) return 1;
Handle(TDataStd_NamedData) anAtt;
if(!aLabel.FindAttribute(TDataStd_NamedData::GetID(), anAtt))
@ -2234,7 +2234,7 @@ static Standard_Integer DDataStd_SetNDataRealAr (Draw_Interpretor& di,
j = 5;
Handle(TColStd_HArray1OfReal) anArr = new TColStd_HArray1OfReal(1, aNum);
for(Standard_Integer i = 1; i<=aNum; i++) {
Standard_Real aVal = atof(arg[j]);
Standard_Real aVal = Draw::Atof(arg[j]);
anArr->SetValue(i, aVal);
j++;
}

View File

@ -218,7 +218,7 @@ static Standard_Integer DDataStd_SetPattern (Draw_Interpretor& di,
Handle(TDataXtd_PatternStd) aP = TDataXtd_PatternStd::Set(L);
// set signature
Standard_Integer signature = atoi(arg[3]);
Standard_Integer signature = Draw::Atoi(arg[3]);
aP->Signature(signature);
TDF_Label aLab;
@ -410,7 +410,7 @@ static Standard_Integer DDataStd_SetPosition (Draw_Interpretor& di,
TDF_Label L;
DDF::AddLabel(DF, arg[2], L);
Standard_Real X = atof(arg[3]), Y = atof(arg[4]), Z = atof(arg[5]);
Standard_Real X = Draw::Atof(arg[3]), Y = Draw::Atof(arg[4]), Z = Draw::Atof(arg[5]);
gp_Pnt aPos (X, Y, Z);
TDataXtd_Position::Set(L,aPos);

View File

@ -62,12 +62,12 @@
static void Location (Standard_Integer nb, const char** arg, gp_Ax2& Loc) {
if (nb == 9) {
Standard_Real X = atof(arg[3]);
Standard_Real Y = atof(arg[4]);
Standard_Real Z = atof(arg[5]);
Standard_Real DX = atof(arg[6]);
Standard_Real DY = atof(arg[7]);
Standard_Real DZ = atof(arg[8]);
Standard_Real X = Draw::Atof(arg[3]);
Standard_Real Y = Draw::Atof(arg[4]);
Standard_Real Z = Draw::Atof(arg[5]);
Standard_Real DX = Draw::Atof(arg[6]);
Standard_Real DY = Draw::Atof(arg[7]);
Standard_Real DZ = Draw::Atof(arg[8]);
Loc = gp_Ax2 (gp_Pnt(X,Y,Z), gp_Dir(DX,DY,DZ));
}
}
@ -193,9 +193,9 @@ static Standard_Integer DDataStd_SetPlane (Draw_Interpretor& di,
// if (nb < 6) return 1;
// gp_Trsf T;
// Standard_Real x = atof(arg[3]);
// Standard_Real y = atof(arg[4]);
// Standard_Real z = atof(arg[5]);
// Standard_Real x = Draw::Atof(arg[3]);
// Standard_Real y = Draw::Atof(arg[4]);
// Standard_Real z = Draw::Atof(arg[5]);
// if (nb == 6) {
// T.SetTranslation(gp_Vec(x,y,z));
@ -203,10 +203,10 @@ static Standard_Integer DDataStd_SetPlane (Draw_Interpretor& di,
// else if (nb < 10)
// return 1;
// else {
// Standard_Real dx = atof(arg[6]);
// Standard_Real dy = atof(arg[7]);
// Standard_Real dz = atof(arg[8]);
// Standard_Real ang = atof(arg[9]);
// Standard_Real dx = Draw::Atof(arg[6]);
// Standard_Real dy = Draw::Atof(arg[7]);
// Standard_Real dz = Draw::Atof(arg[8]);
// Standard_Real ang = Draw::Atof(arg[9]);
// T.SetRotation(gp_Ax1(gp_Pnt(x,y,z),
// gp_Vec(dx,dy,dz)),
// ang * (M_PI / 180.0));

View File

@ -76,9 +76,9 @@ static Standard_Integer DDataStd_PNT (Draw_Interpretor& di,
if (!DDF::GetDF (arg[1], DF)) return 1;
TDF_Label L;
DDF::AddLabel (DF, arg[2], L);
Standard_Real x = atof(arg[3]);
Standard_Real y = atof(arg[4]);
Standard_Real z = atof(arg[5]);
Standard_Real x = Draw::Atof(arg[3]);
Standard_Real y = Draw::Atof(arg[4]);
Standard_Real z = Draw::Atof(arg[5]);
TDataXtd_Point::Set (L,gp_Pnt(x,y,z));
return 0;
}

View File

@ -334,8 +334,8 @@ static Standard_Integer DDataStd_TreeBrowse (Draw_Interpretor& di,
Handle(DDataStd_TreeBrowser) NewTreeNode = new DDataStd_TreeBrowser (lab);
char *name = new char[50];
if (n == 4) sprintf(name,"treebrowser_%s",a[3]);
else sprintf(name,"treebrowser_%s",a[1]);
if (n == 4) Sprintf(name,"treebrowser_%s",a[3]);
else Sprintf(name,"treebrowser_%s",a[1]);
Draw::Set(name, NewTreeNode);
TCollection_AsciiString inst1("treebrowser ");
@ -387,7 +387,7 @@ static Standard_Integer DDataStd_ChildNodeIterate (Draw_Interpretor& di,
if (n >= 4) {
Handle(TDF_Data) DF;
if (!DDF::GetDF(a[1],DF)) return 1;
const Standard_Boolean AllLevels(atoi(a[3]));
const Standard_Boolean AllLevels(Draw::Atoi(a[3]));
Handle(TDataStd_TreeNode) TN, Value;
Standard_GUID ID;
@ -450,7 +450,7 @@ static Standard_Integer DDataStd_InitChildNodeIterator (Draw_Interpretor& di,
}
if (!DDF::Find(DF, a[2], ID, TN)) return 1;
const Standard_Boolean AllLevels(atoi(a[3]));
const Standard_Boolean AllLevels(Draw::Atoi(a[3]));
cni.Initialize(TN, AllLevels);
return 0;
}

View File

@ -193,7 +193,7 @@ static Standard_Integer DDocStd_UndoLimit (Draw_Interpretor& di,Standard_Integer
if (!DDocStd::GetDocument(a[1],D)) return 1;
if (n > 2) {
Standard_Integer lim = atoi(a[2]);
Standard_Integer lim = Draw::Atoi(a[2]);
D->SetUndoLimit(lim);
}
@ -218,7 +218,7 @@ static Standard_Integer DDocStd_Undo (Draw_Interpretor& di,Standard_Integer n, c
Standard_Integer i,step = 1;
if (n > 2) {
step = atoi(a[2]);
step = Draw::Atoi(a[2]);
}
// test if the command was undo or redo

View File

@ -56,7 +56,7 @@ static int mtmCreate (Draw_Interpretor& /*di*/, int n, const char** a)
sMultiTransactionManager = new TDocStd_MultiTransactionManager();
if(n > 1)
sMultiTransactionManager->SetUndoLimit(atoi(a[1]));
sMultiTransactionManager->SetUndoLimit(Draw::Atoi(a[1]));
return 0;
}
@ -198,7 +198,7 @@ static int mtmNestedMode (Draw_Interpretor& di, int n, const char** a)
}
Standard_Boolean aMode = Standard_False;
if(n > 1) {
aMode = atoi(a[1]) ? Standard_True : Standard_False;
aMode = Draw::Atoi(a[1]) ? Standard_True : Standard_False;
}
sMultiTransactionManager->SetNestedTransactionMode(aMode);
return 0;
@ -220,7 +220,7 @@ static Standard_Integer XAttributeValue (Draw_Interpretor& di, Standard_Integer
TDF_Tool::Label(browser->Data(),argv[2],lab);
if ( lab.IsNull() ) { di << "ERROR: label is Null: " << argv[2] << "\n"; return 0; }
Standard_Integer num = atoi ( argv[3] );
Standard_Integer num = Draw::Atoi ( argv[3] );
TDF_AttributeIterator itr(lab,Standard_False);
for (Standard_Integer i=1; itr.More() && i < num; i++) itr.Next();

View File

@ -88,7 +88,7 @@ static Standard_Integer Ascendants (Draw_Interpretor& di, Standard_Integer n, co
Standard_Integer T;
if (n > 3) T = atoi(a[3]);
if (n > 3) T = Draw::Atoi(a[3]);
else T = ND->Transaction ();
//TNaming_OldShapeIterator it (S, T, US);
@ -97,7 +97,7 @@ static Standard_Integer Ascendants (Draw_Interpretor& di, Standard_Integer n, co
TCollection_AsciiString entry;
for (;it.More (); it.Next ()) {
S = it.Shape ();
sprintf (name,"%s_%s_%d",a[2],"old", i++);
Sprintf (name,"%s_%s_%d",a[2],"old", i++);
DBRep::Set (name,it.Shape());
TDF_Label Label = it.Label ();
TDF_Tool::Entry(Label,entry);
@ -128,7 +128,7 @@ static Standard_Integer Descendants (Draw_Interpretor& di, Standard_Integer n, c
Standard_Integer T;
if (n > 3) T = atoi(a[3]);
if (n > 3) T = Draw::Atoi(a[3]);
else T = ND->Transaction ();
TNaming_NewShapeIterator it (S, T, ND->Root());
@ -136,7 +136,7 @@ static Standard_Integer Descendants (Draw_Interpretor& di, Standard_Integer n, c
TCollection_AsciiString entry;
for (;it.More (); it.Next ()) {
S = it.Shape ();
sprintf (name,"%s_%s_%d",a[2],"new", i++);
Sprintf (name,"%s_%s_%d",a[2],"new", i++);
DBRep::Set (name,it.Shape ());
TDF_Label Label = it.Label ();
TDF_Tool::Entry(Label,entry);
@ -281,7 +281,7 @@ static Standard_Integer Exploreshape (Draw_Interpretor& di, Standard_Integer n,
// ND->Root().FindAttribute(TNaming_UsedShapes::GetID(),US);
Standard_Integer Trans = ND->Transaction();
if (n == 5) { Trans = (Standard_Integer ) atof(a[4]);}
if (n == 5) { Trans = (Standard_Integer ) Draw::Atof(a[4]);}
TDF_Label Lab;
DDF::FindLabel(ND,a[2],Lab);
@ -300,11 +300,11 @@ static Standard_Integer Exploreshape (Draw_Interpretor& di, Standard_Integer n,
for (TNaming_Iterator itL(Lab,Trans) ; itL.More(); itL.Next()) {
if (!itL.OldShape().IsNull()) {
sprintf(name,"%s%s_%d","old",a[3],NbShapes);
Sprintf(name,"%s%s_%d","old",a[3],NbShapes);
DBRep::Set (name,itL.OldShape());
}
if (!itL.NewShape().IsNull()) {
sprintf(name,"%s_%d",a[3],NbShapes);
Sprintf(name,"%s_%d",a[3],NbShapes);
DBRep::Set (name,itL.NewShape());
}
NbShapes++;
@ -388,7 +388,7 @@ static Standard_Integer Collect (Draw_Interpretor& di,
if (!DDF::GetDF(arg[1],DF)) return 1;
if (!DDF::Find(DF,arg[2],TNaming_NamedShape::GetID(),A)) return 1;
if (nb >= 4) {
OnlyModif = atoi(arg[3]);
OnlyModif = Draw::Atoi(arg[3]);
}
TNaming_Tool::Collect(A,MNS,OnlyModif);
for (TNaming_MapIteratorOfMapOfNamedShape it(MNS); it.More(); it.Next()) {

View File

@ -17,7 +17,7 @@
// purpose or non-infringement. Please see the License for the specific terms
// and conditions governing the rights and limitations under the License.
#include <Draw.hxx>
#include <Draw_Interpretor.hxx>
#include <Standard_ErrorHandler.hxx>
#include <DNaming.hxx>
@ -321,9 +321,9 @@ static Standard_Integer DNaming_AddBox (Draw_Interpretor& theDI,
TDF_Reference::Set(anObj->Label(), aFun->Label().FindChild(FUNCTION_RESULT_LABEL)); //result is here
Standard_Real dx,dy,dz;
dx = atof(theArg[2]);
dy = atof(theArg[3]);
dz = atof(theArg[4]);
dx = Draw::Atof(theArg[2]);
dy = Draw::Atof(theArg[3]);
dz = Draw::Atof(theArg[4]);
DNaming::GetReal(aFun,BOX_DX)->Set(dx);
DNaming::GetReal(aFun,BOX_DY)->Set(dy);
@ -378,7 +378,7 @@ static Standard_Integer DNaming_BoxDX (Draw_Interpretor& theDI,
Handle(TFunction_Function) aFun = GetFunction(objLabel,funGUID);
if(!aFun.IsNull()) {
Standard_Real value = atof(theArg[3]);
Standard_Real value = Draw::Atof(theArg[3]);
DNaming::GetReal(aFun,BOX_DX)->Set(value);
DDF::ReturnLabel(theDI, DNaming::GetReal(aFun,BOX_DX)->Label());
return 0;
@ -411,7 +411,7 @@ static Standard_Integer DNaming_BoxDY (Draw_Interpretor& theDI,
Handle(TFunction_Function) aFun = GetFunction(objLabel,funGUID);
if(!aFun.IsNull()) {
Standard_Real value = atof(theArg[3]);
Standard_Real value = Draw::Atof(theArg[3]);
DNaming::GetReal(aFun,BOX_DY)->Set(value);
DDF::ReturnLabel(theDI, DNaming::GetReal(aFun,BOX_DY)->Label());
return 0;
@ -444,7 +444,7 @@ static Standard_Integer DNaming_BoxDZ (Draw_Interpretor& theDI,
Handle(TFunction_Function) aFun = GetFunction(objLabel,funGUID);
if(!aFun.IsNull()) {
Standard_Real value = atof(theArg[3]);
Standard_Real value = Draw::Atof(theArg[3]);
DNaming::GetReal(aFun,BOX_DZ)->Set(value);
DDF::ReturnLabel(theDI, DNaming::GetReal(aFun,BOX_DZ)->Label());
return 0;
@ -682,10 +682,10 @@ static Standard_Integer DNaming_AttachShape (Draw_Interpretor& di,
aResultLabel.ForgetAllAttributes(Standard_True);
Standard_Boolean aKeepOrientation(Standard_False);
if (nb >= 6)
aKeepOrientation = (Standard_Boolean) atoi(a[5]);
aKeepOrientation = (Standard_Boolean) Draw::Atoi(a[5]);
Standard_Boolean aGeometry(Standard_False);
if (nb == 7)
aGeometry = (Standard_Boolean) atoi(a[6]);
aGeometry = (Standard_Boolean) Draw::Atoi(a[6]);
Handle(TNaming_NamedShape) aCont = DNaming::GetObjectValue(aContext);
#ifdef DEBUG
if(aCont.IsNull() || aCont->IsEmpty())
@ -758,10 +758,10 @@ static Standard_Integer DNaming_XAttachShape (Draw_Interpretor& di,
aResultLabel.ForgetAllAttributes(Standard_True);
Standard_Boolean aKeepOrientation(Standard_False);
if (nb >= 5)
aKeepOrientation = (Standard_Boolean) atoi(a[4]);
aKeepOrientation = (Standard_Boolean) Draw::Atoi(a[4]);
Standard_Boolean aGeometry(Standard_False);
if (nb == 6)
aGeometry = (Standard_Boolean) atoi(a[5]);
aGeometry = (Standard_Boolean) Draw::Atoi(a[5]);
Handle(TNaming_NamedShape) aCont = DNaming::GetObjectValue(aContext);
if(aCont.IsNull() || aCont->IsEmpty())
@ -815,8 +815,8 @@ static Standard_Integer DNaming_AddCylinder (Draw_Interpretor& theDI,
TDF_Reference::Set(anObj->Label(), aFun->Label().FindChild(FUNCTION_RESULT_LABEL)); //result is here
Standard_Real aR, aH;
aR = atof(theArg[2]);
aH = atof(theArg[3]);
aR = Draw::Atof(theArg[2]);
aH = Draw::Atof(theArg[3]);
Handle(TDataStd_UAttribute) Axis;
if (!DDocStd::Find(aDocument, theArg[4], GEOMOBJECT_GUID, Axis)) return 1;
@ -854,7 +854,7 @@ static Standard_Integer DNaming_CylRad (Draw_Interpretor& theDI,
Handle(TFunction_Function) aFun = GetFunction(objLabel,funGUID);
if(!aFun.IsNull()) {
Standard_Real value = atof(theArg[3]);
Standard_Real value = Draw::Atof(theArg[3]);
DNaming::GetReal(aFun,CYL_RADIUS)->Set(value);
DDF::ReturnLabel(theDI, DNaming::GetReal(aFun,CYL_RADIUS)->Label());
return 0;
@ -991,7 +991,7 @@ static Standard_Integer DNaming_AddFillet (Draw_Interpretor& theDI,
TDF_Reference::Set(anObject->Label(), aFun->Label().FindChild(FUNCTION_RESULT_LABEL)); //result is here
Standard_Real aRadius = atof(theArg[3]);
Standard_Real aRadius = Draw::Atof(theArg[3]);
DNaming::GetReal(aFun,FILLET_RADIUS)->Set(aRadius);
Handle(TDataStd_UAttribute) aPath;
@ -1027,13 +1027,13 @@ static Standard_Integer DNaming_PTranslateDXYZ (Draw_Interpretor& di,
TDataStd_Name::Set(aFun->Label(), "ParTranslation");
Standard_Real aDx=0., aDy=0., aDz=0.;
aDx = atof(a[3]);
aDx = Draw::Atof(a[3]);
//cout << "DX = " << aDx<<endl;
if(nb > 4) {
aDy = atof(a[4]);
aDy = Draw::Atof(a[4]);
//cout << "DY = " << aDy<<endl;
if(nb > 5) {
aDz = atof(a[5]);
aDz = Draw::Atof(a[5]);
//cout << "DZ = " << aDz<<endl;
}
}
@ -1075,7 +1075,7 @@ static Standard_Integer DNaming_PTranslateLine (Draw_Interpretor& di,
TDataStd_Name::Set(aFun->Label(), "ParTranslationAlongLine");
Standard_Real anOff = 0.;
anOff = atof(a[4]);
anOff = Draw::Atof(a[4]);
DNaming::GetReal(aFun,PTRANSF_OFF)->Set(anOff);
DNaming::SetObjectArg(aFun, PTRANSF_LINE, aLine);
@ -1115,7 +1115,7 @@ static Standard_Integer DNaming_PRotateLine(Draw_Interpretor& di,
TDF_Reference::Set(anObject->Label(), aFun->Label().FindChild(FUNCTION_RESULT_LABEL));
Standard_Real anAngle = 0.;
anAngle = atof(a[4]);
anAngle = Draw::Atof(a[4]);
Standard_Real aK = 2*M_PI/360;
anAngle = anAngle * aK;
DNaming::GetReal(aFun,PTRANSF_ANG)->Set(anAngle);
@ -1189,9 +1189,9 @@ static Standard_Integer DNaming_AddPrism (Draw_Interpretor& theDI,
Handle(TDataStd_UAttribute) aBasisObj;
if (!DDocStd::Find(aDocument, theArg[2], GEOMOBJECT_GUID, aBasisObj)) return 1;
DNaming::SetObjectArg(aFun, PRISM_BASIS, aBasisObj);
Standard_Real height = atof(theArg[3]);
Standard_Real height = Draw::Atof(theArg[3]);
DNaming::GetReal(aFun,PRISM_HEIGHT)->Set(height);
Standard_Integer reverse = atoi(theArg[4]);
Standard_Integer reverse = Draw::Atoi(theArg[4]);
DNaming::GetInteger(aFun,PRISM_DIR)->Set(reverse);
DDF::ReturnLabel(theDI, anObj->Label());
return 0;
@ -1219,7 +1219,7 @@ static Standard_Integer DNaming_PrismHeight (Draw_Interpretor& theDI,
Handle(TFunction_Function) aFun = GetFunction(objLabel,funGUID);
if(!aFun.IsNull()) {
Standard_Real value = atof(theArg[3]);
Standard_Real value = Draw::Atof(theArg[3]);
DNaming::GetReal(aFun, PRISM_HEIGHT)->Set(value);
DDF::ReturnLabel(theDI, DNaming::GetReal(aFun,PRISM_HEIGHT)->Label());
return 0;
@ -1277,12 +1277,12 @@ static Standard_Integer DNaming_AddRevol (Draw_Interpretor& theDI,
DNaming::SetObjectArg(aFun, REVOL_AXIS, anAxObj);
if(theNb > 4 ) {
Standard_Real angle = atof(theArg[4]);
Standard_Real angle = Draw::Atof(theArg[4]);
Standard_Real aK = 2*M_PI/360;
angle = angle * aK;
DNaming::GetReal(aFun,REVOL_ANGLE)->Set(angle);
if( theNb == 6) {
Standard_Integer reverse = atoi(theArg[5]);
Standard_Integer reverse = Draw::Atoi(theArg[5]);
DNaming::GetInteger(aFun, REVOL_REV)->Set(reverse);
}
}
@ -1312,7 +1312,7 @@ static Standard_Integer DNaming_RevolutionAngle (Draw_Interpretor& theDI,
Handle(TFunction_Function) aFun = GetFunction(objLabel,funGUID);
if(!aFun.IsNull()) {
Standard_Real value = atof(theArg[3]);
Standard_Real value = Draw::Atof(theArg[3]);
DNaming::GetReal(aFun, REVOL_ANGLE)->Set(value);
DDF::ReturnLabel(theDI, DNaming::GetReal(aFun,REVOL_ANGLE)->Label());
return 0;
@ -1351,7 +1351,7 @@ static Standard_Integer DNaming_AddSphere (Draw_Interpretor& theDI,
if (!DDocStd::Find(aDocument, theArg[2], GEOMOBJECT_GUID, aCenterObj)) return 1;
DNaming::SetObjectArg(aFun, SPHERE_CENTER, aCenterObj);
Standard_Real aRadius = atof(theArg[3]);
Standard_Real aRadius = Draw::Atof(theArg[3]);
DNaming::GetReal(aFun,SPHERE_RADIUS)->Set(aRadius);
DDF::ReturnLabel(theDI, anObj->Label());
@ -1380,7 +1380,7 @@ static Standard_Integer DNaming_SphereRadius (Draw_Interpretor& theDI,
Handle(TFunction_Function) aFun = GetFunction(objLabel,funGUID);
if(!aFun.IsNull()) {
Standard_Real value = atof(theArg[3]);
Standard_Real value = Draw::Atof(theArg[3]);
DNaming::GetReal(aFun, SPHERE_RADIUS)->Set(value);
DDF::ReturnLabel(theDI, DNaming::GetReal(aFun, SPHERE_RADIUS)->Label());
return 0;
@ -1414,9 +1414,9 @@ static Standard_Integer DNaming_AddPoint (Draw_Interpretor& theDI,
TDF_Reference::Set(anObj->Label(), aFun->Label().FindChild(FUNCTION_RESULT_LABEL)); //result is here
Standard_Real x,y,z;
x = atof(theArg[2]);
y = atof(theArg[3]);
z = atof(theArg[4]);
x = Draw::Atof(theArg[2]);
y = Draw::Atof(theArg[3]);
z = Draw::Atof(theArg[4]);
DNaming::GetReal(aFun,PNT_DX)->Set(x);
DNaming::GetReal(aFun,PNT_DY)->Set(y);
@ -1457,9 +1457,9 @@ static Standard_Integer DNaming_AddPointRlt (Draw_Interpretor& theDI,
if (!DDocStd::Find(aDocument, theArg[2], GEOMOBJECT_GUID, aRefPnt)) return 1;
Standard_Real dx,dy,dz;
dx = atof(theArg[3]);
dy = atof(theArg[4]);
dz = atof(theArg[5]);
dx = Draw::Atof(theArg[3]);
dy = Draw::Atof(theArg[4]);
dz = Draw::Atof(theArg[5]);
DNaming::GetReal(aFun,PNT_DX)->Set(dx);
DNaming::GetReal(aFun,PNT_DY)->Set(dy);
@ -1504,17 +1504,17 @@ static Standard_Integer DNaming_PntOffset (Draw_Interpretor& theDI,
Standard_Real value(0.0);
Standard_Boolean isDX = (strcmp(theArg[3],"skip"));
if(isDX) {
value = atof(theArg[3]);
value = Draw::Atof(theArg[3]);
DNaming::GetReal(aFun,PNT_DX)->Set(value);
}
Standard_Boolean isDY = (strcmp(theArg[4],"skip"));
if(isDY) {
value = atof(theArg[4]);
value = Draw::Atof(theArg[4]);
DNaming::GetReal(aFun,PNT_DY)->Set(value);
}
Standard_Boolean isDZ = (strcmp(theArg[5],"skip"));
if(isDZ) {
value = atof(theArg[5]);
value = Draw::Atof(theArg[5]);
DNaming::GetReal(aFun,PNT_DZ)->Set(value);
}
if(isDX || isDY || isDZ)
@ -1554,7 +1554,7 @@ static Standard_Integer DNaming_Line3D (Draw_Interpretor& theDI,
TDataStd_Name::Set(aFun->Label(), "Line3D_Function");
TDF_Reference::Set(anObj->Label(), aFun->Label().FindChild(FUNCTION_RESULT_LABEL)); //result is here
Standard_Integer aType = atoi(theArg[2]);
Standard_Integer aType = Draw::Atoi(theArg[2]);
DNaming::GetInteger(aFun,LINE3D_TYPE)->Set(aType);
//LINE3D_PNTNB
@ -1869,11 +1869,11 @@ static Standard_Integer DNaming_TestSingle (Draw_Interpretor& theDI,
Standard_Boolean XSelection(Standard_False);
Standard_Boolean Geometry(Standard_False);
if(theNb == 4)
Orientation = (Standard_Boolean)atoi(theArg[3]);
Orientation = (Standard_Boolean)Draw::Atoi(theArg[3]);
if(theNb == 5)
XSelection = (Standard_Boolean)atoi(theArg[4]);
XSelection = (Standard_Boolean)Draw::Atoi(theArg[4]);
if (theNb == 6)
Geometry = (Standard_Boolean) atoi(theArg[5]);
Geometry = (Standard_Boolean) Draw::Atoi(theArg[5]);
Handle(TNaming_NamedShape) aNS = DNaming::GetObjectValue( aCntObj);
if(!aNS.IsNull() && !aNS->IsEmpty()) {
@ -2008,11 +2008,11 @@ static Standard_Integer DNaming_Multiple (Draw_Interpretor& theDI,
Standard_Boolean XSelection(Standard_False);
Standard_Boolean Geometry(Standard_False);
if(theNb == 4)
Orientation = (Standard_Boolean)atoi(theArg[3]);
Orientation = (Standard_Boolean)Draw::Atoi(theArg[3]);
if(theNb == 5)
XSelection = (Standard_Boolean)atoi(theArg[4]);
XSelection = (Standard_Boolean)Draw::Atoi(theArg[4]);
if (theNb == 6)
Geometry = (Standard_Boolean) atoi(theArg[5]);
Geometry = (Standard_Boolean) Draw::Atoi(theArg[5]);
Handle(TNaming_NamedShape) aNS = DNaming::GetObjectValue( aCntObj);
if(!aNS.IsNull() && !aNS->IsEmpty()) {

View File

@ -129,7 +129,7 @@ static Standard_Integer DNaming_Select (Draw_Interpretor& di, Standard_Integer n
}
if (n > 4) {
Standard_Boolean Orient(Standard_False);
if(n == 6) Orient = (Standard_Boolean)atoi(a[5]);
if(n == 6) Orient = (Standard_Boolean)Draw::Atoi(a[5]);
TopoDS_Shape S = DBRep::Get(a[3], TopAbs_SHAPE);
TopoDS_Shape C = DBRep::Get(a[4], TopAbs_SHAPE);
SL.Select (S, C, geometry, Orient);
@ -223,7 +223,7 @@ static Standard_Integer DNaming_SolveSelection (Draw_Interpretor& di, Standard_I
if(!isSolved)
di << "!!! Solver is failed" <<"\n";
TopoDS_Shape Res = TNaming_Tool::CurrentShape(SL.NamedShape());
sprintf (name,"%s_%s","new",a[2]);
Sprintf (name,"%s_%s","new",a[2]);
Display (name,Res);
return 0;
}

View File

@ -329,7 +329,7 @@ static Standard_Integer DPrsStd_AISTransparency (Draw_Interpretor& di,
Handle(TPrsStd_AISPresentation) prs;
if(L.FindAttribute( TPrsStd_AISPresentation::GetID(), prs) ) {
if( nb == 4 ) {
prs->SetTransparency(atof(arg[3]));
prs->SetTransparency(Draw::Atof(arg[3]));
TPrsStd_AISViewer::Update(L);
}
else {
@ -396,7 +396,7 @@ static Standard_Integer DPrsStd_AISColor (Draw_Interpretor& di,
Handle(TPrsStd_AISPresentation) prs;
if(L.FindAttribute( TPrsStd_AISPresentation::GetID(), prs) ) {
if( nb == 4 ) {
prs->SetColor((Quantity_NameOfColor)atoi(arg[3]));
prs->SetColor((Quantity_NameOfColor)Draw::Atoi(arg[3]));
TPrsStd_AISViewer::Update(L);
}
else
@ -465,7 +465,7 @@ static Standard_Integer DPrsStd_AISMaterial (Draw_Interpretor& di,
Handle(TPrsStd_AISPresentation) prs;
if(L.FindAttribute( TPrsStd_AISPresentation::GetID(), prs) ) {
if( nb == 4 ) {
prs->SetMaterial((Graphic3d_NameOfMaterial)atoi(arg[3]));
prs->SetMaterial((Graphic3d_NameOfMaterial)Draw::Atoi(arg[3]));
TPrsStd_AISViewer::Update(L);
}
else {

View File

@ -182,13 +182,13 @@ is
---Purpose: Sets a TCL sting variable
Atof(Name : CString) returns Real;
---Purpose: Search a numeric variable. If none found converts
-- the string to a real.
---Purpose: Converts numeric expression, that can involve DRAW
-- variables, to real value.
Atoi(Name : CString) returns Integer;
---Purpose: Search a numeric variable. If none found converts
-- the string to an integer.
---Purpose: Converts numeric expression, that can involve DRAW
-- variables, to integer value.
-- Implemented as cast of Atof() to integer.
LastPick(view,X,Y,button : out Integer);
---Purpose: Returns last graphic selection description.

View File

@ -110,7 +110,7 @@ static void ReadInitFile (const TCollection_AsciiString& theFileName)
try {
aPath.ChangeAll ('\\', '/');
sprintf(console_command, "source \"%.980s\"", aPath.ToCString());
Sprintf(console_command, "source \"%.980s\"", aPath.ToCString());
console_semaphore = HAS_CONSOLE_COMMAND;
while (console_semaphore == HAS_CONSOLE_COMMAND)
Sleep(10);
@ -122,7 +122,7 @@ static void ReadInitFile (const TCollection_AsciiString& theFileName)
} else {
#endif
char* com = new char [aPath.Length() + strlen ("source ") + 2];
sprintf (com, "source %s", aPath.ToCString());
Sprintf (com, "source %s", aPath.ToCString());
Draw_Interprete (com);
delete [] com;
#ifdef WNT

View File

@ -64,9 +64,6 @@ extern Draw_Viewer dout;
extern Standard_Boolean Draw_Batch;
#endif
#define atof(X) Draw::Atof(X)
#define atoi(X) Draw::Atoi(X)
class Draw_SaveAndRestore {
public :

View File

@ -391,7 +391,7 @@ static Standard_Integer Draw_wait(Draw_Interpretor& , Standard_Integer n, const
{
Standard_Integer w = 10;
if (n > 1)
w = atoi(a[1]);
w = Draw::Atoi(a[1]);
time_t ct = time(NULL) + w;
while (time(NULL) < ct) {};
return 0;
@ -443,7 +443,7 @@ static Standard_Integer cpulimit(Draw_Interpretor& di, Standard_Integer n, const
CPU_LIMIT = RLIM_INFINITY;
else
{
CPU_LIMIT = atoi (a[1]);
CPU_LIMIT = Draw::Atoi (a[1]);
Standard_Real anUserSeconds, aSystemSeconds;
OSD_Chronometer::GetProcessCPU (anUserSeconds, aSystemSeconds);
CPU_CURRENT = clock_t(anUserSeconds + aSystemSeconds);
@ -464,7 +464,7 @@ static Standard_Integer cpulimit(Draw_Interpretor& di, Standard_Integer n, const
if (n <= 1)
rlp.rlim_cur = RLIM_INFINITY;
else
rlp.rlim_cur = atoi(a[1]);
rlp.rlim_cur = Draw::Atoi(a[1]);
CPU_LIMIT = rlp.rlim_cur;
int status;
@ -517,7 +517,7 @@ By default <logfile> is \"mem-log.txt\", <outfile> is \"mem-stat.txt\""
}
if (strcmp(a[1], "set") == 0)
{
int aType = (n > 2 ? atoi(a[2]) : 1);
int aType = (n > 2 ? Draw::Atoi(a[2]) : 1);
if (aType < 0 || aType > 2)
{
di << "unknown op of the command set" << "\n";
@ -581,7 +581,7 @@ By default <logfile> is \"mem-log.txt\", <outfile> is \"mem-stat.txt\""
const char* aOutFile = "mem-stat.txt";
if (n > 2)
{
includeAlive = (atoi(a[2]) != 0);
includeAlive = (Draw::Atoi(a[2]) != 0);
if (n > 3)
{
aLogFile = a[3];
@ -608,6 +608,38 @@ By default <logfile> is \"mem-log.txt\", <outfile> is \"mem-stat.txt\""
return 0;
}
//==============================================================================
//function : dlocale
//purpose :
//==============================================================================
static int dlocale (Draw_Interpretor& di, Standard_Integer n, const char** argv)
{
int category = LC_ALL;
if (n > 1)
{
const char *cat = argv[1];
if ( ! strcmp (cat, "LC_ALL") ) category = LC_ALL;
else if ( ! strcmp (cat, "LC_COLLATE") ) category = LC_COLLATE;
else if ( ! strcmp (cat, "LC_CTYPE") ) category = LC_CTYPE;
else if ( ! strcmp (cat, "LC_MONETARY") ) category = LC_MONETARY;
else if ( ! strcmp (cat, "LC_NUMERIC") ) category = LC_NUMERIC;
else if ( ! strcmp (cat, "LC_TIME") ) category = LC_TIME;
else
{
cout << "Error: cannot recognize argument " << cat << " as one of LC_ macros" << endl;
return 1;
}
}
const char* locale = (n > 2 ? argv[2] : NULL);
const char* result = setlocale (category, locale);
if (result)
di << result;
else
cout << "Error: unsupported locale specification: " << locale << endl;
return 0;
}
//==============================================================================
//function : dmeminfo
//purpose :
@ -702,4 +734,6 @@ void Draw::BasicCommands(Draw_Interpretor& theCommands)
__FILE__,dbreak,g);
theCommands.Add("dversion", "provides information on OCCT build configuration (version, compiler, OS, C library, etc.)",
__FILE__,dversion,g);
theCommands.Add("dlocale", "set and / or query locate of C subsystem (function setlocale())",
__FILE__,dlocale,g);
}

View File

@ -74,7 +74,7 @@ static char Draw_fontsizedefault[FONTLENGTH]="150";
static Standard_Integer ViewId(const Standard_CString a)
{
Standard_Integer id = atoi(a);
Standard_Integer id = Draw::Atoi(a);
if ((id < 0) || (id >= MAXVIEW)) {
cout << "Incorrect view-id, must be in 0.."<<MAXVIEW-1<<endl;
return -1;
@ -90,7 +90,7 @@ static void SetTitle(const Standard_Integer id)
{
if (dout.HasView(id)) {
char title[255];
sprintf(title,"%d : %s - Zoom %f",id,dout.GetType(id),dout.Zoom(id));
Sprintf(title,"%d : %s - Zoom %f",id,dout.GetType(id),dout.Zoom(id));
dout.SetTitle(id,title);
}
}
@ -106,7 +106,7 @@ static Standard_Integer zoom(Draw_Interpretor& , Standard_Integer n, const char*
// two argument -> First is the view
Standard_Boolean z2d = !strcasecmp(a[0],"2dzoom");
if (n == 2) {
Standard_Real z = atof(a[1]);
Standard_Real z = Draw::Atof(a[1]);
for (Standard_Integer id = 0; id < MAXVIEW; id++) {
if (dout.HasView(id)) {
if ((z2d && !dout.Is3D(id)) || (!z2d && dout.Is3D(id))) {
@ -121,7 +121,7 @@ static Standard_Integer zoom(Draw_Interpretor& , Standard_Integer n, const char*
else if (n >= 3) {
Standard_Integer id = ViewId(a[1]);
if (id < 0) return 1;
Standard_Real z = atof(a[2]);
Standard_Real z = Draw::Atof(a[2]);
dout.SetZoom(id,z);
dout.RepaintView(id);
SetTitle(id);
@ -263,7 +263,7 @@ static Standard_Integer view(Draw_Interpretor& di, Standard_Integer n, const cha
if (Draw_Batch) return 1;
if ((n >= 3) && (n != 4)) {
Standard_Integer id = atoi(a[1]);
Standard_Integer id = Draw::Atoi(a[1]);
if ((id < 0) || (id >= MAXVIEW)) {
di <<"View-id must be in 0.."<<MAXVIEW-1<<"\n";
return 1;
@ -276,13 +276,13 @@ static Standard_Integer view(Draw_Interpretor& di, Standard_Integer n, const cha
if (dout.HasView(id))
dout.GetPosSize(id,X,Y,W,H);
if (n >= 4)
X = atoi(a[3]);
X = Draw::Atoi(a[3]);
if (n >= 5)
Y = atoi(a[4]);
Y = Draw::Atoi(a[4]);
if (n >= 6)
W = atoi(a[5]);
W = Draw::Atoi(a[5]);
if (n >= 7)
H = atoi(a[6]);
H = Draw::Atoi(a[6]);
dout.MakeView(id,a[2],X,Y,W,H);
if (!dout.HasView(id)) {
di << "View creation failed"<<"\n";
@ -294,7 +294,7 @@ static Standard_Integer view(Draw_Interpretor& di, Standard_Integer n, const cha
}
else if (n == 4) {
// create a view on a given window
Standard_Integer id = atoi(a[1]);
Standard_Integer id = Draw::Atoi(a[1]);
if ((id < 0) || (id >= MAXVIEW)) {
di <<"View-id must be in 0.."<<MAXVIEW-1<<"\n";
return 1;
@ -421,7 +421,7 @@ static Standard_Integer setfocal(Draw_Interpretor& di, Standard_Integer n, const
}
}
else {
Standard_Real f = atof(a[1]);
Standard_Real f = Draw::Atof(a[1]);
for (Standard_Integer id = 0; id < MAXVIEW; id++) {
if (!strcasecmp(dout.GetType(id),"PERS"))
dout.SetFocal(id,f);
@ -575,14 +575,14 @@ static Standard_Integer ptv(Draw_Interpretor& , Standard_Integer n, const char**
Standard_Integer anid = ViewId(a[1]);
if (anid < 0) return 1;
start = end = anid;
X = atof(a[2]);
Y = atof(a[3]);
Z = atof(a[4]);
X = Draw::Atof(a[2]);
Y = Draw::Atof(a[3]);
Z = Draw::Atof(a[4]);
}
else {
X = atof(a[1]);
Y = atof(a[2]);
Z = atof(a[3]);
X = Draw::Atof(a[1]);
Y = Draw::Atof(a[2]);
Z = Draw::Atof(a[3]);
}
for (Standard_Integer id = start; id <= end; id++) {
@ -614,14 +614,14 @@ static Standard_Integer dptv(Draw_Interpretor& , Standard_Integer n, const char*
Standard_Integer anid = ViewId(a[1]);
if (anid < 0) return 1;
start = end = anid;
DX = atof(a[2]);
DY = atof(a[3]);
DZ = atof(a[4]);
DX = Draw::Atof(a[2]);
DY = Draw::Atof(a[3]);
DZ = Draw::Atof(a[4]);
}
else {
DX = atof(a[1]);
DY = atof(a[2]);
DZ = atof(a[3]);
DX = Draw::Atof(a[1]);
DY = Draw::Atof(a[2]);
DZ = Draw::Atof(a[3]);
}
for (Standard_Integer id = start; id <= end; id++) {
@ -647,7 +647,7 @@ static Standard_Integer color(Draw_Interpretor& di, Standard_Integer n, const ch
if (n < 3) {
Draw_BlackBackGround = !Draw_BlackBackGround;
}
else if (!dout.DefineColor(atoi(a[1]),a[2])) {
else if (!dout.DefineColor(Draw::Atoi(a[1]),a[2])) {
di << "Could not allocate color "<<a[2]<<"\n";
return 1;
}
@ -826,7 +826,7 @@ static Standard_Integer hcolor(Draw_Interpretor& di, Standard_Integer n, const c
di << "12 = Yellow,\t 13 = Khaki,\t 14 = Coral" << "\n" ;
di << "1 <= width <= 11, 0 (noir) <= gray <= 1 (blanc)" << "\n" ;
} else {
dout.PostColor(atoi(a[1]),atoi(a[2]),atof(a[3]));
dout.PostColor(Draw::Atoi(a[1]),Draw::Atoi(a[2]),Draw::Atof(a[3]));
}
return 0;
}
@ -848,7 +848,7 @@ static Standard_Integer xwd(Draw_Interpretor& , Standard_Integer n, const char**
Standard_Integer id = 1;
const char* file = a[1];
if (n > 2) {
id = atoi(a[1]);
id = Draw::Atoi(a[1]);
file = a[2];
}
if (!dout.SaveView(id,file))
@ -873,19 +873,19 @@ static Standard_Integer grid (Draw_Interpretor& , Standard_Integer NbArg, const
StepZ = DefaultGridStep ;
break ;
case 2 :
StepX = Abs (atof (Arg[1])) ;
StepY = Abs (atof (Arg[1])) ;
StepZ = Abs (atof (Arg[1])) ;
StepX = Abs (Draw::Atof (Arg[1])) ;
StepY = Abs (Draw::Atof (Arg[1])) ;
StepZ = Abs (Draw::Atof (Arg[1])) ;
break ;
case 3 :
StepX = Abs (atof (Arg[1])) ;
StepY = Abs (atof (Arg[2])) ;
StepZ = Abs (atof (Arg[2])) ;
StepX = Abs (Draw::Atof (Arg[1])) ;
StepY = Abs (Draw::Atof (Arg[2])) ;
StepZ = Abs (Draw::Atof (Arg[2])) ;
break ;
case 4 :
StepX = Abs (atof (Arg[1])) ;
StepY = Abs (atof (Arg[2])) ;
StepZ = Abs (atof (Arg[3])) ;
StepX = Abs (Draw::Atof (Arg[1])) ;
StepY = Abs (Draw::Atof (Arg[2])) ;
StepZ = Abs (Draw::Atof (Arg[3])) ;
break ;
default :
return 1 ;
@ -941,7 +941,7 @@ static Standard_Integer dtext(Draw_Interpretor& di, Standard_Integer n, const ch
}
else if (n >= 4) {
is3d = n > 4;
P.SetCoord(atof(a[1]),atof(a[2]),is3d ? atof(a[3]) : 0);
P.SetCoord(Draw::Atof(a[1]),Draw::Atof(a[2]),is3d ? Draw::Atof(a[3]) : 0);
}
else
return 0;

View File

@ -233,7 +233,7 @@ static Standard_Integer CommandCmd
cout << "An exception was caught " << E << endl;
if (cc && atoi(cc)) {
if (cc && Draw::Atoi(cc)) {
#ifdef WNT
Tcl_Exit(0);
#else
@ -497,7 +497,7 @@ Draw_Interpretor& Draw_Interpretor::Append(const TCollection_ExtendedString& the
Draw_Interpretor& Draw_Interpretor::Append(const Standard_Integer i)
{
char c[100];
sprintf(c,"%d",i);
Sprintf(c,"%d",i);
Tcl_AppendResult(myInterp,c,(Standard_CString)0);
return *this;
}
@ -510,7 +510,7 @@ Draw_Interpretor& Draw_Interpretor::Append(const Standard_Integer i)
Draw_Interpretor& Draw_Interpretor::Append(const Standard_Real r)
{
char s[100];
sprintf(s,"%.17g",r);
Sprintf(s,"%.17g",r);
Tcl_AppendResult(myInterp,s,(Standard_CString)0);
return *this;
}

View File

@ -87,7 +87,7 @@ Standard_Boolean Draw_ProgressIndicator::Show(const Standard_Boolean force)
// Prepare textual progress info
char text[2048];
Standard_Integer n = 0;
n += sprintf ( &text[n], "Progress: %.0f%%", 100. * GetPosition() );
n += Sprintf ( &text[n], "Progress: %.0f%%", 100. * GetPosition() );
for ( Standard_Integer i=GetNbScopes(); i >=1; i-- ) {
const Message_ProgressScale &scale = GetScope ( i );
if ( scale.GetName().IsNull() ) continue; // skip unnamed scopes
@ -95,16 +95,16 @@ Standard_Boolean Draw_ProgressIndicator::Show(const Standard_Boolean force)
Standard_Real locPos = ( i >1 ? GetScope ( i-1 ).GetLast() : GetPosition() );
// print progress info differently for finite and infinite scopes
if ( scale.GetInfinite() )
n += sprintf ( &text[n], " %s: %.0f", scale.GetName()->ToCString(),
n += Sprintf ( &text[n], " %s: %.0f", scale.GetName()->ToCString(),
scale.BaseToLocal ( locPos ) );
else
n += sprintf ( &text[n], " %s: %.0f / %.0f", scale.GetName()->ToCString(),
n += Sprintf ( &text[n], " %s: %.0f / %.0f", scale.GetName()->ToCString(),
scale.BaseToLocal ( locPos ), scale.GetMax() );
}
// In addition, write elapsed/estimated/remaining time
if ( GetPosition() > 0.01 ) {
n += sprintf ( &text[n], "\nElapsed/estimated time: %ld/%.0f sec",
n += Sprintf ( &text[n], "\nElapsed/estimated time: %ld/%.0f sec",
(long)(aTime - myStartTime), ( aTime - myStartTime ) / GetPosition() );
}
@ -112,7 +112,7 @@ Standard_Boolean Draw_ProgressIndicator::Show(const Standard_Boolean force)
if ( myGraphMode ) {
if ( ! myShown ) {
char command[1024];
sprintf ( command, "toplevel .xprogress -height 100 -width 410;"
Sprintf ( command, "toplevel .xprogress -height 100 -width 410;"
"wm title .xprogress \"Progress\";"
"set xprogress_stop 0;"
"canvas .xprogress.bar -width 402 -height 22;"
@ -127,12 +127,12 @@ Standard_Boolean Draw_ProgressIndicator::Show(const Standard_Boolean force)
}
char command[1024];
Standard_Integer num = 0;
num += sprintf ( &command[num], ".xprogress.bar coords progress 2 2 %.0f 21;",
num += Sprintf ( &command[num], ".xprogress.bar coords progress 2 2 %.0f 21;",
1+400*GetPosition() );
num += sprintf ( &command[num], ".xprogress.bar coords progress_next 2 2 %.0f 21;",
num += Sprintf ( &command[num], ".xprogress.bar coords progress_next 2 2 %.0f 21;",
1+400*GetScope(1).GetLast() );
num += sprintf ( &command[num], ".xprogress.text configure -text \"%s\";", text );
num += sprintf ( &command[num], "update" );
num += Sprintf ( &command[num], ".xprogress.text configure -text \"%s\";", text );
num += Sprintf ( &command[num], "update" );
((Draw_Interpretor*)myDraw)->Eval ( command );
}

View File

@ -45,7 +45,7 @@ static Standard_Integer parsing
TCollection_AsciiString aStrTok(argv[1]);
Standard_Integer nbIter =1;
if(argc >2)
nbIter = atoi(argv[2]);
nbIter = Draw::Atoi(argv[2]);
UnitsAPI::SetLocalSystem();
Handle(Units_Token) atoken;
Units_UnitSentence aUnitSent(aStrTok.ToCString());
@ -93,7 +93,7 @@ static Standard_Integer converttoSI
return 1;
}
Standard_Real aData = atof(argv[1]);
Standard_Real aData = Draw::Atof(argv[1]);
Standard_CString aUnit = argv[2];
Standard_Real res = UnitsAPI::AnyToSI(aData,aUnit);
@ -115,7 +115,7 @@ static Standard_Integer converttoMDTV
return 1;
}
Standard_Real aData = atof(argv[1]);
Standard_Real aData = Draw::Atof(argv[1]);
Standard_CString aUnit = argv[2];
UnitsAPI::SetLocalSystem(UnitsAPI_MDTV);
@ -134,7 +134,7 @@ static Standard_Integer converttoMDTV
static Standard_Integer unit(Draw_Interpretor& , Standard_Integer n, const char** a)
{
if(n == 4) {
cout << Units::Convert(atof(a[1]), a[2], a[3]) << endl;
cout << Units::Convert(Draw::Atof(a[1]), a[2], a[3]) << endl;
return 0;
}
else

View File

@ -400,12 +400,12 @@ static Standard_Integer erase(Draw_Interpretor& di, Standard_Integer n, const ch
static Standard_Integer draw(Draw_Interpretor& , Standard_Integer n, const char** a)
{
if (n < 3) return 1;
Standard_Integer id = atoi(a[1]);
Standard_Integer id = Draw::Atoi(a[1]);
if (!dout.HasView(id)) {
cout << "bad view number in draw"<<endl;
return 1;
}
Standard_Integer mo = atoi(a[2]);
Standard_Integer mo = Draw::Atoi(a[2]);
Draw_Display d = dout.MakeDisplay(id);
d.SetMode(mo);
Standard_Integer i;
@ -479,7 +479,7 @@ static Standard_Integer whatis(Draw_Interpretor& di, Standard_Integer n, const c
static Standard_Integer value(Draw_Interpretor& di, Standard_Integer n, const char** a)
{
if (n != 2) return 1;
di << atof(a[1]);
di << Draw::Atof(a[1]);
return 0;
}
@ -586,7 +586,7 @@ static Standard_Integer set(Draw_Interpretor& di, Standard_Integer n, const char
Standard_Real val=0;
for (i = 1; i < n; i += 2) {
val = 0;
if (i+1 < n) val = atof(a[i+1]);
if (i+1 < n) val = Draw::Atof(a[i+1]);
Draw::Set(a[i],val);
}
di << val;
@ -681,7 +681,7 @@ static Standard_Integer pick(Draw_Interpretor& , Standard_Integer n, const char*
Standard_Integer id;
Standard_Integer X,Y,b;
Standard_Boolean wait = (n == 6);
if (!wait) id = atoi(a[1]);
if (!wait) id = Draw::Atoi(a[1]);
dout.Select(id,X,Y,b,wait);
Standard_Real z = dout.Zoom(id);
gp_Pnt P((Standard_Real)X /z,(Standard_Real)Y /z,0);
@ -945,7 +945,7 @@ void Draw::Repaint()
static Standard_Integer trigo (Draw_Interpretor& di, Standard_Integer , const char** a)
{
Standard_Real x = atof(a[1]);
Standard_Real x = Draw::Atof(a[1]);
if (!strcasecmp(a[0],"cos"))
di << Cos(x);
@ -960,7 +960,7 @@ static Standard_Integer trigo (Draw_Interpretor& di, Standard_Integer , const ch
else if (!strcasecmp(a[0],"asin"))
di << ASin(x);
else if (!strcasecmp(a[0],"atan2"))
di << ATan2(x,atof(a[2]));
di << ATan2(x,Draw::Atof(a[2]));
return 0;
}
@ -970,9 +970,6 @@ static Standard_Integer trigo (Draw_Interpretor& di, Standard_Integer , const ch
// Atof and Atoi
//=======================================================================
#undef atof
#undef atoi
static Standard_Boolean Numeric(char c)
{
return (c == '.' || (c >= '0' && c <= '9'));
@ -1028,7 +1025,7 @@ static Standard_Real ParseValue(char*& name)
*p = '\0';
if (Numeric(*name)) // numeric litteral
x = atof(name);
x = Atof(name);
else if (!Draw::Get((Standard_CString) name,x)) { // variable
// search for a function ...
@ -1086,7 +1083,7 @@ static Standard_Real ParseValue(char*& name)
x = 0;
}
else
x = atof(theCommands.Result());
x = Atof(theCommands.Result());
theCommands.Reset();
if (sv) {
theCommands << sv;

View File

@ -224,7 +224,7 @@ static Standard_Integer DrawDim_VARIABLES (Draw_Interpretor& di,
if (M.Add(vf)) {
i++;
char* p = (char *)malloc(100);
sprintf(p,"%s_%dv",a[1],i);
Sprintf(p,"%s_%dv",a[1],i);
DBRep::Set(p,vf);
di.AppendElement(p);
DrawDim::DrawShapeName (vf,p);
@ -232,14 +232,14 @@ static Standard_Integer DrawDim_VARIABLES (Draw_Interpretor& di,
if (M.Add(vl)) {
i++;
char *p = (char *)malloc(100);
sprintf(p,"%s_%dv",a[1],i);
Sprintf(p,"%s_%dv",a[1],i);
DBRep::Set(p,vl);
di.AppendElement(p);
DrawDim::DrawShapeName (vl,p);
}
i++;
char *p = (char *)malloc(100);
sprintf(p,"%s_%de",a[1],i);
Sprintf(p,"%s_%de",a[1],i);
DBRep::Set(p,ex.Current());
di.AppendElement(p);
DrawDim::DrawShapeName (ex.Current(),p);

View File

@ -260,8 +260,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;
}
@ -269,7 +269,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();
}
}
@ -424,13 +424,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;
}
}
@ -445,11 +445,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();
@ -470,22 +470,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') {
@ -500,18 +500,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);
}
@ -545,23 +545,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));
@ -570,16 +570,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);
}

View File

@ -175,7 +175,7 @@ void DrawTrSurf_Triangulation::DrawOn(Draw_Display& dis) const
dis.SetColor(Draw_jaune);
n = myTriangulation->NbNodes();
for (i = 1; i <= n; i++) {
sprintf(text,"%d",i);
Sprintf(text,"%d",i);
dis.DrawString(Nodes(i),text);
}
}
@ -193,7 +193,7 @@ void DrawTrSurf_Triangulation::DrawOn(Draw_Display& dis) const
bary.Add(Nodes(t[j]).Coord());
bary.Multiply(1./3.);
sprintf(text,"%d",i);
Sprintf(text,"%d",i);
dis.DrawString(P,text);
}
}

View File

@ -164,7 +164,7 @@ void Dynamic_FuzzyDefinitionsDictionary::Creates(const Standard_CString afilenam
fuzzydefinition->Parameter(new Dynamic_IntegerParameter(name,atoi(value)));
else if(!strcasecmp(type,"Standard_Real"))
fuzzydefinition->Parameter(new Dynamic_RealParameter(name,atof(value)));
fuzzydefinition->Parameter(new Dynamic_RealParameter(name,Atof(value)));
else if(!strcasecmp(type,"Standard_CString"))
fuzzydefinition->Parameter(new Dynamic_StringParameter(name,value));

View File

@ -175,7 +175,7 @@ void Dynamic_MethodDefinitionsDictionary::Creates(const Standard_CString afilena
methoddefinition->AddVariable(new Dynamic_IntegerParameter(name,atoi(value)),Dynamic::Mode(mode),group);
else if(!strcasecmp(type,"Standard_Real"))
methoddefinition->AddVariable(new Dynamic_RealParameter(name,atof(value)),Dynamic::Mode(mode),group);
methoddefinition->AddVariable(new Dynamic_RealParameter(name,Atof(value)),Dynamic::Mode(mode),group);
else if(!strcasecmp(type,"Standard_CString"))
methoddefinition->AddVariable(new Dynamic_StringParameter(name,value),Dynamic::Mode(mode),group);

View File

@ -116,6 +116,6 @@ Standard_Real Expr_NumericValue::Evaluate(const Expr_Array1OfNamedUnknown&, cons
TCollection_AsciiString Expr_NumericValue::String() const
{
char val[100];
sprintf(val,"%g",myValue);
Sprintf(val,"%g",myValue);
return TCollection_AsciiString(val);
}

View File

@ -481,7 +481,7 @@ extern "C" void ExprIntrp_NumValue()
char num[30];
int nbcar;
nbcar = ExprIntrp_GetResult(num);
Standard_Real value = atof(num);
Standard_Real value = Atof(num);
Handle(Expr_NumericValue) nval = new Expr_NumericValue(value);
ExprIntrp_Recept.Push(nval);
}
@ -621,7 +621,7 @@ extern "C" void ExprIntrp_ConstantDefinition()
char num[30];
int nbcar;
nbcar = ExprIntrp_GetResult(num);
Standard_Real val = atof(num);
Standard_Real val = Atof(num);
Handle(Expr_NamedConstant) theconst = new Expr_NamedConstant(name,val);
ExprIntrp_Recept.Use(theconst);
ExprIntrp_Recept.Push(theconst);

View File

@ -30,8 +30,7 @@ uses Position from Storage,
SequenceOfAsciiString from TColStd,
SequenceOfExtendedString from TColStd,
ExtendedString from TCollection,
FStream from FSD,
Real2String from OSD
FStream from FSD
raises StreamTypeMismatchError from Storage,
StreamFormatError from Storage,
@ -331,6 +330,5 @@ is
fields
myStream : FStream from FSD;
myRealConv : Real2String from OSD;
myStream : FStream from FSD;
end;

View File

@ -19,8 +19,6 @@
#include <FSD_CmpFile.ixx>
#include <OSD.hxx>
#include <OSD_Real2String.hxx>
#include <Storage_StreamModeError.hxx>
#include <Storage_StreamUnknownTypeError.hxx>
#include <Standard_PCharacter.hxx>
@ -122,6 +120,7 @@ Storage_Error FSD_CmpFile::Open(const TCollection_AsciiString& aName,const Stora
}
else {
myStream.precision(17);
myStream.imbue (std::locale::classic()); // use always C locale
SetOpenMode(aMode);
}
}
@ -529,29 +528,9 @@ Storage_BaseDriver& FSD_CmpFile::PutBoolean(const Standard_Boolean aValue)
Storage_BaseDriver& FSD_CmpFile::PutReal(const Standard_Real aValue)
{
#ifdef BUC60808
char realbuffer[100];
Standard_PCharacter pChar;
//
pChar=realbuffer;
realbuffer[0] = '\0';
//
if (myRealConv.RealToCString(aValue,pChar)) {
myStream << realbuffer << " ";
}
else {
Storage_StreamWriteError::Raise();
}
if (myStream.bad()) Storage_StreamWriteError::Raise();
return *this;
#else
myStream << ((Standard_Real)aValue) << " ";
if (myStream.bad()) Storage_StreamWriteError::Raise();
return *this;
#endif
}
//=======================================================================
@ -561,28 +540,9 @@ Storage_BaseDriver& FSD_CmpFile::PutReal(const Standard_Real aValue)
Storage_BaseDriver& FSD_CmpFile::PutShortReal(const Standard_ShortReal aValue)
{
#ifdef BUC60808
char realbuffer[100];
Standard_PCharacter pStr;
//
pStr=realbuffer;
realbuffer[0] = '\0';
//
if (myRealConv.RealToCString(aValue,pStr)) {
myStream << realbuffer << " ";
}
else {
Storage_StreamWriteError::Raise();
}
if (myStream.bad()) Storage_StreamWriteError::Raise();
return *this;
#else
myStream << aValue << " ";
if (myStream.bad()) Storage_StreamWriteError::Raise();
return *this;
#endif
}
//=======================================================================
@ -669,10 +629,9 @@ Storage_BaseDriver& FSD_CmpFile::GetReal(Standard_Real& aValue)
cerr << "\t buffer is" << realbuffer<< endl;
Storage_StreamTypeMismatchError::Raise();
}
if (!myRealConv.CStringToReal(realbuffer,aValue)) {
if (!OSD::CStringToReal(realbuffer,aValue)) {
cerr << "%%%ERROR: read error of double at offset " << myStream.tellg() << endl;
cerr << "\t buffer is" << realbuffer<< endl;
//if (!OSD::CStringToReal(realbuffer,aValue))
Storage_StreamTypeMismatchError::Raise();
}
@ -697,8 +656,8 @@ Storage_BaseDriver& FSD_CmpFile::GetShortReal(Standard_ShortReal& aValue)
realbuffer[0] = '\0';
if (!(myStream >> realbuffer)) Storage_StreamTypeMismatchError::Raise();
// if (!OSD::CStringToReal(realbuffer,r))
if (!myRealConv.CStringToReal(realbuffer,r)) Storage_StreamTypeMismatchError::Raise();
if (!OSD::CStringToReal(realbuffer,r))
Storage_StreamTypeMismatchError::Raise();
aValue = (Standard_ShortReal)r;

View File

@ -91,6 +91,7 @@ Storage_Error FSD_File::Open(const TCollection_AsciiString& aName,const Storage_
}
else {
myStream.precision(17);
myStream.imbue (std::locale::classic()); // use always C locale
SetOpenMode(aMode);
}
}
@ -461,25 +462,9 @@ Storage_BaseDriver& FSD_File::PutBoolean(const Standard_Boolean aValue)
Storage_BaseDriver& FSD_File::PutReal(const Standard_Real aValue)
{
#ifdef USEOSDREAL
char realbuffer[100];
realbuffer[0] = '\0';
if (OSD::RealToCString(aValue,realbuffer)) {
myStream << realbuffer << " ";
}
else {
Storage_StreamWriteError::Raise();
}
if (myStream.bad()) Storage_StreamWriteError::Raise();
return *this;
#else
myStream << ((Standard_Real)aValue) << " ";
if (myStream.bad()) Storage_StreamWriteError::Raise();
return *this;
#endif
}
//=======================================================================
@ -489,25 +474,9 @@ Storage_BaseDriver& FSD_File::PutReal(const Standard_Real aValue)
Storage_BaseDriver& FSD_File::PutShortReal(const Standard_ShortReal aValue)
{
#ifdef USEOSDREAL
char realbuffer[100];
realbuffer[0] = '\0';
if (OSD::RealToCString(aValue,realbuffer)) {
myStream << realbuffer << " ";
}
else {
Storage_StreamWriteError::Raise();
}
if (myStream.bad()) Storage_StreamWriteError::Raise();
return *this;
#else
myStream << aValue << " ";
if (myStream.bad()) Storage_StreamWriteError::Raise();
return *this;
#endif
}
//=======================================================================

View File

@ -91,9 +91,9 @@ Handle(Geom2d_Curve) GeomProjLib::Curve2d(const Handle(Geom_Curve)& C,
//POP pour NT
// char name[100];
char* name = new char[100];
sprintf(name,"PROJCURV_%d",NBPROJ);
Sprintf(name,"PROJCURV_%d",NBPROJ);
DrawTrSurf::Set(name,C);
sprintf(name,"PROJSURF_%d",NBPROJ);
Sprintf(name,"PROJSURF_%d",NBPROJ);
DrawTrSurf::Set(name,S);
NBPROJ++;
}

View File

@ -55,7 +55,7 @@ static Standard_Integer proj (Draw_Interpretor& di, Standard_Integer n, const ch
{
if ( n < 4) return 1;
gp_Pnt2d P(atof(a[2]),atof(a[3]));
gp_Pnt2d P(Draw::Atof(a[2]),Draw::Atof(a[3]));
char name[100];
@ -72,7 +72,7 @@ static Standard_Integer proj (Draw_Interpretor& di, Standard_Integer n, const ch
Handle(Geom2d_Line) L = new Geom2d_Line(P,gp_Vec2d(P,P1));
Handle(Geom2d_TrimmedCurve) CT =
new Geom2d_TrimmedCurve(L, 0., P.Distance(P1));
sprintf(name,"%s%d","ext_",i);
Sprintf(name,"%s%d","ext_",i);
char* temp = name; // portage WNT
DrawTrSurf::Set(temp, CT);
di << name << " ";
@ -108,14 +108,14 @@ static Standard_Integer appro(Draw_Interpretor& di, Standard_Integer n, const ch
if (n < 3) {
if (n == 2)
Tol2d = atof(a[1]);
Tol2d = Draw::Atof(a[1]);
di << "Tolerance for 2d approx : "<< Tol2d << "\n";
return 0;
}
Standard_Integer i, Nb = atoi(a[2]);
Standard_Integer i, Nb = Draw::Atoi(a[2]);
Standard_Boolean hasPoints = Standard_True;
TColgp_Array1OfPnt2d Points(1, Nb);
@ -170,17 +170,17 @@ static Standard_Integer appro(Draw_Interpretor& di, Standard_Integer n, const ch
// points
nc = 3;
for (i = 1; i <= Nb; i++) {
Points(i).SetCoord(atof(a[nc]),atof(a[nc+1]));
Points(i).SetCoord(Draw::Atof(a[nc]),Draw::Atof(a[nc+1]));
nc += 2;
}
}
else if (nc - 2 == Nb) {
// YValues
nc = 5;
X0 = atof(a[3]);
DX = atof(a[4]);
X0 = Draw::Atof(a[3]);
DX = Draw::Atof(a[4]);
for (i = 1; i <= Nb; i++) {
YValues(i) = atof(a[nc]);
YValues(i) = Draw::Atof(a[nc]);
Points(i).SetCoord(X0+(i-1)*DX,YValues(i));
nc++;
}
@ -245,7 +245,7 @@ static Standard_Integer extrema(Draw_Interpretor& di, Standard_Integer n, const
Handle(Geom2d_Line) L = new Geom2d_Line(P1,gp_Vec2d(P1,P2));
Handle(Geom2d_TrimmedCurve) CT =
new Geom2d_TrimmedCurve(L, 0., P1.Distance(P2));
sprintf(name,"%s%d","ext_",i);
Sprintf(name,"%s%d","ext_",i);
char* temp = name; // portage WNT
DrawTrSurf::Set(temp, CT);
di << name << " ";

View File

@ -62,7 +62,7 @@ static Standard_Integer proj (Draw_Interpretor& di, Standard_Integer n, const ch
return 1;
}
gp_Pnt P(atof(a[2]),atof(a[3]),atof(a[4]));
gp_Pnt P(Draw::Atof(a[2]),Draw::Atof(a[3]),Draw::Atof(a[4]));
char name[100];
@ -87,13 +87,13 @@ static Standard_Integer proj (Draw_Interpretor& di, Standard_Integer n, const ch
Handle(Geom_Line) L = new Geom_Line(P,gp_Vec(P,P1));
Handle(Geom_TrimmedCurve) CT =
new Geom_TrimmedCurve(L, 0., P.Distance(P1));
sprintf(name,"%s%d","ext_",i);
Sprintf(name,"%s%d","ext_",i);
char* temp = name; // portage WNT
DrawTrSurf::Set(temp, CT);
di << name << " ";
}
else {
sprintf(name,"%s%d","ext_",i);
Sprintf(name,"%s%d","ext_",i);
di << name << " ";
char* temp = name; // portage WNT
DrawTrSurf::Set(temp, P1);
@ -117,13 +117,13 @@ static Standard_Integer proj (Draw_Interpretor& di, Standard_Integer n, const ch
Handle(Geom_Line) L = new Geom_Line(P,gp_Vec(P,P1));
Handle(Geom_TrimmedCurve) CT =
new Geom_TrimmedCurve(L, 0., P.Distance(P1));
sprintf(name,"%s%d","ext_",i);
Sprintf(name,"%s%d","ext_",i);
char* temp = name; // portage WNT
DrawTrSurf::Set(temp, CT);
di << name << " ";
}
else {
sprintf(name,"%s%d","ext_",i);
Sprintf(name,"%s%d","ext_",i);
char* temp = name; // portage WNT
DrawTrSurf::Set(temp, P1);
di << name << " ";
@ -146,7 +146,7 @@ static Standard_Integer appro(Draw_Interpretor& di, Standard_Integer n, const ch
if ( n<3) return 1;
Handle(Geom_Curve) GC;
Standard_Integer Nb = atoi(a[2]);
Standard_Integer Nb = Draw::Atoi(a[2]);
TColgp_Array1OfPnt Points(1, Nb);
@ -218,20 +218,20 @@ static Standard_Integer grilapp(Draw_Interpretor& di, Standard_Integer n, const
if ( n < 12) return 1;
Standard_Integer i,j;
Standard_Integer Nu = atoi(a[2]);
Standard_Integer Nv = atoi(a[3]);
Standard_Integer Nu = Draw::Atoi(a[2]);
Standard_Integer Nv = Draw::Atoi(a[3]);
TColStd_Array2OfReal ZPoints (1, Nu, 1, Nv);
Standard_Real X0 = atof(a[4]);
Standard_Real dX = atof(a[5]);
Standard_Real Y0 = atof(a[6]);
Standard_Real dY = atof(a[7]);
Standard_Real X0 = Draw::Atof(a[4]);
Standard_Real dX = Draw::Atof(a[5]);
Standard_Real Y0 = Draw::Atof(a[6]);
Standard_Real dY = Draw::Atof(a[7]);
Standard_Integer Count = 8;
for ( j = 1; j <= Nv; j++) {
for ( i = 1; i <= Nu; i++) {
if ( Count > n) return 1;
ZPoints(i,j) = atof(a[Count]);
ZPoints(i,j) = Draw::Atof(a[Count]);
Count++;
}
}
@ -255,8 +255,8 @@ static Standard_Integer surfapp(Draw_Interpretor& di, Standard_Integer n, const
if ( n < 5 ) return 1;
Standard_Integer i,j;
Standard_Integer Nu = atoi(a[2]);
Standard_Integer Nv = atoi(a[3]);
Standard_Integer Nu = Draw::Atoi(a[2]);
Standard_Integer Nv = Draw::Atoi(a[3]);
TColgp_Array2OfPnt Points (1, Nu, 1, Nv);
if ( n == 5) {
@ -278,7 +278,7 @@ static Standard_Integer surfapp(Draw_Interpretor& di, Standard_Integer n, const
for ( j = 1; j <= Nv; j++) {
for ( i = 1; i <= Nu; i++) {
if ( Count > n) return 1;
Points(i,j) = gp_Pnt(atof(a[Count]),atof(a[Count+1]),atof(a[Count+2]));
Points(i,j) = gp_Pnt(Draw::Atof(a[Count]),Draw::Atof(a[Count+1]),Draw::Atof(a[Count+2]));
Count += 3;
}
}
@ -287,7 +287,7 @@ static Standard_Integer surfapp(Draw_Interpretor& di, Standard_Integer n, const
Standard_Integer Count = 1;
for ( j = 1; j <= Nv; j++) {
for ( i = 1; i <= Nu; i++) {
sprintf(name,"point_%d",Count++);
Sprintf(name,"point_%d",Count++);
char* temp = name; // portage WNT
DrawTrSurf::Set(temp,Points(i,j));
}
@ -362,7 +362,7 @@ static Standard_Integer extrema(Draw_Interpretor& di, Standard_Integer n, const
Handle(Geom_Line) L = new Geom_Line(P1,gp_Vec(P1,P2));
Handle(Geom_TrimmedCurve) CT =
new Geom_TrimmedCurve(L, 0., P1.Distance(P2));
sprintf(name,"%s%d","ext_",i);
Sprintf(name,"%s%d","ext_",i);
char* temp = name; // portage WNT
DrawTrSurf::Set(temp, CT);
di << name << " ";
@ -381,7 +381,7 @@ static Standard_Integer extrema(Draw_Interpretor& di, Standard_Integer n, const
Handle(Geom_Line) L = new Geom_Line(P1,gp_Vec(P1,P2));
Handle(Geom_TrimmedCurve) CT =
new Geom_TrimmedCurve(L, 0., P1.Distance(P2));
sprintf(name,"%s%d","ext_",i);
Sprintf(name,"%s%d","ext_",i);
char* temp = name; // portage WNT
DrawTrSurf::Set(temp, CT);
di << name << " ";
@ -396,7 +396,7 @@ static Standard_Integer extrema(Draw_Interpretor& di, Standard_Integer n, const
Handle(Geom_Line) L = new Geom_Line(P1,gp_Vec(P1,P2));
Handle(Geom_TrimmedCurve) CT =
new Geom_TrimmedCurve(L, 0., P1.Distance(P2));
sprintf(name,"%s%d","ext_",i);
Sprintf(name,"%s%d","ext_",i);
char* temp = name; // portage WNT
DrawTrSurf::Set(temp, CT);
di << name << " ";
@ -411,7 +411,7 @@ static Standard_Integer extrema(Draw_Interpretor& di, Standard_Integer n, const
Handle(Geom_Line) L = new Geom_Line(P1,gp_Vec(P1,P2));
Handle(Geom_TrimmedCurve) CT =
new Geom_TrimmedCurve(L, 0., P1.Distance(P2));
sprintf(name,"%s%d","ext_",i);
Sprintf(name,"%s%d","ext_",i);
char* temp = name; // portage WNT
DrawTrSurf::Set(temp, CT);
di << name << " ";
@ -466,7 +466,7 @@ static Standard_Integer totalextcc(Draw_Interpretor& di, Standard_Integer n, con
Handle(Geom_Line) L = new Geom_Line(P1,gp_Vec(P1,P2));
Handle(Geom_TrimmedCurve) CT =
new Geom_TrimmedCurve(L, 0., P1.Distance(P2));
sprintf(name,"%s%d","ext_",1);
Sprintf(name,"%s%d","ext_",1);
char* temp = name; // portage WNT
DrawTrSurf::Set(temp, CT);
di << name << " ";

View File

@ -89,7 +89,7 @@ static Standard_Integer solutions(Draw_Interpretor& di,
if (ct3.IsDone()) {
for (Standard_Integer i = 1 ; i <= ct3.NbSolutions() ; i++) {
Handle(Geom2d_Circle) C = new Geom2d_Circle(ct3.ThisSolution(i));
sprintf(solname,"%s_%d",name,i);
Sprintf(solname,"%s_%d",name,i);
char* temp = solname; // pour portage WNT
DrawTrSurf::Set(temp,C);
di << solname << " ";
@ -113,7 +113,7 @@ static Standard_Integer solutions(Draw_Interpretor& di,
if (ct3.IsDone()) {
for (Standard_Integer i = 1 ; i <= ct3.NbSolutions() ; i++) {
Handle(Geom2d_Circle) C = new Geom2d_Circle(ct3.ThisSolution(i));
sprintf(solname,"%s_%d",name,i);
Sprintf(solname,"%s_%d",name,i);
char* temp = solname; // pour portage WNT
DrawTrSurf::Set(temp,C);
di << solname << " ";
@ -144,7 +144,7 @@ static Standard_Integer cirtang (Draw_Interpretor& di,Standard_Integer n, const
Standard_Boolean ip3 = DrawTrSurf::GetPoint2d(a[4],P3);
Standard_Real tol = Precision::Confusion();
if (n > 5) tol = atof(a[5]);
if (n > 5) tol = Draw::Atof(a[5]);
if (!C1.IsNull()) {
@ -173,7 +173,7 @@ static Standard_Integer cirtang (Draw_Interpretor& di,Standard_Integer n, const
// C-C-R
Geom2dGcc_Circ2d2TanRad ct3(Geom2dGcc::Unqualified(C1),
Geom2dGcc::Unqualified(C2),
atof(a[4]),tol);
Draw::Atof(a[4]),tol);
return solutions(di,ct3,a[1]);
}
}
@ -201,7 +201,7 @@ static Standard_Integer cirtang (Draw_Interpretor& di,Standard_Integer n, const
// C-P-R
Geom2dGcc_Circ2d2TanRad ct3(Geom2dGcc::Unqualified(C1),
new Geom2d_CartesianPoint(P2),
atof(a[4]),tol);
Draw::Atof(a[4]),tol);
return solutions(di,ct3,a[1]);
}
}
@ -212,7 +212,7 @@ static Standard_Integer cirtang (Draw_Interpretor& di,Standard_Integer n, const
// C-R-C
Geom2dGcc_Circ2d2TanRad ct3(Geom2dGcc::Unqualified(C1),
Geom2dGcc::Unqualified(C3),
atof(a[3]),
Draw::Atof(a[3]),
tol);
return solutions(di,ct3,a[1]);
}
@ -221,7 +221,7 @@ static Standard_Integer cirtang (Draw_Interpretor& di,Standard_Integer n, const
// C-R-P
Geom2dGcc_Circ2d2TanRad ct3(Geom2dGcc::Unqualified(C1),
new Geom2d_CartesianPoint(P3),
atof(a[3]),
Draw::Atof(a[3]),
tol);
return solutions(di,ct3,a[1]);
}
@ -260,7 +260,7 @@ static Standard_Integer cirtang (Draw_Interpretor& di,Standard_Integer n, const
// P-C-R
Geom2dGcc_Circ2d2TanRad ct3(Geom2dGcc::Unqualified(C2),
new Geom2d_CartesianPoint(P1),
atof(a[4]),tol);
Draw::Atof(a[4]),tol);
return solutions(di,ct3,a[1]);
}
}
@ -288,7 +288,7 @@ static Standard_Integer cirtang (Draw_Interpretor& di,Standard_Integer n, const
// P-P-R
Geom2dGcc_Circ2d2TanRad ct3(new Geom2d_CartesianPoint(P1),
new Geom2d_CartesianPoint(P2),
atof(a[4]),tol);
Draw::Atof(a[4]),tol);
return solutions(di,ct3,a[1]);
}
}
@ -299,7 +299,7 @@ static Standard_Integer cirtang (Draw_Interpretor& di,Standard_Integer n, const
// P-R-C
Geom2dGcc_Circ2d2TanRad ct3(Geom2dGcc::Unqualified(C3),
new Geom2d_CartesianPoint(P1),
atof(a[3]),
Draw::Atof(a[3]),
tol);
return solutions(di,ct3,a[1]);
}
@ -308,7 +308,7 @@ static Standard_Integer cirtang (Draw_Interpretor& di,Standard_Integer n, const
// P-R-P
Geom2dGcc_Circ2d2TanRad ct3(new Geom2d_CartesianPoint(P1),
new Geom2d_CartesianPoint(P3),
atof(a[3]),
Draw::Atof(a[3]),
tol);
return solutions(di,ct3,a[1]);
}
@ -329,7 +329,7 @@ static Standard_Integer cirtang (Draw_Interpretor& di,Standard_Integer n, const
// R-C-C
Geom2dGcc_Circ2d2TanRad ct3(Geom2dGcc::Unqualified(C2),
Geom2dGcc::Unqualified(C3),
atof(a[2]),
Draw::Atof(a[2]),
tol);
return solutions(di,ct3,a[1]);
}
@ -338,7 +338,7 @@ static Standard_Integer cirtang (Draw_Interpretor& di,Standard_Integer n, const
// R-C-P
Geom2dGcc_Circ2d2TanRad ct3(Geom2dGcc::Unqualified(C2),
new Geom2d_CartesianPoint(P3),
atof(a[2]),
Draw::Atof(a[2]),
tol);
return solutions(di,ct3,a[1]);
}
@ -355,7 +355,7 @@ static Standard_Integer cirtang (Draw_Interpretor& di,Standard_Integer n, const
// R-P-C
Geom2dGcc_Circ2d2TanRad ct3(Geom2dGcc::Unqualified(C3),
new Geom2d_CartesianPoint(P2),
atof(a[2]),
Draw::Atof(a[2]),
tol);
return solutions(di,ct3,a[1]);
}
@ -364,7 +364,7 @@ static Standard_Integer cirtang (Draw_Interpretor& di,Standard_Integer n, const
// R-P-P
Geom2dGcc_Circ2d2TanRad ct3(new Geom2d_CartesianPoint(P2),
new Geom2d_CartesianPoint(P3),
atof(a[2]),
Draw::Atof(a[2]),
tol);
return solutions(di,ct3,a[1]);
}
@ -411,7 +411,7 @@ static Standard_Integer lintang (Draw_Interpretor& di,Standard_Integer n, const
di << "Second argument must be a line";
return 1;
}
Standard_Real ang = atof(a[4]) * (M_PI / 180.0);
Standard_Real ang = Draw::Atof(a[4]) * (M_PI / 180.0);
Geom2dGcc_Lin2dTanObl ct3(Geom2dGcc::Unqualified(C1),
L->Lin2d(),
Precision::Angular(),
@ -420,7 +420,7 @@ static Standard_Integer lintang (Draw_Interpretor& di,Standard_Integer n, const
if (ct3.IsDone()) {
for (Standard_Integer i = 1 ; i <= ct3.NbSolutions() ; i++) {
Handle(Geom2d_Line) LS = new Geom2d_Line(ct3.ThisSolution(i));
sprintf(solname,"%s_%d",a[1],i);
Sprintf(solname,"%s_%d",a[1],i);
char* temp = solname; // pour portage WNT
DrawTrSurf::Set(temp,LS);
di << solname << " ";
@ -438,7 +438,7 @@ static Standard_Integer lintang (Draw_Interpretor& di,Standard_Integer n, const
if (ct3.IsDone()) {
for (Standard_Integer i = 1 ; i <= ct3.NbSolutions() ; i++) {
Handle(Geom2d_Line) LS = new Geom2d_Line(ct3.ThisSolution(i));
sprintf(solname,"%s_%d",a[1],i);
Sprintf(solname,"%s_%d",a[1],i);
char* temp = solname; // pour portage WNT
DrawTrSurf::Set(temp,LS);
di << solname << " ";
@ -684,7 +684,7 @@ static Standard_Integer tanginterpol (Draw_Interpretor& di,
periodic_flag = Standard_True ;
num_read += 1 ;
}
num_parameters = atoi(a[num_read]) ;
num_parameters = Draw::Atoi(a[num_read]) ;
if (num_parameters < 2) {
num_parameters = 2 ;
@ -703,7 +703,7 @@ static Standard_Integer tanginterpol (Draw_Interpretor& di,
num_read += 1 ;
while (num_read <= num_parameters * 3 + num_start ) {
for (jj = 1 ; jj <= 3 ; jj++) {
a_point.SetCoord(jj,atof(a[num_read])) ;
a_point.SetCoord(jj,Draw::Atof(a[num_read])) ;
num_read += 1 ;
}
PointsArrayPtr->SetValue(ii,a_point) ;
@ -728,7 +728,7 @@ static Standard_Integer tanginterpol (Draw_Interpretor& di,
ii = 1 ;
while (ii <= num_tangents) {
for (jj = 1 ; jj <= 3 ; jj++) {
a_vector.SetCoord(jj,atof(a[num_read])) ;
a_vector.SetCoord(jj,Draw::Atof(a[num_read])) ;
num_read += 1 ;
}
TangentsArray.SetValue(ii,a_vector) ;

View File

@ -82,12 +82,12 @@ static Standard_Integer surfaceCcontinuity (Draw_Interpretor& di, Standard_Integ
Handle(Geom_Surface) surf2 = DrawTrSurf::GetSurface(a[5]);
if (surf2.IsNull()) return 1;
U1 = atof(a[3]);
U2 = atof(a[6]);
V1 = atof(a[4]);
V2 = atof(a[7]);
U1 = Draw::Atof(a[3]);
U2 = Draw::Atof(a[6]);
V1 = Draw::Atof(a[4]);
V2 = Draw::Atof(a[7]);
ord = atoi(a[1]);
ord = Draw::Atoi(a[1]);
surf1->Bounds(u1, u2, v1, v2);
b1 = ((((U1>=u1)&&(U1<=u2))||((U1<=u1)&&(U1>=u2))));
@ -103,8 +103,8 @@ static Standard_Integer surfaceCcontinuity (Draw_Interpretor& di, Standard_Integ
switch ( ord )
{ case 0 : { TypeCont=GeomAbs_C0;
switch(n)
{ case 10 : epsC0= atof(a[9]);
case 9 : epsnl = atof(a[8]);
{ case 10 : epsC0= Draw::Atof(a[9]);
case 9 : epsnl = Draw::Atof(a[8]);
case 8 : {} break;
default : return 1;
}
@ -118,9 +118,9 @@ static Standard_Integer surfaceCcontinuity (Draw_Interpretor& di, Standard_Integ
break;
case 1 : { TypeCont=GeomAbs_C1;
switch(n)
{ case 11 : epsC1=atof(a[10]);
case 10 : epsC0= atof(a[9]);
case 9 : epsnl = atof(a[8]);
{ case 11 : epsC1=Draw::Atof(a[10]);
case 10 : epsC0= Draw::Atof(a[9]);
case 9 : epsnl = Draw::Atof(a[8]);
case 8 : {} break;
default : return 1;
}
@ -136,10 +136,10 @@ static Standard_Integer surfaceCcontinuity (Draw_Interpretor& di, Standard_Integ
case 2 : { TypeCont=GeomAbs_C2;
switch(n)
{
case 12 : epsC2= atof(a[11]);
case 11 : epsC1=atof(a[10]);
case 10 : epsC0= atof(a[9]);
case 9 : epsnl = atof(a[8]);
case 12 : epsC2= Draw::Atof(a[11]);
case 11 : epsC1=Draw::Atof(a[10]);
case 10 : epsC0= Draw::Atof(a[9]);
case 9 : epsnl = Draw::Atof(a[8]);
case 8 : {} break;
default : return 1;
}
@ -176,12 +176,12 @@ static Standard_Integer surfaceGcontinuity (Draw_Interpretor& di, Standard_Integ
Handle(Geom_Surface) surf2 = DrawTrSurf::GetSurface(a[5]);
if (surf2.IsNull()) return 1;
U1 = atof(a[3]);
U2 = atof(a[6]);
V1 = atof(a[4]);
V2 = atof(a[7]);
U1 = Draw::Atof(a[3]);
U2 = Draw::Atof(a[6]);
V1 = Draw::Atof(a[4]);
V2 = Draw::Atof(a[7]);
ord = atoi(a[1]);
ord = Draw::Atoi(a[1]);
surf1->Bounds(u1, u2, v1, v2);
b1 = ((((U1>=u1)&&(U1<=u2))||((U1<=u1)&&(U1>=u2))));
@ -198,9 +198,9 @@ static Standard_Integer surfaceGcontinuity (Draw_Interpretor& di, Standard_Integ
{
case 1 : { TypeCont=GeomAbs_G1;
switch(n)
{ case 11 : epsG1=atof(a[10]);
case 10 : epsC0= atof(a[9]);
case 9 : epsnl = atof(a[8]);
{ case 11 : epsG1=Draw::Atof(a[10]);
case 10 : epsC0= Draw::Atof(a[9]);
case 9 : epsnl = Draw::Atof(a[8]);
case 8 : {} break;
default : return 1;
}
@ -215,11 +215,11 @@ static Standard_Integer surfaceGcontinuity (Draw_Interpretor& di, Standard_Integ
break;
case 2 : { TypeCont=GeomAbs_G2;
switch(n)
{ case 13 : maxlen =atof (a[12]);
case 12 : perce=atof(a[11]);
case 11 : epsG1=atof(a[10]);
case 10 : epsC0= atof(a[9]);
case 9 : epsnl = atof(a[8]);
{ case 13 : maxlen =Draw::Atof (a[12]);
case 12 : perce=Draw::Atof(a[11]);
case 11 : epsG1=Draw::Atof(a[10]);
case 10 : epsC0= Draw::Atof(a[9]);
case 9 : epsnl = Draw::Atof(a[8]);
case 8 : {} break;
default : return 1;
}
@ -253,10 +253,10 @@ static Standard_Integer curveGcontinuity(Draw_Interpretor& di, Standard_Integer
Handle(Geom_Curve) curv2 = DrawTrSurf::GetCurve(a[4]);
if (curv2.IsNull()) return 1;
U1 = atof(a[3]);
U2 = atof(a[5]);
U1 = Draw::Atof(a[3]);
U2 = Draw::Atof(a[5]);
ord = atoi(a[1]);
ord = Draw::Atoi(a[1]);
u1=curv1->FirstParameter();
u2=curv1->LastParameter();
@ -273,9 +273,9 @@ static Standard_Integer curveGcontinuity(Draw_Interpretor& di, Standard_Integer
{
case 1 : {
switch(n)
{ case 9 : epsG1=atof(a[8]);
case 8 : epsC0= atof(a[7]);
case 7 : epsnl = atof(a[6]);
{ case 9 : epsG1=Draw::Atof(a[8]);
case 8 : epsC0= Draw::Atof(a[7]);
case 7 : epsnl = Draw::Atof(a[6]);
case 6 : {} break;
default : return 1;
}
@ -291,12 +291,12 @@ static Standard_Integer curveGcontinuity(Draw_Interpretor& di, Standard_Integer
case 2 : {
TypeCont=GeomAbs_G2;
switch(n)
{case 12 :maxlen =atof(a[11]);
case 11 :percent=atof(a[10]);
case 10 : epsG2= atof(a[9]);
case 9 : epsG1=atof(a[8]);
case 8 : epsC0= atof(a[7]);
case 7 : epsnl = atof(a[6]);
{case 12 :maxlen =Draw::Atof(a[11]);
case 11 :percent=Draw::Atof(a[10]);
case 10 : epsG2= Draw::Atof(a[9]);
case 9 : epsG1=Draw::Atof(a[8]);
case 8 : epsC0= Draw::Atof(a[7]);
case 7 : epsnl = Draw::Atof(a[6]);
case 6 : {} break;
default : return 1;
}
@ -328,10 +328,10 @@ static Standard_Integer curveCcontinuity(Draw_Interpretor& di, Standard_Integer
Handle(Geom_Curve) curv2 = DrawTrSurf::GetCurve(a[4]);
if (curv2.IsNull()) return 1;
U1 = atof(a[3]);
U2 = atof(a[5]);
U1 = Draw::Atof(a[3]);
U2 = Draw::Atof(a[5]);
ord = atoi(a[1]);
ord = Draw::Atoi(a[1]);
u1=curv1->FirstParameter();
u2=curv1->LastParameter();
@ -347,8 +347,8 @@ static Standard_Integer curveCcontinuity(Draw_Interpretor& di, Standard_Integer
InitEpsCurv( epsnl,epsC0, epsC1, epsC2, epsG1, epsG2, percent,maxlen);
switch ( ord )
{ case 0 : { switch(n)
{ case 8 : epsC0= atof(a[7]);
case 7 : epsnl = atof(a[6]);
{ case 8 : epsC0= Draw::Atof(a[7]);
case 7 : epsnl = Draw::Atof(a[6]);
case 6 : {} break;
default : return 1;
}
@ -362,9 +362,9 @@ static Standard_Integer curveCcontinuity(Draw_Interpretor& di, Standard_Integer
} break;
case 1 : { switch(n)
{ case 9 : epsC1 =atof(a[8]);
case 8 : epsC0= atof(a[7]);
case 7 : epsnl = atof(a[6]);
{ case 9 : epsC1 =Draw::Atof(a[8]);
case 8 : epsC0= Draw::Atof(a[7]);
case 7 : epsnl = Draw::Atof(a[6]);
case 6 : {} break;
default : return 1;
}
@ -380,10 +380,10 @@ static Standard_Integer curveCcontinuity(Draw_Interpretor& di, Standard_Integer
case 2 : { TypeCont=GeomAbs_C2;
switch(n)
{
case 10 : epsC2= atof(a[9]);
case 9 : epsC1=atof(a[8]);
case 8 : epsC0= atof(a[7]);
case 7 : epsnl = atof(a[6]);
case 10 : epsC2= Draw::Atof(a[9]);
case 9 : epsC1=Draw::Atof(a[8]);
case 8 : epsC0= Draw::Atof(a[7]);
case 7 : epsnl = Draw::Atof(a[6]);
case 6 : {} break;
default : return 1;
}

View File

@ -153,17 +153,17 @@ static Standard_Integer polelaw (Draw_Interpretor& , Standard_Integer n, const c
if (n < 3) return 1;
Standard_Boolean periodic = Standard_False ;
Standard_Integer deg = atoi(a[2]);
Standard_Integer nbk = atoi(a[3]);
Standard_Integer deg = Draw::Atoi(a[2]);
Standard_Integer nbk = Draw::Atoi(a[3]);
TColStd_Array1OfReal knots(1, nbk);
TColStd_Array1OfInteger mults(1, nbk);
k = 4;
Standard_Integer Sigma = 0;
for (i = 1; i<=nbk; i++) {
knots( i) = atof(a[k]);
knots( i) = Draw::Atof(a[k]);
k++;
mults( i) = atoi(a[k]);
mults( i) = Draw::Atoi(a[k]);
Sigma += mults(i);
k++;
}
@ -185,7 +185,7 @@ static Standard_Integer polelaw (Draw_Interpretor& , Standard_Integer n, const c
flat_knots,
schoenberg_points) ;
for (i = 1; i <= np; i++) {
poles(i).SetCoord(schoenberg_points(i),atof(a[k]));
poles(i).SetCoord(schoenberg_points(i),Draw::Atof(a[k]));
k++;
}
@ -270,9 +270,9 @@ static Standard_Integer gproject(Draw_Interpretor& di, Standard_Integer n, const
Standard_Integer ONE = 1;
if (n == 3)
sprintf(name,"p");
Sprintf(name,"p");
else if (n == 4) {
sprintf(name,"%s",a[1]);
Sprintf(name,"%s",a[1]);
ONE = 2;
}
else {
@ -306,8 +306,8 @@ static Standard_Integer gproject(Draw_Interpretor& di, Standard_Integer n, const
Handle(Geom2d_Curve) PCur2d; // Only for isoparametric projection
for(k = 1; k <= Projector.NbCurves(); k++){
sprintf(newname,"%s_%d",name,k);
sprintf(newname1,"%s2d_%d",name,k);
Sprintf(newname,"%s_%d",name,k);
Sprintf(newname1,"%s2d_%d",name,k);
if(Projector.IsSinglePnt(k, P2d)){
// cout<<"Part "<<k<<" of the projection is punctual"<<endl;
Projector.GetSurface()->D0(P2d.X(), P2d.Y(), P);
@ -430,7 +430,7 @@ static Standard_Integer project (Draw_Interpretor& di,
if ( a[index][0] != '-') return 1;
if ( a[index][1] == 'e') {
Standard_Real p = atof(a[index+1]);
Standard_Real p = Draw::Atof(a[index+1]);
Standard_Real dU = p * (U2 - U1) / 100.;
Standard_Real dV = p * (V2 - V1) / 100.;
U1 -= dU; U2 += dU; V1 -= dV; V2 += dV;
@ -438,10 +438,10 @@ static Standard_Integer project (Draw_Interpretor& di,
}
else if ( a[index][1] == 'v') {
Verif = Standard_True;
NbPoints = atoi(a[index+1]);
NbPoints = Draw::Atoi(a[index+1]);
}
else if ( a[index][1] == 't') {
tolerance = atof(a[index+1]);
tolerance = Draw::Atof(a[index+1]);
}
index += 2;
}
@ -507,13 +507,13 @@ Standard_Integer projonplane(Draw_Interpretor& di,
if ( C.IsNull()) return 1;
Standard_Boolean Param = Standard_True;
if ((n == 5 && atoi(a[4]) == 0) ||
(n == 8 && atoi(a[7]) == 0)) Param = Standard_False;
if ((n == 5 && Draw::Atoi(a[4]) == 0) ||
(n == 8 && Draw::Atoi(a[7]) == 0)) Param = Standard_False;
gp_Dir D;
if ( n == 8) {
D = gp_Dir(atof(a[4]),atof(a[5]),atof(a[6]));
D = gp_Dir(Draw::Atof(a[4]),Draw::Atof(a[5]),Draw::Atof(a[6]));
}
else {
D = Pl->Pln().Position().Direction();
@ -539,9 +539,9 @@ static void solution(const Handle(GccInt_Bisec)& Bis,
{
char solname[200];
if ( i == 0)
sprintf(solname,"%s",name);
Sprintf(solname,"%s",name);
else
sprintf(solname,"%s_%d",name,i);
Sprintf(solname,"%s_%d",name,i);
const char* temp = solname; // pour portage WNT
switch ( Bis->ArcType()) {
@ -591,7 +591,7 @@ static Standard_Integer bisec (Draw_Interpretor& di,
char solname[200];
NbSol = Bis.NbSolutions();
for ( i = 1; i <= NbSol; i++) {
sprintf(solname,"%s_%d",a[1],i);
Sprintf(solname,"%s_%d",a[1],i);
const char* temp = solname; // pour portage WNT
DrawTrSurf::Set(temp,new Geom2d_Line(Bis.ThisSolution(i)));
}
@ -775,8 +775,8 @@ static Standard_Integer movelaw (Draw_Interpretor& di, Standard_Integer n, const
tolerance,
tx ;
u = atof(a[2]);
x = atof(a[3]);
u = Draw::Atof(a[2]);
x = Draw::Atof(a[3]);
tolerance = 1.0e-5 ;
dimension = 2 ;
if (n < 5) {
@ -784,9 +784,9 @@ static Standard_Integer movelaw (Draw_Interpretor& di, Standard_Integer n, const
}
Handle(Geom2d_BSplineCurve) G2 = DrawTrSurf::GetBSplineCurve2d(a[1]);
if (!G2.IsNull()) {
tx = atof(a[4]) ;
tx = Draw::Atof(a[4]) ;
if (n == 6) {
condition = Max(atoi(a[5]), -1) ;
condition = Max(Draw::Atoi(a[5]), -1) ;
condition = Min(condition, G2->Degree()-1) ;
}
TColgp_Array1OfPnt2d curve_poles(1,G2->NbPoles()) ;
@ -891,7 +891,7 @@ static Standard_Integer crvpoints (Draw_Interpretor& di, Standard_Integer /*n*/,
Standard_Real defl;
Handle(Geom_Curve) C = DrawTrSurf::GetCurve(a[2]);
defl = atof(a[3]);
defl = Draw::Atof(a[3]);
GeomAdaptor_Curve GAC(C);
GCPnts_QuasiUniformDeflection PntGen(GAC, defl);
@ -948,10 +948,10 @@ static Standard_Integer crvtpoints (Draw_Interpretor& di, Standard_Integer n, co
Standard_Real defl, angle = Precision::Angular();
Handle(Geom_Curve) C = DrawTrSurf::GetCurve(a[2]);
defl = atof(a[3]);
defl = Draw::Atof(a[3]);
if(n > 3)
angle = atof(a[4]);
angle = Draw::Atof(a[4]);
GeomAdaptor_Curve GAC(C);
GCPnts_TangentialDeflection PntGen(GAC, angle, defl, 2);
@ -1017,7 +1017,7 @@ static Standard_Integer uniformAbscissa (Draw_Interpretor& di, Standard_Integer
}
Standard_Integer nocp;
nocp = atoi(a[2]);
nocp = Draw::Atoi(a[2]);
if(nocp < 2)
return 1;
@ -1065,12 +1065,12 @@ static Standard_Integer EllipsUniformAbscissa (Draw_Interpretor& di, Standard_In
return 1;
Standard_Real R1;
R1 = atof(a[1]);
R1 = Draw::Atof(a[1]);
Standard_Real R2;
R2 = atof(a[2]);
R2 = Draw::Atof(a[2]);
Standard_Integer nocp;
nocp = atoi(a[3]);
nocp = Draw::Atoi(a[3]);
if(nocp < 2)
return 1;
@ -1143,7 +1143,7 @@ static Standard_Integer mypoints (Draw_Interpretor& di, Standard_Integer /*n*/,
Standard_Real defl;
Handle(Geom_Curve) C = DrawTrSurf::GetCurve(a[2]);
defl = atof(a[3]);
defl = Draw::Atof(a[3]);
const Handle(Geom_BSplineCurve)& aBS = Handle(Geom_BSplineCurve)::DownCast(C);
if(aBS.IsNull()) return 1;
@ -1271,7 +1271,7 @@ static Standard_Integer surfpoints (Draw_Interpretor& /*di*/, Standard_Integer /
Standard_Real defl;
Handle(Geom_Surface) S = DrawTrSurf::GetSurface(a[2]);
defl = atof(a[3]);
defl = Draw::Atof(a[3]);
Handle(GeomAdaptor_HSurface) AS = new GeomAdaptor_HSurface(S);
@ -1348,7 +1348,7 @@ static Standard_Integer intersection (Draw_Interpretor& di, Standard_Integer n,
}
//
Standard_Real tol = Precision::Confusion();
if (n == 5 || n == 9 || n == 13 || n == 17) tol = atof(a[n-1]);
if (n == 5 || n == 9 || n == 13 || n == 17) tol = Draw::Atof(a[n-1]);
//
Handle(Geom_Curve) Result;
gp_Pnt Point;
@ -1381,11 +1381,11 @@ static Standard_Integer intersection (Draw_Interpretor& di, Standard_Integer n,
}
if (useStart)
for (Standard_Integer i=ista1; i <= ista2; i++)
UVsta[i-ista1] = atof(a[i]);
UVsta[i-ista1] = Draw::Atof(a[i]);
if (useBnd) {
Standard_Real UVbnd[8];
for (Standard_Integer i=ibnd1; i <= ibnd2; i++)
UVbnd[i-ibnd1] = atof(a[i]);
UVbnd[i-ibnd1] = Draw::Atof(a[i]);
AS1 = new GeomAdaptor_HSurface(GS1,UVbnd[0],UVbnd[1],UVbnd[2],UVbnd[3]);
AS2 = new GeomAdaptor_HSurface(GS2,UVbnd[4],UVbnd[5],UVbnd[6],UVbnd[7]);
}
@ -1415,7 +1415,7 @@ static Standard_Integer intersection (Draw_Interpretor& di, Standard_Integer n,
aNbLines = Inters.NbLines();
if (aNbLines >= 2) {
for (i=1; i<=aNbLines; ++i) {
sprintf(buf, "%s_%d",a[1],i);
Sprintf(buf, "%s_%d",a[1],i);
Result = Inters.Line(i);
const char* temp = buf;
DrawTrSurf::Set(temp,Result);
@ -1429,7 +1429,7 @@ static Standard_Integer intersection (Draw_Interpretor& di, Standard_Integer n,
aNbPoints=Inters.NbPoints();
for (i=1; i<=aNbPoints; ++i) {
Point=Inters.Point(i);
sprintf(buf,"%s_p_%d",a[1],i);
Sprintf(buf,"%s_p_%d",a[1],i);
const char* temp =buf;
DrawTrSurf::Set(temp, Point);
}
@ -1448,13 +1448,13 @@ static Standard_Integer intersection (Draw_Interpretor& di, Standard_Integer n,
Standard_Integer i;
Standard_Integer Compt = 1;
for (i = 1; i <= nblines; i++, Compt++) {
sprintf(newname,"%s_%d",a[1],Compt);
Sprintf(newname,"%s_%d",a[1],Compt);
Result = Inters.Segment(i);
const char* temp = newname; // pour portage WNT
DrawTrSurf::Set(temp,Result);
}
for (i = 1; i <= nbpoints; i++, Compt++) {
sprintf(newname,"%s_%d",a[1],i);
Sprintf(newname,"%s_%d",a[1],i);
Point = Inters.Point(i);
const char* temp = newname; // pour portage WNT
DrawTrSurf::Set(temp,Point);

View File

@ -64,9 +64,9 @@ BattenCurve(Draw_Interpretor& di, Standard_Integer argc, const char** argv)
Standard_Boolean Ok;
FairCurve_AnalysisCode Iana;
Standard_Real a1 = atof(cangle1),
a2 = atof(cangle2),
h = atof(cheigth);
Standard_Real a1 = Draw::Atof(cangle1),
a2 = Draw::Atof(cangle2),
h = Draw::Atof(cheigth);
gp_Pnt2d P1, P2;
@ -108,9 +108,9 @@ MVCurve(Draw_Interpretor& di, Standard_Integer argc, const char** argv)
Standard_Boolean Ok;
FairCurve_AnalysisCode Iana;
Standard_Real a1 = atof(cangle1),
a2 = atof(cangle2),
h = atof(cheigth);
Standard_Real a1 = Draw::Atof(cangle1),
a2 = Draw::Atof(cangle2),
h = Draw::Atof(cheigth);
gp_Pnt2d P1, P2;
@ -146,7 +146,7 @@ SetPoint(Draw_Interpretor& di, Standard_Integer argc, const char** argv)
const char *PointName = argv[2];
const char *BattenName = argv[3];
Standard_Integer cote = atoi(side);
Standard_Integer cote = Draw::Atoi(side);
Handle(DrawTrSurf_Point)
Pnt = Handle(DrawTrSurf_Point)::DownCast(Draw::Get(PointName));
@ -173,8 +173,8 @@ SetAngle(Draw_Interpretor& di, Standard_Integer argc, const char** argv)
const char *val = argv[2];
const char *BattenName = argv[3];
Standard_Real angle = atof(val);
Standard_Integer cote = atoi(side);
Standard_Real angle = Draw::Atof(val);
Standard_Integer cote = Draw::Atoi(side);
Handle(DrawFairCurve_Batten)
Bat = Handle(DrawFairCurve_Batten)::DownCast(Draw::Get(BattenName));
@ -197,8 +197,8 @@ SetCurvature(Draw_Interpretor& di, Standard_Integer argc, const char** argv)
const char *val = argv[2];
const char *MVCName = argv[3];
Standard_Real rho = atof(val);
Standard_Integer cote = atoi(side);
Standard_Real rho = Draw::Atof(val);
Standard_Integer cote = Draw::Atoi(side);
Handle(DrawFairCurve_MinimalVariation)
MVC = Handle(DrawFairCurve_MinimalVariation)::DownCast(Draw::Get(MVCName));
@ -221,7 +221,7 @@ SetSlide(Draw_Interpretor& di, Standard_Integer argc, const char** argv)
const char *val = argv[1];
const char *BattenName = argv[2];
Standard_Real slide = atof(val);
Standard_Real slide = Draw::Atof(val);
Handle(DrawFairCurve_Batten)
Bat = Handle(DrawFairCurve_Batten)::DownCast(Draw::Get(BattenName));
@ -243,7 +243,7 @@ FreeAngle(Draw_Interpretor& di, Standard_Integer argc, const char** argv)
const char *side = argv[1];
const char *BattenName = argv[2];
Standard_Integer cote = atoi(side);
Standard_Integer cote = Draw::Atoi(side);
Handle(DrawFairCurve_Batten)
Bat = Handle(DrawFairCurve_Batten)::DownCast(Draw::Get(BattenName));
@ -264,7 +264,7 @@ FreeCurvature(Draw_Interpretor& di, Standard_Integer argc, const char** argv)
const char *side = argv[1];
const char *MVCName = argv[2];
Standard_Integer cote = atoi(side);
Standard_Integer cote = Draw::Atoi(side);
Handle(DrawFairCurve_MinimalVariation)
MVC = Handle(DrawFairCurve_MinimalVariation)::DownCast(Draw::Get(MVCName));
@ -303,7 +303,7 @@ SetHeight(Draw_Interpretor& di, Standard_Integer argc, const char** argv)
const char *val = argv[1];
const char *BattenName = argv[2];
Standard_Real Height = atof(val);
Standard_Real Height = Draw::Atof(val);
Handle(DrawFairCurve_Batten)
Bat = Handle(DrawFairCurve_Batten)::DownCast(Draw::Get(BattenName));
@ -324,7 +324,7 @@ SetSlope(Draw_Interpretor& di, Standard_Integer argc, const char** argv)
const char *val = argv[1];
const char *BattenName = argv[2];
Standard_Real Slope = atof(val);
Standard_Real Slope = Draw::Atof(val);
Handle(DrawFairCurve_Batten)
Bat = Handle(DrawFairCurve_Batten)::DownCast(Draw::Get(BattenName));
@ -344,7 +344,7 @@ SetPhysicalRatio(Draw_Interpretor& di, Standard_Integer argc, const char** argv)
const char *val = argv[1];
const char *MVCName = argv[2];
Standard_Real ratio = atof(val);
Standard_Real ratio = Draw::Atof(val);
Handle(DrawFairCurve_MinimalVariation)
MVC = Handle(DrawFairCurve_MinimalVariation)::DownCast(Draw::Get(MVCName));

View File

@ -48,8 +48,8 @@ static Standard_Integer polytr(Draw_Interpretor& di, Standard_Integer n, const c
if (n < 4)
return 1;
Standard_Integer nbNodes = atoi(a[2]);
Standard_Integer nbTri = atoi(a[3]);
Standard_Integer nbNodes = Draw::Atoi(a[2]);
Standard_Integer nbTri = Draw::Atoi(a[3]);
// read the nodes
Standard_Integer i, j = 4;
@ -60,7 +60,7 @@ static Standard_Integer polytr(Draw_Interpretor& di, Standard_Integer n, const c
di << "Not enough nodes";
return 1;
}
Nodes(i).SetCoord(atof(a[j]),atof(a[j+1]),atof(a[j+2]));
Nodes(i).SetCoord(Draw::Atof(a[j]),Draw::Atof(a[j+1]),Draw::Atof(a[j+2]));
j += 3;
}
@ -72,7 +72,7 @@ static Standard_Integer polytr(Draw_Interpretor& di, Standard_Integer n, const c
di << "Not enough triangles";
return 1;
}
Triangles(i).Set(atoi(a[j]),atoi(a[j+1]),atoi(a[j+2]));
Triangles(i).Set(Draw::Atoi(a[j]),Draw::Atoi(a[j+1]),Draw::Atoi(a[j+2]));
j += 3;
}
@ -94,7 +94,7 @@ static Standard_Integer polygon3d(Draw_Interpretor& di, Standard_Integer n, cons
if (n < 4)
return 1;
Standard_Integer nbNodes = atoi(a[2]);
Standard_Integer nbNodes = Draw::Atoi(a[2]);
// read the nodes
Standard_Integer i, j = 3;
@ -105,7 +105,7 @@ static Standard_Integer polygon3d(Draw_Interpretor& di, Standard_Integer n, cons
di << "Not enough nodes";
return 1;
}
Nodes(i).SetCoord(atof(a[j]),atof(a[j+1]),atof(a[j+2]));
Nodes(i).SetCoord(Draw::Atof(a[j]),Draw::Atof(a[j+1]),Draw::Atof(a[j+2]));
j += 3;
}
@ -126,7 +126,7 @@ static Standard_Integer polygon2d(Draw_Interpretor& di, Standard_Integer n, cons
if (n < 4)
return 1;
Standard_Integer nbNodes = atoi(a[2]);
Standard_Integer nbNodes = Draw::Atoi(a[2]);
// read the nodes
Standard_Integer i, j = 3;
@ -137,7 +137,7 @@ static Standard_Integer polygon2d(Draw_Interpretor& di, Standard_Integer n, cons
di << "Not enough nodes";
return 1;
}
Nodes(i).SetCoord(atof(a[j]),atof(a[j+1]));
Nodes(i).SetCoord(Draw::Atof(a[j]),Draw::Atof(a[j+1]));
j += 2;
}

View File

@ -130,7 +130,7 @@ static Standard_Integer sweep (Draw_Interpretor&,
Pipe.Init(path, Support, firstS);
}
else if (Option == GeomFill_IsConstantNormal) {
gp_Dir D ( atof(a[3]), atof(a[4]), atof(a[5]) );
gp_Dir D ( Draw::Atof(a[3]), Draw::Atof(a[4]), Draw::Atof(a[5]) );
Handle(Geom_Curve) path = DrawTrSurf::GetCurve(a[6]);
Handle(Geom_Curve) firstS = DrawTrSurf::GetCurve(a[7]);
Pipe.Init(path, firstS, D);
@ -146,8 +146,8 @@ static Standard_Integer sweep (Draw_Interpretor&,
}
if (n >=isection+2) {
MaxDegree = atoi(a[isection+1]);
if (n >isection+2) NbSeg = atoi(a[isection+2]);
MaxDegree = Draw::Atoi(a[isection+1]);
if (n >isection+2) NbSeg = Draw::Atoi(a[isection+2]);
}
Pipe.Perform(Tol, Standard_False, GeomAbs_C2, MaxDegree, NbSeg);
@ -188,7 +188,7 @@ static Standard_Integer tuyau (Draw_Interpretor&,
if ( firstS.IsNull()) {
if ( narg == 4) {
// tuyau a rayon constant.
Pipe.Init(path, atof(a[isect]));
Pipe.Init(path, Draw::Atof(a[isect]));
}
else
return 1;
@ -321,7 +321,7 @@ static Standard_Integer fillcurves(Draw_Interpretor& di,
Standard_Integer ist = 2;
GeomFill_FillingStyle Style = GeomFill_CoonsStyle;
if(n > 6) ist = atoi(a[6]);
if(n > 6) ist = Draw::Atoi(a[6]);
if(ist == 1) Style = GeomFill_StretchStyle;
if(ist == 2) Style = GeomFill_CoonsStyle;

View File

@ -70,12 +70,12 @@ static Standard_Integer xdistcs(Draw_Interpretor& , Standard_Integer n, const ch
return 0;
}
//
aT1=atof(a[3]);
aT2=atof(a[4]);
aT1=Draw::Atof(a[3]);
aT2=Draw::Atof(a[4]);
//
aNbP=10;
if (n>5) {
aNbP=atoi(a[5]);
aNbP=Draw::Atoi(a[5]);
}
//
iSize=3;

View File

@ -57,7 +57,7 @@ static Standard_Integer proj (Draw_Interpretor& di, Standard_Integer n, const ch
{
if ( n < 4) return 1;
gp_Pnt2d P(atof(a[2]),atof(a[3]));
gp_Pnt2d P(Draw::Atof(a[2]),Draw::Atof(a[3]));
char name[100];
@ -74,7 +74,7 @@ static Standard_Integer proj (Draw_Interpretor& di, Standard_Integer n, const ch
Handle(Geom2d_Line) L = new Geom2d_Line(P,gp_Vec2d(P,P1));
Handle(Geom2d_TrimmedCurve) CT =
new Geom2d_TrimmedCurve(L, 0., P.Distance(P1));
sprintf(name,"%s%d","ext_",i);
Sprintf(name,"%s%d","ext_",i);
char* temp = name; // portage WNT
DrawTrSurf::Set(temp, CT);
di << name << " ";
@ -110,14 +110,14 @@ static Standard_Integer appro(Draw_Interpretor& di, Standard_Integer n, const ch
if (n < 3) {
if (n == 2)
Tol2d = atof(a[1]);
Tol2d = Draw::Atof(a[1]);
di << "Tolerance for 2d approx : "<< Tol2d << "\n";
return 0;
}
Standard_Integer i, Nb = atoi(a[2]);
Standard_Integer i, Nb = Draw::Atoi(a[2]);
Standard_Boolean hasPoints = Standard_True;
TColgp_Array1OfPnt2d Points(1, Nb);
@ -172,17 +172,17 @@ static Standard_Integer appro(Draw_Interpretor& di, Standard_Integer n, const ch
// points
nc = 3;
for (i = 1; i <= Nb; i++) {
Points(i).SetCoord(atof(a[nc]),atof(a[nc+1]));
Points(i).SetCoord(Draw::Atof(a[nc]),Draw::Atof(a[nc+1]));
nc += 2;
}
}
else if (nc - 2 == Nb) {
// YValues
nc = 5;
X0 = atof(a[3]);
DX = atof(a[4]);
X0 = Draw::Atof(a[3]);
DX = Draw::Atof(a[4]);
for (i = 1; i <= Nb; i++) {
YValues(i) = atof(a[nc]);
YValues(i) = Draw::Atof(a[nc]);
Points(i).SetCoord(X0+(i-1)*DX,YValues(i));
nc++;
}
@ -260,7 +260,7 @@ static Standard_Integer extrema(Draw_Interpretor& di, Standard_Integer n, const
Handle(Geom2d_Line) L = new Geom2d_Line(P1,gp_Vec2d(P1,P2));
Handle(Geom2d_TrimmedCurve) CT =
new Geom2d_TrimmedCurve(L, 0., P1.Distance(P2));
sprintf(name,"%s%d","ext_",i);
Sprintf(name,"%s%d","ext_",i);
char* temp = name; // portage WNT
DrawTrSurf::Set(temp, CT);
di << name << " ";
@ -300,7 +300,7 @@ static Standard_Integer intersect(Draw_Interpretor& di, Standard_Integer n, cons
return 1;
}
if(k < n)
Tol = atof(a[k]);
Tol = Draw::Atof(a[k]);
if(!C2.IsNull())
{

View File

@ -356,7 +356,7 @@ static Standard_Integer smoothing (Draw_Interpretor& di,Standard_Integer n, cons
return 0;
}
if (n == 3) {
Tolerance = atof(a[2]);
Tolerance = Draw::Atof(a[2]);
if (Abs(Tolerance) < Precision::Confusion()*1.e-7) {
Constraint = AppParCurves_PassPoint;
}
@ -368,7 +368,7 @@ static Standard_Integer smoothing (Draw_Interpretor& di,Standard_Integer n, cons
}
else if (n >= 4) {
Standard_Integer ific = 3;
Tolerance = atof(a[2]);
Tolerance = Draw::Atof(a[2]);
if (Abs(Tolerance) < Precision::Confusion()*1.e-7) {
Constraint = AppParCurves_PassPoint;
}
@ -377,7 +377,7 @@ static Standard_Integer smoothing (Draw_Interpretor& di,Standard_Integer n, cons
}
if (! strcmp(a[3],"-D")) {
DegMax = atoi(a[4]);
DegMax = Draw::Atoi(a[4]);
ific = 5;
}
@ -536,8 +536,8 @@ static Standard_Integer smoothingbybezier (Draw_Interpretor& di,
return 0;
}
if (n >= 5) {
Tolerance = atof(a[2]);
Degree = atoi(a[3]);
Tolerance = Draw::Atof(a[2]);
Degree = Draw::Atoi(a[3]);
if (! strcmp(a[4],"-GR")) {
methode = 1;
}

View File

@ -129,11 +129,11 @@ static Standard_Integer anacurve (Draw_Interpretor& , Standard_Integer n, const
if (!strcmp(a[0],"line")) {
if (n == 6)
result2d = new Geom2d_Line(gp_Pnt2d(atof(a[2]),atof(a[3])),
gp_Dir2d(atof(a[4]),atof(a[5])));
result2d = new Geom2d_Line(gp_Pnt2d(Draw::Atof(a[2]),Draw::Atof(a[3])),
gp_Dir2d(Draw::Atof(a[4]),Draw::Atof(a[5])));
else if (n == 8)
result = new Geom_Line(gp_Pnt(atof(a[2]),atof(a[3]),atof(a[4])),
gp_Dir(atof(a[5]),atof(a[6]),atof(a[7])));
result = new Geom_Line(gp_Pnt(Draw::Atof(a[2]),Draw::Atof(a[3]),Draw::Atof(a[4])),
gp_Dir(Draw::Atof(a[5]),Draw::Atof(a[6]),Draw::Atof(a[7])));
else
return 1;
}
@ -141,30 +141,30 @@ static Standard_Integer anacurve (Draw_Interpretor& , Standard_Integer n, const
else if (!strcmp(a[0],"circle")) {
if (n == 5)
result2d =
new Geom2d_Circle(gp_Ax22d(gp_Pnt2d(atof(a[2]),atof(a[3])),
new Geom2d_Circle(gp_Ax22d(gp_Pnt2d(Draw::Atof(a[2]),Draw::Atof(a[3])),
gp_Dir2d(1,0)),
atof(a[4]));
Draw::Atof(a[4]));
else if (n == 6)
result =
new Geom_Circle(gp_Ax2(gp_Pnt(atof(a[2]),atof(a[3]),atof(a[4])),
new Geom_Circle(gp_Ax2(gp_Pnt(Draw::Atof(a[2]),Draw::Atof(a[3]),Draw::Atof(a[4])),
gp_Dir(0,0,1)),
atof(a[5]));
Draw::Atof(a[5]));
else if (n == 7)
result2d =
new Geom2d_Circle(gp_Ax22d(gp_Pnt2d(atof(a[2]),atof(a[3])),
gp_Dir2d(atof(a[4]),atof(a[5]))),
atof(a[6]));
new Geom2d_Circle(gp_Ax22d(gp_Pnt2d(Draw::Atof(a[2]),Draw::Atof(a[3])),
gp_Dir2d(Draw::Atof(a[4]),Draw::Atof(a[5]))),
Draw::Atof(a[6]));
else if (n == 9)
result =
new Geom_Circle(gp_Ax2(gp_Pnt(atof(a[2]),atof(a[3]),atof(a[4])),
gp_Dir(atof(a[5]),atof(a[6]),atof(a[7]))),
atof(a[8]));
new Geom_Circle(gp_Ax2(gp_Pnt(Draw::Atof(a[2]),Draw::Atof(a[3]),Draw::Atof(a[4])),
gp_Dir(Draw::Atof(a[5]),Draw::Atof(a[6]),Draw::Atof(a[7]))),
Draw::Atof(a[8]));
else if (n == 12)
result =
new Geom_Circle(gp_Ax2(gp_Pnt(atof(a[2]),atof(a[3]),atof(a[4])),
gp_Dir(atof(a[5]),atof(a[6]),atof(a[7])),
gp_Dir(atof(a[8]),atof(a[9]),atof(a[10]))),
atof(a[11]));
new Geom_Circle(gp_Ax2(gp_Pnt(Draw::Atof(a[2]),Draw::Atof(a[3]),Draw::Atof(a[4])),
gp_Dir(Draw::Atof(a[5]),Draw::Atof(a[6]),Draw::Atof(a[7])),
gp_Dir(Draw::Atof(a[8]),Draw::Atof(a[9]),Draw::Atof(a[10]))),
Draw::Atof(a[11]));
else
return 1;
}
@ -172,30 +172,30 @@ static Standard_Integer anacurve (Draw_Interpretor& , Standard_Integer n, const
else if (!strcmp(a[0],"parabola")) {
if (n == 5)
result2d =
new Geom2d_Parabola(gp_Ax22d(gp_Pnt2d(atof(a[2]),atof(a[3])),
new Geom2d_Parabola(gp_Ax22d(gp_Pnt2d(Draw::Atof(a[2]),Draw::Atof(a[3])),
gp_Dir2d(1,0)),
atof(a[4]));
Draw::Atof(a[4]));
else if (n == 6)
result =
new Geom_Parabola(gp_Ax2(gp_Pnt(atof(a[2]),atof(a[3]),atof(a[4])),
new Geom_Parabola(gp_Ax2(gp_Pnt(Draw::Atof(a[2]),Draw::Atof(a[3]),Draw::Atof(a[4])),
gp_Dir(0,0,1)),
atof(a[5]));
Draw::Atof(a[5]));
else if (n == 7)
result2d =
new Geom2d_Parabola(gp_Ax22d(gp_Pnt2d(atof(a[2]),atof(a[3])),
gp_Dir2d(atof(a[4]),atof(a[5]))),
atof(a[6]));
new Geom2d_Parabola(gp_Ax22d(gp_Pnt2d(Draw::Atof(a[2]),Draw::Atof(a[3])),
gp_Dir2d(Draw::Atof(a[4]),Draw::Atof(a[5]))),
Draw::Atof(a[6]));
else if (n == 9)
result =
new Geom_Parabola(gp_Ax2(gp_Pnt(atof(a[2]),atof(a[3]),atof(a[4])),
gp_Dir(atof(a[5]),atof(a[6]),atof(a[7]))),
atof(a[8]));
new Geom_Parabola(gp_Ax2(gp_Pnt(Draw::Atof(a[2]),Draw::Atof(a[3]),Draw::Atof(a[4])),
gp_Dir(Draw::Atof(a[5]),Draw::Atof(a[6]),Draw::Atof(a[7]))),
Draw::Atof(a[8]));
else if (n == 12)
result =
new Geom_Parabola(gp_Ax2(gp_Pnt(atof(a[2]),atof(a[3]),atof(a[4])),
gp_Dir(atof(a[5]),atof(a[6]),atof(a[7])),
gp_Dir(atof(a[8]),atof(a[9]),atof(a[10]))),
atof(a[11]));
new Geom_Parabola(gp_Ax2(gp_Pnt(Draw::Atof(a[2]),Draw::Atof(a[3]),Draw::Atof(a[4])),
gp_Dir(Draw::Atof(a[5]),Draw::Atof(a[6]),Draw::Atof(a[7])),
gp_Dir(Draw::Atof(a[8]),Draw::Atof(a[9]),Draw::Atof(a[10]))),
Draw::Atof(a[11]));
else
return 1;
}
@ -203,30 +203,30 @@ static Standard_Integer anacurve (Draw_Interpretor& , Standard_Integer n, const
else if (!strcmp(a[0],"ellipse")) {
if (n == 6)
result2d =
new Geom2d_Ellipse(gp_Ax22d(gp_Pnt2d(atof(a[2]),atof(a[3])),
new Geom2d_Ellipse(gp_Ax22d(gp_Pnt2d(Draw::Atof(a[2]),Draw::Atof(a[3])),
gp_Dir2d(1,0)),
atof(a[4]),atof(a[5]));
Draw::Atof(a[4]),Draw::Atof(a[5]));
else if (n == 7)
result =
new Geom_Ellipse(gp_Ax2(gp_Pnt(atof(a[2]),atof(a[3]),atof(a[4])),
new Geom_Ellipse(gp_Ax2(gp_Pnt(Draw::Atof(a[2]),Draw::Atof(a[3]),Draw::Atof(a[4])),
gp_Dir(0,0,1)),
atof(a[5]),atof(a[6]));
Draw::Atof(a[5]),Draw::Atof(a[6]));
else if (n == 8)
result2d =
new Geom2d_Ellipse(gp_Ax22d(gp_Pnt2d(atof(a[2]),atof(a[3])),
gp_Dir2d(atof(a[4]),atof(a[5]))),
atof(a[6]), atof(a[7]));
new Geom2d_Ellipse(gp_Ax22d(gp_Pnt2d(Draw::Atof(a[2]),Draw::Atof(a[3])),
gp_Dir2d(Draw::Atof(a[4]),Draw::Atof(a[5]))),
Draw::Atof(a[6]), Draw::Atof(a[7]));
else if (n == 10)
result =
new Geom_Ellipse(gp_Ax2(gp_Pnt(atof(a[2]),atof(a[3]),atof(a[4])),
gp_Dir(atof(a[5]),atof(a[6]),atof(a[7]))),
atof(a[8]), atof(a[9]));
new Geom_Ellipse(gp_Ax2(gp_Pnt(Draw::Atof(a[2]),Draw::Atof(a[3]),Draw::Atof(a[4])),
gp_Dir(Draw::Atof(a[5]),Draw::Atof(a[6]),Draw::Atof(a[7]))),
Draw::Atof(a[8]), Draw::Atof(a[9]));
else if (n == 13)
result =
new Geom_Ellipse(gp_Ax2(gp_Pnt(atof(a[2]),atof(a[3]),atof(a[4])),
gp_Dir(atof(a[5]),atof(a[6]),atof(a[7])),
gp_Dir(atof(a[8]),atof(a[9]),atof(a[10]))),
atof(a[11]), atof(a[12]));
new Geom_Ellipse(gp_Ax2(gp_Pnt(Draw::Atof(a[2]),Draw::Atof(a[3]),Draw::Atof(a[4])),
gp_Dir(Draw::Atof(a[5]),Draw::Atof(a[6]),Draw::Atof(a[7])),
gp_Dir(Draw::Atof(a[8]),Draw::Atof(a[9]),Draw::Atof(a[10]))),
Draw::Atof(a[11]), Draw::Atof(a[12]));
else
return 1;
}
@ -234,30 +234,30 @@ static Standard_Integer anacurve (Draw_Interpretor& , Standard_Integer n, const
else if (!strcmp(a[0],"hyperbola")) {
if (n == 6)
result2d =
new Geom2d_Hyperbola(gp_Ax22d(gp_Pnt2d(atof(a[2]),atof(a[3])),
new Geom2d_Hyperbola(gp_Ax22d(gp_Pnt2d(Draw::Atof(a[2]),Draw::Atof(a[3])),
gp_Dir2d(1,0)),
atof(a[4]),atof(a[5]));
Draw::Atof(a[4]),Draw::Atof(a[5]));
else if (n == 7)
result =
new Geom_Hyperbola(gp_Ax2(gp_Pnt(atof(a[2]),atof(a[3]),atof(a[4])),
new Geom_Hyperbola(gp_Ax2(gp_Pnt(Draw::Atof(a[2]),Draw::Atof(a[3]),Draw::Atof(a[4])),
gp_Dir(0,0,1)),
atof(a[5]),atof(a[6]));
Draw::Atof(a[5]),Draw::Atof(a[6]));
else if (n == 8)
result2d =
new Geom2d_Hyperbola(gp_Ax22d(gp_Pnt2d(atof(a[2]),atof(a[3])),
gp_Dir2d(atof(a[4]),atof(a[5]))),
atof(a[6]), atof(a[7]));
new Geom2d_Hyperbola(gp_Ax22d(gp_Pnt2d(Draw::Atof(a[2]),Draw::Atof(a[3])),
gp_Dir2d(Draw::Atof(a[4]),Draw::Atof(a[5]))),
Draw::Atof(a[6]), Draw::Atof(a[7]));
else if (n == 10)
result =
new Geom_Hyperbola(gp_Ax2(gp_Pnt(atof(a[2]),atof(a[3]),atof(a[4])),
gp_Dir(atof(a[5]),atof(a[6]),atof(a[7]))),
atof(a[8]), atof(a[9]));
new Geom_Hyperbola(gp_Ax2(gp_Pnt(Draw::Atof(a[2]),Draw::Atof(a[3]),Draw::Atof(a[4])),
gp_Dir(Draw::Atof(a[5]),Draw::Atof(a[6]),Draw::Atof(a[7]))),
Draw::Atof(a[8]), Draw::Atof(a[9]));
else if (n == 13)
result =
new Geom_Hyperbola(gp_Ax2(gp_Pnt(atof(a[2]),atof(a[3]),atof(a[4])),
gp_Dir(atof(a[5]),atof(a[6]),atof(a[7])),
gp_Dir(atof(a[8]),atof(a[9]),atof(a[10]))),
atof(a[11]), atof(a[12]));
new Geom_Hyperbola(gp_Ax2(gp_Pnt(Draw::Atof(a[2]),Draw::Atof(a[3]),Draw::Atof(a[4])),
gp_Dir(Draw::Atof(a[5]),Draw::Atof(a[6]),Draw::Atof(a[7])),
gp_Dir(Draw::Atof(a[8]),Draw::Atof(a[9]),Draw::Atof(a[10]))),
Draw::Atof(a[11]), Draw::Atof(a[12]));
else
return 1;
}
@ -286,7 +286,7 @@ static Standard_Integer polecurve (Draw_Interpretor& , Standard_Integer n, const
if (!strcmp(a[0],"beziercurve")) {
Standard_Integer np = atoi(a[2]);
Standard_Integer np = Draw::Atoi(a[2]);
if (np == 0) return 1;
i = (n - 3) / (np);
@ -298,10 +298,10 @@ static Standard_Integer polecurve (Draw_Interpretor& , Standard_Integer n, const
k = 3;
for (i = 1; i <= np; i++) {
poles(i).SetCoord(atof(a[k]),atof(a[k+1]),atof(a[k+2]));
poles(i).SetCoord(Draw::Atof(a[k]),Draw::Atof(a[k+1]),Draw::Atof(a[k+2]));
k += 3;
if (hasw) {
weights(i) = atof(a[k]);
weights(i) = Draw::Atof(a[k]);
k++;
}
}
@ -316,17 +316,17 @@ static Standard_Integer polecurve (Draw_Interpretor& , Standard_Integer n, const
}
else if (!strcmp((*a[0] == 'p') ? a[0]+1 : a[0],"bsplinecurve")) {
Standard_Integer deg = atoi(a[2]);
Standard_Integer nbk = atoi(a[3]);
Standard_Integer deg = Draw::Atoi(a[2]);
Standard_Integer nbk = Draw::Atoi(a[3]);
TColStd_Array1OfReal knots(1, nbk);
TColStd_Array1OfInteger mults(1, nbk);
k = 4;
Standard_Integer Sigma = 0;
for (i = 1; i<=nbk; i++) {
knots( i) = atof(a[k]);
knots( i) = Draw::Atof(a[k]);
k++;
mults( i) = atoi(a[k]);
mults( i) = Draw::Atoi(a[k]);
Sigma += mults(i);
k++;
}
@ -342,9 +342,9 @@ static Standard_Integer polecurve (Draw_Interpretor& , Standard_Integer n, const
TColStd_Array1OfReal weights(1, np);
for (i = 1; i <= np; i++) {
poles(i).SetCoord(atof(a[k]),atof(a[k+1]),atof(a[k+2]));
poles(i).SetCoord(Draw::Atof(a[k]),Draw::Atof(a[k+1]),Draw::Atof(a[k+2]));
k += 3;
weights(i) = atof(a[k]);
weights(i) = Draw::Atof(a[k]);
k++;
}
@ -370,7 +370,7 @@ static Standard_Integer polecurve2d (Draw_Interpretor& , Standard_Integer n, con
if (!strcmp(a[0],"2dbeziercurve")) {
Standard_Integer np = atoi(a[2]);
Standard_Integer np = Draw::Atoi(a[2]);
if (np == 0) return 1;
i = (n - 2) / (np);
@ -382,10 +382,10 @@ static Standard_Integer polecurve2d (Draw_Interpretor& , Standard_Integer n, con
k = 3;
for (i = 1; i <= np; i++) {
poles(i).SetCoord(atof(a[k]),atof(a[k+1]));
poles(i).SetCoord(Draw::Atof(a[k]),Draw::Atof(a[k+1]));
k += 2;
if (hasw) {
weights(i) = atof(a[k]);
weights(i) = Draw::Atof(a[k]);
k++;
}
}
@ -400,17 +400,17 @@ static Standard_Integer polecurve2d (Draw_Interpretor& , Standard_Integer n, con
}
else if (!strcmp((*(a[0]+2) == 'p') ? a[0]+3 : a[0]+2,"bsplinecurve")) {
Standard_Integer deg = atoi(a[2]);
Standard_Integer nbk = atoi(a[3]);
Standard_Integer deg = Draw::Atoi(a[2]);
Standard_Integer nbk = Draw::Atoi(a[3]);
TColStd_Array1OfReal knots(1, nbk);
TColStd_Array1OfInteger mults(1, nbk);
k = 4;
Standard_Integer Sigma = 0;
for (i = 1; i<=nbk; i++) {
knots( i) = atof(a[k]);
knots( i) = Draw::Atof(a[k]);
k++;
mults( i) = atoi(a[k]);
mults( i) = Draw::Atoi(a[k]);
Sigma += mults(i);
k++;
}
@ -426,9 +426,9 @@ static Standard_Integer polecurve2d (Draw_Interpretor& , Standard_Integer n, con
TColStd_Array1OfReal weights(1, np);
for (i = 1; i <= np; i++) {
poles(i).SetCoord(atof(a[k]),atof(a[k+1]));
poles(i).SetCoord(Draw::Atof(a[k]),Draw::Atof(a[k+1]));
k += 2;
weights(i) = atof(a[k]);
weights(i) = Draw::Atof(a[k]);
k++;
}
@ -475,11 +475,11 @@ static Standard_Integer cmovepole (Draw_Interpretor& , Standard_Integer n, const
{
if (n < 5) return 1;
Standard_Real dx = atof(a[3]);
Standard_Real dy = atof(a[4]);
Standard_Real dx = Draw::Atof(a[3]);
Standard_Real dy = Draw::Atof(a[4]);
Standard_Real dz=0;
if (n >= 6) dz = atof(a[5]);
Standard_Integer Index = atoi(a[2]);
if (n >= 6) dz = Draw::Atof(a[5]);
Standard_Integer Index = Draw::Atoi(a[2]);
Handle(Geom_BezierCurve) G1 = DrawTrSurf::GetBezierCurve(a[1]);
if (!G1.IsNull()) {
@ -542,9 +542,9 @@ static Standard_Integer cmovetangent (Draw_Interpretor& di, Standard_Integer n,
tx,
ty,
tz ;
u = atof(a[2]);
x = atof(a[3]);
y = atof(a[4]);
u = Draw::Atof(a[2]);
x = Draw::Atof(a[3]);
y = Draw::Atof(a[4]);
z = 0.0e0,
tolerance = 1.0e-5 ;
dimension = 3 ;
@ -565,12 +565,12 @@ static Standard_Integer cmovetangent (Draw_Interpretor& di, Standard_Integer n,
if (dimension == 3) {
Handle(Geom_BSplineCurve) G2 = DrawTrSurf::GetBSplineCurve(a[1]);
if (!G2.IsNull()) {
z = atof(a[5]) ;
tx = atof(a[6]) ;
ty = atof(a[7]) ;
tz = atof(a[8]) ;
z = Draw::Atof(a[5]) ;
tx = Draw::Atof(a[6]) ;
ty = Draw::Atof(a[7]) ;
tz = Draw::Atof(a[8]) ;
if (n == 10) {
condition = Max(atoi(a[9]), -1) ;
condition = Max(Draw::Atoi(a[9]), -1) ;
condition = Min(condition, G2->Degree()-1) ;
}
gp_Pnt p;
@ -598,10 +598,10 @@ static Standard_Integer cmovetangent (Draw_Interpretor& di, Standard_Integer n,
else {
Handle(Geom2d_BSplineCurve) G2 = DrawTrSurf::GetBSplineCurve2d(a[1]);
if (!G2.IsNull()) {
tx = atof(a[5]) ;
ty = atof(a[6]) ;
tx = Draw::Atof(a[5]) ;
ty = Draw::Atof(a[6]) ;
if (n == 8) {
condition = Max(atoi(a[7]), -1) ;
condition = Max(Draw::Atoi(a[7]), -1) ;
condition = Min(condition, G2->Degree()-1) ;
}
gp_Pnt2d p;
@ -639,21 +639,21 @@ static Standard_Integer cmovepoint (Draw_Interpretor& , Standard_Integer n, cons
{
if (n < 5) return 1;
Standard_Real dx = atof(a[3]);
Standard_Real dy = atof(a[4]);
Standard_Real dx = Draw::Atof(a[3]);
Standard_Real dy = Draw::Atof(a[4]);
Standard_Real dz=0;
if (n >= 6 && n != 7) dz = atof(a[5]);
Standard_Real u = atof(a[2]);
if (n >= 6 && n != 7) dz = Draw::Atof(a[5]);
Standard_Real u = Draw::Atof(a[2]);
Standard_Integer index1 = 0;
Standard_Integer index2 = 0;
Standard_Integer fmodif, lmodif;
if (n == 7) {
index1 = atoi(a[5]);
index2 = atoi(a[6]);
index1 = Draw::Atoi(a[5]);
index2 = Draw::Atoi(a[6]);
}
else if (n == 8) {
index1 = atoi(a[6]);
index2 = atoi(a[7]);
index1 = Draw::Atoi(a[6]);
index2 = Draw::Atoi(a[7]);
}
Handle(Geom_BSplineCurve) G2 = DrawTrSurf::GetBSplineCurve(a[1]);
@ -701,9 +701,9 @@ static Standard_Integer cinsertknot (Draw_Interpretor& , Standard_Integer n, con
if (GBs.IsNull() && GBs2d.IsNull()) return 1;
if (n <= 4) {
Standard_Real knot = atof(a[2]);
Standard_Real knot = Draw::Atof(a[2]);
Standard_Integer mult = 1;
if (n == 4) mult = atoi(a[3]);
if (n == 4) mult = Draw::Atoi(a[3]);
if (!GBs.IsNull())
GBs->InsertKnot(knot,mult,Precision::PConfusion());
else
@ -717,8 +717,8 @@ static Standard_Integer cinsertknot (Draw_Interpretor& , Standard_Integer n, con
TColStd_Array1OfReal knots(1,nbk);
TColStd_Array1OfInteger mults(1,nbk);
for (i = 2; i < n; i += 2) {
knots(i/2) = atof(a[i]);
mults(i/2) = atoi(a[i+1]);
knots(i/2) = Draw::Atof(a[i]);
mults(i/2) = Draw::Atoi(a[i+1]);
}
if (!GBs.IsNull())
@ -746,8 +746,8 @@ static Standard_Integer csetknot (Draw_Interpretor& , Standard_Integer n, const
if (GBs.IsNull() && GBs2d.IsNull()) return 1;
Standard_Integer index = atoi(a[2]);
Standard_Real knot = atof(a[3]);
Standard_Integer index = Draw::Atoi(a[2]);
Standard_Real knot = Draw::Atof(a[3]);
if ( n == 4) {
if (!GBs.IsNull())
@ -756,7 +756,7 @@ static Standard_Integer csetknot (Draw_Interpretor& , Standard_Integer n, const
GBs2d->SetKnot(index,knot);
}
else {
Standard_Integer mult = atoi(a[4]);
Standard_Integer mult = Draw::Atoi(a[4]);
if (!GBs.IsNull())
GBs->SetKnot(index,knot,mult);
else
@ -781,12 +781,12 @@ static Standard_Integer cremknot (Draw_Interpretor& di, Standard_Integer n, cons
if (GBs.IsNull() && GBs2d.IsNull()) return 1;
Standard_Integer index = atoi(a[2]);
Standard_Integer index = Draw::Atoi(a[2]);
Standard_Integer mult = 0;
if (n >= 4) mult = atoi(a[3]);
if (n >= 4) mult = Draw::Atoi(a[3]);
Standard_Real tol = RealLast();
if (n >= 5) tol = atof(a[4]);
if (n >= 5) tol = Draw::Atof(a[4]);
if (!GBs.IsNull()) {
if (!GBs->RemoveKnot(index,mult,tol))
@ -810,7 +810,7 @@ static Standard_Integer increasedegree (Draw_Interpretor& , Standard_Integer n,
{
if (n < 3) return 1;
Standard_Integer Deg = atoi(a[2]);
Standard_Integer Deg = Draw::Atoi(a[2]);
Handle(Geom_BezierCurve) GBz = DrawTrSurf::GetBezierCurve(a[1]);
Handle(Geom_BSplineCurve) GBs = DrawTrSurf::GetBSplineCurve(a[1]);
@ -841,7 +841,7 @@ static Standard_Integer removepole (Draw_Interpretor& di, Standard_Integer n, co
{
if (n < 3) return 1;
Standard_Integer Index = atoi(a[2]);
Standard_Integer Index = Draw::Atoi(a[2]);
Handle(Geom_BezierCurve) GBZ = DrawTrSurf::GetBezierCurve(a[1]);
Handle(Geom2d_BezierCurve) GBZ2d = DrawTrSurf::GetBezierCurve2d(a[1]);
@ -869,21 +869,21 @@ static Standard_Integer insertpole (Draw_Interpretor& di, Standard_Integer n, co
{
if (n < 6) return 1;
Standard_Integer Index = atoi(a[2]);
Standard_Integer Index = Draw::Atoi(a[2]);
Handle(Geom_BezierCurve) GBZ = DrawTrSurf::GetBezierCurve(a[1]);
Handle(Geom2d_BezierCurve) GBZ2d = DrawTrSurf::GetBezierCurve2d(a[1]);
if (!GBZ.IsNull()) {
gp_Pnt P (atof(a[3]),atof(a[4]),atof(a[5]));
gp_Pnt P (Draw::Atof(a[3]),Draw::Atof(a[4]),Draw::Atof(a[5]));
if ( n == 7)
GBZ->InsertPoleAfter(Index,P,atof(a[6]));
GBZ->InsertPoleAfter(Index,P,Draw::Atof(a[6]));
else
GBZ->InsertPoleAfter(Index,P);
}
else if (!GBZ2d.IsNull()) {
gp_Pnt2d P (atof(a[3]),atof(a[4]));
gp_Pnt2d P (Draw::Atof(a[3]),Draw::Atof(a[4]));
if ( n == 6)
GBZ2d->InsertPoleAfter(Index,P,atof(a[5]));
GBZ2d->InsertPoleAfter(Index,P,Draw::Atof(a[5]));
else
GBZ2d->InsertPoleAfter(Index,P);
}
@ -906,9 +906,9 @@ static Standard_Integer cfindp (Draw_Interpretor& , Standard_Integer n, const ch
if (n < 6) return 1;
Standard_Integer Index = 0;
Standard_Integer view = atoi(a[2]);
Standard_Real x = atof(a[3]);
Standard_Real y = atof(a[4]);
Standard_Integer view = Draw::Atoi(a[2]);
Standard_Real x = Draw::Atof(a[3]);
Standard_Real y = Draw::Atof(a[4]);
Draw_Display d = dout.MakeDisplay(view);
@ -989,7 +989,7 @@ static Standard_Integer value (Draw_Interpretor& ,
Handle(Geom_Curve) GC = DrawTrSurf::GetCurve(a[1]);
if (GC.IsNull()) return 1;
Standard_Real U = atof(a[2]);
Standard_Real U = Draw::Atof(a[2]);
Standard_Boolean DrawPoint = ( n%3 == 1);
if ( DrawPoint) n--;
@ -1041,7 +1041,7 @@ static Standard_Integer value2d (Draw_Interpretor& ,
Handle(Geom2d_Curve) GC = DrawTrSurf::GetCurve2d(a[1]);
if (GC.IsNull()) return 1;
Standard_Real U = atof(a[2]);
Standard_Real U = Draw::Atof(a[2]);
Standard_Boolean DrawPoint = ( n%2 == 0);
if ( DrawPoint ) n--;
@ -1090,7 +1090,7 @@ static Standard_Integer segment (Draw_Interpretor& , Standard_Integer n, const c
Handle(Geom2d_BezierCurve) GBz2d = DrawTrSurf::GetBezierCurve2d(a[1]);
Handle(Geom2d_BSplineCurve) GBs2d = DrawTrSurf::GetBSplineCurve2d(a[1]);
Standard_Real f = atof(a[2]), l = atof(a[3]);
Standard_Real f = Draw::Atof(a[2]), l = Draw::Atof(a[3]);
if (!GBz.IsNull())
GBz->Segment(f,l);
@ -1121,9 +1121,9 @@ static Standard_Integer setorigin (Draw_Interpretor& , Standard_Integer n, const
Handle(Geom2d_BSplineCurve) GBs2d = DrawTrSurf::GetBSplineCurve2d(a[1]);
if (!GBs.IsNull())
GBs->SetOrigin(atoi(a[2]));
GBs->SetOrigin(Draw::Atoi(a[2]));
if (!GBs2d.IsNull())
GBs2d->SetOrigin(atoi(a[2]));
GBs2d->SetOrigin(Draw::Atoi(a[2]));
else
return 1;
@ -1141,11 +1141,11 @@ static Standard_Integer point(Draw_Interpretor& , Standard_Integer n, const char
{
if (n < 4) return 1;
if (n >= 5) {
gp_Pnt P(atof(a[2]),atof(a[3]),atof(a[4]));
gp_Pnt P(Draw::Atof(a[2]),Draw::Atof(a[3]),Draw::Atof(a[4]));
DrawTrSurf::Set(a[1],P);
}
else {
gp_Pnt2d P(atof(a[2]),atof(a[3]));
gp_Pnt2d P(Draw::Atof(a[2]),Draw::Atof(a[3]));
DrawTrSurf::Set(a[1],P);
}
@ -1283,7 +1283,7 @@ static Standard_Integer radiusmax(Draw_Interpretor&,
Standard_Integer argc, const char** argv)
{
if (argc < 3) return 1;
Standard_Real Radius = atof(argv[2]);
Standard_Real Radius = Draw::Atof(argv[2]);
Handle(DrawTrSurf_Curve2d) C2d = Handle(DrawTrSurf_Curve2d)
::DownCast(Draw::Get(argv[1]));
Handle(DrawTrSurf_Curve) C3d = Handle(DrawTrSurf_Curve)
@ -1308,7 +1308,7 @@ static Standard_Integer radiusratio(Draw_Interpretor&,
Standard_Integer argc, const char** argv)
{
if (argc < 3) return 1;
Standard_Real Ratio = atof(argv[2]);
Standard_Real Ratio = Draw::Atof(argv[2]);
Handle(DrawTrSurf_Curve2d) C2d = Handle(DrawTrSurf_Curve2d)
::DownCast(Draw::Get(argv[1]));
Handle(DrawTrSurf_Curve) C3d = Handle(DrawTrSurf_Curve)
@ -1334,7 +1334,7 @@ static Standard_Integer localprop(Draw_Interpretor& di,
{
if (argc < 3) return 1;
Standard_Real U = atof(argv[2]);
Standard_Real U = Draw::Atof(argv[2]);
Handle(Geom2d_Curve) C2d = DrawTrSurf::GetCurve2d(argv[1]);
Handle(Geom_Curve) C3d;
@ -1416,9 +1416,9 @@ static Standard_Integer rawcont(Draw_Interpretor& di, Standard_Integer n, const
Handle(Geom_Curve) GC2;
GC2 = DrawTrSurf::GetCurve(a[2]);
Standard_Real param1 =
atof(a[3]) ;
Draw::Atof(a[3]) ;
Standard_Real param2 =
atof(a[4]) ;
Draw::Atof(a[4]) ;
if (GC1.IsNull() || GC2.IsNull())
return 1;
gp_Pnt a_point1,
@ -1481,19 +1481,19 @@ static Standard_Integer approxcurveonsurf(Draw_Interpretor& di, Standard_Integer
if ( n>8 || n<4) return 1;
if (n>4) Tol = Max(atof(a[4]),1.e-10);
if (n>4) Tol = Max(Draw::Atof(a[4]),1.e-10);
if (n>5) {
if (atoi(a[5]) == 0) Continuity = GeomAbs_C0;
if (atoi(a[5]) == 2) Continuity = GeomAbs_C2;
if (Draw::Atoi(a[5]) == 0) Continuity = GeomAbs_C0;
if (Draw::Atoi(a[5]) == 2) Continuity = GeomAbs_C2;
}
if (n>6) {
MaxDeg = atoi(a[6]);
MaxDeg = Draw::Atoi(a[6]);
if (MaxDeg<1 || MaxDeg>14) MaxDeg = 14;
}
if (n>7) MaxSeg = atoi(a[7]);
if (n>7) MaxSeg = Draw::Atoi(a[7]);
Handle(Geom2d_Curve) curve2d = DrawTrSurf::GetCurve2d(a[2]);
Handle(Geom_Surface) Surf = DrawTrSurf::GetSurface(a[3]);
@ -1591,19 +1591,19 @@ static Standard_Integer approxcurve(Draw_Interpretor& di, Standard_Integer n, co
Case = 1;
}
if (n>shift) Tol = Max(atof(a[shift]),1.e-10);
if (n>shift) Tol = Max(Draw::Atof(a[shift]),1.e-10);
if (n>shift+1) {
if (atoi(a[shift+1]) == 0) Continuity = GeomAbs_C0;
if (atoi(a[shift+1]) == 2) Continuity = GeomAbs_C2;
if (Draw::Atoi(a[shift+1]) == 0) Continuity = GeomAbs_C0;
if (Draw::Atoi(a[shift+1]) == 2) Continuity = GeomAbs_C2;
}
if (n>shift+2) {
MaxDeg = atoi(a[shift+2]);
MaxDeg = Draw::Atoi(a[shift+2]);
if (MaxDeg<1 || MaxDeg>14) MaxDeg = 14;
}
if (n>shift+3) MaxSeg = atoi(a[shift+3]);
if (n>shift+3) MaxSeg = Draw::Atoi(a[shift+3]);
if (Case == 1) {
GeomConvert_ApproxCurve appr(curve, Tol, Continuity, MaxSeg, MaxDeg);
@ -1690,11 +1690,11 @@ static Standard_Integer splitc1(Draw_Interpretor& di,
char name[100];
if (n<3) return 1;
optiontab=atoi(c[2]);
optiontab=Draw::Atoi(c[2]);
if (n >= 4 )
tolerance=atof(c[3]);
tolerance=Draw::Atof(c[3]);
if (n >= 5) {
angular_tolerance = atof(c[4]) ;
angular_tolerance = Draw::Atof(c[4]) ;
}
Handle(Geom_Curve) ACurve = Handle(Geom_Curve)::DownCast(DrawTrSurf::Get(c[1])) ;
@ -1717,7 +1717,7 @@ static Standard_Integer splitc1(Draw_Interpretor& di,
angular_tolerance,
tolerance);
for (i=0;i<=(tabBS->Length()-1);i++){
sprintf(name,"%s_%d",c[1],i+1);
Sprintf(name,"%s_%d",c[1],i+1);
Standard_CString new_name = name ;
DrawTrSurf::Set(new_name,
tabBS->Value(i));
@ -1749,11 +1749,11 @@ static Standard_Integer splitc12d(Draw_Interpretor& di,
char name[100];
if (n<3) return 1;
optiontab=atoi(c[2]);
optiontab=Draw::Atoi(c[2]);
if (n==4)
tolerance=atof(c[3]);
tolerance=Draw::Atof(c[3]);
if (n==5)
angular_tolerance = atof(c[4]) ;
angular_tolerance = Draw::Atof(c[4]) ;
Handle(Geom2d_Curve) ACurve = Handle(Geom2d_Curve)::DownCast(DrawTrSurf::GetCurve2d(c[1])) ;
Standard_Real f = ACurve->FirstParameter();
@ -1775,7 +1775,7 @@ static Standard_Integer splitc12d(Draw_Interpretor& di,
angular_tolerance,
tolerance);
for (i=0;i<=(tabBS->Length()-1);i++){
sprintf(name,"%s_%d",c[1],i+1);
Sprintf(name,"%s_%d",c[1],i+1);
Standard_CString new_name = name ;
DrawTrSurf::Set(new_name,
tabBS->Value(i));
@ -1802,8 +1802,8 @@ static Standard_Integer canceldenom(Draw_Interpretor& ,
Standard_Boolean udirection=Standard_False;
Standard_Boolean vdirection=Standard_False;
if (n<4) return 1;
uoption=atoi(c[2]);
voption=atoi(c[3]);
uoption=Draw::Atoi(c[2]);
voption=Draw::Atoi(c[3]);
if (uoption)
udirection=Standard_True;
if (voption)
@ -1826,7 +1826,7 @@ static Standard_Integer length(Draw_Interpretor& di,
Handle(Geom_Curve) GC = DrawTrSurf::GetCurve(a[1]);
Handle(Geom2d_Curve) GC2d = DrawTrSurf::GetCurve2d(a[1]);
Standard_Real Tol = Precision::Confusion(), L;
if (n==3) Tol = atof(a[2]);
if (n==3) Tol = Draw::Atof(a[2]);
if (!GC.IsNull()) {
GeomAdaptor_Curve AC(GC);

View File

@ -59,7 +59,7 @@ static Standard_Integer extendcurve (Draw_Interpretor& di, Standard_Integer n, c
apres = Standard_False ;
}
}
Standard_Integer cont=atoi(a[3]);
Standard_Integer cont=Draw::Atoi(a[3]);
GeomLib::ExtendCurveToPoint(GB,P,cont,apres);
DrawTrSurf::Set(a[1],GB);
return 0;
@ -80,8 +80,8 @@ static Standard_Integer extendsurf (Draw_Interpretor& di, Standard_Integer n, co
di << "extendsurf needs a Bounded surface";
return 1;
}
Standard_Real chord=atof(a[2]);
Standard_Integer cont=atoi(a[3]);
Standard_Real chord=Draw::Atof(a[2]);
Standard_Integer cont=Draw::Atoi(a[3]);
Standard_Boolean enU = Standard_True, apres = Standard_True;
if (n >= 5) {
if (strcmp(a[4], "V") == 0) {
@ -116,10 +116,10 @@ static Standard_Integer samerange (Draw_Interpretor& di, Standard_Integer n, con
Handle(Geom2d_Curve) C = DrawTrSurf::GetCurve2d(a[2]);
Handle(Geom2d_Curve) Res;
Standard_Real f, l, rf, rl;
f = atof(a[3]);
l = atof(a[4]);
rf = atof(a[5]);
rl = atof(a[6]);
f = Draw::Atof(a[3]);
l = Draw::Atof(a[4]);
rf = Draw::Atof(a[5]);
rl = Draw::Atof(a[6]);
GeomLib::SameRange(Precision::PConfusion(), C,
f, l, rf, rl, Res);

View File

@ -116,8 +116,8 @@ static Standard_Integer surface_radius (Draw_Interpretor& di,
if (n < 4) return 1;
if (n >= 6) report_curvature = 1 ;
UParameter = atof(a[2]);
VParameter = atof(a[3]);
UParameter = Draw::Atof(a[2]);
VParameter = Draw::Atof(a[3]);
Handle(Geom_Surface) SurfacePtr = DrawTrSurf::GetSurface(a[1]);
if (!SurfacePtr.IsNull()) {
GeomLProp_SLProps myProperties(SurfacePtr,
@ -177,19 +177,19 @@ static Standard_Integer anasurface (Draw_Interpretor& ,
i = 2;
}
else if (n < 8) {
loc = gp_Ax3(gp_Pnt(atof(a[2]),atof(a[3]),atof(a[4])),
loc = gp_Ax3(gp_Pnt(Draw::Atof(a[2]),Draw::Atof(a[3]),Draw::Atof(a[4])),
gp_Dir(0,0,1),gp_Dir(1,0,0));
i = 5;
}
else if (n < 11) {
loc = gp_Ax3(gp_Pnt(atof(a[2]),atof(a[3]),atof(a[4])),
gp_Dir(atof(a[5]),atof(a[6]),atof(a[7])));
loc = gp_Ax3(gp_Pnt(Draw::Atof(a[2]),Draw::Atof(a[3]),Draw::Atof(a[4])),
gp_Dir(Draw::Atof(a[5]),Draw::Atof(a[6]),Draw::Atof(a[7])));
i = 8;
}
else if (n < 14) {
loc = gp_Ax3(gp_Pnt(atof(a[2]),atof(a[3]),atof(a[4])),
gp_Dir(atof(a[5]),atof(a[6]),atof(a[7])),
gp_Dir(atof(a[8]),atof(a[9]),atof(a[10])));
loc = gp_Ax3(gp_Pnt(Draw::Atof(a[2]),Draw::Atof(a[3]),Draw::Atof(a[4])),
gp_Dir(Draw::Atof(a[5]),Draw::Atof(a[6]),Draw::Atof(a[7])),
gp_Dir(Draw::Atof(a[8]),Draw::Atof(a[9]),Draw::Atof(a[10])));
i = 11;
}
else
@ -203,7 +203,7 @@ static Standard_Integer anasurface (Draw_Interpretor& ,
}
else {
if (i >= n) return 1;
Standard_Real par1 = atof(a[i]);
Standard_Real par1 = Draw::Atof(a[i]);
if (!strcasecmp(a[0],"cylinder")) {
Handle(Geom_CylindricalSurface) C =
@ -219,7 +219,7 @@ static Standard_Integer anasurface (Draw_Interpretor& ,
else {
if (i+1 >= n) return 1;
Standard_Real par2 = atof(a[i+1]);
Standard_Real par2 = Draw::Atof(a[i+1]);
if (!strcasecmp(a[0],"cone")) {
par1 *= (M_PI / 180.0);
@ -255,8 +255,8 @@ static Standard_Integer polesurface (Draw_Interpretor& , Standard_Integer n, con
if (!strcasecmp(a[0],"beziersurf")) {
Standard_Integer nup = atoi(a[2]);
Standard_Integer nvp = atoi(a[3]);
Standard_Integer nup = Draw::Atoi(a[2]);
Standard_Integer nvp = Draw::Atoi(a[3]);
if (nup * nvp == 0) return 1;
i = (n - 4) / (nup * nvp);
@ -269,10 +269,10 @@ static Standard_Integer polesurface (Draw_Interpretor& , Standard_Integer n, con
k = 4;
for (j = 1; j <= nvp; j++) {
for (i = 1; i <= nup; i++) {
poles(i, j).SetCoord(atof(a[k]),atof(a[k+1]),atof(a[k+2]));
poles(i, j).SetCoord(Draw::Atof(a[k]),Draw::Atof(a[k+1]),Draw::Atof(a[k+2]));
k += 3;
if (hasw) {
weights(i, j) = atof(a[k]);
weights(i, j) = Draw::Atof(a[k]);
k++;
}
}
@ -288,8 +288,8 @@ static Standard_Integer polesurface (Draw_Interpretor& , Standard_Integer n, con
}
else {
Standard_Integer udeg = atoi(a[2]);
Standard_Integer nbuk = atoi(a[3]);
Standard_Integer udeg = Draw::Atoi(a[2]);
Standard_Integer nbuk = Draw::Atoi(a[3]);
Standard_Boolean uper = (*a[0] == 'u') || (*(a[0]+1) == 'u');
Standard_Boolean vper = (*a[0] == 'v') || (*(a[0]+1) == 'v');
@ -299,25 +299,25 @@ static Standard_Integer polesurface (Draw_Interpretor& , Standard_Integer n, con
k = 4;
Standard_Integer SigmaU = 0;
for (i = 1; i<=nbuk; i++) {
uk( i) = atof(a[k]);
uk( i) = Draw::Atof(a[k]);
k++;
umult( i) = atoi(a[k]);
umult( i) = Draw::Atoi(a[k]);
SigmaU += umult(i);
k++;
}
Standard_Integer vdeg = atoi(a[k]);
Standard_Integer vdeg = Draw::Atoi(a[k]);
k++;
Standard_Integer nbvk = atoi(a[k]);
Standard_Integer nbvk = Draw::Atoi(a[k]);
k++;
TColStd_Array1OfReal vk (1, nbvk);
TColStd_Array1OfInteger vmult(1, nbvk);
Standard_Integer SigmaV = 0;
for (i = 1; i<=nbvk; i++) {
vk( i) = atof(a[k]);
vk( i) = Draw::Atof(a[k]);
k++;
vmult( i) = atoi(a[k]);
vmult( i) = Draw::Atoi(a[k]);
SigmaV += vmult(i);
k++;
}
@ -336,9 +336,9 @@ static Standard_Integer polesurface (Draw_Interpretor& , Standard_Integer n, con
for (j = 1; j <= nvp; j++) {
for (i = 1; i <= nup; i++) {
poles(i, j).SetCoord(atof(a[k]),atof(a[k+1]),atof(a[k+2]));
poles(i, j).SetCoord(Draw::Atof(a[k]),Draw::Atof(a[k+1]),Draw::Atof(a[k+2]));
k += 3;
weights(i, j) = atof(a[k]);
weights(i, j) = Draw::Atof(a[k]);
k++;
}
}
@ -372,7 +372,7 @@ static Standard_Integer algosurface (Draw_Interpretor& , Standard_Integer n, con
gp_Pnt P;
if (!strcasecmp(a[0],"extsurf")) {
D.SetCoord(atof(a[3]),atof(a[4]),atof(a[5]));
D.SetCoord(Draw::Atof(a[3]),Draw::Atof(a[4]),Draw::Atof(a[5]));
Handle(Geom_SurfaceOfLinearExtrusion) result =
new Geom_SurfaceOfLinearExtrusion(GC,D);
@ -381,8 +381,8 @@ static Standard_Integer algosurface (Draw_Interpretor& , Standard_Integer n, con
}
else if (!strcasecmp(a[0],"revsurf")) {
if (n<8) return 1;
P.SetCoord(atof(a[3]),atof(a[4]),atof(a[5]));
D.SetCoord(atof(a[6]),atof(a[7]),atof(a[8]));
P.SetCoord(Draw::Atof(a[3]),Draw::Atof(a[4]),Draw::Atof(a[5]));
D.SetCoord(Draw::Atof(a[6]),Draw::Atof(a[7]),Draw::Atof(a[8]));
Handle(Geom_SurfaceOfRevolution) result =
new Geom_SurfaceOfRevolution(GC,gp_Ax1(P,D));
@ -432,8 +432,8 @@ static Standard_Integer trimming (Draw_Interpretor& ,
if (n < 5) return 1;
Standard_Real u1 = atof(a[3]);
Standard_Real u2 = atof(a[4]);
Standard_Real u1 = Draw::Atof(a[3]);
Standard_Real u2 = Draw::Atof(a[4]);
Handle(Geom_Geometry) result;
Handle(Geom2d_Curve) result2d;
@ -442,7 +442,7 @@ static Standard_Integer trimming (Draw_Interpretor& ,
if (!GS.IsNull()) {
if (n<7) return 1;
result =
new Geom_RectangularTrimmedSurface(GS,u1,u2,atof(a[5]),atof(a[6]));
new Geom_RectangularTrimmedSurface(GS,u1,u2,Draw::Atof(a[5]),Draw::Atof(a[6]));
}
else if (!GC.IsNull()) {
result = new Geom_TrimmedCurve(GC, u1, u2);
@ -552,10 +552,10 @@ static Standard_Integer tobezier(Draw_Interpretor& di,
if ( S.IsNull()) return 1;
if (n == 7) {
Standard_Real U1, U2, V1, V2;
U1 = atof(a[3]);
U2 = atof(a[4]);
V1 = atof(a[5]);
V2 = atof(a[6]);
U1 = Draw::Atof(a[3]);
U2 = Draw::Atof(a[4]);
V1 = Draw::Atof(a[5]);
V2 = Draw::Atof(a[6]);
GeomConvert_BSplineSurfaceToBezierSurface
Conv(S, U1, U2, V1, V2, Precision::PConfusion());
NbU = Conv.NbUPatches();
@ -563,7 +563,7 @@ static Standard_Integer tobezier(Draw_Interpretor& di,
di << NbU << " X " << NbV << " patches in the result" << "\n";
for (i = 1; i <= NbU; i++) {
for (j = 1; j <= NbV; j++) {
sprintf(name,"%s_%i_%i",a[1],i,j);
Sprintf(name,"%s_%i_%i",a[1],i,j);
char *temp = name ;
DrawTrSurf::Set(temp,Conv.Patch(i,j));
}
@ -576,7 +576,7 @@ static Standard_Integer tobezier(Draw_Interpretor& di,
di << NbU << " X " << NbV << " patches in the result" << "\n";
for (i = 1; i <= NbU; i++) {
for (j = 1; j <= NbV; j++) {
sprintf(name,"%s_%i_%i",a[1],i,j);
Sprintf(name,"%s_%i_%i",a[1],i,j);
char *temp = name ;
DrawTrSurf::Set(temp,Conv.Patch(i,j));
}
@ -586,14 +586,14 @@ static Standard_Integer tobezier(Draw_Interpretor& di,
else {
if (n==5) {
Standard_Real U1, U2;
U1 = atof(a[3]);
U2 = atof(a[4]);
U1 = Draw::Atof(a[3]);
U2 = Draw::Atof(a[4]);
GeomConvert_BSplineCurveToBezierCurve Conv(C3d, U1, U2,
Precision::PConfusion());
NbArc = Conv.NbArcs();
di << NbArc << " arcs in the result" << "\n";
for (i = 1; i <= NbArc; i++) {
sprintf(name,"%s_%i",a[1],i);
Sprintf(name,"%s_%i",a[1],i);
char *temp = name ;
DrawTrSurf::Set(temp,Conv.Arc(i));
}
@ -603,7 +603,7 @@ static Standard_Integer tobezier(Draw_Interpretor& di,
NbArc = Conv.NbArcs();
di << NbArc << " arcs in the result" << "\n";
for (i = 1; i <= NbArc; i++) {
sprintf(name,"%s_%i",a[1],i);
Sprintf(name,"%s_%i",a[1],i);
char *temp = name ;
DrawTrSurf::Set(temp,Conv.Arc(i));
}
@ -613,14 +613,14 @@ static Standard_Integer tobezier(Draw_Interpretor& di,
else {
if (n==5) {
Standard_Real U1, U2;
U1 = atof(a[3]);
U2 = atof(a[4]);
U1 = Draw::Atof(a[3]);
U2 = Draw::Atof(a[4]);
Geom2dConvert_BSplineCurveToBezierCurve Conv(C2d, U1, U2,
Precision::PConfusion());
NbArc = Conv.NbArcs();
di << NbArc << " arcs in the result" << "\n";
for (i = 1; i <= NbArc; i++) {
sprintf(name,"%s_%i",a[1],i);
Sprintf(name,"%s_%i",a[1],i);
char *temp = name ;
DrawTrSurf::Set(temp,Conv.Arc(i));
}
@ -630,7 +630,7 @@ static Standard_Integer tobezier(Draw_Interpretor& di,
NbArc = Conv.NbArcs();
di << NbArc << " arcs in the result" << "\n";
for (i = 1; i <= NbArc; i++) {
sprintf(name,"%s_%i",a[1],i);
Sprintf(name,"%s_%i",a[1],i);
char *temp = name ;
DrawTrSurf::Set(temp,Conv.Arc(i));
}
@ -653,11 +653,11 @@ static Standard_Integer convbz(Draw_Interpretor& di,
Standard_Integer ii, jj, kk=0, NbU, NbV;
Standard_Real Tol = Precision::Confusion();
NbU = atoi(a[2]);
NbU = Draw::Atoi(a[2]);
if ( (Handle(Geom_Curve)::
DownCast(DrawTrSurf::Get(a[3]))).IsNull()) {
// Cas Surfacique
NbV = atoi(a[3]);
NbV = Draw::Atoi(a[3]);
if (n<4+NbU*NbV) {
di << "The number of bezier surface have to be " << NbU*NbV << "\n";
return 1;
@ -674,7 +674,7 @@ static Standard_Integer convbz(Draw_Interpretor& di,
}
kk++;
}
if (kk<n) Tol = atof(a[kk]);
if (kk<n) Tol = Draw::Atof(a[kk]);
GeomConvert_CompBezierSurfacesToBSplineSurface Conv(BZ, Tol);
@ -745,28 +745,28 @@ static Standard_Integer approxsurf(Draw_Interpretor& di, Standard_Integer n, con
if ( n>10 || n<3) return 1;
if (n>3) Tol = Max(atof(a[3]),1.e-10);
if (n>3) Tol = Max(Draw::Atof(a[3]),1.e-10);
if (n==5) return 1;
if (n>5) {
if (atoi(a[4]) == 0) myUCont = GeomAbs_C0;
if (atoi(a[4]) == 2) myUCont = GeomAbs_C2;
if (atoi(a[5]) == 0) myVCont = GeomAbs_C0;
if (atoi(a[5]) == 2) myVCont = GeomAbs_C2;
if (Draw::Atoi(a[4]) == 0) myUCont = GeomAbs_C0;
if (Draw::Atoi(a[4]) == 2) myUCont = GeomAbs_C2;
if (Draw::Atoi(a[5]) == 0) myVCont = GeomAbs_C0;
if (Draw::Atoi(a[5]) == 2) myVCont = GeomAbs_C2;
}
if (n==7) return 1;
if (n>7) {
( degU = (atoi(a[6])));
( degV = (atoi(a[7])));
( degU = (Draw::Atoi(a[6])));
( degV = (Draw::Atoi(a[7])));
if ((degU<1) || (degU>24)) degU = 14;
if ((degV<1) || (degV>24)) degV = 14;
}
if (n>8) nmax = atoi(a[8]);
if (n>9) myPrec = atoi(a[9]);
if (n>8) nmax = Draw::Atoi(a[8]);
if (n>9) myPrec = Draw::Atoi(a[9]);
Handle(Geom_Surface) surf = DrawTrSurf::GetSurface(a[2]);
if (surf.IsNull()) return 1;
@ -789,7 +789,7 @@ static Standard_Integer offseting (Draw_Interpretor& ,
// test the Geom2d curve
Handle(Geom2d_Curve) C2d = DrawTrSurf::GetCurve2d(a[2]);
if (!C2d.IsNull()) {
Handle(Geom2d_OffsetCurve) OC = new Geom2d_OffsetCurve(C2d,atof(a[3]));
Handle(Geom2d_OffsetCurve) OC = new Geom2d_OffsetCurve(C2d,Draw::Atof(a[3]));
DrawTrSurf::Set(a[1],OC);
return 0;
}
@ -805,7 +805,7 @@ static Standard_Integer offseting (Draw_Interpretor& ,
yasurf = Standard_True;
}
Standard_Real dist = atof(a[3]);
Standard_Real dist = Draw::Atof(a[3]);
Handle(Geom_Geometry) result;
@ -815,7 +815,7 @@ static Standard_Integer offseting (Draw_Interpretor& ,
}
else {
if (n < 7) return 1;
gp_Dir D(atof(a[4]),atof(a[5]),atof(a[6]));
gp_Dir D(Draw::Atof(a[4]),Draw::Atof(a[5]),Draw::Atof(a[6]));
Handle(Geom_OffsetCurve) GT = new Geom_OffsetCurve(GC, dist, D);
result = GT;
}
@ -859,7 +859,7 @@ static Standard_Integer iso (Draw_Interpretor& , Standard_Integer n, const char*
if (n < 4) return 1;
Handle(Geom_Curve) C;
Standard_Real par = atof(a[3]);
Standard_Real par = Draw::Atof(a[3]);
Handle(Geom_Surface) GS = DrawTrSurf::GetSurface(a[2]);
if (!GS.IsNull()) {
if (*a[0] == 'u')
@ -886,8 +886,8 @@ static Standard_Integer value (Draw_Interpretor& ,
Handle(Geom_Surface) GS = DrawTrSurf::GetSurface(a[1]);
if (GS.IsNull()) return 1;
Standard_Real U = atof(a[2]);
Standard_Real V = atof(a[3]);
Standard_Real U = Draw::Atof(a[2]);
Standard_Real V = Draw::Atof(a[3]);
Standard_Boolean DrawPoint = ( n%3 == 2);
if ( DrawPoint) n--;
@ -952,9 +952,9 @@ static Standard_Integer movepole (Draw_Interpretor& , Standard_Integer n, const
BSpline = Standard_True;
}
Standard_Real dx = atof(a[n-3]);
Standard_Real dy = atof(a[n-2]);
Standard_Real dz = atof(a[n-1]);
Standard_Real dx = Draw::Atof(a[n-3]);
Standard_Real dy = Draw::Atof(a[n-2]);
Standard_Real dz = Draw::Atof(a[n-1]);
Standard_Integer nup, nvp;
if( !BSpline) {
@ -972,22 +972,22 @@ static Standard_Integer movepole (Draw_Interpretor& , Standard_Integer n, const
if (!strcasecmp(a[0],"movep")) {
if (n<7) return 1;
FirstRow = atoi(a[2]);
FirstCol = atoi(a[3]);
FirstRow = Draw::Atoi(a[2]);
FirstCol = Draw::Atoi(a[3]);
if ( FirstRow < 1 || FirstRow > nup ||
FirstCol < 1 || FirstCol > nvp ) return 1;
LastRow = FirstRow;
LastCol = FirstCol;
}
else if (!strcasecmp(a[0],"moverowp")) {
FirstRow = atoi(a[2]);
FirstRow = Draw::Atoi(a[2]);
if ( FirstRow < 1 || FirstRow > nup ) return 1;
LastRow = FirstRow;
FirstCol = 1;
LastCol = nvp;
}
else if (!strcasecmp(a[0],"movecolp")) {
FirstCol = atoi(a[2]);
FirstCol = Draw::Atoi(a[2]);
if ( FirstCol < 1 || FirstCol > nvp ) return 1;
LastCol = FirstCol;
FirstRow = 1;
@ -1031,12 +1031,12 @@ static Standard_Integer movepoint (Draw_Interpretor& , Standard_Integer n, const
return 1;
}
Standard_Real u = atof(a[2]);
Standard_Real v = atof(a[3]);
Standard_Real u = Draw::Atof(a[2]);
Standard_Real v = Draw::Atof(a[3]);
Standard_Real dx = atof(a[4]);
Standard_Real dy = atof(a[5]);
Standard_Real dz = atof(a[6]);
Standard_Real dx = Draw::Atof(a[4]);
Standard_Real dy = Draw::Atof(a[5]);
Standard_Real dz = Draw::Atof(a[6]);
Standard_Integer index1u = 0;
Standard_Integer index2u = 0;
@ -1045,10 +1045,10 @@ static Standard_Integer movepoint (Draw_Interpretor& , Standard_Integer n, const
Standard_Integer fmodifu, lmodifu, fmodifv, lmodifv;
if (n == 11) {
index1u = atoi(a[7]);
index2u = atoi(a[8]);
index1v = atoi(a[9]);
index2v = atoi(a[10]);
index1u = Draw::Atoi(a[7]);
index2u = Draw::Atoi(a[8]);
index1v = Draw::Atoi(a[9]);
index2v = Draw::Atoi(a[10]);
}
else {
index1u = 2;
@ -1085,13 +1085,13 @@ static Standard_Integer insertknot (Draw_Interpretor& , Standard_Integer n, cons
if ( !strcasecmp(a[0],"insertuknot") ||
!strcasecmp(a[0],"insertvknot") ) {
if (n<4) return 1;
knot = atof(a[2]);
mult = atoi(a[3]);
knot = Draw::Atof(a[2]);
mult = Draw::Atoi(a[3]);
}
else if ( !strcasecmp(a[0],"remuknot") ||
!strcasecmp(a[0],"remvknot") ) {
index = atoi(a[2]);
if (n>=4) mult = atoi(a[3]);
index = Draw::Atoi(a[2]);
if (n>=4) mult = Draw::Atoi(a[3]);
}
Standard_Real tol = RealLast();
@ -1103,12 +1103,12 @@ static Standard_Integer insertknot (Draw_Interpretor& , Standard_Integer n, cons
GBs->InsertVKnot(knot,mult,Precision::PConfusion());
}
else if (!strcasecmp(a[0],"remuknot")) {
if (n>=5) tol = atof(a[4]);
if (n>=5) tol = Draw::Atof(a[4]);
if (!GBs->RemoveUKnot(index,mult,tol))
return 1;
}
else if (!strcasecmp(a[0],"remvknot")) {
if (n>=5) tol = atof(a[4]);
if (n>=5) tol = Draw::Atof(a[4]);
if (!GBs->RemoveVKnot(index,mult,tol))
return 1;
}
@ -1126,7 +1126,7 @@ static Standard_Integer incdegree (Draw_Interpretor& di, Standard_Integer n, con
{
if (n < 3) return 1;
Standard_Integer NewDeg = atoi(a[2]);
Standard_Integer NewDeg = Draw::Atoi(a[2]);
Standard_Boolean BSpline = Standard_False;
Standard_Integer UDeg=0, VDeg=0;
@ -1190,7 +1190,7 @@ static Standard_Integer rempole (Draw_Interpretor& di, Standard_Integer n, const
{
if (n < 3) return 1;
Standard_Integer NewIndex = atoi(a[2]);
Standard_Integer NewIndex = Draw::Atoi(a[2]);
Standard_Boolean BSpline = Standard_False;
Handle(Geom_BezierSurface) GBz = DrawTrSurf::GetBezierSurface(a[1]);
@ -1259,9 +1259,9 @@ static Standard_Integer sfindp (Draw_Interpretor& , Standard_Integer n, const ch
Standard_Integer UIndex = 0;
Standard_Integer VIndex = 0;
Standard_Integer view = atoi(a[2]);
Standard_Real x = atof(a[3]);
Standard_Real y = atof(a[4]);
Standard_Integer view = Draw::Atoi(a[2]);
Standard_Real x = Draw::Atof(a[3]);
Standard_Real y = Draw::Atof(a[4]);
Draw_Display d = dout.MakeDisplay(view);
@ -1381,10 +1381,10 @@ static Standard_Integer segsur (Draw_Interpretor& , Standard_Integer n, const ch
GBs = DrawTrSurf::GetBSplineSurface(a[1]);
if (GBs.IsNull())
return 1;
GBs->Segment(atof(a[2]),atof(a[3]),atof(a[4]),atof(a[5]));
GBs->Segment(Draw::Atof(a[2]),Draw::Atof(a[3]),Draw::Atof(a[4]),Draw::Atof(a[5]));
}
else {
GBz->Segment(atof(a[2]),atof(a[3]),atof(a[4]),atof(a[5]));
GBz->Segment(Draw::Atof(a[2]),Draw::Atof(a[3]),Draw::Atof(a[4]),Draw::Atof(a[5]));
}
Draw::Repaint();
@ -1460,10 +1460,10 @@ static Standard_Integer setuvorigin (Draw_Interpretor& , Standard_Integer n, con
if (GBs.IsNull())
return 1;
if ( !strcasecmp(a[0],"setuorigin")) {
GBs->SetUOrigin(atoi(a[2]));
GBs->SetUOrigin(Draw::Atoi(a[2]));
}
else if ( !strcasecmp(a[0],"setvorigin")) {
GBs->SetVOrigin(atoi(a[2]));
GBs->SetVOrigin(Draw::Atoi(a[2]));
}
else
return 1;
@ -1485,8 +1485,8 @@ static Standard_Integer parameters (Draw_Interpretor& di, Standard_Integer n, co
// try to find parameters on a Surface
Handle(Geom_Surface) S = DrawTrSurf::GetSurface(a[1]);
if( S.IsNull() ) { di << "Unknown surface" << "\n"; return 1; }
gp_Pnt P(atof(a[2]), atof(a[3]), atof(a[4]));
Standard_Real Tol = atof(a[5]), U = 0., V = 0.;
gp_Pnt P(Draw::Atof(a[2]), Draw::Atof(a[3]), Draw::Atof(a[4]));
Standard_Real Tol = Draw::Atof(a[5]), U = 0., V = 0.;
Standard_Boolean res = GeomLib_Tool::Parameters(S,P,Tol,U,V);
Draw::Set(a[6],U);
@ -1499,8 +1499,8 @@ static Standard_Integer parameters (Draw_Interpretor& di, Standard_Integer n, co
// try to find parameters on a 3d Curve
Handle(Geom_Curve) C = DrawTrSurf::GetCurve(a[1]);
if( C.IsNull() ) { di << "Unknown curve" << "\n"; return 1; }
gp_Pnt P(atof(a[2]), atof(a[3]), atof(a[4]));
Standard_Real Tol = atof(a[5]), U = 0.;
gp_Pnt P(Draw::Atof(a[2]), Draw::Atof(a[3]), Draw::Atof(a[4]));
Standard_Real Tol = Draw::Atof(a[5]), U = 0.;
Standard_Boolean res = GeomLib_Tool::Parameter(C,P,Tol,U);
Draw::Set(a[6],U);
@ -1512,8 +1512,8 @@ static Standard_Integer parameters (Draw_Interpretor& di, Standard_Integer n, co
// try to find parameters on a 2d Curve
Handle(Geom2d_Curve) C = DrawTrSurf::GetCurve2d(a[1]);
if( C.IsNull() ) { di << "Unknown curve 2d" << "\n"; return 1; }
gp_Pnt2d P(atof(a[2]), atof(a[3]));
Standard_Real Tol = atof(a[4]), U = 0.;
gp_Pnt2d P(Draw::Atof(a[2]), Draw::Atof(a[3]));
Standard_Real Tol = Draw::Atof(a[4]), U = 0.;
Standard_Boolean res = GeomLib_Tool::Parameter(C,P,Tol,U);
Draw::Set(a[5],U);

View File

@ -95,22 +95,22 @@ hprj (Draw_Interpretor& , Standard_Integer n, const char** a)
{
Standard_Integer id = 1;
if (n < 2) return 1;
if (n > 2) id = atoi(a[2]);
if (n > 2) id = Draw::Atoi(a[2]);
//
gp_Ax2 anAx2 = gp::XOY();
if (n == 11)
{
Standard_Real x = atof(a[2]);
Standard_Real y = atof(a[3]);
Standard_Real z = atof(a[4]);
Standard_Real x = Draw::Atof(a[2]);
Standard_Real y = Draw::Atof(a[3]);
Standard_Real z = Draw::Atof(a[4]);
Standard_Real dx = atof(a[5]);
Standard_Real dy = atof(a[6]);
Standard_Real dz = atof(a[7]);
Standard_Real dx = Draw::Atof(a[5]);
Standard_Real dy = Draw::Atof(a[6]);
Standard_Real dz = Draw::Atof(a[7]);
Standard_Real dx1 = atof(a[8]);
Standard_Real dy1 = atof(a[9]);
Standard_Real dz1 = atof(a[10]);
Standard_Real dx1 = Draw::Atof(a[8]);
Standard_Real dy1 = Draw::Atof(a[9]);
Standard_Real dz1 = Draw::Atof(a[10]);
gp_Pnt anOrigin (x, y, z);
gp_Dir aNormal (dx, dy, dz);
@ -152,7 +152,7 @@ hfil (Draw_Interpretor& di, Standard_Integer n, const char** a)
{
Standard_Integer nbIso = 0;
if (n < 3) return 1;
if (n > 3) nbIso = atoi(a[3]);
if (n > 3) nbIso = Draw::Atoi(a[3]);
const char *name1 = a[1];
Handle(HLRTopoBRep_OutLiner) HS = HLRTest::GetOutLiner(name1);
if (HS.IsNull()) {

View File

@ -153,7 +153,7 @@ void IGESData_GlobalSection::Init(const Handle(Interface_ParamSet)& params,
if (fpt == Interface_ParamInteger) {
// but a real is expected
if ( i == 13 || i == 17 || i == 19 || i == 20)
realval = atof(val);
realval = Atof(val);
intval = atoi(val);
}
@ -168,7 +168,7 @@ void IGESData_GlobalSection::Init(const Handle(Interface_ParamSet)& params,
text[j++] = val[k];
if (val[k] == '\0') break;
}
realval = atof(text);//Interface_FileReaderData::Fastof(val);
realval = Atof(text);
}
// if the param is a text

View File

@ -1249,9 +1249,9 @@ Standard_Boolean IGESData_ParamReader::ReadingReal (const Standard_Integer num,
text[j++] = orig[i];
if (orig[i] == '\0') break;
}
if (FP.ParamType() == Interface_ParamReal) val = atof(text);
//Interface_FileReaderData::Fastof(FP.CValue());
else if (FP.ParamType() == Interface_ParamEnum) { // convention
if (FP.ParamType() == Interface_ParamReal)
val = Atof(text);
else if (FP.ParamType() == Interface_ParamEnum) { // convention
if (!pbrealform) {
if (testconv < 0) testconv = 0; //Interface_Static::IVal("iges.convert.read");
if (testconv > 0) {
@ -1266,7 +1266,7 @@ Standard_Boolean IGESData_ParamReader::ReadingReal (const Standard_Integer num,
// mais avec exposant (sinon ce serait un entier)
// -> un message avertissement + on ajoute le point puis on convertit
val = atof(text);//Interface_FileReaderData::Fastof(text);
val = Atof(text);
} else if (FP.ParamType() == Interface_ParamVoid) {
val = 0.0; // DEFAULT
} else {
@ -1317,8 +1317,8 @@ Standard_Boolean IGESData_ParamReader::ReadingReal
text[j++] = orig[i];
if (orig[i] == '\0') break;
}
if (FP.ParamType() == Interface_ParamReal) val = atof(text);
//Interface_FileReaderData::Fastof(FP.CValue());
if (FP.ParamType() == Interface_ParamReal)
val = Atof(text);
else if (FP.ParamType() == Interface_ParamEnum) { // convention
if (!pbrealform) {
if (testconv < 0) testconv = 0; //Interface_Static::IVal("iges.convert.read");
@ -1334,7 +1334,7 @@ Standard_Boolean IGESData_ParamReader::ReadingReal
// mais avec exposant (sinon ce serait un entier)
// -> un message avertissement + on ajoute le point puis on convertit
val = atof(text);//Interface_FileReaderData::Fastof(text);
val = Atof(text);
} else if (FP.ParamType() == Interface_ParamVoid) {
val = 0.0; // DEFAULT
} else {

View File

@ -125,7 +125,7 @@ void IGESGeom_ToolCircularArc::OwnCheck
Standard_Real ratio = Abs(Rad1 - Rad2) / (Rad1+Rad2);
if (ratio > eps) {
char mess[80];
sprintf(mess,"Radius at Start & End Points, relative gap over %f",
Sprintf(mess,"Radius at Start & End Points, relative gap over %f",
Interface_MSG::Intervalled (ratio));
ach.AddFail(mess,"Radius at Start & End Points, relative gap over %f");
}

View File

@ -217,7 +217,7 @@ void IGESGeom_ToolConicArc::OwnCheck(const Handle(IGESGeom_ConicArc)& ent,
//Standard_Real eq = (A*x*x + B*x*y + C*y*y + D*x + E*y + F);
// These messages are transfered in the translation procedure
/* if (eq < -eps || eq > eps) {
sprintf(mess,"Start point does not satisfy conic equation, gap over %f",
Sprintf(mess,"Start point does not satisfy conic equation, gap over %f",
Interface_MSG::Intervalled(eq));
ach.AddFail(mess,"Start point does not satisfy conic equation, gap over %f");
@ -228,7 +228,7 @@ void IGESGeom_ToolConicArc::OwnCheck(const Handle(IGESGeom_ConicArc)& ent,
//y = ent->EndPoint().Y();
//eq = (A*x*x + B*x*y + C*y*y + D*x + E*y + F);
/* if (eq < -eps || eq > eps) {
sprintf(mess,"End point does not satisfy conic equation, gap over %f",
Sprintf(mess,"End point does not satisfy conic equation, gap over %f",
Interface_MSG::Intervalled(eq));
ach.AddFail(mess,"End point does not satisfy conic equation, gap over %f");
}

View File

@ -244,7 +244,7 @@ void IGESGeom_ToolPlane::OwnCheck(const Handle(IGESGeom_Plane)& ent,
C * ent->SymbolAttach().Z() - D;
if ( ec > eps || ec < -eps) {
char mess[80];
sprintf(mess,"Symbol Attach not in the Plane, gap/equation over %f",
Sprintf(mess,"Symbol Attach not in the Plane, gap/equation over %f",
Interface_MSG::Intervalled(ec));
ach.SendWarning(mess,"Symbol Attach not in the Plane");

View File

@ -290,8 +290,8 @@ static int initActivator = 0;
}
Standard_Real Rmin=0., Rmax=0.;
if (argc > 4) {
Rmin = atof(pilot->Word(4).ToCString());
Rmax = atof(pilot->Word(5).ToCString());
Rmin = Atof(pilot->Word(4).ToCString());
Rmax = Atof(pilot->Word(5).ToCString());
if (Rmin <= 0 || Rmax <= 0) { cout<<"intervalle : donner reels > 0"<<endl; return IFSelect_RetError; }
}
Handle(IGESSelect_FloatFormat) fm = new IGESSelect_FloatFormat;

View File

@ -99,9 +99,9 @@ IGESSelect_Dumper::IGESSelect_Dumper () { }
if (hasrange) {
char flotrange[20];
file.SendText(forminrange.ToCString());
sprintf(flotrange,"%f",rangemin);
Sprintf(flotrange,"%f",rangemin);
file.SendText(flotrange);
sprintf(flotrange,"%f",rangemax);
Sprintf(flotrange,"%f",rangemax);
file.SendText(flotrange);
}
return Standard_True;
@ -214,8 +214,8 @@ IGESSelect_Dumper::IGESSelect_Dumper () { }
if (file.NbParams() >= 5) {
//char flotrange[20]; //szv#4:S4163:12Mar99 unused
Standard_Real rangemin, rangemax;
rangemin = atof (file.ParamValue(4).ToCString());
rangemax = atof (file.ParamValue(5).ToCString());
rangemin = Atof (file.ParamValue(4).ToCString());
rangemax = Atof (file.ParamValue(5).ToCString());
ff->SetFormatForRange (file.ParamValue(3).ToCString(),rangemin,rangemax);
}
item = ff;

View File

@ -36,9 +36,9 @@ IGESSelect_FloatFormat::IGESSelect_FloatFormat ()
} else {
char format[20];
char pourcent = '%'; char point = '.';
sprintf(format, "%c%d%c%dE",pourcent,digits+2,point,digits);
Sprintf(format, "%c%d%c%dE",pourcent,digits+2,point,digits);
themainform.AssignCat (format);
sprintf(format, "%c%d%c%df",pourcent,digits+2,point,digits);
Sprintf(format, "%c%d%c%df",pourcent,digits+2,point,digits);
theformrange.AssignCat (format);
}
therangemin = 0.1; therangemax = 1000.;
@ -90,7 +90,7 @@ IGESSelect_FloatFormat::IGESSelect_FloatFormat ()
lab.AssignCat (themainform);
if (theformrange.Length() > 0) {
char mess[30];
// sprintf(mess,", in range %f %f %s",
// Sprintf(mess,", in range %f %f %s",
// therangemin,therangemax,theformrange.ToCString());
// lab.AssignCat(mess);
// ... FloatFormat a droit aussi a un beau format pour son propre compte ...

View File

@ -197,11 +197,11 @@ Standard_Integer IGESToBRep_Reader::LoadFile (const Standard_CString filename)
Standard_Integer minute, hour;
c.Show(second, minute, hour,cpu);
if (hour > 0)
sprintf(t,"%dh:%dm:%.2fs",hour,minute,second);
Sprintf(t,"%dh:%dm:%.2fs",hour,minute,second);
else if (minute > 0)
sprintf(t,"%dm:%.2fs",minute,second);
Sprintf(t,"%dm:%.2fs",minute,second);
else
sprintf(t,"%.2fs",second);
Sprintf(t,"%.2fs",second);
// Sending of message : End of Loading
Msg8.Arg(t);
TF->Send (Msg8, Message_Info);
@ -467,11 +467,11 @@ void IGESToBRep_Reader::TransferRoots (const Standard_Boolean onlyvisible)
Standard_Integer minute, hour;
c.Show(second, minute, hour,cpu);
if (hour > 0)
sprintf(t,"%dh:%dm:%.2fs",hour,minute,second);
Sprintf(t,"%dh:%dm:%.2fs",hour,minute,second);
else if (minute > 0)
sprintf(t,"%dm:%.2fs",minute,second);
Sprintf(t,"%dm:%.2fs",minute,second);
else
sprintf(t,"%.2fs",second);
Sprintf(t,"%.2fs",second);
// Sending of message : End of Loading
msg2065.Arg(t);
TF->Send (msg2065, Message_Info);
@ -588,11 +588,11 @@ Standard_Boolean IGESToBRep_Reader::Transfer(const Standard_Integer num)
Standard_Integer minute, hour;
c.Show(second, minute, hour,cpu);
if (hour > 0)
sprintf(t,"%dh:%dm:%.2fs",hour,minute,second);
Sprintf(t,"%dh:%dm:%.2fs",hour,minute,second);
else if (minute > 0)
sprintf(t,"%dm:%.2fs",minute,second);
Sprintf(t,"%dm:%.2fs",minute,second);
else
sprintf(t,"%.2fs",second);
Sprintf(t,"%.2fs",second);
// Sending of message : End of Loading
msg2065.Arg(t);
TF->Send (msg2065, Message_Info);

View File

@ -405,10 +405,10 @@ static const Standard_Real vtab[] =
je = jx*9;
if (jx > jj) {
valdiv = 1.;
if (jx >= 100 || grexp) return atof(ligne); // issue de secours
if (jx >= 100 || grexp) return Atof(ligne); // issue de secours
} else {
k = jj*9;
if (jj >= 100 || grexp || (k-je >= 900)) return atof(ligne); // issue de secours
if (jj >= 100 || grexp || (k-je >= 900)) return Atof(ligne); // issue de secours
valdiv = vtab[k-je];
je = k;
}

View File

@ -55,8 +55,8 @@ Interface_FloatWriter::Interface_FloatWriter (const Standard_Integer chars)
strcpy(therangeform ,"%f");
} else {
char pourcent = '%'; char point = '.';
sprintf(themainform, "%c%d%c%dE",pourcent,chars+2,point,chars);
sprintf(therangeform, "%c%d%c%df",pourcent,chars+2,point,chars);
Sprintf(themainform, "%c%d%c%dE",pourcent,chars+2,point,chars);
Sprintf(therangeform, "%c%d%c%df",pourcent,chars+2,point,chars);
}
therange1 = 0.1; therange2 = 1000.;
thezerosup = Standard_True;
@ -111,10 +111,10 @@ Standard_Integer Interface_FloatWriter::Convert (const Standard_Real val,
//
if ( (val >= R1 && val < R2) ||
(val <= -R1 && val > -R2) ) {
sprintf(pText,rangeform,val);
Sprintf(pText,rangeform,val);
}
else {
sprintf(pText,mainform,val);
Sprintf(pText,mainform,val);
}
if (zsup) {

View File

@ -184,9 +184,9 @@ Standard_Boolean Interface_Static::Init
else if (init[0] == 'i' && init[2] == 'a')
unstat->SetIntegerLimit (Standard_True ,atoi(&init[iblc]));
else if (init[0] == 'r' && init[2] == 'i')
unstat->SetRealLimit (Standard_False,atof(&init[iblc]));
unstat->SetRealLimit (Standard_False,Atof(&init[iblc]));
else if (init[0] == 'r' && init[2] == 'a')
unstat->SetRealLimit (Standard_True ,atof(&init[iblc]));
unstat->SetRealLimit (Standard_True ,Atof(&init[iblc]));
else if (init[0] == 'u')
unstat->SetUnitDef (&init[iblc]);
else if (init[0] == 'e' && init[1] == 'm')
@ -249,12 +249,12 @@ Standard_CString Interface_Static::CDef
if (part[0] == 'i') {
Standard_Integer ilim;
if (!stat->IntegerLimit((part[2] == 'a'),ilim)) return "";
sprintf(defmess,"%d",ilim); return defmess;
Sprintf(defmess,"%d",ilim); return defmess;
}
if (part[0] == 'r') {
Standard_Real rlim;
if (!stat->RealLimit((part[2] == 'a'),rlim)) return "";
sprintf(defmess,"%f",rlim); return defmess;
Sprintf(defmess,"%f",rlim); return defmess;
}
if (part[0] == 'u') return stat->UnitDef();
return "";

View File

@ -70,9 +70,9 @@ Handle(Dynamic_Parameter) Materials_MaterialDefinition::Switch(
fr = sscanf(avalue,"%s%s%s",value1,value2,value3);
Handle(Materials_Color) pcolor =
new Materials_Color(Quantity_Color(atof(value1),
atof(value2),
atof(value3),
new Materials_Color(Quantity_Color(Atof(value1),
Atof(value2),
Atof(value3),
Quantity_TOC_RGB));
objectparameter = new Dynamic_ObjectParameter(aname,pcolor);
parameter = *(Handle_Dynamic_Parameter*)&objectparameter;

View File

@ -143,13 +143,13 @@ Materials_MaterialsDictionary::Materials_MaterialsDictionary()
if (!strcasecmp(type,"Materials_Color"))
{
Quantity_Color color
(atof(value1),atof(value2),atof(value3),Quantity_TOC_RGB);
(Atof(value1),Atof(value2),Atof(value3),Quantity_TOC_RGB);
pcolor = new Materials_Color(color);
material->Parameter(name,pcolor);
}
else if(!strcasecmp(type,"Standard_Real"))
{
material->Parameter(name,atof(value1));
material->Parameter(name,Atof(value1));
}
else if(!strcasecmp(type,"Standard_CString"))
{

View File

@ -199,11 +199,11 @@ static Standard_Integer incrementalmesh(Draw_Interpretor& di, Standard_Integer n
di << " null shapes is not allowed here\n";
return 0;
}
Standard_Real aDeflection = atof(argv[2]);
Standard_Real aDeflection = Draw::Atof(argv[2]);
Standard_Boolean isInParallel = Standard_False;
if (nbarg == 4) {
isInParallel = atoi(argv[3]) == 1;
isInParallel = Draw::Atoi(argv[3]) == 1;
}
di << "Incremental Mesh, multi-threading "
<< (isInParallel ? "ON\n" : "OFF\n");
@ -280,17 +280,17 @@ static Standard_Integer fastdiscret(Draw_Interpretor& di, Standard_Integer nbarg
TopoDS_Shape S = DBRep::Get(argv[1]);
if (S.IsNull()) return 1;
const Standard_Real d = atof(argv[2]);
const Standard_Real d = Draw::Atof(argv[2]);
Standard_Boolean WithShare = Standard_True;
if (nbarg > 3) WithShare = atoi(argv[3]);
if (nbarg > 3) WithShare = Draw::Atoi(argv[3]);
Bnd_Box B;
BRepBndLib::Add(S,B);
BRepMesh_FastDiscret MESH(d,0.5,B,WithShare,Standard_True,Standard_False,Standard_True);
//Standard_Integer NbIterations = MESH.NbIterations();
//if (nbarg > 4) NbIterations = atoi(argv[4]);
//if (nbarg > 4) NbIterations = Draw::Atoi(argv[4]);
//MESH.NbIterations() = NbIterations;
di<<"Starting FastDiscret with :"<<"\n";
@ -472,19 +472,19 @@ static Standard_Integer triangule(Draw_Interpretor& di, Standard_Integer nbarg,
TopoDS_Shape S = DBRep::Get(id1);
if (S.IsNull()) return 1;
di << argv[1] << " ";
Standard_Real Deflect=atof(argv[3]);
Standard_Real Deflect=Draw::Atof(argv[3]);
if (Deflect<=0.) {
di << " Donner la fleche !" << "\n";
return 1;
}
if (nbarg >4) {
save = (atoi(argv[4])==1);
save = (Draw::Atoi(argv[4])==1);
}
Standard_Boolean partage=Standard_True;
if (nbarg>5) {
partage=atoi(argv[5])==1;
partage=Draw::Atoi(argv[5])==1;
}
Handle(MeshTest_DrawableMesh) DM =
@ -664,7 +664,7 @@ static Standard_Integer medge (Draw_Interpretor&, Standard_Integer n, const char
Standard_Integer i,j,e;
TColStd_SequenceOfInteger& eseq = D->Edges();
for (i = 2; i < n; i++) {
e = atoi(a[i]);
e = Draw::Atoi(a[i]);
if (e > 0)
eseq.Append(e);
else if (e < 0) {
@ -702,7 +702,7 @@ static Standard_Integer mvertex (Draw_Interpretor&, Standard_Integer n, const ch
Standard_Integer i,j,v;
TColStd_SequenceOfInteger& vseq = D->Vertices();
for (i = 2; i < n; i++) {
v = atoi(a[i]);
v = Draw::Atoi(a[i]);
if (v > 0)
vseq.Append(v);
else if (v < 0) {
@ -739,7 +739,7 @@ static Standard_Integer triangle (Draw_Interpretor&, Standard_Integer n, const c
Standard_Integer i,j,v;
TColStd_SequenceOfInteger& tseq = D->Triangles();
for (i = 2; i < n; i++) {
v = atoi(a[i]);
v = Draw::Atoi(a[i]);
if (v > 0)
tseq.Append(v);
else if (v < 0) {
@ -810,12 +810,12 @@ Handle(BRepMesh_DataStructureOfDelaun) struc = D->Mesh()->Result();
Standard_Integer in=1;
if (argc>=3) {
in=atoi(argv[2]);
in=Draw::Atoi(argv[2]);
in=Max(1,in);
}
Standard_Integer nbn=in;
if (argc>=4) {
nbn=atoi(argv[3]);
nbn=Draw::Atoi(argv[3]);
nbn=Min(nbn,struc->NbNodes());
}
@ -850,12 +850,12 @@ if (D.IsNull()) return 1;
Handle(BRepMesh_DataStructureOfDelaun) struc=D->Mesh()->Result();
Standard_Integer il=1;
if (argc>=3) {
il=atoi(argv[2]);
il=Draw::Atoi(argv[2]);
il=Max(1, il);
}
Standard_Integer nbl=il;
if (argc>=4) {
nbl=atoi(argv[3]);
nbl=Draw::Atoi(argv[3]);
nbl=Min(nbl, struc->NbLinks());
}
@ -890,12 +890,12 @@ if (D.IsNull()) return 1;
Handle(BRepMesh_DataStructureOfDelaun) struc=D->Mesh()->Result();
Standard_Integer ie=1;
if (argc>=3) {
ie=atoi(argv[2]);
ie=Draw::Atoi(argv[2]);
ie=Max(1, ie);
}
Standard_Integer nbe=ie;
if (argc>=4) {
nbe=atoi(argv[3]);
nbe=Draw::Atoi(argv[3]);
nbe=Min(nbe, struc->NbElements());
}
@ -1429,7 +1429,7 @@ Standard_Integer onetriangulation(Draw_Interpretor&, Standard_Integer nbarg, con
}
}
sprintf(name, "%s_%i", "tr", nbshell);
Sprintf(name, "%s_%i", "tr", nbshell);
DrawTrSurf::Set(name, TFinale);
}
@ -1502,10 +1502,10 @@ Standard_Integer extrema(Draw_Interpretor& di, Standard_Integer nbarg, const cha
Handle(Geom_Curve) C = DrawTrSurf::GetCurve(argv[1]);
Standard_Real X, Y, Z, U0;
X = atof(argv[2]);
Y = atof(argv[3]);
Z = atof(argv[4]);
U0 = atof(argv[5]);
X = Draw::Atof(argv[2]);
Y = Draw::Atof(argv[3]);
Z = Draw::Atof(argv[4]);
U0 = Draw::Atof(argv[5]);
gp_Pnt P(X, Y, Z);
GeomAdaptor_Curve GC(C);
@ -1586,9 +1586,9 @@ Standard_Integer triedgepoints(Draw_Interpretor& di, Standard_Integer nbarg, con
P3d.Transform(aLoc.Transformation());
if( anEdgeMap.Extent() > 1 )
sprintf(p,"%d_%d",nbEdge,j);
Sprintf(p,"%d_%d",nbEdge,j);
else
sprintf(p,"%d",j);
Sprintf(p,"%d",j);
DBRep::Set( newname, BRepBuilderAPI_MakeVertex(P3d) );
di.AppendElement(newname);
}

View File

@ -29,6 +29,7 @@
#include <BRepMesh_IncrementalMesh.hxx>
#include <Bnd_Box.hxx>
#include <BRepMesh_PDiscretRoot.hxx>
#include <Draw.hxx>
#include <DBRep.hxx>
#include <TopTools_IndexedMapOfShape.hxx>
#include <TopExp.hxx>
@ -235,10 +236,10 @@ static Standard_Integer mpincmesh (Draw_Interpretor& , Standard_Integer n, const
return 0;
}
//
aDeflection=atof(a[2]);
aDeflection=Draw::Atof(a[2]);
aAngle=0.5;
if (n>3) {
aAngle=atof(a[3]);
aAngle=Draw::Atof(a[3]);
}
//
Handle(BRepMesh_DiscretRoot) aMeshAlgo = BRepMesh_DiscretFactory::Get().Discret (aS,
@ -276,7 +277,7 @@ static Standard_Integer triarea (Draw_Interpretor& di, int n, const char ** a)
if (shape.IsNull()) return 1;
Standard_Real anEps = -1.;
if (n > 2)
anEps = atof(a[2]);
anEps = Draw::Atof(a[2]);
TopTools_IndexedMapOfShape aMapF;
TopExp::MapShapes (shape, TopAbs_FACE, aMapF);
@ -526,7 +527,7 @@ static int mpparallel (Draw_Interpretor& di, Standard_Integer argc, const char**
{
if (argc == 2)
{
Standard_Boolean isParallelOn = atoi (argv[1]) == 1;
Standard_Boolean isParallelOn = Draw::Atoi (argv[1]) == 1;
BRepMesh_IncrementalMesh::SetParallelDefault (isParallelOn);
if (isParallelOn)
Standard::SetReentrant(Standard_True);

View File

@ -48,10 +48,10 @@ TCollection_AsciiString Message::FillTime (const Standard_Integer hour,
{
char t [30];
if (hour > 0)
sprintf (t, "%02dh:%02dm:%.2fs", hour, minute, second);
Sprintf (t, "%02dh:%02dm:%.2fs", hour, minute, second);
else if (minute > 0)
sprintf (t, "%02dm:%.2fs", minute, second);
Sprintf (t, "%02dm:%.2fs", minute, second);
else
sprintf (t, "%.2fs", second);
Sprintf (t, "%.2fs", second);
return TCollection_AsciiString (t);
}

View File

@ -170,7 +170,7 @@ Message_Msg& Message_Msg::Arg (const Standard_CString theString)
// print string according to format
char * sStringBuffer = new char [Max ((Standard_Integer)strlen(theString)+1, 1024)];
sprintf (sStringBuffer, aFormat.ToCString(), theString);
Sprintf (sStringBuffer, aFormat.ToCString(), theString);
TCollection_ExtendedString aStr ( sStringBuffer );
delete [] sStringBuffer;
sStringBuffer = 0;
@ -216,7 +216,7 @@ Message_Msg& Message_Msg::Arg (const Standard_Integer theValue)
// print string according to format
char sStringBuffer [64];
sprintf (sStringBuffer, aFormat.ToCString(), theValue);
Sprintf (sStringBuffer, aFormat.ToCString(), theValue);
TCollection_ExtendedString aStr ( sStringBuffer );
// replace the format placeholder by the actual string
@ -240,7 +240,7 @@ Message_Msg& Message_Msg::Arg (const Standard_Real theValue)
// print string according to format
char sStringBuffer [64];
sprintf (sStringBuffer, aFormat.ToCString(), theValue);
Sprintf (sStringBuffer, aFormat.ToCString(), theValue);
TCollection_ExtendedString aStr ( sStringBuffer );
// replace the format placeholder by the actual string

View File

@ -40,7 +40,7 @@ void MoniTool_Timer::Dump(Standard_OStream &ostr)
Standard_Real elapsed = seconds + minutes*60 + hours*3600;
char buff[1024];
sprintf ( buff, "Elapsed:%6.1f sec, CPU User:%9.4f sec, CPU Sys:%9.4f sec, hits: %d",
Sprintf ( buff, "Elapsed:%6.1f sec, CPU User:%9.4f sec, CPU Sys:%9.4f sec, hits: %d",
elapsed, user, system, myCount );
ostr << buff << endl;
@ -113,7 +113,7 @@ void MoniTool_Timer::DumpTimers (Standard_OStream &ostr)
}
//Handle(MoniTool_Timer) MT = iter.Value();
char buff[1024];
sprintf ( buff, "%-20s\t", stmp );
Sprintf ( buff, "%-20s\t", stmp );
ostr << "TIMER: " << buff;
//iter.Value()->Dump ( ostr );
Timer(stmp)->Dump(ostr);

View File

@ -156,11 +156,11 @@ static Standard_Boolean StaticPath(const Handle(TCollection_HAsciiString)& val)
def.AssignCat("Integer");
Standard_Integer ilim;
if (IntegerLimit(Standard_False, ilim)) {
sprintf(mess," >= %d",ilim);
Sprintf(mess," >= %d",ilim);
def.AssignCat(mess);
}
if (IntegerLimit(Standard_True, ilim)) {
sprintf(mess," <= %d",ilim);
Sprintf(mess," <= %d",ilim);
def.AssignCat(mess);
}
}
@ -169,11 +169,11 @@ static Standard_Boolean StaticPath(const Handle(TCollection_HAsciiString)& val)
def.AssignCat("Real");
Standard_Real rlim;
if (RealLimit(Standard_False, rlim)) {
sprintf(mess," >= %f",rlim);
Sprintf(mess," >= %f",rlim);
def.AssignCat(mess);
}
if (RealLimit(Standard_True, rlim)) {
sprintf(mess," <= %f",rlim);
Sprintf(mess," <= %f",rlim);
def.AssignCat(mess);
}
if (theunidef.Length() > 0)
@ -184,12 +184,12 @@ static Standard_Boolean StaticPath(const Handle(TCollection_HAsciiString)& val)
def.AssignCat("Enum");
Standard_Integer startcase, endcase; Standard_Boolean match;
EnumDef (startcase,endcase,match);
sprintf(mess," [%s%d-%d]",(match ? "in " : ""),startcase,endcase);
Sprintf(mess," [%s%d-%d]",(match ? "in " : ""),startcase,endcase);
def.AssignCat(mess);
for (Standard_Integer i = startcase; i <= endcase; i ++) {
Standard_CString enva = EnumVal(i);
if (enva[0] == '?' || enva[0] == '\0') continue;
sprintf(mess," %d:%s",i,enva);
Sprintf(mess," %d:%s",i,enva);
def.AssignCat (mess);
}
if (!theeadds.IsNull()) {
@ -198,7 +198,7 @@ static Standard_Boolean StaticPath(const Handle(TCollection_HAsciiString)& val)
for (listadd.Start(); listadd.More(); listadd.Next()) {
Standard_CString enva = listadd.Name().ToCString();
if (enva[0] == '?') continue;
sprintf(mess,":%d ",listadd.Value());
Sprintf(mess,":%d ",listadd.Value());
def.AssignCat (enva);
def.AssignCat (mess);
}
@ -216,7 +216,7 @@ static Standard_Boolean StaticPath(const Handle(TCollection_HAsciiString)& val)
case MoniTool_ValueText : {
def.AssignCat("Text");
if (themaxlen > 0) {
sprintf (mess," <= %d C.",themaxlen);
Sprintf (mess," <= %d C.",themaxlen);
def.AssignCat (mess);
}
break;
@ -280,9 +280,9 @@ static Standard_Boolean StaticPath(const Handle(TCollection_HAsciiString)& val)
else if (init[0] == 'i' && init[2] == 'a') // imax ival
SetIntegerLimit (Standard_True ,atoi(&init[iblc]));
else if (init[0] == 'r' && init[2] == 'i') // rmin rval
SetRealLimit (Standard_False,atof(&init[iblc]));
SetRealLimit (Standard_False,Atof(&init[iblc]));
else if (init[0] == 'r' && init[2] == 'a') // rmax rval
SetRealLimit (Standard_True ,atof(&init[iblc]));
SetRealLimit (Standard_True ,Atof(&init[iblc]));
else if (init[0] == 'u') // unit name
SetUnitDef (&init[iblc]);
else if (init[0] == 'e' && init[1] == 'm') // ematch istart

View File

@ -16,7 +16,6 @@ OSD_signal.cxx
OSD_signal_WNT.cxx
OSD_ThreadFunction.hxx
OSD_PThread.hxx
OSD_Localizer.cxx
OSD_PerfMeter.cxx
OSD_PerfMeter.h
OSD_PerfMeter.hxx

View File

@ -176,13 +176,6 @@ is
class Thread;
---Purpose: A tool to manage threads
class Real2String;
---Purpose: Convertion of CString to Real and reciprocally
class Localizer;
---Purpose: Manages locale.
-----------------------------------------------
-- UNIX specific exceptions and enumeration --
-----------------------------------------------

View File

@ -28,17 +28,6 @@
# define finite isfinite
#endif
static Standard_Integer DecimalPoint = 0 ;
static void GetDecimalPoint() {
float F1 = (float ) 1.1 ;
char str[5] ;
sprintf(str,"%.1f",F1) ;
// printf("%s\n",str) ;
DecimalPoint = str[1] ;
}
// Convert Real to CString in format e with 16 significant digits.
// The decimal point character is always a period.
// The conversion is independant from current locale database
@ -48,20 +37,9 @@ Standard_Boolean OSD::RealToCString(const Standard_Real aReal,
{
char *p, *q ;
// Get the local decimal point character
if (!DecimalPoint)
GetDecimalPoint() ;
// Substitute it
// if (sprintf(aString,"%.15le",aReal) <= 0)
if (sprintf(aString,"%.17e",aReal) <= 0) //BUC60808
if (Sprintf(aString,"%.17e",aReal) <= 0) //BUC60808
return Standard_False ;
if ((p = strchr(aString,DecimalPoint)))
*p = '.' ;
// Suppress "e+00" and unsignificant 0's
if ((p = strchr(aString,'e'))) {
@ -83,25 +61,8 @@ Standard_Boolean OSD::RealToCString(const Standard_Real aReal,
Standard_Boolean OSD::CStringToReal(const Standard_CString aString,
Standard_Real& aReal)
{
const char *p;
char *endptr ;
// Get the local decimal point character
if (!DecimalPoint)
GetDecimalPoint() ;
const char *str = aString;
char buff[1024];
//if((p = strchr(aString,'.')))
if(DecimalPoint != '.' && (p = strchr(aString,'.'))&& ((p-aString) < 1000) )
{
strncpy(buff, aString, 1000);
buff[p-aString] = DecimalPoint ;
str = buff;
}
aReal = strtod(str,&endptr) ;
aReal = Strtod(aString, &endptr);
if (*endptr)
return Standard_False ;
return Standard_True;

View File

@ -1,60 +0,0 @@
-- Created on: 2010-08-27
-- Created by: Paul SUPRYATKIN
-- Copyright (c) 2010-2012 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.
--
-- 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.
--
-- 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.
class Localizer from OSD
---Purpose: Define the locale.
is
Create ( Category : Integer from Standard;
Locale : CString from Standard);
---Purpose: Set locale
---Level: Public
Restore( me: in out );
---Purpose: Restore previously locale
---Level: Public
SetLocale( me: in out;
Category : Integer from Standard;
Locale : CString from Standard);
---Purpose: Set locale
---Level: Public
Locale( me )
returns CString from Standard;
---Purpose: Get locale
---Level: Public
Category( me )
returns Integer from Standard;
---Purpose: Get Gategory
---Level: Public
fields
myLocale : CString from Standard;
myCategory : Integer from Standard;
end Localizer from OSD;

View File

@ -1,54 +0,0 @@
// Created on: 2010-08-27
// Created by: Paul SUPRYATKIN
// Copyright (c) 2010-2012 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.
//
// 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.
//
// 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.
#include <OSD_Localizer.hxx>
#include <Standard.hxx>
#include <locale.h>
OSD_Localizer::OSD_Localizer(const Standard_Integer Category,const Standard_CString Locale )
{
SetLocale( Category, Locale );
}
void OSD_Localizer::Restore()
{
setlocale( myCategory, myLocale );
}
void OSD_Localizer::SetLocale(const Standard_Integer Category,const Standard_CString Locale )
{
myLocale = setlocale( Category, 0 );
myCategory = Category;
setlocale( Category, Locale );
}
Standard_CString OSD_Localizer::Locale() const
{
return myLocale;
}
Standard_Integer OSD_Localizer::Category() const
{
return myCategory;
}

Some files were not shown because too many files have changed in this diff Show More