1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-09 13:22:24 +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

@@ -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);