mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-09 13:22:24 +03:00
0022898: IGES import fails in german environment
Added DRAW command dlocale to set and query current locale of the C subsystem Equivalents of C functions working with conversions of strings to/from reals added in Standard_CString, providing locale-independent behavior (using always "C" locale) In DRAW packages, calls to atof() and atoi() are replaced by direct calls to Draw::Atof() and Draw::Atoi(), respectively, instead of substituting by #define Use of atof(), strtod(), and *scanf() involving floating point conversions in OCCT code replaced by locale-independent Atof() and Strtod() Calls to sprintf() involving floating point in OCCT code are replaced by call to locale-independent Sprintf(), except a few places where converted strings are used immediately for display in the 3d viewer Changes of global locale are eliminated throughout OCCT code Proposed correction for GNU libC where v*printf_l functions are absent Added test case (bugs xde bug22898) for data exchange operations with non-standard locale Use xlocale on Mac OS X and within glibc Corrected strtod_l wrapper Generate error rather than warning Introduce Standard_CLocaleSentry replacement for removed OSD_Localizer Standard_CLocaleSentry - copy locale string Standard_CLocaleSentry - use _configthreadlocale on Windows Standard_CLocaleSentry::GetCLocale() - return locale_t rather than void* Corrected misprint in ~Standard_CLocaleSentry() Use French locale in bug22898 test case Mark test case as skipped if locale is unavailable on tested system. Use fr_FR locale for tests on Mac OS X
This commit is contained in:
@@ -77,7 +77,7 @@ static Standard_Integer addpcurve(Draw_Interpretor& , Standard_Integer n, const
|
||||
TopoDS_Shape F = DBRep::Get(a[3]);
|
||||
Standard_Real tol = 1.e-7;
|
||||
if (n > 4) {
|
||||
tol = atof(a[4]);
|
||||
tol = Draw::Atof(a[4]);
|
||||
}
|
||||
BRep_Builder BB;
|
||||
BB.UpdateEdge(TopoDS::Edge(E), PC, TopoDS::Face(F),tol);
|
||||
@@ -108,25 +108,25 @@ static Standard_Integer transform(Draw_Interpretor& di,Standard_Integer n,const
|
||||
}
|
||||
else if (!strcmp(a[0],"ttranslate")) {
|
||||
if (n < 5) return 1;
|
||||
T.SetTranslation(gp_Vec(atof(a[n-3]),atof(a[n-2]),atof(a[n-1])));
|
||||
T.SetTranslation(gp_Vec(Draw::Atof(a[n-3]),Draw::Atof(a[n-2]),Draw::Atof(a[n-1])));
|
||||
last = n-3;
|
||||
}
|
||||
else if (!strcmp(a[0],"trotate")) {
|
||||
if (n < 9) return 1;
|
||||
T.SetRotation(gp_Ax1(gp_Pnt(atof(a[n-7]),atof(a[n-6]),atof(a[n-5])),
|
||||
gp_Vec(atof(a[n-4]),atof(a[n-3]),atof(a[n-2]))),
|
||||
atof(a[n-1])* (M_PI / 180.0));
|
||||
T.SetRotation(gp_Ax1(gp_Pnt(Draw::Atof(a[n-7]),Draw::Atof(a[n-6]),Draw::Atof(a[n-5])),
|
||||
gp_Vec(Draw::Atof(a[n-4]),Draw::Atof(a[n-3]),Draw::Atof(a[n-2]))),
|
||||
Draw::Atof(a[n-1])* (M_PI / 180.0));
|
||||
last = n-7;
|
||||
}
|
||||
else if (!strcmp(a[0],"tmirror")) {
|
||||
if (n < 8) return 1;
|
||||
T.SetMirror(gp_Ax2(gp_Pnt(atof(a[n-6]),atof(a[n-5]),atof(a[n-4])),
|
||||
gp_Vec(atof(a[n-3]),atof(a[n-2]),atof(a[n-1]))));
|
||||
T.SetMirror(gp_Ax2(gp_Pnt(Draw::Atof(a[n-6]),Draw::Atof(a[n-5]),Draw::Atof(a[n-4])),
|
||||
gp_Vec(Draw::Atof(a[n-3]),Draw::Atof(a[n-2]),Draw::Atof(a[n-1]))));
|
||||
last = n-6;
|
||||
}
|
||||
else if (!strcmp(a[0],"tscale")) {
|
||||
if (n < 6) return 1;
|
||||
T.SetScale(gp_Pnt(atof(a[n-4]),atof(a[n-3]),atof(a[n-2])),atof(a[n-1]));
|
||||
T.SetScale(gp_Pnt(Draw::Atof(a[n-4]),Draw::Atof(a[n-3]),Draw::Atof(a[n-2])),Draw::Atof(a[n-1]));
|
||||
last = n-4;
|
||||
|
||||
}
|
||||
@@ -180,8 +180,8 @@ static Standard_Integer deform(Draw_Interpretor& di,Standard_Integer n,const cha
|
||||
gp_Trsf T;
|
||||
gp_GTrsf GT(T);
|
||||
|
||||
// gp_Mat rot(atof(a[last-3]),0,0,0,atof(a[last-2]),0,0,0,atof(a[last-1]));
|
||||
gp_Mat rot(atof(a[3]),0,0,0,atof(a[4]),0,0,0,atof(a[5]));
|
||||
// gp_Mat rot(Draw::Atof(a[last-3]),0,0,0,Draw::Atof(a[last-2]),0,0,0,Draw::Atof(a[last-1]));
|
||||
gp_Mat rot(Draw::Atof(a[3]),0,0,0,Draw::Atof(a[4]),0,0,0,Draw::Atof(a[5]));
|
||||
GT.SetVectorialPart(rot);
|
||||
last -= 3;
|
||||
BRepBuilderAPI_GTransform gtrf(GT);
|
||||
@@ -278,7 +278,7 @@ static Standard_Integer mkedgecurve (Draw_Interpretor& ,Standard_Integer n,const
|
||||
Standard_Boolean CurveDone ;
|
||||
|
||||
if (n < 3) return 1;
|
||||
Standard_Real Tolerance = atof(a[2]) ;
|
||||
Standard_Real Tolerance = Draw::Atof(a[2]) ;
|
||||
|
||||
TopoDS_Shape S = DBRep::Get(a[1]);
|
||||
|
||||
@@ -301,7 +301,7 @@ static Standard_Integer sameparameter(Draw_Interpretor& ,Standard_Integer n,cons
|
||||
TopoDS_Shape S = DBRep::Get(a[1]);
|
||||
if (S.IsNull()) return 1;
|
||||
Standard_Boolean force = !strcmp(a[0],"fsameparameter");
|
||||
if (n == 3) tol = atof(a[2]);
|
||||
if (n == 3) tol = Draw::Atof(a[2]);
|
||||
|
||||
BRepLib::SameParameter(S,tol,force);
|
||||
|
||||
@@ -390,12 +390,12 @@ static Standard_Integer bounding(Draw_Interpretor& di,Standard_Integer n,const c
|
||||
di << axmin<<" "<< aymin<<" "<< azmin<<" "<< axmax<<" "<< aymax<<" "<< azmax;
|
||||
}
|
||||
else if (n == 7) {
|
||||
axmin=atof(a[1]);
|
||||
aymin=atof(a[2]);
|
||||
azmin=atof(a[3]);
|
||||
axmax=atof(a[4]);
|
||||
aymax=atof(a[5]);
|
||||
azmax=atof(a[6]);
|
||||
axmin=Draw::Atof(a[1]);
|
||||
aymin=Draw::Atof(a[2]);
|
||||
azmin=Draw::Atof(a[3]);
|
||||
axmax=Draw::Atof(a[4]);
|
||||
aymax=Draw::Atof(a[5]);
|
||||
azmax=Draw::Atof(a[6]);
|
||||
DB = new Draw_Box(gp_Pnt(axmin,aymin,azmin),gp_Pnt(axmax,aymax,azmax),Draw_orange);
|
||||
dout<<DB;
|
||||
}
|
||||
@@ -434,7 +434,7 @@ static Standard_Integer precision(Draw_Interpretor& di,Standard_Integer n,const
|
||||
di << " Current Precision = " << BRepBuilderAPI::Precision() << "\n";
|
||||
}
|
||||
else {
|
||||
BRepBuilderAPI::Precision(atof(a[1]));
|
||||
BRepBuilderAPI::Precision(Draw::Atof(a[1]));
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
@@ -707,26 +707,26 @@ static Standard_Integer vecdc(Draw_Interpretor& di,Standard_Integer ,const char*
|
||||
if (!strcmp(a[arg],"-d")) {
|
||||
arg++;
|
||||
if(n > arg)
|
||||
MaxDistance = atof(a[arg++]);
|
||||
MaxDistance = Draw::Atof(a[arg++]);
|
||||
OrtProj.SetMaxDistance(MaxDistance);
|
||||
}
|
||||
if(n > arg) {
|
||||
Tol = Max(atof(a[arg++]),1.e-10);
|
||||
Tol = Max(Draw::Atof(a[arg++]),1.e-10);
|
||||
}
|
||||
|
||||
if(n > arg) {
|
||||
if (atoi(a[arg]) == 0) Continuity = GeomAbs_C0;
|
||||
else if (atoi(a[arg]) == 1) Continuity = GeomAbs_C1;
|
||||
if (Draw::Atoi(a[arg]) == 0) Continuity = GeomAbs_C0;
|
||||
else if (Draw::Atoi(a[arg]) == 1) Continuity = GeomAbs_C1;
|
||||
arg++;
|
||||
}
|
||||
|
||||
|
||||
if(n > arg) {
|
||||
MaxDeg = atoi(a[arg++]);
|
||||
MaxDeg = Draw::Atoi(a[arg++]);
|
||||
if (MaxDeg<1 || MaxDeg>14) MaxDeg = 14;
|
||||
}
|
||||
|
||||
if(n > arg) MaxSeg = atoi(a[arg]);
|
||||
if(n > arg) MaxSeg = Draw::Atoi(a[arg]);
|
||||
|
||||
Tol2d = Pow(Tol, 2./3);
|
||||
|
||||
@@ -766,7 +766,7 @@ static Standard_Integer wexplo (Draw_Interpretor&,
|
||||
Standard_Integer k = 1;
|
||||
while (we.More()) {
|
||||
TopoDS_Edge E = we.Current();
|
||||
sprintf(name,"WEDGE_%d",k);
|
||||
Sprintf(name,"WEDGE_%d",k);
|
||||
DBRep::Set(name,E);
|
||||
we.Next();
|
||||
k++;
|
||||
@@ -782,9 +782,9 @@ static Standard_Integer scalexyz(Draw_Interpretor& di, Standard_Integer n, const
|
||||
TopoDS_Shape aShapeBase = DBRep::Get(a[2]);
|
||||
if (aShapeBase.IsNull()) return 1;
|
||||
|
||||
Standard_Real aFactorX = atof(a[3]);
|
||||
Standard_Real aFactorY = atof(a[4]);
|
||||
Standard_Real aFactorZ = atof(a[5]);
|
||||
Standard_Real aFactorX = Draw::Atof(a[3]);
|
||||
Standard_Real aFactorY = Draw::Atof(a[4]);
|
||||
Standard_Real aFactorZ = Draw::Atof(a[5]);
|
||||
|
||||
gp_GTrsf aGTrsf;
|
||||
gp_Mat rot (aFactorX, 0, 0,
|
||||
|
@@ -25,6 +25,7 @@
|
||||
|
||||
#include <Draw_Interpretor.hxx>
|
||||
#include <BRepTest.hxx>
|
||||
#include <Draw.hxx>
|
||||
#include <DBRep.hxx>
|
||||
#include <BRepFilletAPI_MakeChamfer.hxx>
|
||||
#include <TopAbs_ShapeEnum.hxx>
|
||||
@@ -97,7 +98,7 @@ static Standard_Integer chamfer(Draw_Interpretor& di,
|
||||
// F = TopoDS::Face(DBRep::Get(a[i + 1], TopAbs_FACE));
|
||||
if (Method == 0) {
|
||||
if (!E.IsNull() && !F.IsNull() && (aMCh.Contour(E) == 0) ) {
|
||||
d1 = atof(a[i + 3]);
|
||||
d1 = Draw::Atof(a[i + 3]);
|
||||
|
||||
if ( d1 > Precision::Confusion())
|
||||
aMCh.Add(d1,E ,F);
|
||||
@@ -106,8 +107,8 @@ static Standard_Integer chamfer(Draw_Interpretor& di,
|
||||
}
|
||||
else if (Method == 1) {
|
||||
if (!E.IsNull() && !F.IsNull() && (aMCh.Contour(E) == 0) ) {
|
||||
d1 = atof(a[i + 2]);
|
||||
d2 = atof(a[i + 3]);
|
||||
d1 = Draw::Atof(a[i + 2]);
|
||||
d2 = Draw::Atof(a[i + 3]);
|
||||
|
||||
if ( (d1 > Precision::Confusion())
|
||||
&& (d2 > Precision::Confusion()) )
|
||||
@@ -117,8 +118,8 @@ static Standard_Integer chamfer(Draw_Interpretor& di,
|
||||
}
|
||||
else {
|
||||
if (!E.IsNull() && !F.IsNull() && (aMCh.Contour(E) == 0) ) {
|
||||
d1 = atof(a[i + 3]);
|
||||
angle = atof(a[i + 4]);
|
||||
d1 = Draw::Atof(a[i + 3]);
|
||||
angle = Draw::Atof(a[i + 4]);
|
||||
angle *= M_PI / 180.;
|
||||
|
||||
if ( (d1 > Precision::Confusion())
|
||||
|
@@ -171,7 +171,7 @@ static void PrintSub(Standard_OStream& OS,
|
||||
if (!FindNamed(sub,Name)) {
|
||||
nbfaulty++;
|
||||
Name = (char*)malloc(18*sizeof(char));
|
||||
sprintf(Name,"%s%d",checkfaultyname,nbfaulty);
|
||||
Sprintf(Name,"%s%d",checkfaultyname,nbfaulty);
|
||||
DBRep::Set(Name,sub);
|
||||
lfaulty.Append(Draw::Get((Standard_CString&)Name));
|
||||
}
|
||||
@@ -179,7 +179,7 @@ static void PrintSub(Standard_OStream& OS,
|
||||
if (!FindNamed(S,Name)) {
|
||||
nbfaulty++;
|
||||
Name = (char*)malloc(18*sizeof(char));
|
||||
sprintf(Name,"%s%d",checkfaultyname,nbfaulty);
|
||||
Sprintf(Name,"%s%d",checkfaultyname,nbfaulty);
|
||||
DBRep::Set(Name,S);
|
||||
lfaulty.Append(Draw::Get((Standard_CString&)Name));
|
||||
}
|
||||
@@ -215,7 +215,7 @@ static void Print(Standard_OStream& OS,
|
||||
if (!FindNamed(S,Name)) {
|
||||
nbfaulty++;
|
||||
Name = (char*)malloc(18*sizeof(char));
|
||||
sprintf(Name,"%s%d",checkfaultyname,nbfaulty);
|
||||
Sprintf(Name,"%s%d",checkfaultyname,nbfaulty);
|
||||
DBRep::Set(Name,S);
|
||||
lfaulty.Append(Draw::Get((Standard_CString&)Name));
|
||||
}
|
||||
@@ -318,7 +318,7 @@ static Standard_Integer checksection(Draw_Interpretor& di,
|
||||
TopTools_MapIteratorOfMapOfShape itvx;
|
||||
for (itvx.Initialize(theVertices); itvx.More(); itvx.Next()) {
|
||||
ipp++;
|
||||
sprintf(Name,"alone_%d",ipp);
|
||||
Sprintf(Name,"alone_%d",ipp);
|
||||
DBRep::Set(Name, itvx.Key());
|
||||
//cout << Name << " " ;
|
||||
di << Name << " " ;
|
||||
@@ -339,7 +339,7 @@ static Standard_Integer checkdiff(Draw_Interpretor& di,
|
||||
const char* syntaxe = "checkdiff arg1 [arg2..argn] result [closedSolid (0/1)] [geomCtrl (1/0)]";
|
||||
if (narg < 3) {
|
||||
if (narg==2) {
|
||||
Standard_Integer bcrtrace=atoi(a[narg-1]);
|
||||
Standard_Integer bcrtrace=Draw::Atoi(a[narg-1]);
|
||||
bcrtrace=BRepCheck_Trace(bcrtrace);
|
||||
//cout << "BRepCheck_Trace : " << bcrtrace << endl;
|
||||
di << "BRepCheck_Trace : " << bcrtrace << "\n";
|
||||
@@ -362,7 +362,7 @@ static Standard_Integer checkdiff(Draw_Interpretor& di,
|
||||
di << syntaxe << "\n";
|
||||
return 1;
|
||||
}
|
||||
closedSolid=atoi(a[narg-1]);
|
||||
closedSolid=Draw::Atoi(a[narg-1]);
|
||||
resu = DBRep::Get(a[narg-2]);
|
||||
lastArg=narg-3;
|
||||
if (resu.IsNull()) {
|
||||
@@ -372,7 +372,7 @@ static Standard_Integer checkdiff(Draw_Interpretor& di,
|
||||
return 1;
|
||||
}
|
||||
geomCtrl=closedSolid;
|
||||
closedSolid=atoi(a[narg-2]);
|
||||
closedSolid=Draw::Atoi(a[narg-2]);
|
||||
resu = DBRep::Get(a[narg-3]);
|
||||
lastArg=narg-4;
|
||||
if (resu.IsNull()) {
|
||||
@@ -820,7 +820,7 @@ void StructuralDump(Draw_Interpretor& theCommands,
|
||||
for(i=1; i<=nb; i++)
|
||||
B.Add(comp,slv->Value(i));
|
||||
char aName[20];
|
||||
sprintf(aName,"%s_v",Pref);
|
||||
Sprintf(aName,"%s_v",Pref);
|
||||
DBRep::Set(aName,comp);
|
||||
//cout<<"VERTEX"<<" : "<<(nb > 9 ? "" : " ")<<nb<<" Items -> compound named "<<aName<<endl;
|
||||
if (nb > 9)
|
||||
@@ -835,7 +835,7 @@ void StructuralDump(Draw_Interpretor& theCommands,
|
||||
for(i=1; i<=nb; i++)
|
||||
B.Add(comp,sle->Value(i));
|
||||
char aName[20];
|
||||
sprintf(aName,"%s_e",Pref);
|
||||
Sprintf(aName,"%s_e",Pref);
|
||||
DBRep::Set(aName,comp);
|
||||
//cout<<"EDGE"<<" : "<<(nb > 9 ? "" : " ")<<nb<<" Items -> compound named "<<aName<<endl;
|
||||
if (nb > 9)
|
||||
@@ -850,7 +850,7 @@ void StructuralDump(Draw_Interpretor& theCommands,
|
||||
for(i=1; i<=nb; i++)
|
||||
B.Add(comp,slw->Value(i));
|
||||
char aName[20];
|
||||
sprintf(aName,"%s_w",Pref);
|
||||
Sprintf(aName,"%s_w",Pref);
|
||||
DBRep::Set(aName,comp);
|
||||
//cout<<"WIRE"<<" : "<<(nb > 9 ? "" : " ")<<nb<<" Items -> compound named "<<aName<<endl;
|
||||
if (nb > 9)
|
||||
@@ -865,7 +865,7 @@ void StructuralDump(Draw_Interpretor& theCommands,
|
||||
for(i=1; i<=nb; i++)
|
||||
B.Add(comp,slf->Value(i));
|
||||
char aName[20];
|
||||
sprintf(aName,"%s_f",Pref);
|
||||
Sprintf(aName,"%s_f",Pref);
|
||||
DBRep::Set(aName,comp);
|
||||
//cout<<"FACE"<<" : "<<(nb > 9 ? "" : " ")<<nb<<" Items -> compound named "<<aName<<endl;
|
||||
if (nb > 9)
|
||||
@@ -880,7 +880,7 @@ void StructuralDump(Draw_Interpretor& theCommands,
|
||||
for(i=1; i<=nb; i++)
|
||||
B.Add(comp,sls->Value(i));
|
||||
char aName[20];
|
||||
sprintf(aName,"%s_s",Pref);
|
||||
Sprintf(aName,"%s_s",Pref);
|
||||
DBRep::Set(aName,comp);
|
||||
//cout<<"SHELL"<<" : "<<(nb > 9 ? "" : " ")<<nb<<" Items -> compound named "<<aName<<endl;
|
||||
if (nb > 9)
|
||||
@@ -895,7 +895,7 @@ void StructuralDump(Draw_Interpretor& theCommands,
|
||||
for(i=1; i<=nb; i++)
|
||||
B.Add(comp,slo->Value(i));
|
||||
char aName[20];
|
||||
sprintf(aName,"%s_o",Pref);
|
||||
Sprintf(aName,"%s_o",Pref);
|
||||
DBRep::Set(aName,comp);
|
||||
//cout<<"SOLID"<<" : "<<(nb > 9 ? "" : " ")<<nb<<" Items -> compound named "<<aName<<endl;
|
||||
if (nb > 9)
|
||||
@@ -1105,12 +1105,12 @@ static Standard_Integer shapeG1continuity (Draw_Interpretor& di, Standard_Intege
|
||||
|
||||
|
||||
|
||||
nbeval = (Standard_Integer ) atof( a[3]);
|
||||
nbeval = (Standard_Integer ) Draw::Atof( a[3]);
|
||||
|
||||
switch(n)
|
||||
{ case 7 : epsG1 = atof(a[6]);
|
||||
case 6 : epsC0 = atof(a[5]);
|
||||
case 5 : epsnl = atof(a[4]);
|
||||
{ case 7 : epsG1 = Draw::Atof(a[6]);
|
||||
case 6 : epsC0 = Draw::Atof(a[5]);
|
||||
case 5 : epsnl = Draw::Atof(a[4]);
|
||||
case 4 : {} break;
|
||||
default : return 1;
|
||||
}
|
||||
@@ -1230,11 +1230,11 @@ static Standard_Integer shapeG0continuity (Draw_Interpretor& di, Standard_Intege
|
||||
|
||||
|
||||
|
||||
nbeval = (Standard_Integer ) atof( a[3]);
|
||||
nbeval = (Standard_Integer ) Draw::Atof( a[3]);
|
||||
|
||||
switch(n)
|
||||
{ case 6 : epsC0 = atof(a[5]);
|
||||
case 5 : epsnl = atof(a[4]);
|
||||
{ case 6 : epsC0 = Draw::Atof(a[5]);
|
||||
case 5 : epsnl = Draw::Atof(a[4]);
|
||||
case 4 : {} break;
|
||||
default : return 1;
|
||||
}
|
||||
@@ -1351,15 +1351,15 @@ static Standard_Integer shapeG2continuity (Draw_Interpretor& di, Standard_Intege
|
||||
|
||||
|
||||
|
||||
nbeval = (Standard_Integer ) atof( a[3]);
|
||||
nbeval = (Standard_Integer ) Draw::Atof( a[3]);
|
||||
|
||||
switch(n)
|
||||
{
|
||||
case 9 : maxlen = atof(a[8]);
|
||||
case 8 : percent = atof(a[7]);
|
||||
case 7 : epsG1 = atof(a[6]);
|
||||
case 6 : epsC0 = atof(a[5]);
|
||||
case 5 : epsnl = atof(a[4]);
|
||||
case 9 : maxlen = Draw::Atof(a[8]);
|
||||
case 8 : percent = Draw::Atof(a[7]);
|
||||
case 7 : epsG1 = Draw::Atof(a[6]);
|
||||
case 6 : epsC0 = Draw::Atof(a[5]);
|
||||
case 5 : epsnl = Draw::Atof(a[4]);
|
||||
case 4 : {} break;
|
||||
default : return 1;
|
||||
}
|
||||
@@ -1454,7 +1454,7 @@ static Standard_Integer clintedge(Draw_Interpretor& di,
|
||||
Standard_Integer i = 1;
|
||||
char* temp = newname;
|
||||
|
||||
sprintf(newname,"%s_%d",a[1],i);
|
||||
Sprintf(newname,"%s_%d",a[1],i);
|
||||
DBRep::Set(temp,mypurgealgo.Shape());
|
||||
//cout<<newname<<" ";
|
||||
di<<newname<<" ";
|
||||
@@ -1495,7 +1495,7 @@ static Standard_Integer facintedge(Draw_Interpretor& di,
|
||||
|
||||
TopTools_DataMapIteratorOfDataMapOfShapeListOfShape itFacEdg;
|
||||
for (itFacEdg.Initialize(mymap); itFacEdg.More(); itFacEdg.Next()) {
|
||||
sprintf(newname,"%s_%d",a[1],i);
|
||||
Sprintf(newname,"%s_%d",a[1],i);
|
||||
DBRep::Set(temp,itFacEdg.Key());
|
||||
//cout<<newname<<" ";
|
||||
di<<newname<<" ";
|
||||
@@ -1539,7 +1539,7 @@ static Standard_Integer fuseedge(Draw_Interpretor& di,
|
||||
Standard_Integer i = 1;
|
||||
char* temp = newname;
|
||||
|
||||
sprintf(newname,"%s_%d",a[1],i);
|
||||
Sprintf(newname,"%s_%d",a[1],i);
|
||||
DBRep::Set(temp,myfusealgo.Shape());
|
||||
//cout<<newname<<" ";
|
||||
di<<newname<<" ";
|
||||
@@ -1585,7 +1585,7 @@ static Standard_Integer listfuseedge(Draw_Interpretor& di,
|
||||
TopTools_ListIteratorOfListOfShape itEdg;
|
||||
i = 1;
|
||||
for (itEdg.Initialize(LmapEdg); itEdg.More(); itEdg.Next()) {
|
||||
sprintf(newname,"%s_%d_%d",a[1],iLst,i);
|
||||
Sprintf(newname,"%s_%d_%d",a[1],iLst,i);
|
||||
DBRep::Set(temp,itEdg.Value());
|
||||
//cout<<newname<<" ";
|
||||
di<<newname<<" ";
|
||||
|
@@ -88,7 +88,7 @@ static Standard_Integer vertex(Draw_Interpretor& , Standard_Integer n, const cha
|
||||
if (n < 4) return 1;
|
||||
if (n >= 5) {
|
||||
DBRep::Set(a[1],
|
||||
BRepBuilderAPI_MakeVertex(gp_Pnt(atof(a[2]),atof(a[3]),atof(a[4]))));
|
||||
BRepBuilderAPI_MakeVertex(gp_Pnt(Draw::Atof(a[2]),Draw::Atof(a[3]),Draw::Atof(a[4]))));
|
||||
}
|
||||
else {
|
||||
TopoDS_Shape S = DBRep::Get(a[3]);
|
||||
@@ -96,7 +96,7 @@ static Standard_Integer vertex(Draw_Interpretor& , Standard_Integer n, const cha
|
||||
if (S.ShapeType() != TopAbs_EDGE) return 0;
|
||||
BRepAdaptor_Curve C(TopoDS::Edge(S));
|
||||
gp_Pnt P;
|
||||
C.D0(atof(a[2]),P);
|
||||
C.D0(Draw::Atof(a[2]),P);
|
||||
DBRep::Set(a[1], BRepBuilderAPI_MakeVertex(P));
|
||||
}
|
||||
return 0;
|
||||
@@ -113,8 +113,8 @@ static Standard_Integer range(Draw_Interpretor& , Standard_Integer n, const char
|
||||
TopoDS_Edge E = TopoDS::Edge(aLocalShape);
|
||||
// TopoDS_Edge E = TopoDS::Edge(DBRep::Get(a[1],TopAbs_EDGE));
|
||||
if (E.IsNull()) return 1;
|
||||
Standard_Real f = atof(a[n-2]);
|
||||
Standard_Real l = atof(a[n-1]);
|
||||
Standard_Real f = Draw::Atof(a[n-2]);
|
||||
Standard_Real l = Draw::Atof(a[n-1]);
|
||||
BRep_Builder B;
|
||||
if (n == 4)
|
||||
B.Range(E,f,l);
|
||||
@@ -188,7 +188,7 @@ static Standard_Integer polyline(Draw_Interpretor& , Standard_Integer n, const c
|
||||
BRepBuilderAPI_MakePolygon W;
|
||||
j = 2;
|
||||
for (i = 1; i <= np; i ++) {
|
||||
W.Add(gp_Pnt(atof(a[j]),atof(a[j+1]),atof(a[j+2])));
|
||||
W.Add(gp_Pnt(Draw::Atof(a[j]),Draw::Atof(a[j+1]),Draw::Atof(a[j+2])));
|
||||
j += 3;
|
||||
}
|
||||
DBRep::Set(a[1],W.Wire());
|
||||
@@ -277,11 +277,11 @@ static Standard_Integer mkedge(Draw_Interpretor& di, Standard_Integer n, const c
|
||||
if (n == 5+i) {
|
||||
if (V1.IsNull()) {
|
||||
if (!C.IsNull())
|
||||
edge = BRepBuilderAPI_MakeEdge(C,atof(a[3]),atof(a[4]));
|
||||
edge = BRepBuilderAPI_MakeEdge(C,Draw::Atof(a[3]),Draw::Atof(a[4]));
|
||||
else if (S.IsNull())
|
||||
edge = BRepBuilderAPI_MakeEdge2d(C2d,atof(a[3]),atof(a[4]));
|
||||
edge = BRepBuilderAPI_MakeEdge2d(C2d,Draw::Atof(a[3]),Draw::Atof(a[4]));
|
||||
else
|
||||
edge = BRepBuilderAPI_MakeEdge(C2d,S,atof(a[4]),atof(a[5]));
|
||||
edge = BRepBuilderAPI_MakeEdge(C2d,S,Draw::Atof(a[4]),Draw::Atof(a[5]));
|
||||
}
|
||||
else {
|
||||
aLocalShape = DBRep::Get(a[4+i],TopAbs_VERTEX);
|
||||
@@ -300,11 +300,11 @@ static Standard_Integer mkedge(Draw_Interpretor& di, Standard_Integer n, const c
|
||||
TopoDS_Vertex V2 = TopoDS::Vertex(aLocalShape);
|
||||
// TopoDS_Vertex V2 = TopoDS::Vertex(DBRep::Get(a[5+i],TopAbs_VERTEX));
|
||||
if (!C.IsNull())
|
||||
edge = BRepBuilderAPI_MakeEdge(C,V1,V2,atof(a[4]),atof(a[6]));
|
||||
edge = BRepBuilderAPI_MakeEdge(C,V1,V2,Draw::Atof(a[4]),Draw::Atof(a[6]));
|
||||
else if (S.IsNull())
|
||||
edge = BRepBuilderAPI_MakeEdge2d(C2d,V1,V2,atof(a[4]),atof(a[6]));
|
||||
edge = BRepBuilderAPI_MakeEdge2d(C2d,V1,V2,Draw::Atof(a[4]),Draw::Atof(a[6]));
|
||||
else
|
||||
edge = BRepBuilderAPI_MakeEdge(C2d,S,V1,V2,atof(a[5]),atof(a[7]));
|
||||
edge = BRepBuilderAPI_MakeEdge(C2d,S,V1,V2,Draw::Atof(a[5]),Draw::Atof(a[7]));
|
||||
}
|
||||
else
|
||||
return 1;
|
||||
@@ -442,9 +442,9 @@ static Standard_Integer isoedge(Draw_Interpretor& , Standard_Integer n, const ch
|
||||
if (n < 6) return 1;
|
||||
|
||||
Standard_Boolean uiso = *a[0] == 'u';
|
||||
Standard_Real p = atof(a[3]);
|
||||
Standard_Real p1 = atof(a[4]);
|
||||
Standard_Real p2 = atof(a[5]);
|
||||
Standard_Real p = Draw::Atof(a[3]);
|
||||
Standard_Real p1 = Draw::Atof(a[4]);
|
||||
Standard_Real p2 = Draw::Atof(a[5]);
|
||||
TopoDS_Shape Sh = DBRep::Get(a[2],TopAbs_FACE);
|
||||
if (Sh.IsNull()) return 1;
|
||||
TopLoc_Location Loc;
|
||||
@@ -603,8 +603,8 @@ static Standard_Integer profile(Draw_Interpretor& di,
|
||||
di << "profile: The F instruction must precede all moves";
|
||||
return 1;
|
||||
}
|
||||
x0 = x = atof(a[i-1]);
|
||||
y0 = y = atof(a[i]);
|
||||
x0 = x = Draw::Atof(a[i-1]);
|
||||
y0 = y = Draw::Atof(a[i]);
|
||||
stayfirst = Standard_True;
|
||||
break;
|
||||
|
||||
@@ -612,7 +612,7 @@ static Standard_Integer profile(Draw_Interpretor& di,
|
||||
case 'o':
|
||||
i += 3;
|
||||
if (i >= n) goto badargs;
|
||||
P.SetLocation(gp_Pnt(atof(a[i-2]),atof(a[i-1]),atof(a[i])));
|
||||
P.SetLocation(gp_Pnt(Draw::Atof(a[i-2]),Draw::Atof(a[i-1]),Draw::Atof(a[i])));
|
||||
stayfirst = Standard_True;
|
||||
break;
|
||||
|
||||
@@ -621,8 +621,8 @@ static Standard_Integer profile(Draw_Interpretor& di,
|
||||
i += 6;
|
||||
if (i >= n) goto badargs;
|
||||
{
|
||||
gp_Vec vn(atof(a[i-5]),atof(a[i-4]),atof(a[i-3]));
|
||||
gp_Vec vx(atof(a[i-2]),atof(a[i-1]),atof(a[i]));
|
||||
gp_Vec vn(Draw::Atof(a[i-5]),Draw::Atof(a[i-4]),Draw::Atof(a[i-3]));
|
||||
gp_Vec vx(Draw::Atof(a[i-2]),Draw::Atof(a[i-1]),Draw::Atof(a[i]));
|
||||
if (vn.Magnitude() <= Precision::Confusion()) {
|
||||
di << "profile : null direction";
|
||||
return 1;
|
||||
@@ -664,7 +664,7 @@ static Standard_Integer profile(Draw_Interpretor& di,
|
||||
case 'x':
|
||||
i++;
|
||||
if (i >= n) goto badargs;
|
||||
length = atof(a[i]);
|
||||
length = Draw::Atof(a[i]);
|
||||
if ((a[i-1][1] == 'X') || (a[i-1][1] == 'x')) {
|
||||
length -= x;
|
||||
}
|
||||
@@ -676,7 +676,7 @@ static Standard_Integer profile(Draw_Interpretor& di,
|
||||
case 'y':
|
||||
i++;
|
||||
if (i >= n) goto badargs;
|
||||
length = atof(a[i]);
|
||||
length = Draw::Atof(a[i]);
|
||||
if ((a[i-1][1] == 'Y') || (a[i-1][1] == 'y')) {
|
||||
length -= y;
|
||||
}
|
||||
@@ -688,7 +688,7 @@ static Standard_Integer profile(Draw_Interpretor& di,
|
||||
case 'l':
|
||||
i++;
|
||||
if (i >= n) goto badargs;
|
||||
length = atof(a[i]);
|
||||
length = Draw::Atof(a[i]);
|
||||
move = line;
|
||||
break;
|
||||
|
||||
@@ -697,8 +697,8 @@ static Standard_Integer profile(Draw_Interpretor& di,
|
||||
i += 2;
|
||||
if (i >= n) goto badargs;
|
||||
{
|
||||
Standard_Real vx = atof(a[i-1]);
|
||||
Standard_Real vy = atof(a[i]);
|
||||
Standard_Real vx = Draw::Atof(a[i-1]);
|
||||
Standard_Real vy = Draw::Atof(a[i]);
|
||||
if ((a[i-2][1] == 'T') || (a[i-2][1] == 't')) {
|
||||
vx -= x;
|
||||
vy -= y;
|
||||
@@ -716,7 +716,7 @@ static Standard_Integer profile(Draw_Interpretor& di,
|
||||
case 'r':
|
||||
i++;
|
||||
if (i >= n) goto badargs;
|
||||
angle = atof(a[i]) * (M_PI / 180.0);
|
||||
angle = Draw::Atof(a[i]) * (M_PI / 180.0);
|
||||
if ((a[i-1][1] == 'R') || (a[i-1][1] == 'r')) {
|
||||
dx = Cos(angle);
|
||||
dy = Sin(angle);
|
||||
@@ -735,8 +735,8 @@ static Standard_Integer profile(Draw_Interpretor& di,
|
||||
i += 2;
|
||||
if (i >= n) goto badargs;
|
||||
{
|
||||
Standard_Real vx = atof(a[i-1]);
|
||||
Standard_Real vy = atof(a[i]);
|
||||
Standard_Real vx = Draw::Atof(a[i-1]);
|
||||
Standard_Real vy = Draw::Atof(a[i]);
|
||||
length = Sqrt(vx*vx+vy*vy);
|
||||
if (length > Precision::Confusion()) {
|
||||
// move = line; DUB
|
||||
@@ -750,9 +750,9 @@ static Standard_Integer profile(Draw_Interpretor& di,
|
||||
case 'c':
|
||||
i += 2;
|
||||
if (i >= n) goto badargs;
|
||||
radius = atof(a[i-1]);
|
||||
radius = Draw::Atof(a[i-1]);
|
||||
if (Abs(radius) > Precision::Confusion()) {
|
||||
angle = atof(a[i]) * (M_PI / 180.0);
|
||||
angle = Draw::Atof(a[i]) * (M_PI / 180.0);
|
||||
move = circle;
|
||||
}
|
||||
break;
|
||||
@@ -761,7 +761,7 @@ static Standard_Integer profile(Draw_Interpretor& di,
|
||||
case 'i':
|
||||
i++;
|
||||
if (i >= n) goto badargs;
|
||||
length = atof(a[i]);
|
||||
length = Draw::Atof(a[i]);
|
||||
if ((a[i-1][1] == 'X') || (a[i-1][1] == 'x')) {
|
||||
if (Abs(dx) < Precision::Confusion()) {
|
||||
di << "Profile : cannot intersect, arg " << i-1;
|
||||
@@ -1242,8 +1242,8 @@ static Standard_Integer profile2d(Draw_Interpretor& di,
|
||||
di << "profile: The F instruction must precede all moves";
|
||||
return 1;
|
||||
}
|
||||
x0 = x = atof(a[i-1]);
|
||||
y0 = y = atof(a[i]);
|
||||
x0 = x = Draw::Atof(a[i-1]);
|
||||
y0 = y = Draw::Atof(a[i]);
|
||||
stayfirst = Standard_True;
|
||||
break;
|
||||
|
||||
@@ -1251,7 +1251,7 @@ static Standard_Integer profile2d(Draw_Interpretor& di,
|
||||
case 'x':
|
||||
i++;
|
||||
if (i >= n) goto badargs;
|
||||
length = atof(a[i]);
|
||||
length = Draw::Atof(a[i]);
|
||||
if ((a[i-1][1] == 'X') || (a[i-1][1] == 'x')) {
|
||||
length -= x;
|
||||
}
|
||||
@@ -1263,7 +1263,7 @@ static Standard_Integer profile2d(Draw_Interpretor& di,
|
||||
case 'y':
|
||||
i++;
|
||||
if (i >= n) goto badargs;
|
||||
length = atof(a[i]);
|
||||
length = Draw::Atof(a[i]);
|
||||
if ((a[i-1][1] == 'Y') || (a[i-1][1] == 'y')) {
|
||||
length -= y;
|
||||
}
|
||||
@@ -1275,7 +1275,7 @@ static Standard_Integer profile2d(Draw_Interpretor& di,
|
||||
case 'l':
|
||||
i++;
|
||||
if (i >= n) goto badargs;
|
||||
length = atof(a[i]);
|
||||
length = Draw::Atof(a[i]);
|
||||
move = line;
|
||||
break;
|
||||
|
||||
@@ -1284,8 +1284,8 @@ static Standard_Integer profile2d(Draw_Interpretor& di,
|
||||
i += 2;
|
||||
if (i >= n) goto badargs;
|
||||
{
|
||||
Standard_Real vx = atof(a[i-1]);
|
||||
Standard_Real vy = atof(a[i]);
|
||||
Standard_Real vx = Draw::Atof(a[i-1]);
|
||||
Standard_Real vy = Draw::Atof(a[i]);
|
||||
if ((a[i-2][1] == 'T') || (a[i-2][1] == 't')) {
|
||||
vx -= x;
|
||||
vy -= y;
|
||||
@@ -1303,7 +1303,7 @@ static Standard_Integer profile2d(Draw_Interpretor& di,
|
||||
case 'r':
|
||||
i++;
|
||||
if (i >= n) goto badargs;
|
||||
angle = atof(a[i]) * (M_PI / 180.0);
|
||||
angle = Draw::Atof(a[i]) * (M_PI / 180.0);
|
||||
if ((a[i-1][1] == 'R') || (a[i-1][1] == 'r')) {
|
||||
dx = Cos(angle);
|
||||
dy = Sin(angle);
|
||||
@@ -1322,8 +1322,8 @@ static Standard_Integer profile2d(Draw_Interpretor& di,
|
||||
i += 2;
|
||||
if (i >= n) goto badargs;
|
||||
{
|
||||
Standard_Real vx = atof(a[i-1]);
|
||||
Standard_Real vy = atof(a[i]);
|
||||
Standard_Real vx = Draw::Atof(a[i-1]);
|
||||
Standard_Real vy = Draw::Atof(a[i]);
|
||||
length = Sqrt(vx*vx+vy*vy);
|
||||
if (length > Precision::Confusion()) {
|
||||
// move = line; DUB
|
||||
@@ -1337,9 +1337,9 @@ static Standard_Integer profile2d(Draw_Interpretor& di,
|
||||
case 'c':
|
||||
i += 2;
|
||||
if (i >= n) goto badargs;
|
||||
radius = atof(a[i-1]);
|
||||
radius = Draw::Atof(a[i-1]);
|
||||
if (Abs(radius) > Precision::Confusion()) {
|
||||
angle = atof(a[i]) * (M_PI / 180.0);
|
||||
angle = Draw::Atof(a[i]) * (M_PI / 180.0);
|
||||
move = circle;
|
||||
}
|
||||
break;
|
||||
@@ -1348,7 +1348,7 @@ static Standard_Integer profile2d(Draw_Interpretor& di,
|
||||
case 'i':
|
||||
i++;
|
||||
if (i >= n) goto badargs;
|
||||
length = atof(a[i]);
|
||||
length = Draw::Atof(a[i]);
|
||||
if ((a[i-1][1] == 'X') || (a[i-1][1] == 'x')) {
|
||||
if (Abs(dx) < Precision::Confusion()) {
|
||||
di << "Profile : cannot intersect, arg " << i-1;
|
||||
@@ -1394,7 +1394,7 @@ static Standard_Integer profile2d(Draw_Interpretor& di,
|
||||
Handle(Geom2d_TrimmedCurve) ct =
|
||||
new Geom2d_TrimmedCurve(l,0,length);
|
||||
NbCurves++;
|
||||
sprintf(name,"%s_%d",a[1],NbCurves);
|
||||
Sprintf(name,"%s_%d",a[1],NbCurves);
|
||||
DrawTrSurf::Set(name,ct);
|
||||
di.AppendElement(name);
|
||||
x += length*dx;
|
||||
@@ -1420,7 +1420,7 @@ static Standard_Integer profile2d(Draw_Interpretor& di,
|
||||
Handle(Geom2d_TrimmedCurve) ct =
|
||||
new Geom2d_TrimmedCurve(c,0,angle);
|
||||
NbCurves++;
|
||||
sprintf(name,"%s_%d",a[1],NbCurves);
|
||||
Sprintf(name,"%s_%d",a[1],NbCurves);
|
||||
DrawTrSurf::Set(name,ct);
|
||||
di.AppendElement(name);
|
||||
gp_Pnt2d p;
|
||||
@@ -1508,11 +1508,11 @@ Standard_Integer mkoffset(Draw_Interpretor& di,
|
||||
|
||||
Standard_Real U, dU;
|
||||
Standard_Integer Nb;
|
||||
dU = atof(a[4]);
|
||||
Nb = atoi(a[3]);
|
||||
dU = Draw::Atof(a[4]);
|
||||
Nb = Draw::Atoi(a[3]);
|
||||
|
||||
Standard_Real Alt = 0.;
|
||||
if ( n == 6) Alt = atof(a[5]);
|
||||
if ( n == 6) Alt = Draw::Atof(a[5]);
|
||||
Standard_Integer Compt = 1;
|
||||
|
||||
for ( Standard_Integer i = 1; i <= Nb; i++) {
|
||||
@@ -1523,7 +1523,7 @@ Standard_Integer mkoffset(Draw_Interpretor& di,
|
||||
di << " Parali aux fraises" << "\n";
|
||||
}
|
||||
else {
|
||||
sprintf(name,"%s_%d", a[1], Compt++);
|
||||
Sprintf(name,"%s_%d", a[1], Compt++);
|
||||
char* temp = name; // portage WNT
|
||||
DBRep::Set(temp,Paral.Shape());
|
||||
}
|
||||
@@ -1545,7 +1545,7 @@ Standard_Integer pickface(Draw_Interpretor& di,
|
||||
if (S.IsNull()) return 1;
|
||||
|
||||
char* name = new char[100];
|
||||
sprintf(name,"PickedFace %s",pick_name);
|
||||
Sprintf(name,"PickedFace %s",pick_name);
|
||||
DBRep::Set(name,S);
|
||||
di.AppendElement(name);
|
||||
return 0;
|
||||
@@ -1578,7 +1578,7 @@ Standard_Integer edgeintersector(Draw_Interpretor& di,
|
||||
//-----------------------------------------------------
|
||||
EInter.SetFaces(F,F);
|
||||
Standard_Real TolInter = 1.e-7;
|
||||
if (n == 6) TolInter = atof(a[5]);
|
||||
if (n == 6) TolInter = Draw::Atof(a[5]);
|
||||
EInter.ForceTolerances(TolInter,TolInter);
|
||||
Standard_Boolean reducesegments = Standard_True;
|
||||
EInter.Perform (E[0],E[1],reducesegments);
|
||||
@@ -1601,7 +1601,7 @@ Standard_Integer edgeintersector(Draw_Interpretor& di,
|
||||
gp_Pnt P = P2D.Value();
|
||||
TopoDS_Vertex V = BRepLib_MakeVertex(P);
|
||||
NbV ++;
|
||||
sprintf(name,"%s_%d",a[1],NbV);
|
||||
Sprintf(name,"%s_%d",a[1],NbV);
|
||||
DBRep::Set(name,V);
|
||||
for (Standard_Integer i = 1; i <= 2; i++) {
|
||||
//---------------------------------------------------------------
|
||||
@@ -1687,7 +1687,7 @@ Standard_Integer build3d(Draw_Interpretor& di,
|
||||
if (S.IsNull()) return 1;
|
||||
|
||||
if (n==2) { Ok = BRepLib::BuildCurves3d(S); }
|
||||
else { Ok = BRepLib::BuildCurves3d(S,atof(a[2])); }
|
||||
else { Ok = BRepLib::BuildCurves3d(S,Draw::Atof(a[2])); }
|
||||
//if (!Ok) {cout << " one of the computation failed" << endl;}
|
||||
if (!Ok) {di << " one of the computation failed" << "\n";}
|
||||
|
||||
|
@@ -64,7 +64,7 @@ static Standard_Integer DEP(Draw_Interpretor& theCommands,
|
||||
TopoDS_Shape V = DBRep::Get(a[2]);
|
||||
BRepOffsetAPI_DraftAngle drft(V);
|
||||
|
||||
gp_Dir Dirextract(atof(a[3]),atof(a[4]),atof(a[5]));
|
||||
gp_Dir Dirextract(Draw::Atof(a[3]),Draw::Atof(a[4]),Draw::Atof(a[5]));
|
||||
|
||||
TopoDS_Face F;
|
||||
Standard_Real Angle;
|
||||
@@ -74,9 +74,9 @@ static Standard_Integer DEP(Draw_Interpretor& theCommands,
|
||||
TopoDS_Shape aLocalShape(DBRep::Get(a[8*ii+6],TopAbs_FACE));
|
||||
F = TopoDS::Face(aLocalShape);
|
||||
// F = TopoDS::Face(DBRep::Get(a[8*ii+6],TopAbs_FACE));
|
||||
Angle = atof(a[8*ii+7])*M_PI/180.;
|
||||
Pax.SetCoord(atof(a[8*ii+8]),atof(a[8*ii+9]),atof(a[8*ii+10]));
|
||||
Dax.SetCoord(atof(a[8*ii+11]),atof(a[8*ii+12]),atof(a[8*ii+13]));
|
||||
Angle = Draw::Atof(a[8*ii+7])*M_PI/180.;
|
||||
Pax.SetCoord(Draw::Atof(a[8*ii+8]),Draw::Atof(a[8*ii+9]),Draw::Atof(a[8*ii+10]));
|
||||
Dax.SetCoord(Draw::Atof(a[8*ii+11]),Draw::Atof(a[8*ii+12]),Draw::Atof(a[8*ii+13]));
|
||||
drft.Add(F,Dirextract,Angle,gp_Pln(Pax,Dax));
|
||||
if (!drft.AddDone()) {
|
||||
break;
|
||||
@@ -115,7 +115,7 @@ static Standard_Integer NDEP(Draw_Interpretor& theCommands,
|
||||
|
||||
BRepOffsetAPI_DraftAngle drft(V);
|
||||
|
||||
gp_Dir Dirextract(atof(a[3]),atof(a[4]),atof(a[5]));
|
||||
gp_Dir Dirextract(Draw::Atof(a[3]),Draw::Atof(a[4]),Draw::Atof(a[5]));
|
||||
|
||||
TopoDS_Face F;
|
||||
Standard_Real Angle;
|
||||
@@ -134,13 +134,13 @@ static Standard_Integer NDEP(Draw_Interpretor& theCommands,
|
||||
}
|
||||
|
||||
//#ifdef DEB
|
||||
// Flag = atof(a[9*ii+7]); // BUG?? Real -> Boolean ???
|
||||
// Flag = Draw::Atof(a[9*ii+7]); // BUG?? Real -> Boolean ???
|
||||
//#else
|
||||
Flag = (Standard_Boolean ) atof(a[9*ii+7]);
|
||||
Flag = (Standard_Boolean ) Draw::Atof(a[9*ii+7]);
|
||||
//#endif
|
||||
Angle = atof(a[9*ii+8])*M_PI/180.;
|
||||
Pax.SetCoord(atof(a[9*ii+9]),atof(a[9*ii+10]),atof(a[9*ii+11]));
|
||||
Dax.SetCoord(atof(a[9*ii+12]),atof(a[9*ii+13]),atof(a[9*ii+14]));
|
||||
Angle = Draw::Atof(a[9*ii+8])*M_PI/180.;
|
||||
Pax.SetCoord(Draw::Atof(a[9*ii+9]),Draw::Atof(a[9*ii+10]),Draw::Atof(a[9*ii+11]));
|
||||
Dax.SetCoord(Draw::Atof(a[9*ii+12]),Draw::Atof(a[9*ii+13]),Draw::Atof(a[9*ii+14]));
|
||||
drft.Add(F,Dirextract,Angle,gp_Pln(Pax,Dax), Flag);
|
||||
if (!drft.AddDone()) {
|
||||
break;
|
||||
@@ -175,10 +175,10 @@ static Standard_Integer draft (Draw_Interpretor& di,
|
||||
Standard_Real x, y ,z, teta;
|
||||
TopoDS_Shape SInit = DBRep::Get(a[2]);//shape d'arret
|
||||
|
||||
x = atof(a[3]);
|
||||
y = atof(a[4]); // direction de depouille
|
||||
z = atof(a[5]);
|
||||
teta = atof(a[6]); //angle de depouille (teta)
|
||||
x = Draw::Atof(a[3]);
|
||||
y = Draw::Atof(a[4]); // direction de depouille
|
||||
z = Draw::Atof(a[5]);
|
||||
teta = Draw::Atof(a[6]); //angle de depouille (teta)
|
||||
|
||||
gp_Dir D(x,y,z);
|
||||
|
||||
@@ -238,7 +238,7 @@ static Standard_Integer draft (Draw_Interpretor& di,
|
||||
MkDraft.Perform(Surf, KeepInside);
|
||||
}
|
||||
else { // by Lenght
|
||||
Standard_Real L = atof(a[7]);
|
||||
Standard_Real L = Draw::Atof(a[7]);
|
||||
if (L > 1.e-7) {
|
||||
MkDraft.Perform(L);
|
||||
}
|
||||
|
@@ -84,7 +84,7 @@ static Standard_Integer distmini(Draw_Interpretor& di, Standard_Integer n, const
|
||||
#endif
|
||||
|
||||
char named[100];
|
||||
sprintf(named, "%s%s" ,ns0,"_val");
|
||||
Sprintf(named, "%s%s" ,ns0,"_val");
|
||||
char* tempd = named;
|
||||
Draw::Set(tempd,dst.Value());
|
||||
di << named << " ";
|
||||
@@ -99,8 +99,8 @@ static Standard_Integer distmini(Draw_Interpretor& di, Standard_Integer n, const
|
||||
TopoDS_Vertex V =BRepLib_MakeVertex(P1);
|
||||
char namev[100];
|
||||
if (i1==1)
|
||||
sprintf(namev, "%s" ,ns0);
|
||||
else sprintf(namev, "%s%d" ,ns0,i1);
|
||||
Sprintf(namev, "%s" ,ns0);
|
||||
else Sprintf(namev, "%s%d" ,ns0,i1);
|
||||
char* tempv = namev;
|
||||
DBRep::Set(tempv,V);
|
||||
di << namev << " ";
|
||||
@@ -109,8 +109,8 @@ static Standard_Integer distmini(Draw_Interpretor& di, Standard_Integer n, const
|
||||
{char name[100];
|
||||
TopoDS_Edge E = BRepLib_MakeEdge (P1, P2);
|
||||
if (i1==1)
|
||||
{sprintf(name,"%s",ns0);}
|
||||
else {sprintf(name,"%s%d",ns0,i1);}
|
||||
{Sprintf(name,"%s",ns0);}
|
||||
else {Sprintf(name,"%s%d",ns0,i1);}
|
||||
char* temp = name;
|
||||
DBRep::Set(temp,E);
|
||||
di << name << " " ;
|
||||
|
@@ -172,7 +172,7 @@ static Standard_Integer Loc(Draw_Interpretor& theCommands,
|
||||
i = 0;
|
||||
for (; its.More(); its.Next()) {
|
||||
i++;
|
||||
sprintf(p,"%d",i);
|
||||
Sprintf(p,"%d",i);
|
||||
DBRep::Set(newname,its.Value());
|
||||
}
|
||||
if (i >= 2) {
|
||||
@@ -223,10 +223,10 @@ static Standard_Integer HOLE1(Draw_Interpretor& theCommands,
|
||||
if (narg<10 || narg == 11) return 1;
|
||||
TopoDS_Shape S = DBRep::Get(a[2]);
|
||||
|
||||
gp_Pnt Or(atof(a[3]),atof(a[4]),atof(a[5]));
|
||||
gp_Dir Di(atof(a[6]),atof(a[7]),atof(a[8]));
|
||||
gp_Pnt Or(Draw::Atof(a[3]),Draw::Atof(a[4]),Draw::Atof(a[5]));
|
||||
gp_Dir Di(Draw::Atof(a[6]),Draw::Atof(a[7]),Draw::Atof(a[8]));
|
||||
|
||||
Standard_Real Radius = atof(a[9]);
|
||||
Standard_Real Radius = Draw::Atof(a[9]);
|
||||
|
||||
theHole.Init(S,gp_Ax1(Or,Di));
|
||||
|
||||
@@ -234,8 +234,8 @@ static Standard_Integer HOLE1(Draw_Interpretor& theCommands,
|
||||
theHole.Perform(Radius);
|
||||
}
|
||||
else {
|
||||
Standard_Real pfrom = atof(a[10]);
|
||||
Standard_Real pto = atof(a[11]);
|
||||
Standard_Real pfrom = Draw::Atof(a[10]);
|
||||
Standard_Real pto = Draw::Atof(a[11]);
|
||||
theHole.Perform(Radius,pfrom,pto,WithControl);
|
||||
}
|
||||
|
||||
@@ -257,10 +257,10 @@ static Standard_Integer HOLE2(Draw_Interpretor& theCommands,
|
||||
if (narg<10) return 1;
|
||||
TopoDS_Shape S = DBRep::Get(a[2]);
|
||||
|
||||
gp_Pnt Or(atof(a[3]),atof(a[4]),atof(a[5]));
|
||||
gp_Dir Di(atof(a[6]),atof(a[7]),atof(a[8]));
|
||||
gp_Pnt Or(Draw::Atof(a[3]),Draw::Atof(a[4]),Draw::Atof(a[5]));
|
||||
gp_Dir Di(Draw::Atof(a[6]),Draw::Atof(a[7]),Draw::Atof(a[8]));
|
||||
|
||||
Standard_Real Radius = atof(a[9]);
|
||||
Standard_Real Radius = Draw::Atof(a[9]);
|
||||
|
||||
theHole.Init(S,gp_Ax1(Or,Di));
|
||||
theHole.PerformThruNext(Radius,WithControl);
|
||||
@@ -283,10 +283,10 @@ static Standard_Integer HOLE3(Draw_Interpretor& theCommands,
|
||||
if (narg<10) return 1;
|
||||
TopoDS_Shape S = DBRep::Get(a[2]);
|
||||
|
||||
gp_Pnt Or(atof(a[3]),atof(a[4]),atof(a[5]));
|
||||
gp_Dir Di(atof(a[6]),atof(a[7]),atof(a[8]));
|
||||
gp_Pnt Or(Draw::Atof(a[3]),Draw::Atof(a[4]),Draw::Atof(a[5]));
|
||||
gp_Dir Di(Draw::Atof(a[6]),Draw::Atof(a[7]),Draw::Atof(a[8]));
|
||||
|
||||
Standard_Real Radius = atof(a[9]);
|
||||
Standard_Real Radius = Draw::Atof(a[9]);
|
||||
|
||||
theHole.Init(S,gp_Ax1(Or,Di));
|
||||
theHole.PerformUntilEnd(Radius,WithControl);
|
||||
@@ -309,11 +309,11 @@ static Standard_Integer HOLE4(Draw_Interpretor& theCommands,
|
||||
if (narg<11) return 1;
|
||||
TopoDS_Shape S = DBRep::Get(a[2]);
|
||||
|
||||
gp_Pnt Or(atof(a[3]),atof(a[4]),atof(a[5]));
|
||||
gp_Dir Di(atof(a[6]),atof(a[7]),atof(a[8]));
|
||||
gp_Pnt Or(Draw::Atof(a[3]),Draw::Atof(a[4]),Draw::Atof(a[5]));
|
||||
gp_Dir Di(Draw::Atof(a[6]),Draw::Atof(a[7]),Draw::Atof(a[8]));
|
||||
|
||||
Standard_Real Radius = atof(a[9]);
|
||||
Standard_Real Length = atof(a[10]);
|
||||
Standard_Real Radius = Draw::Atof(a[9]);
|
||||
Standard_Real Length = Draw::Atof(a[10]);
|
||||
|
||||
theHole.Init(S,gp_Ax1(Or,Di));
|
||||
theHole.PerformBlind(Radius,Length,WithControl);
|
||||
@@ -378,19 +378,19 @@ static Standard_Integer PRW(Draw_Interpretor& theCommands,
|
||||
if (narg < 11) {
|
||||
return 1;
|
||||
}
|
||||
V.SetCoord(atof(a[6]),atof(a[7]),atof(a[8]));
|
||||
V.SetCoord(Draw::Atof(a[6]),Draw::Atof(a[7]),Draw::Atof(a[8]));
|
||||
FFrom = DBRep::Get(a[4],TopAbs_SHAPE);
|
||||
FUntil = DBRep::Get(a[5],TopAbs_SHAPE);
|
||||
borne = 9;
|
||||
}
|
||||
else {
|
||||
V.SetCoord(atof(a[5]),atof(a[6]),atof(a[7]));
|
||||
V.SetCoord(Draw::Atof(a[5]),Draw::Atof(a[6]),Draw::Atof(a[7]));
|
||||
FUntil = DBRep::Get(a[4],TopAbs_SHAPE);
|
||||
borne = 8;
|
||||
}
|
||||
}
|
||||
else {
|
||||
V.SetCoord(atof(a[4]),atof(a[5]),atof(a[6]));
|
||||
V.SetCoord(Draw::Atof(a[4]),Draw::Atof(a[5]),Draw::Atof(a[6]));
|
||||
borne = 7;
|
||||
}
|
||||
Standard_Real Length = V.Magnitude();
|
||||
@@ -554,19 +554,19 @@ static Standard_Integer PRF(Draw_Interpretor& theCommands,
|
||||
return 1;
|
||||
}
|
||||
borne = 9;
|
||||
V.SetCoord(atof(a[6]),atof(a[7]),atof(a[8]));
|
||||
V.SetCoord(Draw::Atof(a[6]),Draw::Atof(a[7]),Draw::Atof(a[8]));
|
||||
FFrom = DBRep::Get(a[4],TopAbs_SHAPE);
|
||||
FUntil = DBRep::Get(a[5],TopAbs_SHAPE);
|
||||
}
|
||||
else {
|
||||
borne = 8;
|
||||
V.SetCoord(atof(a[5]),atof(a[6]),atof(a[7]));
|
||||
V.SetCoord(Draw::Atof(a[5]),Draw::Atof(a[6]),Draw::Atof(a[7]));
|
||||
FUntil = DBRep::Get(a[4],TopAbs_SHAPE);
|
||||
}
|
||||
}
|
||||
else {
|
||||
borne = 7;
|
||||
V.SetCoord(atof(a[4]),atof(a[5]),atof(a[6]));
|
||||
V.SetCoord(Draw::Atof(a[4]),Draw::Atof(a[5]),Draw::Atof(a[6]));
|
||||
}
|
||||
Standard_Real Length = V.Magnitude();
|
||||
if (Length < Precision::Confusion()) {
|
||||
@@ -813,7 +813,7 @@ Standard_Integer thickshell(Draw_Interpretor& ,
|
||||
TopoDS_Shape S = DBRep::Get(a[2]);
|
||||
if (S.IsNull()) return 1;
|
||||
|
||||
Standard_Real Of = atof(a[3]);
|
||||
Standard_Real Of = Draw::Atof(a[3]);
|
||||
|
||||
GeomAbs_JoinType JT= GeomAbs_Arc;
|
||||
if (n > 4)
|
||||
@@ -827,7 +827,7 @@ Standard_Integer thickshell(Draw_Interpretor& ,
|
||||
Standard_Boolean Inter = Standard_False; //Standard_True;
|
||||
Standard_Real Tol = Precision::Confusion();
|
||||
if (n > 5)
|
||||
Tol = atof(a[5]);
|
||||
Tol = Draw::Atof(a[5]);
|
||||
|
||||
BRepOffset_MakeOffset B;
|
||||
B.Initialize(S,Of,Tol,BRepOffset_Skin,Inter,0,JT, Standard_True);
|
||||
@@ -859,7 +859,7 @@ Standard_Integer offsetshape(Draw_Interpretor& ,
|
||||
TopoDS_Shape S = DBRep::Get(a[2]);
|
||||
if (S.IsNull()) return 1;
|
||||
|
||||
Standard_Real Of = atof(a[3]);
|
||||
Standard_Real Of = Draw::Atof(a[3]);
|
||||
Standard_Boolean Inter = (!strcmp(a[0],"offsetcompshape"));
|
||||
GeomAbs_JoinType JT= GeomAbs_Arc;
|
||||
if (!strcmp(a[0],"offsetinter")) {
|
||||
@@ -874,7 +874,7 @@ Standard_Integer offsetshape(Draw_Interpretor& ,
|
||||
TopoDS_Shape SF = DBRep::Get(a[4],TopAbs_FACE);
|
||||
if (SF.IsNull()) {
|
||||
IB = 5;
|
||||
Tol = atof(a[4]);
|
||||
Tol = Draw::Atof(a[4]);
|
||||
}
|
||||
}
|
||||
B.Initialize(S,Of,Tol,BRepOffset_Skin,Inter,0,JT);
|
||||
@@ -947,7 +947,7 @@ Standard_Integer offsetparameter(Draw_Interpretor& di,
|
||||
|
||||
if ( n < 4 ) return 1;
|
||||
|
||||
TheTolerance = atof(a[1]);
|
||||
TheTolerance = Draw::Atof(a[1]);
|
||||
TheInter = strcmp(a[2],"p");
|
||||
|
||||
if ( !strcmp(a[3],"a")) TheJoin = GeomAbs_Arc;
|
||||
@@ -970,7 +970,7 @@ Standard_Integer offsetload(Draw_Interpretor& ,
|
||||
TopoDS_Shape S = DBRep::Get(a[1]);
|
||||
if (S.IsNull()) return 1;
|
||||
|
||||
Standard_Real Of = atof(a[2]);
|
||||
Standard_Real Of = Draw::Atof(a[2]);
|
||||
TheRadius = Of;
|
||||
// Standard_Boolean Inter = Standard_True;
|
||||
|
||||
@@ -1003,7 +1003,7 @@ Standard_Integer offsetonface(Draw_Interpretor&, Standard_Integer n, const char*
|
||||
for (Standard_Integer i = 1 ; i < n; i+=2) {
|
||||
TopoDS_Shape SF = DBRep::Get(a[i],TopAbs_FACE);
|
||||
if (!SF.IsNull()) {
|
||||
Standard_Real Of = atof(a[i+1]);
|
||||
Standard_Real Of = Draw::Atof(a[i+1]);
|
||||
TheOffset.SetOffsetOnFace(TopoDS::Face(SF),Of);
|
||||
}
|
||||
}
|
||||
@@ -1123,7 +1123,7 @@ static Standard_Integer ROW(Draw_Interpretor& theCommands,
|
||||
|
||||
FFrom = DBRep::Get(a[4],TopAbs_SHAPE);
|
||||
if (FFrom.IsNull()) {
|
||||
Angle = atof(a[4]);
|
||||
Angle = Draw::Atof(a[4]);
|
||||
Angle *=M_PI/180.;
|
||||
i = 5;
|
||||
}
|
||||
@@ -1144,8 +1144,8 @@ static Standard_Integer ROW(Draw_Interpretor& theCommands,
|
||||
}
|
||||
borne = i+6;
|
||||
|
||||
Or.SetCoord(atof(a[i]),atof(a[i+1]),atof(a[i+2]));
|
||||
D.SetCoord(atof(a[i+3]),atof(a[i+4]),atof(a[i+5]));
|
||||
Or.SetCoord(Draw::Atof(a[i]),Draw::Atof(a[i+1]),Draw::Atof(a[i+2]));
|
||||
D.SetCoord(Draw::Atof(a[i+3]),Draw::Atof(a[i+4]),Draw::Atof(a[i+5]));
|
||||
gp_Ax1 theAxis(Or,D);
|
||||
|
||||
TopoDS_Shape aLocalShape(DBRep::Get(a[borne],TopAbs_FACE));
|
||||
@@ -1284,7 +1284,7 @@ static Standard_Integer ROF(Draw_Interpretor& theCommands,
|
||||
|
||||
FFrom = DBRep::Get(a[4],TopAbs_SHAPE);
|
||||
if (FFrom.IsNull()) {
|
||||
Angle = atof(a[4]);
|
||||
Angle = Draw::Atof(a[4]);
|
||||
Angle *=M_PI/180.;
|
||||
i = 5;
|
||||
}
|
||||
@@ -1305,8 +1305,8 @@ static Standard_Integer ROF(Draw_Interpretor& theCommands,
|
||||
}
|
||||
|
||||
borne = i+6;
|
||||
Or.SetCoord(atof(a[i]),atof(a[i+1]),atof(a[i+2]));
|
||||
D.SetCoord(atof(a[i+3]),atof(a[i+4]),atof(a[i+5]));
|
||||
Or.SetCoord(Draw::Atof(a[i]),Draw::Atof(a[i+1]),Draw::Atof(a[i+2]));
|
||||
D.SetCoord(Draw::Atof(a[i+3]),Draw::Atof(a[i+4]),Draw::Atof(a[i+5]));
|
||||
gp_Ax1 theAxis(Or,D);
|
||||
|
||||
TopoDS_Shape ToRotate;
|
||||
@@ -1501,8 +1501,8 @@ static Standard_Integer DEFIN(Draw_Interpretor& theCommands,
|
||||
theCommands << "null basis shape";
|
||||
return 1;
|
||||
}
|
||||
Standard_Integer Ifuse = atoi(a[narg-2]);
|
||||
Standard_Integer Imodif = atoi(a[narg-1]);
|
||||
Standard_Integer Ifuse = Draw::Atoi(a[narg-2]);
|
||||
Standard_Integer Imodif = Draw::Atoi(a[narg-1]);
|
||||
|
||||
Standard_Integer Fuse = Ifuse;
|
||||
Standard_Boolean Modify = (Imodif!=0);
|
||||
@@ -1547,9 +1547,9 @@ static Standard_Integer DEFIN(Draw_Interpretor& theCommands,
|
||||
if (narg == 9 || narg == 12 || narg == 14) {
|
||||
// Standard_Real X,Y,Z,X1,Y1,Z1;
|
||||
Standard_Real X,Y,Z;
|
||||
X = atof(a[4]);
|
||||
Y = atof(a[5]);
|
||||
Z = atof(a[6]);
|
||||
X = Draw::Atof(a[4]);
|
||||
Y = Draw::Atof(a[5]);
|
||||
Z = Draw::Atof(a[6]);
|
||||
|
||||
if (narg == 9) { // prism
|
||||
prdef = Standard_True;
|
||||
@@ -1558,11 +1558,11 @@ static Standard_Integer DEFIN(Draw_Interpretor& theCommands,
|
||||
else if(narg == 14) {
|
||||
rfdef = Standard_True;
|
||||
gp_Pnt Or(X, Y, Z);
|
||||
X = atof(a[7]);
|
||||
Y = atof(a[8]);
|
||||
Z = atof(a[9]);
|
||||
Standard_Real H1 = atof(a[10]);
|
||||
Standard_Real H2 = atof(a[11]);
|
||||
X = Draw::Atof(a[7]);
|
||||
Y = Draw::Atof(a[8]);
|
||||
Z = Draw::Atof(a[9]);
|
||||
Standard_Real H1 = Draw::Atof(a[10]);
|
||||
Standard_Real H2 = Draw::Atof(a[11]);
|
||||
gp_Ax1 ax1(Or, gp_Dir(X, Y, Z));
|
||||
theRF.Init(Sbase, W, P, ax1, H1, H2, Fuse, Modify);
|
||||
if (!theRF.IsDone()) {
|
||||
@@ -1577,18 +1577,18 @@ static Standard_Integer DEFIN(Draw_Interpretor& theCommands,
|
||||
else if(narg == 12 && strcasecmp(a[0],"FEATLF")) {
|
||||
rvdef = Standard_True;
|
||||
gp_Pnt Or(X,Y,Z);
|
||||
X = atof(a[7]);
|
||||
Y = atof(a[8]);
|
||||
Z = atof(a[9]);
|
||||
X = Draw::Atof(a[7]);
|
||||
Y = Draw::Atof(a[8]);
|
||||
Z = Draw::Atof(a[9]);
|
||||
theRevol.Init(Sbase,Pbase,Skface,gp_Ax1(Or,gp_Dir(X,Y,Z)),
|
||||
Fuse,Modify);
|
||||
}
|
||||
else {
|
||||
lfdef = Standard_True;
|
||||
gp_Vec Direct(X,Y,Z);
|
||||
X = atof(a[7]);
|
||||
Y = atof(a[8]);
|
||||
Z = atof(a[9]);
|
||||
X = Draw::Atof(a[7]);
|
||||
Y = Draw::Atof(a[8]);
|
||||
Z = Draw::Atof(a[9]);
|
||||
theLF.Init(Sbase, W, P, Direct, gp_Vec(X,Y,Z), Fuse,Modify);
|
||||
if (!theLF.IsDone()) {
|
||||
se = theLF.CurrentStatusError();
|
||||
@@ -1606,7 +1606,7 @@ static Standard_Integer DEFIN(Draw_Interpretor& theCommands,
|
||||
theCommands << "Invalid DPrism base";
|
||||
return 1;
|
||||
}
|
||||
Standard_Real Angle = atof(a[4])*M_PI/360;
|
||||
Standard_Real Angle = Draw::Atof(a[4])*M_PI/360;
|
||||
dprdef = Standard_True;
|
||||
theDPrism.Init(Sbase,TopoDS::Face(Pbase),Skface,Angle,Fuse,Modify);
|
||||
}
|
||||
@@ -1785,7 +1785,7 @@ static Standard_Integer PERF(Draw_Interpretor& theCommands,
|
||||
return 1;
|
||||
}
|
||||
if (narg == 4) {
|
||||
Standard_Real Val = atof(a[3]);
|
||||
Standard_Real Val = Draw::Atof(a[3]);
|
||||
if (Kas == 1) {
|
||||
thePrism.Perform(Val);
|
||||
}
|
||||
@@ -1806,7 +1806,7 @@ static Standard_Integer PERF(Draw_Interpretor& theCommands,
|
||||
}
|
||||
}
|
||||
else if(narg == 5) {
|
||||
Standard_Real Val = atof(a[3]);
|
||||
Standard_Real Val = Draw::Atof(a[3]);
|
||||
TopoDS_Shape FUntil = DBRep::Get(a[4],TopAbs_SHAPE);
|
||||
if (Kas == 1) {
|
||||
thePrism.PerformUntilHeight(FUntil, Val);
|
||||
@@ -2059,14 +2059,14 @@ static Standard_Integer BOSS(Draw_Interpretor& theCommands,
|
||||
Standard_Integer dprsig=0;
|
||||
if (!strcasecmp("ENDEDGES",a[0])) {
|
||||
Kas = 1;
|
||||
dprsig = atoi(a[4]);
|
||||
dprsig = Draw::Atoi(a[4]);
|
||||
}
|
||||
else if (!strcasecmp("FILLET",a[0])) {
|
||||
Kas = 2;
|
||||
}
|
||||
else if (!strcasecmp("BOSSAGE",a[0])) {
|
||||
Kas = 3;
|
||||
dprsig = atoi(a[5]);
|
||||
dprsig = Draw::Atoi(a[5]);
|
||||
}
|
||||
|
||||
TopoDS_Shape theShapeTop;
|
||||
@@ -2137,7 +2137,7 @@ static Standard_Integer BOSS(Draw_Interpretor& theCommands,
|
||||
|
||||
if (Kas == 2) {
|
||||
for (Standard_Integer ii = 1; ii < (narg-1)/2; ii++){
|
||||
Rad = atof(a[2*ii + 1]);
|
||||
Rad = Draw::Atof(a[2*ii + 1]);
|
||||
if (Rad == 0.) continue;
|
||||
S = DBRep::Get(a[(2*ii+2)],TopAbs_SHAPE);
|
||||
TopExp_Explorer exp;
|
||||
@@ -2151,7 +2151,7 @@ static Standard_Integer BOSS(Draw_Interpretor& theCommands,
|
||||
}
|
||||
}
|
||||
else if (Kas == 3) {
|
||||
Rad = atof(a[3]);
|
||||
Rad = Draw::Atof(a[3]);
|
||||
if (Rad != 0.) {
|
||||
S = theShapeTop;
|
||||
TopExp_Explorer exp;
|
||||
@@ -2163,7 +2163,7 @@ static Standard_Integer BOSS(Draw_Interpretor& theCommands,
|
||||
}
|
||||
}
|
||||
}
|
||||
Rad = atof(a[4]);
|
||||
Rad = Draw::Atof(a[4]);
|
||||
if (Rad != 0.) {
|
||||
S = theShapeBottom;
|
||||
TopExp_Explorer exp;
|
||||
|
@@ -103,7 +103,7 @@ static Standard_Integer chfi2d(Draw_Interpretor& di, Standard_Integer n, const c
|
||||
return 1;
|
||||
}
|
||||
|
||||
Standard_Real p1 = atof(a[i+1]);
|
||||
Standard_Real p1 = Draw::Atof(a[i+1]);
|
||||
if (*a[i] == 'F') {
|
||||
MF.AddFillet(V,p1);
|
||||
}
|
||||
@@ -116,7 +116,7 @@ static Standard_Integer chfi2d(Draw_Interpretor& di, Standard_Integer n, const c
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
Standard_Real p2 = atof(a[i+2]);
|
||||
Standard_Real p2 = Draw::Atof(a[i+2]);
|
||||
if (a[i][2] == 'D') {
|
||||
MF.AddChamfer(E1,E2,p1,p2);
|
||||
}
|
||||
|
@@ -109,7 +109,7 @@ static Standard_Integer contblend(Draw_Interpretor& di, Standard_Integer narg, c
|
||||
}
|
||||
else {
|
||||
if (narg >3) return 1;
|
||||
if (narg == 3) { tapp_angle = Abs(atof(a[2])); }
|
||||
if (narg == 3) { tapp_angle = Abs(Draw::Atof(a[2])); }
|
||||
char c=a[1][1];
|
||||
switch (c) {
|
||||
case '0':
|
||||
@@ -149,10 +149,10 @@ static Standard_Integer tolblend(Draw_Interpretor& di, Standard_Integer narg, co
|
||||
return 0;
|
||||
}
|
||||
else if(narg == 5){
|
||||
ta = atof(a[1]);
|
||||
t3d = atof(a[2]);
|
||||
t2d = atof(a[3]);
|
||||
fl = atof(a[4]);
|
||||
ta = Draw::Atof(a[1]);
|
||||
t3d = Draw::Atof(a[2]);
|
||||
t2d = Draw::Atof(a[3]);
|
||||
fl = Draw::Atof(a[4]);
|
||||
return 0;
|
||||
}
|
||||
return 1;
|
||||
@@ -180,7 +180,7 @@ static Standard_Integer BLEND(Draw_Interpretor& di, Standard_Integer narg, const
|
||||
TopoDS_Edge E;
|
||||
Standard_Integer nbedge = 0;
|
||||
for (Standard_Integer ii = 1; ii < (narg-1)/2; ii++){
|
||||
Rad = atof(a[2*ii + 1]);
|
||||
Rad = Draw::Atof(a[2*ii + 1]);
|
||||
TopoDS_Shape aLocalEdge(DBRep::Get(a[(2*ii+2)],TopAbs_EDGE));
|
||||
E = TopoDS::Edge(aLocalEdge);
|
||||
// E = TopoDS::Edge(DBRep::Get(a[(2*ii+2)],TopAbs_EDGE));
|
||||
@@ -207,13 +207,13 @@ static void PrintHist(const TopoDS_Shape& S,
|
||||
B.Add(C,S);
|
||||
char localname[100];
|
||||
if(nbgen<10){
|
||||
sprintf(localname,"generated_00%d", nbgen++);
|
||||
Sprintf(localname,"generated_00%d", nbgen++);
|
||||
}
|
||||
else if(nbgen<100){
|
||||
sprintf(localname,"generated_0%d", nbgen++);
|
||||
Sprintf(localname,"generated_0%d", nbgen++);
|
||||
}
|
||||
else {
|
||||
sprintf(localname,"generated_%d", nbgen++);
|
||||
Sprintf(localname,"generated_%d", nbgen++);
|
||||
}
|
||||
for(; It.More(); It.Next()){
|
||||
B.Add(C,It.Value());
|
||||
@@ -299,8 +299,8 @@ static Standard_Integer UPDATEVOL(Draw_Interpretor& di,
|
||||
TopoDS_Edge E = TopoDS::Edge(aLocalEdge);
|
||||
// TopoDS_Edge E = TopoDS::Edge(DBRep::Get(a[1],TopAbs_EDGE));
|
||||
for (Standard_Integer ii = 1; ii <= (narg/2)-1; ii++){
|
||||
Par = atof(a[2*ii]);
|
||||
Rad = atof(a[2*ii + 1]);
|
||||
Par = Draw::Atof(a[2*ii]);
|
||||
Rad = Draw::Atof(a[2*ii + 1]);
|
||||
uandr.ChangeValue(ii).SetCoord(Par,Rad);
|
||||
}
|
||||
Rake->Add(uandr,E);
|
||||
@@ -341,7 +341,7 @@ Standard_Integer topoblend(Draw_Interpretor& di, Standard_Integer narg, const ch
|
||||
Standard_Boolean fuse = !strcmp(a[0],"fubl");
|
||||
TopoDS_Shape S1 = DBRep::Get(a[2]);
|
||||
TopoDS_Shape S2 = DBRep::Get(a[3]);
|
||||
Standard_Real Rad = atof(a[4]);
|
||||
Standard_Real Rad = Draw::Atof(a[4]);
|
||||
BRepAlgo_BooleanOperation* BC;
|
||||
if(fuse){
|
||||
BC = new BRepAlgo_Fuse(S1,S2);
|
||||
@@ -402,7 +402,7 @@ Standard_Integer boptopoblend(Draw_Interpretor& di, Standard_Integer narg, const
|
||||
printf(" Null shapes are not allowed \n");
|
||||
return 1;
|
||||
}
|
||||
Standard_Real Rad = atof(a[4]);
|
||||
Standard_Real Rad = Draw::Atof(a[4]);
|
||||
|
||||
BOPTools_DSFiller theDSFiller;
|
||||
|
||||
@@ -476,7 +476,7 @@ static Standard_Integer blend1(Draw_Interpretor& di, Standard_Integer narg, cons
|
||||
Standard_Real Rad;
|
||||
Standard_Boolean simul=Standard_False;
|
||||
const char *ns0=(a[1]);
|
||||
Rad = atof(a[3]);
|
||||
Rad = Draw::Atof(a[3]);
|
||||
TopTools_ListOfShape E;
|
||||
for (i=4; i <=(narg-1) ; i++){
|
||||
TopoDS_Shape edge= DBRep::Get(a[i],TopAbs_EDGE);
|
||||
@@ -559,47 +559,47 @@ static Standard_Integer blend1(Draw_Interpretor& di, Standard_Integer narg, cons
|
||||
di<<"precision "<< i << "= "<<Rakk.TolApp3d(i)<<"\n";
|
||||
|
||||
// display resulting surfaces
|
||||
sprintf(localname, "%s%d" ,ns0,i);
|
||||
Sprintf(localname, "%s%d" ,ns0,i);
|
||||
temp = localname;
|
||||
DrawTrSurf::Set(temp,Rakk.SurfaceFillet(i));
|
||||
di << localname<< " ";
|
||||
|
||||
// display curves 3d
|
||||
sprintf(localname, "%s%d" ,"courb1",i);
|
||||
Sprintf(localname, "%s%d" ,"courb1",i);
|
||||
temp =localname;
|
||||
DrawTrSurf::Set(temp,Rakk.CurveOnFace1(i));
|
||||
di << localname<< " ";
|
||||
sprintf(localname, "%s%d" ,"courb2",i);
|
||||
Sprintf(localname, "%s%d" ,"courb2",i);
|
||||
temp =localname;
|
||||
DrawTrSurf::Set(temp,Rakk.CurveOnFace2(i));
|
||||
di << localname<< " ";
|
||||
|
||||
// display supports
|
||||
sprintf(localname, "%s%d" ,"face1",i);
|
||||
Sprintf(localname, "%s%d" ,"face1",i);
|
||||
temp =localname ;
|
||||
DBRep::Set(temp,Rakk.SupportFace1(i));
|
||||
di << localname<< " ";
|
||||
sprintf(localname, "%s%d" ,"face2",i);
|
||||
Sprintf(localname, "%s%d" ,"face2",i);
|
||||
temp =localname;
|
||||
DBRep::Set(temp,Rakk.SupportFace2(i));
|
||||
di << localname<< " ";
|
||||
|
||||
// display Pcurves on faces
|
||||
sprintf(localname, "%s%d" ,"pcurveonface1",i);
|
||||
Sprintf(localname, "%s%d" ,"pcurveonface1",i);
|
||||
temp =localname ;
|
||||
DrawTrSurf::Set(temp,Rakk.PCurveOnFace1(i));
|
||||
di << localname<< " ";
|
||||
sprintf(localname, "%s%d" ,"pcurveonface2",i);
|
||||
Sprintf(localname, "%s%d" ,"pcurveonface2",i);
|
||||
temp =localname;
|
||||
DrawTrSurf::Set(temp,Rakk.PCurveOnFace2(i));
|
||||
di << localname<< " ";
|
||||
|
||||
// display Pcurves on the fillet
|
||||
sprintf(localname, "%s%d" ,"pcurveonconge1",i);
|
||||
Sprintf(localname, "%s%d" ,"pcurveonconge1",i);
|
||||
temp =localname;
|
||||
DrawTrSurf::Set(temp,Rakk.PCurve1OnFillet(i));
|
||||
di << localname<< " ";
|
||||
sprintf(localname, "%s%d" ,"pcurveonconge2",i);
|
||||
Sprintf(localname, "%s%d" ,"pcurveonconge2",i);
|
||||
temp =localname;
|
||||
DrawTrSurf::Set(temp,Rakk.PCurve2OnFillet(i));
|
||||
di << localname<< " ";
|
||||
@@ -613,7 +613,7 @@ static Standard_Integer blend1(Draw_Interpretor& di, Standard_Integer narg, cons
|
||||
for (j=1;j<=s;j++)
|
||||
{Handle(Geom_TrimmedCurve Sec);
|
||||
Rakk.Section(i,j,Sec);
|
||||
sprintf(localname, "%s%d%d" ,"sec",i,j);
|
||||
Sprintf(localname, "%s%d%d" ,"sec",i,j);
|
||||
temp =localname;
|
||||
DrawTrSurf::Set (temp,Sec);
|
||||
di << localname<< " ";}
|
||||
@@ -633,7 +633,7 @@ Standard_Integer rollingball(Draw_Interpretor& di, Standard_Integer n, const cha
|
||||
|
||||
TopoDS_Shape S = DBRep::Get(a[2]);
|
||||
if ( S.IsNull()) return 1;
|
||||
Standard_Real Rad = atof(a[3]);
|
||||
Standard_Real Rad = Draw::Atof(a[3]);
|
||||
|
||||
Standard_Real Tol = t3d; //the same as blend ! 1.e-7;
|
||||
|
||||
@@ -708,7 +708,7 @@ Standard_Integer rollingball(Draw_Interpretor& di, Standard_Integer n, const cha
|
||||
di << " " << From << " " << To << "\n";
|
||||
for (Standard_Integer j = From; j <= To; j++) {
|
||||
const TopoDS_Shape& CurF = Roll.Face(j);
|
||||
sprintf(localname,"%s_%d_%d",a[1],i,j);
|
||||
Sprintf(localname,"%s_%d_%d",a[1],i,j);
|
||||
DBRep::Set(localname,CurF);
|
||||
}
|
||||
}
|
||||
|
@@ -140,7 +140,7 @@ Standard_Integer MaxSegments = defMaxSegments;
|
||||
static Standard_Integer plate (Draw_Interpretor & di,Standard_Integer n,const char** a)
|
||||
{
|
||||
if (n < 8 ) return 1;
|
||||
Standard_Integer NbCurFront=atoi(a[3]);
|
||||
Standard_Integer NbCurFront=Draw::Atoi(a[3]);
|
||||
Handle(GeomPlate_HArray1OfHCurveOnSurface) Fronts = new GeomPlate_HArray1OfHCurveOnSurface(1,NbCurFront);
|
||||
Handle(TColStd_HArray1OfInteger) Tang = new TColStd_HArray1OfInteger(1,NbCurFront);
|
||||
Handle(TColStd_HArray1OfInteger) NbPtsCur = new TColStd_HArray1OfInteger(1,NbCurFront);
|
||||
@@ -158,9 +158,9 @@ static Standard_Integer plate (Draw_Interpretor & di,Standard_Integer n,const ch
|
||||
TopoDS_Face F = TopoDS::Face(aLocalFace);
|
||||
// TopoDS_Face F = TopoDS::Face(DBRep::Get(a[3*i+2],TopAbs_FACE));
|
||||
if(F.IsNull()) return 1;
|
||||
Standard_Integer T = atoi(a[3*i+3]);
|
||||
Standard_Integer T = Draw::Atoi(a[3*i+3]);
|
||||
Tang->SetValue(i,T);
|
||||
NbPtsCur->SetValue(i,atoi(a[2]));
|
||||
NbPtsCur->SetValue(i,Draw::Atoi(a[2]));
|
||||
Handle(BRepAdaptor_HSurface) S = new BRepAdaptor_HSurface();
|
||||
S->ChangeSurface().Initialize(F);
|
||||
Handle(BRepAdaptor_HCurve2d) C = new BRepAdaptor_HCurve2d();
|
||||
@@ -204,7 +204,7 @@ static Standard_Integer plate (Draw_Interpretor & di,Standard_Integer n,const ch
|
||||
B.UpdateVertex(TopExp::LastVertex(E), ErrG0);
|
||||
BRepLib::BuildCurve3d(E);
|
||||
char name[100];
|
||||
sprintf(name,"Edge_%d", i);
|
||||
Sprintf(name,"Edge_%d", i);
|
||||
DBRep::Set(name, E);
|
||||
MW.Add(E);
|
||||
if (MW.IsDone()==Standard_False) {
|
||||
@@ -227,8 +227,8 @@ static Standard_Integer plate (Draw_Interpretor & di,Standard_Integer n,const ch
|
||||
static Standard_Integer gplate (Draw_Interpretor & ,Standard_Integer n,const char** a)
|
||||
{
|
||||
if (n < 6 ) return 1;
|
||||
Standard_Integer NbCurFront=atoi(a[2]),
|
||||
NbPointConstraint=atoi(a[3]);
|
||||
Standard_Integer NbCurFront=Draw::Atoi(a[2]),
|
||||
NbPointConstraint=Draw::Atoi(a[3]);
|
||||
|
||||
GeomPlate_BuildPlateSurface Henri(3,15,2);
|
||||
|
||||
@@ -251,7 +251,7 @@ static Standard_Integer gplate (Draw_Interpretor & ,Standard_Integer n,const cha
|
||||
TopoDS_Edge E = TopoDS::Edge(aLocalShape);
|
||||
// TopoDS_Edge E = TopoDS::Edge(DBRep::Get(a[Indice++],TopAbs_EDGE));
|
||||
if(E.IsNull()) return 1;
|
||||
Conti=atoi(a[Indice++]);
|
||||
Conti=Draw::Atoi(a[Indice++]);
|
||||
if ((Conti==0)||(Conti==-1))
|
||||
{ Handle(BRepAdaptor_HCurve) C = new BRepAdaptor_HCurve();
|
||||
C->ChangeCurve().Initialize(E);
|
||||
@@ -289,10 +289,10 @@ static Standard_Integer gplate (Draw_Interpretor & ,Standard_Integer n,const cha
|
||||
Indice++;
|
||||
}
|
||||
else
|
||||
{ Standard_Real u=atof(a[Indice++]),
|
||||
v=atof(a[Indice++]);
|
||||
{ Standard_Real u=Draw::Atof(a[Indice++]),
|
||||
v=Draw::Atof(a[Indice++]);
|
||||
|
||||
Conti=atoi(a[Indice++]);
|
||||
Conti=Draw::Atoi(a[Indice++]);
|
||||
aLocalFace = DBRep::Get(a[Indice++],TopAbs_FACE);
|
||||
TopoDS_Face F = TopoDS::Face(aLocalFace);
|
||||
// TopoDS_Face F = TopoDS::Face(DBRep::Get(a[Indice++],TopAbs_FACE));
|
||||
@@ -339,8 +339,8 @@ static Standard_Integer gplate (Draw_Interpretor & ,Standard_Integer n,const cha
|
||||
static Standard_Integer approxplate (Draw_Interpretor & di,Standard_Integer n,const char** a)
|
||||
{
|
||||
if (n < 9 ) return 1;
|
||||
Standard_Integer NbMedium=atoi(a[2]);
|
||||
Standard_Integer NbCurFront=atoi(a[3]);
|
||||
Standard_Integer NbMedium=Draw::Atoi(a[2]);
|
||||
Standard_Integer NbCurFront=Draw::Atoi(a[3]);
|
||||
Handle(GeomPlate_HArray1OfHCurveOnSurface) Fronts = new GeomPlate_HArray1OfHCurveOnSurface(1,NbCurFront);
|
||||
Handle(TColStd_HArray1OfInteger) Tang = new TColStd_HArray1OfInteger(1,NbCurFront);
|
||||
Handle(TColStd_HArray1OfInteger) NbPtsCur = new TColStd_HArray1OfInteger(1,NbCurFront);
|
||||
@@ -357,7 +357,7 @@ static Standard_Integer approxplate (Draw_Interpretor & di,Standard_Integer n,co
|
||||
TopoDS_Face F = TopoDS::Face(aLocalFace);
|
||||
// TopoDS_Face F = TopoDS::Face(DBRep::Get(a[3*i+2],TopAbs_FACE));
|
||||
if(F.IsNull()) return 1;
|
||||
Standard_Integer T = atoi(a[3*i+3]);
|
||||
Standard_Integer T = Draw::Atoi(a[3*i+3]);
|
||||
Tang->SetValue(i,T);
|
||||
NbPtsCur->SetValue(i,NbMedium);
|
||||
Handle(BRepAdaptor_HSurface) S = new BRepAdaptor_HSurface();
|
||||
@@ -381,10 +381,10 @@ static Standard_Integer approxplate (Draw_Interpretor & di,Standard_Integer n,co
|
||||
//cout<<" dist. max = "<<dmax<<" ; angle max = "<<anmax<<endl;
|
||||
di<<" dist. max = "<<dmax<<" ; angle max = "<<anmax<<"\n";
|
||||
|
||||
Tol3d = atof(a[3*NbCurFront+4]);
|
||||
Standard_Integer Nbmax = atoi(a[3*NbCurFront+5]);
|
||||
Standard_Integer degmax = atoi(a[3*NbCurFront+6]);
|
||||
Standard_Integer CritOrder = atoi(a[3*NbCurFront+7]);
|
||||
Tol3d = Draw::Atof(a[3*NbCurFront+4]);
|
||||
Standard_Integer Nbmax = Draw::Atoi(a[3*NbCurFront+5]);
|
||||
Standard_Integer degmax = Draw::Atoi(a[3*NbCurFront+6]);
|
||||
Standard_Integer CritOrder = Draw::Atoi(a[3*NbCurFront+7]);
|
||||
Handle(GeomPlate_Surface) surf = Henri.Surface();
|
||||
Handle(Geom_BSplineSurface) support;
|
||||
|
||||
@@ -462,9 +462,9 @@ static Standard_Integer filling( Draw_Interpretor & di, Standard_Integer n, cons
|
||||
#endif
|
||||
|
||||
if (n < 7) return 1;
|
||||
Standard_Integer NbBounds = atoi( a[2] );
|
||||
Standard_Integer NbConstraints = atoi( a[3] );
|
||||
Standard_Integer NbPoints = atoi( a[4] );
|
||||
Standard_Integer NbBounds = Draw::Atoi( a[2] );
|
||||
Standard_Integer NbConstraints = Draw::Atoi( a[3] );
|
||||
Standard_Integer NbPoints = Draw::Atoi( a[4] );
|
||||
|
||||
BRepOffsetAPI_MakeFilling MakeFilling( Degree,
|
||||
NbPtsOnCur,
|
||||
@@ -502,7 +502,7 @@ static Standard_Integer filling( Draw_Interpretor & di, Standard_Integer n, cons
|
||||
if (! F.IsNull())
|
||||
i++;
|
||||
|
||||
Order = atoi( a[i++] );
|
||||
Order = Draw::Atoi( a[i++] );
|
||||
|
||||
if (! E.IsNull() && ! F.IsNull())
|
||||
MakeFilling.Add( E, F, (GeomAbs_Shape)Order );
|
||||
@@ -539,7 +539,7 @@ static Standard_Integer filling( Draw_Interpretor & di, Standard_Integer n, cons
|
||||
if (! F.IsNull())
|
||||
i++;
|
||||
|
||||
Order = atoi( a[i++] );
|
||||
Order = Draw::Atoi( a[i++] );
|
||||
|
||||
if (F.IsNull())
|
||||
MakeFilling.Add( E, (GeomAbs_Shape)Order, Standard_False );
|
||||
@@ -555,7 +555,7 @@ static Standard_Integer filling( Draw_Interpretor & di, Standard_Integer n, cons
|
||||
}
|
||||
else
|
||||
{
|
||||
Standard_Real U = atof( a[i++] ), V = atof( a[i++] );
|
||||
Standard_Real U = Draw::Atof( a[i++] ), V = Draw::Atof( a[i++] );
|
||||
//aLocalFace = DBRep::Get( a[i++], TopAbs_FACE );
|
||||
//F = TopoDS::Face( aLocalFace);
|
||||
F = TopoDS::Face( DBRep::Get(a[i++], TopAbs_FACE));
|
||||
@@ -565,7 +565,7 @@ static Standard_Integer filling( Draw_Interpretor & di, Standard_Integer n, cons
|
||||
di<<"Wrong parameters"<<"\n";
|
||||
return 1;
|
||||
}
|
||||
Order = atoi( a[i++] );
|
||||
Order = Draw::Atoi( a[i++] );
|
||||
|
||||
MakeFilling.Add( U, V, F, (GeomAbs_Shape)Order );
|
||||
}
|
||||
@@ -669,22 +669,22 @@ static Standard_Integer fillingparam( Draw_Interpretor & di, Standard_Integer n,
|
||||
}
|
||||
else if (strcmp( flag, "-r" ) == 0 && n == 6)
|
||||
{
|
||||
Degree = atoi( a[2] );
|
||||
NbPtsOnCur = atoi( a[3] );
|
||||
NbIter = atoi( a[4] );
|
||||
Anisotropie = atoi( a[5] );
|
||||
Degree = Draw::Atoi( a[2] );
|
||||
NbPtsOnCur = Draw::Atoi( a[3] );
|
||||
NbIter = Draw::Atoi( a[4] );
|
||||
Anisotropie = Draw::Atoi( a[5] );
|
||||
}
|
||||
else if (strcmp( flag, "-c" ) == 0 && n == 6)
|
||||
{
|
||||
Tol2d = atof( a[2] );
|
||||
Tol3d = atof( a[3] );
|
||||
TolAng = atof( a[4] );
|
||||
TolCurv = atof( a[5] );
|
||||
Tol2d = Draw::Atof( a[2] );
|
||||
Tol3d = Draw::Atof( a[3] );
|
||||
TolAng = Draw::Atof( a[4] );
|
||||
TolCurv = Draw::Atof( a[5] );
|
||||
}
|
||||
else if (strcmp( flag, "-a" ) == 0 && n == 4)
|
||||
{
|
||||
MaxDeg = atoi( a[2] );
|
||||
MaxSegments = atoi( a[3] );
|
||||
MaxDeg = Draw::Atoi( a[2] );
|
||||
MaxSegments = Draw::Atoi( a[3] );
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@@ -63,7 +63,7 @@ Standard_Integer props(Draw_Interpretor& di, Standard_Integer n, const char** a)
|
||||
Standard_Real eps = 1.0;
|
||||
Standard_Boolean witheps = Standard_False;
|
||||
if(n > 2 && *a[2]=='c' || n > 3 && *a[3]=='c') onlyClosed = Standard_True;
|
||||
if(n > 2 && *a[2]!='c' && n != 5) {eps = atof (a[2]); witheps = Standard_True;}
|
||||
if(n > 2 && *a[2]!='c' && n != 5) {eps = Draw::Atof (a[2]); witheps = Standard_True;}
|
||||
|
||||
if (witheps){
|
||||
if (Abs(eps) < Precision::Angular()) return 2;
|
||||
@@ -177,13 +177,13 @@ Standard_Integer vpropsgk(Draw_Interpretor& di, Standard_Integer n, const char**
|
||||
//Standard_Real aDefaultTol = 1.e-3;
|
||||
Standard_Integer mode = 0;
|
||||
|
||||
eps = atof(a[2]);
|
||||
mode = atoi(a[3]);
|
||||
eps = Draw::Atof(a[2]);
|
||||
mode = Draw::Atoi(a[3]);
|
||||
if(mode > 0) onlyClosed = Standard_True;
|
||||
mode = atoi(a[4]);
|
||||
mode = Draw::Atoi(a[4]);
|
||||
if(mode > 0) isUseSpan = Standard_True;
|
||||
|
||||
mode = atoi(a[5]);
|
||||
mode = Draw::Atoi(a[5]);
|
||||
if(mode == 1 || mode == 3) CGFlag = Standard_True;
|
||||
if(mode == 2 || mode == 3) IFlag = Standard_True;
|
||||
|
||||
|
@@ -21,6 +21,7 @@
|
||||
|
||||
#include <BRepTest.hxx>
|
||||
|
||||
#include <Draw.hxx>
|
||||
#include <Draw_Interpretor.hxx>
|
||||
#include <DBRep.hxx>
|
||||
#include <DrawTrSurf.hxx>
|
||||
@@ -197,12 +198,12 @@ Standard_Integer subshape(Draw_Interpretor& di, Standard_Integer n, const char**
|
||||
p++;
|
||||
Standard_Integer i = 0;
|
||||
if (n == 3) {
|
||||
Standard_Integer isub = atoi(a[2]);
|
||||
Standard_Integer isub = Draw::Atoi(a[2]);
|
||||
TopoDS_Iterator itr(S);
|
||||
while (itr.More()) {
|
||||
i++;
|
||||
if ( i == isub ) {
|
||||
sprintf(p,"%d",i);
|
||||
Sprintf(p,"%d",i);
|
||||
DBRep::Set(newname,itr.Value());
|
||||
di.AppendElement(newname);
|
||||
break;
|
||||
@@ -254,7 +255,7 @@ Standard_Integer subshape(Draw_Interpretor& di, Standard_Integer n, const char**
|
||||
return 1;
|
||||
}
|
||||
|
||||
Standard_Integer isub = atoi(a[3]);
|
||||
Standard_Integer isub = Draw::Atoi(a[3]);
|
||||
TopTools_MapOfShape M;
|
||||
M.Add(S);
|
||||
TopExp_Explorer ex(S,typ);
|
||||
@@ -262,7 +263,7 @@ Standard_Integer subshape(Draw_Interpretor& di, Standard_Integer n, const char**
|
||||
if (M.Add(ex.Current())) {
|
||||
i++;
|
||||
if ( i == isub ) {
|
||||
sprintf(p,"%d",i);
|
||||
Sprintf(p,"%d",i);
|
||||
DBRep::Set(newname,ex.Current());
|
||||
di.AppendElement(newname);
|
||||
break;
|
||||
@@ -298,7 +299,7 @@ Standard_Integer brepintcs(Draw_Interpretor& , Standard_Integer n, const char**
|
||||
nbpi++;
|
||||
char name[64];
|
||||
char* temp = name; // pour portage WNT
|
||||
sprintf(temp, "%s_%d", "brics", nbpi);
|
||||
Sprintf(temp, "%s_%d", "brics", nbpi);
|
||||
DrawTrSurf::Set(temp, curp);
|
||||
}
|
||||
}
|
||||
@@ -315,7 +316,7 @@ Standard_Integer brepintcs(Draw_Interpretor& , Standard_Integer n, const char**
|
||||
nbpi++;
|
||||
char name[64];
|
||||
char* temp = name; // pour portage WNT
|
||||
sprintf(temp, "%s_%d", "brics", nbpi);
|
||||
Sprintf(temp, "%s_%d", "brics", nbpi);
|
||||
DrawTrSurf::Set(temp, curp);
|
||||
}
|
||||
}
|
||||
@@ -369,7 +370,7 @@ Standard_Integer MakeShell(Draw_Interpretor& , Standard_Integer , const char** a
|
||||
TopoDS_Face F = TopoDS::Face(InputShape);
|
||||
// TopoDS_Face F = TopoDS::Face(DBRep::Get( a[2] ));
|
||||
|
||||
Standard_Real Off = -atof( a[3] );
|
||||
Standard_Real Off = -Draw::Atof( a[3] );
|
||||
|
||||
BRepOffset_MakeOffset Offset;
|
||||
|
||||
@@ -455,7 +456,7 @@ Standard_Integer xclassify (Draw_Interpretor& aDI, Standard_Integer n, const cha
|
||||
//
|
||||
aTol=1.e-7;
|
||||
if (n==3) {
|
||||
aTol=atof(a[2]);
|
||||
aTol=Draw::Atof(a[2]);
|
||||
}
|
||||
//
|
||||
BRepClass3d_SolidClassifier aSC(aS);
|
||||
|
@@ -46,17 +46,17 @@
|
||||
static Standard_Integer box(Draw_Interpretor& , Standard_Integer n, const char** a)
|
||||
{
|
||||
if (n < 5) return 1;
|
||||
Standard_Real dx = atof(a[n-3]);
|
||||
Standard_Real dy = atof(a[n-2]);
|
||||
Standard_Real dz = atof(a[n-1]);
|
||||
Standard_Real dx = Draw::Atof(a[n-3]);
|
||||
Standard_Real dy = Draw::Atof(a[n-2]);
|
||||
Standard_Real dz = Draw::Atof(a[n-1]);
|
||||
|
||||
TopoDS_Solid S;
|
||||
|
||||
if (n > 5) {
|
||||
if (n < 8) return 1;
|
||||
Standard_Real x = atof(a[2]);
|
||||
Standard_Real y = atof(a[3]);
|
||||
Standard_Real z = atof(a[4]);
|
||||
Standard_Real x = Draw::Atof(a[2]);
|
||||
Standard_Real y = Draw::Atof(a[3]);
|
||||
Standard_Real z = Draw::Atof(a[4]);
|
||||
S = BRepPrimAPI_MakeBox(gp_Pnt(x,y,z),dx,dy,dz);
|
||||
}
|
||||
else {
|
||||
@@ -77,29 +77,29 @@ static Standard_Integer wedge(Draw_Interpretor& , Standard_Integer n, const char
|
||||
|
||||
// Standard_Integer i = 0;
|
||||
if ( n == 15 || n == 18) {
|
||||
gp_Pnt LocalP(atof(a[2]),atof(a[3]),atof(a[4]));
|
||||
gp_Dir LocalN(atof(a[5]),atof(a[6]),atof(a[7]));
|
||||
gp_Dir LocalVx(atof(a[8]),atof(a[9]),atof(a[10]));
|
||||
gp_Pnt LocalP(Draw::Atof(a[2]),Draw::Atof(a[3]),Draw::Atof(a[4]));
|
||||
gp_Dir LocalN(Draw::Atof(a[5]),Draw::Atof(a[6]),Draw::Atof(a[7]));
|
||||
gp_Dir LocalVx(Draw::Atof(a[8]),Draw::Atof(a[9]),Draw::Atof(a[10]));
|
||||
gp_Ax2 Axis(LocalP,LocalN,LocalVx);
|
||||
// gp_Ax2 Axis(gp_Pnt(atof(a[2]),atof(a[3]),atof(a[4])),
|
||||
// gp_Dir(atof(a[5]),atof(a[6]),atof(a[7])),
|
||||
// gp_Dir(atof(a[8]),atof(a[9]),atof(a[10])));
|
||||
// gp_Ax2 Axis(gp_Pnt(Draw::Atof(a[2]),Draw::Atof(a[3]),Draw::Atof(a[4])),
|
||||
// gp_Dir(Draw::Atof(a[5]),Draw::Atof(a[6]),Draw::Atof(a[7])),
|
||||
// gp_Dir(Draw::Atof(a[8]),Draw::Atof(a[9]),Draw::Atof(a[10])));
|
||||
if ( n == 15) {
|
||||
S = BRepPrimAPI_MakeWedge(Axis,
|
||||
atof(a[11]),atof(a[12]),atof(a[13]),atof(a[14]));
|
||||
Draw::Atof(a[11]),Draw::Atof(a[12]),Draw::Atof(a[13]),Draw::Atof(a[14]));
|
||||
}
|
||||
else {
|
||||
S = BRepPrimAPI_MakeWedge(Axis,
|
||||
atof(a[11]),atof(a[12]),atof(a[13]),
|
||||
atof(a[14]),atof(a[15]),atof(a[16]),atof(a[17]));
|
||||
Draw::Atof(a[11]),Draw::Atof(a[12]),Draw::Atof(a[13]),
|
||||
Draw::Atof(a[14]),Draw::Atof(a[15]),Draw::Atof(a[16]),Draw::Atof(a[17]));
|
||||
}
|
||||
}
|
||||
else if (n == 6) {
|
||||
S = BRepPrimAPI_MakeWedge(atof(a[2]),atof(a[3]),atof(a[4]),atof(a[5]));
|
||||
S = BRepPrimAPI_MakeWedge(Draw::Atof(a[2]),Draw::Atof(a[3]),Draw::Atof(a[4]),Draw::Atof(a[5]));
|
||||
}
|
||||
else if (n == 9){
|
||||
S = BRepPrimAPI_MakeWedge(atof(a[2]),atof(a[3]),atof(a[4]),
|
||||
atof(a[5]),atof(a[6]),atof(a[7]),atof(a[8]));
|
||||
S = BRepPrimAPI_MakeWedge(Draw::Atof(a[2]),Draw::Atof(a[3]),Draw::Atof(a[4]),
|
||||
Draw::Atof(a[5]),Draw::Atof(a[6]),Draw::Atof(a[7]),Draw::Atof(a[8]));
|
||||
}
|
||||
else
|
||||
return 1;
|
||||
@@ -120,19 +120,19 @@ static Standard_Integer cylinder(Draw_Interpretor& , Standard_Integer n, const c
|
||||
Handle(Geom_Plane)::DownCast(DrawTrSurf::Get(a[2]));
|
||||
|
||||
if (n == 4) {
|
||||
S = BRepPrimAPI_MakeCylinder(atof(a[2]),atof(a[3]));
|
||||
S = BRepPrimAPI_MakeCylinder(Draw::Atof(a[2]),Draw::Atof(a[3]));
|
||||
}
|
||||
else if (n == 5) {
|
||||
if (P.IsNull())
|
||||
S = BRepPrimAPI_MakeCylinder(atof(a[2]),atof(a[3]),atof(a[4]) * (M_PI / 180.0));
|
||||
S = BRepPrimAPI_MakeCylinder(Draw::Atof(a[2]),Draw::Atof(a[3]),Draw::Atof(a[4]) * (M_PI / 180.0));
|
||||
else
|
||||
S = BRepPrimAPI_MakeCylinder(P->Pln().Position().Ax2(),atof(a[3]),atof(a[4]));
|
||||
S = BRepPrimAPI_MakeCylinder(P->Pln().Position().Ax2(),Draw::Atof(a[3]),Draw::Atof(a[4]));
|
||||
}
|
||||
else if (n == 6) {
|
||||
if (P.IsNull())
|
||||
return 1;
|
||||
else
|
||||
S = BRepPrimAPI_MakeCylinder(P->Pln().Position().Ax2(),atof(a[3]),atof(a[4]),atof(a[5]) * (M_PI / 180.0));
|
||||
S = BRepPrimAPI_MakeCylinder(P->Pln().Position().Ax2(),Draw::Atof(a[3]),Draw::Atof(a[4]),Draw::Atof(a[5]) * (M_PI / 180.0));
|
||||
}
|
||||
else
|
||||
return 1;
|
||||
@@ -154,16 +154,16 @@ static Standard_Integer cone(Draw_Interpretor& , Standard_Integer n, const char*
|
||||
Handle(Geom_Plane)::DownCast(DrawTrSurf::Get(a[2]));
|
||||
|
||||
if (n == 5) {
|
||||
S = BRepPrimAPI_MakeCone(atof(a[2]),atof(a[3]),atof(a[4]));
|
||||
S = BRepPrimAPI_MakeCone(Draw::Atof(a[2]),Draw::Atof(a[3]),Draw::Atof(a[4]));
|
||||
}
|
||||
else if (n == 6) {
|
||||
if (P.IsNull())
|
||||
S = BRepPrimAPI_MakeCone(atof(a[2]),atof(a[3]),atof(a[4]),atof(a[5]) * (M_PI / 180.0));
|
||||
S = BRepPrimAPI_MakeCone(Draw::Atof(a[2]),Draw::Atof(a[3]),Draw::Atof(a[4]),Draw::Atof(a[5]) * (M_PI / 180.0));
|
||||
else
|
||||
S = BRepPrimAPI_MakeCone(P->Pln().Position().Ax2(),atof(a[3]),atof(a[4]),atof(a[5]));
|
||||
S = BRepPrimAPI_MakeCone(P->Pln().Position().Ax2(),Draw::Atof(a[3]),Draw::Atof(a[4]),Draw::Atof(a[5]));
|
||||
}
|
||||
else if (n == 7) {
|
||||
S = BRepPrimAPI_MakeCone(P->Pln().Position().Ax2(),atof(a[3]),atof(a[4]),atof(a[5]),atof(a[6]) * (M_PI / 180.0));
|
||||
S = BRepPrimAPI_MakeCone(P->Pln().Position().Ax2(),Draw::Atof(a[3]),Draw::Atof(a[4]),Draw::Atof(a[5]),Draw::Atof(a[6]) * (M_PI / 180.0));
|
||||
}
|
||||
else
|
||||
return 1;
|
||||
@@ -185,28 +185,28 @@ static Standard_Integer sphere(Draw_Interpretor& , Standard_Integer n, const cha
|
||||
Handle(Geom_Plane)::DownCast(DrawTrSurf::Get(a[2]));
|
||||
|
||||
if (n == 3) {
|
||||
S = BRepPrimAPI_MakeSphere(atof(a[2]));
|
||||
S = BRepPrimAPI_MakeSphere(Draw::Atof(a[2]));
|
||||
}
|
||||
else if (n == 4) {
|
||||
if (P.IsNull())
|
||||
S = BRepPrimAPI_MakeSphere(atof(a[2]),atof(a[3]) * (M_PI / 180.0));
|
||||
S = BRepPrimAPI_MakeSphere(Draw::Atof(a[2]),Draw::Atof(a[3]) * (M_PI / 180.0));
|
||||
else
|
||||
S = BRepPrimAPI_MakeSphere(P->Pln().Position().Ax2(),atof(a[3]));
|
||||
S = BRepPrimAPI_MakeSphere(P->Pln().Position().Ax2(),Draw::Atof(a[3]));
|
||||
}
|
||||
else if (n == 5) {
|
||||
if (P.IsNull())
|
||||
S = BRepPrimAPI_MakeSphere(atof(a[2]),atof(a[3]) * (M_PI / 180.0),atof(a[4]) * (M_PI / 180.0));
|
||||
S = BRepPrimAPI_MakeSphere(Draw::Atof(a[2]),Draw::Atof(a[3]) * (M_PI / 180.0),Draw::Atof(a[4]) * (M_PI / 180.0));
|
||||
else
|
||||
S = BRepPrimAPI_MakeSphere(P->Pln().Position().Ax2(),atof(a[3]),atof(a[4]) * (M_PI / 180.0));
|
||||
S = BRepPrimAPI_MakeSphere(P->Pln().Position().Ax2(),Draw::Atof(a[3]),Draw::Atof(a[4]) * (M_PI / 180.0));
|
||||
}
|
||||
else if (n == 6) {
|
||||
if (P.IsNull())
|
||||
S = BRepPrimAPI_MakeSphere(atof(a[2]),atof(a[3]) * (M_PI / 180.0),atof(a[4]) * (M_PI / 180.0),atof(a[5]) * (M_PI / 180.0));
|
||||
S = BRepPrimAPI_MakeSphere(Draw::Atof(a[2]),Draw::Atof(a[3]) * (M_PI / 180.0),Draw::Atof(a[4]) * (M_PI / 180.0),Draw::Atof(a[5]) * (M_PI / 180.0));
|
||||
else
|
||||
S = BRepPrimAPI_MakeSphere(P->Pln().Position().Ax2(),atof(a[3]),atof(a[4]) * (M_PI / 180.0),atof(a[5]) * (M_PI / 180.0));
|
||||
S = BRepPrimAPI_MakeSphere(P->Pln().Position().Ax2(),Draw::Atof(a[3]),Draw::Atof(a[4]) * (M_PI / 180.0),Draw::Atof(a[5]) * (M_PI / 180.0));
|
||||
}
|
||||
else if (n == 7) {
|
||||
S = BRepPrimAPI_MakeSphere(P->Pln().Position().Ax2(),atof(a[3]),atof(a[4]) * (M_PI / 180.0),atof(a[5]) * (M_PI / 180.0),atof(a[6]) * (M_PI / 180.0));
|
||||
S = BRepPrimAPI_MakeSphere(P->Pln().Position().Ax2(),Draw::Atof(a[3]),Draw::Atof(a[4]) * (M_PI / 180.0),Draw::Atof(a[5]) * (M_PI / 180.0),Draw::Atof(a[6]) * (M_PI / 180.0));
|
||||
}
|
||||
else
|
||||
return 1;
|
||||
@@ -228,33 +228,33 @@ static Standard_Integer torus(Draw_Interpretor& , Standard_Integer n, const char
|
||||
Handle(Geom_Plane)::DownCast(DrawTrSurf::Get(a[2]));
|
||||
|
||||
if (n == 4) {
|
||||
S = BRepPrimAPI_MakeTorus(atof(a[2]),atof(a[3]));
|
||||
S = BRepPrimAPI_MakeTorus(Draw::Atof(a[2]),Draw::Atof(a[3]));
|
||||
}
|
||||
else if (n == 5) {
|
||||
if (P.IsNull())
|
||||
S = BRepPrimAPI_MakeTorus(atof(a[2]),atof(a[3]),atof(a[4]) * (M_PI / 180.0));
|
||||
S = BRepPrimAPI_MakeTorus(Draw::Atof(a[2]),Draw::Atof(a[3]),Draw::Atof(a[4]) * (M_PI / 180.0));
|
||||
else
|
||||
S = BRepPrimAPI_MakeTorus(P->Pln().Position().Ax2(),atof(a[3]),atof(a[4]));
|
||||
S = BRepPrimAPI_MakeTorus(P->Pln().Position().Ax2(),Draw::Atof(a[3]),Draw::Atof(a[4]));
|
||||
}
|
||||
else if (n == 6) {
|
||||
if (P.IsNull())
|
||||
S = BRepPrimAPI_MakeTorus(atof(a[2]),atof(a[3]),
|
||||
atof(a[4]) * (M_PI / 180.0),atof(a[5]) * (M_PI / 180.0));
|
||||
S = BRepPrimAPI_MakeTorus(Draw::Atof(a[2]),Draw::Atof(a[3]),
|
||||
Draw::Atof(a[4]) * (M_PI / 180.0),Draw::Atof(a[5]) * (M_PI / 180.0));
|
||||
else
|
||||
S = BRepPrimAPI_MakeTorus(P->Pln().Position().Ax2(),
|
||||
atof(a[3]),atof(a[4]),atof(a[5]) * (M_PI / 180.0));
|
||||
Draw::Atof(a[3]),Draw::Atof(a[4]),Draw::Atof(a[5]) * (M_PI / 180.0));
|
||||
}
|
||||
else if (n == 7) {
|
||||
if (P.IsNull())
|
||||
S = BRepPrimAPI_MakeTorus(atof(a[2]),atof(a[3]),
|
||||
atof(a[4]) * (M_PI / 180.0),atof(a[5]) * (M_PI / 180.0),atof(a[6]) * (M_PI / 180.0));
|
||||
S = BRepPrimAPI_MakeTorus(Draw::Atof(a[2]),Draw::Atof(a[3]),
|
||||
Draw::Atof(a[4]) * (M_PI / 180.0),Draw::Atof(a[5]) * (M_PI / 180.0),Draw::Atof(a[6]) * (M_PI / 180.0));
|
||||
else
|
||||
S = BRepPrimAPI_MakeTorus(P->Pln().Position().Ax2(),atof(a[3]),
|
||||
atof(a[4]),atof(a[5]) * (M_PI / 180.0),atof(a[6]) * (M_PI / 180.0));
|
||||
S = BRepPrimAPI_MakeTorus(P->Pln().Position().Ax2(),Draw::Atof(a[3]),
|
||||
Draw::Atof(a[4]),Draw::Atof(a[5]) * (M_PI / 180.0),Draw::Atof(a[6]) * (M_PI / 180.0));
|
||||
}
|
||||
else if (n == 8) {
|
||||
S = BRepPrimAPI_MakeTorus(P->Pln().Position().Ax2(),atof(a[3]),atof(a[4]),
|
||||
atof(a[5]) * (M_PI / 180.0),atof(a[6]) * (M_PI / 180.0),atof(a[7]) * (M_PI / 180.0));
|
||||
S = BRepPrimAPI_MakeTorus(P->Pln().Position().Ax2(),Draw::Atof(a[3]),Draw::Atof(a[4]),
|
||||
Draw::Atof(a[5]) * (M_PI / 180.0),Draw::Atof(a[6]) * (M_PI / 180.0),Draw::Atof(a[7]) * (M_PI / 180.0));
|
||||
}
|
||||
else
|
||||
return 1;
|
||||
|
@@ -39,7 +39,7 @@ static Standard_Integer prj(Draw_Interpretor& di, Standard_Integer n, const char
|
||||
if (n < 7) return 1;
|
||||
TopoDS_Shape InpLine = DBRep::Get(a[2]);
|
||||
TopoDS_Shape InpShape = DBRep::Get(a[3]);
|
||||
Standard_Real DX=atof(a[4]),DY=atof(a[5]),DZ=atof(a[6]);
|
||||
Standard_Real DX=Draw::Atof(a[4]),DY=Draw::Atof(a[5]),DZ=Draw::Atof(a[6]);
|
||||
gp_Dir TD(DX,DY,DZ);
|
||||
BRepProj_Projection Prj(InpLine,InpShape,TD);
|
||||
Standard_Integer i = 1;
|
||||
@@ -48,7 +48,7 @@ static Standard_Integer prj(Draw_Interpretor& di, Standard_Integer n, const char
|
||||
|
||||
if (Prj.IsDone()) {
|
||||
while (Prj.More()) {
|
||||
sprintf(newname,"%s_%d",a[1],i);
|
||||
Sprintf(newname,"%s_%d",a[1],i);
|
||||
DBRep::Set(temp,Prj.Current());
|
||||
//cout<<newname<<" ";
|
||||
di<<newname<<" ";
|
||||
@@ -68,7 +68,7 @@ static Standard_Integer cprj(Draw_Interpretor& di, Standard_Integer n, const cha
|
||||
if (n < 7) return 1;
|
||||
TopoDS_Shape InpLine = DBRep::Get(a[2]);
|
||||
TopoDS_Shape InpShape = DBRep::Get(a[3]);
|
||||
Standard_Real PX=atof(a[4]),PY=atof(a[5]),PZ=atof(a[6]);
|
||||
Standard_Real PX=Draw::Atof(a[4]),PY=Draw::Atof(a[5]),PZ=Draw::Atof(a[6]);
|
||||
gp_Pnt P(PX,PY,PZ);
|
||||
BRepProj_Projection Prj(InpLine,InpShape,P);
|
||||
Standard_Integer i = 1;
|
||||
@@ -76,7 +76,7 @@ static Standard_Integer cprj(Draw_Interpretor& di, Standard_Integer n, const cha
|
||||
|
||||
if (Prj.IsDone()) {
|
||||
while (Prj.More()) {
|
||||
sprintf(newname,"%s_%d",a[1],i);
|
||||
Sprintf(newname,"%s_%d",a[1],i);
|
||||
DBRep::Set(temp,Prj.Current());
|
||||
//cout<<newname<<" ";
|
||||
di<<newname<<" ";
|
||||
|
@@ -110,9 +110,9 @@ static Standard_Integer mkface(Draw_Interpretor& , Standard_Integer n, const cha
|
||||
}
|
||||
else {
|
||||
if (mkface)
|
||||
res = BRepBuilderAPI_MakeFace(S,atof(a[3]),atof(a[4]),atof(a[5]),atof(a[6]),Precision::Confusion());
|
||||
res = BRepBuilderAPI_MakeFace(S,Draw::Atof(a[3]),Draw::Atof(a[4]),Draw::Atof(a[5]),Draw::Atof(a[6]),Precision::Confusion());
|
||||
else
|
||||
res = BRepBuilderAPI_MakeShell(S,atof(a[3]),atof(a[4]),atof(a[5]),atof(a[6]),
|
||||
res = BRepBuilderAPI_MakeShell(S,Draw::Atof(a[3]),Draw::Atof(a[4]),Draw::Atof(a[5]),Draw::Atof(a[6]),
|
||||
Segment);
|
||||
}
|
||||
|
||||
@@ -246,7 +246,7 @@ static Standard_Integer pcurve(Draw_Interpretor& , Standard_Integer n, const cha
|
||||
col = DBRep_ColorOrientation(ex.Current().Orientation());
|
||||
DrawTrSurf_CurveColor(col);
|
||||
|
||||
sprintf(name,"%s_%d",a[1],i);
|
||||
Sprintf(name,"%s_%d",a[1],i);
|
||||
DrawTrSurf::Set(name,new Geom2d_TrimmedCurve(c,f,l));
|
||||
}
|
||||
DrawTrSurf_CurveColor(savecol);
|
||||
@@ -309,9 +309,9 @@ static Standard_Integer sewing (Draw_Interpretor& theDi,
|
||||
{
|
||||
if (tolower(theArgv[i][2]) == 'i' && i+1 < theArgc)
|
||||
{
|
||||
if (atof (theArgv[i+1]))
|
||||
if (Draw::Atof (theArgv[i+1]))
|
||||
{
|
||||
aMinTol = atof (theArgv[++i]);
|
||||
aMinTol = Draw::Atof (theArgv[++i]);
|
||||
aSetMinTol = Standard_True;
|
||||
}
|
||||
else
|
||||
@@ -322,8 +322,8 @@ static Standard_Integer sewing (Draw_Interpretor& theDi,
|
||||
}
|
||||
if (tolower(theArgv[i][2]) == 'a' && i+1 < theArgc)
|
||||
{
|
||||
if (atof (theArgv[i+1]))
|
||||
aMaxTol = atof (theArgv[++i]);
|
||||
if (Draw::Atof (theArgv[i+1]))
|
||||
aMaxTol = Draw::Atof (theArgv[++i]);
|
||||
else
|
||||
{
|
||||
theDi << "Error! max tolerance can't possess the null value" << "\n";
|
||||
@@ -351,8 +351,8 @@ static Standard_Integer sewing (Draw_Interpretor& theDi,
|
||||
}
|
||||
else
|
||||
{
|
||||
if (atof (theArgv[i]))
|
||||
aTol = atof (theArgv[i]);
|
||||
if (Draw::Atof (theArgv[i]))
|
||||
aTol = Draw::Atof (theArgv[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -430,7 +430,7 @@ static Standard_Integer continuity (Draw_Interpretor& ,
|
||||
Standard_Integer i=1;
|
||||
if (sh.IsNull()) {
|
||||
if (n < 3) return (1);
|
||||
Standard_Real tol = atof(a[1]);
|
||||
Standard_Real tol = Draw::Atof(a[1]);
|
||||
aFind.Init(tol, Standard_False);
|
||||
i = 2;
|
||||
}
|
||||
@@ -478,7 +478,7 @@ static Standard_Integer encoderegularity (Draw_Interpretor& ,
|
||||
if (n==2)
|
||||
BRepLib::EncodeRegularity(sh);
|
||||
else {
|
||||
Standard_Real Tol = atof(a[2]);
|
||||
Standard_Real Tol = Draw::Atof(a[2]);
|
||||
Tol *= M_PI/180.;
|
||||
BRepLib::EncodeRegularity(sh, Tol);
|
||||
}
|
||||
|
@@ -76,7 +76,7 @@ static Standard_Integer prism(Draw_Interpretor& , Standard_Integer n, const char
|
||||
TopoDS_Shape base = DBRep::Get(a[2]);
|
||||
if (base.IsNull()) return 1;
|
||||
|
||||
gp_Vec V(atof(a[3]),atof(a[4]),atof(a[5]));
|
||||
gp_Vec V(Draw::Atof(a[3]),Draw::Atof(a[4]),Draw::Atof(a[5]));
|
||||
|
||||
Standard_Boolean copy = Standard_False;
|
||||
Standard_Boolean inf = Standard_False;
|
||||
@@ -113,11 +113,11 @@ static Standard_Integer revol(Draw_Interpretor& ,
|
||||
TopoDS_Shape base = DBRep::Get(a[2]);
|
||||
if (base.IsNull()) return 1;
|
||||
|
||||
gp_Pnt P(atof(a[3]),atof(a[4]),atof(a[5]));
|
||||
gp_Dir D(atof(a[6]),atof(a[7]),atof(a[8]));
|
||||
gp_Pnt P(Draw::Atof(a[3]),Draw::Atof(a[4]),Draw::Atof(a[5]));
|
||||
gp_Dir D(Draw::Atof(a[6]),Draw::Atof(a[7]),Draw::Atof(a[8]));
|
||||
gp_Ax1 A(P,D);
|
||||
|
||||
Standard_Real angle = atof(a[9]) * (M_PI / 180.0);
|
||||
Standard_Real angle = Draw::Atof(a[9]) * (M_PI / 180.0);
|
||||
|
||||
Standard_Boolean copy = n > 10;
|
||||
|
||||
@@ -166,7 +166,7 @@ static Standard_Integer geompipe(Draw_Interpretor& ,
|
||||
Handle(GeomAdaptor_HCurve) aAdaptCurve = new GeomAdaptor_HCurve(SpineCurve,aSpFirst,aSpLast);
|
||||
Standard_Boolean ByACR = Standard_False;
|
||||
Standard_Boolean rotate = Standard_False;
|
||||
Standard_Real Radius = atof(a[4]);
|
||||
Standard_Real Radius = Draw::Atof(a[4]);
|
||||
gp_Pnt ctr;
|
||||
gp_Vec norm;
|
||||
ProfileCurve->D1(aSpFirst,ctr,norm);
|
||||
@@ -175,9 +175,9 @@ static Standard_Integer geompipe(Draw_Interpretor& ,
|
||||
Handle(Geom_Circle) cStart=new Geom_Circle(aAx2Start,Radius);
|
||||
Standard_Integer k =5;
|
||||
if(n > k)
|
||||
ByACR = (atoi(a[k++]) ==1);
|
||||
ByACR = (Draw::Atoi(a[k++]) ==1);
|
||||
if(n > k)
|
||||
rotate = (atoi(a[k++])==1);
|
||||
rotate = (Draw::Atoi(a[k++])==1);
|
||||
GeomFill_Pipe aPipe(ProfileCurve,aAdaptCurve,cStart,ByACR,rotate);
|
||||
aPipe.Perform(Standard_True);
|
||||
Handle(Geom_Surface) Sur=aPipe.Surface();
|
||||
@@ -340,8 +340,8 @@ Standard_Integer thrusections(Draw_Interpretor&, Standard_Integer n, const char*
|
||||
|
||||
TopoDS_Shape Shape;
|
||||
|
||||
Standard_Boolean issolid = ( atoi(a[index]) == 1 );
|
||||
Standard_Boolean isruled = ( atoi(a[index+1]) == 1 );
|
||||
Standard_Boolean issolid = ( Draw::Atoi(a[index]) == 1 );
|
||||
Standard_Boolean isruled = ( Draw::Atoi(a[index+1]) == 1 );
|
||||
|
||||
BRepOffsetAPI_ThruSections Generator(issolid,isruled);
|
||||
|
||||
@@ -471,7 +471,7 @@ static Standard_Integer setsweep(Draw_Interpretor& di,
|
||||
di << "bad arguments !" << "\n";
|
||||
return 1;
|
||||
}
|
||||
gp_Dir D(atof(a[2]), atof(a[3]), atof(a[4]));
|
||||
gp_Dir D(Draw::Atof(a[2]), Draw::Atof(a[3]), Draw::Atof(a[4]));
|
||||
Sweep->SetMode(D);;
|
||||
}
|
||||
else if (!strcmp(a[1],"-FX")) {
|
||||
@@ -480,9 +480,9 @@ static Standard_Integer setsweep(Draw_Interpretor& di,
|
||||
di << "bad arguments !" << "\n";
|
||||
return 1;
|
||||
}
|
||||
gp_Dir D(atof(a[2]), atof(a[3]), atof(a[4]));
|
||||
gp_Dir D(Draw::Atof(a[2]), Draw::Atof(a[3]), Draw::Atof(a[4]));
|
||||
if (n==8) {
|
||||
gp_Dir DN(atof(a[5]), atof(a[6]), atof(a[7]));
|
||||
gp_Dir DN(Draw::Atof(a[5]), Draw::Atof(a[6]), Draw::Atof(a[7]));
|
||||
gp_Ax2 Axe(gp_Pnt(0., 0., 0.), D, DN);
|
||||
Sweep->SetMode(Axe);
|
||||
}
|
||||
@@ -502,7 +502,7 @@ static Standard_Integer setsweep(Draw_Interpretor& di,
|
||||
else
|
||||
{
|
||||
TopoDS_Shape Guide = DBRep::Get(a[2],TopAbs_WIRE);
|
||||
Sweep->SetMode(TopoDS::Wire(Guide), atoi(a[3]), atoi(a[4]));
|
||||
Sweep->SetMode(TopoDS::Wire(Guide), Draw::Atoi(a[3]), Draw::Atoi(a[4]));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -591,8 +591,8 @@ static Standard_Integer addsweep(Draw_Interpretor& di,
|
||||
Standard_Integer ii, L= nbreal/2;
|
||||
TColgp_Array1OfPnt2d ParAndRad(1, L);
|
||||
for (ii=1; ii<=L; ii++, cur+=2) {
|
||||
ParAndRad(ii).SetX(atof(a[cur]));
|
||||
ParAndRad(ii).SetY(atof(a[cur+1]));
|
||||
ParAndRad(ii).SetX(Draw::Atof(a[cur]));
|
||||
ParAndRad(ii).SetY(Draw::Atof(a[cur+1]));
|
||||
}
|
||||
thelaw = new (Law_Interpol) ();
|
||||
thelaw->Set(ParAndRad,
|
||||
@@ -749,7 +749,7 @@ static Standard_Integer simulsweep(Draw_Interpretor& di,
|
||||
TopTools_ListOfShape List;
|
||||
TopTools_ListIteratorOfListOfShape it;
|
||||
Standard_Integer N, ii;
|
||||
N = atoi(a[2]);
|
||||
N = Draw::Atoi(a[2]);
|
||||
|
||||
if (n>3) {
|
||||
BRepBuilderAPI_TransitionMode Transition = BRepBuilderAPI_Transformed;
|
||||
@@ -766,7 +766,7 @@ static Standard_Integer simulsweep(Draw_Interpretor& di,
|
||||
// Calculate the result
|
||||
Sweep->Simulate(N, List);
|
||||
for (ii=1, it.Initialize(List); it.More(); it.Next(), ii++) {
|
||||
sprintf(name,"%s_%d",a[1],ii);
|
||||
Sprintf(name,"%s_%d",a[1],ii);
|
||||
DBRep::Set(name, it.Value());
|
||||
}
|
||||
|
||||
|
@@ -196,7 +196,7 @@ static Standard_Integer halfspace(Draw_Interpretor& di,
|
||||
if (n < 6) return 1;
|
||||
|
||||
// Le point indiquant le cote "matiere".
|
||||
gp_Pnt RefPnt = gp_Pnt(atof(a[3]),atof(a[4]),atof(a[5]));
|
||||
gp_Pnt RefPnt = gp_Pnt(Draw::Atof(a[3]),Draw::Atof(a[4]),Draw::Atof(a[5]));
|
||||
|
||||
TopoDS_Shape Face = DBRep::Get(a[2],TopAbs_FACE);
|
||||
if ( Face.IsNull()) {
|
||||
|
Reference in New Issue
Block a user