}
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
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
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);
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);
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;
#include <Geom_Curve.hxx>
#include <DrawTrSurf.hxx>
+#include <Draw.hxx>
#include <DBRep.hxx>
#include <IntTools_Tools.hxx>
aTol=1.e-7;
if (n>2) {
- aTol=atof(a[2]);
+ aTol=Draw::Atof(a[2]);
if (aTol<=0.) {
aTol=1.e-7;
}
#include <stdio.h>
+#include <Draw.hxx>
#include <Draw_Interpretor.hxx>
#include <TopoDS.hxx>
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";
#include <TopAbs.hxx>
#include <TopAbs_State.hxx>
+#include <Draw.hxx>
#include <DBRep.hxx>
#include <DrawTrSurf.hxx>
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();
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();
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);
}
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;
}
aTol=1.e-7;
if (n==4) {
- aTol=atof(a[3]);
+ aTol=Draw::Atof(a[3]);
}
//
BRepClass3d_SolidClassifier aSC(aS);
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;
}
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;
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;
}
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;
}
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;
}
#include <stdio.h>
+#include <Draw.hxx>
#include <Draw_Interpretor.hxx>
#include <TopoDS_Shape.hxx>
#include <DBRep.hxx>
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);
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";
#include <TColStd_IndexedMapOfTransient.hxx>
#include <TopoDS_Shape.hxx>
#include <TopoDS_Vertex.hxx>
+#include <Draw.hxx>
#include <DBRep.hxx>
#include <gp_Pnt2d.hxx>
//
Standard_Real aTolEMin=1.e-7;
if (n==3) {
- aTolEMin=atof(a[2]);
+ aTolEMin=Draw::Atof(a[2]);
}
//
// Edge Tolerances
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);
//
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);
//
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);
}
//
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);
}
//
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);
}
//
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);
}
//
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);
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();
//
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);
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);
}
//
if (anErrorStatus==6) {
- sprintf(buf,
+ Sprintf(buf,
"Warning: [PreparePaveBlocks()] Max.Dummy Shrunk Range for Edge %d\n", nE);
BOPTools_CheckResult aChRes;
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);
}
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;
}
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);
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]);
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);
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;
}
di << " Current Precision = " << BRepBuilderAPI::Precision() << "\n";
}
else {
- BRepBuilderAPI::Precision(atof(a[1]));
+ BRepBuilderAPI::Precision(Draw::Atof(a[1]));
}
return 0;
}
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);
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++;
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,
#include <Draw_Interpretor.hxx>
#include <BRepTest.hxx>
+#include <Draw.hxx>
#include <DBRep.hxx>
#include <BRepFilletAPI_MakeChamfer.hxx>
#include <TopAbs_ShapeEnum.hxx>
// 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);
}
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()) )
}
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())
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));
}
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));
}
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));
}
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 << " " ;
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";
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()) {
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()) {
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)
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)
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)
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)
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)
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)
- 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;
}
- 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;
}
- 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;
}
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<<" ";
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<<" ";
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<<" ";
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<<" ";
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]);
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;
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);
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());
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);
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;
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;
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;
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;
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;
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;
}
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;
}
case 'l':
i++;
if (i >= n) goto badargs;
- length = atof(a[i]);
+ length = Draw::Atof(a[i]);
move = line;
break;
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;
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);
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
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;
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;
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;
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;
}
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;
}
case 'l':
i++;
if (i >= n) goto badargs;
- length = atof(a[i]);
+ length = Draw::Atof(a[i]);
move = line;
break;
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;
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);
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
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;
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;
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;
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;
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++) {
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());
}
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;
//-----------------------------------------------------
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);
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++) {
//---------------------------------------------------------------
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";}
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;
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;
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;
}
//#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;
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);
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);
}
#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 << " ";
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 << " ";
{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 << " " ;
i = 0;
for (; its.More(); its.Next()) {
i++;
- sprintf(p,"%d",i);
+ Sprintf(p,"%d",i);
DBRep::Set(newname,its.Value());
}
if (i >= 2) {
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));
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);
}
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);
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);
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);
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();
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()) {
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)
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);
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")) {
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);
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;
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;
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);
}
}
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;
}
}
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));
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;
}
}
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;
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);
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;
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()) {
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();
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);
}
return 1;
}
if (narg == 4) {
- Standard_Real Val = atof(a[3]);
+ Standard_Real Val = Draw::Atof(a[3]);
if (Kas == 1) {
thePrism.Perform(Val);
}
}
}
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);
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;
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;
}
}
else if (Kas == 3) {
- Rad = atof(a[3]);
+ Rad = Draw::Atof(a[3]);
if (Rad != 0.) {
S = theShapeTop;
TopExp_Explorer exp;
}
}
}
- Rad = atof(a[4]);
+ Rad = Draw::Atof(a[4]);
if (Rad != 0.) {
S = theShapeBottom;
TopExp_Explorer exp;
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);
}
}
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);
}
}
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':
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;
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));
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());
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);
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);
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;
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);
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<< " ";
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<< " ";}
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;
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);
}
}
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);
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();
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) {
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);
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);
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));
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);
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();
//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;
#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,
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 );
if (! F.IsNull())
i++;
- Order = atoi( a[i++] );
+ Order = Draw::Atoi( a[i++] );
if (F.IsNull())
MakeFilling.Add( E, (GeomAbs_Shape)Order, Standard_False );
}
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));
di<<"Wrong parameters"<<"\n";
return 1;
}
- Order = atoi( a[i++] );
+ Order = Draw::Atoi( a[i++] );
MakeFilling.Add( U, V, F, (GeomAbs_Shape)Order );
}
}
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
{
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;
//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;
#include <BRepTest.hxx>
+#include <Draw.hxx>
#include <Draw_Interpretor.hxx>
#include <DBRep.hxx>
#include <DrawTrSurf.hxx>
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;
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);
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;
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);
}
}
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);
}
}
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;
//
aTol=1.e-7;
if (n==3) {
- aTol=atof(a[2]);
+ aTol=Draw::Atof(a[2]);
}
//
BRepClass3d_SolidClassifier aSC(aS);
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 {
// 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;
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;
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;
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;
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;
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;
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<<" ";
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;
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<<" ";
}
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);
}
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);
{
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
}
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";
}
else
{
- if (atof (theArgv[i]))
- aTol = atof (theArgv[i]);
+ if (Draw::Atof (theArgv[i]))
+ aTol = Draw::Atof (theArgv[i]);
}
}
}
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;
}
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);
}
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;
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;
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);
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();
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);
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")) {
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);
}
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]));
}
}
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,
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;
// 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());
}
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()) {
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 ;
}
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;
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;
if (n <= 1)
di << "Current number of points : "<<discret<<"\n";
else {
- discret = atoi(a[1]);
+ discret = Draw::Atoi(a[1]);
}
return 0;
}
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();
Standard_Boolean added = M.Add(Sx);
if (added) {
i++;
- sprintf(p,"%d",i);
+ Sprintf(p,"%d",i);
DBRep::Set(newname,Sx);
di.AppendElement(newname);
}
}
for (Index=1 ;Index <= MaxShapes; Index++) {
- sprintf(p,"%d",Index);
+ Sprintf(p,"%d",Index);
DBRep::Set(newname,aShapes(OrderInd(Index)));
di.AppendElement(newname);
}
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();
}
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;
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;
}
else {
myIStream->precision(17);
+ myIStream->imbue (std::locale::classic()); // always use C locale
SetOpenMode(aMode);
}
}
}
else {
myOStream->precision(17);
+ myOStream->imbue (std::locale::classic()); // make sure to always use C locale
SetOpenMode(aMode);
}
}
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 ?
}
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 ?
}
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();
}
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);
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";
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";
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++;
}
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);
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);
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++;
}
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);
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;
}
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;
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);
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)
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));
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;
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;
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))
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);
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);
}
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);
}
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
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);
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);
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))
// 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);
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;
}
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);
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;
}
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);
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);
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;
}
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))
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++;
}
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))
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++;
}
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;
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);
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));
}
}
// 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));
// 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));
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;
}
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 ");
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;
}
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;
}
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);
}
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
sMultiTransactionManager = new TDocStd_MultiTransactionManager();
if(n > 1)
- sMultiTransactionManager->SetUndoLimit(atoi(a[1]));
+ sMultiTransactionManager->SetUndoLimit(Draw::Atoi(a[1]));
return 0;
}
}
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;
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();
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);
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);
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());
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);
// 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);
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++;
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()) {
// 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>
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);
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;
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;
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;
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())
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())
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;
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;
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;
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;
}
}
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);
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);
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;
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;
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);
}
}
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;
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());
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;
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);
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);
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)
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
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()) {
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()) {
}
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);
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;
}
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 {
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
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 {
---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.
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);
} 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
extern Standard_Boolean Draw_Batch;
#endif
-#define atof(X) Draw::Atof(X)
-#define atoi(X) Draw::Atoi(X)
-
class Draw_SaveAndRestore {
public :
{
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;
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);
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;
}
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";
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];
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 :
__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);
}
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;
{
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);
}
}
// 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))) {
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);
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;
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";
}
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;
}
}
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);
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++) {
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++) {
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;
}
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;
}
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))
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 ;
}
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;
cout << "An exception was caught " << E << endl;
- if (cc && atoi(cc)) {
+ if (cc && Draw::Atoi(cc)) {
#ifdef WNT
Tcl_Exit(0);
#else
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;
}
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;
}
// 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
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() );
}
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;"
}
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 );
}
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());
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);
return 1;
}
- Standard_Real aData = atof(argv[1]);
+ Standard_Real aData = Draw::Atof(argv[1]);
Standard_CString aUnit = argv[2];
UnitsAPI::SetLocalSystem(UnitsAPI_MDTV);
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
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;
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;
}
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;
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);
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);
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;
}
// Atof and Atoi
//=======================================================================
-#undef atof
-#undef atoi
-
static Standard_Boolean Numeric(char c)
{
return (c == '.' || (c >= '0' && c <= '9'));
*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 ...
x = 0;
}
else
- x = atof(theCommands.Result());
+ x = Atof(theCommands.Result());
theCommands.Reset();
if (sv) {
theCommands << sv;
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);
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);
{
if (n < 4) {
if (n == 3) {
- NbUIsos = atoi(a[1]);
- NbVIsos = atoi(a[2]);
+ NbUIsos = Draw::Atoi(a[1]);
+ NbVIsos = Draw::Atoi(a[2]);
}
di << NbUIsos << " " << NbVIsos;
}
for (Standard_Integer i = 1; i < n - 2; i++) {
Handle(DrawTrSurf_Surface) DS = GetSurface(a[i]);
if (!DS.IsNull()) {
- DS->ShowIsos(atoi(a[n-2]),atoi(a[n-1]));
+ DS->ShowIsos(Draw::Atoi(a[n-2]),Draw::Atoi(a[n-1]));
Draw::Repaint();
}
}
else if (!strcmp(a[0],"discr")) {
if (n == 2)
- Discret = atoi(a[n-1]);
+ Discret = Draw::Atoi(a[n-1]);
di << Discret;
}
else if (!strcmp(a[0],"defle")) {
if (n == 2)
- Deflection = atof(a[n-1]);
+ Deflection = Draw::Atof(a[n-1]);
di << Deflection;
}
}
}
else if (!strcmp(a[0],"discr")) {
- D->SetDiscretisation(atoi(a[n-1]));
+ D->SetDiscretisation(Draw::Atoi(a[n-1]));
}
else if (!strcmp(a[0],"defle")) {
- D->SetDeflection(atof(a[n-1]));
+ D->SetDeflection(Draw::Atof(a[n-1]));
}
Draw::Repaint();
gp_Trsf T;
Standard_Integer i,last = n-1;
if (!strcmp(a[0],"pscale")) {
- Standard_Real s = atof(a[last]);
+ Standard_Real s = Draw::Atof(a[last]);
last--;
if (last < 4) return 1;
- gp_Pnt P(atof(a[last-2]),atof(a[last-1]),atof(a[last]));
+ gp_Pnt P(Draw::Atof(a[last-2]),Draw::Atof(a[last-1]),Draw::Atof(a[last]));
T.SetScale(P,s);
}
else if (!strcmp(a[0]+1,"mirror")) {
if (last < 4) return 1;
- gp_Pnt P(atof(a[last-2]),atof(a[last-1]),atof(a[last]));
+ gp_Pnt P(Draw::Atof(a[last-2]),Draw::Atof(a[last-1]),Draw::Atof(a[last]));
if (*a[0] == 'p') {
T.SetMirror(P);
}
else {
last -= 3;
if (last < 4) return 1;
- gp_Pnt O(atof(a[last-2]),atof(a[last-1]),atof(a[last]));
+ gp_Pnt O(Draw::Atof(a[last-2]),Draw::Atof(a[last-1]),Draw::Atof(a[last]));
last -= 3;
gp_Dir D(P.X(),P.Y(),P.Z());
if (*a[0] == 'l') {
else if (!strcmp(a[0],"translate")) {
if (last < 4) return 1;
- gp_Vec V(atof(a[last-2]),atof(a[last-1]),atof(a[last]));
+ gp_Vec V(Draw::Atof(a[last-2]),Draw::Atof(a[last-1]),Draw::Atof(a[last]));
last -= 3;
T.SetTranslation(V);
}
else if (!strcmp(a[0],"rotate")) {
if (last < 8) return 1;
- Standard_Real ang = atof(a[last]) * (M_PI / 180.0);
+ Standard_Real ang = Draw::Atof(a[last]) * (M_PI / 180.0);
last --;
- gp_Dir D(atof(a[last-2]),atof(a[last-1]),atof(a[last]));
+ gp_Dir D(Draw::Atof(a[last-2]),Draw::Atof(a[last-1]),Draw::Atof(a[last]));
last -= 3;
- gp_Pnt P(atof(a[last-2]),atof(a[last-1]),atof(a[last]));
+ gp_Pnt P(Draw::Atof(a[last-2]),Draw::Atof(a[last-1]),Draw::Atof(a[last]));
last -= 3;
T.SetRotation(gp_Ax1(P,D),ang);
}
gp_Trsf2d T;
Standard_Integer i,last = n-1;
if (!strcmp(a[0],"2dpscale")) {
- Standard_Real s = atof(a[last]);
+ Standard_Real s = Draw::Atof(a[last]);
last--;
if (last < 3) return 1;
- gp_Pnt2d P(atof(a[last-1]),atof(a[last]));
+ gp_Pnt2d P(Draw::Atof(a[last-1]),Draw::Atof(a[last]));
T.SetScale(P,s);
}
else if ( (!strcmp(a[0],"2dpmirror")) ||
(!strcmp(a[0],"2dlmirror")) ) {
if (last < 3) return 1;
- gp_Pnt2d P(atof(a[last-1]),atof(a[last]));
+ gp_Pnt2d P(Draw::Atof(a[last-1]),Draw::Atof(a[last]));
if (!strcmp(a[0],"2dpmirror")) {
T.SetMirror(P);
}
else {
last -= 2;
if (last < 3) return 1;
- gp_Pnt2d O(atof(a[last-1]),atof(a[last]));
+ gp_Pnt2d O(Draw::Atof(a[last-1]),Draw::Atof(a[last]));
last -= 2;
gp_Dir2d D(P.X(),P.Y());
T.SetMirror(gp_Ax2d(O,D));
else if (!strcmp(a[0],"2dtranslate")) {
if (last < 3) return 1;
- gp_Vec2d V(atof(a[last-1]),atof(a[last]));
+ gp_Vec2d V(Draw::Atof(a[last-1]),Draw::Atof(a[last]));
last -= 2;
T.SetTranslation(V);
}
else if (!strcmp(a[0],"2drotate")) {
if (last < 4) return 1;
- Standard_Real ang = atof(a[last]) * (M_PI / 180.0);
+ Standard_Real ang = Draw::Atof(a[last]) * (M_PI / 180.0);
last --;
- gp_Pnt2d P(atof(a[last-1]),atof(a[last]));
+ gp_Pnt2d P(Draw::Atof(a[last-1]),Draw::Atof(a[last]));
last -= 2;
T.SetRotation(P,ang);
}
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);
}
}
bary.Add(Nodes(t[j]).Coord());
bary.Multiply(1./3.);
- sprintf(text,"%d",i);
+ Sprintf(text,"%d",i);
dis.DrawString(P,text);
}
}
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));
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);
TCollection_AsciiString Expr_NumericValue::String() const
{
char val[100];
- sprintf(val,"%g",myValue);
+ Sprintf(val,"%g",myValue);
return TCollection_AsciiString(val);
}
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);
}
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);
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,
fields
- myStream : FStream from FSD;
- myRealConv : Real2String from OSD;
+ myStream : FStream from FSD;
end;
#include <FSD_CmpFile.ixx>
#include <OSD.hxx>
-#include <OSD_Real2String.hxx>
-
#include <Storage_StreamModeError.hxx>
#include <Storage_StreamUnknownTypeError.hxx>
#include <Standard_PCharacter.hxx>
}
else {
myStream.precision(17);
+ myStream.imbue (std::locale::classic()); // use always C locale
SetOpenMode(aMode);
}
}
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
}
//=======================================================================
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
}
//=======================================================================
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();
}
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;
}
else {
myStream.precision(17);
+ myStream.imbue (std::locale::classic()); // use always C locale
SetOpenMode(aMode);
}
}
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
}
//=======================================================================
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
}
//=======================================================================
//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++;
}
{
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];
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 << " ";
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);
// 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++;
}
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 << " ";
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];
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);
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 << " ";
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);
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++;
}
}
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) {
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;
}
}
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));
}
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 << " ";
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 << " ";
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 << " ";
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 << " ";
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 << " ";
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 << " ";
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 << " ";
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()) {
// 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]);
}
}
// 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]);
}
}
// 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]);
}
// 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]);
}
// 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]);
}
}
// 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]);
}
}
// 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]);
}
// 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]);
}
// 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]);
}
// 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]);
}
// 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]);
}
// 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]);
}
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(),
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 << " ";
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 << " ";
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 ;
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) ;
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) ;
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))));
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;
}
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;
}
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;
}
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))));
{
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;
}
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;
}
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();
{
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;
}
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;
}
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();
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;
}
} 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;
}
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;
}
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++;
}
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++;
}
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 {
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);
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;
}
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;
}
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();
{
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()) {
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)));
}
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) {
}
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()) ;
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);
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);
}
Standard_Integer nocp;
- nocp = atoi(a[2]);
+ nocp = Draw::Atoi(a[2]);
if(nocp < 2)
return 1;
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;
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;
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);
}
//
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;
}
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]);
}
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);
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);
}
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);
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;
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;
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));
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));
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));
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));
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));
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));
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));
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));
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));
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;
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;
}
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;
}
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;
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;
}
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;
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;
}
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);
}
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);
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;
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;
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;
{
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];
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 << " ";
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);
// 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++;
}
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 << " ";
return 1;
}
if(k < n)
- Tol = atof(a[k]);
+ Tol = Draw::Atof(a[k]);
if(!C2.IsNull())
{
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;
}
}
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;
}
}
if (! strcmp(a[3],"-D")) {
- DegMax = atoi(a[4]);
+ DegMax = Draw::Atoi(a[4]);
ific = 5;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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);
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++;
}
}
}
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++;
}
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++;
}
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);
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++;
}
}
}
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++;
}
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++;
}
{
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()) {
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 ;
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;
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;
{
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]);
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
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())
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())
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
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))
{
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]);
{
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]);
{
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);
}
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);
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--;
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--;
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);
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;
{
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);
}
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)
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)
{
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;
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,
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]);
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);
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])) ;
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));
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();
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));
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)
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);
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;
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) {
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);
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,
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
}
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 =
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);
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);
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++;
}
}
}
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');
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++;
}
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++;
}
}
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);
}
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));
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;
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);
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();
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));
}
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));
}
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));
}
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));
}
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));
}
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));
}
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;
}
kk++;
}
- if (kk<n) Tol = atof(a[kk]);
+ if (kk<n) Tol = Draw::Atof(a[kk]);
GeomConvert_CompBezierSurfacesToBSplineSurface Conv(BZ, Tol);
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;
// 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;
}
yasurf = Standard_True;
}
- Standard_Real dist = atof(a[3]);
+ Standard_Real dist = Draw::Atof(a[3]);
Handle(Geom_Geometry) result;
}
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;
}
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')
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--;
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) {
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;
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;
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;
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();
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;
}
{
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;
{
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]);
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);
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();
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;
// 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);
// 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);
// 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);
{
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);
{
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()) {
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);
}
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
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) {
// 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 {
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");
// 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 {
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");
}
//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");
//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");
}
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");
}
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;
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;
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;
} 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.;
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 ...
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);
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);
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);
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;
}
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;
//
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) {
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')
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 "";
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;
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"))
{
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");
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";
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 =
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) {
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) {
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) {
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());
}
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());
}
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());
}
}
}
- sprintf(name, "%s_%i", "tr", nbshell);
+ Sprintf(name, "%s_%i", "tr", nbshell);
DrawTrSurf::Set(name, TFinale);
}
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);
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);
}
#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>
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,
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);
{
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);
{
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);
}
// 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;
// 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
// 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
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;
}
//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);
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);
}
}
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)
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()) {
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);
}
case MoniTool_ValueText : {
def.AssignCat("Text");
if (themaxlen > 0) {
- sprintf (mess," <= %d C.",themaxlen);
+ Sprintf (mess," <= %d C.",themaxlen);
def.AssignCat (mess);
}
break;
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
OSD_signal_WNT.cxx
OSD_ThreadFunction.hxx
OSD_PThread.hxx
-OSD_Localizer.cxx
OSD_PerfMeter.cxx
OSD_PerfMeter.h
OSD_PerfMeter.hxx
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 --
-----------------------------------------------
# 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
{
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'))) {
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;
+++ /dev/null
--- 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;
-
-
+++ /dev/null
-// 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;
-}
-
-
+++ /dev/null
--- Created on: 2002-01-25
--- Created by: doneux <doneux@samcef.com>
--- Copyright (c) 2002-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 Real2String from OSD
-
- ---Purpose: Convertion of CString to Real and reciprocally
-
-is
-
- Create
- returns Real2String from OSD;
-
- RealToCString(me;
- aReal: Real;
- aString:out PCharacter)
- returns Boolean ;
- ---Purpose:
- -- Converts aReal into aCstring in exponential format with maximum
- -- 17 digits. The size of the destination string must be sufficient (at least 23 characters)
- -- The decimal separator account for locale setting, but
- -- neither thousand separator nor grouping of digits in the output string.
- --
-
- CStringToReal(me: in out;
- aString: CString;
- aReal: out Real) returns Boolean ;
- ---Purpose:
- -- Converts aCstring representing a real. The first occurence of the decimal separator
- -- (comma or period) defines it values for further readings.
- -- Neither thousand separator nor grouping of digits are allowed in the CString
-
-fields
-
- myReadDecimalPoint: Integer from Standard;
- myLocalDecimalPoint: Integer from Standard;
-
-end Real2String;
+++ /dev/null
-// Created on: 2002-01-25
-// Created by: doneux
-// Copyright (c) 2002-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.
-
-
-// Lastly modified by :
-// +---------------------------------------------------------------------------+
-// ! doneux ! Creation ! 06/17/02! %V%-1!
-// +---------------------------------------------------------------------------+
-
-#ifdef HAVE_CONFIG_H
-# include <config.h>
-#endif
-
-#include <OSD_Real2String.ixx>
-#include <stdio.h>
-#if defined(HAVE_STDLIB_H) || defined(WNT)
-# include <stdlib.h>
-#endif
-
-//=======================================================================
-//function : OSD_Real2String
-//purpose :
-//=======================================================================
-
-OSD_Real2String::OSD_Real2String():
- myReadDecimalPoint(0)
-{
- float F1 = (float ) 1.1 ;
- char str[5] ;
-
- sprintf(str,"%.1f",F1) ;
- // printf("%s\n",str) ;
- myLocalDecimalPoint = str[1] ;
-}
-
-//=======================================================================
-//function : RealToCString
-//purpose :
-//=======================================================================
-
-Standard_Boolean OSD_Real2String::RealToCString(const Standard_Real theReal,
- Standard_PCharacter& theString) const
-{
- char *p, *q ;
-
- if (sprintf(theString,"%.17e",theReal) <= 0)
- return Standard_False ;
-
- // Suppress "e+00" and unsignificant 0's
-
- if ((p = strchr(theString,'e'))) {
- if (!strcmp(p,"e+00"))
- *p = 0 ;
- for (q = p-1 ; *q == '0' ; q--) ;
- if (q != p-1) {
-
- if (*q != myLocalDecimalPoint) q++ ;
-
- while (*p)
- *q++ = *p++ ;
- *q = 0 ;
- }
- }
- return Standard_True ;
-}
-
-//=======================================================================
-//function : CStringToReal
-//purpose :
-//=======================================================================
-
-Standard_Boolean OSD_Real2String::CStringToReal(const Standard_CString theString,
- Standard_Real& theReal)
-{
- char *endptr ;
-
- if (! theString) return Standard_False;
-
- // Get the decimal point character in the string (if any)
- if (!myReadDecimalPoint) {
- if (strchr(theString, ',')) myReadDecimalPoint = ',';
- else if (strchr(theString, '.')) myReadDecimalPoint = '.';
- }
-
-
- const char *str = theString;
- char buff[1024];
- if (myReadDecimalPoint) {
- if (myReadDecimalPoint != myLocalDecimalPoint) {
- const char * p;
- // replace the decimal point by the local one
- if(myReadDecimalPoint != myLocalDecimalPoint &&
- (p = strchr(theString,myReadDecimalPoint))&& ((p-theString) < 1000) )
- {
- strncpy(buff, theString, 1000);
- buff[p-theString] = myLocalDecimalPoint;
- str = buff;
- }
- }
- }
-
- theReal = strtod(str,&endptr) ;
- if (*endptr)
- return Standard_False ;
-
- return Standard_True;
-}
-
// purpose or non-infringement. Please see the License for the specific terms
// and conditions governing the rights and limitations under the License.
-/************************************************************************/
-/* Includes */
-/************************************************************************/
-
#include <OpenGl_GraphicDriver.hxx>
#include <OpenGl_Context.hxx>
#include <OpenGl_CView.hxx>
-#include <OSD_Localizer.hxx>
+
+#include <Standard_CLocaleSentry.hxx>
#ifdef HAVE_CONFIG_H
# include <config.h>
#include <gl2ps.h>
#endif
-#include <locale.h>
-
/************************************************************************/
/* Print Methods */
/************************************************************************/
GLint anErrCode = GL2PS_SUCCESS;
// gl2ps uses standard write functions and do not check locale
- OSD_Localizer locate (LC_NUMERIC, "C");
+ Standard_CLocaleSentry aLocaleSentry;
while (aBufferSize > 0)
{
break;
}
- locate.Restore();
return anErrCode == GL2PS_SUCCESS;
#else
return Standard_False;
//purpose :
//=======================================================================
-void PCDM_RetrievalDriver::Read(const TCollection_ExtendedString& theFileName,
+void PCDM_RetrievalDriver::Read(const TCollection_ExtendedString& theFileName,
const Handle(CDM_Document)& aNewDocument,
- const Handle(CDM_Application)& theApplication) {
-
-
- char *oldnum,*plocal ;
- plocal = setlocale(LC_NUMERIC, NULL) ;
- oldnum = new char[strlen(plocal)+1] ;
- strcpy(oldnum,plocal);
+ const Handle(CDM_Application)& theApplication)
+{
Standard_SStream aMsg;
Standard_Boolean Failure=Standard_False;
Handle(Storage_Schema) aSchema;
// read comments
aNewDocument->SetComments(theData->Comments());
-// on remet le LC_NUMERIC a la precedente valeur
- setlocale(LC_NUMERIC, oldnum) ;
- delete[] oldnum;
-
PCDM_DriverError_Raise_if(Failure,aMsg);
}
-void PCDM_StorageDriver::Write(const Handle(CDM_Document)& aDocument, const TCollection_ExtendedString& aFileName) {
-
- // on sauvegarde l'ancien LC_NUMERIC
- char *oldnum,*plocal ;
- plocal = setlocale(LC_NUMERIC, NULL) ;
- oldnum = new char[strlen(plocal)+1] ;
- strcpy(oldnum,plocal);
-
+void PCDM_StorageDriver::Write(const Handle(CDM_Document)& aDocument, const TCollection_ExtendedString& aFileName)
+{
Handle(Storage_Schema) theSchema=PCDM::Schema(SchemaName(),aDocument->Application());
TColStd_SequenceOfExtendedString theExtensions;
theSchema->Write(theFile,theData);
theFile.Close();
- // on remet le LC_NUMERIC a la precedente valeur
- setlocale(LC_NUMERIC, oldnum) ;
- delete[] oldnum;
-
if ( theData->ErrorStatus() != Storage_VSOk )
PCDM_DriverError::Raise(theData->ErrorStatusExtension().ToCString());
}
for(i = 0; i < astring->Length(); i++)
cnvbuf[i] = astring->Value(i+1);
cnvbuf[i] = 0;
- cnvreal = strtod(cnvbuf,&ptr);
+ cnvreal = Strtod(cnvbuf,&ptr);
if (ptr < cnvbuf+astring->Length()) return Standard_False;
else return Standard_True;
}
void Poly_CoherentNode::Dump(Standard_OStream& theStream) const
{
char buf[256];
- sprintf (buf, " X =%9.4f; Y =%9.4f; Z =%9.4f", X(), Y(), Z());
+ Sprintf (buf, " X =%9.4f; Y =%9.4f; Z =%9.4f", X(), Y(), Z());
theStream << buf << endl;
Poly_CoherentTriPtr::Iterator anIter(* myTriangles);
for (; anIter.More(); anIter.Next()) {
const Poly_CoherentTriangle& aTri = anIter.Value();
- sprintf (buf, " %5d %5d %5d", aTri.Node(0),aTri.Node(1),aTri.Node(2));
+ Sprintf (buf, " %5d %5d %5d", aTri.Node(0),aTri.Node(1),aTri.Node(2));
theStream << buf << endl;
}
}
}
TCollection_AsciiString aFileName = argv[1];
- Standard_Integer aMaxNbr = atoi(argv[2]);
+ Standard_Integer aMaxNbr = Draw::Atoi(argv[2]);
BRep_Builder aBld;
TopoDS_Shape aShape;
//cout << "OCC73_SelectionMode 4" << endl;
if(L.FindAttribute( TPrsStd_AISPresentation::GetID(), prs) ) {
if( argc == 4 ) {
- prs->SetSelectionMode((Standard_Integer)atoi(argv[3]));
+ prs->SetSelectionMode((Standard_Integer)Draw::Atoi(argv[3]));
TPrsStd_AISViewer::Update(L);
}
else {
}
TCollection_AsciiString name(argv[1]);
- Standard_Real Length = atof(argv[3]);
+ Standard_Real Length = Draw::Atof(argv[3]);
// Construction de l'AIS_PlaneTrihedron
Handle(AIS_PlaneTrihedron) theAISPlaneTri;
TCollection_AsciiString aName(argv[1]);
Handle(AIS_InteractiveObject) AISObj;
- Standard_Integer SelectMode = atoi(argv[2]);
+ Standard_Integer SelectMode = Draw::Atoi(argv[2]);
if(!aMap.IsBound2(aName)) {
di << "Use 'vdisplay' before" << "\n";
// purpose or non-infringement. Please see the License for the specific terms
// and conditions governing the rights and limitations under the License.
-
-
#include <QABugs.hxx>
+#include <Draw.hxx>
#include <Draw_Interpretor.hxx>
#include <DBRep.hxx>
#include <DrawTrSurf.hxx>
}
Standard_Boolean IsBRepAlgoAPI = Standard_True;
if (argc == 8) {
- Standard_Integer IsB = atoi(argv[7]);
+ Standard_Integer IsB = Draw::Atoi(argv[7]);
if (IsB != 1) {
IsBRepAlgoAPI = Standard_False;
#if ! defined(BRepAlgo_def01)
Handle(Geom_Surface) GS;
GS = DrawTrSurf::GetSurface(argv[1]);
if (GS.IsNull()) { di << "OCC486 FAULTY. Null surface /n";return 1;}
- gp_Pnt P3D( atof(argv[2]),atof(argv[3]),atof(argv[4]) );
+ gp_Pnt P3D( Draw::Atof(argv[2]),Draw::Atof(argv[3]),Draw::Atof(argv[4]) );
Standard_Real Tol = Precision::PConfusion();
Extrema_ExtPS myExtPS;
- if (argc > 5) du = atof(argv[5]);
- if (argc > 6) dv = atof(argv[6]);
+ if (argc > 5) du = Draw::Atof(argv[5]);
+ if (argc > 6) dv = Draw::Atof(argv[6]);
Standard_Real uf, ul, vf, vl;
GS->Bounds(uf, ul, vf, vl);
// Case:3 draftAngle = 10, slabThick = 40 --> Ok
//
// --------------------------------------------------
- Standard_Real draftAngle = atof(argv[1]);
- Standard_Real slabThick = atof(argv[2]);
+ Standard_Real draftAngle = Draw::Atof(argv[1]);
+ Standard_Real slabThick = Draw::Atof(argv[2]);
Standard_Real f1 = 75;
Standard_Real f2 = 35;
}
Standard_Boolean IsBRepAlgoAPI = Standard_True;
if (argc == 5) {
- Standard_Integer IsB = atoi(argv[4]);
+ Standard_Integer IsB = Draw::Atoi(argv[4]);
if (IsB != 1) {
IsBRepAlgoAPI = Standard_False;
#if ! defined(BRepAlgo_def01)
}
Standard_Boolean IsBRepAlgoAPI = Standard_True;
if (argc == 5) {
- Standard_Integer IsB = atoi(argv[4]);
+ Standard_Integer IsB = Draw::Atoi(argv[4]);
if (IsB != 1) {
IsBRepAlgoAPI = Standard_False;
#if ! defined(BRepAlgo_def01)
}
Standard_Boolean IsBRepAlgoAPI = Standard_True;
if (argc == 5) {
- Standard_Integer IsB = atoi(argv[4]);
+ Standard_Integer IsB = Draw::Atoi(argv[4]);
if (IsB != 1) {
IsBRepAlgoAPI = Standard_False;
#if ! defined(BRepAlgo_def01)
}
Standard_Boolean IsBRepAlgoAPI = Standard_True;
if (argc == 5) {
- Standard_Integer IsB = atoi(argv[4]);
+ Standard_Integer IsB = Draw::Atoi(argv[4]);
if (IsB != 1) {
IsBRepAlgoAPI = Standard_False;
#if ! defined(BRepAlgo_def01)
}
Standard_Boolean IsBRepAlgoAPI = Standard_True;
if (argc == 7) {
- Standard_Integer IsB = atoi(argv[6]);
+ Standard_Integer IsB = Draw::Atoi(argv[6]);
if (IsB != 1) {
IsBRepAlgoAPI = Standard_False;
#if ! defined(BRepAlgo_def02)
}
Standard_Boolean IsBRepAlgoAPI = Standard_True;
if (argc == 5) {
- Standard_Integer IsB = atoi(argv[4]);
+ Standard_Integer IsB = Draw::Atoi(argv[4]);
if (IsB != 1) {
IsBRepAlgoAPI = Standard_False;
#if ! defined(BRepAlgo_def01)
}
Standard_Boolean IsBRepAlgoAPI = Standard_True;
if (argc == 7) {
- Standard_Integer IsB = atoi(argv[6]);
+ Standard_Integer IsB = Draw::Atoi(argv[6]);
if (IsB != 1) {
IsBRepAlgoAPI = Standard_False;
#if ! defined(BRepAlgo_def01)
#include <QABugs.hxx>
+#include <Draw.hxx>
#include <Draw_Interpretor.hxx>
#include <DBRep.hxx>
#include <DrawTrSurf.hxx>
//
// Standard_Integer aNum = -1;
//
-// if(atoi(argv[2])) {
+// if(Draw::Atoi(argv[2])) {
// aNum = anAISCtx->OpenLocalContext();
// }
//
di << "Num points = " << plin.NbPoints() << "\n";
if(argc > 2) {
i++;
- sprintf(Ch,"%s_%i",argv[2],1);
+ Sprintf(Ch,"%s_%i",argv[2],1);
DBRep::Set(Ch,E);
}
}
#endif
Standard_Character *file1 = new Standard_Character [strlen(DD)+strlen(a[1])+2];
- sprintf(file1,"%s/%s",DD,a[1]);
+ Sprintf(file1,"%s/%s",DD,a[1]);
IGESToBRep_Reader reader;
Standard_Integer status = reader.LoadFile(file1);
}
// TopoDS_Wire myTopoDSWire = TopoDS::Wire(DBRep::Get("aa.brep"));
TopoDS_Wire myTopoDSWire = TopoDS::Wire(DBRep::Get(argv[1]));
- Standard_Real l = 0.5; //atof(argv[2]);
+ Standard_Real l = 0.5; //Draw::Atof(argv[2]);
// Find the first vertex of the wire
BRepTools_WireExplorer wire_exp(myTopoDSWire);
TopoDS_Vertex vlast;
GeomFill_Pipe aPipe(Handle(Geom_Curve)::DownCast( aCurveSeq(1) ),
Handle(Geom_Curve)::DownCast( aCurveSeq(2) ),
Handle(Geom_Curve)::DownCast( aCurveSeq(3) ),
- atof (a[5]) );
+ Draw::Atof (a[5]) );
if (n == 7) {
- aPipe.Perform(atof (a[6]), Standard_True);
+ aPipe.Perform(Draw::Atof (a[6]), Standard_True);
} else {
aPipe.Perform(Standard_True/*, Standard_True*/);
}
di << "Invalid input shape"<< "\n";
return 1;
}
- Standard_Real toler = atof(a[3]);
+ Standard_Real toler = Draw::Atof(a[3]);
TopoDS_Wire aWire = TopoDS::Wire(inputShape);
BRepLib_FindSurface FS(aWire, toler, Standard_True);
if(FS.Found()) {
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");
di<<sbf;
return 1;
}
if (aS.ShapeType()!=TopAbs_SOLID) {
- sprintf(sbf, " Shape type must be SOLID\n");
+ Sprintf(sbf, " Shape type must be SOLID\n");
di<<sbf;
return 1;
}
gp_Pnt aP(8., 9., 10.);
if (!DrawTrSurf::GetPoint(a[2], aP) ) {
- sprintf(sbf, " Null Point is not allowed here\n");
+ Sprintf(sbf, " Null Point is not allowed here\n");
di<<sbf;
return 1;
}
aTol=1.e-7;
if (n==4) {
- aTol=atof(a[3]);
+ aTol=Draw::Atof(a[3]);
}
//
BRepClass3d_SolidClassifier aSC(aS);
//
aState = aSC.State();
//
- sprintf(sbf, "The point is "); di<<sbf;
+ Sprintf(sbf, "The point is "); di<<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;
}
di<<sbf;
//
- sprintf(sbf, " shape\n");
+ Sprintf(sbf, " shape\n");
di<<sbf;
return 0;
}
Standard_Boolean IsBRepAlgoAPI = Standard_True;
if (nb == 2) {
- Standard_Integer IsB = atoi(a[1]);
+ Standard_Integer IsB = Draw::Atoi(a[1]);
if (IsB != 1) {
IsBRepAlgoAPI = Standard_False;
}
Standard_Real aDistDomain = 0.0;
Standard_Integer k = 3;
if(k < n)
- aTol = atof(a[k++]);
+ aTol = Draw::Atof(a[k++]);
if(k < n)
- aDistDomain = atof(a[k++]);
+ aDistDomain = Draw::Atof(a[k++]);
ShapeAnalysis_Edge sae;
if(sae.CheckOverlapping(e1,e2,aTol,aDistDomain)) {
// 2. Initialize parameters
gp_Pnt2d p2d;
- p2d.SetX ( atof(argv[2]) );
- p2d.SetY ( atof(argv[3]) );
- Standard_Real precuv = atof (argv[4] );
+ p2d.SetX ( Draw::Atof(argv[2]) );
+ p2d.SetY ( Draw::Atof(argv[3]) );
+ Standard_Real precuv = Draw::Atof (argv[4] );
// 3. Read shape
BRep_Builder B;
di<<"Usage : " << argv[0] << " LowerVector UpperVector InitialValueVector LowerRowMatrix UpperRowMatrix LowerColMatrix UpperColMatrix InitialValueMatrix\n";
return 1;
}
- Standard_Integer LowerVector = atoi(argv[1]);
- Standard_Integer UpperVector = atoi(argv[2]);
- Standard_Real InitialValueVector = atof(argv[3]);
- Standard_Integer LowerRowMatrix = atoi(argv[4]);
- Standard_Integer UpperRowMatrix = atoi(argv[5]);
- Standard_Integer LowerColMatrix = atoi(argv[6]);
- Standard_Integer UpperColMatrix = atoi(argv[7]);
- Standard_Real InitialValueMatrix = atof(argv[8]);
+ Standard_Integer LowerVector = Draw::Atoi(argv[1]);
+ Standard_Integer UpperVector = Draw::Atoi(argv[2]);
+ Standard_Real InitialValueVector = Draw::Atof(argv[3]);
+ Standard_Integer LowerRowMatrix = Draw::Atoi(argv[4]);
+ Standard_Integer UpperRowMatrix = Draw::Atoi(argv[5]);
+ Standard_Integer LowerColMatrix = Draw::Atoi(argv[6]);
+ Standard_Integer UpperColMatrix = Draw::Atoi(argv[7]);
+ Standard_Real InitialValueMatrix = Draw::Atof(argv[8]);
math_Vector Vector1(LowerVector, UpperVector);
math_Vector Vector2(LowerVector, UpperVector);
}
Standard_Boolean IsBRepAlgoAPI = Standard_True;
if (argc == 5) {
- Standard_Integer IsB = atoi(argv[4]);
+ Standard_Integer IsB = Draw::Atoi(argv[4]);
if (IsB != 1) {
IsBRepAlgoAPI = Standard_False;
// di << "Error: There is not BRepAlgo_Fuse class" << "\n";
gp_Pnt aPoint3d;
DrawTrSurf::GetPoint(argv[1],aPoint3d);
Handle (Geom_Surface) aSurface=DrawTrSurf::GetSurface(argv[2]);
- Standard_Real Umin=atof(argv[3]);
- Standard_Real Usup=atof(argv[4]);
- Standard_Real Vmin=atof(argv[5]);
- Standard_Real Vsup=atof(argv[6]);
+ Standard_Real Umin=Draw::Atof(argv[3]);
+ Standard_Real Usup=Draw::Atof(argv[4]);
+ Standard_Real Vmin=Draw::Atof(argv[5]);
+ Standard_Real Vsup=Draw::Atof(argv[6]);
if (aSurface.IsNull()) {
di << argv[2] << " Null surface \n" ;
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 {
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
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 {
Handle(TPrsStd_AISPresentation) prs;
if(L.FindAttribute( TPrsStd_AISPresentation::GetID(), prs) ) {
if( nb == 4 ) {
- prs->SetWidth(atof(arg[3]));
+ prs->SetWidth(Draw::Atof(arg[3]));
TPrsStd_AISViewer::Update(L);
}
else {
Handle(TPrsStd_AISPresentation) prs;
if(L.FindAttribute( TPrsStd_AISPresentation::GetID(), prs) ) {
if( nb == 4 ) {
- prs->SetMode(atoi(arg[3]));
+ prs->SetMode(Draw::Atoi(arg[3]));
TPrsStd_AISViewer::Update(L);
}
else {
Handle(TPrsStd_AISPresentation) prs;
if(L.FindAttribute( TPrsStd_AISPresentation::GetID(), prs) ) {
if( nb == 4 ) {
- prs->SetSelectionMode(atoi(arg[3]));
+ prs->SetSelectionMode(Draw::Atoi(arg[3]));
TPrsStd_AISViewer::Update(L);
}
else {
}
Standard_Boolean IsBRepAlgoAPI = Standard_True;
if (argc == 6) {
- Standard_Integer IsB = atoi(argv[5]);
+ Standard_Integer IsB = Draw::Atoi(argv[5]);
if (IsB != 1) {
IsBRepAlgoAPI = Standard_False;
// di << "Error: There is not BRepAlgo_Cut class" << "\n";
}
}
- Standard_Integer CaseNumber = atoi(argv[1]);
+ Standard_Integer CaseNumber = Draw::Atoi(argv[1]);
//BRepPrimAPI_MakeCylinder o_mc1 (gp_Ax2 (gp_Pnt(0,-50,140), gp_Dir(1,0,0)), 50,1000);
gp_Dir myDir(1,0,0);
}
adapCurve = new BRepAdaptor_CompCurve(TopoDS::Wire(wire));
}
- double step = atof(argv[3]);
+ double step = Draw::Atof(argv[3]);
GCPnts_UniformAbscissa aUni(*adapCurve, step);
int res;
if (!aUni.IsDone())
double par = aUni.Parameter(i+1);
gp_Pnt p = adapCurve->Value(par);
char n[20], *pname=n;
- sprintf(n,"%s_%d",name,i+1);
+ Sprintf(n,"%s_%d",name,i+1);
DrawTrSurf::Set(pname,p);
di<<pname<<" ";
}
return 1;
}
- Standard_Integer nb = atoi(argv[1]);
- Standard_Integer sz = atoi(argv[2]);
+ Standard_Integer nb = Draw::Atoi(argv[1]);
+ Standard_Integer sz = Draw::Atoi(argv[2]);
Standard_Real val = 10;
math_Vector **pv = new math_Vector *[nb];
}
if (argc > 1)
- nCount = atoi(argv[1]);
+ nCount = Draw::Atoi(argv[1]);
STEPCAFControl_Writer writer;
Handle_TDocStd_Document document;
document = new TDocStd_Document("Pace Test-StepExporter-");
return 1;
}
- Standard_Integer LOWER = atoi(argv[1]);
- Standard_Integer UPPER = atoi(argv[2]);
+ Standard_Integer LOWER = Draw::Atoi(argv[1]);
+ Standard_Integer UPPER = Draw::Atoi(argv[2]);
//! 0. Create an empty document with several test labels
Handle(TDocStd_Document) doc = new TDocStd_Document("XmlOcaf");
NCollection_Vector<int> vec;
for (i = 0; i < argc - 1; i++) {
i++;
- aValue = atoi(argv[i]);
- aPosition = atoi(argv[i+1]);
+ aValue = Draw::Atoi(argv[i]);
+ aPosition = Draw::Atoi(argv[i+1]);
vec.SetValue(aValue, aPosition);
}
NCollection_Vector<int>::Iterator it(vec);
BRepBuilderAPI_MakePolygon W;
j = 3;
for (i = 1; i <= np; i ++) {
- W.Add(gp_Pnt(atof(argv[j]),atof(argv[j+1]),atof(argv[j+2])));
+ W.Add(gp_Pnt(Draw::Atof(argv[j]),Draw::Atof(argv[j+1]),Draw::Atof(argv[j+2])));
j += 3;
}
W.Close();
gp_Ax2 aPln (gp_Pnt(0.,0.,0.),
gp_Dir(1., -1., 0.));
gp_GTrsf aTrf;
- aTrf.SetAffinity (aPln, atof(argv[4]));
- gp_XYZ aOrigin (atof(argv[1]),atof(argv[2]),atof(argv[3]));
+ aTrf.SetAffinity (aPln, Draw::Atof(argv[4]));
+ gp_XYZ aOrigin (Draw::Atof(argv[1]),Draw::Atof(argv[2]),Draw::Atof(argv[3]));
gp_XYZ aResult (aOrigin);
aTrf.Transforms(aResult);
char sbf[512];
- sprintf(sbf, "( %8.3f %8.3f %8.3f ) => ( %8.3f %8.3f %8.3f )\n",
+ Sprintf(sbf, "( %8.3f %8.3f %8.3f ) => ( %8.3f %8.3f %8.3f )\n",
aOrigin.X(), aOrigin.Y(), aOrigin.Z(),
aResult.X(), aResult.Y(), aResult.Z());
di<<sbf;
Standard_Real aDeflection = 0.45110277533;
if (argc > 2) {
- aDeflection = atof(argv[2]);
+ aDeflection = Draw::Atof(argv[2]);
}
di<<"deflection="<< aDeflection << "\n";
}
try
{
- gp_Lin2d aLin2d (atof(argv[1]),atof(argv[2]),atof(argv[3]));
+ gp_Lin2d aLin2d (Draw::Atof(argv[1]),Draw::Atof(argv[2]),Draw::Atof(argv[3]));
gp_Pnt2d anOrigin = aLin2d.Location();
di << "X_0 = " << anOrigin.X() << " Y_0 = " << anOrigin.Y() << "\n" ;
}
Standard_Integer mode = 0;
if (argc == 2)
{
- mode = atoi(argv[1]);
+ mode = Draw::Atoi(argv[1]);
}
if (mode > 2 || mode < 0)
{
// amv 26.09.2003 : this is used to avoid error of enter's simbol
char str[80];
cin>>str;
- modepri = atoi(str);
+ modepri = Draw::Atoi(str);
}
if (modepri == 0) { //fin
//amv 26.09.2003
char str_a[80];
cin >> str_a;
- answer = atoi(str_a);
+ answer = Draw::Atoi(str_a);
}
if ( answer == 0) continue;
if ( answer == 1 || answer == 3) {
// save the shape
if (shape.IsNull()) { di<<"No Shape produced"<<"\n"; continue; }
char fname[110];
- sprintf(fname, "%s", rnom.ToCString());
+ Sprintf(fname, "%s", rnom.ToCString());
di << "Saving shape in variable Draw : " << fname << "\n";
if (answer == 3) IGESToBRep::WriteShape (shape,1);
try {
TopoDS_Shape shape = Reader.Shape(inum);
if (shape.IsNull()) { di<<"No Shape produced"<<"\n"; continue; }
char fname[110];
- sprintf(fname, "%s_%d", rnom.ToCString(),inum);
+ Sprintf(fname, "%s_%d", rnom.ToCString(),inum);
di << "Saving shape in variable Draw : " << fname << "\n";
if (answer == 4) IGESToBRep::WriteShape (shape,inum);
try {
if (!Reader.TransferOne (nent)) di<<"Transfer entity n0 "<<nent<<" : no result"<<"\n";
else {
nbs = Reader.NbShapes();
- char shname[30]; sprintf (shname,"%s_%d",rnom.ToCString(),nent);
+ char shname[30]; Sprintf (shname,"%s_%d",rnom.ToCString(),nent);
di<<"Transfer entity n0 "<<nent<<" OK -> DRAW Shape: "<<shname<<"\n";
di<<"Now, "<<nbs<<" Shapes produced"<<"\n";
TopoDS_Shape sh = Reader.Shape(nbs);
TopoDS_Shape shape = Reader.OneShape();
// save the shape
char fname[110];
- sprintf(fname, "%s", rnom.ToCString());
+ Sprintf(fname, "%s", rnom.ToCString());
di << "Saving shape in variable Draw : " << fname << "\n";
try {
OCC_CATCH_SIGNALS
// anv 26.09.2003
char str_answer[80];
cin>>str_answer;
- answer = atoi(str_answer);
+ answer = Draw::Atoi(str_answer);
}
if (answer <= 0 || answer > 3) continue;
if (answer == 3) {
if (!Reader.TransferOne(nent)) di<<"Transfer entity n0 "<<nent<<" : no result"<<"\n";
else {
nbs = Reader.NbShapes();
- char shname[30]; sprintf (shname,"%s_%d",rnom.ToCString(),nbs);
+ char shname[30]; Sprintf (shname,"%s_%d",rnom.ToCString(),nbs);
di<<"Transfer entity n0 "<<nent<<" OK -> DRAW Shape: "<<shname<<"\n";
di<<"Now, "<<nbs<<" Shapes produced"<<"\n";
TopoDS_Shape sh = Reader.Shape(nbs);
return 1;
}
- Standard_Real A = atof(argv[2]);
- Standard_Real B = atof(argv[3]);
- Standard_Real C = atof(argv[4]);
- Standard_Real D = atof(argv[5]);
+ Standard_Real A = Draw::Atof(argv[2]);
+ Standard_Real B = Draw::Atof(argv[3]);
+ Standard_Real C = Draw::Atof(argv[4]);
+ Standard_Real D = Draw::Atof(argv[5]);
Handle(Geom_Geometry) result;
di << "Usage : " << argv[0] << " MaxNbr" << "\n";
return -1;
}
- Standard_Integer aMaxNbr = atoi(argv[1]);
+ Standard_Integer aMaxNbr = Draw::Atoi(argv[1]);
for (Standard_Integer i=0;i<aMaxNbr;i++)
{
di << "Wrong number of arguments" << "\n";
return -1;
}
- Standard_Real X1_Pnt = atof(argv[1]);
- Standard_Real Y1_Pnt = atof(argv[2]);
- Standard_Real Z1_Pnt = atof(argv[3]);
- Standard_Real X2_Pnt = atof(argv[4]);
- Standard_Real Y2_Pnt = atof(argv[5]);
- Standard_Real Z2_Pnt = atof(argv[6]);
+ Standard_Real X1_Pnt = Draw::Atof(argv[1]);
+ Standard_Real Y1_Pnt = Draw::Atof(argv[2]);
+ Standard_Real Z1_Pnt = Draw::Atof(argv[3]);
+ Standard_Real X2_Pnt = Draw::Atof(argv[4]);
+ Standard_Real Y2_Pnt = Draw::Atof(argv[5]);
+ Standard_Real Z2_Pnt = Draw::Atof(argv[6]);
Graphic3d_Vector AV1(X1_Pnt, Y1_Pnt, Z1_Pnt);
Graphic3d_Vector AV2(X2_Pnt, Y2_Pnt, Z2_Pnt);
return 1;
}
- Standard_Real X_Pnt = atof(argv[2]);
- Standard_Real Y_Pnt = atof(argv[3]);
- Standard_Real Z_Pnt = atof(argv[4]);
+ Standard_Real X_Pnt = Draw::Atof(argv[2]);
+ Standard_Real Y_Pnt = Draw::Atof(argv[3]);
+ Standard_Real Z_Pnt = Draw::Atof(argv[4]);
- Standard_Real X_Dir = atof(argv[5]);
- Standard_Real Y_Dir = atof(argv[6]);
- Standard_Real Z_Dir = atof(argv[7]);
+ Standard_Real X_Dir = Draw::Atof(argv[5]);
+ Standard_Real Y_Dir = Draw::Atof(argv[6]);
+ Standard_Real Z_Dir = Draw::Atof(argv[7]);
- Standard_Real PInf = atof(argv[8]);
+ Standard_Real PInf = Draw::Atof(argv[8]);
IntCurvesFace_ShapeIntersector intersector;
intersector.Load(shape, Precision::Intersection());
return 1;
}
- Standard_Real X_vec = atof(argv[1]);
- Standard_Real Y_vec = atof(argv[2]);
- Standard_Real Z_vec = atof(argv[3]);
+ Standard_Real X_vec = Draw::Atof(argv[1]);
+ Standard_Real Y_vec = Draw::Atof(argv[2]);
+ Standard_Real Z_vec = Draw::Atof(argv[3]);
- Standard_Real X_dir = atof(argv[4]);
- Standard_Real Y_dir = atof(argv[5]);
- Standard_Real Z_dir = atof(argv[6]);
+ Standard_Real X_dir = Draw::Atof(argv[4]);
+ Standard_Real Y_dir = Draw::Atof(argv[5]);
+ Standard_Real Z_dir = Draw::Atof(argv[6]);
- Standard_Real X_pnt = atof(argv[7]);
- Standard_Real Y_pnt = atof(argv[8]);
- Standard_Real Z_pnt = atof(argv[9]);
+ Standard_Real X_pnt = Draw::Atof(argv[7]);
+ Standard_Real Y_pnt = Draw::Atof(argv[8]);
+ Standard_Real Z_pnt = Draw::Atof(argv[9]);
gp_Dir toSym(X_vec, Y_vec, Z_vec);
gp_Dir dir(X_dir, Y_dir, Z_dir);
return 1;
}
- Standard_Real X_mirrorFirstPoint = atof(argv[1]);
- Standard_Real Y_mirrorFirstPoint = atof(argv[2]);
- Standard_Real X_mirrorSecondPoint = atof(argv[3]);
- Standard_Real Y_mirrorSecondPoint = atof(argv[4]);
- Standard_Real X_p1 = atof(argv[5]);
- Standard_Real Y_p1 = atof(argv[6]);
- Standard_Real X_p2 = atof(argv[7]);
- Standard_Real Y_p2 = atof(argv[8]);
+ Standard_Real X_mirrorFirstPoint = Draw::Atof(argv[1]);
+ Standard_Real Y_mirrorFirstPoint = Draw::Atof(argv[2]);
+ Standard_Real X_mirrorSecondPoint = Draw::Atof(argv[3]);
+ Standard_Real Y_mirrorSecondPoint = Draw::Atof(argv[4]);
+ Standard_Real X_p1 = Draw::Atof(argv[5]);
+ Standard_Real Y_p1 = Draw::Atof(argv[6]);
+ Standard_Real X_p2 = Draw::Atof(argv[7]);
+ Standard_Real Y_p2 = Draw::Atof(argv[8]);
gp_Trsf2d identityTransformation;
return 1; //TCL_ERROR
}
- const Standard_Integer aMode = atoi(argv[1]);
+ const Standard_Integer aMode = Draw::Atoi(argv[1]);
//===================================================================
// purpose or non-infringement. Please see the License for the specific terms
// and conditions governing the rights and limitations under the License.
-
-
#include <QABugs.hxx>
+#include <Draw.hxx>
#include <Draw_Interpretor.hxx>
#include <DBRep.hxx>
#include <DrawTrSurf.hxx>
}
const Standard_Real rad = 1.0;
- const Standard_Real angle = (argc > 2)? atof(argv[2]) : 0.0;
- const Standard_Integer reverse = (argc > 3)? atoi(argv[3]) : 0;
- const Standard_Integer order = (argc > 4)? atoi(argv[4]) : 0;
+ const Standard_Real angle = (argc > 2)? Draw::Atof(argv[2]) : 0.0;
+ const Standard_Integer reverse = (argc > 3)? Draw::Atoi(argv[3]) : 0;
+ const Standard_Integer order = (argc > 4)? Draw::Atoi(argv[4]) : 0;
// Make a wire from the first arc for ThruSections.
//
// purpose or non-infringement. Please see the License for the specific terms
// and conditions governing the rights and limitations under the License.
-
-
#include <QABugs.hxx>
+#include <Draw.hxx>
#include <Draw_Interpretor.hxx>
#include <DBRep.hxx>
#include <DrawTrSurf.hxx>
double major_radius = 280.0;
// Convert arguments
- if (argc>1) wall_thickness = atof(argv[1]);
- if (argc>2) dia1 = atof(argv[2]);
- if (argc>3) dia2 = atof(argv[3]);
- if (argc>4) major_radius = atof(argv[4]);
- if (argc>5) length = atof(argv[5]);
+ if (argc>1) wall_thickness = Draw::Atof(argv[1]);
+ if (argc>2) dia1 = Draw::Atof(argv[2]);
+ if (argc>3) dia2 = Draw::Atof(argv[3]);
+ if (argc>4) major_radius = Draw::Atof(argv[4]);
+ if (argc>5) length = Draw::Atof(argv[5]);
double bend_angle = length/major_radius;
//if ((bend_angle >= M_PI)) {
if (!mkEdge.IsDone()) return 0;
TopoDS_Wire SpineWire = BRepBuilderAPI_MakeWire(mkEdge.Edge()).Wire();
- sprintf (name,"SpineWire");
+ Sprintf (name,"SpineWire");
DBRep::Set(name,SpineWire);
- sprintf (name,"Wire1_");
+ Sprintf (name,"Wire1_");
DBRep::Set(name,Wire1_);
- sprintf (name,"outerWire1_");
+ Sprintf (name,"outerWire1_");
DBRep::Set(name,outerWire1_);
// SUPPORT:
// - There is no need to create 2nd circles
- //sprintf (name,"Wire2_");
+ //Sprintf (name,"Wire2_");
//DBRep::Set(name,Wire2_);
- //sprintf (name,"outerWire2_");
+ //Sprintf (name,"outerWire2_");
//DBRep::Set(name,outerWire2_);
di.Eval("fit");
mkPipe1.MakeSolid();
gasSolid = mkPipe1.Shape();
- sprintf (name,"gasSolid_");
+ Sprintf (name,"gasSolid_");
DBRep::Set(name,gasSolid);
//getFaces.Clear();
B.MakeSolid(wallSolid);
B.Add(wallSolid,TubeShell);
- sprintf (name,"wallSolid_");
+ Sprintf (name,"wallSolid_");
DBRep::Set(name,wallSolid);
// Now calculated the volume of the outside tube.
while (getFaces.More())
{
i++;
- sprintf(name,"Face%d",i);
+ Sprintf(name,"Face%d",i);
di << "Face named " << name << "\n";
DBRep::Set(name,getFaces.Current());
getFaces.Next();
}
Standard_Boolean IsBRepAlgoAPI = Standard_True;
if (argc == 7) {
- Standard_Integer IsB = atoi(argv[6]);
+ Standard_Integer IsB = Draw::Atoi(argv[6]);
if (IsB != 1) {
IsBRepAlgoAPI = Standard_False;
#if ! defined(BRepAlgo_def01)
// Convert arguments
- if (argc>1) radius_l = atof(argv[1]);
- if (argc>2) radius_r = atof(argv[2]);
- if (argc>3) bend_angle = atof(argv[3]);
- if (argc>4) major_rad = atof(argv[4]);
- if (argc>5) wall_thickness = atof(argv[5]);
+ if (argc>1) radius_l = Draw::Atof(argv[1]);
+ if (argc>2) radius_r = Draw::Atof(argv[2]);
+ if (argc>3) bend_angle = Draw::Atof(argv[3]);
+ if (argc>4) major_rad = Draw::Atof(argv[4]);
+ if (argc>5) wall_thickness = Draw::Atof(argv[5]);
// mkv 15.07.03 if ((bend_angle >= 2.0*M_PI)) {
if ((bend_angle >= 2.0*M_PI)) {
if (!mkEdge.IsDone()) return TCL_ERROR;
TopoDS_Wire SpineWire = BRepBuilderAPI_MakeWire(mkEdge.Edge()).Wire();
- sprintf (name,"SpineWire");
+ Sprintf (name,"SpineWire");
DBRep::Set(name,SpineWire);
- sprintf (name,"Wire1_");
+ Sprintf (name,"Wire1_");
DBRep::Set(name,Wire1_);
- sprintf (name,"outerWire1_");
+ Sprintf (name,"outerWire1_");
DBRep::Set(name,outerWire1_);
- sprintf (name,"Wire2_");
+ Sprintf (name,"Wire2_");
DBRep::Set(name,Wire2_);
- sprintf (name,"outerWire2_");
+ Sprintf (name,"outerWire2_");
DBRep::Set(name,outerWire2_);
di.Eval("fit");
TopExp::Vertices(SpineWire, Location2, Location1);
- sprintf (name,"Location1");
+ Sprintf (name,"Location1");
DBRep::Set(name,Location1);
- sprintf (name,"Location2");
+ Sprintf (name,"Location2");
DBRep::Set(name,Location2);
// Make inner pipe shell
mkPipe2.Build();
if (!mkPipe2.IsDone()) return TCL_ERROR;
-// sprintf(name,"w1-first");
+// Sprintf(name,"w1-first");
// DBRep::Set(name,mkPipe1.FirstShape());
-// sprintf(name,"w1-last");
+// Sprintf(name,"w1-last");
// DBRep::Set(name,mkPipe1.LastShape());
-// sprintf(name,"w2-first");
+// Sprintf(name,"w2-first");
// DBRep::Set(name,mkPipe2.FirstShape());
-// sprintf(name,"w2-last");
+// Sprintf(name,"w2-last");
// DBRep::Set(name,mkPipe2.LastShape());
BRepOffsetAPI_Sewing SewIt(1.0e-4);
{
di << "Next shell found in compound" << "\n";
di << "B.Add(wallSolid,TopoDS::Shell(getShel.Current()));" << "\n";
- sprintf(name,"shell%d", i++);
+ Sprintf(name,"shell%d", i++);
DBRep::Set(name,getShel.Current());
B.Add(wallSolid,TopoDS::Shell(getShel.Current()));
getShel.Next();
}
}
- sprintf(name,"result");
+ Sprintf(name,"result");
DBRep::Set(name,wallSolid);
// Now calculated the volume of the outside tube.
}
Standard_Boolean IsBRepAlgoAPI = Standard_True;
if (argc == 4) {
- Standard_Integer IsB = atoi(argv[3]);
+ Standard_Integer IsB = Draw::Atoi(argv[3]);
if (IsB != 1) {
IsBRepAlgoAPI = Standard_False;
#if ! defined(BRepAlgo_def02)
}
Standard_Real delt = 5.0*Precision::Confusion();
- Standard_Real mesh_delt = atof(argv[2]);
+ Standard_Real mesh_delt = Draw::Atof(argv[2]);
if (mesh_delt <= 0.0)
{
di<<"Error: mesh_delta must be positive value"<<"\n";
if (err)
{
char astr[80];
- sprintf(astr,"e_%d",l);
+ Sprintf(astr,"e_%d",l);
DBRep::Set(astr,commonShape);
}
}
Standard_Character abuf[16];
Handle(Geom2d_Line) aLine = new Geom2d_Line(gp_Pnt2d(100, 0), gp_Dir2d(-1, 0));
- sprintf(abuf,"line");
+ Sprintf(abuf,"line");
Standard_CString st = abuf;
DrawTrSurf::Set (st, aLine);
aPoints.SetValue(2, gp_Pnt2d(50, 50));
aPoints.SetValue(3, gp_Pnt2d(0, 100));
Handle(Geom2d_BezierCurve) aCurve = new Geom2d_BezierCurve(aPoints);
- sprintf(abuf,"curve");
+ Sprintf(abuf,"curve");
DrawTrSurf::Set (st, aCurve);
Geom2dAdaptor_Curve aCLine(aLine);
di << "\n" << "tangency1 : X " << aPnt2d1.X() << " Y " << aPnt2d1.Y();
di << "\n" << "tangency2 : X " << aPnt2d2.X() << " Y " << aPnt2d2.Y() << "\n";
- sprintf(abuf,"circle_%d",i);
+ Sprintf(abuf,"circle_%d",i);
Handle(Geom2d_Curve) circ_res = new Geom2d_Circle(aCirc2d);
DrawTrSurf::Set (st, circ_res);
}
BRepAdaptor_Curve curve(ed);
gp_Dir d = curve.Line().Direction();
Bnd_Box bnd_box;
- bnd_box.Update(atof(argv[4]), atof(argv[5]), atof(argv[6]), atof(argv[7]), atof(argv[8]), atof(argv[9]));
+ bnd_box.Update(Draw::Atof(argv[4]), Draw::Atof(argv[5]), Draw::Atof(argv[6]), Draw::Atof(argv[7]), Draw::Atof(argv[8]), Draw::Atof(argv[9]));
if(bnd_box.IsOut(p1, p2, d))
di << "The band lies out of the box" << "\n";
else
BRepAdaptor_Curve curve(shape);
gp_Lin lin = curve.Line();
Bnd_Box bnd_box;
- bnd_box.Update(atof(argv[2]), atof(argv[3]), atof(argv[4]), atof(argv[5]), atof(argv[6]), atof(argv[7]));
+ bnd_box.Update(Draw::Atof(argv[2]), Draw::Atof(argv[3]), Draw::Atof(argv[4]), Draw::Atof(argv[5]), Draw::Atof(argv[6]), Draw::Atof(argv[7]));
if(bnd_box.IsOut(lin))
di << "Line that lies on edge does not intersect the box" << "\n";
else
}
const char *ns1 = (argv[2]), *ns2 = (argv[3]), *ns0 = (argv[1]);
TopoDS_Shape S1(DBRep::Get(ns1)), S2(DBRep::Get(ns2)) ;
- Standard_Real dev = atof(argv[4]);
+ Standard_Real dev = Draw::Atof(argv[4]);
BRepExtrema_DistShapeShape dst(S1 ,S2, dev );
if (dst.IsDone()) {
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 << " ";
TopoDS_Vertex V =BRepLib_MakeVertex(P1);
char namev[100];
if (i1==1) {
- sprintf(namev, "%s" ,ns0);
+ Sprintf(namev, "%s" ,ns0);
} else {
- sprintf(namev, "%s%d" ,ns0,i1);
+ Sprintf(namev, "%s%d" ,ns0,i1);
}
char* tempv = namev;
DBRep::Set(tempv,V);
char name[100];
TopoDS_Edge E = BRepLib_MakeEdge (P1, P2);
if (i1==1) {
- sprintf(name,"%s",ns0);
+ Sprintf(name,"%s",ns0);
} else {
- sprintf(name,"%s%d",ns0,i1);
+ Sprintf(name,"%s%d",ns0,i1);
}
char* temp = name;
DBRep::Set(temp,E);
return 1;
}
- gp_XYZ aVec(atof(argv[2]),atof(argv[3]),atof(argv[4]));
+ gp_XYZ aVec(Draw::Atof(argv[2]),Draw::Atof(argv[3]),Draw::Atof(argv[4]));
Standard_Boolean isPlanar=Standard_False;
isPlanar=ShapeAnalysis_Curve::IsPlanar(aCurve,aVec,1e-7);
LDOM_Document myDOM;
//Standard_Character *File = new Standard_Character [100];
- //sprintf(File,"%s",argv[1]);
+ //Sprintf(File,"%s",argv[1]);
const char *File = (argv[1]);
if(!aParser.parse(File)) {
cerr << "use 'vinit' command before " << argv[0] << "\n";
return 1;
}
- Standard_Integer AutoHilightInteger = atoi(argv[1]);
+ Standard_Integer AutoHilightInteger = Draw::Atoi(argv[1]);
Standard_Boolean AutoHilightBoolean = Standard_False;
if (AutoHilightInteger != 0) {
AutoHilightBoolean = Standard_True;
TDF_Label L;
DDF::AddLabel(DF, argv[2], L);
- //TDataStd_Real::Set(L,atof(arg[3]));
+ //TDataStd_Real::Set(L,Draw::Atof(arg[3]));
TCollection_AsciiString AsciiStringReal(argv[3]);
if (!AsciiStringReal.IsRealValue()) return 1;
Standard_Real aReal = AsciiStringReal.RealValue();
if (!DDF::GetDF(argv[1],DF)) return 1;
TDF_Label L;
DDF::AddLabel(DF, argv[2], L);
- Standard_Integer Tag = atoi(argv[3]);
+ Standard_Integer Tag = Draw::Atoi(argv[3]);
Handle(TDF_TagSource) A = TDF_TagSource::Set(L);
A->Set(Tag);
return 0;
Standard_Integer aNb = 1;
if ( max )
- aNb += atoi( max );
+ aNb += Draw::Atoi( max );
else
aNb += 40000;
if ( argc > 1 )
- aNb = atoi( argv[1] );
+ aNb = Draw::Atoi( argv[1] );
di << "Use nb = " << aNb << "\n";
// purpose or non-infringement. Please see the License for the specific terms
// and conditions governing the rights and limitations under the License.
-
-
#include <QABugs.hxx>
+#include <Draw.hxx>
#include <Draw_Interpretor.hxx>
#include <DBRep.hxx>
#include <DrawTrSurf.hxx>
di << "Usage : " << argv[0] << " 0/1" << "\n";
}
- if(atoi(argv[1]) == 0) {
+ if(Draw::Atoi(argv[1]) == 0) {
if ( theObject1.IsNull() )
{
theObject1 = new QABugs_PresentableObject();
theObject1->SetDisplayMode(0);
myAISContext->Display(theObject1);
}
- } else if(atoi(argv[1]) == 1) {
+ } else if(Draw::Atoi(argv[1]) == 1) {
if ( theObject2.IsNull() )
{
theObject2 = new QABugs_PresentableObject();
// purpose or non-infringement. Please see the License for the specific terms
// and conditions governing the rights and limitations under the License.
-
-
#include <QABugs.hxx>
+#include <Draw.hxx>
#include <Draw_Interpretor.hxx>
#include <DBRep.hxx>
#include <DrawTrSurf.hxx>
TCollection_ExtendedString aText(argv[5]);
//Standard_ExtString ExtString_aText = aText.ToExtString();
- //di << ExtString_aText << " " << atof(argv[4]) << "\n";
- di << argv[5] << " " << atof(argv[4]) << "\n";
+ //di << ExtString_aText << " " << Draw::Atof(argv[4]) << "\n";
+ di << argv[5] << " " << Draw::Atof(argv[4]) << "\n";
- Handle(AIS_AngleDimension) aDim = new AIS_AngleDimension(aFirst, aSecond, aPlane, atof(argv[4]), aText);
+ Handle(AIS_AngleDimension) aDim = new AIS_AngleDimension(aFirst, aSecond, aPlane, Draw::Atof(argv[4]), aText);
aContext->Display(aDim);
return 0;
//QAModTopOpe_ModeOfLimitation ModeOfLimitation = QAModTopOpe_Forward;
QANewModTopOpe_ModeOfLimitation ModeOfLimitation = QANewModTopOpe_Forward;
if(argc==5) {
- Standard_Integer ModeOfLimitationInteger = atoi(argv[4]);
+ Standard_Integer ModeOfLimitationInteger = Draw::Atoi(argv[4]);
if(!(ModeOfLimitationInteger == 0 || ModeOfLimitationInteger == 1 || ModeOfLimitationInteger == 2)) {
di << "Usage : " << argv[0] << " result part tool [ModeOfLimitation=0/1/2]" << "\n";
return 1;
Standard_Boolean AllowCutting = Standard_False;
if(argc==5) {
- Standard_Integer AllowCuttingInteger = atoi(argv[4]);
+ Standard_Integer AllowCuttingInteger = Draw::Atoi(argv[4]);
if(!( AllowCuttingInteger == 0 || AllowCuttingInteger == 1)) {
di << "Usage : " << argv[0] << " result part tool [AllowCutting=0/1]" << "\n";
return 1;
Standard_Integer mode = 2;
Standard_Real tolang = M_PI/2;
if(argc > k)
- tol = atof(argv[k++]);
+ tol = Draw::Atof(argv[k++]);
if(argc > k)
- mode= atoi(argv[k++]);
+ mode= Draw::Atoi(argv[k++]);
if(argc > k)
- tolang = atof(argv[k++]);
+ tolang = Draw::Atof(argv[k++]);
Handle(ShapeFix_Wireframe) aSfwr = new ShapeFix_Wireframe();
return 1;
}
- Standard_Real X = atof(argv[1]);
- Standard_Real Y = atof(argv[2]);
- Standard_Real Z = atof(argv[3]);
- Standard_Real ArrowSize = atof(argv[4]);
+ Standard_Real X = Draw::Atof(argv[1]);
+ Standard_Real Y = Draw::Atof(argv[2]);
+ Standard_Real Z = Draw::Atof(argv[3]);
+ Standard_Real ArrowSize = Draw::Atof(argv[4]);
gp_Pnt p1 = gp_Pnt(10.,10.,0.);
gp_Pnt p2 = gp_Pnt(50.,10.,0.);
return 1;
}
- Standard_Integer xmin = atoi(argv[1]);
- Standard_Integer ymin = atoi(argv[2]);
- Standard_Integer xmax = atoi(argv[3]);
- Standard_Integer ymax = atoi(argv[4]);
+ Standard_Integer xmin = Draw::Atoi(argv[1]);
+ Standard_Integer ymin = Draw::Atoi(argv[2]);
+ Standard_Integer xmax = Draw::Atoi(argv[3]);
+ Standard_Integer ymax = Draw::Atoi(argv[4]);
Handle(V3d_View) V3dView = ViewerTest::CurrentView();
TColgp_Array1OfPnt2d Polyline(1,np);
j = 1;
for (i = 1; i <= np; i++) {
- Polyline(i) = gp_Pnt2d(atof(argv[j]), atof(argv[j+1]));
+ Polyline(i) = gp_Pnt2d(Draw::Atof(argv[j]), Draw::Atof(argv[j+1]));
j += 2;
}
di << " Shape is null" << "\n";
return 1;
}
- Standard_Boolean nonmanifmode = (atoi(argv[3]) != 0);
+ Standard_Boolean nonmanifmode = (Draw::Atoi(argv[3]) != 0);
Handle(ShapeFix_Shell) SFSh = new ShapeFix_Shell;
SFSh->FixFaceOrientation(TopoDS::Shell(S),Standard_True,nonmanifmode);
DBRep::Set(argv[1],SFSh->Shape());
#include <QABugs.hxx>
+#include <Draw.hxx>
#include <Draw_Interpretor.hxx>
#include <DBRep.hxx>
#include <DrawTrSurf.hxx>
gp_Pln pln = plne->Pln();
Handle(Geom2d_Curve) curve2d = GeomAPI::To2d (ell, pln);
- sprintf(abuf,"ell");
+ Sprintf(abuf,"ell");
DrawTrSurf::Set(st,curve2d);
if(!aContext.IsNull()) {
Handle(AIS_Shape) aisp =
}
Handle(Geom2d_Curve) fromcurve2d = GeomAPI::To2d (cir, pln);
- sprintf(abuf,"cil");
+ Sprintf(abuf,"cil");
DrawTrSurf::Set(st,fromcurve2d);
if(!aContext.IsNull()) {
Handle(AIS_Shape) aisp =
Geom2dGcc_Lin2d2Tan lintan (qcur, qfromcur, 0.1, 0.0, 0.0);
Standard_Integer i=0;
for(i=0;i<lintan.NbSolutions();i++) {
- sprintf(abuf,"lintan_%d",i);
+ Sprintf(abuf,"lintan_%d",i);
Handle(Geom2d_Line) glin = new Geom2d_Line(lintan.ThisSolution(i));
DrawTrSurf::Set(st,glin);
if(!aContext.IsNull()) {
Standard_Real par1 = 0.0, par2 = 0.0;
Standard_Real tol = Precision::Angular();
if (argc >= 5)
- par1 = atof(argv[4]);
+ par1 = Draw::Atof(argv[4]);
if (argc == 6)
- par2 = atof(argv[5]);
+ par2 = Draw::Atof(argv[5]);
if (argc == 7)
- tol = atof(argv[6]);
+ tol = Draw::Atof(argv[6]);
Handle(Geom2d_Curve) aCur2d1 = DrawTrSurf::GetCurve2d(argv[2]);
Handle(Geom2d_Curve) aCur2d2 = DrawTrSurf::GetCurve2d(argv[3]);
if (aCur2d1.IsNull() || aCur2d2.IsNull()) {
Handle(Geom2d_Circle) aCir2d = Handle(Geom2d_Circle)::DownCast(aCur2d1);
if (!aCir2d.IsNull()) {
c1IsCircle = Standard_True;
- if (argc == 6) tol = atof(argv[5]);
+ if (argc == 6) tol = Draw::Atof(argv[5]);
}
if(c1IsCircle) {
Geom2dAdaptor_Curve acur(aCur2d2);
return -1;
}
- Handle(QABugs_MyText) txt1 = new QABugs_MyText("Gosha1",gp_Pnt(0,0,0),Font_NOF_ASCII_SIMPLEX,Quantity_NOC_RED,atoi(argv[1]));
+ Handle(QABugs_MyText) txt1 = new QABugs_MyText("Gosha1",gp_Pnt(0,0,0),Font_NOF_ASCII_SIMPLEX,Quantity_NOC_RED,Draw::Atoi(argv[1]));
aContext->Display(txt1);
- Handle(QABugs_MyText) txt2 = new QABugs_MyText("Gosha2",gp_Pnt(0,0,100),Font_NOF_ASCII_SIMPLEX,Quantity_NOC_YELLOW,atoi(argv[2]));
+ Handle(QABugs_MyText) txt2 = new QABugs_MyText("Gosha2",gp_Pnt(0,0,100),Font_NOF_ASCII_SIMPLEX,Quantity_NOC_YELLOW,Draw::Atoi(argv[2]));
aContext->Display(txt2);
- Handle(QABugs_MyText) txt3 = new QABugs_MyText("Gosha3",gp_Pnt(0,100,100),Font_NOF_ASCII_SIMPLEX,Quantity_NOC_SKYBLUE,atoi(argv[3]));
+ Handle(QABugs_MyText) txt3 = new QABugs_MyText("Gosha3",gp_Pnt(0,100,100),Font_NOF_ASCII_SIMPLEX,Quantity_NOC_SKYBLUE,Draw::Atoi(argv[3]));
aContext->Display(txt3);
return 0;
res = sol.NbSolutions();
for(Standard_Integer i=1;i<=res;i++) {
Handle(Geom2d_Circle) aC = new Geom2d_Circle(sol.ThisSolution(i));
- sprintf(buf,"Result_%d",i);
+ Sprintf(buf,"Result_%d",i);
st = buf;
DrawTrSurf::Set(st,aC);
}
return 1;
}
- Standard_Integer HLR = atoi(argv[1]);
+ Standard_Integer HLR = Draw::Atoi(argv[1]);
if (HLR != 0) {
HLR = 1;
}
Handle(V3d_View) anOldView = ViewerTest::CurrentView();
Handle(V3d_Viewer) aViewer = ViewerTest::GetViewerFromContext();
- if (atoi (argv[2]))
+ if (Draw::Atoi (argv[2]))
{
aViewer->SetDefaultSurfaceDetail (V3d_TEX_ALL);
}
TopoDS_Shape aLocalEdge(DBRep::Get(a[1],TopAbs_EDGE));
TopoDS_Edge E = TopoDS::Edge(aLocalEdge);
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);
}
//HELPDESK: Add law creation
}
Standard_CString str;
- Standard_Real U = atof(argv[1]);
- Standard_Real V = atof(argv[2]);
+ Standard_Real U = Draw::Atof(argv[1]);
+ Standard_Real V = Draw::Atof(argv[2]);
//Between ellipse and point:
Standard_Integer i;
for(i=1;i<=lintan.NbSolutions();i++) {
- sprintf(abuf,"lintan_%d",i);
+ Sprintf(abuf,"lintan_%d",i);
Handle(Geom2d_Line) glin = new Geom2d_Line(lintan.ThisSolution(i));
DrawTrSurf::Set(st,glin);
if(!aContext.IsNull()) {
Standard_Integer i;
for(i=1;i<=lintan.NbSolutions();i++) {
- sprintf(abuf,"lintan_%d",i);
+ Sprintf(abuf,"lintan_%d",i);
Handle(Geom2d_Line) glin = new Geom2d_Line(lintan.ThisSolution(i));
DrawTrSurf::Set(st,glin);
if(!aContext.IsNull()) {
{
gp_Pnt pt = points3d(i);
di << "Info: Intersecting pt : (" << pt.X() << ", " << pt.Y() << ", " << pt.Z() << ")\n";
- sprintf(str,"p_%d",i);
+ Sprintf(str,"p_%d",i);
DrawTrSurf::Set(name,pt);
}
sfw->Load(wire);
sfw->SetFace(face);
- if (argc > 3) sfw->SetPrecision(atof(argv[3])/*0.1*/);
- if (argc > 4) sfw->SetMaxTolerance(atof(argv[4]));
+ if (argc > 3) sfw->SetPrecision(Draw::Atof(argv[3])/*0.1*/);
+ if (argc > 4) sfw->SetMaxTolerance(Draw::Atof(argv[4]));
di << "Info: Precision is set to " << sfw->Precision() << "\n";
di << "Info: MaxTolerance is set to " << sfw->MaxTolerance() << "\n";
di << "use 'vinit' command before " << argv[0] << "\n";
return 1;
}
- Standard_Real angle = atof(argv[1]);
- Standard_Integer fuse = atoi(argv[2]);
- Standard_Real length = atof(argv[3]);
+ Standard_Real angle = Draw::Atof(argv[1]);
+ Standard_Integer fuse = Draw::Atoi(argv[2]);
+ Standard_Real length = Draw::Atof(argv[3]);
BRepBuilderAPI_MakeEdge edge1(gp_Pnt(0, 0, 0), gp_Pnt(50, 0, 0));
BRepBuilderAPI_MakeEdge edge2(gp_Pnt(50, 0, 0), gp_Pnt(50, 50, 0));
}
Standard_Boolean IsBRepAlgoAPI = Standard_True;
if (argc == 2) {
- Standard_Integer IsB = atoi(argv[1]);
+ Standard_Integer IsB = Draw::Atoi(argv[1]);
if (IsB != 1) {
IsBRepAlgoAPI = Standard_False;
#if ! defined(BRepAlgo_def04)
return 1;
}
- int poles=atoi(argv[1]);
+ int poles=Draw::Atoi(argv[1]);
TColgp_Array1OfPnt arr(1, poles);
for(int i=1; i<=poles; i++)
#include <QABugs.hxx>
+#include <Draw.hxx>
#include <Draw_Interpretor.hxx>
#include <DBRep.hxx>
#include <DrawTrSurf.hxx>
Standard_CString aFileName = argv[1];
Standard_CString aDir1 = argv[2];
Standard_CString aDir2 = argv[3];
- Standard_Integer verboseInt = atoi(argv[4]);
+ Standard_Integer verboseInt = Draw::Atoi(argv[4]);
Standard_Boolean verboseBool = Standard_False;
if (verboseInt != 0) {
}
TopoDS_Wire myTopoDSWire = TopoDS::Wire(DBRep::Get(argv[1]));
- Standard_Real l = atof(argv[2]);
- Standard_Real goodX = atof(argv[3]);
- Standard_Real goodY = atof(argv[4]);
- Standard_Real goodZ = atof(argv[5]);
- Standard_Real percent = atof(argv[6]);
+ Standard_Real l = Draw::Atof(argv[2]);
+ Standard_Real goodX = Draw::Atof(argv[3]);
+ Standard_Real goodY = Draw::Atof(argv[4]);
+ Standard_Real goodZ = Draw::Atof(argv[5]);
+ Standard_Real percent = Draw::Atof(argv[6]);
Standard_Boolean Status = Standard_False;
// Find the first vertex of the wire
// purpose or non-infringement. Please see the License for the specific terms
// and conditions governing the rights and limitations under the License.
-
-
#include <QABugs.hxx>
+#include <Draw.hxx>
#include <Draw_Interpretor.hxx>
#include <DBRep.hxx>
#include <DrawTrSurf.hxx>
}
Standard_Boolean IsBRepAlgoAPI = Standard_True;
if (argc == 3) {
- Standard_Integer IsB = atoi(argv[2]);
+ Standard_Integer IsB = Draw::Atoi(argv[2]);
if (IsB != 1) {
IsBRepAlgoAPI = Standard_False;
//#if ! defined(BRepAlgo_def04)
// 3. Explode entry shape on faces and build sections from Zmin to Zmax with step aStep
const Standard_Real Zmin = -40.228173882121, Zmax = 96.408126285268, aStep = 1.0;
- char str[100]; str[0] = 0; sprintf(str,"Test range: [%f, %f] with step %f\n",Zmin,Zmax,aStep); di << str;
+ char str[100]; str[0] = 0; Sprintf(str,"Test range: [%f, %f] with step %f\n",Zmin,Zmax,aStep); di << str;
int nbf = 0;
TopExp_Explorer aExp1;
for (aExp1.Init(aShape,TopAbs_FACE); aExp1.More(); aExp1.Next())
{
// Process one face
- str[0] = 0; sprintf(str,"Face #%d: \t",nbf++); di << str;
+ str[0] = 0; Sprintf(str,"Face #%d: \t",nbf++); di << str;
TopoDS_Face aFace = TopoDS::Face(aExp1.Current());
// Build BndBox in order to avoid try of building section
// if (wasBuilt)
// {
// if(gmaxdist > Precision::Confusion())
-// sprintf(str,"Dist=%f, Param=%f FAULTY\n",gmaxdist,gzmax);
+// Sprintf(str,"Dist=%f, Param=%f FAULTY\n",gmaxdist,gzmax);
// else
-// sprintf(str,"Dist=%f, Param=%f\n",gmaxdist,gzmax);
+// Sprintf(str,"Dist=%f, Param=%f\n",gmaxdist,gzmax);
if(dist > toler)
- sprintf(str,"Dist=%f, Toler=%f, Param=%f FAULTY\n",dist,toler,gzmax);
+ Sprintf(str,"Dist=%f, Toler=%f, Param=%f FAULTY\n",dist,toler,gzmax);
else
- sprintf(str,"Dist=%f, Toler=%f, Param=%f\n",dist,toler,gzmax);
+ Sprintf(str,"Dist=%f, Toler=%f, Param=%f\n",dist,toler,gzmax);
// }
-// else sprintf(str,"No result\n");
+// else Sprintf(str,"No result\n");
di << str;
}
if (lmaxdist > gmaxdist)
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
-#include<Draw_Interpretor.hxx>
-#include<TopLoc_Location.hxx>
-#include<TopoDS_Face.hxx>
-#include<TopoDS.hxx>
-#include<DBRep.hxx>
-#include<Geom_Surface.hxx>
-#include<BRep_Tool.hxx>
-#include<GeomInt_IntSS.hxx>
-#include<BRepBuilderAPI_MakeEdge.hxx>
+#include <Draw.hxx>
+#include <Draw_Interpretor.hxx>
+#include <TopLoc_Location.hxx>
+#include <TopoDS_Face.hxx>
+#include <TopoDS.hxx>
+#include <DBRep.hxx>
+#include <Geom_Surface.hxx>
+#include <BRep_Tool.hxx>
+#include <GeomInt_IntSS.hxx>
+#include <BRepBuilderAPI_MakeEdge.hxx>
#include <Standard_ErrorHandler.hxx>
-#include<tcl.h>
+#include <tcl.h>
static int BUC60623(Draw_Interpretor& di, Standard_Integer argc, const char ** a)
{
di << "U=" << 1.28 << " V=" << 5.1 << " classified OUTSIDE" << "\n";
}
} else {
- uvSurf = gp_Pnt2d(atof(argv[3]),atof(argv[4]));
+ uvSurf = gp_Pnt2d(Draw::Atof(argv[3]),Draw::Atof(argv[4]));
state = PClass.Classify(face,uvSurf,Precision::PConfusion());
if(state == TopAbs_IN || state == TopAbs_ON){
- di << "U=" << atof(argv[3]) << " V=" << atof(argv[4]) << " classified INSIDE" << "\n";
+ di << "U=" << Draw::Atof(argv[3]) << " V=" << Draw::Atof(argv[4]) << " classified INSIDE" << "\n";
}else{
- di << "U=" << atof(argv[3]) << " V=" << atof(argv[4]) << " classified OUTSIDE" << "\n";
+ di << "U=" << Draw::Atof(argv[3]) << " V=" << Draw::Atof(argv[4]) << " classified OUTSIDE" << "\n";
}
}
return 0;
}
Standard_Boolean IsBRepAlgoAPI = Standard_True;
if (argc == 6) {
- Standard_Integer IsB = atoi(argv[5]);
+ Standard_Integer IsB = Draw::Atoi(argv[5]);
if (IsB != 1) {
IsBRepAlgoAPI = Standard_False;
#if ! defined(BRepAlgo_def04)
#endif
Standard_Character *filename = new Standard_Character [strlen(DD)+17];
- sprintf(filename,"%s/%s.topo",DD,argv[1]);
+ Sprintf(filename,"%s/%s.topo",DD,argv[1]);
filebuf fic;
istream in(&fic);
TopoDS_Shape free_1,free_2,free_3,free_4;
BRep_Builder B;
- sprintf(FileName,"%s/%s",DD,"buc60547a.brep");
+ Sprintf(FileName,"%s/%s",DD,"buc60547a.brep");
BRepTools::Read(free_1,FileName,B);
- sprintf(FileName,"%s/%s",DD,"buc60547b.brep");
+ Sprintf(FileName,"%s/%s",DD,"buc60547b.brep");
BRepTools::Read(free_2,FileName,B);
- sprintf(FileName,"%s/%s",DD,"buc60547c.brep");
+ Sprintf(FileName,"%s/%s",DD,"buc60547c.brep");
BRepTools::Read(free_3,FileName,B);
- sprintf(FileName,"%s/%s",DD,"buc60547d.brep");
+ Sprintf(FileName,"%s/%s",DD,"buc60547d.brep");
BRepTools::Read(free_4,FileName,B);
- sprintf(Ch,"%s_%i",argv[1],1);
+ Sprintf(Ch,"%s_%i",argv[1],1);
DBRep::Set(Ch,free_1);
di << Ch << " ";
- sprintf(Ch,"%s_%i",argv[1],2);
+ Sprintf(Ch,"%s_%i",argv[1],2);
DBRep::Set(Ch,free_2);
di << Ch << " ";
- sprintf(Ch,"%s_%i",argv[1],3);
+ Sprintf(Ch,"%s_%i",argv[1],3);
DBRep::Set(Ch,free_3);
di << Ch << " ";
- sprintf(Ch,"%s_%i",argv[1],4);
+ Sprintf(Ch,"%s_%i",argv[1],4);
DBRep::Set(Ch,free_4);
di << Ch << " ";
bui.Add(Com,free_3);
bui.Add(Com,free_4);
- sprintf(Ch,"%s_%c",argv[1],'c');
+ Sprintf(Ch,"%s_%c",argv[1],'c');
DBRep::Set(Ch,Com);
di << Ch << " ";
Handle(AIS_Shape) SC = new AIS_Shape(Com);
myAISContext->Display(SC); // nothing on the screen If I save the compound :
- sprintf(FileName,"%s/%s",DD,"free.brep");
+ Sprintf(FileName,"%s/%s",DD,"free.brep");
BRepTools::Write(Com,FileName);
Handle(Geom_Plane) Plane1 = new Geom_Plane(gp_Pnt(0,0,0),gp_Dir(0,0,1));
TCollection_ExtendedString Ext1("Dim1");
- Handle(AIS_LengthDimension) Dim1 = new AIS_LengthDimension(V1,V2,Plane1,atof(a[2]),Ext1);
+ Handle(AIS_LengthDimension) Dim1 = new AIS_LengthDimension(V1,V2,Plane1,Draw::Atof(a[2]),Ext1);
- myAIScontext->SetDisplayMode(Dim1, atoi(a[1]));
+ myAIScontext->SetDisplayMode(Dim1, Draw::Atoi(a[1]));
myAIScontext->Display(Dim1);
return 0;
}
TopoDS_Shape s1 = DBRep::Get(a[2],TopAbs_SHELL);
TopoDS_Shape s2 = DBRep::Get(a[3],TopAbs_SHELL);
if (s1.IsNull() || s2.IsNull()) return 1;
- NbPntMax=atoi(a[4]);
- Toler3d=atof(a[5]);
- Toler2d=atof(a[6]);
- RelativeTol=atoi(a[7]);
+ NbPntMax=Draw::Atoi(a[4]);
+ Toler3d=Draw::Atof(a[5]);
+ Toler2d=Draw::Atof(a[6]);
+ RelativeTol=Draw::Atoi(a[7]);
di << "BRepAlgo_BooleanOperations myalgo" << "\n";
BRepAlgo_BooleanOperations myalgo;
}
Standard_Boolean IsBRepAlgoAPI = Standard_True;
if (argc == 2) {
- Standard_Integer IsB = atoi(a[1]);
+ Standard_Integer IsB = Draw::Atoi(a[1]);
if (IsB != 1) {
IsBRepAlgoAPI = Standard_False;
#if ! defined(BRepAlgo_def01)
}
Handle(V3d_View) myV3dView = ViewerTest::CurrentView();
- if((argc == 2) && (atof(argv[1]) == 0))
+ if((argc == 2) && (Draw::Atof(argv[1]) == 0))
myV3dView->SetAntialiasingOff();
else
myV3dView->SetAntialiasingOn();
// Change the background color of the view with the color values <r>,<g>,<b>
// A color value must be defined in the space [0.,1.]
- Standard_Real QuantityOfRed = atoi(argv[1]);
- Standard_Real QuantityOfGreen = atoi(argv[2]);
- Standard_Real QuantityOfBlue = atoi(argv[3]);
+ Standard_Real QuantityOfRed = Draw::Atoi(argv[1]);
+ Standard_Real QuantityOfGreen = Draw::Atoi(argv[2]);
+ Standard_Real QuantityOfBlue = Draw::Atoi(argv[3]);
myV3dView->SetBackgroundColor(Quantity_TOC_RGB,QuantityOfRed,QuantityOfGreen,QuantityOfBlue);
myV3dView->Redraw();
break;
// change the object color with RGB values.
- Standard_Real QuantityOfRed = atof(argv[2]);
- Standard_Real QuantityOfGreen = atof(argv[3]);
- Standard_Real QuantityOfBlue = atof(argv[4]);
+ Standard_Real QuantityOfRed = Draw::Atof(argv[2]);
+ Standard_Real QuantityOfGreen = Draw::Atof(argv[3]);
+ Standard_Real QuantityOfBlue = Draw::Atof(argv[4]);
TopoDS_Shape aShape = DBRep::Get(argv[1]);
Handle(AIS_InteractiveObject) myShape = new AIS_Shape (aShape);
di << "Usage : " << argv[0] << " 0/1" << "\n";
}
- if(atoi(argv[1]) == 0) {
+ if(Draw::Atoi(argv[1]) == 0) {
myAISContext->CloseAllContexts();
BRepPrimAPI_MakeBox B(gp_Pnt(-400.,-400.,-100.),200.,150.,100.);
Handle(AIS_Shape) aBox = new AIS_Shape(B.Shape());
myAISContext->Display(aBox);
- } else if(atoi(argv[1]) == 1) {
+ } else if(Draw::Atoi(argv[1]) == 1) {
myAISContext->CloseAllContexts();
myAISContext->OpenLocalContext();
myAISContext->ActivateStandardMode(TopAbs_EDGE);
- } else if(atoi(argv[1]) == 2) {
+ } else if(Draw::Atoi(argv[1]) == 2) {
myAISContext->CloseAllContexts();
myAISContext->OpenLocalContext();
myAISContext->ActivateStandardMode(TopAbs_FACE);
gccc = new Geom2d_Circle(ccc);
TopoDS_Shape sh = BRepBuilderAPI_MakeEdge(gccc, pln).Shape();
Standard_Character aStr[5];
- sprintf(aStr,"sh%d",i);
+ Sprintf(aStr,"sh%d",i);
DBRep::Set(aStr,sh);
Handle_AIS_Shape ais = new AIS_Shape(sh);
if( i ==1 )
}
Standard_Boolean IsBRepAlgoAPI = Standard_True;
if (argc == 2) {
- Standard_Integer IsB = atoi(argv[1]);
+ Standard_Integer IsB = Draw::Atoi(argv[1]);
if (IsB != 1) {
IsBRepAlgoAPI = Standard_False;
#if ! defined(BRepAlgo_def01)
file.getline(line,80);
for(int i=0;i<30;i++) X[i]=Y[i]=0;
fr = sscanf(line,"%20c%20c",&X,&Y);
- V1 = BRepBuilderAPI_MakeVertex(gp_Pnt(atof(X),atof(Y),0.0));
+ V1 = BRepBuilderAPI_MakeVertex(gp_Pnt(Draw::Atof(X),Draw::Atof(Y),0.0));
for(;;)
{
if (!file) break;
for(int i=0;i<30;i++) X[i]=Y[i]=0;
fr = sscanf(line,"%20c%20c",&X,&Y);
- V2 = BRepBuilderAPI_MakeVertex(gp_Pnt(atof(X),atof(Y),0.0));
+ V2 = BRepBuilderAPI_MakeVertex(gp_Pnt(Draw::Atof(X),Draw::Atof(Y),0.0));
Edge = BRepBuilderAPI_MakeEdge(V1,V2);
WB.Add(Edge);
V1=V2;
TopoDS_Shape aShape = DBRep::Get(argv[1]);
Handle(AIS_InteractiveObject) anIO = new AIS_Shape(aShape);
// Handle(AIS_InteractiveObject) anIOa = ViewerTest::GetAISShapeFromName(argv[1]);
- anIO->SetHilightMode((argc == 3) ? atoi(argv[2]) : 1);
+ anIO->SetHilightMode((argc == 3) ? Draw::Atoi(argv[2]) : 1);
aContext->Display(anIO);
return 0;
}
}
Standard_Boolean IsBRepAlgoAPI = Standard_True;
if (argc == 2) {
- Standard_Integer IsB = atoi(argv[1]);
+ Standard_Integer IsB = Draw::Atoi(argv[1]);
if (IsB != 1) {
IsBRepAlgoAPI = Standard_False;
#if ! defined(BRepAlgo_def01)
}
Standard_Boolean IsBRepAlgoAPI = Standard_True;
if (argc == 2) {
- Standard_Integer IsB = atoi(argv[1]);
+ Standard_Integer IsB = Draw::Atoi(argv[1]);
if (IsB != 1) {
IsBRepAlgoAPI = Standard_False;
#if ! defined(BRepAlgo_def01)
Handle(TPrsStd_AISPresentation) prs;
if(L.FindAttribute( TPrsStd_AISPresentation::GetID(), prs) ) {
if( argc == 4 ) {
- prs->SetWidth(atof(argv[3]));
+ prs->SetWidth(Draw::Atof(argv[3]));
TPrsStd_AISViewer::Update(L);
}
else {
}
Standard_Boolean IsBRepAlgoAPI = Standard_True;
if (argc == 3) {
- Standard_Integer IsB = atoi(a[2]);
+ Standard_Integer IsB = Draw::Atoi(a[2]);
if (IsB != 1) {
IsBRepAlgoAPI = Standard_False;
#if ! defined(BRepAlgo_def01)
// Standard_Character *DD = Tcl_GetVar(di.Interp(),"Draw_DataDir",TCL_GLOBAL_ONLY);
// Standard_Character *filename = new Standard_Character [strlen(DD)+strlen(argv[2])+1];
-// sprintf(filename,"%s/%s",DD,argv[2]);
+// Sprintf(filename,"%s/%s",DD,argv[2]);
// satModel->ReadSaveFile(filename);
// for(Standard_Integer i=1;i<=nbs;i++) {
// TopoDS_Shape xShape = satShapes->Value(i);
// if(!xShape.IsNull()) {
-// sprintf(Ch,"%s_%i",argv[1],i);
+// Sprintf(Ch,"%s_%i",argv[1],i);
// DBRep::Set(Ch,xShape);
// } else cout << "The shape " << argv[1] << "_" << i << " is NULL !" << endl;
// }
di<<"inter "<<i<<": W = "<<par<<"\n"
<<"\tpnt = "<<p.X()<<" "<<p.Y()<<" "<<p.Z()<<"\n";
char n[20], *pname=n;
- sprintf(n,"%s_%d",name,i);
+ Sprintf(n,"%s_%d",name,i);
DrawTrSurf::Set(pname,p);
}
// purpose or non-infringement. Please see the License for the specific terms
// and conditions governing the rights and limitations under the License.
-
-
#include <QABugs.hxx>
+#include <Draw.hxx>
#include <Draw_Interpretor.hxx>
#include <DBRep.hxx>
#include <DrawTrSurf.hxx>
}
Standard_Integer x,y,TypeOfMarker;
- x = atoi(argv[1]);
- y = atoi(argv[2]);
- TypeOfMarker = atoi(argv[3]);
+ x = Draw::Atoi(argv[1]);
+ y = Draw::Atoi(argv[2]);
+ TypeOfMarker = Draw::Atoi(argv[3]);
if( x <= 0) {
di << "Bad value x=" << x << "\n";
return 1;
// purpose or non-infringement. Please see the License for the specific terms
// and conditions governing the rights and limitations under the License.
-
-
#include <QABugs.hxx>
+#include <Draw.hxx>
#include <Draw_Interpretor.hxx>
#include <DBRep.hxx>
#include <DrawTrSurf.hxx>
Handle(V3d_View) myV3dView = ViewerTest::CurrentView();
myV3dView->SetAnimationMode(Standard_True,Standard_True);
- myAISContext-> SetDegenerateModel((Aspect_TypeOfDegenerateModel) atoi(argv[1]),atof(argv[2]));
+ myAISContext-> SetDegenerateModel((Aspect_TypeOfDegenerateModel) Draw::Atoi(argv[1]),Draw::Atof(argv[2]));
// Timer.Reset ();
// Timer.Start ();
return 1;
}
Standard_Boolean UpdateViewer = Standard_True;
- Standard_Integer IntegerUpdateViewer = atoi(argv[1]);
+ Standard_Integer IntegerUpdateViewer = Draw::Atoi(argv[1]);
if (IntegerUpdateViewer == 0) {
UpdateViewer = Standard_False;
}
TopoDS_Shape aShape = DBRep::Get(argv[1]);
if (aShape.IsNull()) return 0;
- gp_Pnt aP1(atof(argv[2]), atof(argv[3]), atof(argv[4]));
- gp_Dir aD1(atof(argv[5]), atof(argv[6]), atof(argv[7]));
+ gp_Pnt aP1(Draw::Atof(argv[2]), Draw::Atof(argv[3]), Draw::Atof(argv[4]));
+ gp_Dir aD1(Draw::Atof(argv[5]), Draw::Atof(argv[6]), Draw::Atof(argv[7]));
gp_Lin aL1(aP1,aD1);
BRepClass3d_Intersector3d aI1;
aI1.Perform(aL1, -250, 1e-7, TopoDS::Face(aShape));
// purpose or non-infringement. Please see the License for the specific terms
// and conditions governing the rights and limitations under the License.
-
-
#include <QABugs.hxx>
+#include <Draw.hxx>
#include <Draw_Interpretor.hxx>
#include <DBRep.hxx>
#include <DrawTrSurf.hxx>
ViewerTest_DoubleMapIteratorOfDoubleMapOfInteractiveAndName it(GetMapOfAIS());
while ( it.More() ) {
Handle(AIS_InteractiveObject) AISObj = Handle(AIS_InteractiveObject)::DownCast(it.Key1());
- AISObj->SetHilightMode(atoi(argv[1]));
+ AISObj->SetHilightMode(Draw::Atoi(argv[1]));
if(AISObj->HasSelection(4)) {
//Handle(SelectMgr_Selection)& aSelection = AISObj->Selection(4);
const Handle(SelectMgr_Selection)& aSelection = AISObj->Selection(4);
if(!aSelection.IsNull()) {
for(aSelection->Init();aSelection->More();aSelection->Next()) {
Handle(StdSelect_BRepOwner) aO = Handle(StdSelect_BRepOwner)::DownCast(aSelection->Sensitive()->OwnerId());
- aO->SetHilightMode(atoi(argv[1]));
+ aO->SetHilightMode(Draw::Atoi(argv[1]));
}
}
}
di << "ERROR : Usage : " << argv[0] << " [ZDetection_mode]" << "\n";
return 1;
}
- aContext->SetZDetection(((argc == 1 || (argc == 2 && atoi(argv[1]) == 1)) ? Standard_True : Standard_False));
+ aContext->SetZDetection(((argc == 1 || (argc == 2 && Draw::Atoi(argv[1]) == 1)) ? Standard_True : Standard_False));
return 0;
}
}
if (all != 0) {
char s[100];
- sprintf(s,"%f %f %f",(float)x/all,(float)y/all,(float)z/all);
+ Sprintf(s,"%f %f %f",(float)x/all,(float)y/all,(float)z/all);
di<<s;
return 0;
}
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);
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);
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());
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);
// 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);
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++;
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()) {
}
// if (nb >= 4) {
-// OnlyModif = atoi(arg[3]);
+// OnlyModif = Draw::Atoi(arg[3]);
// }
} else {
di<<"Usage: BuildName df entry evolution(P[RIMITIVE] G[ENERATED] M[ODIFY] D[ELETE] R[EPLACE] S[ELECTED]) shape1 [shape2 ...]"<<"\n";
for(a=1;anIter.More();anIter.Next(),a++) {
if (anIter.NewShape().IsNull()) a--;
else if (nb==4) {
- sprintf(aName,"%s_%d",arg[3],a);
+ Sprintf(aName,"%s_%d",arg[3],a);
DBRep::Set (aName,anIter.NewShape());
}
}
for(a=1;anIter.More();anIter.Next(),a++) {
if (anIter.OldShape().IsNull()) a--;
else if (nb==4) {
- sprintf(aName,"%s_%d",arg[3],a);
+ Sprintf(aName,"%s_%d",arg[3],a);
DBRep::Set (aName,anIter.OldShape());
}
}
Standard_Boolean done = SL.Solve(valid);
TopoDS_Shape Res = TNaming_Tool::CurrentShape(SL.NamedShape());
//TopoDS_Shape Res = TNaming_Tool::CurrentShape(NS);
- sprintf (name,"%s_%s","new",a[2]);
+ Sprintf (name,"%s_%s","new",a[2]);
Display (name,Res);
return done?0:1;
}
#include <TColStd_HSequenceOfReal.hxx>
#include <AIS_InteractiveContext.hxx>
#include <Graphic3d_GraphicDevice.hxx>
+#include <Draw.hxx>
#include <Draw_Window.hxx>
#include <Draw_Viewer.hxx>
#include <Aspect_WindowDriver.hxx>
"QA_DUP",TCL_GLOBAL_ONLY);
#endif
Standard_Integer aDUP=1;
- if((adup != NULL) && (atof(adup) == 0)) {
+ if((adup != NULL) && (Draw::Atof(adup) == 0)) {
aDUP = 0;
}
anAISWindow->Size (aWindowSizeX, aWindowSizeY);
Standard_Integer anArgIter = 1;
- const Standard_Integer aPickCoordX = atoi (theArgs[anArgIter++]);
- const Standard_Integer aPickCoordY = atoi (theArgs[anArgIter++]);
+ const Standard_Integer aPickCoordX = Draw::Atoi (theArgs[anArgIter++]);
+ const Standard_Integer aPickCoordY = Draw::Atoi (theArgs[anArgIter++]);
const Standard_Integer aRadius = (theArgsNb == 3) ? 0 : 1;
Image_ColorRGBF aColorInput = {{ 0.0f, 0.0f, 0.0f }};
if (theArgsNb == 6)
{
- aColorInput.r() = (Standard_ShortReal )atof (theArgs[anArgIter++]);
- aColorInput.g() = (Standard_ShortReal )atof (theArgs[anArgIter++]);
- aColorInput.b() = (Standard_ShortReal )atof (theArgs[anArgIter++]);
+ aColorInput.r() = (Standard_ShortReal )Draw::Atof (theArgs[anArgIter++]);
+ aColorInput.g() = (Standard_ShortReal )Draw::Atof (theArgs[anArgIter++]);
+ aColorInput.b() = (Standard_ShortReal )Draw::Atof (theArgs[anArgIter++]);
}
Image_PixMap anImage;
Standard_Integer QAAIS_MousePoint_X = 0;
Standard_Integer QAAIS_MousePoint_Y = 0;
Standard_Character QAAIS_MousePointX[32];
- sprintf (QAAIS_MousePointX, "X : %d", QAAIS_MousePoint_X);
+ Sprintf (QAAIS_MousePointX, "X : %d", QAAIS_MousePoint_X);
Standard_Character QAAIS_MousePointY[32];
- sprintf (QAAIS_MousePointY, "Y : %d", QAAIS_MousePoint_Y);
+ Sprintf (QAAIS_MousePointY, "Y : %d", QAAIS_MousePoint_Y);
Standard_ShortReal QAAIS_ColorRED = 0;
Standard_ShortReal QAAIS_ColorGRN = 0;
Standard_ShortReal QAAIS_ColorBLU = 0;
QAAIS_ColorView -> SetBackgroundColor (QAAIS_ShowingColor);
QAAIS_ColorView -> Redraw ();
QAAIS_CoordWindow.Clear();
- sprintf (QAAIS_MousePointX, "X : %d", QAAIS_MousePoint_X);
- sprintf (QAAIS_MousePointY, "Y : %d", QAAIS_MousePoint_Y);
+ Sprintf (QAAIS_MousePointX, "X : %d", QAAIS_MousePoint_X);
+ Sprintf (QAAIS_MousePointY, "Y : %d", QAAIS_MousePoint_Y);
QAAIS_CoordWindow.DrawString (30, 35, QAAIS_MousePointX);
QAAIS_CoordWindow.DrawString (125, 35, QAAIS_MousePointY);
}
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;
// purpose or non-infringement. Please see the License for the specific terms
// and conditions governing the rights and limitations under the License.
-
-
#include <QANCollection.hxx>
+
+#include <Draw.hxx>
#include <Draw_Interpretor.hxx>
#include <gp_Pnt.hxx>
-// HashCode and IsEquel must be defined for key types of maps
-Standard_Integer HashCode(const gp_Pnt thePnt,
- int theUpper)
+// HashCode and IsEquel must be defined for key types of maps
+Standard_Integer HashCode(const gp_Pnt thePnt, int theUpper)
{
return HashCode(thePnt.X(),theUpper);
}
di << "Usage : " << argv[0] << " Lower Upper" << "\n";
return 1;
}
- Lower = atoi(argv[1]);
- Upper = atoi(argv[2]);
+ Lower = Draw::Atoi(argv[1]);
+ Upper = Draw::Atoi(argv[2]);
if ( Lower > Upper ) {
di << "Lower > Upper" << "\n";
return 1;
di << "Usage : " << argv[0] << " LowerRow UpperRow LowerCol UpperCol" << "\n";
return 1;
}
- LowerRow = atoi(argv[1]);
- UpperRow = atoi(argv[2]);
- LowerCol = atoi(argv[3]);
- UpperCol = atoi(argv[4]);
+ LowerRow = Draw::Atoi(argv[1]);
+ UpperRow = Draw::Atoi(argv[2]);
+ LowerCol = Draw::Atoi(argv[3]);
+ UpperCol = Draw::Atoi(argv[4]);
if ( LowerRow > UpperRow ) {
di << "LowerRow > UpperRow" << "\n";
return 1;
// purpose or non-infringement. Please see the License for the specific terms
// and conditions governing the rights and limitations under the License.
-
-
#include <QANCollection.hxx>
+
+#include <Draw.hxx>
#include <Draw_Interpretor.hxx>
#define ItemType gp_Pnt
di << "Usage : " << argv[0] << " Repeat Size" << "\n";
return 1;
}
- Repeat = atoi(argv[1]);
- Size = atoi(argv[2]);
+ Repeat = Draw::Atoi(argv[1]);
+ Size = Draw::Atoi(argv[2]);
if ( Repeat < 1 ) {
di << "Repeat > 0" << "\n";
return 1;
// ***
- if (!atoi(a[3])) return 0;
+ if (!Draw::Atoi(a[3])) return 0;
Standard_Real aDX = 100.0;
Standard_Real aDY = 100.0;
Standard_Real aDZ = 100.0;
if(nb > 6) {
- aDX = atof(a[6]);
- if(nb > 7) aDY = atof(a[7]);
- if(nb > 8) aDZ = atof(a[8]);
+ aDX = Draw::Atof(a[6]);
+ if(nb > 7) aDY = Draw::Atof(a[7]);
+ if(nb > 8) aDZ = Draw::Atof(a[8]);
}
// cout<<endl;
// cout<<"TRANSLATION ... DX = "<<aDX <<" DY = "<< aDY <<" DZ = " << aDZ <<endl;
if (aRes.IsNull()) {
// cout<<"Failure of TNaming_Tool::FindShape()!"<<endl;
// return 1;
- sprintf(aNotSolved,"%s %d",aNotSolved,i);
+ Sprintf(aNotSolved,"%s %d",aNotSolved,i);
isFailured = Standard_True;
// break;
continue;
DDF::AddLabel(DF, a[2], L);
di<<"SELECT A SUB-SHAPE ..."<<"\n";
- TopoDS_Shape aSelectedShape = ViewerTest::PickShape((TopAbs_ShapeEnum)atoi(a[3]));
+ TopoDS_Shape aSelectedShape = ViewerTest::PickShape((TopAbs_ShapeEnum)Draw::Atoi(a[3]));
if (aSelectedShape.IsNull()) {
di<<"QANewDBRepNaming_CheckSelectShape(): Nothing is selected ..."<<"\n";
return 1;
Handle(TNaming_NamedShape) NS;
if (itr.Value().FindAttribute(TNaming_NamedShape::GetID(), NS)) {
aContext = NS->Get();
- TopExp_Explorer expl(aContext, (TopAbs_ShapeEnum)atoi(a[3]));
+ TopExp_Explorer expl(aContext, (TopAbs_ShapeEnum)Draw::Atoi(a[3]));
for (; expl.More(); expl.Next()) {
if (expl.Current().IsSame(aSelectedShape)) {
di<<"QANewDBRepNaming_CheckSelectShape(): The context is found at ";
TDF_Label L;
if (!DDF::AddLabel(D->GetData(), arg[2], L)) return 1;
- const Standard_Integer Op = (Standard_Integer)atoi(arg[3]);
+ const Standard_Integer Op = (Standard_Integer)Draw::Atoi(arg[3]);
const TopoDS_Shape& S1 = DBRep::Get(arg[4]);
const TopoDS_Shape& S2 = DBRep::Get(arg[5]);
Standard_Integer Orientation = 0;
- if (nb == 7) Orientation = atoi(arg[6]);
+ if (nb == 7) Orientation = Draw::Atoi(arg[6]);
switch (Op) {
case 1: {
const TopoDS_Shape& S2 = DBRep::Get(arg[4]);
Standard_Integer Orientation = 0;
if (nb == 6) {
- Orientation = atoi(arg[5]);
+ Orientation = Draw::Atoi(arg[5]);
}
QANewBRepNaming_Limitation nameBool(L);
const QANewModTopOpe_ModeOfLimitation aMode = (QANewModTopOpe_ModeOfLimitation) Orientation;
TDF_Label L;
if (!QADNaming::Entry(arg, L)) return 1;
- BRepPrimAPI_MakeBox mkBox(atof(arg[3]), atof(arg[4]), atof(arg[5]));
+ BRepPrimAPI_MakeBox mkBox(Draw::Atof(arg[3]), Draw::Atof(arg[4]), Draw::Atof(arg[5]));
mkBox.Build();
if(!mkBox.IsDone()) {
TDF_Label L;
if (!QADNaming::Entry(arg, L)) return 1;
- BRepPrimAPI_MakeCylinder mkCylinder(atof(arg[3]), atof(arg[4]));
- if (atof(arg[5]) != 0.) {
- // for Mandrake-10 - mkv,02.06.06 - mkCylinder = BRepPrimAPI_MakeCylinder(atof(arg[3]), atof(arg[4]), atof(arg[5]));
- BRepPrimAPI_MakeCylinder MakeCylinder(atof(arg[3]), atof(arg[4]), atof(arg[5]));
+ BRepPrimAPI_MakeCylinder mkCylinder(Draw::Atof(arg[3]), Draw::Atof(arg[4]));
+ if (Draw::Atof(arg[5]) != 0.) {
+ // for Mandrake-10 - mkv,02.06.06 - mkCylinder = BRepPrimAPI_MakeCylinder(Draw::Atof(arg[3]), Draw::Atof(arg[4]), Draw::Atof(arg[5]));
+ BRepPrimAPI_MakeCylinder MakeCylinder(Draw::Atof(arg[3]), Draw::Atof(arg[4]), Draw::Atof(arg[5]));
mkCylinder = MakeCylinder;
}
mkCylinder.Build();
QANewBRepNaming_Cylinder nameCylinder(L);
if (nb == 6) nameCylinder.Load(mkCylinder, QANewBRepNaming_SHELL);
- else if (atoi(arg[6]) == 0) nameCylinder.Load(mkCylinder, QANewBRepNaming_SHELL);
+ else if (Draw::Atoi(arg[6]) == 0) nameCylinder.Load(mkCylinder, QANewBRepNaming_SHELL);
else nameCylinder.Load(mkCylinder, QANewBRepNaming_SOLID);
return 0;
{
TDF_Label L;
if (!QADNaming::Entry(arg, L)) return 1;
- Standard_Real R = atof(arg[3]);
- Standard_Real X = atof(arg[4]);
- Standard_Real Y = atof(arg[5]);
- Standard_Real Z = atof(arg[6]);
- Standard_Real DX = atof(arg[7]);
- Standard_Real DY = atof(arg[8]);
- Standard_Real DZ = atof(arg[9]);
+ Standard_Real R = Draw::Atof(arg[3]);
+ Standard_Real X = Draw::Atof(arg[4]);
+ Standard_Real Y = Draw::Atof(arg[5]);
+ Standard_Real Z = Draw::Atof(arg[6]);
+ Standard_Real DX = Draw::Atof(arg[7]);
+ Standard_Real DY = Draw::Atof(arg[8]);
+ Standard_Real DZ = Draw::Atof(arg[9]);
QANewBRepNaming_TypeOfPrimitive3D type = QANewBRepNaming_SHELL;
- if (nb == 11) type = (QANewBRepNaming_TypeOfPrimitive3D) atoi(arg[10]);
+ if (nb == 11) type = (QANewBRepNaming_TypeOfPrimitive3D) Draw::Atoi(arg[10]);
QANewBRepNaming_Sphere nameSphere(L);
BRepPrimAPI_MakeSphere mkSphere(R);
if (!QADNaming::Entry(arg, L)) return 1;
if (!DDF::AddLabel(L.Data(), arg[3], BL)) return 1;
- Standard_Real H = atof(arg[4]);
+ Standard_Real H = Draw::Atof(arg[4]);
Handle(TNaming_NamedShape) BasisNS;
if (!BL.FindAttribute(TNaming_NamedShape::GetID(), BasisNS)) return 1;
QANewBRepNaming_Prism namePrism(L);
if (nb >= 8) {
- gp_Dir Direction(atof(arg[5]), atof(arg[6]), atof(arg[7]));
+ gp_Dir Direction(Draw::Atof(arg[5]), Draw::Atof(arg[6]), Draw::Atof(arg[7]));
gp_Vec Vector(Direction);
Vector.Normalize();
Vector *= H;
namePrism.Load(mkPrism, Basis);
}
else if (nb == 9) {
- BRepPrimAPI_MakePrism mkPrism(Basis, Direction, (Standard_Boolean)atoi(arg[8]));
+ BRepPrimAPI_MakePrism mkPrism(Basis, Direction, (Standard_Boolean)Draw::Atoi(arg[8]));
mkPrism.Build();
if(!mkPrism.IsDone()) {
}
else if (nb == 6) {
- Standard_Real Angle = atof(arg[5]);
+ Standard_Real Angle = Draw::Atof(arg[5]);
BRepPrimAPI_MakeRevol mkRevol(Basis, axis, Angle);
mkRevol.Build();
if (!DDF::AddLabel(L.Data(), arg[3], BL)) return 1;
if (!DDF::AddLabel(L.Data(), arg[4], PL)) return 1;
- Standard_Real aRadius = atoi(arg[5]);
+ Standard_Real aRadius = Draw::Atoi(arg[5]);
Handle(TNaming_NamedShape) BasisNS, PathNS;
if (!BL.FindAttribute(TNaming_NamedShape::GetID(), BasisNS)) return 1;
if (!PL.FindAttribute(TNaming_NamedShape::GetID(), PathNS)) return 1;
if (!DDF::AddLabel(L.Data(), arg[3], BL)) return 1;
if (!DDF::AddLabel(L.Data(), arg[4], EL)) return 1;
if (!DDF::AddLabel(L.Data(), arg[5], FL)) return 1;
- aDist1 = atoi(arg[6]);
- aDist2 = atoi(arg[7]);
+ aDist1 = Draw::Atoi(arg[6]);
+ aDist2 = Draw::Atoi(arg[7]);
Handle(TNaming_NamedShape) BasisNS, EdgeNS, FaceNS;
if (!BL.FindAttribute(TNaming_NamedShape::GetID(), BasisNS)) return 1;
// si Vnorm est quasi-nul, on le charge a 0 explicitement
Vnorm.SetCoord (0., 0., 0.);
}
- sprintf (sval,
+ Sprintf (sval,
" facet normal % 12e % 12e % 12e\n"
" outer loop\n"
" vertex % 12e % 12e % 12e\n"
Standard_Integer nbLines = 0;
Standard_Integer nbTris = 0;
Standard_Integer iTri;
- Standard_ShortReal x[4],y[4],z[4];
Standard_Integer i1,i2,i3;
Handle(StlMesh_Mesh) ReadMesh;
fclose(file);
file = fopen(filename.ToCString(),"r");
-
-
// count the number of lines
for (ipos = 0; ipos < filesize; ++ipos) {
if (getc(file) == '\n')
Message_ProgressSentry aPS (theProgInd, "Triangles", 0, (nbTris - 1) * 1.0 / IND_THRESHOLD, 1);
for (iTri = 0; iTri < nbTris && aPS.More();)
{
+ char x[256]="", y[256]="", z[256]="";
+
// reading the facet normal
- fscanf(file,"%*s %*s %f %f %f\n",&x[0],&y[0],&z[0]);
+ if (3 != fscanf(file,"%*s %*s %80s %80s %80s\n", x, y, z))
+ break; // error should be properly reported
+ gp_XYZ aN (Atof(x), Atof(y), Atof(z));
// skip the keywords "outer loop"
fscanf(file,"%*s %*s");
// reading vertex
- fscanf(file,"%*s %f %f %f\n",&x[1],&y[1],&z[1]);
- fscanf(file,"%*s %f %f %f\n",&x[2],&y[2],&z[2]);
- fscanf(file,"%*s %f %f %f\n",&x[3],&y[3],&z[3]);
+ if (3 != fscanf(file,"%*s %80s %80s %80s\n", x, y, z))
+ break; // error should be properly reported
+ gp_XYZ aV1 (Atof(x), Atof(y), Atof(z));
+ if (3 != fscanf(file,"%*s %80s %80s %80s\n", x, y, z))
+ break; // error should be properly reported
+ gp_XYZ aV2 (Atof(x), Atof(y), Atof(z));
+ if (3 != fscanf(file,"%*s %80s %80s %80s\n", x, y, z))
+ break; // error should be properly reported
+ gp_XYZ aV3 (Atof(x), Atof(y), Atof(z));
// here the facet must be built and put in the mesh datastructure
- i1 = ReadMesh->AddOnlyNewVertex ((Standard_Real)x[1],(Standard_Real)y[1],(Standard_Real)z[1]);
- i2 = ReadMesh->AddOnlyNewVertex ((Standard_Real)x[2],(Standard_Real)y[2],(Standard_Real)z[2]);
- i3 = ReadMesh->AddOnlyNewVertex ((Standard_Real)x[3],(Standard_Real)y[3],(Standard_Real)z[3]);
- ReadMesh->AddTriangle (i1,i2,i3,(Standard_Real)x[0],(Standard_Real)y[0],(Standard_Real)z[0]);
+ i1 = ReadMesh->AddOnlyNewVertex (aV1.X(), aV1.Y(), aV1.Z());
+ i2 = ReadMesh->AddOnlyNewVertex (aV2.X(), aV2.Y(), aV2.Z());
+ i3 = ReadMesh->AddOnlyNewVertex (aV3.X(), aV3.Y(), aV3.Z());
+ ReadMesh->AddTriangle (i1, i2, i3, aN.X(), aN.Y(), aN.Z());
// skip the keywords "endloop"
fscanf(file,"%*s");
#endif
fclose(file);
return ReadMesh;
-
}
#include <SWDRAW.ixx>
+#include <Draw.hxx>
#include <DBRep.hxx>
-// CKY 4-AOUT-1998 : pb avec GeomFill
-//#include <GeometryTest.hxx>
-//#include <BRepTest.hxx>
-//#include <MeshTest.hxx>
#include <SWDRAW_ShapeTool.hxx>
#include <SWDRAW_ShapeAnalysis.hxx>
return 1;
}
TopoDS_Shape newshape;
- Standard_Real tol = atof(argv[5]);
+ Standard_Real tol = Draw::Atof(argv[5]);
Standard_Real maxtol = 1.;
- if (argc > 6) maxtol = atof(argv[6]);
+ if (argc > 6) maxtol = Draw::Atof(argv[6]);
XSAlgo::AlgoContainer()->PrepareForTransfer();
Handle(Standard_Transient) info; // reserved for special uses
#include <SWDRAW_ShapeAnalysis.ixx>
#include <stdio.h>
+#include <Draw.hxx>
#include <DBRep.hxx>
#include <DrawTrSurf.hxx>
#include <SWDRAW.hxx>
if (nextarg < 3) opt = 'a';
Standard_Real tol1= 0., tol2= 0.;
- if (nextarg < argc) tol1 = atof (argv[nextarg]);
- if (nextarg < argc-1) tol2 = atof (argv[nextarg+1]);
-// Standard_Real tol = atof (argv[2]);
+ if (nextarg < argc) tol1 = Draw::Atof (argv[nextarg]);
+ if (nextarg < argc-1) tol2 = Draw::Atof (argv[nextarg+1]);
+// Standard_Real tol = Draw::Atof (argv[2]);
Handle(TopTools_HSequenceOfShape) list = sat.InTolerance (Shape,tol1,tol2,type);
Standard_Integer i, nb = list->Length();
switch (type) {
di<<"\n";
char nomsh[30];
for (i = 1; i <= nb; i ++) {
- sprintf (nomsh,"tol_%d",i);
+ Sprintf (nomsh,"tol_%d",i);
DBRep::Set (nomsh,list->Value(i));
}
}
Handle(Geom_Surface) thesurf = BRep_Tool::Surface (F); // pas locface
// On y va
Standard_Real X,Y,Z,U,V;
- X = U = atof (argv[2]);
- Y = V = atof (argv[3]);
+ X = U = Draw::Atof (argv[2]);
+ Y = V = Draw::Atof (argv[3]);
if (argc > 4) {
- Z = atof (argv[4]);
+ Z = Draw::Atof (argv[4]);
gp_Pnt P3D (X,Y,Z);
di<<" Point 3D X = "<<X<<" Y = "<<Y<<" Z = "<<Z<<"\n";
Standard_Real uf, ul, vf, vl;
if (C.IsNull())
{ di<<arg1<<" neither EDGE nor CURVE 3D"<<"\n"; return 1 /* Error */; }
cf = C->FirstParameter(); cl = C->LastParameter();
- if (argc >= 7) { cf = atof (argv[2]); cl = atof (argv[3]); i0 = 2; }
+ if (argc >= 7) { cf = Draw::Atof (argv[2]); cl = Draw::Atof (argv[3]); i0 = 2; }
di<<"Curve 3D "<<arg1<<" Params from "<<cf<<" to "<<cl<<"\n";
}
Standard_Real X,Y,Z;
- X = atof (argv[2+i0]);
- Y = atof (argv[3+i0]);
- Z = atof (argv[4+i0]);
+ X = Draw::Atof (argv[2+i0]);
+ Y = Draw::Atof (argv[3+i0]);
+ Z = Draw::Atof (argv[4+i0]);
di<<"Precision (BRepBuilderAPI) : "<<BRepBuilderAPI::Precision()
<<" Projection : "<<X<<" "<<Y<<" "<<Z<<"\n";
if(analyzer.ModifyBigSplineMode()) {
sec = analyzer.BigSplineSec();
for(Standard_Integer i = 1; i <= sec->Length(); i++) {
- sprintf(nompart,"%s_bigspl_%d",arg2,i);
+ Sprintf(nompart,"%s_bigspl_%d",arg2,i);
DBRep::Set (nompart,sec->Value(i));
}
}
if(analyzer.ModifyIndirectMode()) {
sec = analyzer.IndirectSec();
for(Standard_Integer i = 1; i <= sec->Length(); i++) {
- sprintf(nompart,"%s_indsur_%d",arg2,i);
+ Sprintf(nompart,"%s_indsur_%d",arg2,i);
DBRep::Set (nompart,sec->Value(i));
}
}
if(analyzer.ModifyOffestSurfaceMode()) {
sec = analyzer.OffsetSurfaceSec();
for(Standard_Integer i = 1; i <= sec->Length(); i++) {
- sprintf(nompart,"%s_ofsur_%d",arg2,i);
+ Sprintf(nompart,"%s_ofsur_%d",arg2,i);
DBRep::Set (nompart,sec->Value(i));
}
}
if(analyzer.ModifyTrimmed3dMode()) {
sec = analyzer.Trimmed3dSec();
for(Standard_Integer i = 1; i <= sec->Length(); i++) {
- sprintf(nompart,"%s_trc3d_%d",arg2,i);
+ Sprintf(nompart,"%s_trc3d_%d",arg2,i);
DBRep::Set (nompart,sec->Value(i));
}
}
if(analyzer.ModifyOffsetCurveMode()) {
sec = analyzer.OffsetCurveSec();
for(Standard_Integer i = 1; i <= sec->Length(); i++) {
- sprintf(nompart,"%s_ofcur_%d",arg2,i);
+ Sprintf(nompart,"%s_ofcur_%d",arg2,i);
DBRep::Set (nompart,sec->Value(i));
}
}
if(analyzer.ModifyTrimmed2dMode()) {
sec = analyzer.Trimmed2dSec();
for(Standard_Integer i = 1; i <= sec->Length(); i++) {
- sprintf(nompart,"%s_trc2d_%d",arg2,i);
+ Sprintf(nompart,"%s_trc2d_%d",arg2,i);
DBRep::Set (nompart,sec->Value(i));
}
}
Standard_CString prefix = 0;
if ( argc >2 ) {
if ( IsDigit(argv[2][0]) ) {
- nbpnts = atoi(argv[2]);
+ nbpnts = Draw::Atoi(argv[2]);
if ( nbpnts <2 ) nbpnts = 2;
if ( argc >3 ) prefix = argv[3];
}
"MAX=" << relmax << " AVG=" << relave/num << " MIN=" << relmin << "\n";
if ( prefix && prefix[0] ) {
char name[21];
- sprintf ( name, "%.10s_edge_tol", prefix );
+ Sprintf ( name, "%.10s_edge_tol", prefix );
DBRep::Set (name,edmax);
di << "Edge with max tolerance saved to " << name;
if ( edmax.IsSame ( edmaxrel ) ) di << "\n";
else {
- sprintf ( name, "%.10s_edge_rel", prefix );
+ Sprintf ( name, "%.10s_edge_rel", prefix );
DBRep::Set (name,edmaxrel);
di << "; edge with max relation saved to " << name << "\n";
}
TopoDS_Edge edge = TopoDS::Edge ( ed.Current() );
if ( edge.IsSame ( edmax ) || edge.IsSame ( edmaxrel ) ) {
if ( ! num1 ) di << "Concerned faces saved to shapes ";
- sprintf ( name, "%.10s_%d", prefix, num1+1 );
+ Sprintf ( name, "%.10s_%d", prefix, num1+1 );
DBRep::Set (name,face);
//cout << ( num1 ? ", " : "" ) << name;
if (num1 == 0) {
if ((n < 3) || (n > 5)) return 1;
TopoDS_Shape shape = DBRep::Get(a[1]);
if (shape.IsNull()) return 1;
- Standard_Real toler = atof (a[2]);
+ Standard_Real toler = Draw::Atof (a[2]);
Standard_Boolean splitclosed = Standard_False, splitopen = Standard_False;
- if ( n > 3) splitclosed = atoi (a[3]);
- if ( n > 4) splitopen = atoi (a[4]);
+ if ( n > 3) splitclosed = Draw::Atoi (a[3]);
+ if ( n > 4) splitopen = Draw::Atoi (a[4]);
ShapeAnalysis_FreeBounds F;
if (toler <= 0)
char name[100];
TopoDS_Shape wires = F.GetClosedWires();
- sprintf (name, "%s_c", a[1]);
+ Sprintf (name, "%s_c", a[1]);
DBRep::Set (name, wires);
di << name << " - closed wires" << "\n";
wires = F.GetOpenWires();
- sprintf (name, "%s_o", a[1]);
+ Sprintf (name, "%s_o", a[1]);
DBRep::Set (name, wires);
di << name << " - open wires" << "\n";
Standard_Real ratio = fbd->Ratio();
Standard_Real width = fbd->Width();
Standard_Integer notch = fbd->NbNotches();
- sprintf(str," %d\t%12.5f\t%12.5f\t%12.5f\t%12.5f\t%d", i, area, perimeter, ratio, width, notch);
+ Sprintf(str," %d\t%12.5f\t%12.5f\t%12.5f\t%12.5f\t%d", i, area, perimeter, ratio, width, notch);
di<<str<<"\n";
}
Standard_Real toler = 0.;
Standard_Boolean splitclosed = Standard_False, splitopen = Standard_False;
- if (n > 2) toler = atof(a[2]);
- if (n > 3) splitclosed = atoi(a[3]);
- if (n > 4) splitopen = atoi(a[4]);
+ if (n > 2) toler = Draw::Atof(a[2]);
+ if (n > 3) splitclosed = Draw::Atoi(a[3]);
+ if (n > 4) splitopen = Draw::Atoi(a[4]);
ShapeAnalysis_FreeBoundsProperties analyzer;
if (toler > 0)
analyzer.Init(source, toler, splitclosed, splitopen);
}
char name[100];
- sprintf (name, "%s_c",a[1]);
+ Sprintf (name, "%s_c",a[1]);
di << name << " - closed wires, ";
DBRep::Set(name, closed);
- sprintf (name, "%s_o",a[1]);
+ Sprintf (name, "%s_o",a[1]);
di << name << " - closed wires " << "\n";
DBRep::Set(name, open);
return 0;
if ((n < 4) || (n > 6)) return 1;
TopoDS_Shape shape = DBRep::Get(a[1]);
if (shape.IsNull()) return 1;
- Standard_Real sewtoler = atof (a[2]), closetoler = atof (a[3]);
+ Standard_Real sewtoler = Draw::Atof (a[2]), closetoler = Draw::Atof (a[3]);
Standard_Boolean splitclosed = Standard_False, splitopen = Standard_False;
- if ( n > 4) splitclosed = atoi (a[3]);
- if ( n > 5) splitopen = atoi (a[4]);
+ if ( n > 4) splitclosed = Draw::Atoi (a[3]);
+ if ( n > 5) splitopen = Draw::Atoi (a[4]);
ShapeFix_FreeBounds F;
if (sewtoler <= 0)
char name[100];
TopoDS_Shape wires = F.GetClosedWires();
- sprintf (name, "%s_c", a[1]);
+ Sprintf (name, "%s_c", a[1]);
DBRep::Set (name, wires);
di << name << " - closed wires" << "\n";
wires = F.GetOpenWires();
- sprintf (name, "%s_o", a[1]);
+ Sprintf (name, "%s_o", a[1]);
DBRep::Set (name, wires);
di << name << " - open wires" << "\n";
if (TheList.IsNull()) return 1;
Standard_Real toler = 0.001;
int create = 0;
- if ( n >= 3) toler = atof(a[2]);
+ if ( n >= 3) toler = Draw::Atof(a[2]);
if (n == 4 && !strcmp(a[3],"C")) create = 1;
ShapeAnalysis_FreeBounds F(TheList,toler);
//
Standard_Integer iwire = 0;
while (S.More())
{
- sprintf (num,"%d",iwire);
+ Sprintf (num,"%d",iwire);
name[0] = 'w';
name[1] = '\0';
strncat(name,num,strlen(num));
iwire = 0;
while (S.More())
{
- sprintf (num,"%d",iwire);
+ Sprintf (num,"%d",iwire);
name[0] = 'E';
name[1] = '\0';
strncat(name,num,strlen(num));
// purpose or non-infringement. Please see the License for the specific terms
// and conditions governing the rights and limitations under the License.
-// abv 08.05.99: new command convtorevol
-
#include <SWDRAW_ShapeCustom.ixx>
+
+#include <Draw.hxx>
#include <DBRep.hxx>
#include <SWDRAW.hxx>
#include <TopoDS_Shape.hxx>
}
Standard_CString arg2 = argv[1];
TopoDS_Shape Shape = DBRep::Get(arg2);
- Standard_Integer Degree = atoi(argv[2]);
- Standard_Integer MaxSeg = atoi(argv[3]);
+ Standard_Integer Degree = Draw::Atoi(argv[2]);
+ Standard_Integer MaxSeg = Draw::Atoi(argv[3]);
GeomAbs_Shape aCont3 = GeomAbs_C0;
Standard_Integer k = 4;
if( argc > k)
TopoDS_Shape Shape = DBRep::Get(arg2);
if (Shape.IsNull()) { di << "Shape unknown: " << arg2 << "\n"; return 1 /* Error */; }
- TopoDS_Shape result = ShapeCustom::ScaleShape (Shape, atof(argv[3]));
+ TopoDS_Shape result = ShapeCustom::ScaleShape (Shape, Draw::Atof(argv[3]));
if (result.IsNull()) { di << "NO RESULT" << "\n"; return 1; }
else if (result == Shape) { di << "NO MODIFICATIONS" << "\n"; return 0; }
DBRep::Set (argv[1],result);
di<< "Invalid argument Cont3e" << "\n"; return 1; }
Handle(ShapeCustom_RestrictionParameters) aParameters = new ShapeCustom_RestrictionParameters;
- TopoDS_Shape result = ShapeCustom::BSplineRestriction (Shape, atof(argv[3]), atof(argv[4]), atoi(argv[5]),atoi(argv[6]),aCont3,aCont2,(Standard_Boolean) atoi(argv[9]),(Standard_Boolean) atoi(argv[10]),aParameters);
+ TopoDS_Shape result = ShapeCustom::BSplineRestriction (Shape, Draw::Atof(argv[3]), Draw::Atof(argv[4]), Draw::Atoi(argv[5]),Draw::Atoi(argv[6]),aCont3,aCont2,(Standard_Boolean) Draw::Atoi(argv[9]),(Standard_Boolean) Draw::Atoi(argv[10]),aParameters);
if (result.IsNull()) { di << "NO RESULT" << "\n"; return 1; }
else if (result == Shape) {
di << "NO MODIFICATIONS" << "\n";
// purpose or non-infringement. Please see the License for the specific terms
// and conditions governing the rights and limitations under the License.
-
-
#include <SWDRAW_ShapeFix.ixx>
+
+#include <Draw.hxx>
#include <DBRep.hxx>
#include <SWDRAW.hxx>
#include <gp_XYZ.hxx>
Standard_Real tmin,tmax;
mod2 = argv[premarg][0];
- if (mod2 == '=') tmin = tmax = atof (argv[argc-1]);
- else if (mod2 == '<') { tmin = 0; tmax = atof (argv[argc-1]); }
- else if (mod2 == '>') { tmin = atof (argv[argc-1]); tmax = 0; }
- else { tmin = atof (argv[premarg]); tmax = atof (argv[argc-1]); }
+ if (mod2 == '=') tmin = tmax = Draw::Atof (argv[argc-1]);
+ else if (mod2 == '<') { tmin = 0; tmax = Draw::Atof (argv[argc-1]); }
+ else if (mod2 == '>') { tmin = Draw::Atof (argv[argc-1]); tmax = 0; }
+ else { tmin = Draw::Atof (argv[premarg]); tmax = Draw::Atof (argv[argc-1]); }
if (argc == premarg + 1 || tmin == tmax) di<<"Setting Tolerance to "<<tmin<<"\n";
else if (tmax < tmin) di<<"Minimum Tolerance to "<<tmin<<"\n";
if(initShape.IsNull()) continue;
sfs->Init ( initShape );
} break;
- case 2: sfs->SetPrecision (atof(argv[i])); break;
- case 3: sfs->SetMaxTolerance(atof(argv[i])); break;
+ case 2: sfs->SetPrecision (Draw::Atof(argv[i])); break;
+ case 3: sfs->SetMaxTolerance(Draw::Atof(argv[i])); break;
}
}
par++;
if ( mess < 0 )
{
char buff[256];
- sprintf ( buff, "%s_%s", res, "m" );
+ Sprintf ( buff, "%s_%s", res, "m" );
di << " Modified shapes saved in compound: " << buff;
DBRep::Set (buff, aCompound);
}
}
Handle(ShapeFix_Wireframe) SFWF = new ShapeFix_Wireframe(S);
- Standard_Real prec = ( n >3 ? atof(a[3]) : 0. );
+ Standard_Real prec = ( n >3 ? Draw::Atof(a[3]) : 0. );
SFWF->SetPrecision(prec);
if ( SFWF->FixWireGaps() ) {
DBRep::Set(a[1],SFWF->Shape());
return 1;
}
- Standard_Real prec = (n == 4)? atof(a[3]) : 1.;
+ Standard_Real prec = (n == 4)? Draw::Atof(a[3]) : 1.;
ShapeFix_Wireframe SFWF(S);
SFWF.SetPrecision(prec);
Standard_Integer mode = 2;
Standard_Real tolang = M_PI/2;
if(n > k)
- tol = atof(a[k++]);
+ tol = Draw::Atof(a[k++]);
if(n > k)
- mode= atoi(a[k++]);
+ mode= Draw::Atoi(a[k++]);
if(n > k)
- tolang = atof(a[k++]);
+ tolang = Draw::Atof(a[k++]);
Handle(ShapeFix_Wireframe) aSfwr = new ShapeFix_Wireframe();
Handle(ShapeBuild_ReShape) aReShape = new ShapeBuild_ReShape;
Standard_Real aDistDomain = 0.0;
Standard_Integer k = 3;
if(k < n)
- aTol = atof(a[k++]);
+ aTol = Draw::Atof(a[k++]);
if(k < n)
- aDistDomain = atof(a[k++]);
+ aDistDomain = Draw::Atof(a[k++]);
ShapeAnalysis_Edge sae;
if(sae.CheckOverlapping(e1,e2,aTol,aDistDomain)) {
return 1;
}
TopoDS_Shape Sh1 = DBRep::Get(a[1]);
- Standard_Real ucoord = atof(a[2]);
- Standard_Real vcoord = atof(a[3]);
+ Standard_Real ucoord = Draw::Atof(a[2]);
+ Standard_Real vcoord = Draw::Atof(a[3]);
if(Sh1.IsNull() || Sh1.ShapeType()!= TopAbs_FACE) {
di<<"Invalid arguments"<<"\n";
return 1;
}
Standard_Real aTol = Precision::Confusion();
if( n > 3)
- aTol = atof(a[3]);
+ aTol = Draw::Atof(a[3]);
Standard_Boolean shared = Standard_True;
if( n > 4)
- shared = (atoi(a[4]) == 1);
+ shared = (Draw::Atoi(a[4]) == 1);
TopExp_Explorer aExpE(aSh1,TopAbs_EDGE);
Handle(TopTools_HSequenceOfShape) aSeqEdges = new TopTools_HSequenceOfShape;
Handle(TopTools_HSequenceOfShape) aSeqWires = new TopTools_HSequenceOfShape;
// 15.06.99 abv/pdn: command comptol added (from S4030)
#include <SWDRAW_ShapeTool.ixx>
+#include <Draw.hxx>
#include <DBRep.hxx>
#include <TopAbs_ShapeEnum.hxx>
#include <TopoDS.hxx>
if (curve3d.IsNull()) {
char nomsh[30];
nbf ++;
- sprintf (nomsh,"faultedge_%d",nbf);
+ Sprintf (nomsh,"faultedge_%d",nbf);
di<<"Edge sans Curve3d, n0 "<<nbe<<"\n";
DBRep::Set (nomsh,Edge);
}
for (i = 1; i <= nbe; i ++) {
if (nbs[i] < 1) {
di<<"Edge n0 "<<i<<" pas vue par WE"<<"\n";
- sprintf (nomsh,"NOWE_%d",i);
+ Sprintf (nomsh,"NOWE_%d",i);
DBRep::Set (nomsh,map.FindKey(i));
} else if (nbs[i] > 1) {
di<<"Edge n0 "<<i<<" vue par WE : "<<nbs[i]<<" fois"<<"\n";
- sprintf (nomsh,"MULT_%d",i);
+ Sprintf (nomsh,"MULT_%d",i);
DBRep::Set (nomsh,map.FindKey(i));
}
}
}
Standard_CString arg1 = argv[1];
Standard_CString arg2 = argv[2];
- if (argc > 2) tolang = atof (arg2);
+ if (argc > 2) tolang = Draw::Atof (arg2);
if (tolang <= 0) {
di<<"Not a suitable value : "<<tolang<<"\n";
return 1 /* Error */;
Handle(Geom2d_Curve) C = DrawTrSurf::GetCurve2d(argv[2]);
if (C.IsNull()) { di<<"Curve unknown: "<<argv[2]<<"\n"; return 1; }
- Standard_Real oldFirst = atof(argv[3]);
- Standard_Real oldLast = atof(argv[4]);
- Standard_Real current_first = atof(argv[5]);
- Standard_Real current_last = atof(argv[6]);
+ Standard_Real oldFirst = Draw::Atof(argv[3]);
+ Standard_Real oldLast = Draw::Atof(argv[4]);
+ Standard_Real current_first = Draw::Atof(argv[5]);
+ Standard_Real current_last = Draw::Atof(argv[6]);
Standard_Real Tol = Precision::PConfusion();
Handle(Geom2d_Curve) NewC2d;
GeomLib::SameRange(Tol, C, oldFirst,oldLast,
#include <SWDRAW_ShapeUpgrade.ixx>
//#include <SWDRAW_ShapeUpgrade.hxx>
+#include <Draw.hxx>
#include <DBRep.hxx>
#include <ShapeUpgrade.hxx>
#include <ShapeUpgrade_SplitCurve3dContinuity.hxx>
// tolerance is optional
if (n==4) {
- Standard_Real Tol=atof(a[3]);
+ Standard_Real Tol=Draw::Atof(a[3]);
tool.SetTolerance(Tol);
}
return 1;
}
- Standard_Integer c2d = atoi(a[3]);
- Standard_Integer c3d = atoi(a[4]);
+ Standard_Integer c2d = Draw::Atoi(a[3]);
+ Standard_Integer c3d = Draw::Atoi(a[4]);
TopoDS_Shape revsh = ShapeCustom::ConvertToRevolution (inputShape);
if (revsh.IsNull()) { di<<"NO RESULT"<<"\n"; return 1; }
else if (revsh == inputShape) { di<<"No modif"<<"\n";}
// tolerance is optional
if (n==4) {
- Standard_Real Tol=atof(a[n-1]);
+ Standard_Real Tol=Draw::Atof(a[n-1]);
theTool.SetTolerance(Tol);
}
else {
// not a face: we can use the empty consturctor.
ShapeUpgrade_ShapeDivideContinuity theTool;
- Standard_Real Tol=atof(a[n-1]);
+ Standard_Real Tol=Draw::Atof(a[n-1]);
theTool.SetTolerance(Tol);
theTool.SetGlobalCriterion(GeomAbs_C1);
return 1;
}
// number of surf:
- Standard_Integer NbU=atoi(a[2]);
- Standard_Integer NbV=atoi(a[3]);
+ Standard_Integer NbU=Draw::Atoi(a[2]);
+ Standard_Integer NbV=Draw::Atoi(a[3]);
if (n < 4+NbU*NbV+1) {
di << "bad number of arguments" <<"\n";
return 1;
return 1;
}
- Standard_Integer c2d = atoi(a[3]);
- Standard_Integer c3d = atoi(a[4]);
+ Standard_Integer c2d = Draw::Atoi(a[3]);
+ Standard_Integer c3d = Draw::Atoi(a[4]);
ShapeUpgrade_ShapeConvertToBezier tool(inputShape);
tool.SetSurfaceConversion(Standard_True);
Standard_Real maxangle = 95;
if ( n >3 ) {
- maxangle = atof ( a[3] );
+ maxangle = Draw::Atof ( a[3] );
if ( maxangle <1 ) maxangle = 1;
}
return 1;
}
- Standard_Real Tol=atof(a[3]);
+ Standard_Real Tol=Draw::Atof(a[3]);
TopoDS_Shape inputShape=DBRep::Get(a[2]);
TopoDS_Face inputFace = TopoDS::Face(inputShape);
if (inputFace.IsNull()) {
// a[4+NbU+NbV+1] = Tol
// number of knots:
- Standard_Integer NbU=atoi(a[2]);
- Standard_Integer NbV=atoi(a[3]);
+ Standard_Integer NbU=Draw::Atoi(a[2]);
+ Standard_Integer NbV=Draw::Atoi(a[3]);
if (n != 4+NbU+NbV+1) {
di << "bad number of arguments" <<"\n";
return 1;
TColStd_Array1OfReal TheVKnots(1,NbV);
for (Standard_Integer ii=1; ii<=NbU; ii++) {
- TheUKnots(ii)=atof(a[4+ii-1]);
+ TheUKnots(ii)=Draw::Atof(a[4+ii-1]);
}
for (ii=1; ii<=NbV; ii++) {
- TheVKnots(ii)=atof(a[4+NbU+ii-1]);
+ TheVKnots(ii)=Draw::Atof(a[4+NbU+ii-1]);
}
- Standard_Real Tol=atof(a[4+NbU+NbV]);
+ Standard_Real Tol=Draw::Atof(a[4+NbU+NbV]);
ShapeUpgrade_PlaneGridShell TheGrid(ThePlane,TheUKnots,TheVKnots,Tol);
return 1;
}
- Standard_Real Tol=atof(a[2]);
+ Standard_Real Tol=Draw::Atof(a[2]);
Handle(Geom_Curve) GC = DrawTrSurf::GetCurve(a[1]);
if ( GC.IsNull()) return 1;
- Standard_Integer Split = atoi(a[3]);
+ Standard_Integer Split = Draw::Atoi(a[3]);
Handle(ShapeUpgrade_SplitCurve3dContinuity) theTool = new ShapeUpgrade_SplitCurve3dContinuity;
theTool->Init(GC);
theTool->SetTolerance (Tol);
Standard_Integer NbC=theCurves->Length();
for (Standard_Integer icurv=1; icurv<=NbC; icurv++) {
char name[100];
- sprintf(name,"%s%s%d",a[1],"_",icurv);
+ Sprintf(name,"%s%s%d",a[1],"_",icurv);
char* newname = name;
DrawTrSurf::Set(newname, theCurves->Value(icurv));
di.AppendElement(newname);
return 1;
}
- Standard_Real Tol=atof(a[2]);
+ Standard_Real Tol=Draw::Atof(a[2]);
Handle(Geom2d_Curve) GC = DrawTrSurf::GetCurve2d(a[1]);
if ( GC.IsNull()) return 1;
- Standard_Integer Split = atoi(a[3]);
+ Standard_Integer Split = Draw::Atoi(a[3]);
Handle(ShapeUpgrade_SplitCurve2dContinuity) theTool = new ShapeUpgrade_SplitCurve2dContinuity;
theTool->Init(GC);
theTool->SetTolerance (Tol);
Standard_Integer NbC=theCurves->Length();
for (Standard_Integer icurv=1; icurv<=NbC; icurv++) {
char name[100];
- sprintf(name,"%s%s%d",a[1],"_",icurv);
+ Sprintf(name,"%s%s%d",a[1],"_",icurv);
char* newname = name;
DrawTrSurf::Set(newname, theCurves->Value(icurv));
di.AppendElement(newname);
Handle(ShapeUpgrade_WireDivideContinuity) tool = new ShapeUpgrade_WireDivideContinuity;
tool->Init(wire,source);
if(n >=4 ) {
- Standard_Real Tol=atof(a[3]);
+ Standard_Real Tol=Draw::Atof(a[3]);
}
Handle(ShapeBuild_ReShape) context = new ShapeBuild_ReShape;
tool->Perform(context);
Handle(ShapeUpgrade_ShapeDivideContinuity) tool = new ShapeUpgrade_FaceDivideContinuity;
tool->Init(source);
if(n >=4 ) {
- Standard_Real Tol=atof(a[3]);
+ Standard_Real Tol=Draw::Atof(a[3]);
tool->SetPrecision(Tol);
}
Handle(ShapeUpgrade_SplitSurfaceContinuity) theTool = new ShapeUpgrade_SplitSurfaceContinuity;//S4137
- Standard_Real Tol=atof(a[3]);
- Standard_Integer Split = atoi(a[4]);
+ Standard_Real Tol=Draw::Atof(a[3]);
+ Standard_Integer Split = Draw::Atoi(a[4]);
theTool->SetTolerance(Tol);
theTool->SetCriterion(GeomAbs_C1);
Handle(Geom_Surface) GS = DrawTrSurf::GetSurface(a[2]);
if ( GS.IsNull()) {
// Case of composite grid surface
di << "composite surf" << "\n";
- Standard_Integer nbU=atoi(a[2]);
- Standard_Integer nbV=atoi(a[3]);
+ Standard_Integer nbU=Draw::Atoi(a[2]);
+ Standard_Integer nbV=Draw::Atoi(a[3]);
if (nbU==0 || nbV==0) return 1;
Handle(TColGeom_HArray2OfSurface)
theGrid= new TColGeom_HArray2OfSurface(1,nbU,1,nbV);
for (Standard_Integer irow=1; irow<=NbRow; irow++) {
for (Standard_Integer icol=1; icol<=NbCol; icol++) {
char name[100];
- sprintf(name,"%s%s%d%s%d",a[1],"_",irow,"_",icol);
+ Sprintf(name,"%s%s%d%s%d",a[1],"_",irow,"_",icol);
char* newname = name;
DrawTrSurf::Set(newname, theSurfaces->Value(irow, icol));
di.AppendElement(newname);
theMap.Bind(theFace,theSurf);
}
- Standard_Real the2d3dFactor=atof(a[4]);
+ Standard_Real the2d3dFactor=Draw::Atof(a[4]);
ShapeUpgrade_SupportModification theTool(inputShell,theMap,the2d3dFactor);
TopoDS_Shell res = theTool.Shell();
return 1;
}
- if (atoi(a[1])==1) {
+ if (Draw::Atoi(a[1])==1) {
di << "Activation of debug messages"<<"\n";
ShapeUpgrade::SetDebug(Standard_True);
}
}
// Standard_CString arg1 = argv[1];
// Standard_CString arg2 = argv[2];
- Standard_Real Offset = atof(argv[3]);
+ Standard_Real Offset = Draw::Atof(argv[3]);
Handle(Geom2d_Curve) GC = DrawTrSurf::GetCurve2d(argv[2]);
if ( GC.IsNull()) return 1;
Handle(Geom2d_OffsetCurve) offcrv = new Geom2d_OffsetCurve(GC,Offset);
}
// Standard_CString arg1 = argv[1];
// Standard_CString arg2 = argv[2];
- Standard_Real Offset = atof(argv[3]);
+ Standard_Real Offset = Draw::Atof(argv[3]);
Handle(Geom_Curve) GC = DrawTrSurf::GetCurve(argv[2]);
if ( GC.IsNull()) return 1;
gp_Pnt point;
if ( argv[i][0] == 'u' ) byV = Standard_False;
else if ( argv[i][0] == 'v' ) byV = Standard_True;
else {
- Standard_Real val = atof ( argv[i] );
+ Standard_Real val = Draw::Atof ( argv[i] );
TColStd_SequenceOfReal &vals = ( byV ? vval : uval );
if ( vals.Length() >0 && val - vals.Last() < Precision::PConfusion() ) {
di << "Values should be sorted in increasing order; skipped" << "\n";
di << "Unknown shape"<< "\n";
return 1;
}
- Standard_Real aMaxArea = atof(argv[3]);
+ Standard_Real aMaxArea = Draw::Atof(argv[3]);
ShapeUpgrade_ShapeDivideArea tool (inputShape);
if(argc >4) {
- Standard_Real prec = atof(argv[4]);
+ Standard_Real prec = Draw::Atof(argv[4]);
tool.SetPrecision(prec);
}
tool.MaxArea() = aMaxArea;
di << "bad number of arguments" <<"\n";
return 1;
}
- Standard_Real aMinArea = atof(argv[2]);
+ Standard_Real aMinArea = Draw::Atof(argv[2]);
TopoDS_Shape inputShape=DBRep::Get(argv[3]);
if (inputShape.IsNull()) {
di << "Unknown shape"<< "\n";
}
}
if(!isShape)
- aModeRemoveFaces = (atoi(argv[k]) == 1);
+ aModeRemoveFaces = (Draw::Atoi(argv[k]) == 1);
}
aTool->MinArea() = aMinArea;
TopoDS_Shape aShape = DBRep::Get(argv[2]);
if(aShape.IsNull())
return 1;
- Standard_Real aDx = atof(argv[3]);
- Standard_Real aDy = atof(argv[4]);
- Standard_Real aDz = atof(argv[5]);
+ Standard_Real aDx = Draw::Atof(argv[3]);
+ Standard_Real aDy = Draw::Atof(argv[4]);
+ Standard_Real aDz = Draw::Atof(argv[5]);
gp_Trsf aTrsf;
aTrsf.SetTranslation(gp_Vec(aDx, aDy, aDz));
BRepBuilderAPI_Transform builderTransform(aTrsf);
Standard_Boolean.hxx
Standard_Byte.hxx
Standard_PByte.hxx
+Standard_CLocaleSentry.hxx
+Standard_CLocaleSentry.cxx
Standard_CString.cxx
Standard_CString.hxx
Standard_Character.cxx
#include <Standard_MMgrTBBalloc.hxx>
#if(defined(_WIN32) || defined(__WIN32__))
-#include <windows.h>
-#include <malloc.h>
+ #include <windows.h>
+ #include <malloc.h>
+ #include <locale.h>
#endif
#ifndef OCCT_MMGT_OPT_DEFAULT
Standard_MMgrFactory::Standard_MMgrFactory()
: myFMMgr (NULL)
{
+/*#if defined(_MSC_VER) && (_MSC_VER > 1400)
+ // Turn ON thread-safe C locale globally to avoid side effects by setlocale() calls between threads.
+ // After this call all following _configthreadlocale() will be ignored assuming
+ // Notice that this is MSVCRT feature - on POSIX systems xlocale API (uselocale instead of setlocale)
+ // should be used explicitly to ensure thread-safety!
+
+ // This is not well documented call because _ENABLE_PER_THREAD_LOCALE_GLOBAL flag is defined but not implemented for some reason.
+ // -1 will set global locale flag to force _ENABLE_PER_THREAD_LOCALE_GLOBAL + _ENABLE_PER_THREAD_LOCALE_NEW behaviour
+ // although there NO way to turn it off again and following calls will have no effect (locale will be changed only for current thread).
+ _configthreadlocale (-1);
+#endif*/
+
char* aVar;
Standard_Integer anAllocId = (aVar = getenv ("MMGT_OPT" )) ? atoi (aVar) :
(OCCT_MMGT_OPT_DEFAULT);
Standard_Boolean toClear = (aVar = getenv ("MMGT_CLEAR" )) ? (atoi (aVar) != 0) : Standard_True;
-
// on Windows (actual for XP and 2000) activate low fragmentation heap
// for CRT heap in order to get best performance.
// Environment variable MMGT_LFH can be used to switch off this action (if set to 0)
--- /dev/null
+// Created on: 2013-01-17
+// Created by: Kirill GAVRILOV
+// Copyright (c) 2013 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.
+
+#ifdef HAVE_CONFIG_H
+ #include <config.h>
+#endif
+
+#include <Standard_CLocaleSentry.hxx>
+
+#include <Standard_TypeDef.hxx>
+
+#include <cstring>
+
+namespace
+{
+
+ //! CLocalePtr - static object representing C locale
+ class CLocalePtr
+ {
+ public:
+
+ CLocalePtr()
+ #ifdef HAVE_XLOCALE_H
+ : myLocale (newlocale (LC_ALL_MASK, "C", NULL))
+ #elif defined(_WIN32)
+ : myLocale (_create_locale (LC_ALL, "C"))
+ #else
+ : myLocale (NULL)
+ #endif
+ {}
+
+ ~CLocalePtr()
+ {
+ #ifdef HAVE_XLOCALE_H
+ freelocale (myLocale);
+ #elif defined(_WIN32)
+ _free_locale (myLocale);
+ #endif
+ }
+
+ public:
+
+ Standard_CLocaleSentry::clocale_t myLocale;
+
+ };
+
+ static CLocalePtr theCLocale;
+
+};
+
+// =======================================================================
+// function : GetCLocale
+// purpose :
+// =======================================================================
+Standard_CLocaleSentry::clocale_t Standard_CLocaleSentry::GetCLocale()
+{
+ return theCLocale.myLocale;
+}
+
+// =======================================================================
+// function : Standard_CLocaleSentry
+// purpose :
+// =======================================================================
+Standard_CLocaleSentry::Standard_CLocaleSentry()
+#ifdef HAVE_XLOCALE_H
+: myPrevLocale (uselocale (theCLocale.myLocale)) // switch to C locale within this thread only using xlocale API
+#else
+: myPrevLocale (setlocale (LC_ALL, 0))
+#if defined(_MSC_VER) && (_MSC_VER > 1400)
+, myPrevTLocaleState (_configthreadlocale (_ENABLE_PER_THREAD_LOCALE))
+#endif
+#endif
+{
+#ifndef HAVE_XLOCALE_H
+ const char* aPrevLocale = (const char* )myPrevLocale;
+ if (aPrevLocale[0] == 'C' && aPrevLocale[1] == '\0')
+ {
+ myPrevLocale = NULL; // already C locale
+ return;
+ }
+ // copy string as following setlocale calls may invalidate returned pointer
+ Standard_Size aLen = std::strlen (aPrevLocale) + 1;
+ myPrevLocale = new char[aLen];
+ memcpy (myPrevLocale, aPrevLocale, aLen);
+
+ setlocale (LC_ALL, "C");
+#endif
+}
+
+// =======================================================================
+// function : ~Standard_CLocaleSentry
+// purpose :
+// =======================================================================
+Standard_CLocaleSentry::~Standard_CLocaleSentry()
+{
+#ifdef HAVE_XLOCALE_H
+ uselocale ((locale_t )myPrevLocale);
+#else
+ if (myPrevLocale != NULL)
+ {
+ const char* aPrevLocale = (const char* )myPrevLocale;
+ setlocale (LC_ALL, aPrevLocale);
+ delete[] aPrevLocale;
+ }
+#if defined(_MSC_VER) && (_MSC_VER > 1400)
+ if (myPrevTLocaleState != _ENABLE_PER_THREAD_LOCALE)
+ {
+ _configthreadlocale (myPrevTLocaleState);
+ }
+#endif
+#endif
+}
--- /dev/null
+// Created on: 2013-01-17
+// Created by: Kirill GAVRILOV
+// Copyright (c) 2013 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.
+
+#ifndef _Standard_CLocaleSentry_H__
+#define _Standard_CLocaleSentry_H__
+
+#include <Standard_Macro.hxx>
+
+#include <locale.h>
+
+//! "xlocale.h" available in Mac OS X and glibc (Linux) for a long time as an extension
+//! and become part of POSIX since '2008.
+//! Notice that this is impossible to test (_POSIX_C_SOURCE >= 200809L)
+//! since POSIX didn't declared such identifier.
+//! We check _GNU_SOURCE for glibc extensions here and it is always defined by g++ compiler.
+#if defined(__APPLE__) || defined(_GNU_SOURCE) || defined(HAVE_XLOCALE_H)
+ #include <xlocale.h>
+ #ifndef HAVE_XLOCALE_H
+ #define HAVE_XLOCALE_H
+ #endif
+#endif
+
+//! This class intended to temporary switch C locale and logically equivalent to setlocale(LC_ALL, "C").
+//! It is intended to format text regardless of user locale settings (for import/export functionality).
+//! Thus following calls to sprintf, atoi and other functions will use "C" locale.
+//! Destructor of this class will return original locale.
+//!
+//! Notice that this functionality is platfrom dependent and intended only to workaround alien code
+//! that doesn't setup locale correctly.
+//!
+//! Internally you should prefer more portable C++ locale interfaces
+//! or OCCT wrappers to some C functions like Sprintf, Atof, Strtod.
+class Standard_CLocaleSentry
+{
+public:
+
+ //! Setup current C locale to "C".
+ Standard_EXPORT Standard_CLocaleSentry();
+
+ //! Restore previous locale.
+ Standard_EXPORT virtual ~Standard_CLocaleSentry();
+
+public:
+
+#ifdef HAVE_XLOCALE_H
+ typedef locale_t clocale_t;
+#elif defined(_WIN32)
+ typedef _locale_t clocale_t;
+#else
+ typedef void* clocale_t;
+#endif
+
+ //! @return locale "C" instance (locale_t within xlocale or _locale_t within Windows)
+ //! to be used for _l functions with locale argument.
+ static Standard_EXPORT clocale_t GetCLocale();
+
+private:
+
+ void* myPrevLocale; //!< previous locale, platform-dependent pointer!
+#ifdef _WIN32
+ int myPrevTLocaleState; //!< previous thread-locale state, MSVCRT-specific
+#endif
+
+private:
+
+ //! Copying disallowed
+ Standard_CLocaleSentry (const Standard_CLocaleSentry& );
+ Standard_CLocaleSentry& operator= (const Standard_CLocaleSentry& );
+
+};
+
+#endif // _Standard_CLocaleSentry_H__
// Copyright (c) 1998-1999 Matra Datavision
-// Copyright (c) 1999-2012 OPEN CASCADE SAS
+// Copyright (c) 1999-2013 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
# include <config.h>
#endif
-
+#include <Standard_CLocaleSentry.hxx>
#include <Standard_CString.hxx>
-#include <Standard_Type.hxx>
+#include <Standard_Type.hxx>
#include <Standard_OStream.hxx>
#if OptJr
#include <Standard_String.hxx>
#include <string.h>
+#include <stdarg.h>
//============================================================================
-//====
+//====
//============================================================================
-const Handle_Standard_Type& Standard_CString_Type_()
+const Handle_Standard_Type& Standard_CString_Type_()
{
- static Handle_Standard_Type _aType =
+ static Handle_Standard_Type _aType =
new Standard_Type("Standard_CString",sizeof(Standard_CString),0,NULL);
return _aType;
//============================================================================
//==== HashCode of a CString
//============================================================================
-Standard_Integer HashCode (const Standard_CString Value,
+Standard_Integer HashCode (const Standard_CString Value,
const Standard_Integer Upper )
{
Standard_Integer aLen ;
*tmphash;
char tabchar[20];
#endif
-
+
if (Value != NULL) {
#if !OptJr
else tabchar[count] = charPtr[pos + count];
i++;
}
- tmphash = (Standard_Integer *)tabchar;
+ tmphash = (Standard_Integer *)tabchar;
aHashCode = aHashCode ^ *tmphash;
}
}
return Standard_True ;
}
+#ifdef __APPLE__
+ // There are a lot of *_l functions availalbe on Mac OS X - we use them
+ #define SAVE_TL()
+#elif defined(_WIN32)
+ // MSVCRT has equivalents with slightly different syntax
+ #define SAVE_TL()
+ #define strtod_l(thePtr, theNextPtr, theLocale) _strtod_l(thePtr, theNextPtr, theLocale)
+ #define vprintf_l(theLocale, theFormat, theArgPtr) _vprintf_l(theFormat, theLocale, theArgPtr)
+ #define vsprintf_l(theBuffer, theLocale, theFormat, theArgPtr) _vsprintf_l(theBuffer, theFormat, theLocale, theArgPtr)
+ #define vfprintf_l(theFile, theLocale, theFormat, theArgPtr) _vfprintf_l(theFile, theFormat, theLocale, theArgPtr)
+#else
+ // glibc provides only limited xlocale implementation:
+ // strtod_l/strtol_l/strtoll_l functions with explicitly specified locale
+ // and newlocale/uselocale/freelocale to switch locale within current thread only.
+ // So we switch to C locale temporarily
+ #define SAVE_TL() Standard_CLocaleSentry aLocaleSentry;
+ #ifndef HAVE_XLOCALE_H
+ #error System does not support xlocale. Import/export could be broken if C locale did not specified by application.
+ #define strtod_l(thePtr, theNextPtr, theLocale) strtod(thePtr, theNextPtr)
+ #endif
+ #define vprintf_l(theLocale, theFormat, theArgPtr) vprintf(theFormat, theArgPtr)
+ #define vsprintf_l(theBuffer, theLocale, theFormat, theArgPtr) vsprintf(theBuffer, theFormat, theArgPtr)
+ #define vfprintf_l(theFile, theLocale, theFormat, theArgPtr) vfprintf(theFile, theFormat, theArgPtr)
+#endif
+
+double Strtod (const char* theStr, char** theNextPtr)
+{
+ return strtod_l (theStr, theNextPtr, Standard_CLocaleSentry::GetCLocale());
+}
+
+double Atof (const char* theStr)
+{
+ return Strtod (theStr, NULL);
+}
+
+int Printf (const Standard_CString theFormat, ...)
+{
+ SAVE_TL();
+ va_list argp;
+ va_start(argp, theFormat);
+ int result = vprintf_l (Standard_CLocaleSentry::GetCLocale(), theFormat, argp);
+ va_end(argp);
+ return result;
+}
+int Fprintf (FILE* theFile, const char* theFormat, ...)
+{
+ SAVE_TL();
+ va_list argp;
+ va_start(argp, theFormat);
+ int result = vfprintf_l(theFile, Standard_CLocaleSentry::GetCLocale(), theFormat, argp);
+ va_end(argp);
+ return result;
+}
+
+int Sprintf (char* theBuffer, const char* theFormat, ...)
+{
+ SAVE_TL();
+ va_list argp;
+ va_start(argp, theFormat);
+ int result = vsprintf_l(theBuffer, Standard_CLocaleSentry::GetCLocale(), theFormat, argp);
+ va_end(argp);
+ return result;
+}
//============================================================================
//==== Titre: Standard_CString.hxx
//==== Role : The headr file of primitve type "CString" from package "Standard"
-//====
+//====
//==== Implementation: This is a primitive type implementadef with typedef
//==== typedef char* Standard_CString;
//============================================================================
# include <Standard_TypeDef.hxx>
# endif
-# ifdef WNT
+# ifdef _MSC_VER
# define strcasecmp _stricmp
# endif
# include <string.h>
+# include <stdio.h>
# ifndef _Standard_Integer_HeaderFile
# include <Standard_Integer.hxx>
__Standard_API Standard_Integer HASHCODES (const Standard_CString,
const Standard_Integer);
+//! Equivalents of functions from standard C library that use always C locale
+__Standard_API double Atof (const char* theStr);
+__Standard_API double Strtod (const char* theStr, char** theNextPtr);
+__Standard_API int Printf (const char* theFormat, ...);
+__Standard_API int Fprintf (FILE* theFile, const char* theFormat, ...);
+__Standard_API int Sprintf (char* theBuffer, const char* theFormat, ...);
+
//============================================================================
//==== ShallowCopy: Returns a CString
//============================================================================
//============================================================================
inline Standard_Boolean IsSimilar(const Standard_CString One
,const Standard_CString Two)
-{
+{
return (strcmp(One,Two) == 0);
}
//==== the HashCode % Upper
//============================================================================
inline Standard_Integer HashCode (const Standard_CString Value,
- const Standard_Integer Len ,
+ const Standard_Integer Len ,
const Standard_Integer Upper ,
Standard_Integer& aHashCode )
{
//==== and the HashCode % Upper
//============================================================================
inline Standard_Integer HASHCODE (const Standard_CString Value,
- const Standard_Integer Len ,
+ const Standard_Integer Len ,
const Standard_Integer Upper ,
Standard_Integer& aHashCode )
{
//==== HashCode of a CString converted to uppercase
//============================================================================
inline Standard_Integer HASHCODE (const Standard_CString Value,
- const Standard_Integer Len ,
+ const Standard_Integer Len ,
const Standard_Integer Upper)
{
// return (Abs( HASHCODES( Value , Len ) ) % Upper ) + 1 ;
const Standard_Integer LenOne ,
const Standard_CString Two,
const Standard_Integer LenTwo )
-{
+{
if ( One == Two )
return Standard_True ;
}
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(StepSelect_FloatFormat) fm = new StepSelect_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.;
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);
}
TCollection_AsciiString Storage_Schema::ICreationDate()
{
- // on sauvegarde l'ancien LC_NUMERIC
- char *oldnum,*plocal ;
- plocal = setlocale(LC_NUMERIC, NULL);
- oldnum = new char[strlen(plocal)+1] ;
- strcpy(oldnum,plocal);
-
-
char nowstr[SLENGTH];
time_t nowbin;
struct tm *nowstruct;
-
- (void)setlocale(LC_ALL, "");
-
- if (time(&nowbin) == (time_t) - 1)
+ if (time(&nowbin) == (time_t)-1)
cerr << "Storage ERROR : Could not get time of day from time()" << endl;
nowstruct = localtime(&nowbin);
cerr << "Storage ERROR : Could not get string from strftime()" << endl;
TCollection_AsciiString t(nowstr);
-
- // on remet le LC_NUMERIC a la precedente valeur
- setlocale(LC_NUMERIC, oldnum);
- delete[] oldnum;
-
return t;
}
union { int bid ; // ?? to ensure alignment of t[] by double-word??
char t [13]; } CHN ;
- sprintf(&CHN.t[0],"%d",aValue);
+ Sprintf(&CHN.t[0],"%d",aValue);
#if OptJr
STRINGLEN( CHN.t , mylength ) ;
#else
union { int bid ;
char t [50]; } CHN ;
- sprintf(&CHN.t[0],"%g",aValue);
+ Sprintf(&CHN.t[0],"%g",aValue);
#if OptJr
STRINGLEN( CHN.t , mylength ) ;
#else
{
char *ptr;
if(mystring) {
-//#ifdef DEB
-// Standard_Real value = strtod(mystring,&ptr);
-//#else
- strtod(mystring,&ptr);
-//#endif
+ Strtod(mystring,&ptr);
if (ptr != mystring) return Standard_True;
else return Standard_False;
}
char *ptr;
Standard_Real value = 0;
if(mystring) {
- value = strtod(mystring,&ptr);
+ value = Strtod(mystring,&ptr);
if (ptr != mystring) return value;
}
Standard_NumericError::Raise("TCollection_AsciiString::RealValue");
{
union {int bid ;
char t [13];} CHN ;
- sprintf(&CHN.t[0],"%d",aValue);
+ Sprintf(&CHN.t[0],"%d",aValue);
#if OptJr
STRINGLEN( CHN.t , mylength ) ;
#else
{
union {int bid ;
char t [50];} CHN ;
- sprintf(&CHN.t[0],"%g",aValue);
+ Sprintf(&CHN.t[0],"%g",aValue);
#if OptJr
STRINGLEN( CHN.t , mylength ) ;
#else
}
if ( !strcmp(argv[3],"-r") )
{
- int Nb = atoi(argv[4]);
+ int Nb = Draw::Atoi(argv[4]);
Handle(TColStd_HArray1OfReal) rArr = new TColStd_HArray1OfReal(1,Nb);
for ( int i = 1; i <= Nb; i++ )
- rArr->SetValue(i, atof(argv[4+i]));
+ rArr->SetValue(i, Draw::Atof(argv[4+i]));
tObj->SetRealArr( rArr );
}
else
- tObj->SetInt( atoi(argv[3] ) );
+ tObj->SetInt( Draw::Atoi(argv[3] ) );
return 0;
}
Standard_Integer ix = 0;
if (ISINTEGER(name.ToCString())) {
if (myHDS.IsNull()) return 0;
- Standard_Integer is = atoi(name.ToCString());
+ Standard_Integer is = Draw::Atoi(name.ToCString());
Standard_Integer ns = myHDS->NbShapes();
Standard_Integer i1 = 0, i2 = 0;
if (is != 0) {
#include <TopoDS.hxx>
#include <TopExp_Explorer.hxx>
#include <TColStd_HArray1OfBoolean.hxx>
+#include <Draw.hxx>
#include <DBRep.hxx>
#ifdef HAVE_STRINGS_H
# include <strings.h>
}
else if (na > 3) {
// tsp IN/ON/OUT e/f/s i1 i2 ...
- for(i=3;i<na;i++) PBOOP->GetSplit(typ,sta,atoi(a[i]));
+ for(i=3;i<na;i++) PBOOP->GetSplit(typ,sta,Draw::Atoi(a[i]));
}
}
else {
// tsp IN/ON/OUT i1 i2 ...
- for(i=2;i<na;i++) PBOOP->GetSplit(sta,atoi(a[i]));
+ for(i=2;i<na;i++) PBOOP->GetSplit(sta,Draw::Atoi(a[i]));
}
}
}
else { // tsp i1 i2 ...
for (i = 1; i < na; i++) {
- if ( ISINTEGER(a[i]) ) PBOOP->GetSplit(atoi(a[i]));
+ if ( ISINTEGER(a[i]) ) PBOOP->GetSplit(Draw::Atoi(a[i]));
}
}
}
}
else if (na > 3) {
// tme IN/ON/OUT e/f/s i1 i2 ...
- for(i=3;i<na;i++) PBOOP->GetMerged(typ,sta,atoi(a[i]));
+ for(i=3;i<na;i++) PBOOP->GetMerged(typ,sta,Draw::Atoi(a[i]));
}
}
else {
// tme IN/ON/OUT i1 i2 ...
- for(i=2;i<na;i++) PBOOP->GetMerged(sta,atoi(a[i]));
+ for(i=2;i<na;i++) PBOOP->GetMerged(sta,Draw::Atoi(a[i]));
}
}
}
else { // tme i1 i2 ...
for (i = 1; i < na; i++) {
- if ( ISINTEGER(a[i]) ) PBOOP->GetMerged(atoi(a[i]));
+ if ( ISINTEGER(a[i]) ) PBOOP->GetMerged(Draw::Atoi(a[i]));
}
}
}
if (!strcmp(a[ia],"-d")) continue;
if (!strcmp(a[ia],"-c")) continue;
if (!strcmp(a[ia],"-AB")) continue;
- Standard_Integer ie = atoi(a[ia]);
+ Standard_Integer ie = Draw::Atoi(a[ia]);
if (ie>=1 && ie<=n) { onedef = Standard_True; tabloe->SetValue(ie,Standard_True); }
}
if (!onedef) tabloe->Init(Standard_True);
#ifdef DEB
// Standard_IMPORT extern Standard_Integer TopOpeBRepTool_BOOOPE_CHECK_DEB;
Standard_IMPORT Standard_Integer TopOpeBRepTool_BOOOPE_CHECK_DEB;
- if ( na >= 2 ) TopOpeBRepTool_BOOOPE_CHECK_DEB = (atoi(a[1])) ? 1 : 0;
+ if ( na >= 2 ) TopOpeBRepTool_BOOOPE_CHECK_DEB = (Draw::Atoi(a[1])) ? 1 : 0;
#endif
return 0;
}
return 1;
case 4:
if(!strcasecmp(a[1],"p"))
- PT.SetTol(TopOpeBRepDS_POINT,atoi(a[2]),atof(a[3]));
+ PT.SetTol(TopOpeBRepDS_POINT,Draw::Atoi(a[2]),Draw::Atof(a[3]));
else if(!strcasecmp(a[1],"c"))// c ou C
- PT.SetTol(TopOpeBRepDS_CURVE,atoi(a[2]),atof(a[3]));
+ PT.SetTol(TopOpeBRepDS_CURVE,Draw::Atoi(a[2]),Draw::Atof(a[3]));
else if(!strcasecmp(a[1],"s"))
- PT.SetTol(TopOpeBRepDS_SURFACE,atoi(a[2]),atof(a[3]));
+ PT.SetTol(TopOpeBRepDS_SURFACE,Draw::Atoi(a[2]),Draw::Atof(a[3]));
else if(!strcasecmp(a[1],"sh") ||
!strcasecmp(a[1],"v") ||
!strcasecmp(a[1],"e") ||
!strcasecmp(a[1],"f") ||
!strcasecmp(a[1],"w"))
- PT.SetTol(atoi(a[2]),atof(a[3]));
+ PT.SetTol(Draw::Atoi(a[2]),Draw::Atof(a[3]));
break;
case 6:
if(!strcasecmp(a[1],"p"))
- PT.SetPnt(atoi(a[2]),atof(a[3]),atof(a[4]),atof(a[5]));
+ PT.SetPnt(Draw::Atoi(a[2]),Draw::Atof(a[3]),Draw::Atof(a[4]),Draw::Atof(a[5]));
else
return 1;
break;
else if (!strcmp(thea,"-tx")) {
suppressarg(na,a,ia);
if (ia + 1 < na) {
- VT.SetTolx(atof(a[ia]),atof(a[ia + 1]));
+ VT.SetTolx(Draw::Atof(a[ia]),Draw::Atof(a[ia + 1]));
suppressarg(na,a,ia);
suppressarg(na,a,ia);
}
suppressarg(na,a,ia);
}
else {
- VT.SetTolx(atof(a[ia]),atof(a[ia]));
+ VT.SetTolx(Draw::Atof(a[ia]),Draw::Atof(a[ia]));
suppressarg(na,a,ia);
}
}
else if (!strcmp(thea,"-ti")) {
suppressarg(na,a,ia);
if (ia + 1 < na) {
- VT.SetToli(atof(a[ia]),atof(a[ia + 1]));
+ VT.SetToli(Draw::Atof(a[ia]),Draw::Atof(a[ia + 1]));
suppressarg(na,a,ia);
suppressarg(na,a,ia);
}
suppressarg(na,a,ia);
}
else {
- VT.SetToli(atof(a[ia]),atof(a[ia]));
+ VT.SetToli(Draw::Atof(a[ia]),Draw::Atof(a[ia]));
suppressarg(na,a,ia);
}
}
else if (!strcmp(thea,"-c")) {
suppressarg(na,a,ia);
if (ia < na) {
- VT.SetClear((Standard_Boolean)atoi(a[ia]));
+ VT.SetClear((Standard_Boolean)Draw::Atoi(a[ia]));
suppressarg(na,a,ia);
}
else VT.SetClear(Standard_True);
else if (!strcmp(thea,"-m")) {
suppressarg(na,a,ia);
if (ia < na) {
- VT.SetMode(atoi(a[ia]));
+ VT.SetMode(Draw::Atoi(a[ia]));
suppressarg(na,a,ia);
}
else VT.SetMode(0);
else if (!strcmp(thea,"-v")) {
suppressarg(na,a,ia);
if (ia < na) {
- VT.SetVerbose(atoi(a[ia]));
+ VT.SetVerbose(Draw::Atoi(a[ia]));
suppressarg(na,a,ia);
}
else VT.SetVerbose(0);
#include <TopOpeBRepTool_ShapeClassifier.hxx>
#include <TopOpeBRepDS_EXPORT.hxx>
+#include <Draw.hxx>
#include <Draw_Interpretor.hxx>
#include <DrawTrSurf.hxx>
#include <Draw_Color.hxx>
static Standard_Integer drawbnd2d(Draw_Interpretor& , Standard_Integer n, const char** a)
{
if (n < 5) return 1;
- Standard_Integer i = atoi(a[4]);
+ Standard_Integer i = Draw::Atoi(a[4]);
TopoDS_Shape W = DBRep::Get(a[2]);
TopoDS_Shape F = DBRep::Get(a[3]);
if (W.IsNull() || F.IsNull()) return 1;
static Standard_Integer pntonc(Draw_Interpretor& di, Standard_Integer n, const char** a)
{
if (n < 3) return 1;
- Standard_Real x = atof(a[1]);
+ Standard_Real x = Draw::Atof(a[1]);
Handle(Geom_Curve) C = DrawTrSurf::GetCurve(a[2]);
if (C.IsNull()) {di<<"null curve"<<"\n"; return 1;}
gp_Pnt p = C->Value(x);
static Standard_Integer pntonc2d(Draw_Interpretor& di, Standard_Integer n, const char** a)
{
if (n < 4) return 1;
- Standard_Real x = atof(a[1]);
+ Standard_Real x = Draw::Atof(a[1]);
Handle(Geom2d_Curve) C2d = DrawTrSurf::GetCurve2d(a[2]);
if (C2d.IsNull()) {di<<"null curve"<<"\n"; return 1;}
Handle(Geom_Surface) S = DrawTrSurf::GetSurface(a[3]);
TopoDS_Shape s = DBRep::Get(a[1]);
if (s.IsNull()) {di<<"null shape"<<"\n";return 1;}
gp_Pnt p; DrawTrSurf::GetPoint(a[2], p);
- Standard_Real tol = atof(a[3]);
+ Standard_Real tol = Draw::Atof(a[3]);
TopOpeBRepTool_SolidClassifier soclassi;
TopAbs_State sta = TopAbs_UNKNOWN;
TopoDS_Shape s = DBRep::Get(a[1]);
if (s.IsNull()) {di<<"null shape"<<"\n";return 1;}
gp_Pnt p; DrawTrSurf::GetPoint(a[2], p);
- Standard_Real tol = atof(a[3]);
+ Standard_Real tol = Draw::Atof(a[3]);
BRepClass3d_SolidClassifier soclassi(s);
TopAbs_State sta = TopAbs_UNKNOWN;
if (f.IsNull()) {di<<"null shape"<<"\n";return 1;}
gp_Pnt p; DrawTrSurf::GetPoint(a[2], p);
#ifdef DEB
- Standard_Real length = atof(a[3]);
+ Standard_Real length = Draw::Atof(a[3]);
#endif
Standard_Real dist=0.; gp_Pnt2d uv; Standard_Boolean ok = FUN_tool_projPonF(p,f,uv,dist);
if (!ok) {di<<"projection failed"<<"\n"; return 1;}
TopoDS_Face f = TopoDS::Face(aLocalShape);
// TopoDS_Face f = TopoDS::Face(DBRep::Get(a[1]));
if (f.IsNull()) {di<<"null shape"<<"\n";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]);
Handle(Geom_Line) line = new Geom_Line(gp_Ax1(gp_Pnt(0.,0.,0.), gp_Dir(x,y,z)));
BRepAdaptor_Surface BS(f);
Handle(Geom_Surface) su = BRep_Tool::Surface(f);
Standard_Integer tsee_entity::Set(Standard_Integer na,const char** a,Standard_Integer iargK,Standard_Integer iargI) {
myEOK = Standard_False;
if (iargK>=na) return 1; if (iargI>=na) return 1;
- TCollection_AsciiString ascK = a[iargK]; myEindex = atoi(a[iargI]);
+ TCollection_AsciiString ascK = a[iargK]; myEindex = Draw::Atoi(a[iargI]);
myEiskind = TestTopOpeDraw_TTOT::StringToKind(ascK,myETK);
if (!myEiskind) return 1; if (myETK == TopOpeBRepDS_UNKNOWN) return 1;
}
else if (!strcasecmp(a[ia],"-p") && (ia < na-1)) {
suppressargs(na,a,ia,ia+1);
- Standard_Real t = atof(a[ia+1]);
+ Standard_Real t = Draw::Atof(a[ia+1]);
if (t >= 0. && t <= 1.) {
OldParFlag = ParFlag; ParFlag = t;
}
else if ( Tpar.isshap() ) {
// na == 2 : display all DS shapes of type TS
- // na > 2 : display DS shapes of type TS of index atoi(a[2]..a[narg-1])
+ // na > 2 : display DS shapes of type TS of index Draw::Atoi(a[2]..a[narg-1])
if (na == 2 ) {
TopOpeBRepDS_Explorer x(HDS,Tpar.TS(),Standard_False);
for(;x.More();x.Next()) (*SeeShapefunc)(x.Index(),x.Current());
}
else {
for (ia = i1arg+1; ia < na; ia++) {
- is = atoi(a[ia]);
+ is = Draw::Atoi(a[ia]);
(*SeeShapefunc)(is,GetShape(is,Tpar.TS()));
}
}
}
else {
for (ia = i1arg+1; ia < na; ia++) {
- is = atoi(a[ia]);
+ is = Draw::Atoi(a[ia]);
(*SeeShapefunc)(is,GetShape(is,Tpar.TS()));
}
}
else if ( Tpar.isgeom() ) {
// na == 2 : display all DS geometries of type TK
- // na > 2 : display DS geometries of type TK index atoi(a[2])..a[narg-1])
+ // na > 2 : display DS geometries of type TK index Draw::Atoi(a[2])..a[narg-1])
if (na == 2 ) SeeGeometry(Tpar.TK());
- else for (ia = i1arg+1; ia < na; ia++) SeeGeometry(Standard_Integer(atoi(a[ia])),Tpar.TK());
+ else for (ia = i1arg+1; ia < na; ia++) SeeGeometry(Standard_Integer(Draw::Atoi(a[ia])),Tpar.TK());
}
else if ( Tpar.isafev() ) {
else if ( Tpar.isedcu() ) {
// na == 2 : display curves of all DS edges
- // na > 2 : display curve of DS edges index atoi(a[2])..a[narg-1])
+ // na > 2 : display curve of DS edges index Draw::Atoi(a[2])..a[narg-1])
if ( na == 2 ) {
TopOpeBRepDS_Explorer x(HDS,TopAbs_EDGE,Standard_False);
for (;x.More();x.Next()) SeeEdgeCurve(x.Index(),x.Edge());
}
else {
for (ia = i1arg+1; ia < na; ia++) {
- is = atoi(a[ia]);
+ is = Draw::Atoi(a[ia]);
SeeEdgeCurve(is,GetShape(is,TopAbs_EDGE));
}
}
else if ( Tpar.issect() ) { // na=2 all section edges,na>2 section edges (a[2]..a[na-1])
Standard_Integer ise,nse = BDS.NbSectionEdges();
if (na == 2) for (ise = 1; ise<=nse; ise++) SeeSectionEdge(ise);
- else for (ia = i1arg+1; ia<na; ia++) SeeSectionEdge(atoi(a[ia]));
+ else for (ia = i1arg+1; ia<na; ia++) SeeSectionEdge(Draw::Atoi(a[ia]));
}
else if (Tpar.isdege()) {
return 0;
} // (na == 2)
- // nna > 2 : dump DS entities of type TK index atoi(a[2])..a[narg-1])
+ // nna > 2 : dump DS entities of type TK index Draw::Atoi(a[2])..a[narg-1])
for (ia = 2; ia < na; ia++) {
if ( !strcmp(a[ia],"sd") ) { // dump all shapes HasSameDomain of type TS
}
}
else {
- ids = atoi(a[ia]);
+ ids = Draw::Atoi(a[ia]);
if ( Tpar.isshap() ) {
if (Tpar.TS() != TopAbs_SHAPE) Dumper.DumpTopology(Tpar.TK(),ids,cout);
else {
gp_Pnt pds;
TopoDS_Edge ed;
- Standard_Integer ip = atoi(a[2]);
- Standard_Integer ie = atoi(a[4]);
+ Standard_Integer ip = Draw::Atoi(a[2]);
+ Standard_Integer ie = Draw::Atoi(a[4]);
ok = ok && (ip >= 1); ok = ok && (ie >= 1);
if (!ok) {
di <<" bad data"<<"\n";
if ( HDS.IsNull() ) { COUTNOHDS(di); return 0; }
if (na == 1) FDSCNX_Dump(HDS);
else if (na == 2) {
- if (ISINTEGER(a[1])) FDSCNX_Dump(HDS,atoi(a[1]));
+ if (ISINTEGER(a[1])) FDSCNX_Dump(HDS,Draw::Atoi(a[1]));
else
}
return 0;
TDSpar Tpar(a[i1arg]);
if ( strcasecmp(a[i1arg + 2],"i") ) return 0;
- Standard_Integer ii = atoi(a[i1arg + 3]);
+ Standard_Integer ii = Draw::Atoi(a[i1arg + 3]);
// Standard_Integer ia,is,ig;
Standard_Integer is,ig;
if ( Tpar.isshap() ) {
- is = atoi(a[i1arg + 1]);
+ is = Draw::Atoi(a[i1arg + 1]);
const TopoDS_Shape& s = GetShape(is,Tpar.TS()); if (s.IsNull()) return 0;
TopOpeBRepDS_ListOfInterference& li = BDS.ChangeShapeInterferences(is);
Standard_Integer i=0; TopOpeBRepDS_ListIteratorOfListOfInterference it(li);
}
}
else if ( Tpar.isgeom() ) {
- ig = atoi(a[i1arg + 1]);
+ ig = Draw::Atoi(a[i1arg + 1]);
}
return 0;
} // tdsri
}
else if (na == 4) {
if (!strcmp(a[1],"xy")) {
- Standard_Integer i = atoi(a[2]);
+ Standard_Integer i = Draw::Atoi(a[2]);
const TestTopOpeTools_Mesure& M = (*PAMES).Value(SetName(a[3],di));
Standard_Real x,y,z;gp_Pnt p=M.Pnt(i);p.Coord(x,y,z);
di<<x<<" "<<y;
(D.IsNull() && ((*PDel).Value(CurrentMES4) == "1"))) // after a "dall"
{
TestTopOpeTools_Mesure *MES4 = (new TestTopOpeTools_Mesure(a[1]));
- (*MES4).Add(atoi(a[2]),atof(a[3]));
+ (*MES4).Add(Draw::Atoi(a[2]),Draw::Atof(a[3]));
if((*PDel).Value(CurrentMES4) == "1") {
TestTopOpeTools_Mesure MES3;
MES3 = (*PAMES).Value(CurrentMES4);
(*PAMES).SetValue(CurrentMES4, *MES4);
} else {
TestTopOpeTools_Mesure& MES4 = (*PAMES).ChangeValue(CurrentMES4);
- MES4.Add(atoi(a[2]),atof(a[3]));
+ MES4.Add(Draw::Atoi(a[2]),Draw::Atof(a[3]));
(*PAMES).SetValue(CurrentMES4, MES4);
}
if (na < 3) return 0;
Standard_Real dx=1.,dy=1.;
Standard_Boolean isX = Standard_False, isY = Standard_False;
- if (!strcmp(a[0],"seemx")) { dx = atof(a[na-1]); isX = Standard_True; }
- else if (!strcmp(a[0],"seemy")) { dy = atof(a[na-1]); isY = Standard_True; }
+ if (!strcmp(a[0],"seemx")) { dx = Draw::Atof(a[na-1]); isX = Standard_True; }
+ else if (!strcmp(a[0],"seemy")) { dy = Draw::Atof(a[na-1]); isY = Standard_True; }
TestTopOpeTools_Mesure MES5;
Handle(Draw_Drawable3D) D;
Handle(TestTopOpeDraw_DrawableMesure) DMES5;
else if (!strcmp(a[0],"seemxy")) {
if (na < 4) return 0;
TestTopOpeTools_Mesure& M = (*PAMES).ChangeValue(SetName(a[1],di));
- Standard_Real dx=atof(a[2]),dy=atof(a[3]);
+ Standard_Real dx=Draw::Atof(a[2]),dy=Draw::Atof(a[3]);
Handle(Draw_Drawable3D) D = Draw::Get(a[1],Standard_False);
Handle(TestTopOpeDraw_DrawableMesure) DM;
DM = Handle(TestTopOpeDraw_DrawableMesure)::DownCast(D);
if (narg != 10) return 1;
Standard_Real xmin,ymin,zmin,xmax,ymax,zmax,dx,dy,dz;
Standard_Integer nbx,nby,nbz;
- xmin = atof(a[1]);
- ymin = atof(a[2]);
- zmin = atof(a[3]);
- xmax = atof(a[4]);
- ymax = atof(a[5]);
- zmax = atof(a[6]);
- nbx = atoi(a[7]);
- nby = atoi(a[8]);
- nbz = atoi(a[9]);
+ xmin = Draw::Atof(a[1]);
+ ymin = Draw::Atof(a[2]);
+ zmin = Draw::Atof(a[3]);
+ xmax = Draw::Atof(a[4]);
+ ymax = Draw::Atof(a[5]);
+ zmax = Draw::Atof(a[6]);
+ nbx = Draw::Atoi(a[7]);
+ nby = Draw::Atoi(a[8]);
+ nbz = Draw::Atoi(a[9]);
if(xmax<xmin || ymax<ymin || zmax<zmin || nbx<0 || nby<0 || nbz<0)
return 1;
if(nbx) dx = (xmax-xmin)/nbx; else dx=0;
Standard_Integer testtopopedraw_cdinp(Draw_Interpretor&,Standard_Integer na,const char** a)
{
if ( na < 5 ) return 0;
- TestTopOpeDraw_P3DDisplayer PD(a[1],atof(a[2]),atof(a[3]),atof(a[4]));
+ TestTopOpeDraw_P3DDisplayer PD(a[1],Draw::Atof(a[2]),Draw::Atof(a[3]),Draw::Atof(a[4]));
return 0;
}
char sis[40]; sis[0] = '\0';
Standard_Integer kk = 0, k = j+1;
for (; k<l; k++,kk++,sis[kk] = '\0' ) sis[kk] = a[iloc][k];
- inbr = atoi(sis);
+ inbr = Draw::Atoi(sis);
inbrdef = Standard_True;
}
}
else if(a[iloc][j] == 'p') {
if (iloc < na - 1) {
- tpar = atof(a[iloc+1]);
+ tpar = Draw::Atof(a[iloc+1]);
dloc++; decal++;
}
}
static Standard_Integer ttab(Draw_Interpretor& di, Standard_Integer narg, const char** a) {
char s[2000]; strcpy(s,"");
- sprintf(s,"%s%s",s,"proc addt {at args} {upvar $at x;set L \"\";addl L [join $args];");
- sprintf(s,"%s%s",s,"foreach l $L {set x([array size x]) $l}};");
+ Sprintf(s,"%s%s",s,"proc addt {at args} {upvar $at x;set L \"\";addl L [join $args];");
+ Sprintf(s,"%s%s",s,"foreach l $L {set x([array size x]) $l}};");
di.Eval(s);
return 0;
}
char s[1000];
mypdi->Eval("info proc vx2d_displayface");
if (mypdi->Result()) {
- sprintf(s,"vx2d_displayface %s",myfacename.ToCString());
+ Sprintf(s,"vx2d_displayface %s",myfacename.ToCString());
mypdi->Eval(s);
}
else cout<<"procedure vx2d_displayface non trouvee"<<endl;
lenames(l2,ste2);
cout<<endl;
- sprintf(stol,"%g",tole);
+ Sprintf(stol,"%g",tole);
cout<<"# "<<ste<<" : tole "<<stol<<" : uv "<<pe1.X()<<" "<<pe1.Y()<<" UV "<<pe2.X()<<" "<<pe2.Y();
cout<<endl;
- sprintf(stol,"%g",tol1);
+ Sprintf(stol,"%g",tol1);
cout<<"# "<<sv1<<" : tol1 "<<stol<<" : uv "<<p1.X()<<" "<<p1.Y()<<" : edges "<<ste1;
cout<<endl;
- sprintf(stol,"%g",tol2);
+ Sprintf(stol,"%g",tol2);
cout<<"# "<<sv2<<" : tol2 "<<stol<<" : uv "<<p2.X()<<" "<<p2.Y()<<" : edges "<<ste2;
cout<<endl;
- sprintf(stol,"%g",v1v2); cout<<"# v1v2 = "<<stol;
+ Sprintf(stol,"%g",v1v2); cout<<"# v1v2 = "<<stol;
cout<<endl;
cout.flush();
for(Standard_Integer ia=1;ia<na;ia++) {
if (!strcasecmp(a[1],"-n")) { dostep=+1; DRAWsuppressarg(na,a,ia); }
else if(!strcasecmp(a[1],"-p")) { dostep=-1; DRAWsuppressarg(na,a,ia); }
- else if (ISINTEGER(a[1])) { doiedge=atoi(a[1]); DRAWsuppressarg(na,a,ia); }
+ else if (ISINTEGER(a[1])) { doiedge=Draw::Atoi(a[1]); DRAWsuppressarg(na,a,ia); }
}
if (dostep) {
TCollection_AsciiString sta1(a[1]); TopAbs_ShapeEnum t = S.ShapeType();
TopAbs_ShapeEnum tt = ( t == TopAbs_FACE) ? TopAbs_EDGE : TopAbs_FACE;
- Standard_Integer iearg = (na >= 3) ? atoi(a[2]) : 0;
+ Standard_Integer iearg = (na >= 3) ? Draw::Atoi(a[2]) : 0;
TCollection_AsciiString stss; Standard_Integer i = 1;
TopExp_Explorer ex;
for (ex.Init(S,tt);ex.More();ex.Next(),i++) {
const char* flag = a[1];
t_value value; // new value of flag
if (n == 2) value = Standard_True;
- else value = (atoi(a[2]) ? Standard_True : Standard_False);
+ else value = (Draw::Atoi(a[2]) ? Standard_True : Standard_False);
if (mute == 0) {
if ( n == 2 ) {
for (Standard_Integer i=0; i < n; i++) {
const char *p = a[i];
if ( !strcasecmp(p,"def") ) {
- if ( ++i < n ) SetDef(atof(a[i]));
+ if ( ++i < n ) SetDef(Atof(a[i]));
}
else if ( !strcasecmp(p,"pas") ) {
- if ( ++i < n ) SetPas(atof(a[i]));
+ if ( ++i < n ) SetPas(Atof(a[i]));
}
else if ( !strcasecmp(p,"nbp") ) {
if ( ++i < n ) SetNbp(atoi(a[i]));
Standard_Integer n = 0;
GdumpSHAORI(E, (char *) "vertices of ");cout<<endl;
TopOpeBRepTool_ShapeExplorer ex(E,TopAbs_VERTEX);
- char strpar[256]; sprintf(strpar," #");
+ char strpar[256];
+ Sprintf(strpar," #");
for (; ex.More(); ex.Next()) {
const TopoDS_Vertex& VV = TopoDS::Vertex(ex.Current());
TopAbs_Orientation o = VV.Orientation();
else if (o == TopAbs_EXTERNAL) cout<<"E";
cout<<++n<<" "; TopOpeBRepBuild_Builder::PrintPnt(VV); cout<<";";
Standard_Real par = BRep_Tool::Parameter(VV,EE);
- char spar[255];sprintf(spar," par%d %f",n,par); strcat(strpar,spar);
+ char spar[255];
+ Sprintf(spar," par%d %f",n,par);
+ strcat(strpar,spar);
}
if(n) cout<<strpar<<endl;
cout.flush();
void TopTools_ShapeSet::Write(Standard_OStream& OS)
{
+ // always use C locale for writing shapes
+ std::locale anOldLocale = OS.imbue (std::locale::classic());
- // on sauvegarde l'ancien LC_NUMERIC
- char *oldnum,*plocal ;
- plocal = setlocale(LC_NUMERIC, NULL) ;
- oldnum = new char[strlen(plocal)+1] ;
- strcpy(oldnum,plocal);
-
- // on positionne LC_NUMERIC a "C" (point decimal)
- setlocale(LC_NUMERIC, "C") ;
-
+ // use 15-digit precision
std::streamsize prec = OS.precision(15);
// write the copyright
// write the locations
//-----------------------------------------
- if (!myProgress.IsNull() && myProgress->UserBreak()) {
- cout << "Interrupted by the user"<<endl;
- // on remet le LC_NUMERIC a la precedente valeur
- setlocale(LC_NUMERIC, oldnum) ;
- delete[] oldnum;
- return;
- }
-
if ( !myProgress.IsNull() )
myProgress->NewScope ( 10, "Locations" );
myLocations.SetProgress(myProgress);
myProgress->Show();
}
-
if (!myProgress.IsNull() && myProgress->UserBreak()) {
- cout << "Interrupted by the user"<<endl;
- // on remet le LC_NUMERIC a la precedente valeur
- setlocale(LC_NUMERIC, oldnum) ;
- delete[] oldnum;
+ OS << "Interrupted by the user"<<endl;
+ OS.imbue (anOldLocale);
return;
}
Standard_Integer i, nbShapes = myShapes.Extent();
OS << "\nTShapes " << nbShapes << "\n";
-
// subshapes are written first
//OCC19559
OS << endl;
OS.precision(prec);
+ OS.imbue (anOldLocale);
+
PS.Relieve();
if (!myProgress.IsNull()) {
myProgress->EndScope();
myProgress->Show();
+ if (myProgress->UserBreak())
+ OS << "Interrupted by the user"<<endl;
}
-
- // on remet le LC_NUMERIC a la precedente valeur
- setlocale(LC_NUMERIC, oldnum) ;
- delete[] oldnum;
}
//=======================================================================
void TopTools_ShapeSet::Read(Standard_IStream& IS)
{
- // on sauvegarde l'ancien LC_NUMERIC
- char *oldnum,*plocal ;
- plocal = setlocale(LC_NUMERIC, NULL) ;
- oldnum = new char[strlen(plocal)+1] ;
- strcpy(oldnum,plocal);
+ // always use C locale for reading shapes
+ std::locale anOldLocale = IS.imbue (std::locale::classic());
Clear();
} while ( ! IS.fail() && strcmp(vers,Version) && strcmp(vers,Version2) );
if (IS.fail()) {
cout << "File was not written with this version of the topology"<<endl;
- // on remet le LC_NUMERIC a la precedente valeur
- setlocale(LC_NUMERIC, oldnum) ;
- delete[] oldnum;
+ IS.imbue (anOldLocale);
return;
}
if (strcmp(vers,Version2) == 0) SetFormatNb(2);
if (!myProgress.IsNull() && myProgress->UserBreak()) {
cout << "Interrupted by the user"<<endl;
// on remet le LC_NUMERIC a la precedente valeur
- setlocale(LC_NUMERIC, oldnum) ;
- delete[] oldnum;
+ IS.imbue (anOldLocale);
return;
}
if ( !myProgress.IsNull() )
if (!myProgress.IsNull() && myProgress->UserBreak()) {
cout << "Interrupted by the user"<<endl;
// on remet le LC_NUMERIC a la precedente valeur
- setlocale(LC_NUMERIC, oldnum) ;
- delete[] oldnum;
+ IS.imbue (anOldLocale);
return;
}
if (strcmp(buffer,"TShapes")) {
cout << "Not a TShape table"<<endl;
// on remet le LC_NUMERIC a la precedente valeur
- setlocale(LC_NUMERIC, oldnum) ;
- delete[] oldnum;
+ IS.imbue (anOldLocale);
return;
}
}
// on remet le LC_NUMERIC a la precedente valeur
- setlocale(LC_NUMERIC, oldnum) ;
- delete[] oldnum;
+ IS.imbue (anOldLocale);
}
//=======================================================================
#include <Units_Operators.hxx>
#include <OSD.hxx>
-
-// GG 09.04.98 PRO13136
-// Ne pas utiliser la fonction systeme atof() qui
-// depend de la localisation
-static char DecimalPoint = '\0';
-static void GetDecimalPoint() {
- Standard_Real f = 1.1 ;
- char str[5] ;
-
- sprintf(str,"%.1f",f) ;
-//#ifdef DEB
-// printf("Local System is %s\n",str) ;
-//#endif
- DecimalPoint = str[1] ;
-}
-
//=======================================================================
//function : Units_UnitsDictionary
//purpose :
}
else if( argc > 1 )
{
- StdSelect_SensitivityMode aMode = ( StdSelect_SensitivityMode )atoi( argv[1] );
+ StdSelect_SensitivityMode aMode = ( StdSelect_SensitivityMode )Draw::Atoi( argv[1] );
aContext->SetSensitivityMode( aMode );
if( argc > 2 )
{
if( aMode == StdSelect_SM_WINDOW )
{
- Standard_Integer aPixelTolerance = atoi( argv[2] );
+ Standard_Integer aPixelTolerance = Draw::Atoi( argv[2] );
aContext->SetPixelTolerance( aPixelTolerance );
}
else if( aMode == StdSelect_SM_VIEW )
{
- Standard_Real aSensitivity = atof( argv[2] );
+ Standard_Real aSensitivity = Draw::Atof( argv[2] );
aContext->SetSensitivity( aSensitivity );
}
}
}
}
- Standard_Integer aWidth = (argc > 3) ? atoi (argv[3]) : 0;
- Standard_Integer aHeight = (argc > 4) ? atoi (argv[4]) : 0;
+ Standard_Integer aWidth = (argc > 3) ? Draw::Atoi (argv[3]) : 0;
+ Standard_Integer aHeight = (argc > 4) ? Draw::Atoi (argv[4]) : 0;
Handle(AIS_InteractiveContext) IC;
Handle(V3d_View) view;
}
}
else if(argc==2){
- Standard_Integer Dmode = atoi(argv[1]);
+ Standard_Integer Dmode = Draw::Atoi(argv[1]);
if(Ctx->NbCurrents()==0 && TypeOfOperation==3){
Handle(AIS_InteractiveObject) IO;
VwrTst_DispErase(IO,Dmode,TypeOfOperation,Standard_True);
if(GetMapOfAIS().IsBound2(name))
IO = Handle(AIS_InteractiveObject)::DownCast(GetMapOfAIS().Find2(name));
if (!IO.IsNull())
- VwrTst_DispErase(IO,atoi(argv[2]),TypeOfOperation,Standard_True);
+ VwrTst_DispErase(IO,Draw::Atoi(argv[2]),TypeOfOperation,Standard_True);
}
return 0;
}
static int VSubInt(Draw_Interpretor& di, Standard_Integer argc, const char** argv)
{
if(argc==1) return 1;
- Standard_Integer On = atoi(argv[1]);
+ Standard_Integer On = Draw::Atoi(argv[1]);
const Handle(AIS_InteractiveContext)& Ctx = ViewerTest::GetAISContext();
if(argc==2){
const Handle(AIS_InteractiveObject) ashape =
Handle(AIS_InteractiveObject)::DownCast(anObj);
if(HaveToSet)
- TheAISContext()->SetTransparency(ashape,atof(argv[2]) );
+ TheAISContext()->SetTransparency(ashape,Draw::Atof(argv[2]) );
else
TheAISContext()->UnsetTransparency(ashape);
} else if (anObj->IsKind(STANDARD_TYPE(NIS_InteractiveObject))) {
const Handle(NIS_InteractiveObject) ashape =
Handle(NIS_InteractiveObject)::DownCast(anObj);
if(HaveToSet)
- ashape->SetTransparency(atof(argv[2]) );
+ ashape->SetTransparency(Draw::Atof(argv[2]) );
else
ashape->UnsetTransparency();
}
{
Handle(AIS_InteractiveObject) ashape = TheAISContext() -> Current();
if(HaveToSet)
- TheAISContext()->SetTransparency(ashape,atof(argv[1]),Standard_False);
+ TheAISContext()->SetTransparency(ashape,Draw::Atof(argv[1]),Standard_False);
else
TheAISContext()->UnsetTransparency(ashape,Standard_False);
}
Handle(AIS_InteractiveObject)::DownCast(it.Key1());
if (!ashape.IsNull())
if(HaveToSet)
- TheAISContext()->SetTransparency(ashape,atof(argv[1]),Standard_False);
+ TheAISContext()->SetTransparency(ashape,Draw::Atof(argv[1]),Standard_False);
else
TheAISContext()->UnsetTransparency(ashape,Standard_False);
it.Next();
const Handle(AIS_InteractiveObject) ashape =
Handle(AIS_InteractiveObject)::DownCast(GetMapOfAIS().Find2(name));
if (HaveToSet)
- TheAISContext()->SetWidth ( ashape,atof (argv[2]) );
+ TheAISContext()->SetWidth ( ashape,Draw::Atof (argv[2]) );
else
TheAISContext()->UnsetWidth (ashape);
} else if (anObj->IsKind(STANDARD_TYPE(NIS_InteractiveObject))) {
const Handle(NIS_Triangulated) ashape =
Handle(NIS_Triangulated)::DownCast(GetMapOfAIS().Find2(name));
if (HaveToSet && !ashape.IsNull())
- ashape->SetLineWidth ( atof (argv[2]) );
+ ashape->SetLineWidth ( Draw::Atof (argv[2]) );
}
}
{
Handle(AIS_InteractiveObject) ashape = TheAISContext() -> Current();
if (HaveToSet)
- TheAISContext()->SetWidth(ashape,atof(argv[1]),Standard_False);
+ TheAISContext()->SetWidth(ashape,Draw::Atof(argv[1]),Standard_False);
else
TheAISContext()->UnsetWidth(ashape,Standard_False);
}
Handle(AIS_InteractiveObject)::DownCast (it.Key1());
if (!ashape.IsNull())
if (HaveToSet)
- TheAISContext()->SetWidth(ashape,atof(argv[1]),Standard_False);
+ TheAISContext()->SetWidth(ashape,Draw::Atof(argv[1]),Standard_False);
else
TheAISContext()->UnsetWidth(ashape,Standard_False);
it.Next();
if (anObj->IsKind(STANDARD_TYPE(AIS_InteractiveObject))) {
const Handle(AIS_InteractiveObject) ashape =
Handle(AIS_InteractiveObject)::DownCast(GetMapOfAIS().Find2(name));
- SetInteriorStyle (ashape, atoi (argv[2]), di);
+ SetInteriorStyle (ashape, Draw::Atoi (argv[2]), di);
}
}
//=======================================================================
TheAISContext() ->NextCurrent() )
{
Handle(AIS_InteractiveObject) ashape = TheAISContext() -> Current();
- SetInteriorStyle (ashape, atoi (argv[1]), di);
+ SetInteriorStyle (ashape, Draw::Atoi (argv[1]), di);
}
}
//=======================================================================
Handle(AIS_InteractiveObject) ashape =
Handle(AIS_InteractiveObject)::DownCast (it.Key1());
if (!ashape.IsNull())
- SetInteriorStyle (ashape, atoi (argv[1]), di);
+ SetInteriorStyle (ashape, Draw::Atoi (argv[1]), di);
it.Next();
}
}
}
myShape->SetTextureScale (( argv[2] ? Standard_True : Standard_False ),
- ( argv[2] ? atof(argv[2]) : 1.0 ),
- ( argv[2] ? atof(argv[argc-1]) : 1.0 ) );
+ ( argv[2] ? Draw::Atof(argv[2]) : 1.0 ),
+ ( argv[2] ? Draw::Atof(argv[argc-1]) : 1.0 ) );
break;
case 3: // vtexorigin : we change the origin of the texture on the shape
return 1;
}
myShape->SetTextureOrigin (( argv[2] ? Standard_True : Standard_False ),
- ( argv[2] ? atof(argv[2]) : 0.0 ),
- ( argv[2] ? atof(argv[argc-1]) : 0.0 ));
+ ( argv[2] ? Draw::Atof(argv[2]) : 0.0 ),
+ ( argv[2] ? Draw::Atof(argv[argc-1]) : 0.0 ));
break;
case 4: // vtexrepeat : we change the number of occurences of the texture on the shape
if (argc>2 && argv[2])
{
di <<"Texture repeat enabled"<<"\n";
- myShape->SetTextureRepeat(Standard_True, atof(argv[2]), atof(argv[argc-1]) );
+ myShape->SetTextureRepeat(Standard_True, Draw::Atof(argv[2]), Draw::Atof(argv[argc-1]) );
}
else
{
myTimer.Start();
- if (atoi(argv[3])==1 ) {
+ if (Draw::Atoi(argv[3])==1 ) {
di<<" Primitives sensibles OFF"<<"\n";
TheAISContext()->Deactivate(aIO);
}
di<<" Primitives sensibles ON"<<"\n";
}
// Movement par transformation
- if(atoi(argv[2]) ==1) {
+ if(Draw::Atoi(argv[2]) ==1) {
di<<" Calcul par Transformation"<<"\n";
for (Standard_Real myAngle=0;Angle<10*2*M_PI; myAngle++) {
TheAISContext() ->UpdateCurrentViewer();
}
}
- if (atoi(argv[3])==1 ){
+ if (Draw::Atoi(argv[3])==1 ){
// On reactive la selection des primitives sensibles
TheAISContext()->Activate(aIO,0);
}
if (argc < 3) {
myDevCoef = 0.0008;
} else {
- myDevCoef =atof(argv[2]);
+ myDevCoef =Draw::Atof(argv[2]);
}
TCollection_AsciiString name=argv[1];
// IL n'y a aps de nom de shape passe en argument
if (HaveToSet && !ThereIsName){
- Standard_Integer aMode=atoi(argv [1]);
+ Standard_Integer aMode=Draw::Atoi(argv [1]);
const char *cmode="???";
switch (aMode) {
}
}
else if (HaveToSet && ThereIsName){
- Standard_Integer aMode=atoi(argv [2]);
+ Standard_Integer aMode=Draw::Atoi(argv [2]);
Handle(AIS_InteractiveObject) aIO =
Handle(AIS_InteractiveObject)::DownCast(GetMapOfAIS().Find2(argv[1]));
TCollection_AsciiString shapeName;
shapeName = argv[1];
- Standard_Integer persFlag1 = atoi(argv[2]);
+ Standard_Integer persFlag1 = Draw::Atoi(argv[2]);
Standard_Integer persFlag2 = 0;
Standard_Integer persFlag3 = 0;
gp_Pnt origin = gp_Pnt( 0.0, 0.0, 0.0 );
if ( argc == 4 || argc == 5 || argc == 7 || argc == 8 ) {
- persFlag2 = atoi(argv[3]);
+ persFlag2 = Draw::Atoi(argv[3]);
}
if ( argc == 5 || argc == 8 ) {
- persFlag3 = atoi(argv[4]);
+ persFlag3 = Draw::Atoi(argv[4]);
}
if ( argc >= 6 ) {
- origin.SetX( atof(argv[argc - 3]) );
- origin.SetY( atof(argv[argc - 2]) );
- origin.SetZ( atof(argv[argc - 1]) );
+ origin.SetX( Draw::Atof(argv[argc - 3]) );
+ origin.SetY( Draw::Atof(argv[argc - 2]) );
+ origin.SetZ( Draw::Atof(argv[argc - 1]) );
}
Standard_Boolean IsBound = GetMapOfAIS().IsBound2(shapeName);
Standard_Boolean IsPoly = Standard_False;
gp_Ax2 anAx2 = gp::XOY();
- //if(n > 2) aPolyAlgo = atoi(a[2]);
+ //if(n > 2) aPolyAlgo = Draw::Atoi(a[2]);
//IsPoly = aPolyAlgo > 0;
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);
Standard_Boolean IsPoly = Standard_True;
gp_Ax2 anAx2 = gp::XOY();
- //if(n > 2) aPolyAlgo = atoi(a[2]);
+ //if(n > 2) aPolyAlgo = Draw::Atoi(a[2]);
//IsPoly = aPolyAlgo > 0;
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);
// argv[4] - Standard_Real Angle
// argv[5] - Standard_Integer Reverse
-// sprintf(prefix, argv[1]);
+// Sprintf(prefix, argv[1]);
Standard_Real anAngle = 0;
Standard_Boolean Rev = Standard_False;
Standard_Integer rev = 0;
di << "TEST : Plane is NULL" << "\n";
return 1;
}
- anAngle = atof(argv[4]);
+ anAngle = Draw::Atof(argv[4]);
anAngle = 2*M_PI * anAngle / 360.0;
gp_Pln aPln;
Handle( Geom_Surface )aSurf;
Standard_Real Offset;
gp_Dir aDir;
if(argc > 4) { // == 5
- rev = atoi(argv[5]);
+ rev = Draw::Atoi(argv[5]);
Rev = (rev)? Standard_True : Standard_False;
}
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;
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 aLocalShape = DBRep::Get(a[(2*ii+2)],TopAbs_EDGE);
E = TopoDS::Edge(aLocalShape);
// E = TopoDS::Edge(DBRep::Get(a[(2*ii+2)],TopAbs_EDGE));
Standard_Integer anArgIter = 2; // 1st is an IO name
if (anArgIter < theArgsNb)
{
- anOrigin.SetX (atof (theArgVec[anArgIter++]));
- anOrigin.SetY (atof (theArgVec[anArgIter++]));
- anOrigin.SetZ (atof (theArgVec[anArgIter++]));
+ anOrigin.SetX (Draw::Atof (theArgVec[anArgIter++]));
+ anOrigin.SetY (Draw::Atof (theArgVec[anArgIter++]));
+ anOrigin.SetZ (Draw::Atof (theArgVec[anArgIter++]));
if (anArgIter < theArgsNb)
{
- Standard_Real aX = atof (theArgVec[anArgIter++]);
- Standard_Real aY = atof (theArgVec[anArgIter++]);
- Standard_Real aZ = atof (theArgVec[anArgIter++]);
+ Standard_Real aX = Draw::Atof (theArgVec[anArgIter++]);
+ Standard_Real aY = Draw::Atof (theArgVec[anArgIter++]);
+ Standard_Real aZ = Draw::Atof (theArgVec[anArgIter++]);
aDirZ.SetCoord (aX, aY, aZ);
- aX = atof (theArgVec[anArgIter++]);
- aY = atof (theArgVec[anArgIter++]);
- aZ = atof (theArgVec[anArgIter++]);
+ aX = Draw::Atof (theArgVec[anArgIter++]);
+ aY = Draw::Atof (theArgVec[anArgIter++]);
+ aZ = Draw::Atof (theArgVec[anArgIter++]);
aDirX.SetCoord (aX, aY, aZ);
}
}
// Verification du nombre d'arguments
if (argc==1) {ThereIsName=Standard_False;value=100;}
- else if (argc==2) {ThereIsName=Standard_False;value=atof(argv[1]);}
- else {ThereIsName=Standard_True;value=atof(argv[2]);}
+ else if (argc==2) {ThereIsName=Standard_False;value=Draw::Atof(argv[1]);}
+ else {ThereIsName=Standard_True;value=Draw::Atof(argv[2]);}
// On ferme le contexte local pour travailler dans le contexte global
if(TheAISContext()->HasOpenedContext())
if (HasArg) {
Standard_Real coord[6];
for(Standard_Integer i=0;i<=5;i++){
- coord[i]=atof(argv[2+i]);
+ coord[i]=Draw::Atof(argv[2+i]);
}
gp_Pnt p1(coord[0],coord[1],coord[2]), p2(coord[3],coord[4],coord[5]) ;
if (HasArg) {
Standard_Real thecoord[3];
for(Standard_Integer i=0;i<=2;i++)
- thecoord[i]=atof(argv[2+i]);
+ thecoord[i]=Draw::Atof(argv[2+i]);
Handle(Geom_CartesianPoint ) myGeomPoint= new Geom_CartesianPoint (thecoord[0],thecoord[1],thecoord[2]);
Handle(AIS_Point) myAISPoint=new AIS_Point(myGeomPoint );
GetMapOfAIS().Bind (myAISPoint,name);
Handle(Geom_CartesianPoint)::DownCast( anAISPointC->Component());
// Verification that the three points are different
- if(abs(aCartPointB->X()-aCartPointA->X())<=Precision::Confusion() &&
- abs(aCartPointB->Y()-aCartPointA->Y())<=Precision::Confusion() &&
- abs(aCartPointB->Z()-aCartPointA->Z())<=Precision::Confusion())
+ if(Abs(aCartPointB->X()-aCartPointA->X())<=Precision::Confusion() &&
+ Abs(aCartPointB->Y()-aCartPointA->Y())<=Precision::Confusion() &&
+ Abs(aCartPointB->Z()-aCartPointA->Z())<=Precision::Confusion())
{
// B=A
std::cout<<"vplane error: same points"<<"\n";return 1;
}
- if(abs(aCartPointC->X()-aCartPointA->X())<=Precision::Confusion() &&
- abs(aCartPointC->Y()-aCartPointA->Y())<=Precision::Confusion() &&
- abs(aCartPointC->Z()-aCartPointA->Z())<=Precision::Confusion())
+ if(Abs(aCartPointC->X()-aCartPointA->X())<=Precision::Confusion() &&
+ Abs(aCartPointC->Y()-aCartPointA->Y())<=Precision::Confusion() &&
+ Abs(aCartPointC->Z()-aCartPointA->Z())<=Precision::Confusion())
{
// C=A
std::cout<<"vplane error: same points"<<"\n";return 1;
}
- if(abs(aCartPointC->X()-aCartPointB->X())<=Precision::Confusion() &&
- abs(aCartPointC->Y()-aCartPointB->Y())<=Precision::Confusion() &&
- abs(aCartPointC->Z()-aCartPointB->Z())<=Precision::Confusion())
+ if(Abs(aCartPointC->X()-aCartPointB->X())<=Precision::Confusion() &&
+ Abs(aCartPointC->Y()-aCartPointB->Y())<=Precision::Confusion() &&
+ Abs(aCartPointC->Z()-aCartPointB->Z())<=Precision::Confusion())
{
// C=B
std::cout<<"vplane error: same points"<<"\n";return 1;
Standard_Real coord[6];
for(Standard_Integer i=0;i<=2;i++){
- coord[i]=atof(argv[2+i]);
- coord[i+3]=atof(argv[5+i]);
+ coord[i]=Draw::Atof(argv[2+i]);
+ coord[i+3]=Draw::Atof(argv[5+i]);
}
Handle(Geom_CartesianPoint ) myCartPointA=new Geom_CartesianPoint (coord[0],coord[1],coord[2] );
{
// Get arguments
TCollection_AsciiString aName(argv[1]);
- Standard_Boolean isFilled = (Standard_Boolean)atoi(argv[5]);
+ Standard_Boolean isFilled = (Standard_Boolean)Draw::Atoi(argv[5]);
Handle(AIS_InteractiveObject) theShapeA;
Handle(AIS_InteractiveObject) theShapeB;
Handle(Geom_CartesianPoint)::DownCast(myGeomPointC);
// Test A=B
- if (abs(myCartPointA->X()-myCartPointB->X()) <= Precision::Confusion() &&
- abs(myCartPointA->Y()-myCartPointB->Y()) <= Precision::Confusion() &&
- abs(myCartPointA->Z()-myCartPointB->Z()) <= Precision::Confusion() )
+ if (Abs(myCartPointA->X()-myCartPointB->X()) <= Precision::Confusion() &&
+ Abs(myCartPointA->Y()-myCartPointB->Y()) <= Precision::Confusion() &&
+ Abs(myCartPointA->Z()-myCartPointB->Z()) <= Precision::Confusion() )
{
std::cout << "vcircle error: Same points.\n";
return 1; // TCL_ERROR
}
// Test A=C
- if (abs(myCartPointA->X()-myCartPointC->X()) <= Precision::Confusion() &&
- abs(myCartPointA->Y()-myCartPointC->Y()) <= Precision::Confusion() &&
- abs(myCartPointA->Z()-myCartPointC->Z()) <= Precision::Confusion() )
+ if (Abs(myCartPointA->X()-myCartPointC->X()) <= Precision::Confusion() &&
+ Abs(myCartPointA->Y()-myCartPointC->Y()) <= Precision::Confusion() &&
+ Abs(myCartPointA->Z()-myCartPointC->Z()) <= Precision::Confusion() )
{
std::cout << "vcircle error: Same points.\n";
return 1; // TCL_ERROR
}
// Test B=C
- if (abs(myCartPointB->X()-myCartPointC->X()) <= Precision::Confusion() &&
- abs(myCartPointB->Y()-myCartPointC->Y()) <= Precision::Confusion() &&
- abs(myCartPointB->Z()-myCartPointC->Z()) <= Precision::Confusion() )
+ if (Abs(myCartPointB->X()-myCartPointC->X()) <= Precision::Confusion() &&
+ Abs(myCartPointB->Y()-myCartPointC->Y()) <= Precision::Confusion() &&
+ Abs(myCartPointB->Z()-myCartPointC->Z()) <= Precision::Confusion() )
{
std::cout << "vcircle error: Same points.\n";
return 1;// TCL_ERROR
return 1; // TCL_ERROR
}
// Ñheck that the radius is >= 0
- if (atof(argv[4]) <= 0 )
+ if (Draw::Atof(argv[4]) <= 0 )
{
std::cout << "vcircle error: the radius must be >=0.\n";
return 1; // TCL_ERROR
gp_Ax1 thegpAxe = mygpPlane.Axis();
gp_Dir theDir = thegpAxe.Direction();
gp_Pnt theCenter = myCartPointB->Pnt();
- Standard_Real TheR = atof(argv[4]);
+ Standard_Real TheR = Draw::Atof(argv[4]);
GC_MakeCircle Cir = GC_MakeCircle (theCenter, theDir ,TheR);
Handle (Geom_Circle) theGeomCircle;
try
}
// Text position
- const Standard_Real X = atof(argv[2]);
- const Standard_Real Y = atof(argv[3]);
- const Standard_Real Z = atof(argv[4]);
+ const Standard_Real X = Draw::Atof(argv[2]);
+ const Standard_Real Y = Draw::Atof(argv[3]);
+ const Standard_Real Z = Draw::Atof(argv[4]);
const gp_Pnt pnt(X,Y,Z);
// Text color
- const Quantity_Parameter R = atof(argv[5])/255.;
- const Quantity_Parameter G = atof(argv[6])/255.;
- const Quantity_Parameter B = atof(argv[7])/255.;
+ const Quantity_Parameter R = Draw::Atof(argv[5])/255.;
+ const Quantity_Parameter G = Draw::Atof(argv[6])/255.;
+ const Quantity_Parameter B = Draw::Atof(argv[7])/255.;
const Quantity_Color aColor( R, G, B, Quantity_TOC_RGB );
// Text alignment
- const int hor_align = atoi(argv[8]);
- const int ver_align = atoi(argv[9]);
+ const int hor_align = Draw::Atoi(argv[8]);
+ const int ver_align = Draw::Atoi(argv[9]);
// Text angle
- const Standard_Real angle = atof(argv[10]);
+ const Standard_Real angle = Draw::Atof(argv[10]);
// Text zooming
- const Standard_Boolean zoom = atoi(argv[11]);
+ const Standard_Boolean zoom = Draw::Atoi(argv[11]);
// Text height
- const Standard_Real height = atof(argv[12]);
+ const Standard_Real height = Draw::Atof(argv[12]);
// Text aspect
- const Font_FontAspect aspect = Font_FontAspect(atoi(argv[13]));
+ const Font_FontAspect aspect = Font_FontAspect(Draw::Atoi(argv[13]));
// Text font
TCollection_AsciiString font;
font.AssignCat(argv[14]);
// Text is multibyte
- const Standard_Boolean isMultibyte = (argc < 16)? Standard_False : (atoi(argv[15]) != 0);
+ const Standard_Boolean isMultibyte = (argc < 16)? Standard_False : (Draw::Atoi(argv[15]) != 0);
// Read text string
TCollection_ExtendedString name;
// read the arguments
TCollection_AsciiString aShapeName (argv[1]);
- Standard_Integer aResolution = atoi (argv[2]);
- Standard_Real aCenterX = (argc > 5) ? atof (argv[3]) : 0.0;
- Standard_Real aCenterY = (argc > 5) ? atof (argv[4]) : 0.0;
- Standard_Real aCenterZ = (argc > 5) ? atof (argv[5]) : 0.0;
- Standard_Real aRadius = (argc > 6) ? atof (argv[6]) : 100.0;
- Standard_Boolean toShowEdges = (argc > 7) ? atoi (argv[7]) : Standard_False;
+ Standard_Integer aResolution = Draw::Atoi (argv[2]);
+ Standard_Real aCenterX = (argc > 5) ? Draw::Atof (argv[3]) : 0.0;
+ Standard_Real aCenterY = (argc > 5) ? Draw::Atof (argv[4]) : 0.0;
+ Standard_Real aCenterZ = (argc > 5) ? Draw::Atof (argv[5]) : 0.0;
+ Standard_Real aRadius = (argc > 6) ? Draw::Atof (argv[6]) : 100.0;
+ Standard_Boolean toShowEdges = (argc > 7) ? Draw::Atoi (argv[7]) : Standard_False;
// remove AIS object with given name from map
VDisplayAISObject (aShapeName, Handle(AIS_InteractiveObject)());
}
else if (argc == 2 || argc == 3)
{
- Standard_Integer aPlaneIdToOff = (argc == 3) ? atoi (argv[1]) : 1;
+ Standard_Integer aPlaneIdToOff = (argc == 3) ? Draw::Atoi (argv[1]) : 1;
Standard_Boolean toIterateAll = (argc == 2);
TCollection_AsciiString isOnOffStr ((argc == 3) ? argv[2] : argv[1]);
isOnOffStr.LowerCase();
return 1;
}
- Standard_Real aLocX = atof (argv[1]);
- Standard_Real aLocY = atof (argv[2]);
- Standard_Real aLocZ = atof (argv[3]);
- Standard_Real aNormDX = atof (argv[4]);
- Standard_Real aNormDY = atof (argv[5]);
- Standard_Real aNormDZ = atof (argv[6]);
+ Standard_Real aLocX = Draw::Atof (argv[1]);
+ Standard_Real aLocY = Draw::Atof (argv[2]);
+ Standard_Real aLocZ = Draw::Atof (argv[3]);
+ Standard_Real aNormDX = Draw::Atof (argv[4]);
+ Standard_Real aNormDY = Draw::Atof (argv[5]);
+ Standard_Real aNormDZ = Draw::Atof (argv[6]);
Handle(V3d_Plane) aPlaneV3d = new V3d_Plane();
gp_Pln aPlane (gp_Pnt (aLocX, aLocY, aLocZ), gp_Dir (aNormDX, aNormDY, aNormDZ));
{
gp_Dir anUp;
- anEye.SetCoord (atof (argv[3]), atof (argv[4]), atof (argv[5]));
- aDir.SetCoord (atof (argv[6]), atof (argv[7]), atof (argv[8]));
- anUp.SetCoord (atof (argv[9]), atof (argv[10]), atof (argv[11]));
+ anEye.SetCoord (Draw::Atof (argv[3]), Draw::Atof (argv[4]), Draw::Atof (argv[5]));
+ aDir.SetCoord (Draw::Atof (argv[6]), Draw::Atof (argv[7]), Draw::Atof (argv[8]));
+ anUp.SetCoord (Draw::Atof (argv[9]), Draw::Atof (argv[10]), Draw::Atof (argv[11]));
aProjAx.SetLocation (anEye);
aProjAx.SetDirection (aDir);
aProjAx.SetYDirection (anUp);
// vertex command
if (CheckInputCommand ("v", argv, aArgIndex, 3, argc))
{
- anArray->AddVertex (atof (argv[aArgIndex - 3]),
- atof (argv[aArgIndex - 2]),
- atof (argv[aArgIndex - 1]));
+ anArray->AddVertex (Draw::Atof (argv[aArgIndex - 3]),
+ Draw::Atof (argv[aArgIndex - 2]),
+ Draw::Atof (argv[aArgIndex - 1]));
// vertex has a normal or normal with color or texel
if (CheckInputCommand ("n", argv, aArgIndex, 3, argc))
anArray->SetVertexNormal (anArray->VertexNumber (),
- atof (argv[aArgIndex - 3]),
- atof (argv[aArgIndex - 2]),
- atof (argv[aArgIndex - 1]));
+ Draw::Atof (argv[aArgIndex - 3]),
+ Draw::Atof (argv[aArgIndex - 2]),
+ Draw::Atof (argv[aArgIndex - 1]));
if (CheckInputCommand ("c", argv, aArgIndex, 3, argc))
anArray->SetVertexColor (anArray->VertexNumber (),
- atof (argv[aArgIndex - 3]),
- atof (argv[aArgIndex - 2]),
- atof (argv[aArgIndex - 1]));
+ Draw::Atof (argv[aArgIndex - 3]),
+ Draw::Atof (argv[aArgIndex - 2]),
+ Draw::Atof (argv[aArgIndex - 1]));
if (CheckInputCommand ("t", argv, aArgIndex, 2, argc))
anArray->SetVertexTexel (anArray->VertexNumber (),
- atof (argv[aArgIndex - 2]),
- atof (argv[aArgIndex - 1]));
+ Draw::Atof (argv[aArgIndex - 2]),
+ Draw::Atof (argv[aArgIndex - 1]));
}
// bounds command
else if (CheckInputCommand ("b", argv, aArgIndex, 1, argc))
{
- Standard_Integer aVertCount = atoi (argv[aArgIndex - 1]);
+ Standard_Integer aVertCount = Draw::Atoi (argv[aArgIndex - 1]);
if (CheckInputCommand ("c", argv, aArgIndex, 3, argc))
anArray->AddBound (aVertCount,
- atof (argv[aArgIndex - 3]),
- atof (argv[aArgIndex - 2]),
- atof (argv[aArgIndex - 1]));
+ Draw::Atof (argv[aArgIndex - 3]),
+ Draw::Atof (argv[aArgIndex - 2]),
+ Draw::Atof (argv[aArgIndex - 1]));
else
anArray->AddBound (aVertCount);
// edge command
else if (CheckInputCommand ("e", argv, aArgIndex, 1, argc))
{
- Standard_Integer aVertIndex = atoi (argv[aArgIndex - 1]);
+ Standard_Integer aVertIndex = Draw::Atoi (argv[aArgIndex - 1]);
// edge has/hasn't hide flag
if (CheckInputCommand ("h", argv, aArgIndex, 0, argc))
}
TCollection_AsciiString aName (argv[1]);
- Standard_Real aX = atof (argv[2]);
- Standard_Real aY = atof (argv[3]);
- Standard_Real aZ = atof (argv[4]);
+ Standard_Real aX = Draw::Atof (argv[2]);
+ Standard_Real aY = Draw::Atof (argv[3]);
+ Standard_Real aZ = Draw::Atof (argv[4]);
// find object
ViewerTest_DoubleMapOfInteractiveAndName& aMap = GetMapOfAIS();
}
// Get location data
- Standard_Real aXo = atof (argv[anArgIter++]);
- Standard_Real aYo = atof (argv[anArgIter++]);
- Standard_Real aZo = atof (argv[anArgIter++]);
- Standard_Real aXu = atof (argv[anArgIter++]);
- Standard_Real aXv = atof (argv[anArgIter++]);
- Standard_Real aXw = atof (argv[anArgIter++]);
- Standard_Real aZu = atof (argv[anArgIter++]);
- Standard_Real aZv = atof (argv[anArgIter++]);
- Standard_Real aZw = atof (argv[anArgIter++]);
+ Standard_Real aXo = Draw::Atof (argv[anArgIter++]);
+ Standard_Real aYo = Draw::Atof (argv[anArgIter++]);
+ Standard_Real aZo = Draw::Atof (argv[anArgIter++]);
+ Standard_Real aXu = Draw::Atof (argv[anArgIter++]);
+ Standard_Real aXv = Draw::Atof (argv[anArgIter++]);
+ Standard_Real aXw = Draw::Atof (argv[anArgIter++]);
+ Standard_Real aZu = Draw::Atof (argv[anArgIter++]);
+ Standard_Real aZv = Draw::Atof (argv[anArgIter++]);
+ Standard_Real aZw = Draw::Atof (argv[anArgIter++]);
// Create transformation
gp_Pnt aPoint(aXo, aYo, aZo);
}
// Get location data
- Standard_Real aXo = atof (argv[anArgIter++]);
- Standard_Real aYo = atof (argv[anArgIter++]);
- Standard_Real aZo = atof (argv[anArgIter++]);
- Standard_Real aXu = atof (argv[anArgIter++]);
- Standard_Real aXv = atof (argv[anArgIter++]);
- Standard_Real aXw = atof (argv[anArgIter++]);
- Standard_Real aZu = atof (argv[anArgIter++]);
- Standard_Real aZv = atof (argv[anArgIter++]);
- Standard_Real aZw = atof (argv[anArgIter++]);
+ Standard_Real aXo = Draw::Atof (argv[anArgIter++]);
+ Standard_Real aYo = Draw::Atof (argv[anArgIter++]);
+ Standard_Real aZo = Draw::Atof (argv[anArgIter++]);
+ Standard_Real aXu = Draw::Atof (argv[anArgIter++]);
+ Standard_Real aXv = Draw::Atof (argv[anArgIter++]);
+ Standard_Real aXw = Draw::Atof (argv[anArgIter++]);
+ Standard_Real aZu = Draw::Atof (argv[anArgIter++]);
+ Standard_Real aZv = Draw::Atof (argv[anArgIter++]);
+ Standard_Real aZw = Draw::Atof (argv[anArgIter++]);
// Create transformation
gp_Pnt aPoint(aXo, aYo, aZo);
if(argc == 3)
{
// Get arguments
- Standard_Integer aMode = atoi(argv[1]);
- Standard_Boolean isTurnOn = atoi(argv[2]);
+ Standard_Integer aMode = Draw::Atoi(argv[1]);
+ Standard_Boolean isTurnOn = Draw::Atoi(argv[2]);
// Get all displayed objects
AIS_ListOfInteractive anObjList;
else
{
// Get argumnets
- Standard_Integer aMode = atoi(argv[2]);
- Standard_Boolean isTurnOn = atoi(argv[3]);
+ Standard_Integer aMode = Draw::Atoi(argv[2]);
+ Standard_Boolean isTurnOn = Draw::Atoi(argv[3]);
TCollection_AsciiString aName(argv[1]);
// Check if there is an object with given name in context
Standard_Boolean IsMatch (const Handle(Geom_CartesianPoint)& thePoint1,
const Handle(Geom_CartesianPoint)& thePoint2)
{
- if(abs(thePoint1->X()-thePoint2->X()) <= Precision::Confusion() &&
- abs(thePoint1->Y()-thePoint2->Y()) <= Precision::Confusion() &&
- abs(thePoint1->Z()-thePoint2->Z()) <= Precision::Confusion())
+ if(Abs(thePoint1->X()-thePoint2->X()) <= Precision::Confusion() &&
+ Abs(thePoint1->Y()-thePoint2->Y()) <= Precision::Confusion() &&
+ Abs(thePoint1->Z()-thePoint2->Z()) <= Precision::Confusion())
{
return Standard_True;
}
// process operation
if (aOperation.IsEqual ("set"))
{
- Standard_Integer aLayerId = atoi (argv [3]);
+ Standard_Integer aLayerId = Draw::Atoi (argv [3]);
aContext->SetZLayer (anInterObj, aLayerId);
}
else if (aOperation.IsEqual ("get"))
Standard_ShortReal aFactor, aUnits;
if (argc == 5)
{
- aMode = atoi(argv[2]);
- aFactor = (Standard_ShortReal) atof(argv[3]);
- aUnits = (Standard_ShortReal) atof(argv[4]);
+ aMode = Draw::Atoi(argv[2]);
+ aFactor = (Standard_ShortReal) Draw::Atof(argv[3]);
+ aUnits = (Standard_ShortReal) Draw::Atof(argv[4]);
anInterObj->SetPolygonOffsets(aMode, aFactor, aUnits);
aContext->UpdateCurrentViewer();
TheAISContext ()->DefaultDrawer () : anInterObj->Attributes ();
// turn boundaries on/off
- Standard_Boolean isBoundaryDraw = (atoi (argv[2]) == 1);
+ Standard_Boolean isBoundaryDraw = (Draw::Atoi (argv[2]) == 1);
aDrawer->SetFaceBoundaryDraw (isBoundaryDraw);
// set boundary line color
if (argc >= 6)
{
// Text color
- aRed = atof (argv[3])/255.;
- aGreen = atof (argv[4])/255.;
- aBlue = atof (argv[5])/255.;
+ aRed = Draw::Atof (argv[3])/255.;
+ aGreen = Draw::Atof (argv[4])/255.;
+ aBlue = Draw::Atof (argv[5])/255.;
}
// set line width
if (argc >= 7)
{
- aWidth = (Standard_Real)atof (argv[6]);
+ aWidth = (Standard_Real)Draw::Atof (argv[6]);
}
// select appropriate line type
if (argc == 8)
{
- switch (atoi (argv[7]))
+ switch (Draw::Atoi (argv[7]))
{
case 1: aLineType = Aspect_TOL_DASH; break;
case 2: aLineType = Aspect_TOL_DOT; break;
static int VInit (Draw_Interpretor& , Standard_Integer argc, const char** argv)
{
- Standard_Integer aPxLeft = (argc > 1) ? atoi (argv[1]) : 0;
- Standard_Integer aPxTop = (argc > 2) ? atoi (argv[2]) : 0;
- Standard_Integer aPxWidth = (argc > 3) ? atoi (argv[3]) : 0;
- Standard_Integer aPxHeight = (argc > 4) ? atoi (argv[4]) : 0;
+ Standard_Integer aPxLeft = (argc > 1) ? Draw::Atoi (argv[1]) : 0;
+ Standard_Integer aPxTop = (argc > 2) ? Draw::Atoi (argv[2]) : 0;
+ Standard_Integer aPxWidth = (argc > 3) ? Draw::Atoi (argv[3]) : 0;
+ Standard_Integer aPxHeight = (argc > 4) ? Draw::Atoi (argv[4]) : 0;
ViewerTest::ViewerInit (aPxLeft, aPxTop, aPxWidth, aPxHeight);
return 0;
}
}
// Number
else{
- Standard_Integer Num = atoi(buf_ret);
+ Standard_Integer Num = Draw::Atoi(buf_ret);
if(Num>=0 && Num<=7)
ViewerTest::StandardModeActivation(Num);
}
if (argc == 8)
{
- Standard_Real R1 = atof(argv[1])/255.;
- Standard_Real G1 = atof(argv[2])/255.;
- Standard_Real B1 = atof(argv[3])/255.;
+ Standard_Real R1 = Draw::Atof(argv[1])/255.;
+ Standard_Real G1 = Draw::Atof(argv[2])/255.;
+ Standard_Real B1 = Draw::Atof(argv[3])/255.;
Quantity_Color aColor1(R1,G1,B1,Quantity_TOC_RGB);
- Standard_Real R2 = atof(argv[4])/255.;
- Standard_Real G2 = atof(argv[5])/255.;
- Standard_Real B2 = atof(argv[6])/255.;
+ Standard_Real R2 = Draw::Atof(argv[4])/255.;
+ Standard_Real G2 = Draw::Atof(argv[5])/255.;
+ Standard_Real B2 = Draw::Atof(argv[6])/255.;
Quantity_Color aColor2(R2,G2,B2,Quantity_TOC_RGB);
- int aType = atoi(argv[7]);
+ int aType = Draw::Atoi(argv[7]);
if( aType < 0 || aType > 8 )
{
di << "Wrong fill type " << "\n";
}
if (argc == 2)
{
- int aType = atoi(argv[1]);
+ int aType = Draw::Atoi(argv[1]);
if( aType < 0 || aType > 8 )
{
di << "Wrong fill type " << "\n";
if (argc == 4)
{
- Standard_Real R = atof(argv[1])/255.;
- Standard_Real G = atof(argv[2])/255.;
- Standard_Real B = atof(argv[3])/255.;
+ Standard_Real R = Draw::Atof(argv[1])/255.;
+ Standard_Real G = Draw::Atof(argv[2])/255.;
+ Standard_Real B = Draw::Atof(argv[3])/255.;
Quantity_Color aColor(R,G,B,Quantity_TOC_RGB);
Handle(V3d_View) V3dView = ViewerTest::CurrentView();
di << argv[0] << "Invalid number of arguments" << "\n";
return 1;
}
- V3dView->SetAxialScale( atof(argv[1]), atof(argv[2]), atof(argv[3]) );
+ V3dView->SetAxialScale( Draw::Atof(argv[1]), Draw::Atof(argv[2]), Draw::Atof(argv[3]) );
return 0;
}
//==============================================================================
return 1;
}
- Standard_Real R = atof(argv[2])/255.;
- Standard_Real G = atof(argv[3])/255.;
- Standard_Real B = atof(argv[4])/255.;
+ Standard_Real R = Draw::Atof(argv[2])/255.;
+ Standard_Real G = Draw::Atof(argv[3])/255.;
+ Standard_Real B = Draw::Atof(argv[4])/255.;
Quantity_Color aColor(R, G, B, Quantity_TOC_RGB);
- Standard_Real aScale = atof(argv[5]);
+ Standard_Real aScale = Draw::Atof(argv[5]);
if( aScale <= 0.0 )
{
}
if ( argc == 4 ) {
- V3dView->Rotate( atof(argv[1]), atof(argv[2]), atof(argv[3]) );
+ V3dView->Rotate( Draw::Atof(argv[1]), Draw::Atof(argv[2]), Draw::Atof(argv[3]) );
return 0;
} else if ( argc == 7 ) {
- V3dView->Rotate( atof(argv[1]), atof(argv[2]), atof(argv[3]), atof(argv[4]), atof(argv[5]), atof(argv[6]) );
+ V3dView->Rotate( Draw::Atof(argv[1]), Draw::Atof(argv[2]), Draw::Atof(argv[3]), Draw::Atof(argv[4]), Draw::Atof(argv[5]), Draw::Atof(argv[6]) );
return 0;
} else {
di << argv[0] << " Invalid number of arguments" << "\n";
}
if ( argc == 2 ) {
- Standard_Real coef = atof(argv[1]);
+ Standard_Real coef = Draw::Atof(argv[1]);
if ( coef <= 0.0 ) {
di << argv[1] << "Invalid value" << "\n";
return 1;
}
- V3dView->SetZoom( atof(argv[1]) );
+ V3dView->SetZoom( Draw::Atof(argv[1]) );
return 0;
} else {
di << argv[0] << " Invalid number of arguments" << "\n";
if ( V3dView.IsNull() ) return 1;
if ( argc == 3 ) {
- V3dView->Pan( atoi(argv[1]), atoi(argv[2]) );
+ V3dView->Pan( Draw::Atoi(argv[1]), Draw::Atoi(argv[2]) );
return 0;
} else {
di << argv[0] << " Invalid number of arguments" << "\n";
{
if( argc > 3 )
{
- minRange = atof( argv[1] );
- maxRange = atof( argv[2] );
- numIntervals = atoi( argv[3] );
+ minRange = Draw::Atof( argv[1] );
+ maxRange = Draw::Atof( argv[2] );
+ numIntervals = Draw::Atoi( argv[3] );
}
if ( argc > 4 )
- textHeight = atoi( argv[4] );
+ textHeight = Draw::Atoi( argv[4] );
if ( argc > 5 )
- position = (Aspect_TypeOfColorScalePosition)atoi( argv[5] );
+ position = (Aspect_TypeOfColorScalePosition)Draw::Atoi( argv[5] );
if ( argc > 7 )
{
- X = atof( argv[6] );
- Y = atof( argv[7] );
+ X = Draw::Atof( argv[6] );
+ Y = Draw::Atof( argv[7] );
}
}
Handle(V3d_View) curView = ViewerTest::CurrentView( );
}
// Erase (==0) or display (!=0)
- const int display = atoi(argv[1]);
+ const int display = Draw::Atoi(argv[1]);
if (display)
{
font.AssignCat(argv[5]);
// Text is multibyte
- const Standard_Boolean isMultibyte = (argc < 7)? Standard_False : (atoi(argv[6]) != 0);
+ const Standard_Boolean isMultibyte = (argc < 7)? Standard_False : (Draw::Atoi(argv[6]) != 0);
// Set axis names
TCollection_ExtendedString xname, yname, zname;
}
// get the input params
- Standard_Integer aWidth = atoi (argv[1]);
- Standard_Integer aHeight = atoi (argv[2]);
+ Standard_Integer aWidth = Draw::Atoi (argv[1]);
+ Standard_Integer aHeight = Draw::Atoi (argv[2]);
Standard_Integer aMode = 0;
TCollection_AsciiString aFileName = TCollection_AsciiString (argv[3]);
if (argc==5)
- aMode = atoi (argv[4]);
+ aMode = Draw::Atoi (argv[4]);
// check the input parameters
if (aWidth <= 0 || aHeight <= 0)
return 1;
}
- Standard_Integer aDelId = atoi (argv[2]);
+ Standard_Integer aDelId = Draw::Atoi (argv[2]);
if (!aViewer->RemoveZLayer (aDelId))
{
di << "Impossible to remove the z layer or invalid id!\n";
}
// get the input params
- Standard_Real X1 = atof(argv[1]);
- Standard_Real Y1 = atof(argv[2]);
- Standard_Real X2 = atof(argv[3]);
- Standard_Real Y2 = atof(argv[4]);
+ Standard_Real X1 = Draw::Atof(argv[1]);
+ Standard_Real Y1 = Draw::Atof(argv[2]);
+ Standard_Real X2 = Draw::Atof(argv[3]);
+ Standard_Real Y2 = Draw::Atof(argv[4]);
Standard_Real aWidth = 0.5;
Standard_Integer aType = 0;
// has width
if (argc > 5)
- aWidth = atof(argv[5]);
+ aWidth = Draw::Atof(argv[5]);
// has type
if (argc > 6)
- aType = (Standard_Integer) atoi(argv[6]);
+ aType = (Standard_Integer) Draw::Atoi(argv[6]);
// has transparency
if (argc > 7)
{
- aTransparency = atof(argv[7]);
+ aTransparency = Draw::Atof(argv[7]);
if (aTransparency < 0 || aTransparency > 1.0)
aTransparency = 1.0;
}
}
TCollection_AsciiString aText (argv[1]);
- Standard_Real aPosX = atof(argv[2]);
- Standard_Real aPosY = atof(argv[3]);
- Standard_Real aHeight = (argc >= 5) ? atof (argv[4]) : 10.0;
+ Standard_Real aPosX = Draw::Atof(argv[2]);
+ Standard_Real aPosY = Draw::Atof(argv[3]);
+ Standard_Real aHeight = (argc >= 5) ? Draw::Atof (argv[4]) : 10.0;
// font name
TCollection_AsciiString aFontName = "Courier";
Quantity_Parameter aColorBlue = 1.0;
if (argc >= 9)
{
- aColorRed = atof (argv[6])/255.;
- aColorGreen = atof (argv[7])/255.;
- aColorBlue = atof (argv[8])/255.;
+ aColorRed = Draw::Atof (argv[6])/255.;
+ aColorGreen = Draw::Atof (argv[7])/255.;
+ aColorBlue = Draw::Atof (argv[8])/255.;
}
// display type
Quantity_Parameter aSubBlue = 1.0;
if (argc == 13)
{
- aSubRed = atof (argv[10])/255.;
- aSubGreen = atof (argv[11])/255.;
- aSubBlue = atof (argv[12])/255.;
+ aSubRed = Draw::Atof (argv[10])/255.;
+ aSubGreen = Draw::Atof (argv[11])/255.;
+ aSubBlue = Draw::Atof (argv[12])/255.;
}
// check fo current overlay
Quantity_Length aRStepX, aRStepY;
aViewer->RectangularGridValues (anOriginX, anOriginY, aRStepX, aRStepY, aRotAngle);
- anOriginX = atof (theArgVec[anIter++]);
- anOriginY = atof (theArgVec[anIter++]);
+ anOriginX = Draw::Atof (theArgVec[anIter++]);
+ anOriginY = Draw::Atof (theArgVec[anIter++]);
if (aTail == 5)
{
- aRStepX = atof (theArgVec[anIter++]);
- aRStepY = atof (theArgVec[anIter++]);
- aRotAngle = atof (theArgVec[anIter++]);
+ aRStepX = Draw::Atof (theArgVec[anIter++]);
+ aRStepY = Draw::Atof (theArgVec[anIter++]);
+ aRotAngle = Draw::Atof (theArgVec[anIter++]);
}
aViewer->SetRectangularGridValues (anOriginX, anOriginY, aRStepX, aRStepY, aRotAngle);
aViewer->ActivateGrid (aType, aMode);
Standard_Integer aDivisionNumber;
aViewer->CircularGridValues (anOriginX, anOriginY, aRadiusStep, aDivisionNumber, aRotAngle);
- anOriginX = atof (theArgVec[anIter++]);
- anOriginY = atof (theArgVec[anIter++]);
+ anOriginX = Draw::Atof (theArgVec[anIter++]);
+ anOriginY = Draw::Atof (theArgVec[anIter++]);
if (aTail == 5)
{
- aRadiusStep = atof (theArgVec[anIter++]);
- aDivisionNumber = atoi (theArgVec[anIter++]);
- aRotAngle = atof (theArgVec[anIter++]);
+ aRadiusStep = Draw::Atof (theArgVec[anIter++]);
+ aDivisionNumber = Draw::Atoi (theArgVec[anIter++]);
+ aRotAngle = Draw::Atof (theArgVec[anIter++]);
}
aViewer->SetCircularGridValues (anOriginX, anOriginY, aRadiusStep, aDivisionNumber, aRotAngle);
return 1;
}
- Standard_Integer aFramesNb = (theArgNb > 1) ? atoi(theArgVec[1]) : 100;
+ Standard_Integer aFramesNb = (theArgNb > 1) ? Draw::Atoi(theArgVec[1]) : 100;
if (aFramesNb <= 0)
{
std::cerr << "Incorrect arguments!\n";
return 1;
}
- aDriver->EnableVBO (atoi(theArgVec[1]) != 0);
+ aDriver->EnableVBO (Draw::Atoi(theArgVec[1]) != 0);
return 0;
}
Standard_Integer aWidth, aHeight;
aView->Window()->Size (aWidth, aHeight);
- const Standard_Integer anX = atoi (theArgVec[1]);
- const Standard_Integer anY = atoi (theArgVec[2]);
+ const Standard_Integer anX = Draw::Atoi (theArgVec[1]);
+ const Standard_Integer anY = Draw::Atoi (theArgVec[2]);
if (anX < 0 || anX >= aWidth || anY < 0 || anY > aHeight)
{
std::cerr << "Pixel coordinates (" << anX << "; " << anY << ") are out of view (" << aWidth << " x " << aHeight << ")\n";
const char* anImgPathNew = theArgVec[2];
// get string tolerance and check its validity
- Standard_Real aTolColor = atof (theArgVec[3]);
+ Standard_Real aTolColor = Draw::Atof (theArgVec[3]);
if (aTolColor < 0.0)
aTolColor = 0.0;
if (aTolColor > 1.0)
aTolColor = 1.0;
- Standard_Boolean toBlackWhite = (atoi (theArgVec[4]) == 1);
- Standard_Boolean isBorderFilterOn = (atoi (theArgVec[5]) == 1);
+ Standard_Boolean toBlackWhite = (Draw::Atoi (theArgVec[4]) == 1);
+ Standard_Boolean isBorderFilterOn = (Draw::Atoi (theArgVec[5]) == 1);
// image file of difference
const char* aDiffImagePath = (theArgNb >= 7) ? theArgVec[6] : NULL;
fclose(f);
return Standard_False;
}
- x = atof(sx); y = atof(sy); z = atof(sz);
+ x = Atof(sx); y = Atof(sy); z = Atof(sz);
if (fscanf(f, "%s %s %s\n", sx, sy, sz) != 3)
{
fclose(f);
return Standard_False;
}
- xlen = atof(sx); ylen = atof(sy); zlen = atof(sz);
+ xlen = Atof(sx); ylen = Atof(sy); zlen = Atof(sz);
if (fscanf(f, "%d %d %d\n", &nbx, &nby, &nbz) != 3)
{
fclose(f);
fclose(f);
return Standard_False;
}
- x = atof(sx); y = atof(sy); z = atof(sz);
+ x = Atof(sx); y = Atof(sy); z = Atof(sz);
if (fscanf(f, "%s %s %s\n", sx, sy, sz) != 3)
{
fclose(f);
return Standard_False;
}
- xlen = atof(sx); ylen = atof(sy); zlen = atof(sz);
+ xlen = Atof(sx); ylen = Atof(sy); zlen = Atof(sz);
if (fscanf(f, "%d %d %d\n", &nbx, &nby, &nbz) != 3)
{
fclose(f);
fclose(f);
return Standard_False;
}
- x = atof(sx); y = atof(sy); z = atof(sz);
+ x = Atof(sx); y = Atof(sy); z = Atof(sz);
if (fscanf(f, "%s %s %s\n", sx, sy, sz) != 3)
{
fclose(f);
return Standard_False;
}
- xlen = atof(sx); ylen = atof(sy); zlen = atof(sz);
+ xlen = Atof(sx); ylen = Atof(sy); zlen = Atof(sz);
if (fscanf(f, "%d %d %d\n", &nbx, &nby, &nbz) != 3)
{
fclose(f);
return Standard_False;
}
}
- value = atof(line);
+ value = Atof(line);
// Set value
if (!((Standard_ShortReal**)((Voxel_DS*)myFloatVoxels)->myData)[i1])
if (OK (aStatus, Scene().WriteLine (thePrefix, header, GlobalIndent())))
{
char buf[128];
- sprintf (buf, "size %.12g %.12g %.12g", mySize.X(), mySize.Y(), mySize.Z());
+ Sprintf (buf, "size %.12g %.12g %.12g", mySize.X(), mySize.Y(), mySize.Z());
Scene().WriteLine (buf);
aStatus = WriteClosing();
}
{
char buf[128];
if ((myBottomRadius - 1.)*(myBottomRadius - 1.) > Precision::Confusion()) {
- sprintf (buf, "bottomRadius %.12g", myBottomRadius);
+ Sprintf (buf, "bottomRadius %.12g", myBottomRadius);
aStatus = Scene().WriteLine (buf);
}
if (OK(aStatus) &&
(myHeight - 2.)*(myHeight - 2.) > Precision::Confusion()) {
- sprintf (buf, "height %.12g", myHeight);
+ Sprintf (buf, "height %.12g", myHeight);
aStatus = Scene().WriteLine (buf);
}
if (OK(aStatus) && myHasBottom == Standard_False)
{
char buf[128];
if ((myRadius - 1.)*(myRadius - 1.) > Precision::Confusion()) {
- sprintf (buf, "radius %.12g", myRadius);
+ Sprintf (buf, "radius %.12g", myRadius);
aStatus = Scene().WriteLine (buf);
}
if (OK(aStatus) &&
(myHeight - 2.)*(myHeight - 2.) > Precision::Confusion()) {
- sprintf (buf, "height %.12g", myHeight);
+ Sprintf (buf, "height %.12g", myHeight);
aStatus = Scene().WriteLine (buf);
}
if (OK(aStatus) && myHasBottom == Standard_False)
if (OK (aStatus, Scene().WriteLine (thePrefix, header, GlobalIndent())))
{
char buf[128];
- sprintf (buf, "radius %.12g", myRadius);
+ Sprintf (buf, "radius %.12g", myRadius);
Scene().WriteLine (buf);
aStatus = WriteClosing();
}
};
// Check that the box is not void
if (aBoxCorner[0].X() < aBoxCorner[1].X() + Precision::Confusion()) {
- sprintf (buf, "bboxCenter %.9g %.9g %.9g",
+ Sprintf (buf, "bboxCenter %.9g %.9g %.9g",
0.5 * (aBoxCorner[0].X() + aBoxCorner[1].X()),
0.5 * (aBoxCorner[0].Y() + aBoxCorner[1].Y()),
0.5 * (aBoxCorner[0].Z() + aBoxCorner[1].Z()));
aStatus = aScene.WriteLine (buf);
if (OK(aStatus)) {
- sprintf (buf, "bboxSize %.9g %.9g %.9g",
+ Sprintf (buf, "bboxSize %.9g %.9g %.9g",
aBoxCorner[1].X() - aBoxCorner[0].X(),
aBoxCorner[1].Y() - aBoxCorner[0].Y(),
aBoxCorner[1].Z() - aBoxCorner[0].Z());
if ((aScaleFactor - 1.)*(aScaleFactor - 1.) >
0.0001*Precision::Confusion())
{
- sprintf (buf, "scale %.12g %.12g %.12g",
+ Sprintf (buf, "scale %.12g %.12g %.12g",
aScaleFactor, aScaleFactor, aScaleFactor);
aStatus = aScene.WriteLine (buf);
}
// Output the Translation
const gp_XYZ& aTrans = myTrsf.TranslationPart();
if (aTrans.SquareModulus() > 0.0001*Precision::Confusion()) {
- sprintf (buf, "translation %.12g %.12g %.12g",
+ Sprintf (buf, "translation %.12g %.12g %.12g",
aTrans.X(), aTrans.Y(), aTrans.Z());
aStatus = aScene.WriteLine (buf);
}
Standard_Real anAngle;
if (myTrsf.GetRotation (anAxis, anAngle)) {
// output the Rotation
- sprintf (buf, "rotation %.12g %.12g %.12g %.9g",
+ Sprintf (buf, "rotation %.12g %.12g %.12g %.9g",
anAxis.X(), anAxis.Y(), anAxis.Z(), anAngle);
aStatus = aScene.WriteLine (buf);
}
aStatus = aScene.WriteLine ("convex FALSE");
if (OK(aStatus) && CreaseAngle() > Precision::Confusion()) {
char buf[64];
- sprintf (buf, "%.9g", CreaseAngle());
+ Sprintf (buf, "%.9g", CreaseAngle());
aStatus = aScene.WriteLine ("creaseAngle", buf);
}
const Standard_Real aConf (0.001 * Precision::Confusion());
if (OK(aStatus) && fabs(myAmbientIntensity - 0.2) > aConf) {
- sprintf (buf, "%.6g", myAmbientIntensity);
+ Sprintf (buf, "%.6g", myAmbientIntensity);
aStatus = aScene.WriteLine ("ambientIntensity ", buf);
}
if (OK(aStatus)) {
(val[1] - 0.8) * (val[1] - 0.8) +
(val[2] - 0.8) * (val[2] - 0.8) > 1e-7)
{
- sprintf (buf, "%.6g %.6g %.6g", val[0], val[1], val[2]);
+ Sprintf (buf, "%.6g %.6g %.6g", val[0], val[1], val[2]);
aStatus = aScene.WriteLine ("diffuseColor ", buf);
}
}
if (OK(aStatus)) {
myEmissiveColor.Values (val[0], val[1], val[2], bidType);
if (val[0] * val[0] + val[1] * val[1] + val[2] * val[2] > 1e-7) {
- sprintf (buf, "%.6g %.6g %.6g", val[0], val[1], val[2]);
+ Sprintf (buf, "%.6g %.6g %.6g", val[0], val[1], val[2]);
aStatus = aScene.WriteLine ("emissiveColor ", buf);
}
}
if (OK(aStatus) && fabs(myShininess - 0.2) > aConf) {
- sprintf (buf, "%.6g", myShininess);
+ Sprintf (buf, "%.6g", myShininess);
aStatus = aScene.WriteLine ("shininess ", buf);
}
if (OK(aStatus)) {
mySpecularColor.Values (val[0], val[1], val[2], bidType);
if (val[0] * val[0] + val[1] * val[1] + val[2] * val[2] > 1e-7) {
- sprintf (buf, "%.6g %.6g %.6g", val[0], val[1], val[2]);
+ Sprintf (buf, "%.6g %.6g %.6g", val[0], val[1], val[2]);
aStatus = aScene.WriteLine ("specularColor ", buf);
}
}
if (OK(aStatus) && myTransparency > aConf) {
- sprintf (buf, "%.6g", myTransparency);
+ Sprintf (buf, "%.6g", myTransparency);
aStatus = aScene.WriteLine ("transparency ", buf);
}
VrmlData_ErrorStatus aStatus;
if (VrmlData_Node::OK(aStatus, VrmlData_Scene::ReadLine(theBuffer))) {
char * endptr;
- aResult = strtod (theBuffer.LinePtr, &endptr);
+ aResult = Strtod (theBuffer.LinePtr, &endptr);
if (endptr == theBuffer.LinePtr)
aStatus = VrmlData_NumericInputError;
else if (isOnlyPositive && aResult < 0.001*Precision::Confusion())
if (!VrmlData_Node::OK(aStatus, VrmlData_Scene::ReadLine(theBuffer)))
break;
char * endptr;
- aVal[i] = strtod (theBuffer.LinePtr, &endptr);
+ aVal[i] = Strtod (theBuffer.LinePtr, &endptr);
if (endptr == theBuffer.LinePtr) {
aStatus = VrmlData_NumericInputError;
break;
if (!VrmlData_Node::OK(aStatus, VrmlData_Scene::ReadLine(theBuffer)))
break;
char * endptr;
- aVal[i] = strtod (theBuffer.LinePtr, &endptr);
+ aVal[i] = Strtod (theBuffer.LinePtr, &endptr);
if (endptr == theBuffer.LinePtr) {
aStatus = VrmlData_NumericInputError;
break;
const Standard_Integer * arrVal = theArrIndex[iBlock]+1;
switch (nVal) {
case 1:
- sprintf (buf, "%d,", arrVal[0]);
+ Sprintf (buf, "%d,", arrVal[0]);
break;
case 2:
- sprintf (buf, "%d,%d,", arrVal[0], arrVal[1]);
+ Sprintf (buf, "%d,%d,", arrVal[0], arrVal[1]);
break;
case 3:
- sprintf (buf, "%d,%d,%d,", arrVal[0], arrVal[1], arrVal[2]);
+ Sprintf (buf, "%d,%d,%d,", arrVal[0], arrVal[1], arrVal[2]);
break;
case 4:
- sprintf (buf, "%d,%d,%d,%d,",
+ Sprintf (buf, "%d,%d,%d,%d,",
arrVal[0], arrVal[1], arrVal[2], arrVal[3]);
break;
default:
if (nVal > 0) {
char * ptr = &buf[0];
for (Standard_Integer i = 0; i < nVal; i++) {
- sprintf (ptr, "%d,", arrVal[i]);
+ Sprintf (ptr, "%d,", arrVal[i]);
ptr = strchr (ptr, ',') + 1;
if ((ptr - &buf[0]) > (ptrdiff_t)aLineLimit) {
WriteLine(buf);
char buf[240];
if (IsDummyWrite() == Standard_False)
if (isApplyScale && myLinearScale > Precision::Confusion())
- sprintf (buf, "%.12g %.12g %.12g%s", theXYZ.X() / myLinearScale,
+ Sprintf (buf, "%.12g %.12g %.12g%s", theXYZ.X() / myLinearScale,
theXYZ.Y() / myLinearScale, theXYZ.Z() / myLinearScale,
thePostfix ? thePostfix : "");
else
- sprintf (buf, "%.12g %.12g %.12g%s", theXYZ.X(), theXYZ.Y(), theXYZ.Z(),
+ Sprintf (buf, "%.12g %.12g %.12g%s", theXYZ.X(), theXYZ.Y(), theXYZ.Z(),
thePostfix ? thePostfix : "");
return WriteLine (buf);
}
Handle(VrmlData_UnknownNode) bidNode = new VrmlData_UnknownNode;
char buf[32];
do {
- sprintf (buf, "_%d",
+ Sprintf (buf, "_%d",
++const_cast<Standard_Integer&>(myAutoNameCounter));
bidNode->myName = &buf[0];
} while (myNamedNodes.Contains (bidNode));
const Handle(VrmlData_Group) aGroup =
Handle(VrmlData_Group)::DownCast (theNode);
char buf[64];
- sprintf (buf, "Group (%s)",
+ Sprintf (buf, "Group (%s)",
aGroup->IsTransform() ? "Transform" : "Group");
dumpNodeHeader (theStream, theIndent, buf, theNode->Name());
if (theIndent.IsEmpty() == Standard_False) {
const Standard_Size nCoord = aNode->Coordinates()->Length();
const Standard_Size nPoly = aNode->Polygons (ppDummy);
char buf[64];
- sprintf (buf, "IndexedFaceSet (%d vertices, %d polygons)", nCoord, nPoly);
+ Sprintf (buf, "IndexedFaceSet (%d vertices, %d polygons)", nCoord, nPoly);
dumpNodeHeader (theStream, theIndent, buf, theNode->Name());
} else if (theNode->IsKind(STANDARD_TYPE(VrmlData_IndexedLineSet))) {
const Handle(VrmlData_IndexedLineSet) aNode =
const Standard_Size nCoord = aNode->Coordinates()->Length();
const Standard_Size nPoly = aNode->Polygons (ppDummy);
char buf[64];
- sprintf (buf, "IndexedLineSet (%d vertices, %d polygons)", nCoord, nPoly);
+ Sprintf (buf, "IndexedLineSet (%d vertices, %d polygons)", nCoord, nPoly);
dumpNodeHeader (theStream, theIndent, buf, theNode->Name());
} else if (theNode->IsKind(STANDARD_TYPE(VrmlData_Material))) {
// const Handle(VrmlData_Material) aMaterial =
const Handle(VrmlData_UnknownNode) anUnknown =
Handle(VrmlData_UnknownNode)::DownCast (theNode);
char buf[64];
- sprintf (buf, "Unknown (%s)", anUnknown->GetTitle().ToCString());
+ Sprintf (buf, "Unknown (%s)", anUnknown->GetTitle().ToCString());
dumpNodeHeader (theStream, theIndent, buf, theNode->Name());
}
}
{
char buf[4096];
if (myTitle) {
- sprintf (buf, "title \"%s\"", myTitle);
+ Sprintf (buf, "title \"%s\"", myTitle);
aStatus = aScene.WriteLine (buf);
}
if (OK (aStatus, aScene.WriteLine ("info [", 0L, GlobalIndent()))) {
NCollection_List<const char *>::Iterator anIter (myInfo);
while (anIter.More()) {
- sprintf (buf, "\"%s\"", anIter.Value());
+ Sprintf (buf, "\"%s\"", anIter.Value());
anIter.Next();
if (anIter.More())
aStatus = aScene.WriteLine (buf, ",");
if ( GetEnvironmentVariable ( "CSF_GammaValue", buff, 32 ) ) {
- gamma = atof ( buff );
+ gamma = Atof ( buff );
if ( gamma == 0.0 )
Handle(XCAFDoc_ShapeTool) myAssembly = XCAFDoc_DocumentTool::ShapeTool(Doc->Main());
Standard_Boolean deep = Standard_False;
- if ( (argc==3) && (atoi(argv[2])==1) ) deep = Standard_True;
+ if ( (argc==3) && (Draw::Atoi(argv[2])==1) ) deep = Standard_True;
myAssembly->Dump(deep);
return 0;
}
// init viewer
// char string[260];
-// sprintf ( string, "AISInitViewer %s", argv[1] );
+// Sprintf ( string, "AISInitViewer %s", argv[1] );
// di.Eval ( string );
TDF_Label acces = Doc->GetData()->Root();
Handle(TPrsStd_AISViewer) viewer;
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();
Handle(XCAFDoc_Color) val = Handle(XCAFDoc_Color)::DownCast ( att );
Quantity_Color C = val->GetColor();
char string[260];
- sprintf ( string, "%s (%g, %g, %g)", C.StringName ( C.Name() ),
+ Sprintf ( string, "%s (%g, %g, %g)", C.StringName ( C.Name() ),
C.Red(), C.Green(), C.Blue() );
di << string;
}
return 1;
}
Standard_Boolean mode = Standard_False;
- if (atoi(argv[1]) == 1) mode = Standard_True;
+ if (Draw::Atoi(argv[1]) == 1) mode = Standard_True;
XCAFPrs::SetViewNameMode(mode);
return 0;
}
DDocStd::GetDocument(argv[1], Doc);
if ( Doc.IsNull() ) { di << argv[1] << " is not a document" << "\n"; return 1; }
- const Standard_Real aTransparency = atof(argv[2]);
+ const Standard_Real aTransparency = Draw::Atof(argv[2]);
// collect sequence of labels
Handle(XCAFDoc_ShapeTool) shapes = XCAFDoc_DocumentTool::ShapeTool(Doc->Main());
Aspect_TypeOfLine aLineType = Aspect_TOL_SOLID;
// turn boundaries on/off
- Standard_Boolean isBoundaryDraw = (atoi (argv[3]) == 1);
+ Standard_Boolean isBoundaryDraw = (Draw::Atoi (argv[3]) == 1);
aDrawer->SetFaceBoundaryDraw (isBoundaryDraw);
// set boundary color
if (argc >= 7)
{
// Text color
- aRed = atof (argv[4])/255.;
- aGreen = atof (argv[5])/255.;
- aBlue = atof (argv[6])/255.;
+ aRed = Draw::Atof (argv[4])/255.;
+ aGreen = Draw::Atof (argv[5])/255.;
+ aBlue = Draw::Atof (argv[6])/255.;
}
// set line width
if (argc >= 8)
{
- aWidth = (Standard_Real)atof (argv[7]);
+ aWidth = (Standard_Real)Draw::Atof (argv[7]);
}
// select appropriate line type
if (argc == 9)
{
- switch (atoi (argv[8]))
+ switch (Draw::Atoi (argv[8]))
{
case 1: aLineType = Aspect_TOL_DASH; break;
case 2: aLineType = Aspect_TOL_DOT; break;
// purpose or non-infringement. Please see the License for the specific terms
// and conditions governing the rights and limitations under the License.
-
#include <XDEDRAW_Colors.ixx>
+#include <Draw.hxx>
#include <DBRep.hxx>
#include <DDocStd.hxx>
TDF_Label aLabel;
TDF_Tool::Label(Doc->GetData(), argv[2], aLabel);
- Quantity_Color Col ( atof(argv[3]), atof(argv[4]), atof(argv[5]), Quantity_TOC_RGB );
+ Quantity_Color Col ( Draw::Atof(argv[3]), Draw::Atof(argv[4]), Draw::Atof(argv[5]), Quantity_TOC_RGB );
Handle(XCAFDoc_ColorTool) myColors = XCAFDoc_DocumentTool::ColorTool(Doc->Main());
XCAFDoc_ColorType ctype = ( argc <=6 ? XCAFDoc_ColorGen :
TDF_Label aLabel;
Handle(XCAFDoc_ColorTool) myColors = XCAFDoc_DocumentTool::ColorTool(Doc->Main());
- Quantity_Color Col ( atof(argv[2]), atof(argv[3]), atof(argv[4]), Quantity_TOC_RGB );
+ Quantity_Color Col ( Draw::Atof(argv[2]), Draw::Atof(argv[3]), Draw::Atof(argv[4]), Quantity_TOC_RGB );
aLabel = myColors->AddColor(Col);
TCollection_AsciiString Entry;
Handle(XCAFDoc_ColorTool) myColors = XCAFDoc_DocumentTool::ColorTool(Doc->Main());
- Quantity_Color Col ( atof(argv[2]), atof(argv[3]), atof(argv[4]), Quantity_TOC_RGB );
+ Quantity_Color Col ( Draw::Atof(argv[2]), Draw::Atof(argv[3]), Draw::Atof(argv[4]), Quantity_TOC_RGB );
TCollection_AsciiString Entry;
TDF_Tool::Entry(myColors->FindColor(Col), Entry);
if ( Doc.IsNull() ) { di << argv[1] << " is not a document" << "\n"; return 1; }
Handle(XCAFDoc_ColorTool) localTool = XCAFDoc_DocumentTool::ColorTool(Doc->Main());
Standard_Boolean isvisible = Standard_False;
- if ( (argc==4) && (atoi(argv[3])==1) ) isvisible = Standard_True;
+ if ( (argc==4) && (Draw::Atoi(argv[3])==1) ) isvisible = Standard_True;
TDF_Label aLabel;
TDF_Tool::Label(Doc->GetData(), argv[2], aLabel);
TopoDS_Shape aShape;
aShape = DBRep::Get(argv[2]);
- Quantity_Color col ( atof(argv[3]), atof(argv[4]), atof(argv[5]), Quantity_TOC_RGB );
+ Quantity_Color col ( Draw::Atof(argv[3]), Draw::Atof(argv[4]), Draw::Atof(argv[5]), Quantity_TOC_RGB );
XCAFDoc_ColorType type;
if ( argv[6] && argv[6][0] == 's' )
type = XCAFDoc_ColorSurf;
}
char command[256];
- sprintf ( command, "fromshape %.200s -1", argv[1] );
+ Sprintf ( command, "fromshape %.200s -1", argv[1] );
Handle(Dico_DictionaryOfTransient) DictWS = thedictws;
if ( DictWS->IsEmpty() ) return di.Eval ( command );
#include <XDEDRAW_Layers.ixx>
+#include <Draw.hxx>
#include <DBRep.hxx>
#include <DDocStd.hxx>
return 1;
}
Standard_Boolean shapeInOneLayer = Standard_False;
- if ( (argc==5) && (atoi(argv[4])==1) ) shapeInOneLayer = Standard_True;
+ if ( (argc==5) && (Draw::Atoi(argv[4])==1) ) shapeInOneLayer = Standard_True;
Handle(TDocStd_Document) Doc;
DDocStd::GetDocument(argv[1], Doc);
if ( Doc.IsNull() ) { di << argv[1] << " is not a document" << "\n"; return 1; }
return 1;
}
Standard_Boolean shapeInOneLayer = Standard_False;
- if ( (argc==5) && (atoi(argv[4])==1) ) shapeInOneLayer = Standard_True;
+ if ( (argc==5) && (Draw::Atoi(argv[4])==1) ) shapeInOneLayer = Standard_True;
Handle(TDocStd_Document) Doc;
DDocStd::GetDocument(argv[1], Doc);
if ( Doc.IsNull() ) { di << argv[1] << " is not a document" << "\n"; return 1; }
if ( Doc.IsNull() ) { di << argv[1] << " is not a document" << "\n"; return 1; }
Handle(XCAFDoc_LayerTool) localLayerTool = XCAFDoc_DocumentTool::LayerTool(Doc->Main());
Standard_Boolean isvisible = Standard_False;
- if ( (argc==4) && (atoi(argv[3])==1) ) isvisible = Standard_True;
+ if ( (argc==4) && (Draw::Atoi(argv[3])==1) ) isvisible = Standard_True;
TDF_Label aLabel;
TDF_Tool::Label(Doc->GetData(), argv[2], aLabel);
#include <XDEDRAW_Props.ixx>
+#include <Draw.hxx>
#include <DBRep.hxx>
#include <DDocStd.hxx>
// retrieve epsilon
Standard_Real anEps;
- if(argc > 3 ) anEps = atof(argv[3]);
+ if(argc > 3 ) anEps = Draw::Atof(argv[3]);
else anEps = 0.001;
GProp_GProps G;
}
}
if ( !aLabel.IsNull() ) {
- res = atof(argv[3]);
+ res = Draw::Atof(argv[3]);
Handle(XCAFDoc_Volume) aVolume = new XCAFDoc_Volume;
if (!aLabel.FindAttribute (XCAFDoc_Volume::GetID(), aVolume)) aLabel.AddAttribute(aVolume);
aVolume->Set(res);
}
}
if ( !aLabel.IsNull() ) {
- res = atof(argv[3]);
+ res = Draw::Atof(argv[3]);
Handle(XCAFDoc_Area) aArea = new XCAFDoc_Area;
if (!aLabel.FindAttribute (XCAFDoc_Area::GetID(), aArea)) aLabel.AddAttribute(aArea);
aArea->Set(res);
}
}
if ( !aLabel.IsNull() ) {
- aPoint.SetX(atof(argv[3]));
- aPoint.SetY(atof(argv[4]));
- aPoint.SetZ(atof(argv[5]));
+ aPoint.SetX(Draw::Atof(argv[3]));
+ aPoint.SetY(Draw::Atof(argv[4]));
+ aPoint.SetZ(Draw::Atof(argv[5]));
Handle(XCAFDoc_Centroid) aCentroid = new XCAFDoc_Centroid;
if (!aLabel.FindAttribute (XCAFDoc_Centroid::GetID(), aCentroid)) aLabel.AddAttribute(aCentroid);
aCentroid->Set(aPoint);
- di << atof(argv[3])<<" "<<atof(argv[4])<<" "<<atof(argv[5]);
+ di << Draw::Atof(argv[3])<<" "<<Draw::Atof(argv[4])<<" "<<Draw::Atof(argv[5]);
}
return 0;
}
DDocStd::GetDocument(argv[1], Doc);
if ( Doc.IsNull() ) { di << argv[1] << " is not a document" << "\n"; return 1; }
Standard_Boolean withVolFix = Standard_False;
- if ( argc >2 && atof(argv[2]) != 0 ) withVolFix = Standard_True;
+ if ( argc >2 && Draw::Atof(argv[2]) != 0 ) withVolFix = Standard_True;
Standard_Boolean wholeDoc = ( argc <4 );
TDF_LabelSequence seq;
if ( ! wholeDoc ) {
//printf ( "%s%-12.12s", ( wholeDoc ? "" : "Label " ), str.ToCString() );
//fflush ( stdout );
char string1[260];
- sprintf (string1, "%s%-12.12s", ( wholeDoc ? "" : "Label " ), str.ToCString() );
+ Sprintf (string1, "%s%-12.12s", ( wholeDoc ? "" : "Label " ), str.ToCString() );
di << string1;
Handle(TDataStd_Name) N;
if ( aLabel.FindAttribute ( TDataStd_Name::GetID(), N ) && ! wholeDoc ) {
// (Standard_Integer)( Abs ( G.Mass() ) > 1e-10 ? 100. * ( aArea->Get() - G.Mass() ) / G.Mass() : 999. ),
// ( wholeDoc ? "" : "\n" ));
char string2[260];
- sprintf (string2, "%s%9.1f (%3d%%)%s", ( wholeDoc ? "" : " Area defect: " ),
+ Sprintf (string2, "%s%9.1f (%3d%%)%s", ( wholeDoc ? "" : " Area defect: " ),
aArea->Get() - G.Mass(),
(Standard_Integer)( Abs ( G.Mass() ) > 1e-10 ? 100. * ( aArea->Get() - G.Mass() ) / G.Mass() : 999. ),
( wholeDoc ? "" : "\n" ));
catch (Standard_Failure) {
//printf ( "%-16.16s", "exception" );
char string3[260];
- sprintf (string3, "%-16.16s", "exception" );
+ Sprintf (string3, "%-16.16s", "exception" );
di << string3;
}
}
else if ( wholeDoc ) {
//printf ( "%16.16s", "" );
char string4[260];
- sprintf (string4, "%16.16s", "" );
+ Sprintf (string4, "%16.16s", "" );
di << string4;
}
Standard_Real localVolume;
gp_Pnt pcg(0,0,0);
if ( withVolFix ) {
- Standard_Real tol = atof(argv[2]);
+ Standard_Real tol = Draw::Atof(argv[2]);
Standard_Boolean withForce = Standard_False;
if ( tol < 0 ) {
withForce = Standard_True;
// (Standard_Integer)( Abs ( localVolume ) > 1e-10 ? 100. * ( aVolume->Get() - localVolume ) / localVolume : 999. ),
// ( wholeDoc ? "" : "\n" ));
char string5[260];
- sprintf (string5, "%s%9.1f (%3d%%)%s", ( wholeDoc ? "" : " Volume defect: " ),
+ Sprintf (string5, "%s%9.1f (%3d%%)%s", ( wholeDoc ? "" : " Volume defect: " ),
aVolume->Get() - localVolume,
(Standard_Integer)( Abs ( localVolume ) > 1e-10 ? 100. * ( aVolume->Get() - localVolume ) / localVolume : 999. ),
( wholeDoc ? "" : "\n" ));
else if ( wholeDoc ) {
//printf ( "%16.16s", "" );
char string6[260];
- sprintf (string6, "%16.16s", "" );
+ Sprintf (string6, "%16.16s", "" );
di << string6;
}
if ( wholeDoc ) {
//printf ( " %7.2f %7.2f %7.2f",
// p.X() - pcg.X(), p.Y() - pcg.Y(), p.Z() - pcg.Z() );
- sprintf (string7, " %7.2f %7.2f %7.2f",
+ Sprintf (string7, " %7.2f %7.2f %7.2f",
p.X() - pcg.X(), p.Y() - pcg.Y(), p.Z() - pcg.Z() );
} else {
//printf ( " CG defect: dX=%.3f, dY=%.3f, dZ=%.3f\n",
// p.X() - pcg.X(), p.Y() - pcg.Y(), p.Z() - pcg.Z() );
- sprintf (string7, " CG defect: dX=%.3f, dY=%.3f, dZ=%.3f\n",
+ Sprintf (string7, " CG defect: dX=%.3f, dY=%.3f, dZ=%.3f\n",
p.X() - pcg.X(), p.Y() - pcg.Y(), p.Z() - pcg.Z() );
}
di << string7;
else if ( wholeDoc ) {
//printf ( "%24.24s", "" );
char string8[260];
- sprintf (string8, "%24.24s", "" );
+ Sprintf (string8, "%24.24s", "" );
di << string8;
}
}
catch (Standard_Failure) {
//printf ( "%40.40s", "exception" );
char string9[260];
- sprintf (string9, "%40.40s", "exception" );
+ Sprintf (string9, "%40.40s", "exception" );
di << string9;
#ifdef DEB
//fflush ( stdout );
else if ( wholeDoc ) {
//printf ( "%40.40s", "" );
char string10[260];
- sprintf (string10, "%40.40s", "" );
+ Sprintf (string10, "%40.40s", "" );
di << string10;
}
//fflush ( stdout );
if (aShape.IsNull()) return 1;
gp_Pnt aPoint(0,0,0);
Standard_Real localVolume;
- Standard_Real tol = atof(argv[2]);
+ Standard_Real tol = Draw::Atof(argv[2]);
Standard_Boolean withForce = Standard_False;
if ( tol < 0 ) {
withForce = Standard_True;
DDocStd::GetDocument(argv[1], Doc);
Standard_Real atol = Precision::Confusion();
if(argc >2)
- atol = atof(argv[2]);
+ atol = Draw::Atof(argv[2]);
if ( Doc.IsNull() ) { di << argv[1] << " is not a document" << "\n"; return 1; }
Standard_Boolean wholeDoc = ( argc <4 );
TDF_LabelSequence seq;
Handle(XCAFDoc_MaterialTool) MatTool = XCAFDoc_DocumentTool::MaterialTool(Doc->Main());
MatTool->SetMaterial(aLabel, new TCollection_HAsciiString(argv[3]),
- new TCollection_HAsciiString(""), atof(argv[4]),
+ new TCollection_HAsciiString(""), Draw::Atof(argv[4]),
new TCollection_HAsciiString("density measure"),
new TCollection_HAsciiString("POSITIVE_RATIO_MEASURE"));
#include <XDEDRAW_Shapes.ixx>
+#include <Draw.hxx>
#include <DBRep.hxx>
#include <DDocStd.hxx>
aShape = DBRep::Get(argv[2]);
Handle(XCAFDoc_ShapeTool) myAssembly = XCAFDoc_DocumentTool::ShapeTool(Doc->Main());
Standard_Boolean makeAssembly = Standard_True;
- if ( argc==4 && atoi(argv[3]) == 0 ) makeAssembly = Standard_False;
+ if ( argc==4 && Draw::Atoi(argv[3]) == 0 ) makeAssembly = Standard_False;
TDF_Label aLabel;
aLabel = myAssembly->AddShape(aShape, makeAssembly);
if (aLabel.IsNull()) di<<"Null Label"<<"\n";
// myAssembly.Init(Doc);
Handle(XCAFDoc_ShapeTool) myAssembly = XCAFDoc_DocumentTool::ShapeTool(Doc->Main());
Standard_Boolean removeCompletely = Standard_True;
- if ( argc == 4 && atoi(argv[3]) == 0 )
+ if ( argc == 4 && Draw::Atoi(argv[3]) == 0 )
removeCompletely = Standard_False;
myAssembly->RemoveShape(aLabel, removeCompletely);
return 1;
}
Standard_Boolean getsubchilds = Standard_False;
- if ( (argc==4) && ( atoi(argv[3])==1 ) ) getsubchilds = Standard_True;
+ if ( (argc==4) && ( Draw::Atoi(argv[3])==1 ) ) getsubchilds = Standard_True;
Handle(TDocStd_Document) Doc;
DDocStd::GetDocument(argv[1], Doc);
return 1;
}
Standard_Boolean getsubchilds = Standard_False;
- if ( (argc==4) && ( atoi(argv[3])==1 ) ) getsubchilds = Standard_True;
+ if ( (argc==4) && ( Draw::Atoi(argv[3])==1 ) ) getsubchilds = Standard_True;
Handle(TDocStd_Document) Doc;
DDocStd::GetDocument(argv[1], Doc);
if ( Doc.IsNull() ) { di << argv[1] << " is not a document" << "\n"; return 1; }
for ( Standard_Integer i = 1; i<= Labels.Length(); i++) {
TopoDS_Shape S = STool->GetShape ( Labels.Value(i) );
char string[260];
- sprintf ( string, "%s_%d", argv[2], i );
+ Sprintf ( string, "%s_%d", argv[2], i );
DBRep::Set ( string, S );
di << string << " ";
}
if (theolds->HasItem(com.ToCString())) num = theolds->Item(com.ToCString());
if (num == 0) continue;
if (!IFSelect_Activator::Select(com.ToCString(),nact,act))
- sprintf (help,"type : xhelp %s for help",com.ToCString());
+ Sprintf (help,"type : xhelp %s for help",com.ToCString());
else if (!act.IsNull()) strcpy(help,act->Help(nact));
if (num < 0) theCommands.Add (com.ToCString(),help,XSTEPDRAWRUN,act->Group());
else theCommands.Add (thenews->Value(num).ToCString(),help,XSTEPDRAWRUN,act->Group());
(const Standard_CString command, const Standard_CString varname)
{
char mess[100];
- sprintf (mess,command,varname);
+ Sprintf (mess,command,varname);
#ifdef DEB
IFSelect_ReturnStatus stat =
#endif
// amv 26.09.2003 : this is used to avoid error of enter's simbol
char str[80];
cin>>str;
- modepri = atoi(str);
+ modepri = Draw::Atoi(str);
}
if (modepri == 0) { //fin
//amv 26.09.2003
char str_a[80];
cin >> str_a;
- answer = atoi(str_a);
+ answer = Draw::Atoi(str_a);
}
if ( answer == 0) continue;
if ( answer == 1 || answer == 3) {
// save the shape
if (shape.IsNull()) { di<<"No Shape produced"<<"\n"; continue; }
char fname[110];
- sprintf(fname, "%s", rnom.ToCString());
+ Sprintf(fname, "%s", rnom.ToCString());
di << "Saving shape in variable Draw : " << fname << "\n";
if (answer == 3) IGESToBRep::WriteShape (shape,1);
try {
TopoDS_Shape shape = Reader.Shape(inum);
if (shape.IsNull()) { di<<"No Shape produced"<<"\n"; continue; }
char fname[110];
- sprintf(fname, "%s_%d", rnom.ToCString(),inum);
+ Sprintf(fname, "%s_%d", rnom.ToCString(),inum);
di << "Saving shape in variable Draw : " << fname << "\n";
if (answer == 4) IGESToBRep::WriteShape (shape,inum);
try {
if (!Reader.TransferOne (nent)) di<<"Transfer entity n0 "<<nent<<" : no result"<<"\n";
else {
nbs = Reader.NbShapes();
- char shname[30]; sprintf (shname,"%s_%d",rnom.ToCString(),nent);
+ char shname[30]; Sprintf (shname,"%s_%d",rnom.ToCString(),nent);
di<<"Transfer entity n0 "<<nent<<" OK -> DRAW Shape: "<<shname<<"\n";
di<<"Now, "<<nbs<<" Shapes produced"<<"\n";
TopoDS_Shape sh = Reader.Shape(nbs);
TopoDS_Shape shape = Reader.OneShape();
// save the shape
char fname[110];
- sprintf(fname, "%s", rnom.ToCString());
+ Sprintf(fname, "%s", rnom.ToCString());
di << "Saving shape in variable Draw : " << fname << "\n";
try {
OCC_CATCH_SIGNALS
// anv 26.09.2003
char str_answer[80];
cin>>str_answer;
- answer = atoi(str_answer);
+ answer = Draw::Atoi(str_answer);
}
if (answer <= 0 || answer > 3) continue;
if (answer == 3) {
if (!Reader.TransferOne(nent)) di<<"Transfer entity n0 "<<nent<<" : no result"<<"\n";
else {
nbs = Reader.NbShapes();
- char shname[30]; sprintf (shname,"%s_%d",rnom.ToCString(),nbs);
+ char shname[30]; Sprintf (shname,"%s_%d",rnom.ToCString(),nbs);
di<<"Transfer entity n0 "<<nent<<" OK -> DRAW Shape: "<<shname<<"\n";
di<<"Now, "<<nbs<<" Shapes produced"<<"\n";
TopoDS_Shape sh = Reader.Shape(nbs);
if (!sr.TransferRoot (num)) di<<"Transfer root n0 "<<num<<" : no result"<<"\n";
else {
nbs = sr.NbShapes();
- char shname[30]; sprintf (shname,"%s_%d",rnom.ToCString(),nbs);
+ char shname[30]; Sprintf (shname,"%s_%d",rnom.ToCString(),nbs);
di<<"Transfer root n0 "<<num<<" OK -> DRAW Shape: "<<shname<<"\n";
di<<"Now, "<<nbs<<" Shapes produced"<<"\n";
TopoDS_Shape sh = sr.Shape(nbs);
if (!sr.TransferOne (num)) di<<"Transfer entity n0 "<<num<<" : no result"<<"\n";
else {
nbs = sr.NbShapes();
- char shname[30]; sprintf (shname,"%s_%d",rnom.ToCString(),num);
+ char shname[30]; Sprintf (shname,"%s_%d",rnom.ToCString(),num);
di<<"Transfer entity n0 "<<num<<" OK -> DRAW Shape: "<<shname<<"\n";
di<<"Now, "<<nbs<<" Shapes produced"<<"\n";
TopoDS_Shape sh = sr.Shape(nbs);
if (!sr.TransferOne(num)) di<<"Transfer entity n0 "<<num<<" : no result"<<"\n";
else {
nbs = sr.NbShapes();
- char shname[30]; sprintf (shname,"%s_%d",rnom.ToCString(),nbs);
+ char shname[30]; Sprintf (shname,"%s_%d",rnom.ToCString(),nbs);
di<<"Transfer entity n0 "<<num<<" OK -> DRAW Shape: "<<shname<<"\n";
di<<"Now, "<<nbs<<" Shapes produced"<<"\n";
TopoDS_Shape sh = sr.Shape(nbs);
Standard_Boolean isASCIIMode = Standard_False;
Standard_Boolean isInParallel = Standard_False;
if (argc > 3) {
- isASCIIMode = (atoi(argv[3]) == 0);
+ isASCIIMode = (Draw::Atoi(argv[3]) == 0);
if (argc > 4) {
- isInParallel = (atoi(argv[4]) == 1);
+ isInParallel = (Draw::Atoi(argv[4]) == 1);
Standard::SetReentrant(isInParallel);
}
}
}
else {
TopoDS_Shape shape = DBRep::Get(argv[1]);
- Standard_Real defl = atof(argv[3]);
+ Standard_Real defl = Draw::Atof(argv[3]);
Standard_Integer type = 1;
- if(argc > 4) type = atoi(argv[4]);
+ if(argc > 4) type = Draw::Atoi(argv[4]);
type = Max(0, type);
type = Min(2, type);
Handle( MeshVS_Mesh ) aMesh = getMesh( argv[1], di );
if( !aMesh.IsNull() )
{
- Standard_Integer DisplayMode = 0;
- sscanf( argv[2], "%i", &DisplayMode );
+ Standard_Integer DisplayMode = Draw::Atoi (argv[2]);
Handle( AIS_InteractiveContext ) aContext = ViewerTest::GetAISContext();
Handle( MeshVS_Mesh ) aMesh = getMesh( argv[1], di );
if( !aMesh.IsNull() )
{
- Standard_Integer SelMode = 0;
- sscanf( argv[2], "%i", &SelMode );
+ Standard_Integer SelMode = Draw::Atoi (argv[2]);
Handle( AIS_InteractiveContext ) aContext = ViewerTest::GetAISContext();
Handle( MeshVS_Mesh ) aMesh = getMesh( argv[1], di );
if( !aMesh.IsNull() )
{
- Standard_Real r, g, b;
- sscanf( argv[2], "%lf", &r );
- sscanf( argv[3], "%lf", &g );
- sscanf( argv[4], "%lf", &b );
+ Standard_Real r = Draw::Atof (argv[2]);
+ Standard_Real g = Draw::Atof (argv[3]);
+ Standard_Real b = Draw::Atof (argv[4]);
aMesh->GetDrawer()->SetColor( (MeshVS_DrawerAttribute)Param, Quantity_Color( r, g, b, Quantity_TOC_RGB ) );
Handle( AIS_InteractiveContext ) aContext = ViewerTest::GetAISContext();
Handle( MeshVS_Mesh ) aMesh = getMesh( argv[1], di );
if( !aMesh.IsNull() )
{
- Standard_Integer mat;
- sscanf( argv[2], "%i", &mat );
+ Standard_Integer mat = Draw::Atoi (argv[2]);
Graphic3d_MaterialAspect aMatAsp =
(Graphic3d_MaterialAspect)(Graphic3d_NameOfMaterial)mat;
Handle( MeshVS_Mesh ) aMesh = getMesh( argv[1], di );
if( !aMesh.IsNull() )
{
- Standard_Real sh;
- sscanf( argv[2], "%lf", &sh );
+ Standard_Real sh = Draw::Atof (argv[2]);
aMesh->GetDrawer()->SetDouble( MeshVS_DA_ShrinkCoeff, sh );
Handle( AIS_InteractiveContext ) aContext = ViewerTest::GetAISContext();
if( aMode.IsEqual("elem1") || aMode.IsEqual("elem2") || aMode.IsEqual("nodal") || aMode.IsEqual("nodaltex") || aMode.IsEqual("none") )
{
Handle(MeshVS_PrsBuilder) aTempBuilder;
- Standard_Integer reflection = atoi(argv[3]);
+ Standard_Integer reflection = Draw::Atoi(argv[3]);
for (int count = 0 ; count < aMesh->GetBuildersCount(); count++ ){
aTempBuilder = Handle(MeshVS_PrsBuilder)::DownCast(aMesh->FindBuilder("MeshVS_ElementalColorPrsBuilder"));
}
const char* aWidthStr = argv[ 2 ];
- if ( aWidthStr == 0 || atof( aWidthStr ) <= 0 )
+ if ( aWidthStr == 0 || Draw::Atof( aWidthStr ) <= 0 )
{
di << "Width must be real value more than zero" << "\n";
return 0;
}
- double aWidth = atof( aWidthStr );
+ double aWidth = Draw::Atof( aWidthStr );
Handle(AIS_InteractiveContext) anIC = ViewerTest::GetAISContext();
if ( anIC.IsNull() )
//=======================================================================
TCollection_AsciiString XmlLDrivers::CreationDate ()
{
- const TCollection_AsciiString anOldNumLocale =
- (Standard_CString) setlocale (LC_NUMERIC, NULL);
- setlocale(LC_NUMERIC, "C");
-
Standard_Character nowstr[SLENGTH];
time_t nowbin;
struct tm *nowstruct;
if (strftime(nowstr, SLENGTH, "%Y-%m-%d", nowstruct) == (size_t) 0)
cerr << "Storage ERROR : Could not get string from strftime()" << endl;
- setlocale(LC_NUMERIC, (char *) anOldNumLocale.ToCString()) ;
return nowstr;
}
{
myReaderStatus = PCDM_RS_DriverFailure;
myFileName = theFileName;
- const TCollection_AsciiString anOldNumLocale =
- (Standard_CString) setlocale (LC_NUMERIC, NULL);
- setlocale(LC_NUMERIC, "C");
-
Handle(CDM_MessageDriver) aMessageDriver = theApplication -> MessageDriver();
::take_time (~0, " +++++ Start RETRIEVE procedures ++++++", aMessageDriver);
::take_time (0, " +++++ Fin parsing XML : ", aMessageDriver);
ReadFromDomDocument (anElement, theNewDocument, theApplication);
-
- setlocale(LC_NUMERIC, (char *) anOldNumLocale.ToCString()) ;
}
//=======================================================================
if (isReset) tmbuf0 = tmbuf;
else {
char take_tm_buf [64];
- sprintf (take_tm_buf, "%9.2f s ++++",
+ Sprintf (take_tm_buf, "%9.2f s ++++",
double(tmbuf.time - tmbuf0.time) +
double(tmbuf.millitm - tmbuf0.millitm)/1000.);
aMessage += take_tm_buf;
(const Handle(CDM_Document)& theDocument,
const TCollection_ExtendedString& theFileName)
{
- const TCollection_AsciiString anOldNumLocale =
- (Standard_CString) setlocale (LC_NUMERIC, NULL);
- setlocale(LC_NUMERIC, "C");
-
Handle(CDM_MessageDriver) aMessageDriver =
theDocument -> Application() -> MessageDriver();
::take_time (~0, " +++++ Start STORAGE procedures ++++++", aMessageDriver);
Standard_Failure::Raise("File cannot be opened for writing");
}
}
- setlocale(LC_NUMERIC, (char *) anOldNumLocale.ToCString()) ;
}
//=======================================================================
if (isReset) tmbuf0 = tmbuf;
else {
char take_tm_buf [64];
- sprintf (take_tm_buf, "%9.2f s ++++",
+ Sprintf (take_tm_buf, "%9.2f s ++++",
double(tmbuf.time - tmbuf0.time) +
double(tmbuf.millitm - tmbuf0.millitm)/1000.);
aMessage += take_tm_buf;
aValueStr2 += TCollection_AsciiString(anArr1.Value(j));
#else
char aValueChar[32];
- sprintf(aValueChar, "%.15g", anArr1.Value(j));
+ Sprintf(aValueChar, "%.15g", anArr1.Value(j));
TCollection_AsciiString aValueStr(aValueChar);
aValueStr2 += aValueStr;
#endif
aValueStr += TCollection_AsciiString(aRealArray->Value(i));
#else
char aValueChar[32];
- sprintf(aValueChar, "%.15g", aRealArray->Value(i));
+ Sprintf(aValueChar, "%.15g", aRealArray->Value(i));
aValueStr += aValueChar;
#endif
if (i >= anU) break;
TCollection_AsciiString aValueStr (anInt->Get());
#else
char aValueChar[32];
- sprintf(aValueChar, "%.15g", anInt->Get());
+ Sprintf(aValueChar, "%.15g", anInt->Get());
TCollection_AsciiString aValueStr(aValueChar);
#endif
// No occurrence of '&', '<' and other irregular XML characters
case TopAbs_EXTERNAL : anOr = 'e'; break;
default : anOr = '\0';
}
- sprintf (aBuffer, "%c%i", anOr, theID);
+ Sprintf (aBuffer, "%c%i", anOr, theID);
Element().setAttribute (::TShapeString(), aBuffer);
if (theLocID > 0)
Element().setAttribute (::LocationString(), theLocID);
gp_Pnt aPos = BRep_Tool::Pnt(aV);
char buf [16];
- sprintf (buf, "%.8g", aPos.X());
+ Sprintf (buf, "%.8g", aPos.X());
Element().setAttribute (::XCoordString(), buf);
- sprintf (buf, "%.8g", aPos.Y());
+ Sprintf (buf, "%.8g", aPos.Y());
Element().setAttribute (::YCoordString(), buf);
- sprintf (buf, "%.8g", aPos.Z());
+ Sprintf (buf, "%.8g", aPos.Z());
Element().setAttribute (::ZCoordString(), buf);
}
{
gp_Pnt aPos = aTPos->GetPosition();
char buf [64];
- sprintf (buf, "%.17g %.17g %.17g", aPos.X(), aPos.Y(), aPos.Z());
+ Sprintf (buf, "%.17g %.17g %.17g", aPos.X(), aPos.Y(), aPos.Z());
XmlObjMgt::SetStringValue(theTarget.Element(), buf);
}
}
{
gp_Pnt aPos = aTPos->Get();
char buf [64];
- sprintf (buf, "%.17g %.17g %.17g", aPos.X(), aPos.Y(), aPos.Z());
+ Sprintf (buf, "%.17g %.17g %.17g", aPos.X(), aPos.Y(), aPos.Z());
XmlObjMgt::SetStringValue(theTarget.Element(), buf);
}
}
for ( Standard_Integer i = aFirstInd; i <= aLastInd; i++ )
{
char aValueChar[256];
- sprintf(aValueChar, "%.15g", aHArr->Value(i));
+ Sprintf(aValueChar, "%.15g", aHArr->Value(i));
aValueStr += aValueChar;
if ( i < aLastInd )
aValueStr += ' ';
const Standard_Integer aLen = theString.Length();
// const Standard_ExtCharacter * aString = theString.ToExtString();
char * buf0 = new char [4 * (aLen + 1) + 3];
- sprintf (&buf0[0], "##%04x", 0xfeff); // set UNICODE header
+ Sprintf (&buf0[0], "##%04x", 0xfeff); // set UNICODE header
char * buf = &buf0[6];
// Standard_Integer i = 0;
// while (i <= (aLen - 4)) {
-// sprintf (&buf[i*4], "%04x%04x%04x%04x", aString[i], aString[i+1],
+// Sprintf (&buf[i*4], "%04x%04x%04x%04x", aString[i], aString[i+1],
// aString[i+2], aString[i+3]);
// i += 4;
// }
// while (i < aLen) {
-// sprintf (&buf[i*4], "%04x", aString[i]);
+// Sprintf (&buf[i*4], "%04x", aString[i]);
// ++i;
// }
// buf[4*aLen] = '\0';
{
char * ptr;
errno = 0;
- double aValue = strtod (theString, &ptr);
+ double aValue = Strtod (theString, &ptr);
if (ptr == theString || errno == ERANGE || errno == EINVAL)
return Standard_False;
theValue = Standard_Real (aValue);
char * ptr;
const char * aString = theString.GetString();
errno = 0;
- double aValue = strtod (aString, &ptr);
+ double aValue = Strtod (aString, &ptr);
if (ptr == aString || errno == ERANGE || errno == EINVAL)
return Standard_False;
theValue = Standard_Real (aValue);
char buf [256];
XmlObjMgt_DOMString S1 (Translate(aTrsf.HVectorialPart())),
S2 (Translate(aTrsf.TranslationPart()));
- sprintf (buf, "%.17g %d %s %s", aTrsf.ScaleFactor(), aTrsf.Form(),
+ Sprintf (buf, "%.17g %d %s %s", aTrsf.ScaleFactor(), aTrsf.Form(),
S1.GetString(), S2.GetString());
return XmlObjMgt_DOMString (buf);
XmlObjMgt_DOMString S1 (Translate(aMat.Row(1))),
S2 (Translate(aMat.Row(2))),
S3 (Translate(aMat.Row(3)));
- sprintf (buf, "%s %s %s", S1.GetString(), S2.GetString(), S3.GetString());
+ Sprintf (buf, "%s %s %s", S1.GetString(), S2.GetString(), S3.GetString());
return XmlObjMgt_DOMString (buf);
}
XmlObjMgt_DOMString XmlObjMgt_GP::Translate (const gp_XYZ& anXYZ)
{
char buf [64];
- sprintf (buf, "%.17g %.17g %.17g", anXYZ.X(), anXYZ.Y(), anXYZ.Z());
+ Sprintf (buf, "%.17g %.17g %.17g", anXYZ.X(), anXYZ.Y(), anXYZ.Z());
return XmlObjMgt_DOMString (buf);
}
const char * aStr = theStr.GetString();
char * ptr;
errno = 0;
- Standard_Real aScaleFactor = Standard_Real(strtod (aStr, &ptr));
+ Standard_Real aScaleFactor = Standard_Real(Strtod (aStr, &ptr));
if (ptr != aStr && errno != ERANGE && errno != EINVAL)
{
T._CSFDB_Setgp_Trsfscale(aScaleFactor);
char * ptr;
if (theStr) {
errno = 0;
- Standard_Real aC = strtod (theStr, &ptr);
+ Standard_Real aC = Strtod (theStr, &ptr);
if (ptr != theStr && errno != ERANGE && errno != EINVAL) {
P.SetX(aC);
theStr = ptr;
- aC = strtod (theStr, &ptr);
+ aC = Strtod (theStr, &ptr);
if (ptr != theStr && errno != ERANGE && errno != EINVAL) {
P.SetY(aC);
theStr = ptr;
- aC = strtod (theStr, &ptr);
+ aC = Strtod (theStr, &ptr);
if (ptr != theStr && errno != ERANGE && errno != EINVAL) {
P.SetZ(aC);
theStr = ptr;
}
# Procedure to check equality of two reals with tolerance (relative and absolute)
+help checkreal {name value expected tol_abs tol_rel}
proc checkreal {name value expected tol_abs tol_rel} {
if { abs ($value - $expected) > $tol_abs + $tol_rel * abs ($expected) } {
puts "Error: $name = $value is not equal to expected $expected"
return
}
+# Procedure to check equality of two reals with tolerance (relative and absolute)
+help checkarea {shape area_expected tol_abs tol_rel}
+proc checkarea {shape area_expected tol_abs tol_rel} {
+ # compute area with half of the relative tolerance
+ # to be used in comparison; 0.001 is added to avoid zero value
+ set prop [uplevel sprops $shape [expr 0.5 * abs($tol_rel) + 0.001]]
+
+ # get te value
+ if { ! [regexp {Mass\s*:\s*([0-9.e+-]+)} $prop res area] } {
+ puts "Error: cannot get area of the shape $shape"
+ return
+ }
+ # compare with expected value
+ checkreal "area of $shape" $area $area_expected $tol_abs $tol_rel
+}
# Procedure to check color in the point near default coordinate
FAILED /\bFaulty\b/ bad shape
IGNORE /^Error [23]d = [\d.-]+/ debug output of blend command
+SKIPPED /Error: unsupported locale specification/ locale is unavailable on tested system
OK /Relative error of mass computation/ message from vprops
--- /dev/null
+# Test for issue #22898 and other functionality that can be affected by locale.
+# Just run multiple conversions of the shape to and from diferent formats and
+# check that the result is good shape with expected area
+
+set anOS $tcl_platform(os)
+if { ${anOS} == "Darwin" } {
+ dlocale LC_ALL fr_FR
+} else {
+ dlocale LC_ALL French
+}
+
+pload MODELING
+pload XSTEP
+
+# original shape
+restore [locate_data_file hammer.brep] hammer
+checkshape hammer
+tolerance hammer
+checkarea hammer 3.978e8 1e6 0.001
+
+# BREP
+save hammer $imagedir/hammer.brep
+restore $imagedir/hammer.brep brep
+checkshape brep
+tolerance brep
+checkarea brep 3.978e8 1e6 0.001
+
+# IGES
+brepiges hammer $imagedir/hammer.igs
+igesbrep $imagedir/hammer.igs iges *
+checkshape iges
+tolerance iges
+checkarea iges 3.978e8 1e6 0.001
+
+# STEP
+stepwrite a hammer $imagedir/hammer.stp
+stepread $imagedir/hammer.stp step *
+checkshape step_1
+tolerance step_1
+checkarea step_1 3.978e8 1e6 0.001
+
+# STL
+writestl hammer $imagedir/hammer.stl
+readstl stl $imagedir/hammer.stl
+checkshape stl
+tolerance stl
+checkarea stl 3.978e8 1e6 0.001
+
+# VRML: reading does not work regardless of locale...
+writevrml hammer $imagedir/hammer.vrml
+#loadvrml vrml $imagedir/hammer.vrml
+#checkshape vrml
+#tolerance vrml