]> OCCT Git - occt-copy.git/commitdiff
0022898: IGES import fails in german environment
authorabv <abv@opencascade.com>
Fri, 1 Feb 2013 14:41:16 +0000 (18:41 +0400)
committerabv <abv@opencascade.com>
Fri, 1 Feb 2013 14:41:16 +0000 (18:41 +0400)
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

203 files changed:
src/Approx/Approx_SameParameter.cxx
src/BOPTest/BOPTest_BOPCommands.cxx
src/BOPTest/BOPTest_CurveCommands.cxx
src/BOPTest/BOPTest_EFCommands.cxx
src/BOPTest/BOPTest_LowCommands.cxx
src/BOPTest/BOPTest_MTestCommands.cxx
src/BOPTest/BOPTest_TolerCommands.cxx
src/BOPTools/BOPTools_Checker.cxx
src/BRepTest/BRepTest_BasicCommands.cxx
src/BRepTest/BRepTest_ChamferCommands.cxx
src/BRepTest/BRepTest_CheckCommands.cxx
src/BRepTest/BRepTest_CurveCommands.cxx
src/BRepTest/BRepTest_DraftAngleCommands.cxx
src/BRepTest/BRepTest_ExtremaCommands.cxx
src/BRepTest/BRepTest_FeatureCommands.cxx
src/BRepTest/BRepTest_Fillet2DCommands.cxx
src/BRepTest/BRepTest_FilletCommands.cxx
src/BRepTest/BRepTest_FillingCommands.cxx
src/BRepTest/BRepTest_GPropCommands.cxx
src/BRepTest/BRepTest_OtherCommands.cxx
src/BRepTest/BRepTest_PrimitiveCommands.cxx
src/BRepTest/BRepTest_ProjectionCommands.cxx
src/BRepTest/BRepTest_SurfaceCommands.cxx
src/BRepTest/BRepTest_SweepCommands.cxx
src/BRepTest/BRepTest_TopologyCommands.cxx
src/DBRep/DBRep.cxx
src/DDF/DDF_BrowserCommands.cxx
src/DDF/DDF_IOStream.cxx
src/DDF/DDF_TransactionCommands.cxx
src/DDataStd/DDataStd_BasicCommands.cxx
src/DDataStd/DDataStd_ConstraintCommands.cxx
src/DDataStd/DDataStd_DatumCommands.cxx
src/DDataStd/DDataStd_DrawDisplayCommands.cxx
src/DDataStd/DDataStd_TreeCommands.cxx
src/DDocStd/DDocStd_DocumentCommands.cxx
src/DDocStd/DDocStd_MTMCommands.cxx
src/DNaming/DNaming_BasicCommands.cxx
src/DNaming/DNaming_ModelingCommands.cxx
src/DNaming/DNaming_SelectionCommands.cxx
src/DPrsStd/DPrsStd_AISPresentationCommands.cxx
src/Draw/Draw.cdl
src/Draw/Draw.cxx
src/Draw/Draw_Appli.hxx
src/Draw/Draw_BasicCommands.cxx
src/Draw/Draw_GraphicCommands.cxx
src/Draw/Draw_Interpretor.cxx
src/Draw/Draw_ProgressIndicator.cxx
src/Draw/Draw_UnitCommands.cxx
src/Draw/Draw_VariableCommands.cxx
src/DrawDim/DrawDim_PlanarDimensionCommands.cxx
src/DrawTrSurf/DrawTrSurf.cxx
src/DrawTrSurf/DrawTrSurf_Triangulation.cxx
src/Dynamic/Dynamic_FuzzyDefinitionsDictionary.cxx
src/Dynamic/Dynamic_MethodDefinitionsDictionary.cxx
src/Expr/Expr_NumericValue.cxx
src/ExprIntrp/ExprIntrp_yaccintrf.cxx
src/FSD/FSD_CmpFile.cdl
src/FSD/FSD_CmpFile.cxx
src/FSD/FSD_File.cxx
src/GeomProjLib/GeomProjLib.cxx
src/GeometryTest/GeometryTest_API2dCommands.cxx
src/GeometryTest/GeometryTest_APICommands.cxx
src/GeometryTest/GeometryTest_ConstraintCommands.cxx
src/GeometryTest/GeometryTest_ContinuityCommands.cxx
src/GeometryTest/GeometryTest_CurveCommands.cxx
src/GeometryTest/GeometryTest_FairCurveCommands.cxx
src/GeometryTest/GeometryTest_PolyCommands.cxx
src/GeometryTest/GeometryTest_SurfaceCommands.cxx
src/GeometryTest/GeometryTest_TestProjCommands.cxx
src/GeomliteTest/GeomliteTest_API2dCommands.cxx
src/GeomliteTest/GeomliteTest_ApproxCommands.cxx
src/GeomliteTest/GeomliteTest_CurveCommands.cxx
src/GeomliteTest/GeomliteTest_ModificationCommands.cxx
src/GeomliteTest/GeomliteTest_SurfaceCommands.cxx
src/HLRTest/HLRTest.cxx
src/IGESData/IGESData_GlobalSection.cxx
src/IGESData/IGESData_ParamReader.cxx
src/IGESGeom/IGESGeom_ToolCircularArc.cxx
src/IGESGeom/IGESGeom_ToolConicArc.cxx
src/IGESGeom/IGESGeom_ToolPlane.cxx
src/IGESSelect/IGESSelect_Activator.cxx
src/IGESSelect/IGESSelect_Dumper.cxx
src/IGESSelect/IGESSelect_FloatFormat.cxx
src/IGESToBRep/IGESToBRep_Reader.cxx
src/Interface/Interface_FileReaderData.cxx
src/Interface/Interface_FloatWriter.cxx
src/Interface/Interface_Static.cxx
src/Materials/Materials_MaterialDefinition.cxx
src/Materials/Materials_MaterialsDictionary.cxx
src/MeshTest/MeshTest.cxx
src/MeshTest/MeshTest_PluginCommands.cxx
src/Message/Message.cxx
src/Message/Message_Msg.cxx
src/MoniTool/MoniTool_Timer.cxx
src/MoniTool/MoniTool_TypedValue.cxx
src/OSD/FILES
src/OSD/OSD.cdl
src/OSD/OSD.cxx
src/OSD/OSD_Localizer.cdl [deleted file]
src/OSD/OSD_Localizer.cxx [deleted file]
src/OSD/OSD_Real2String.cdl [deleted file]
src/OSD/OSD_Real2String.cxx [deleted file]
src/OpenGl/OpenGl_GraphicDriver_Export.cxx
src/PCDM/PCDM_RetrievalDriver.cxx
src/PCDM/PCDM_StorageDriver.cxx
src/PCollection/PCollection_HAsciiString.cxx
src/Poly/Poly_CoherentNode.cxx
src/QABugs/QABugs_1.cxx
src/QABugs/QABugs_10.cxx
src/QABugs/QABugs_11.cxx
src/QABugs/QABugs_12.cxx
src/QABugs/QABugs_13.cxx
src/QABugs/QABugs_14.cxx
src/QABugs/QABugs_15.cxx
src/QABugs/QABugs_16.cxx
src/QABugs/QABugs_17.cxx
src/QABugs/QABugs_18.cxx
src/QABugs/QABugs_2.cxx
src/QABugs/QABugs_3.cxx
src/QABugs/QABugs_4.cxx
src/QABugs/QABugs_5.cxx
src/QABugs/QABugs_6.cxx
src/QABugs/QABugs_8.cxx
src/QABugs/QABugs_9.cxx
src/QADNaming/QADNaming.cxx
src/QADNaming/QADNaming_BasicCommands.cxx
src/QADNaming/QADNaming_BuilderCommands.cxx
src/QADNaming/QADNaming_IteratorsCommands.cxx
src/QADNaming/QADNaming_SelectionCommands.cxx
src/QADraw/QADraw.cxx
src/QANCollection/QANCollection2.cxx
src/QANCollection/QANCollection3.cxx
src/QANewDBRepNaming/QANewDBRepNaming.cxx
src/QANewDBRepNaming/QANewDBRepNaming_FeatureCommands.cxx
src/QANewDBRepNaming/QANewDBRepNaming_PrimitiveCommands.cxx
src/RWStl/RWStl.cxx
src/SWDRAW/SWDRAW.cxx
src/SWDRAW/SWDRAW_ShapeAnalysis.cxx
src/SWDRAW/SWDRAW_ShapeCustom.cxx
src/SWDRAW/SWDRAW_ShapeFix.cxx
src/SWDRAW/SWDRAW_ShapeTool.cxx
src/SWDRAW/SWDRAW_ShapeUpgrade.cxx
src/Standard/FILES
src/Standard/Standard.cxx
src/Standard/Standard_CLocaleSentry.cxx [new file with mode: 0644]
src/Standard/Standard_CLocaleSentry.hxx [new file with mode: 0644]
src/Standard/Standard_CString.cxx
src/Standard/Standard_CString.hxx [changed mode: 0755->0644]
src/StepSelect/StepSelect_Activator.cxx
src/StepSelect/StepSelect_FloatFormat.cxx
src/Storage/Storage_Schema.cxx
src/TCollection/TCollection_AsciiString.cxx
src/TCollection/TCollection_ExtendedString.cxx
src/TObjDRAW/TObjDRAW.cxx
src/TestTopOpe/TestTopOpe_BOOP.cxx
src/TestTopOpe/TestTopOpe_BOOPCommands.cxx
src/TestTopOpe/TestTopOpe_CORCommands.cxx
src/TestTopOpe/TestTopOpe_HDSCommands.cxx
src/TestTopOpe/TestTopOpe_MesureCommands.cxx
src/TestTopOpe/TestTopOpe_OtherCommands.cxx
src/TestTopOpeDraw/TestTopOpeDraw_OtherCommands.cxx
src/TestTopOpeTools/TestTopOpeTools_TraceCommands.cxx
src/TopOpeBRep/TopOpeBRep_traceALWL.cxx
src/TopOpeBRepBuild/TopOpeBRepBuild_Griddump.cxx
src/TopTools/TopTools_ShapeSet.cxx
src/Units/Units_UnitsDictionary.cxx
src/ViewerTest/ViewerTest.cxx
src/ViewerTest/ViewerTest_FilletCommands.cxx
src/ViewerTest/ViewerTest_ObjectCommands.cxx
src/ViewerTest/ViewerTest_ViewerCommands.cxx
src/Voxel/Voxel_Reader.cxx
src/VrmlData/VrmlData_Geometry.cxx
src/VrmlData/VrmlData_Group.cxx
src/VrmlData/VrmlData_IndexedFaceSet.cxx
src/VrmlData/VrmlData_Material.cxx
src/VrmlData/VrmlData_Scene.cxx
src/VrmlData/VrmlData_WorldInfo.cxx
src/WNT/WNT_GraphicDevice.cxx
src/XDEDRAW/XDEDRAW.cxx
src/XDEDRAW/XDEDRAW_Colors.cxx
src/XDEDRAW/XDEDRAW_Common.cxx
src/XDEDRAW/XDEDRAW_Layers.cxx
src/XDEDRAW/XDEDRAW_Props.cxx
src/XDEDRAW/XDEDRAW_Shapes.cxx
src/XSDRAW/XSDRAW.cxx
src/XSDRAWIGES/XSDRAWIGES.cxx
src/XSDRAWSTEP/XSDRAWSTEP.cxx
src/XSDRAWSTLVRML/XSDRAWSTLVRML.cxx
src/XmlLDrivers/XmlLDrivers.cxx
src/XmlLDrivers/XmlLDrivers_DocumentRetrievalDriver.cxx
src/XmlLDrivers/XmlLDrivers_DocumentStorageDriver.cxx
src/XmlMDataStd/XmlMDataStd_NamedDataDriver.cxx
src/XmlMDataStd/XmlMDataStd_RealArrayDriver.cxx
src/XmlMDataStd/XmlMDataStd_RealDriver.cxx
src/XmlMNaming/XmlMNaming_Shape1.cxx
src/XmlMPrsStd/XmlMPrsStd_PositionDriver.cxx
src/XmlMXCAFDoc/XmlMXCAFDoc_CentroidDriver.cxx
src/XmlMXCAFDoc/XmlMXCAFDoc_DimTolDriver.cxx
src/XmlObjMgt/XmlObjMgt.cxx
src/XmlObjMgt/XmlObjMgt_GP.cxx
tests/bugs/begin
tests/bugs/parse.rules
tests/bugs/xde/bug22898 [new file with mode: 0644]

index 7ff300b13e82a3a22f43761fd757fd111361c866..6c9e58acfb5e2cd17f05cac2a3be76aab5425c8d 100755 (executable)
@@ -570,7 +570,7 @@ void Approx_SameParameter::Build(const Standard_Real Tolerance)
     }
     Handle(Geom2d_BSplineCurve) DEBBS = 
       new Geom2d_BSplineCurve(DEBP2d,DEBKnots,DEBMults,1);
-    sprintf(Name,"DEBC2d_%d",++NbCurve);
+    Sprintf(Name,"DEBC2d_%d",++NbCurve);
 #ifdef DRAW
     DrawTrSurf::Set(Name,DEBBS);
 #endif
@@ -651,7 +651,7 @@ void Approx_SameParameter::Build(const Standard_Real Tolerance)
 
     Handle(Geom2d_BSplineCurve) DEBBS = 
       new Geom2d_BSplineCurve(DEBP2d,DEBKnots,DEBMults,1);
-    sprintf(Name,"DEBC2d_%d_%d",NbCurve,nbcoups );
+    Sprintf(Name,"DEBC2d_%d_%d",NbCurve,nbcoups );
 #ifdef DRAW
     DrawTrSurf::Set(Name,DEBBS);
 #endif
index 83ccddd5ae9ea9a72457586eb86a176c139a83c6..21986b340a6787b27b1c63032f64d7ce9603dfd0 100755 (executable)
@@ -1496,8 +1496,8 @@ Standard_Integer bopsinf (Draw_Interpretor& di,
   const BooleanOperations_ShapesDataStructure& aDS=pDF->DS();
 
   Standard_Integer nSp=0, nF1, nF2, anExistFlag=0;
-  nF1=atoi(a[1]);
-  nF2=atoi(a[2]);
+  nF1=Draw::Atoi(a[1]);
+  nF2=Draw::Atoi(a[2]);
 
   const TopoDS_Shape& aS1=aDS.GetShape(nF1);
   const TopoDS_Shape& aS2=aDS.GetShape(nF2);
@@ -1558,8 +1558,8 @@ Standard_Integer bopsonf (Draw_Interpretor& di,
   const BooleanOperations_ShapesDataStructure& aDS=pDF->DS();
 
   Standard_Integer nSp=0, nF1, nF2, anExistFlag=0;
-  nF1=atoi(a[1]);
-  nF2=atoi(a[2]);
+  nF1=Draw::Atoi(a[1]);
+  nF2=Draw::Atoi(a[2]);
 
   const TopoDS_Shape& aS1=aDS.GetShape(nF1);
   const TopoDS_Shape& aS2=aDS.GetShape(nF2);
@@ -1621,7 +1621,7 @@ Standard_Integer bopwho (Draw_Interpretor& di,
   Standard_Boolean bIsNewShape;
   Standard_Integer iNum, i, aNbLines, aNbObj, aNewShape, aWhat, aWith;
   //
-  iNum=atoi(a[1]);
+  iNum=Draw::Atoi(a[1]);
   if (iNum<=0) {
     di << " Shape Index must be >0 .\n";
     return 1;
index 03da536ce26582bd2835700e0ff76cb24c8119a1..9b92863299b3c0165b7016bd4f01ecc90b1fc73e 100755 (executable)
@@ -35,6 +35,7 @@
 
 #include <Geom_Curve.hxx>
 #include <DrawTrSurf.hxx>
+#include <Draw.hxx>
 #include <DBRep.hxx>
 #include <IntTools_Tools.hxx>
 
@@ -182,7 +183,7 @@ Standard_Integer bopcurves (Draw_Interpretor& di,
   
   aTol=1.e-7;
   if (n>2) {
-    aTol=atof(a[2]);
+    aTol=Draw::Atof(a[2]);
     if (aTol<=0.) {
       aTol=1.e-7;
     }
index 96211054de8ea960d0162ac73803db3c24a83bdf..3762f7f90503f03f5d9c374ac543fc6a2cfe940a 100755 (executable)
@@ -23,6 +23,7 @@
 
 #include <stdio.h>
 
+#include <Draw.hxx>
 #include <Draw_Interpretor.hxx>
 
 #include <TopoDS.hxx>
@@ -70,15 +71,15 @@ static Standard_Integer bef   (Draw_Interpretor& di,
   Standard_Real aTol=.0000001, aDeflection=.01, aFrom, aTo;
   
   if (n>=4) {  
-    aDiscr=atoi (a[3]);
+    aDiscr=Draw::Atoi (a[3]);
   }
 
   if (n>=5) {  
-    aTol=atof (a[4]);
+    aTol=Draw::Atof (a[4]);
   }
 
   if (n>=6) {  
-    aDeflection=atof (a[5]);
+    aDeflection=Draw::Atof (a[5]);
   }
 
   di << " bef: ===Begin===\n";
index 83871d5c12c4909f3437a75d8a04472a96e5b45f..eafd9fa19d945eefc0919978312229d19eb76f20 100755 (executable)
@@ -55,6 +55,7 @@
 #include <TopAbs.hxx>
 #include <TopAbs_State.hxx>
 
+#include <Draw.hxx>
 #include <DBRep.hxx>
 
 #include <DrawTrSurf.hxx>
@@ -464,8 +465,8 @@ Standard_Integer baddve (Draw_Interpretor& di, Standard_Integer n, const char**
 
 
   Standard_Real p1, p2;
-  p1=atof(a[4]);
-  p2=atof(a[5]);
+  p1=Draw::Atof(a[4]);
+  p2=Draw::Atof(a[5]);
   
   TopoDS_Edge E=aE;
   E.EmptyCopy();
@@ -552,7 +553,7 @@ static Standard_Integer bexplode(Draw_Interpretor& di,
     TopoDS_Iterator itr(S);
     while (itr.More()) {
       i++;
-      sprintf(p,"%d",i);
+      Sprintf(p,"%d",i);
       DBRep::Set(newname,itr.Value());
       di.AppendElement(newname);
       itr.Next();
@@ -610,7 +611,7 @@ static Standard_Integer bexplode(Draw_Interpretor& di,
     for (; ex.More(); ex.Next()) {
       const TopoDS_Shape& aS = ex.Current();
       i++;
-      sprintf(p,"%d",i);
+      Sprintf(p,"%d",i);
       DBRep::Set(newname,aS);
       di.AppendElement(newname);
     }
@@ -629,20 +630,20 @@ Standard_Integer bclassify (Draw_Interpretor& aDI,
   char sbf[512];       
   
   if (n < 3) {
-    sprintf(sbf, " Use >bclassify Solid Point [Tolerance=1.e-7]\n");
+    Sprintf(sbf, " Use >bclassify Solid Point [Tolerance=1.e-7]\n");
     aDI<<sbf;
     return 1;
   }
   
   TopoDS_Shape aS = DBRep::Get(a[1]);
   if (aS.IsNull()) {
-    sprintf(sbf, " Null Shape is not allowed here\n");
+    Sprintf(sbf, " Null Shape is not allowed here\n");
     aDI<<sbf;
     return 1;
   }
   
   if (aS.ShapeType()!=TopAbs_SOLID) {
-    sprintf(sbf, " Shape type must be SOLID\n");
+    Sprintf(sbf, " Shape type must be SOLID\n");
     aDI<<sbf;
     return 1;
   }
@@ -655,7 +656,7 @@ Standard_Integer bclassify (Draw_Interpretor& aDI,
   
   aTol=1.e-7; 
   if (n==4) {
-    aTol=atof(a[3]);
+    aTol=Draw::Atof(a[3]);
   }
   //
   BRepClass3d_SolidClassifier aSC(aS);
@@ -679,20 +680,20 @@ Standard_Integer b2dclassify (Draw_Interpretor& aDI,
   char sbf[512];       
   
   if (n < 3) {
-    sprintf(sbf, " Use >bclassify Face Point2d [Tol2D=Tol(Face)]\n");
+    Sprintf(sbf, " Use >bclassify Face Point2d [Tol2D=Tol(Face)]\n");
     aDI<<sbf;
     return 1;
   }
   
   TopoDS_Shape aS = DBRep::Get(a[1]);
   if (aS.IsNull()) {
-    sprintf(sbf, " Null Shape is not allowed here\n");
+    Sprintf(sbf, " Null Shape is not allowed here\n");
     aDI<<sbf;
     return 1;
   }
   
   if (aS.ShapeType()!=TopAbs_FACE) {
-    sprintf(sbf, " Shape type must be FACE\n");
+    Sprintf(sbf, " Shape type must be FACE\n");
     aDI<<sbf;
     return 1;
   }
@@ -706,7 +707,7 @@ Standard_Integer b2dclassify (Draw_Interpretor& aDI,
   const TopoDS_Face& aF=TopoDS::Face(aS);
   aTol=BRep_Tool::Tolerance(aF); 
   if (n==4) {
-    aTol=atof(a[3]);
+    aTol=Draw::Atof(a[3]);
   }
   //
   BRepClass_FaceClassifier aClassifier;
@@ -728,28 +729,28 @@ void PrintState (Draw_Interpretor& aDI,
   char sbf[512];       
   TCollection_AsciiString sIN("IN"), sOUT("OUT of"), sON("ON"), sUNKNOWN("UNKNOWN"); 
   //
-  sprintf(sbf, "The point is "); aDI<<sbf;
+  Sprintf(sbf, "The point is "); aDI<<sbf;
   //
   switch (aState) {
   case TopAbs_IN:              
-    sprintf(sbf, sIN.ToCString());
+    Sprintf(sbf, sIN.ToCString());
     break;
   case TopAbs_OUT:             
-    sprintf(sbf, sOUT.ToCString());
+    Sprintf(sbf, sOUT.ToCString());
     break;
   case TopAbs_ON:              
-    sprintf(sbf, sON.ToCString());
+    Sprintf(sbf, sON.ToCString());
     break;
   case TopAbs_UNKNOWN:         
-    sprintf(sbf, sUNKNOWN.ToCString());
+    Sprintf(sbf, sUNKNOWN.ToCString());
     break;
   default:
-    sprintf(sbf, sUNKNOWN.ToCString()); 
+    Sprintf(sbf, sUNKNOWN.ToCString()); 
     break;
   }
   aDI<<sbf; 
        //
-  sprintf(sbf, " shape\n");
+  Sprintf(sbf, " shape\n");
   aDI<<sbf;
   
 }
@@ -765,20 +766,20 @@ Standard_Integer bhole (Draw_Interpretor& aDI,
   char sbf[512];       
   
   if (n!=2) {
-    sprintf(sbf, " Use bhole Face\n");
+    Sprintf(sbf, " Use bhole Face\n");
     aDI<<sbf;
     return 1;
   }
   
   TopoDS_Shape aS = DBRep::Get(a[1]);
   if (aS.IsNull()) {
-    sprintf(sbf, " Null Shape is not allowed here\n");
+    Sprintf(sbf, " Null Shape is not allowed here\n");
     aDI<<sbf;
     return 1;
   }
   
   if (aS.ShapeType()!=TopAbs_FACE) {
-    sprintf(sbf, " Shape type must be FACE\n");
+    Sprintf(sbf, " Shape type must be FACE\n");
     aDI<<sbf;
     return 1;
   }
@@ -851,24 +852,24 @@ Standard_Integer bxhole (Draw_Interpretor& aDI,
   Standard_Integer aNbIter;
   //
   if (n!=3) {
-    sprintf(sbf, " Use bxhole Face NbIter\n");
+    Sprintf(sbf, " Use bxhole Face NbIter\n");
     aDI<<sbf;
     return 1;
   }
   
   TopoDS_Shape aS = DBRep::Get(a[1]);
   if (aS.IsNull()) {
-    sprintf(sbf, " Null Shape is not allowed here\n");
+    Sprintf(sbf, " Null Shape is not allowed here\n");
     aDI<<sbf;
     return 1;
   }
   if (aS.ShapeType()!=TopAbs_FACE) {
-    sprintf(sbf, " Shape type must be FACE\n");
+    Sprintf(sbf, " Shape type must be FACE\n");
     aDI<<sbf;
     return 1;
   }
   //
-  aNbIter=atoi(a[2]);
+  aNbIter=Draw::Atoi(a[2]);
   if (aNbIter<1) {
     aNbIter=1;
   }
index 6bc116a239180415602a47f85a9ea6ecd2600338..4ed523ad8b667bd388342378c6653653b2c3b171 100755 (executable)
@@ -23,6 +23,7 @@
 
 #include <stdio.h>
 
+#include <Draw.hxx>
 #include <Draw_Interpretor.hxx>
 #include <TopoDS_Shape.hxx>
 #include <DBRep.hxx>
@@ -67,10 +68,10 @@ static Standard_Integer bbedge (Draw_Interpretor& di,
   Standard_Real aTol=.0000001, aDeflection=.01;
   Standard_Real f1, l1, f2, l2;
 
-  f1=atof (a[3]);
-  l1=atof (a[4]);
-  f2=atof (a[5]);
-  l2=atof (a[6]);
+  f1=Draw::Atof (a[3]);
+  l1=Draw::Atof (a[4]);
+  f2=Draw::Atof (a[5]);
+  l2=Draw::Atof (a[6]);
 
   IntTools_Range aR1, aR2;
   aR1.SetFirst(f1);  aR1.SetLast(l1);
@@ -172,15 +173,15 @@ static Standard_Integer bedge (Draw_Interpretor& di,
   aR2.SetFirst(f2);  aR2.SetLast(l2);
 
   if (n>=4) {  
-    aDiscr=atoi (a[3]);
+    aDiscr=Draw::Atoi (a[3]);
   }
 
   if (n>=5) {  
-    aTol=atof (a[4]);
+    aTol=Draw::Atof (a[4]);
   }
 
   if (n>=6) {  
-    aDeflection=atof (a[5]);
+    aDeflection=Draw::Atof (a[5]);
   }
 
   di << " bedge: ===Begin===\n";
index b5ff0933af5bbb7a27b86c33b894b03dafaf4052..c869ad948233ab21c009bea2957467e934a7458d 100755 (executable)
@@ -25,6 +25,7 @@
 #include <TColStd_IndexedMapOfTransient.hxx>
 #include <TopoDS_Shape.hxx>
 #include <TopoDS_Vertex.hxx>
+#include <Draw.hxx>
 #include <DBRep.hxx>
 #include <gp_Pnt2d.hxx>
 
@@ -124,7 +125,7 @@ Standard_Integer  btolx(Draw_Interpretor& di, Standard_Integer n,  const char**
   //
   Standard_Real aTolEMin=1.e-7;
   if (n==3) {
-    aTolEMin=atof(a[2]);
+    aTolEMin=Draw::Atof(a[2]);
   }
   //
   // Edge Tolerances
index 2a9ae48e2082d1e0e11e1418c6cc5c9679a458ec..48b73382de1ba4a865976af292161dbe602acd78 100755 (executable)
@@ -242,7 +242,7 @@ void BOPTools_Checker::PerformVV()
     
     if (!aFlag) {
       char buf[512];
-      sprintf (buf, "VV: (%d, %d)", n1, n2);
+      Sprintf (buf, "VV: (%d, %d)", n1, n2);
 
       BOPTools_CheckResult aChRes;
       aChRes.AddShape(aV1);
@@ -308,7 +308,7 @@ void BOPTools_Checker::PerformVE()
     //
     if (!aFlag) {
       char buf[512];
-      sprintf (buf, "VE: (%d, %d)", aWhat, aWith);
+      Sprintf (buf, "VE: (%d, %d)", aWhat, aWith);
 
       BOPTools_CheckResult aChRes;
       aChRes.AddShape(aV1);
@@ -369,7 +369,7 @@ void BOPTools_Checker::PerformVF()
     //
     if (!aFlag) {
       char buf[512];
-      sprintf (buf, "VF: (%d, %d)", aWhat, aWith);
+      Sprintf (buf, "VF: (%d, %d)", aWhat, aWith);
 
       BOPTools_CheckResult aChRes;
       aChRes.AddShape(aV1);
@@ -530,7 +530,7 @@ void BOPTools_Checker::PerformEE()
                }
                //
                char buf[512];
-               sprintf (buf, "EE: (%d, %d), vertex at t1=%f, t2=%f", aWhat, aWith, aT1, aT2);
+               Sprintf (buf, "EE: (%d, %d), vertex at t1=%f, t2=%f", aWhat, aWith, aT1, aT2);
                //
                gp_Pnt aPnt;
                BOPTools_Tools::PointOnEdge(aEWhat, aT1, aPnt);
@@ -570,7 +570,7 @@ void BOPTools_Checker::PerformEE()
                }
                //
                char buf[512];
-               sprintf (buf, "EE: (%d, %d), common block ", aWhat, aWith);
+               Sprintf (buf, "EE: (%d, %d), common block ", aWhat, aWith);
                 
                 BOPTools_CheckResult aChRes;
                 aChRes.AddShape(aE1);
@@ -704,7 +704,7 @@ void BOPTools_Checker::PerformEF()
              }
              //
              char buf[512];
-             sprintf (buf, "EF: (%d, %d), vertex at t=%f", nE, nF, aT);
+             Sprintf (buf, "EF: (%d, %d), vertex at t=%f", nE, nF, aT);
              //
              gp_Pnt aPnt;
              BOPTools_Tools::PointOnEdge(aE, aT, aPnt);
@@ -734,7 +734,7 @@ void BOPTools_Checker::PerformEF()
              }
              //
              char buf[512];
-             sprintf (buf, "EF: (%d, %d), common block ", nE, nF);
+             Sprintf (buf, "EF: (%d, %d), common block ", nE, nF);
 
               BOPTools_CheckResult aChRes;
               aChRes.AddShape(aE);
@@ -846,7 +846,7 @@ void BOPTools_Checker::PerformEF()
       
       if (aNbPoints) {
        char buf[512];
-       sprintf (buf, "FF: (%d, %d) ", nF1, nF2);
+       Sprintf (buf, "FF: (%d, %d) ", nF1, nF2);
        //
        const IntTools_PntOn2Faces& aPntOn2Faces=aPnts(1);
        const IntTools_PntOnFace& aPntOnFace=aPntOn2Faces.P1();
@@ -881,7 +881,7 @@ void BOPTools_Checker::PerformEF()
            //
            if (bValid) {
              char buf[512];
-             sprintf (buf, "FF: (%d, %d) ", nF1, nF2);
+             Sprintf (buf, "FF: (%d, %d) ", nF1, nF2);
              //
              Handle (Geom_Curve) aC3D=aC.Curve();
              Handle (Geom_TrimmedCurve) aTC3D=Handle (Geom_TrimmedCurve)::DownCast(aC3D);
@@ -1036,7 +1036,7 @@ void BOPTools_Checker::PerformEF()
 
       char buf[512];
       if (!aSR.IsDone()) {
-       sprintf (buf, "Can not obtain ShrunkRange for Edge %d", nE);
+       Sprintf (buf, "Can not obtain ShrunkRange for Edge %d", nE);
         
         BOPTools_CheckResult aChRes;
         aChRes.AddShape(aE);
@@ -1048,7 +1048,7 @@ void BOPTools_Checker::PerformEF()
       }
       //
       if (anErrorStatus==6) {
-       sprintf(buf,
+       Sprintf(buf,
                "Warning: [PreparePaveBlocks()] Max.Dummy Shrunk Range for Edge %d\n", nE);
 
         BOPTools_CheckResult aChRes;
index b1472a4d7a06fbbc0ee13d7101c9ff6251b23088..e7feabb1c99040d6409cdecbe17ed3d1c4f2bcad 100755 (executable)
@@ -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,
index cc9920b8c999a5e0096f00171b94c988534bbc75..b213238b6114803ffa72345c236c6da848c9294a 100755 (executable)
@@ -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())
index b6ea15b43c7977496f62ecd318e0df8dd693e0d9..6755056987f94944edd8c752161a6c6b6f9d86e7 100755 (executable)
@@ -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<<" ";
index 0a82ff04b84ac5fa75db06a15c105762558d5846..1010e2e0cf68da3dbcf08aff5fa604189f7f80c4 100755 (executable)
@@ -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";}
 
index 09e4032755c1ae73088282735522c14a540bdbf0..942dbc415a52c26f9e29ac422691b77ef23a1b4f 100755 (executable)
@@ -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);
       }
index 5c394a73c2cf1c4acd6461f6967b951cab8eec1a..347a04b405a70ee23f064e3a827f19c4821b252b 100755 (executable)
@@ -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 << " " ;
index 4ef4b3ce2b4b00e49d795d0924d74ef43ba558cf..a837eaa2edb83f238f854e56eba0360f1a8c190f 100755 (executable)
@@ -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;
index 7d85ee2357b47a50eaf7f9e0ac240b85b1944d35..ecc97c75f5a9c72e1c93b07689996f04a5595078 100755 (executable)
@@ -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);
       }
index 51e42e070aa2355c6f8fda4c5324658e5d24ce5c..b7c12f951ba82b5339d5ebe1ed7cb59bf0438afc 100755 (executable)
@@ -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);
       }
     }
index d0889054c7939cbb63e33b71ee99b728ac75a796..42b5103a59f17a37450bfd3fa89046155ff11707 100755 (executable)
@@ -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
        {
index c8fdf2688874064659394cbe2b5ca2d8d038a88d..60b206c579a4f4ae20395faac2dc003b112bba22 100755 (executable)
@@ -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;
 
index 9abac47b1c8b199b9c228fb0c5a0b844b62dd21e..2044f652096b9ae87812aa61acd42ab4cb84bbf7 100755 (executable)
@@ -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);
index 84b45a3e22afb0f5b1968c77e9e3075dc8823e77..fa9f9deea95483b986415f6b36652a9cc24ca5b4 100755 (executable)
 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;
index 5449f33889e8a352b3ffaf0954caab9eba4bb263..62b871484efd674ce2413482bd7183b68c657450 100755 (executable)
@@ -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<<" ";
index 0a1e0692731d6d079ace00e4219a4e10be12352c..9bbbc7bb22017bdf52ae5991f56681c9259ceb2b 100755 (executable)
@@ -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);
   }
index dc75ab1e0543f42ad56b1bce88453b7cbadfda74..631d9f15ff8c8da6962c8dd5af02bb4734f1e9e6 100755 (executable)
@@ -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());
   }
 
index 3262638ef81b6340856523fcb6bc3c1fe668be74..322f9e2c9d0c702cd16d9ba1ad06c23f2e217a22 100755 (executable)
@@ -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()) {
index 18883920e1aa17b0d9227a817113e11db8bab834..38d598c30829804509589b3ac670948f6cebd112 100755 (executable)
@@ -139,7 +139,7 @@ static Standard_Integer isos (Draw_Interpretor& di,
   Standard_Boolean Change = Standard_False ;
   if (!Characters (NbArg) && Float (NbArg)) return 1 ;
   if (!Characters (NbArg)) {
-    NbIsos = atoi (Arg[NbArg]) ;
+    NbIsos = Draw::Atoi (Arg[NbArg]) ;
     NbArg-- ;
     Change = Standard_True ;
   }
@@ -233,7 +233,7 @@ static Standard_Integer hlr (Draw_Interpretor& di,
   if (n >= 3 && !strcasecmp(a[1],"ang"  )) {
     nFirst = 3;
     if (n == 3) {
-      Standard_Real ang = atof(a[2]);
+      Standard_Real ang = Draw::Atof(a[2]);
       anglHLR = ang * M_PI / 180;
       if (anglHLR < HAngMin) anglHLR = HAngMin;
       if (anglHLR > HAngMax) anglHLR = HAngMax;
@@ -279,7 +279,7 @@ static Standard_Integer hlr (Draw_Interpretor& di,
            localRgN = Standard_True;
          }
          else if (!strcasecmp(a[1],"ang"  )) {
-           Standard_Real ang = atof(a[2]);
+           Standard_Real ang = Draw::Atof(a[2]);
            localAng = ang * M_PI / 180;
          }
          else return 1;
@@ -332,7 +332,7 @@ static Standard_Integer discretisation(Draw_Interpretor& di,
   if (n <= 1)
     di << "Current number of points : "<<discret<<"\n";
   else {
-    discret = atoi(a[1]);
+    discret = Draw::Atoi(a[1]);
   }
   return 0;
 }
@@ -496,7 +496,7 @@ static Standard_Integer explode(Draw_Interpretor& di,
     TopoDS_Iterator itr(S);
     while (itr.More()) {
       i++;
-      sprintf(p,"%d",i);
+      Sprintf(p,"%d",i);
       DBRep::Set(newname,itr.Value());
       di.AppendElement(newname);
       itr.Next();
@@ -557,7 +557,7 @@ static Standard_Integer explode(Draw_Interpretor& di,
       Standard_Boolean added = M.Add(Sx);
       if (added) {
        i++;
-       sprintf(p,"%d",i);
+       Sprintf(p,"%d",i);
        DBRep::Set(newname,Sx);
        di.AppendElement(newname);
       }
@@ -651,7 +651,7 @@ static Standard_Integer nexplode(Draw_Interpretor& di,
   }
   
   for (Index=1 ;Index <= MaxShapes; Index++) {
-    sprintf(p,"%d",Index);
+    Sprintf(p,"%d",Index);
     DBRep::Set(newname,aShapes(OrderInd(Index)));
     di.AppendElement(newname);    
   }
@@ -680,7 +680,7 @@ static Standard_Integer exwire(Draw_Interpretor& ,
   BRepTools_WireExplorer ex(TopoDS::Wire(S));
   while (ex.More()) {
     i++;
-    sprintf(p,"%d",i);
+    Sprintf(p,"%d",i);
     DBRep::Set(newname,ex.Current());
     ex.Next();
   }
@@ -1021,7 +1021,7 @@ static Standard_Integer normals(Draw_Interpretor& di,
   if (n <= 1) return 1;
   Standard_Real l = 1.;
   if (n > 2) 
-    l = atof(a[2]);
+    l = Draw::Atof(a[2]);
 
   TopoDS_Shape S = DBRep::Get(a[1]);
   if (S.IsNull()) return 1;
index ac12a6d2b875f1fba207e902021ac5e2ba4caed2..13356120e7d82e4cf43e8c5449f407890bde37e0 100755 (executable)
@@ -164,7 +164,7 @@ static Standard_Integer DFOpenAttribute (Draw_Interpretor& di,
   Handle(DDF_Browser) browser =
     Handle(DDF_Browser)::DownCast (Draw::Get(a[1], Standard_True)); 
 
-  const Standard_Integer index = atoi(a[2]);
+  const Standard_Integer index = Draw::Atoi(a[2]);
   TCollection_AsciiString list = browser->OpenAttribute(index);
   di<<list.ToCString();
   return 0;
index cf491a2d04e0c5b85ea0f543f8d2d5e0b1430b12..83fbbf929217b6f30be7463b1b1f189602aba9f3 100755 (executable)
@@ -80,6 +80,7 @@ Storage_Error DDF_IOStream::Open(const TCollection_AsciiString& aName,const Stor
       }
       else {
        myIStream->precision(17);
+        myIStream->imbue (std::locale::classic()); // always use C locale
        SetOpenMode(aMode);
       }
     }
@@ -91,6 +92,7 @@ Storage_Error DDF_IOStream::Open(const TCollection_AsciiString& aName,const Stor
       }
       else {
        myOStream->precision(17);
+        myOStream->imbue (std::locale::classic()); // make sure to always use C locale
        SetOpenMode(aMode);
       }
     }
@@ -113,6 +115,7 @@ Storage_Error DDF_IOStream::Open(istream* anIStream)
   SetOpenMode(Storage_VSRead);
   myIStream = anIStream;
   myIStream->precision(17);
+  myIStream->imbue (std::locale::classic()); // use always C locale
   SetName("DDF_IOStream");
   return Storage_VSOk; // ou Storage_VSAlreadyOpen ?
 }
@@ -128,6 +131,7 @@ Storage_Error DDF_IOStream::Open(ostream* anOStream)
   SetOpenMode(Storage_VSWrite);
   myOStream = anOStream;
   myOStream->precision(17);
+  myOStream->imbue (std::locale::classic()); // use always C locale
   SetName("DDF_IOStream");
   return Storage_VSOk; // ou Storage_VSAlreadyOpen ?
 }
index 44ab85333feeea2fd90fa759cf83391942c2fa20..8984fd5a3d454aeaa2afd2e0c3d0997075d43e50 100755 (executable)
@@ -112,7 +112,7 @@ static Standard_Integer CommitTran (Draw_Interpretor& di,
       Handle(DDF_Transaction) tr = DDF_TStack.Top();
       di<<"Commit transaction # "<<tr->Transaction()<<" # "<<DF->Transaction()<<"\n";
       Standard_Boolean withDelta = Standard_False;
-      if (n > 2) withDelta = (atoi(a[2]) != 0);
+      if (n > 2) withDelta = (Draw::Atoi(a[2]) != 0);
       DDF_LastDelta = tr->Commit(withDelta);
       DDF_TStack.Pop();
     }
@@ -169,7 +169,7 @@ static Standard_Integer Undo (Draw_Interpretor& di,
   Handle(TDF_Data) DF;
   if (DDF::GetDF (a[1], DF)) {
     Standard_Boolean withDelta = Standard_False;
-    if (n > 2) withDelta = (atoi(a[2]) != 0);
+    if (n > 2) withDelta = (Draw::Atoi(a[2]) != 0);
     if (!DDF_LastDelta.IsNull()) {
       if (DF->IsApplicable(DDF_LastDelta)) {
        Handle(TDF_Delta) tmp = DF->Undo(DDF_LastDelta,withDelta);
index 3eef78952e3258a3095d3ae78ed1d1ebc28a87d5..8174246525d3b163f38419bf2f624f6d29574ee5 100755 (executable)
@@ -113,7 +113,7 @@ static Standard_Integer DDataStd_SetInteger (Draw_Interpretor& di,
     if (!DDF::GetDF(arg[1],DF)) return 1;
     TDF_Label L;
     DDF::AddLabel(DF, arg[2], L);
-    TDataStd_Integer::Set(L,atoi(arg[3]));  
+    TDataStd_Integer::Set(L,Draw::Atoi(arg[3]));  
     return 0;
   }
   di << "DDataStd_SetInteger : Error" << "\n";
@@ -134,7 +134,7 @@ static Standard_Integer DDataStd_SetReal (Draw_Interpretor& di,
     if (!DDF::GetDF(arg[1],DF)) return 1;
     TDF_Label L;
     DDF::AddLabel(DF, arg[2], L);
-    TDataStd_Real::Set(L,atof(arg[3]));  
+    TDataStd_Real::Set(L,Draw::Atof(arg[3]));  
     return 0;
   } 
   di << "DDataStd_SetReal : Error" << "\n";
@@ -441,14 +441,14 @@ static Standard_Integer DDataStd_SetIntArray (Draw_Interpretor& di,
   if (!DDF::GetDF(arg[1],DF))  return 1; 
   TDF_Label label;
   DDF::AddLabel(DF, arg[2], label);
-  Standard_Integer isDelta = atoi(arg[3]);
-  Standard_Integer From = atoi(arg[4]), To = atoi( arg[5] ), j;
+  Standard_Integer isDelta = Draw::Atoi(arg[3]);
+  Standard_Integer From = Draw::Atoi(arg[4]), To = Draw::Atoi( arg[5] ), j;
   di << "Array of Standard_Integer with bounds from = " << From  << " to = " << To  << "\n";
   Handle(TDataStd_IntegerArray) A = TDataStd_IntegerArray::Set(label, From, To, isDelta);
   
   j = 6;
   for(Standard_Integer i = From; i<=To; i++) {
-    A->SetValue(i, atoi(arg[j]) ); 
+    A->SetValue(i, Draw::Atoi(arg[j]) ); 
     j++;
   }
 
@@ -510,8 +510,8 @@ static Standard_Integer DDataStd_ChangeIntArray (Draw_Interpretor& di,
       di << "There is no TDataStd_IntegerArray at label"  << "\n";
       return 1;
     }
-    Standard_Integer indx = atoi(arg[3]);
-    Standard_Integer val  = atoi(arg[4]);
+    Standard_Integer indx = Draw::Atoi(arg[3]);
+    Standard_Integer val  = Draw::Atoi(arg[4]);
     Standard_Integer low = A->Lower(), up = A->Upper();
     if(low <= indx && indx <= up)
       A->SetValue(indx, val);
@@ -559,8 +559,8 @@ static Standard_Integer DDataStd_SetIntArrayTest (Draw_Interpretor& di,
   if (!DDF::GetDF(arg[1],DF))  return 1; 
   TDF_Label label;
   DDF::AddLabel(DF, arg[2], label);
-  Standard_Integer isDelta = atoi(arg[3]);
-  Standard_Integer From = atoi(arg[4]), To = atoi( arg[5] ), j;
+  Standard_Integer isDelta = Draw::Atoi(arg[3]);
+  Standard_Integer From = Draw::Atoi(arg[4]), To = Draw::Atoi( arg[5] ), j;
   di << "Array of Standard_Integer with bounds from = " << From  << " to = " << To  << "\n";
   Handle(TDataStd_IntegerArray) A = TDataStd_IntegerArray::Set(label, From, To, isDelta);
   
@@ -587,15 +587,15 @@ static Standard_Integer DDataStd_SetRealArray (Draw_Interpretor& di,
   if (!DDF::GetDF(arg[1],DF))  return 1;  
   TDF_Label label; 
   DDF::AddLabel(DF, arg[2], label);
-  Standard_Integer isDelta = atoi(arg[3]);
+  Standard_Integer isDelta = Draw::Atoi(arg[3]);
  
-  Standard_Integer From = atoi(arg[4]), To = atoi( arg[5] ), j;
+  Standard_Integer From = Draw::Atoi(arg[4]), To = Draw::Atoi( arg[5] ), j;
   di << " Array of Standard_Real with bounds from = " << From  << " to = " << To  << "\n";
   Handle(TDataStd_RealArray) A = TDataStd_RealArray::Set(label, From, To, isDelta);
   
   j = 6;
   for(Standard_Integer i = From; i<=To; i++) { 
-    A->SetValue(i, atof(arg[j]) ); 
+    A->SetValue(i, Draw::Atof(arg[j]) ); 
     j++;
   }
 
@@ -658,8 +658,8 @@ static Standard_Integer DDataStd_ChangeRealArray (Draw_Interpretor& di,
       di << "There is no TDataStd_RealArray at label"  << "\n";
       return 1;
     }
-    Standard_Integer indx = atoi(arg[3]);
-    Standard_Real val  = atof(arg[4]);
+    Standard_Integer indx = Draw::Atoi(arg[3]);
+    Standard_Real val  = Draw::Atof(arg[4]);
     Standard_Integer low = A->Lower(), up = A->Upper();
     if(low <= indx && indx <= up)
       A->SetValue(indx, val);
@@ -712,7 +712,7 @@ static Standard_Integer DDataStd_SetVariable (Draw_Interpretor& di,
     const char* aUnits = arg[4];
     aV->Unit(Standard_CString(aUnits));
 
-    aV->Constant(Standard_Boolean(atoi(arg[3])));
+    aV->Constant(Standard_Boolean(Draw::Atoi(arg[3])));
     return 0; 
   }
 
@@ -854,7 +854,7 @@ static Standard_Integer DDataStd_SetFunction (Draw_Interpretor& di,
     Standard_GUID guid (arg[3]);
     Handle(TFunction_Function) aF = TFunction_Function::Set(label, guid);
 
-    int fail = atoi(arg[4]);
+    int fail = Draw::Atoi(arg[4]);
     aF->SetFailure(fail);
 
     return 0;
@@ -914,9 +914,9 @@ static Standard_Integer DDataStd_SetExtStringArray (Draw_Interpretor& di,
   if (!DDF::GetDF(arg[1],DF))  return 1; 
   TDF_Label label;
   DDF::AddLabel(DF, arg[2], label);
-  Standard_Integer isDelta = atoi(arg[3]);
+  Standard_Integer isDelta = Draw::Atoi(arg[3]);
 
-  Standard_Integer From = atoi(arg[4]), To = atoi( arg[5] ), j;
+  Standard_Integer From = Draw::Atoi(arg[4]), To = Draw::Atoi( arg[5] ), j;
   di << "Array of ExtString with bounds from = " << From  << " to = " << To  << "\n";
   Handle(TDataStd_ExtStringArray) A = TDataStd_ExtStringArray::Set(label, From, To, isDelta);
   
@@ -988,7 +988,7 @@ static Standard_Integer DDataStd_ChangeExtStrArray (Draw_Interpretor& di,
       di << "There is no TDataStd_ExtStringArray at label"  << "\n";
       return 1;
     }
-    Standard_Integer indx = atoi(arg[3]);
+    Standard_Integer indx = Draw::Atoi(arg[3]);
     TCollection_ExtendedString val(arg[4]);
     Standard_Integer low = A->Lower(), up = A->Upper();
     if(low <= indx && indx <= up)
@@ -1122,7 +1122,7 @@ static Standard_Integer DDataStd_GetUTFtoFile (Draw_Interpretor& di,
       cout << "Error: problem with the file stream, rdstate = " <<anOS.rdstate() <<endl;
 #endif
     }
-    char prefix[4] = {0xEF,0xBB,0xBF, 0x00};
+    unsigned char prefix[4] = {0xEF,0xBB,0xBF, 0x00};
     anOS.write( (char*)&prefix[0], 3); 
     Standard_Integer  n = aES.LengthOfCString();
     Standard_PCharacter aCstr = (Standard_PCharacter) Standard::Allocate(ROUNDMEM(n+1));
@@ -1148,14 +1148,14 @@ static Standard_Integer DDataStd_SetByteArray (Draw_Interpretor& di,
     if (!DDF::GetDF(arg[1],DF))  return 1; 
     TDF_Label label;
     DDF::AddLabel(DF, arg[2], label);
-    Standard_Integer isDelta = atoi(arg[3]);
-    Standard_Integer From = atoi(arg[4]), To = atoi( arg[5] ), j;
+    Standard_Integer isDelta = Draw::Atoi(arg[3]);
+    Standard_Integer From = Draw::Atoi(arg[4]), To = Draw::Atoi( arg[5] ), j;
     di << "Array of Standard_Integer with bounds from = " << From  << " to = " << To  << "\n";
     Handle(TDataStd_ByteArray) A = TDataStd_ByteArray::Set(label, From, To, isDelta);
     
     j = 6;
     for(Standard_Integer i = From; i<=To; i++) {
-      Standard_Integer ival = atoi(arg[j]);
+      Standard_Integer ival = Draw::Atoi(arg[j]);
       if(ival > 255) {
        cout << "Bad value = " << ival<< endl;
        return 1;
@@ -1224,8 +1224,8 @@ static Standard_Integer DDataStd_ChangeByteArray (Draw_Interpretor& di,
       di << "There is no TDataStd_ByteArray at label"  << "\n";
       return 1;
     }
-    Standard_Integer indx = atoi(arg[3]);
-    Standard_Integer ival  = atoi(arg[4]);
+    Standard_Integer indx = Draw::Atoi(arg[3]);
+    Standard_Integer ival  = Draw::Atoi(arg[4]);
     if (ival > 255 || ival < 0) {
         di << "DDataStd_ChangeByteArray: Bad value = " <<ival << "\n";
        return 1;
@@ -1276,7 +1276,7 @@ static Standard_Integer DDataStd_SetIntPackedMap (Draw_Interpretor& di,
     if (!DDF::GetDF(arg[1],DF))  return 1; 
     TDF_Label aLabel;
     DDF::AddLabel(DF, arg[2], aLabel);
-    Standard_Integer isDelta = atoi(arg[3]);
+    Standard_Integer isDelta = Draw::Atoi(arg[3]);
     Standard_Integer aNum = nb - 4;
     Handle(TDataStd_IntPackedMap) anAtt;
     if(!aLabel.FindAttribute(TDataStd_IntPackedMap::GetID(), anAtt))
@@ -1288,7 +1288,7 @@ static Standard_Integer DDataStd_SetIntPackedMap (Draw_Interpretor& di,
     Standard_Integer j = 4;
     TColStd_PackedMapOfInteger aMap;
     for(Standard_Integer i = 1; i<=aNum; i++) {
-      aMap.Add (atoi(arg[j]));
+      aMap.Add (Draw::Atoi(arg[j]));
       j++;
     }
     const Handle(TColStd_HPackedMapOfInteger)& aHMap = new TColStd_HPackedMapOfInteger(aMap);
@@ -1361,7 +1361,7 @@ static Standard_Integer DDataStd_ChangeIntPackedMap_Add (Draw_Interpretor& di,
     if(!aHMap.IsNull()) {
       ahMap->ChangeMap().Assign(aHMap->Map());
       for(i=1; i<=aNum;i++) {
-       Standard_Integer val = atoi(arg[i+2]);
+       Standard_Integer val = Draw::Atoi(arg[i+2]);
        if(!ahMap->Map().Contains(val))
          ahMap->ChangeMap().Add(val);
       }
@@ -1404,7 +1404,7 @@ static Standard_Integer DDataStd_ChangeIntPackedMap_Rem (Draw_Interpretor& di,
     if(!aHMap.IsNull()) {
       ahMap->ChangeMap().Assign(aHMap->Map());
       for(i=1; i<=aNum;i++) {
-       Standard_Integer val = atoi(arg[i+2]);
+       Standard_Integer val = Draw::Atoi(arg[i+2]);
        if(ahMap->Map().Contains(val))
          ahMap->ChangeMap().Remove(val);
       }
@@ -1447,7 +1447,7 @@ static Standard_Integer DDataStd_ChangeIntPackedMap_AddRem (Draw_Interpretor& di
     if(!aHMap.IsNull()) {
       ahMap->ChangeMap().Assign(aHMap->Map());
       for(i=1; i<=aNum;i++) {
-       Standard_Integer val = atoi(arg[i+2]);
+       Standard_Integer val = Draw::Atoi(arg[i+2]);
        if(!ahMap->Map().Contains(val))
          ahMap->ChangeMap().Add(val);
        else
@@ -1476,8 +1476,8 @@ static Standard_Integer DDataStd_SetIntPHugeMap (Draw_Interpretor& di,
     if (!DDF::GetDF(arg[1],DF))  return 1; 
     TDF_Label aLabel;
     DDF::AddLabel(DF, arg[2], aLabel);
-    Standard_Integer isDelta = atoi(arg[3]);
-    Standard_Integer aNum = atoi(arg[4]);
+    Standard_Integer isDelta = Draw::Atoi(arg[3]);
+    Standard_Integer aNum = Draw::Atoi(arg[4]);
     Handle(TDataStd_IntPackedMap) anAtt;
     if(!aLabel.FindAttribute(TDataStd_IntPackedMap::GetID(), anAtt))
       anAtt = TDataStd_IntPackedMap::Set(aLabel, isDelta);
@@ -1512,7 +1512,7 @@ static Standard_Integer DDataStd_SetNDataIntegers2 (Draw_Interpretor& di,
     if (!DDF::GetDF(arg[1],DF))  return 1; 
     TDF_Label aLabel;
     DDF::AddLabel(DF, arg[2], aLabel);
-    Standard_Integer aNumP = atoi(arg[3]), j;
+    Standard_Integer aNumP = Draw::Atoi(arg[3]), j;
     Handle(TDataStd_NamedData) anAtt;
     if(!aLabel.FindAttribute(TDataStd_NamedData::GetID(), anAtt))
       anAtt = TDataStd_NamedData::Set(aLabel);
@@ -1551,7 +1551,7 @@ static Standard_Integer DDataStd_SetNDataIntAr2 (Draw_Interpretor& di,
  
     Standard_Integer j;
     TCollection_ExtendedString aKey(arg[3]);
-    Standard_Integer aNum = atoi(arg[4]);
+    Standard_Integer aNum = Draw::Atoi(arg[4]);
     if (aNum <= 0) return 1;
     Handle(TDataStd_NamedData) anAtt;
     if(!aLabel.FindAttribute(TDataStd_NamedData::GetID(), anAtt))
@@ -1655,7 +1655,7 @@ static Standard_Integer DDataStd_SetNDataIntegers (Draw_Interpretor& di,
 //     cout << "Value = |"<<aValue<<endl;
 //     cout << "aKey = " << aString << "|"<<endl;
 // 
-    Standard_Integer aNumP = atoi(arg[3]), j;
+    Standard_Integer aNumP = Draw::Atoi(arg[3]), j;
     Handle(TDataStd_NamedData) anAtt;
     if(!aLabel.FindAttribute(TDataStd_NamedData::GetID(), anAtt))
       anAtt = TDataStd_NamedData::Set(aLabel);
@@ -1666,7 +1666,7 @@ static Standard_Integer DDataStd_SetNDataIntegers (Draw_Interpretor& di,
     j = 4;
     for(Standard_Integer i = 1; i<=aNumP; i++) {
       TCollection_ExtendedString aKey(arg[j]);
-      Standard_Integer aVal = atoi(arg[j+1]);
+      Standard_Integer aVal = Draw::Atoi(arg[j+1]);
       anAtt->SetInteger(aKey, aVal); 
       j +=2;
     }    
@@ -1765,7 +1765,7 @@ static Standard_Integer DDataStd_SetNDataReals (Draw_Interpretor& di,
     TDF_Label aLabel;
     DDF::AddLabel(DF, arg[2], aLabel);
  
-    Standard_Integer aNumP = atoi(arg[3]), j;
+    Standard_Integer aNumP = Draw::Atoi(arg[3]), j;
     Handle(TDataStd_NamedData) anAtt;
     if(!aLabel.FindAttribute(TDataStd_NamedData::GetID(), anAtt))
       anAtt = TDataStd_NamedData::Set(aLabel);
@@ -1776,7 +1776,7 @@ static Standard_Integer DDataStd_SetNDataReals (Draw_Interpretor& di,
     j = 4;
     for(Standard_Integer i = 1; i<=aNumP; i++) {
       TCollection_ExtendedString aKey(arg[j]);
-      Standard_Real aVal = atof(arg[j+1]);
+      Standard_Real aVal = Draw::Atof(arg[j+1]);
       anAtt->SetReal(aKey, aVal); 
       j +=2;
     }    
@@ -1873,7 +1873,7 @@ static Standard_Integer DDataStd_SetNDataStrings (Draw_Interpretor& di,
     TDF_Label aLabel;
     DDF::AddLabel(DF, arg[2], aLabel);
  
-    Standard_Integer aNumP = atoi(arg[3]), j;
+    Standard_Integer aNumP = Draw::Atoi(arg[3]), j;
     Handle(TDataStd_NamedData) anAtt;
     if(!aLabel.FindAttribute(TDataStd_NamedData::GetID(), anAtt))
       anAtt = TDataStd_NamedData::Set(aLabel);
@@ -1983,7 +1983,7 @@ static Standard_Integer DDataStd_SetNDataBytes (Draw_Interpretor& di,
     TDF_Label aLabel;
     DDF::AddLabel(DF, arg[2], aLabel);
  
-    Standard_Integer aNumP = atoi(arg[3]), j;
+    Standard_Integer aNumP = Draw::Atoi(arg[3]), j;
     Handle(TDataStd_NamedData) anAtt;
     if(!aLabel.FindAttribute(TDataStd_NamedData::GetID(), anAtt))
       anAtt = TDataStd_NamedData::Set(aLabel);
@@ -1994,7 +1994,7 @@ static Standard_Integer DDataStd_SetNDataBytes (Draw_Interpretor& di,
     j = 4;
     for(Standard_Integer i = 1; i<=aNumP; i++) {
       TCollection_ExtendedString aKey(arg[j]);
-      Standard_Byte aVal = (Standard_Byte)atoi(arg[j+1]);
+      Standard_Byte aVal = (Standard_Byte)Draw::Atoi(arg[j+1]);
       anAtt->SetByte(aKey, aVal); 
       j +=2;
     }    
@@ -2092,7 +2092,7 @@ static Standard_Integer DDataStd_SetNDataIntAr (Draw_Interpretor& di,
  
     Standard_Integer j;
     TCollection_ExtendedString aKey(arg[3]);
-    Standard_Integer aNum = atoi(arg[4]);
+    Standard_Integer aNum = Draw::Atoi(arg[4]);
     if (aNum <= 0) return 1;
     Handle(TDataStd_NamedData) anAtt;
     if(!aLabel.FindAttribute(TDataStd_NamedData::GetID(), anAtt))
@@ -2104,7 +2104,7 @@ static Standard_Integer DDataStd_SetNDataIntAr (Draw_Interpretor& di,
     j = 5;
     Handle(TColStd_HArray1OfInteger) anArr =  new TColStd_HArray1OfInteger(1, aNum);
     for(Standard_Integer i = 1; i<=aNum; i++) {
-      Standard_Integer aVal = atoi(arg[j]);
+      Standard_Integer aVal = Draw::Atoi(arg[j]);
       anArr->SetValue(i, aVal);
       j++;
     }
@@ -2222,7 +2222,7 @@ static Standard_Integer DDataStd_SetNDataRealAr (Draw_Interpretor& di,
  
     Standard_Integer j;
     TCollection_ExtendedString aKey(arg[3]);
-    Standard_Integer aNum = atoi(arg[4]);
+    Standard_Integer aNum = Draw::Atoi(arg[4]);
     if (aNum <= 0) return 1;
     Handle(TDataStd_NamedData) anAtt;
     if(!aLabel.FindAttribute(TDataStd_NamedData::GetID(), anAtt))
@@ -2234,7 +2234,7 @@ static Standard_Integer DDataStd_SetNDataRealAr (Draw_Interpretor& di,
     j = 5;
     Handle(TColStd_HArray1OfReal) anArr =  new TColStd_HArray1OfReal(1, aNum);
     for(Standard_Integer i = 1; i<=aNum; i++) {
-      Standard_Real aVal = atof(arg[j]);
+      Standard_Real aVal = Draw::Atof(arg[j]);
       anArr->SetValue(i, aVal);
       j++;
     }
index 5906f594564d472eb6ca81df666c8bac3382c49b..096a9b17555b792970fb010b87957bb255ee2c36 100755 (executable)
@@ -218,7 +218,7 @@ static Standard_Integer DDataStd_SetPattern (Draw_Interpretor& di,
   Handle(TDataXtd_PatternStd) aP = TDataXtd_PatternStd::Set(L);
 
   // set signature
-  Standard_Integer signature = atoi(arg[3]);
+  Standard_Integer signature = Draw::Atoi(arg[3]);
   aP->Signature(signature);
 
   TDF_Label aLab;     
@@ -410,7 +410,7 @@ static Standard_Integer DDataStd_SetPosition (Draw_Interpretor& di,
     TDF_Label L;
     DDF::AddLabel(DF, arg[2], L);
 
-    Standard_Real X = atof(arg[3]), Y = atof(arg[4]), Z = atof(arg[5]);
+    Standard_Real X = Draw::Atof(arg[3]), Y = Draw::Atof(arg[4]), Z = Draw::Atof(arg[5]);
     gp_Pnt aPos (X, Y, Z);
 
     TDataXtd_Position::Set(L,aPos);  
index 3f2d3c31007045787a9900c02c8bb1be4cb0d9c5..5b7144a5bc02efce6c8d3a2be216cf1bbaa6478d 100755 (executable)
 static void Location (Standard_Integer nb, const char** arg, gp_Ax2& Loc) {
 
   if (nb == 9) {
-    Standard_Real X  = atof(arg[3]);
-    Standard_Real Y  = atof(arg[4]);
-    Standard_Real Z  = atof(arg[5]);
-    Standard_Real DX = atof(arg[6]);
-    Standard_Real DY = atof(arg[7]);
-    Standard_Real DZ = atof(arg[8]);
+    Standard_Real X  = Draw::Atof(arg[3]);
+    Standard_Real Y  = Draw::Atof(arg[4]);
+    Standard_Real Z  = Draw::Atof(arg[5]);
+    Standard_Real DX = Draw::Atof(arg[6]);
+    Standard_Real DY = Draw::Atof(arg[7]);
+    Standard_Real DZ = Draw::Atof(arg[8]);
     Loc = gp_Ax2 (gp_Pnt(X,Y,Z), gp_Dir(DX,DY,DZ));
   }  
 }
@@ -193,9 +193,9 @@ static Standard_Integer DDataStd_SetPlane (Draw_Interpretor& di,
 //     if (nb < 6) return 1;
     
 //     gp_Trsf T;
-//     Standard_Real x = atof(arg[3]);
-//     Standard_Real y = atof(arg[4]);
-//     Standard_Real z = atof(arg[5]);
+//     Standard_Real x = Draw::Atof(arg[3]);
+//     Standard_Real y = Draw::Atof(arg[4]);
+//     Standard_Real z = Draw::Atof(arg[5]);
     
 //     if (nb == 6) {
 //       T.SetTranslation(gp_Vec(x,y,z));
@@ -203,10 +203,10 @@ static Standard_Integer DDataStd_SetPlane (Draw_Interpretor& di,
 //     else if (nb < 10)
 //       return 1;
 //     else {
-//       Standard_Real dx = atof(arg[6]);
-//       Standard_Real dy = atof(arg[7]);
-//       Standard_Real dz = atof(arg[8]);
-//       Standard_Real ang = atof(arg[9]);
+//       Standard_Real dx = Draw::Atof(arg[6]);
+//       Standard_Real dy = Draw::Atof(arg[7]);
+//       Standard_Real dz = Draw::Atof(arg[8]);
+//       Standard_Real ang = Draw::Atof(arg[9]);
 //       T.SetRotation(gp_Ax1(gp_Pnt(x,y,z),
 //                         gp_Vec(dx,dy,dz)),
 //                  ang * (M_PI / 180.0));
index f323120e41ed0863065d53febc026fd6311611ce..4f67e0806ecad88c58f1b2af88b4c967e9b1bde5 100755 (executable)
@@ -76,9 +76,9 @@ static Standard_Integer DDataStd_PNT (Draw_Interpretor& di,
     if (!DDF::GetDF (arg[1], DF)) return 1;  
     TDF_Label L;
     DDF::AddLabel (DF, arg[2], L);    
-    Standard_Real x = atof(arg[3]);
-    Standard_Real y = atof(arg[4]);
-    Standard_Real z = atof(arg[5]);
+    Standard_Real x = Draw::Atof(arg[3]);
+    Standard_Real y = Draw::Atof(arg[4]);
+    Standard_Real z = Draw::Atof(arg[5]);
     TDataXtd_Point::Set (L,gp_Pnt(x,y,z));
     return 0;
   }  
index 4870c205508b34dde94177c9fe4c0e8d6ed72b3e..966b7dc9149d27c3122cbeb6ce6c260082e8d4a0 100755 (executable)
@@ -334,8 +334,8 @@ static Standard_Integer DDataStd_TreeBrowse (Draw_Interpretor& di,
 
   Handle(DDataStd_TreeBrowser) NewTreeNode = new DDataStd_TreeBrowser (lab);
   char *name = new char[50];
-  if (n == 4) sprintf(name,"treebrowser_%s",a[3]);
-  else        sprintf(name,"treebrowser_%s",a[1]);
+  if (n == 4) Sprintf(name,"treebrowser_%s",a[3]);
+  else        Sprintf(name,"treebrowser_%s",a[1]);
 
   Draw::Set(name, NewTreeNode);
   TCollection_AsciiString inst1("treebrowser ");
@@ -387,7 +387,7 @@ static Standard_Integer DDataStd_ChildNodeIterate (Draw_Interpretor& di,
   if (n >= 4) {
     Handle(TDF_Data) DF;
     if (!DDF::GetDF(a[1],DF)) return 1;
-    const Standard_Boolean AllLevels(atoi(a[3]));
+    const Standard_Boolean AllLevels(Draw::Atoi(a[3]));
     Handle(TDataStd_TreeNode) TN, Value;
 
     Standard_GUID ID;
@@ -450,7 +450,7 @@ static Standard_Integer DDataStd_InitChildNodeIterator (Draw_Interpretor& di,
     }
 
     if (!DDF::Find(DF, a[2], ID, TN)) return 1; 
-    const Standard_Boolean AllLevels(atoi(a[3]));
+    const Standard_Boolean AllLevels(Draw::Atoi(a[3]));
     cni.Initialize(TN, AllLevels);
     return 0;
   }
index e45f99edec5674442b10bfa2499bac3afd07ea8b..241c144d406ea58180ac9b7acec871ea677fbdd0 100755 (executable)
@@ -193,7 +193,7 @@ static Standard_Integer DDocStd_UndoLimit (Draw_Interpretor& di,Standard_Integer
   if (!DDocStd::GetDocument(a[1],D)) return 1;
   
   if (n > 2) {
-    Standard_Integer lim = atoi(a[2]);
+    Standard_Integer lim = Draw::Atoi(a[2]);
     D->SetUndoLimit(lim);
   }
   
@@ -218,7 +218,7 @@ static Standard_Integer DDocStd_Undo (Draw_Interpretor& di,Standard_Integer n, c
   
   Standard_Integer i,step = 1;
   if (n > 2) {
-    step = atoi(a[2]);
+    step = Draw::Atoi(a[2]);
   }
 
   // test if the command was undo or redo
index e3f941d4cb20f11d7bf297984029af89dbd28684..5375d54165a6bcf4119587fc58338bdab0873aed 100755 (executable)
@@ -56,7 +56,7 @@ static int mtmCreate (Draw_Interpretor& /*di*/, int n, const char** a)
 
   sMultiTransactionManager = new TDocStd_MultiTransactionManager();
   if(n > 1)
-    sMultiTransactionManager->SetUndoLimit(atoi(a[1]));
+    sMultiTransactionManager->SetUndoLimit(Draw::Atoi(a[1]));
   return 0;
 }
 
@@ -198,7 +198,7 @@ static int mtmNestedMode (Draw_Interpretor& di, int n, const char** a)
   }
   Standard_Boolean aMode = Standard_False;
   if(n > 1) {
-    aMode = atoi(a[1]) ? Standard_True : Standard_False;
+    aMode = Draw::Atoi(a[1]) ? Standard_True : Standard_False;
   }
   sMultiTransactionManager->SetNestedTransactionMode(aMode);
   return 0;
@@ -220,7 +220,7 @@ static Standard_Integer XAttributeValue (Draw_Interpretor& di, Standard_Integer
   TDF_Tool::Label(browser->Data(),argv[2],lab);
   if ( lab.IsNull() ) { di << "ERROR: label is Null: " << argv[2] << "\n"; return 0; }
   
-  Standard_Integer num = atoi ( argv[3] );
+  Standard_Integer num = Draw::Atoi ( argv[3] );
   TDF_AttributeIterator itr(lab,Standard_False);
   for (Standard_Integer i=1; itr.More() && i < num; i++) itr.Next();
   
index 71fc4ae5e24565b4cfe624f74163020c1ac73588..96d4ceee7875b8fc1c902202325eb5f0154a48ed 100755 (executable)
@@ -88,7 +88,7 @@ static Standard_Integer Ascendants (Draw_Interpretor& di, Standard_Integer n, co
 
   Standard_Integer T;
 
-  if (n > 3) T = atoi(a[3]);
+  if (n > 3) T = Draw::Atoi(a[3]);
   else       T = ND->Transaction ();
 
   //TNaming_OldShapeIterator it (S, T, US);  
@@ -97,7 +97,7 @@ static Standard_Integer Ascendants (Draw_Interpretor& di, Standard_Integer n, co
   TCollection_AsciiString entry;
   for (;it.More (); it.Next ()) {
     S = it.Shape ();
-    sprintf (name,"%s_%s_%d",a[2],"old", i++);
+    Sprintf (name,"%s_%s_%d",a[2],"old", i++);
     DBRep::Set (name,it.Shape());
     TDF_Label Label = it.Label ();
     TDF_Tool::Entry(Label,entry);
@@ -128,7 +128,7 @@ static Standard_Integer Descendants (Draw_Interpretor& di, Standard_Integer n, c
 
   Standard_Integer T;
 
-  if (n > 3) T = atoi(a[3]);
+  if (n > 3) T = Draw::Atoi(a[3]);
   else       T = ND->Transaction ();
 
   TNaming_NewShapeIterator it (S, T, ND->Root());
@@ -136,7 +136,7 @@ static Standard_Integer Descendants (Draw_Interpretor& di, Standard_Integer n, c
   TCollection_AsciiString entry;
   for (;it.More (); it.Next ()) {
     S = it.Shape ();
-    sprintf (name,"%s_%s_%d",a[2],"new", i++);
+    Sprintf (name,"%s_%s_%d",a[2],"new", i++);
     DBRep::Set (name,it.Shape ());
     TDF_Label Label = it.Label ();
     TDF_Tool::Entry(Label,entry);
@@ -281,7 +281,7 @@ static Standard_Integer Exploreshape (Draw_Interpretor& di, Standard_Integer n,
 //  ND->Root().FindAttribute(TNaming_UsedShapes::GetID(),US);
   
   Standard_Integer Trans = ND->Transaction();
-  if (n == 5) { Trans = (Standard_Integer ) atof(a[4]);}
+  if (n == 5) { Trans = (Standard_Integer ) Draw::Atof(a[4]);}
   
   TDF_Label Lab;
   DDF::FindLabel(ND,a[2],Lab);
@@ -300,11 +300,11 @@ static Standard_Integer Exploreshape (Draw_Interpretor& di, Standard_Integer n,
   
   for (TNaming_Iterator itL(Lab,Trans) ; itL.More(); itL.Next()) {
     if (!itL.OldShape().IsNull()) {
-      sprintf(name,"%s%s_%d","old",a[3],NbShapes);
+      Sprintf(name,"%s%s_%d","old",a[3],NbShapes);
       DBRep::Set (name,itL.OldShape());
     }
     if (!itL.NewShape().IsNull()) {    
-      sprintf(name,"%s_%d",a[3],NbShapes);
+      Sprintf(name,"%s_%d",a[3],NbShapes);
       DBRep::Set (name,itL.NewShape());
     }
     NbShapes++;
@@ -388,7 +388,7 @@ static Standard_Integer Collect (Draw_Interpretor& di,
     if (!DDF::GetDF(arg[1],DF)) return 1;
     if (!DDF::Find(DF,arg[2],TNaming_NamedShape::GetID(),A)) return 1;
     if (nb >= 4) {
-      OnlyModif = atoi(arg[3]);
+      OnlyModif = Draw::Atoi(arg[3]);
     }
     TNaming_Tool::Collect(A,MNS,OnlyModif);
     for (TNaming_MapIteratorOfMapOfNamedShape it(MNS); it.More(); it.Next()) {
index 7f3a0fc3a1d1123fe4eab36f63c0b7653a8b58bb..f710a5f4471c11fe0b2f30bc5e10cdfcf2d0de4f 100644 (file)
@@ -17,7 +17,7 @@
 // purpose or non-infringement. Please see the License for the specific terms
 // and conditions governing the rights and limitations under the License.
 
-
+#include <Draw.hxx>
 #include <Draw_Interpretor.hxx>
 #include <Standard_ErrorHandler.hxx>
 #include <DNaming.hxx>
@@ -321,9 +321,9 @@ static Standard_Integer DNaming_AddBox (Draw_Interpretor& theDI,
     
     TDF_Reference::Set(anObj->Label(), aFun->Label().FindChild(FUNCTION_RESULT_LABEL)); //result is here 
     Standard_Real dx,dy,dz;
-    dx = atof(theArg[2]);
-    dy = atof(theArg[3]);
-    dz = atof(theArg[4]);
+    dx = Draw::Atof(theArg[2]);
+    dy = Draw::Atof(theArg[3]);
+    dz = Draw::Atof(theArg[4]);
 
     DNaming::GetReal(aFun,BOX_DX)->Set(dx);
     DNaming::GetReal(aFun,BOX_DY)->Set(dy);
@@ -378,7 +378,7 @@ static Standard_Integer DNaming_BoxDX (Draw_Interpretor& theDI,
 
     Handle(TFunction_Function) aFun = GetFunction(objLabel,funGUID);
     if(!aFun.IsNull()) {
-      Standard_Real value = atof(theArg[3]);
+      Standard_Real value = Draw::Atof(theArg[3]);
       DNaming::GetReal(aFun,BOX_DX)->Set(value);
       DDF::ReturnLabel(theDI, DNaming::GetReal(aFun,BOX_DX)->Label());
       return 0;
@@ -411,7 +411,7 @@ static Standard_Integer DNaming_BoxDY (Draw_Interpretor& theDI,
     
     Handle(TFunction_Function) aFun = GetFunction(objLabel,funGUID);
     if(!aFun.IsNull()) {
-      Standard_Real value = atof(theArg[3]);
+      Standard_Real value = Draw::Atof(theArg[3]);
       DNaming::GetReal(aFun,BOX_DY)->Set(value);
       DDF::ReturnLabel(theDI, DNaming::GetReal(aFun,BOX_DY)->Label());
       return 0;
@@ -444,7 +444,7 @@ static Standard_Integer DNaming_BoxDZ (Draw_Interpretor& theDI,
     
     Handle(TFunction_Function) aFun = GetFunction(objLabel,funGUID);
     if(!aFun.IsNull()) {
-      Standard_Real value = atof(theArg[3]);
+      Standard_Real value = Draw::Atof(theArg[3]);
       DNaming::GetReal(aFun,BOX_DZ)->Set(value);
       DDF::ReturnLabel(theDI, DNaming::GetReal(aFun,BOX_DZ)->Label());
       return 0;
@@ -682,10 +682,10 @@ static Standard_Integer DNaming_AttachShape (Draw_Interpretor& di,
          aResultLabel.ForgetAllAttributes(Standard_True);
          Standard_Boolean aKeepOrientation(Standard_False);
          if (nb >= 6) 
-           aKeepOrientation = (Standard_Boolean) atoi(a[5]);
+           aKeepOrientation = (Standard_Boolean) Draw::Atoi(a[5]);
          Standard_Boolean aGeometry(Standard_False);
          if (nb == 7) 
-           aGeometry = (Standard_Boolean) atoi(a[6]);
+           aGeometry = (Standard_Boolean) Draw::Atoi(a[6]);
          Handle(TNaming_NamedShape) aCont =  DNaming::GetObjectValue(aContext);
 #ifdef DEBUG
          if(aCont.IsNull() || aCont->IsEmpty())
@@ -758,10 +758,10 @@ static Standard_Integer DNaming_XAttachShape (Draw_Interpretor& di,
          aResultLabel.ForgetAllAttributes(Standard_True);
          Standard_Boolean aKeepOrientation(Standard_False);
          if (nb >= 5) 
-           aKeepOrientation = (Standard_Boolean) atoi(a[4]);
+           aKeepOrientation = (Standard_Boolean) Draw::Atoi(a[4]);
          Standard_Boolean aGeometry(Standard_False);
          if (nb == 6) 
-           aGeometry = (Standard_Boolean) atoi(a[5]);
+           aGeometry = (Standard_Boolean) Draw::Atoi(a[5]);
          Handle(TNaming_NamedShape) aCont =  DNaming::GetObjectValue(aContext);
 
          if(aCont.IsNull() || aCont->IsEmpty())
@@ -815,8 +815,8 @@ static Standard_Integer DNaming_AddCylinder (Draw_Interpretor& theDI,
     TDF_Reference::Set(anObj->Label(), aFun->Label().FindChild(FUNCTION_RESULT_LABEL)); //result is here 
 
     Standard_Real aR, aH;
-    aR = atof(theArg[2]);
-    aH = atof(theArg[3]);
+    aR = Draw::Atof(theArg[2]);
+    aH = Draw::Atof(theArg[3]);
 
     Handle(TDataStd_UAttribute) Axis; 
     if (!DDocStd::Find(aDocument, theArg[4], GEOMOBJECT_GUID, Axis)) return 1;
@@ -854,7 +854,7 @@ static Standard_Integer DNaming_CylRad (Draw_Interpretor& theDI,
     
     Handle(TFunction_Function) aFun = GetFunction(objLabel,funGUID);
     if(!aFun.IsNull()) {
-      Standard_Real value = atof(theArg[3]);
+      Standard_Real value = Draw::Atof(theArg[3]);
       DNaming::GetReal(aFun,CYL_RADIUS)->Set(value);
       DDF::ReturnLabel(theDI, DNaming::GetReal(aFun,CYL_RADIUS)->Label());
       return 0;
@@ -991,7 +991,7 @@ static Standard_Integer DNaming_AddFillet (Draw_Interpretor& theDI,
 
   TDF_Reference::Set(anObject->Label(), aFun->Label().FindChild(FUNCTION_RESULT_LABEL)); //result is here 
 
-  Standard_Real aRadius = atof(theArg[3]);
+  Standard_Real aRadius = Draw::Atof(theArg[3]);
   DNaming::GetReal(aFun,FILLET_RADIUS)->Set(aRadius);  
 
   Handle(TDataStd_UAttribute) aPath;
@@ -1027,13 +1027,13 @@ static Standard_Integer DNaming_PTranslateDXYZ (Draw_Interpretor& di,
     TDataStd_Name::Set(aFun->Label(), "ParTranslation");
     
     Standard_Real aDx=0., aDy=0., aDz=0.;
-    aDx = atof(a[3]);
+    aDx = Draw::Atof(a[3]);
     //cout << "DX = " << aDx<<endl;
     if(nb > 4) {
-      aDy = atof(a[4]);
+      aDy = Draw::Atof(a[4]);
       //cout << "DY = " << aDy<<endl;
       if(nb > 5) {
-       aDz = atof(a[5]);
+       aDz = Draw::Atof(a[5]);
        //cout << "DZ = " << aDz<<endl;
       }
     }
@@ -1075,7 +1075,7 @@ static Standard_Integer DNaming_PTranslateLine (Draw_Interpretor& di,
     TDataStd_Name::Set(aFun->Label(), "ParTranslationAlongLine");
         
     Standard_Real anOff = 0.;
-    anOff =  atof(a[4]);
+    anOff =  Draw::Atof(a[4]);
     DNaming::GetReal(aFun,PTRANSF_OFF)->Set(anOff);
   
     DNaming::SetObjectArg(aFun, PTRANSF_LINE, aLine); 
@@ -1115,7 +1115,7 @@ static Standard_Integer DNaming_PRotateLine(Draw_Interpretor& di,
     TDF_Reference::Set(anObject->Label(), aFun->Label().FindChild(FUNCTION_RESULT_LABEL));
 
     Standard_Real anAngle = 0.;
-    anAngle =  atof(a[4]);
+    anAngle =  Draw::Atof(a[4]);
     Standard_Real aK = 2*M_PI/360;
     anAngle = anAngle * aK;
     DNaming::GetReal(aFun,PTRANSF_ANG)->Set(anAngle);
@@ -1189,9 +1189,9 @@ static Standard_Integer DNaming_AddPrism (Draw_Interpretor& theDI,
   Handle(TDataStd_UAttribute) aBasisObj;
   if (!DDocStd::Find(aDocument, theArg[2], GEOMOBJECT_GUID, aBasisObj)) return 1;
   DNaming::SetObjectArg(aFun, PRISM_BASIS, aBasisObj); 
-  Standard_Real height = atof(theArg[3]);
+  Standard_Real height = Draw::Atof(theArg[3]);
   DNaming::GetReal(aFun,PRISM_HEIGHT)->Set(height);
-  Standard_Integer reverse = atoi(theArg[4]);
+  Standard_Integer reverse = Draw::Atoi(theArg[4]);
   DNaming::GetInteger(aFun,PRISM_DIR)->Set(reverse);
   DDF::ReturnLabel(theDI, anObj->Label());
   return 0;
@@ -1219,7 +1219,7 @@ static Standard_Integer DNaming_PrismHeight (Draw_Interpretor& theDI,
     
     Handle(TFunction_Function) aFun = GetFunction(objLabel,funGUID);
     if(!aFun.IsNull()) {
-      Standard_Real value = atof(theArg[3]);
+      Standard_Real value = Draw::Atof(theArg[3]);
       DNaming::GetReal(aFun, PRISM_HEIGHT)->Set(value);
       DDF::ReturnLabel(theDI, DNaming::GetReal(aFun,PRISM_HEIGHT)->Label());
       return 0;
@@ -1277,12 +1277,12 @@ static Standard_Integer DNaming_AddRevol (Draw_Interpretor& theDI,
   DNaming::SetObjectArg(aFun, REVOL_AXIS, anAxObj); 
 
   if(theNb > 4 ) {  
-    Standard_Real angle = atof(theArg[4]);
+    Standard_Real angle = Draw::Atof(theArg[4]);
     Standard_Real aK = 2*M_PI/360;
     angle = angle * aK;
     DNaming::GetReal(aFun,REVOL_ANGLE)->Set(angle);
     if( theNb == 6) {
-      Standard_Integer reverse = atoi(theArg[5]);
+      Standard_Integer reverse = Draw::Atoi(theArg[5]);
       DNaming::GetInteger(aFun, REVOL_REV)->Set(reverse);
     }
   }
@@ -1312,7 +1312,7 @@ static Standard_Integer DNaming_RevolutionAngle (Draw_Interpretor& theDI,
     
     Handle(TFunction_Function) aFun = GetFunction(objLabel,funGUID);
     if(!aFun.IsNull()) {
-      Standard_Real value = atof(theArg[3]);
+      Standard_Real value = Draw::Atof(theArg[3]);
       DNaming::GetReal(aFun, REVOL_ANGLE)->Set(value);
       DDF::ReturnLabel(theDI, DNaming::GetReal(aFun,REVOL_ANGLE)->Label());
       return 0;
@@ -1351,7 +1351,7 @@ static Standard_Integer DNaming_AddSphere (Draw_Interpretor& theDI,
   if (!DDocStd::Find(aDocument, theArg[2], GEOMOBJECT_GUID, aCenterObj)) return 1;
   DNaming::SetObjectArg(aFun, SPHERE_CENTER, aCenterObj);
 
-  Standard_Real aRadius = atof(theArg[3]);
+  Standard_Real aRadius = Draw::Atof(theArg[3]);
   DNaming::GetReal(aFun,SPHERE_RADIUS)->Set(aRadius);
   
   DDF::ReturnLabel(theDI, anObj->Label());
@@ -1380,7 +1380,7 @@ static Standard_Integer DNaming_SphereRadius (Draw_Interpretor& theDI,
 
     Handle(TFunction_Function) aFun = GetFunction(objLabel,funGUID);
     if(!aFun.IsNull()) {
-      Standard_Real value = atof(theArg[3]);
+      Standard_Real value = Draw::Atof(theArg[3]);
       DNaming::GetReal(aFun, SPHERE_RADIUS)->Set(value);
       DDF::ReturnLabel(theDI, DNaming::GetReal(aFun, SPHERE_RADIUS)->Label());
       return 0;
@@ -1414,9 +1414,9 @@ static Standard_Integer DNaming_AddPoint (Draw_Interpretor& theDI,
     
     TDF_Reference::Set(anObj->Label(), aFun->Label().FindChild(FUNCTION_RESULT_LABEL)); //result is here 
     Standard_Real x,y,z;
-    x = atof(theArg[2]);
-    y = atof(theArg[3]);
-    z = atof(theArg[4]);
+    x = Draw::Atof(theArg[2]);
+    y = Draw::Atof(theArg[3]);
+    z = Draw::Atof(theArg[4]);
 
     DNaming::GetReal(aFun,PNT_DX)->Set(x);
     DNaming::GetReal(aFun,PNT_DY)->Set(y);
@@ -1457,9 +1457,9 @@ static Standard_Integer DNaming_AddPointRlt (Draw_Interpretor& theDI,
     if (!DDocStd::Find(aDocument, theArg[2], GEOMOBJECT_GUID, aRefPnt)) return 1;
 
     Standard_Real dx,dy,dz;
-    dx = atof(theArg[3]);
-    dy = atof(theArg[4]);
-    dz = atof(theArg[5]);
+    dx = Draw::Atof(theArg[3]);
+    dy = Draw::Atof(theArg[4]);
+    dz = Draw::Atof(theArg[5]);
 
     DNaming::GetReal(aFun,PNT_DX)->Set(dx);
     DNaming::GetReal(aFun,PNT_DY)->Set(dy);
@@ -1504,17 +1504,17 @@ static Standard_Integer DNaming_PntOffset (Draw_Interpretor& theDI,
       Standard_Real value(0.0);
       Standard_Boolean isDX = (strcmp(theArg[3],"skip"));
       if(isDX) {
-       value = atof(theArg[3]);
+       value = Draw::Atof(theArg[3]);
        DNaming::GetReal(aFun,PNT_DX)->Set(value);
       }
       Standard_Boolean isDY = (strcmp(theArg[4],"skip"));
       if(isDY) {
-       value = atof(theArg[4]);
+       value = Draw::Atof(theArg[4]);
        DNaming::GetReal(aFun,PNT_DY)->Set(value);
       }
       Standard_Boolean isDZ = (strcmp(theArg[5],"skip"));
       if(isDZ) {
-       value = atof(theArg[5]);
+       value = Draw::Atof(theArg[5]);
        DNaming::GetReal(aFun,PNT_DZ)->Set(value);
       }
       if(isDX || isDY || isDZ)
@@ -1554,7 +1554,7 @@ static Standard_Integer DNaming_Line3D (Draw_Interpretor& theDI,
   TDataStd_Name::Set(aFun->Label(), "Line3D_Function");
   TDF_Reference::Set(anObj->Label(), aFun->Label().FindChild(FUNCTION_RESULT_LABEL)); //result is here 
  
-  Standard_Integer aType = atoi(theArg[2]);
+  Standard_Integer aType = Draw::Atoi(theArg[2]);
   DNaming::GetInteger(aFun,LINE3D_TYPE)->Set(aType);
   
 //LINE3D_PNTNB
@@ -1869,11 +1869,11 @@ static Standard_Integer DNaming_TestSingle (Draw_Interpretor& theDI,
     Standard_Boolean XSelection(Standard_False);
     Standard_Boolean Geometry(Standard_False);
     if(theNb == 4)
-      Orientation = (Standard_Boolean)atoi(theArg[3]);
+      Orientation = (Standard_Boolean)Draw::Atoi(theArg[3]);
     if(theNb == 5)
-      XSelection = (Standard_Boolean)atoi(theArg[4]);
+      XSelection = (Standard_Boolean)Draw::Atoi(theArg[4]);
     if (theNb == 6) 
-      Geometry = (Standard_Boolean) atoi(theArg[5]);
+      Geometry = (Standard_Boolean) Draw::Atoi(theArg[5]);
     Handle(TNaming_NamedShape) aNS = DNaming::GetObjectValue( aCntObj);
 
     if(!aNS.IsNull() && !aNS->IsEmpty()) {
@@ -2008,11 +2008,11 @@ static Standard_Integer DNaming_Multiple (Draw_Interpretor& theDI,
     Standard_Boolean XSelection(Standard_False);
     Standard_Boolean Geometry(Standard_False);
     if(theNb == 4)
-      Orientation = (Standard_Boolean)atoi(theArg[3]);
+      Orientation = (Standard_Boolean)Draw::Atoi(theArg[3]);
     if(theNb == 5)
-      XSelection = (Standard_Boolean)atoi(theArg[4]);
+      XSelection = (Standard_Boolean)Draw::Atoi(theArg[4]);
     if (theNb == 6) 
-      Geometry = (Standard_Boolean) atoi(theArg[5]);
+      Geometry = (Standard_Boolean) Draw::Atoi(theArg[5]);
     Handle(TNaming_NamedShape) aNS = DNaming::GetObjectValue( aCntObj);
 
     if(!aNS.IsNull() && !aNS->IsEmpty()) {
index 8a2039dadb82720f454de8484d784f36a0923ba1..919e7753236c06e2b4c53a1083cf4e89a18df4ad 100755 (executable)
@@ -129,7 +129,7 @@ static Standard_Integer DNaming_Select (Draw_Interpretor& di, Standard_Integer n
     }
     if (n > 4) {  
       Standard_Boolean Orient(Standard_False);
-      if(n == 6) Orient = (Standard_Boolean)atoi(a[5]);
+      if(n == 6) Orient = (Standard_Boolean)Draw::Atoi(a[5]);
       TopoDS_Shape S = DBRep::Get(a[3], TopAbs_SHAPE);
       TopoDS_Shape C = DBRep::Get(a[4], TopAbs_SHAPE);
       SL.Select (S, C, geometry, Orient);       
@@ -223,7 +223,7 @@ static Standard_Integer DNaming_SolveSelection (Draw_Interpretor& di, Standard_I
        if(!isSolved)
                di << "!!! Solver is failed" <<"\n";
     TopoDS_Shape Res = TNaming_Tool::CurrentShape(SL.NamedShape());
-    sprintf (name,"%s_%s","new",a[2]);
+    Sprintf (name,"%s_%s","new",a[2]);
     Display (name,Res);
     return 0;
   }
index d9b6b60951477b96d3730d713ea1304c1b877eea..f31643168b77ec0a08962afd56f1bb3078f84b81 100755 (executable)
@@ -329,7 +329,7 @@ static Standard_Integer DPrsStd_AISTransparency (Draw_Interpretor& di,
     Handle(TPrsStd_AISPresentation) prs;
     if(L.FindAttribute( TPrsStd_AISPresentation::GetID(), prs) ) {   
       if( nb == 4 ) {
-       prs->SetTransparency(atof(arg[3]));
+       prs->SetTransparency(Draw::Atof(arg[3]));
        TPrsStd_AISViewer::Update(L);
       }
       else {
@@ -396,7 +396,7 @@ static Standard_Integer DPrsStd_AISColor (Draw_Interpretor& di,
     Handle(TPrsStd_AISPresentation) prs;
     if(L.FindAttribute( TPrsStd_AISPresentation::GetID(), prs) ) {   
       if( nb == 4 ) {
-       prs->SetColor((Quantity_NameOfColor)atoi(arg[3]));
+       prs->SetColor((Quantity_NameOfColor)Draw::Atoi(arg[3]));
        TPrsStd_AISViewer::Update(L);
       }
       else
@@ -465,7 +465,7 @@ static Standard_Integer DPrsStd_AISMaterial (Draw_Interpretor& di,
     Handle(TPrsStd_AISPresentation) prs;
     if(L.FindAttribute( TPrsStd_AISPresentation::GetID(), prs) ) {   
       if( nb == 4 ) {
-       prs->SetMaterial((Graphic3d_NameOfMaterial)atoi(arg[3]));
+       prs->SetMaterial((Graphic3d_NameOfMaterial)Draw::Atoi(arg[3]));
        TPrsStd_AISViewer::Update(L);
       }
       else {
index 886cfe253ac3a53faf5410da849dfa2f280896e0..b943ad3f5943c276595461ef61259b08179311b5 100755 (executable)
@@ -182,13 +182,13 @@ is
        ---Purpose: Sets a TCL sting variable
        
     Atof(Name : CString) returns Real;
-       ---Purpose: Search a  numeric  variable.  If none found converts
-       --          the string to a real.
+       ---Purpose: Converts numeric expression, that can involve DRAW
+        --          variables, to real value.
     
     Atoi(Name : CString) returns Integer;
-       ---Purpose: Search a  numeric  variable.  If none found converts
-       --          the string to an integer.
-    
+       ---Purpose: Converts numeric expression, that can involve DRAW
+        --          variables, to integer value. 
+        --          Implemented as cast of Atof() to integer.
     
     LastPick(view,X,Y,button : out Integer);
        ---Purpose: Returns last graphic selection description.
index 8e57404ce46a5657de4cfa6b5f5f8710e9925e84..d654dd22e61e211e6fabfeb3017048de9daa2735 100755 (executable)
@@ -110,7 +110,7 @@ static void ReadInitFile (const TCollection_AsciiString& theFileName)
     try {
       aPath.ChangeAll ('\\', '/');
 
-      sprintf(console_command, "source \"%.980s\"", aPath.ToCString());
+      Sprintf(console_command, "source \"%.980s\"", aPath.ToCString());
       console_semaphore = HAS_CONSOLE_COMMAND;
       while (console_semaphore == HAS_CONSOLE_COMMAND)
         Sleep(10);
@@ -122,7 +122,7 @@ static void ReadInitFile (const TCollection_AsciiString& theFileName)
   } else {
 #endif
     char* com = new char [aPath.Length() + strlen ("source ") + 2];
-    sprintf (com, "source %s", aPath.ToCString());
+    Sprintf (com, "source %s", aPath.ToCString());
     Draw_Interprete (com);
     delete [] com;
 #ifdef WNT
index 3503c0917fb4dfc4fc377341cdc14b18c3dd1939..004a8c3079384772df0bcf5b857f79bbc7a62895 100755 (executable)
@@ -64,9 +64,6 @@ extern Draw_Viewer dout;
 extern Standard_Boolean Draw_Batch;
 #endif
 
-#define atof(X) Draw::Atof(X)
-#define atoi(X) Draw::Atoi(X)
-
 class Draw_SaveAndRestore {
 
   public :
index d2db55a3c1a53428a7823b1615e5fd2701c89010..012af7f198d3786d57a53f0f9ae141e9829b95ce 100755 (executable)
@@ -391,7 +391,7 @@ static Standard_Integer Draw_wait(Draw_Interpretor& , Standard_Integer n, const
 {
   Standard_Integer w = 10;
   if (n > 1)
-    w = atoi(a[1]);
+    w = Draw::Atoi(a[1]);
   time_t ct = time(NULL) + w;
   while (time(NULL) < ct) {};
   return 0;
@@ -443,7 +443,7 @@ static Standard_Integer cpulimit(Draw_Interpretor& di, Standard_Integer n, const
     CPU_LIMIT = RLIM_INFINITY;
   else
   {
-    CPU_LIMIT = atoi (a[1]);
+    CPU_LIMIT = Draw::Atoi (a[1]);
     Standard_Real anUserSeconds, aSystemSeconds;
     OSD_Chronometer::GetProcessCPU (anUserSeconds, aSystemSeconds);
     CPU_CURRENT = clock_t(anUserSeconds + aSystemSeconds);
@@ -464,7 +464,7 @@ static Standard_Integer cpulimit(Draw_Interpretor& di, Standard_Integer n, const
   if (n <= 1)
     rlp.rlim_cur = RLIM_INFINITY;
   else
-    rlp.rlim_cur = atoi(a[1]);
+    rlp.rlim_cur = Draw::Atoi(a[1]);
   CPU_LIMIT = rlp.rlim_cur;
 
   int status;
@@ -517,7 +517,7 @@ By default <logfile> is \"mem-log.txt\", <outfile> is \"mem-stat.txt\""
   }
   if (strcmp(a[1], "set") == 0)
   {
-    int aType = (n > 2 ? atoi(a[2]) : 1);
+    int aType = (n > 2 ? Draw::Atoi(a[2]) : 1);
     if (aType < 0 || aType > 2)
     {
       di << "unknown op of the command set" << "\n";
@@ -581,7 +581,7 @@ By default <logfile> is \"mem-log.txt\", <outfile> is \"mem-stat.txt\""
     const char* aOutFile = "mem-stat.txt";
     if (n > 2)
     {
-      includeAlive = (atoi(a[2]) != 0);
+      includeAlive = (Draw::Atoi(a[2]) != 0);
       if (n > 3)
       {
         aLogFile = a[3];
@@ -608,6 +608,38 @@ By default <logfile> is \"mem-log.txt\", <outfile> is \"mem-stat.txt\""
   return 0;
 }
 
+//==============================================================================
+//function : dlocale
+//purpose  :
+//==============================================================================
+
+static int dlocale (Draw_Interpretor& di, Standard_Integer n, const char** argv)
+{
+  int category = LC_ALL;
+  if (n > 1)
+  {
+    const char *cat = argv[1];
+    if ( ! strcmp (cat, "LC_ALL") ) category = LC_ALL;
+    else if ( ! strcmp (cat, "LC_COLLATE") ) category = LC_COLLATE;
+    else if ( ! strcmp (cat, "LC_CTYPE") ) category = LC_CTYPE;
+    else if ( ! strcmp (cat, "LC_MONETARY") ) category = LC_MONETARY;
+    else if ( ! strcmp (cat, "LC_NUMERIC") ) category = LC_NUMERIC;
+    else if ( ! strcmp (cat, "LC_TIME") ) category = LC_TIME;
+    else 
+    {
+      cout << "Error: cannot recognize argument " << cat << " as one of LC_ macros" << endl;
+      return 1;
+    }
+  }
+  const char* locale = (n > 2 ? argv[2] : NULL);
+  const char* result = setlocale (category, locale);
+  if (result)
+    di << result;
+  else 
+    cout << "Error: unsupported locale specification: " << locale << endl;
+  return 0;
+}
+
 //==============================================================================
 //function : dmeminfo
 //purpose  :
@@ -702,4 +734,6 @@ void Draw::BasicCommands(Draw_Interpretor& theCommands)
                  __FILE__,dbreak,g);
   theCommands.Add("dversion", "provides information on OCCT build configuration (version, compiler, OS, C library, etc.)",
                  __FILE__,dversion,g);
+  theCommands.Add("dlocale", "set and / or query locate of C subsystem (function setlocale())",
+                 __FILE__,dlocale,g);
 }
index f36ba2ca47225bd64fa652fc70dcb1004e44d810..13d485b99b3ad390a4fa0acd8f7ce7e13c107d2f 100755 (executable)
@@ -74,7 +74,7 @@ static char Draw_fontsizedefault[FONTLENGTH]="150";
 
 static Standard_Integer ViewId(const Standard_CString a)
 {
-  Standard_Integer id = atoi(a);
+  Standard_Integer id = Draw::Atoi(a);
   if ((id < 0) || (id >= MAXVIEW)) {
     cout << "Incorrect view-id, must be in 0.."<<MAXVIEW-1<<endl;
     return -1;
@@ -90,7 +90,7 @@ static void SetTitle(const Standard_Integer id)
 {
   if (dout.HasView(id)) {
     char title[255];
-    sprintf(title,"%d : %s - Zoom %f",id,dout.GetType(id),dout.Zoom(id));
+    Sprintf(title,"%d : %s - Zoom %f",id,dout.GetType(id),dout.Zoom(id));
     dout.SetTitle(id,title);
   }
 }
@@ -106,7 +106,7 @@ static Standard_Integer zoom(Draw_Interpretor& , Standard_Integer n, const char*
   // two argument -> First is the view
   Standard_Boolean z2d = !strcasecmp(a[0],"2dzoom");
   if (n == 2) {
-    Standard_Real z = atof(a[1]);
+    Standard_Real z = Draw::Atof(a[1]);
     for (Standard_Integer id = 0; id < MAXVIEW; id++) {
       if (dout.HasView(id)) {
        if ((z2d && !dout.Is3D(id)) || (!z2d && dout.Is3D(id))) {
@@ -121,7 +121,7 @@ static Standard_Integer zoom(Draw_Interpretor& , Standard_Integer n, const char*
   else if (n >= 3) {
     Standard_Integer id = ViewId(a[1]);
     if (id < 0) return 1;
-    Standard_Real z = atof(a[2]);
+    Standard_Real z = Draw::Atof(a[2]);
     dout.SetZoom(id,z);
     dout.RepaintView(id);
     SetTitle(id);
@@ -263,7 +263,7 @@ static Standard_Integer view(Draw_Interpretor& di, Standard_Integer n, const cha
   if (Draw_Batch) return 1;
 
   if ((n >= 3) && (n != 4)) {
-    Standard_Integer id = atoi(a[1]);
+    Standard_Integer id = Draw::Atoi(a[1]);
     if ((id < 0) || (id >= MAXVIEW)) {
       di <<"View-id must be in 0.."<<MAXVIEW-1<<"\n";
       return 1;
@@ -276,13 +276,13 @@ static Standard_Integer view(Draw_Interpretor& di, Standard_Integer n, const cha
     if (dout.HasView(id))
       dout.GetPosSize(id,X,Y,W,H);
     if (n >= 4)
-      X = atoi(a[3]);
+      X = Draw::Atoi(a[3]);
     if (n >= 5)
-      Y = atoi(a[4]);
+      Y = Draw::Atoi(a[4]);
     if (n >= 6)
-      W = atoi(a[5]);
+      W = Draw::Atoi(a[5]);
     if (n >= 7)
-      H = atoi(a[6]);
+      H = Draw::Atoi(a[6]);
     dout.MakeView(id,a[2],X,Y,W,H);
     if (!dout.HasView(id)) {
       di << "View creation failed"<<"\n";
@@ -294,7 +294,7 @@ static Standard_Integer view(Draw_Interpretor& di, Standard_Integer n, const cha
   }
   else if (n == 4) {
     // create a view on a given window
-    Standard_Integer id = atoi(a[1]);
+    Standard_Integer id = Draw::Atoi(a[1]);
     if ((id < 0) || (id >= MAXVIEW)) {
       di <<"View-id must be in 0.."<<MAXVIEW-1<<"\n";
       return 1;
@@ -421,7 +421,7 @@ static Standard_Integer setfocal(Draw_Interpretor& di, Standard_Integer n, const
     }
   }
   else {
-    Standard_Real f = atof(a[1]);
+    Standard_Real f = Draw::Atof(a[1]);
     for (Standard_Integer id = 0; id < MAXVIEW; id++) {
       if (!strcasecmp(dout.GetType(id),"PERS"))
        dout.SetFocal(id,f);
@@ -575,14 +575,14 @@ static Standard_Integer ptv(Draw_Interpretor& , Standard_Integer n, const char**
     Standard_Integer anid = ViewId(a[1]);
     if (anid < 0) return 1;
     start = end = anid;
-    X = atof(a[2]);
-    Y = atof(a[3]);
-    Z = atof(a[4]);
+    X = Draw::Atof(a[2]);
+    Y = Draw::Atof(a[3]);
+    Z = Draw::Atof(a[4]);
   }
   else {
-    X = atof(a[1]);
-    Y = atof(a[2]);
-    Z = atof(a[3]);
+    X = Draw::Atof(a[1]);
+    Y = Draw::Atof(a[2]);
+    Z = Draw::Atof(a[3]);
   }
 
   for (Standard_Integer id = start; id <= end; id++) {
@@ -614,14 +614,14 @@ static Standard_Integer dptv(Draw_Interpretor& , Standard_Integer n, const char*
     Standard_Integer anid = ViewId(a[1]);
     if (anid < 0) return 1;
     start = end = anid;
-    DX = atof(a[2]);
-    DY = atof(a[3]);
-    DZ = atof(a[4]);
+    DX = Draw::Atof(a[2]);
+    DY = Draw::Atof(a[3]);
+    DZ = Draw::Atof(a[4]);
   }
   else {
-    DX = atof(a[1]);
-    DY = atof(a[2]);
-    DZ = atof(a[3]);
+    DX = Draw::Atof(a[1]);
+    DY = Draw::Atof(a[2]);
+    DZ = Draw::Atof(a[3]);
   }
 
   for (Standard_Integer id = start; id <= end; id++) {
@@ -647,7 +647,7 @@ static Standard_Integer color(Draw_Interpretor& di, Standard_Integer n, const ch
   if (n < 3) {
     Draw_BlackBackGround = !Draw_BlackBackGround;
   }
-  else if (!dout.DefineColor(atoi(a[1]),a[2])) {
+  else if (!dout.DefineColor(Draw::Atoi(a[1]),a[2])) {
     di << "Could not allocate color "<<a[2]<<"\n";
     return 1;
   }
@@ -826,7 +826,7 @@ static Standard_Integer hcolor(Draw_Interpretor& di, Standard_Integer n, const c
     di << "12 = Yellow,\t 13 = Khaki,\t 14 = Coral" << "\n" ;
     di << "1 <= width <= 11,  0 (noir)  <= gray <= 1 (blanc)" << "\n" ;
   } else {
-    dout.PostColor(atoi(a[1]),atoi(a[2]),atof(a[3]));
+    dout.PostColor(Draw::Atoi(a[1]),Draw::Atoi(a[2]),Draw::Atof(a[3]));
   }
   return 0;
 }
@@ -848,7 +848,7 @@ static Standard_Integer xwd(Draw_Interpretor& , Standard_Integer n, const char**
   Standard_Integer id = 1;
   const char* file = a[1];
   if (n > 2) {
-    id  = atoi(a[1]);
+    id  = Draw::Atoi(a[1]);
     file = a[2];
   }
   if (!dout.SaveView(id,file))
@@ -873,19 +873,19 @@ static Standard_Integer grid (Draw_Interpretor& , Standard_Integer NbArg, const
       StepZ = DefaultGridStep ;
       break ;
     case 2 :
-      StepX = Abs (atof (Arg[1])) ;
-      StepY = Abs (atof (Arg[1])) ;
-      StepZ = Abs (atof (Arg[1])) ;
+      StepX = Abs (Draw::Atof (Arg[1])) ;
+      StepY = Abs (Draw::Atof (Arg[1])) ;
+      StepZ = Abs (Draw::Atof (Arg[1])) ;
       break ;
     case 3 :
-      StepX = Abs (atof (Arg[1])) ;
-      StepY = Abs (atof (Arg[2])) ;
-      StepZ = Abs (atof (Arg[2])) ;
+      StepX = Abs (Draw::Atof (Arg[1])) ;
+      StepY = Abs (Draw::Atof (Arg[2])) ;
+      StepZ = Abs (Draw::Atof (Arg[2])) ;
       break ;
     case 4 :
-      StepX = Abs (atof (Arg[1])) ;
-      StepY = Abs (atof (Arg[2])) ;
-      StepZ = Abs (atof (Arg[3])) ;
+      StepX = Abs (Draw::Atof (Arg[1])) ;
+      StepY = Abs (Draw::Atof (Arg[2])) ;
+      StepZ = Abs (Draw::Atof (Arg[3])) ;
       break ;
     default :
       return 1 ;
@@ -941,7 +941,7 @@ static Standard_Integer dtext(Draw_Interpretor& di, Standard_Integer n, const ch
   }
   else if (n >= 4) {
     is3d = n > 4;
-    P.SetCoord(atof(a[1]),atof(a[2]),is3d ? atof(a[3]) : 0);
+    P.SetCoord(Draw::Atof(a[1]),Draw::Atof(a[2]),is3d ? Draw::Atof(a[3]) : 0);
   }
   else
     return 0;
index 7a9aac764e32ba9645e81964d2582f085d0cfb3d..41fa96e0e358313d36b99205e9d6480d9b57d972 100755 (executable)
@@ -233,7 +233,7 @@ static Standard_Integer CommandCmd
 
     cout << "An exception was caught " << E << endl;
 
-    if (cc && atoi(cc)) {
+    if (cc && Draw::Atoi(cc)) {
 #ifdef WNT
       Tcl_Exit(0);
 #else      
@@ -497,7 +497,7 @@ Draw_Interpretor& Draw_Interpretor::Append(const TCollection_ExtendedString& the
 Draw_Interpretor& Draw_Interpretor::Append(const Standard_Integer i)
 {
   char c[100];
-  sprintf(c,"%d",i);
+  Sprintf(c,"%d",i);
   Tcl_AppendResult(myInterp,c,(Standard_CString)0);
   return *this;
 }
@@ -510,7 +510,7 @@ Draw_Interpretor& Draw_Interpretor::Append(const Standard_Integer i)
 Draw_Interpretor& Draw_Interpretor::Append(const Standard_Real r)
 {
   char s[100];
-  sprintf(s,"%.17g",r);
+  Sprintf(s,"%.17g",r);
   Tcl_AppendResult(myInterp,s,(Standard_CString)0);
   return *this;
 }
index 366c9ca723a15415d62234e0cef4661cc58fb9b0..bbfaa56ba03939cec1db858340d4d8181e719dd4 100755 (executable)
@@ -87,7 +87,7 @@ Standard_Boolean Draw_ProgressIndicator::Show(const Standard_Boolean force)
   // Prepare textual progress info
   char text[2048];
   Standard_Integer n = 0;
-  n += sprintf ( &text[n], "Progress: %.0f%%", 100. * GetPosition() );
+  n += Sprintf ( &text[n], "Progress: %.0f%%", 100. * GetPosition() );
   for ( Standard_Integer i=GetNbScopes(); i >=1; i-- ) {
     const Message_ProgressScale &scale = GetScope ( i );
     if ( scale.GetName().IsNull() ) continue; // skip unnamed scopes
@@ -95,16 +95,16 @@ Standard_Boolean Draw_ProgressIndicator::Show(const Standard_Boolean force)
     Standard_Real locPos = ( i >1 ? GetScope ( i-1 ).GetLast() : GetPosition() );
     // print progress info differently for finite and infinite scopes
     if ( scale.GetInfinite() )
-      n += sprintf ( &text[n], " %s: %.0f", scale.GetName()->ToCString(), 
+      n += Sprintf ( &text[n], " %s: %.0f", scale.GetName()->ToCString(), 
                      scale.BaseToLocal ( locPos ) );
     else 
-      n += sprintf ( &text[n], " %s: %.0f / %.0f", scale.GetName()->ToCString(), 
+      n += Sprintf ( &text[n], " %s: %.0f / %.0f", scale.GetName()->ToCString(), 
                      scale.BaseToLocal ( locPos ), scale.GetMax() );
   }
 
   // In addition, write elapsed/estimated/remaining time
   if ( GetPosition() > 0.01 ) {
-    n += sprintf ( &text[n], "\nElapsed/estimated time: %ld/%.0f sec", 
+    n += Sprintf ( &text[n], "\nElapsed/estimated time: %ld/%.0f sec", 
                    (long)(aTime - myStartTime), ( aTime - myStartTime ) / GetPosition() );
   }
   
@@ -112,7 +112,7 @@ Standard_Boolean Draw_ProgressIndicator::Show(const Standard_Boolean force)
   if ( myGraphMode ) {
     if ( ! myShown ) {
       char command[1024];
-      sprintf ( command, "toplevel .xprogress -height 100 -width 410;"
+      Sprintf ( command, "toplevel .xprogress -height 100 -width 410;"
                          "wm title .xprogress \"Progress\";"
                          "set xprogress_stop 0;"
                          "canvas .xprogress.bar -width 402 -height 22;"
@@ -127,12 +127,12 @@ Standard_Boolean Draw_ProgressIndicator::Show(const Standard_Boolean force)
     }
     char command[1024];
     Standard_Integer num = 0;
-    num += sprintf ( &command[num], ".xprogress.bar coords progress 2 2 %.0f 21;", 
+    num += Sprintf ( &command[num], ".xprogress.bar coords progress 2 2 %.0f 21;", 
                   1+400*GetPosition() );
-    num += sprintf ( &command[num], ".xprogress.bar coords progress_next 2 2 %.0f 21;", 
+    num += Sprintf ( &command[num], ".xprogress.bar coords progress_next 2 2 %.0f 21;", 
                   1+400*GetScope(1).GetLast() );
-    num += sprintf ( &command[num], ".xprogress.text configure -text \"%s\";", text );
-    num += sprintf ( &command[num], "update" );
+    num += Sprintf ( &command[num], ".xprogress.text configure -text \"%s\";", text );
+    num += Sprintf ( &command[num], "update" );
     ((Draw_Interpretor*)myDraw)->Eval ( command );
   }
 
index b0da35532653539ce563d3b40f3e572b93a586a8..c67bc4793b4dac32f391de7e73c9398d5271dbdf 100755 (executable)
@@ -45,7 +45,7 @@ static Standard_Integer parsing
   TCollection_AsciiString aStrTok(argv[1]);
   Standard_Integer nbIter =1;
   if(argc >2)
-    nbIter = atoi(argv[2]);
+    nbIter = Draw::Atoi(argv[2]);
   UnitsAPI::SetLocalSystem();
   Handle(Units_Token) atoken;
   Units_UnitSentence aUnitSent(aStrTok.ToCString());
@@ -93,7 +93,7 @@ static Standard_Integer converttoSI
     return 1;
   }
 
-  Standard_Real aData = atof(argv[1]);
+  Standard_Real aData = Draw::Atof(argv[1]);
   Standard_CString aUnit = argv[2];
 
   Standard_Real res = UnitsAPI::AnyToSI(aData,aUnit);
@@ -115,7 +115,7 @@ static Standard_Integer converttoMDTV
     return 1;
   }
 
-  Standard_Real aData = atof(argv[1]);
+  Standard_Real aData = Draw::Atof(argv[1]);
   Standard_CString aUnit = argv[2];
 
   UnitsAPI::SetLocalSystem(UnitsAPI_MDTV);
@@ -134,7 +134,7 @@ static Standard_Integer converttoMDTV
 static Standard_Integer unit(Draw_Interpretor& , Standard_Integer n, const char** a)
 {
   if(n == 4) {
-    cout << Units::Convert(atof(a[1]), a[2], a[3]) << endl;
+    cout << Units::Convert(Draw::Atof(a[1]), a[2], a[3]) << endl;
     return 0;
   }
   else
index 95728f73cef5d2144d0f29409ca12743432c6dfe..da2144d75138f1ec1e29612cd6a8a08ce2686c02 100755 (executable)
@@ -400,12 +400,12 @@ static Standard_Integer erase(Draw_Interpretor& di, Standard_Integer n, const ch
 static Standard_Integer draw(Draw_Interpretor& , Standard_Integer n, const char** a)
 {
   if (n < 3) return 1;
-  Standard_Integer id = atoi(a[1]);
+  Standard_Integer id = Draw::Atoi(a[1]);
   if (!dout.HasView(id)) {
     cout << "bad view number in draw"<<endl;
     return 1;
   }
-  Standard_Integer mo = atoi(a[2]);
+  Standard_Integer mo = Draw::Atoi(a[2]);
   Draw_Display d = dout.MakeDisplay(id);
   d.SetMode(mo);
   Standard_Integer i;
@@ -479,7 +479,7 @@ static Standard_Integer whatis(Draw_Interpretor& di, Standard_Integer n, const c
 static Standard_Integer value(Draw_Interpretor& di, Standard_Integer n, const char** a)
 {
   if (n != 2) return 1;
-  di << atof(a[1]);
+  di << Draw::Atof(a[1]);
 
   return 0;
 }
@@ -586,7 +586,7 @@ static Standard_Integer set(Draw_Interpretor& di, Standard_Integer n, const char
   Standard_Real val=0;
   for (i = 1; i < n; i += 2) {
     val = 0;
-    if (i+1 < n) val = atof(a[i+1]);
+    if (i+1 < n) val = Draw::Atof(a[i+1]);
     Draw::Set(a[i],val);
   }
   di << val;
@@ -681,7 +681,7 @@ static Standard_Integer pick(Draw_Interpretor& , Standard_Integer n, const char*
   Standard_Integer id;
   Standard_Integer X,Y,b;
   Standard_Boolean wait = (n == 6);
-  if (!wait) id = atoi(a[1]);
+  if (!wait) id = Draw::Atoi(a[1]);
   dout.Select(id,X,Y,b,wait);
   Standard_Real z = dout.Zoom(id);
   gp_Pnt P((Standard_Real)X /z,(Standard_Real)Y /z,0);
@@ -945,7 +945,7 @@ void  Draw::Repaint()
 static Standard_Integer trigo (Draw_Interpretor& di, Standard_Integer , const char** a)
 {
 
-  Standard_Real x = atof(a[1]);
+  Standard_Real x = Draw::Atof(a[1]);
 
   if (!strcasecmp(a[0],"cos"))
     di << Cos(x);
@@ -960,7 +960,7 @@ static Standard_Integer trigo (Draw_Interpretor& di, Standard_Integer , const ch
   else if (!strcasecmp(a[0],"asin"))
     di << ASin(x);
   else if (!strcasecmp(a[0],"atan2"))
-    di << ATan2(x,atof(a[2]));
+    di << ATan2(x,Draw::Atof(a[2]));
 
   return 0;
 }
@@ -970,9 +970,6 @@ static Standard_Integer trigo (Draw_Interpretor& di, Standard_Integer , const ch
 // Atof and Atoi
 //=======================================================================
 
-#undef atof
-#undef atoi
-
 static Standard_Boolean Numeric(char c)
 {
   return (c == '.' || (c >= '0' && c <= '9'));
@@ -1028,7 +1025,7 @@ static Standard_Real ParseValue(char*& name)
        *p = '\0';
        
        if (Numeric(*name))   // numeric litteral
-         x = atof(name);
+         x = Atof(name);
        else if (!Draw::Get((Standard_CString) name,x)) {  // variable
          
          // search for a function ...
@@ -1086,7 +1083,7 @@ static Standard_Real ParseValue(char*& name)
                  x = 0;
                }
                else
-                 x = atof(theCommands.Result());
+                 x = Atof(theCommands.Result());
                theCommands.Reset();
                if (sv) {
                  theCommands << sv;
index f00f919c2e36af0a6cdffa933ccbe7ff58f3b702..2db97e72fbc8b8eee300c04d7cdc1e28edc9dd2a 100755 (executable)
@@ -224,7 +224,7 @@ static Standard_Integer DrawDim_VARIABLES (Draw_Interpretor& di,
       if (M.Add(vf)) {
        i++;
        char* p = (char *)malloc(100);
-       sprintf(p,"%s_%dv",a[1],i);
+       Sprintf(p,"%s_%dv",a[1],i);
        DBRep::Set(p,vf);
        di.AppendElement(p);
        DrawDim::DrawShapeName (vf,p);
@@ -232,14 +232,14 @@ static Standard_Integer DrawDim_VARIABLES (Draw_Interpretor& di,
       if (M.Add(vl)) {
        i++;
        char *p = (char *)malloc(100);
-       sprintf(p,"%s_%dv",a[1],i);
+       Sprintf(p,"%s_%dv",a[1],i);
        DBRep::Set(p,vl);
        di.AppendElement(p);    
        DrawDim::DrawShapeName (vl,p);
       }
       i++;
       char *p = (char *)malloc(100);
-      sprintf(p,"%s_%de",a[1],i);
+      Sprintf(p,"%s_%de",a[1],i);
       DBRep::Set(p,ex.Current());
       di.AppendElement(p);
       DrawDim::DrawShapeName (ex.Current(),p);
index 47d68789b9bb302f61c0dbeb4b4401d8e0904e6b..18e2cbac3556c4b5ad519da17f373f8091d72c9e 100755 (executable)
@@ -260,8 +260,8 @@ static Standard_Integer nbiso (Draw_Interpretor& di, Standard_Integer n, const c
 {
   if (n < 4) {
     if (n == 3) {
-      NbUIsos = atoi(a[1]);
-      NbVIsos = atoi(a[2]);
+      NbUIsos = Draw::Atoi(a[1]);
+      NbVIsos = Draw::Atoi(a[2]);
     }
     di << NbUIsos << " " << NbVIsos;
   }
@@ -269,7 +269,7 @@ static Standard_Integer nbiso (Draw_Interpretor& di, Standard_Integer n, const c
     for (Standard_Integer i = 1; i < n - 2; i++) {
       Handle(DrawTrSurf_Surface) DS = GetSurface(a[i]);
       if (!DS.IsNull()) {
-       DS->ShowIsos(atoi(a[n-2]),atoi(a[n-1]));
+       DS->ShowIsos(Draw::Atoi(a[n-2]),Draw::Atoi(a[n-1]));
        Draw::Repaint();
       }
     }
@@ -424,13 +424,13 @@ static Standard_Integer draw (Draw_Interpretor& di, Standard_Integer n, const ch
        
        else if (!strcmp(a[0],"discr")) {
          if (n == 2)
-           Discret = atoi(a[n-1]);
+           Discret = Draw::Atoi(a[n-1]);
          di << Discret;
        }
        
        else if (!strcmp(a[0],"defle")) {
          if (n == 2)
-           Deflection = atof(a[n-1]);
+           Deflection = Draw::Atof(a[n-1]);
          di << Deflection;
        }
   }
@@ -445,11 +445,11 @@ static Standard_Integer draw (Draw_Interpretor& di, Standard_Integer n, const ch
        }
        
        else if (!strcmp(a[0],"discr")) {
-         D->SetDiscretisation(atoi(a[n-1]));
+         D->SetDiscretisation(Draw::Atoi(a[n-1]));
        }
        
        else if (!strcmp(a[0],"defle")) {
-         D->SetDeflection(atof(a[n-1]));
+         D->SetDeflection(Draw::Atof(a[n-1]));
        }
        
        Draw::Repaint();
@@ -470,22 +470,22 @@ static Standard_Integer transform (Draw_Interpretor& di, Standard_Integer n, con
   gp_Trsf T;
   Standard_Integer i,last = n-1;
   if (!strcmp(a[0],"pscale")) {
-    Standard_Real s = atof(a[last]);
+    Standard_Real s = Draw::Atof(a[last]);
     last--;
     if (last < 4) return 1;
-    gp_Pnt P(atof(a[last-2]),atof(a[last-1]),atof(a[last]));
+    gp_Pnt P(Draw::Atof(a[last-2]),Draw::Atof(a[last-1]),Draw::Atof(a[last]));
     T.SetScale(P,s);
   }
   else if (!strcmp(a[0]+1,"mirror")) {
     if (last < 4) return 1;
-    gp_Pnt P(atof(a[last-2]),atof(a[last-1]),atof(a[last]));
+    gp_Pnt P(Draw::Atof(a[last-2]),Draw::Atof(a[last-1]),Draw::Atof(a[last]));
     if (*a[0] == 'p') {
       T.SetMirror(P);
     }
     else {
       last -= 3;
       if (last < 4) return 1;
-      gp_Pnt O(atof(a[last-2]),atof(a[last-1]),atof(a[last]));
+      gp_Pnt O(Draw::Atof(a[last-2]),Draw::Atof(a[last-1]),Draw::Atof(a[last]));
       last -= 3;
       gp_Dir D(P.X(),P.Y(),P.Z());
       if (*a[0] == 'l') {
@@ -500,18 +500,18 @@ static Standard_Integer transform (Draw_Interpretor& di, Standard_Integer n, con
 
   else if (!strcmp(a[0],"translate")) {
     if (last < 4) return 1;
-    gp_Vec V(atof(a[last-2]),atof(a[last-1]),atof(a[last]));
+    gp_Vec V(Draw::Atof(a[last-2]),Draw::Atof(a[last-1]),Draw::Atof(a[last]));
     last -= 3;
     T.SetTranslation(V);
   }
 
   else if (!strcmp(a[0],"rotate")) {
     if (last < 8) return 1;
-    Standard_Real ang = atof(a[last]) * (M_PI / 180.0);
+    Standard_Real ang = Draw::Atof(a[last]) * (M_PI / 180.0);
     last --;
-    gp_Dir D(atof(a[last-2]),atof(a[last-1]),atof(a[last]));
+    gp_Dir D(Draw::Atof(a[last-2]),Draw::Atof(a[last-1]),Draw::Atof(a[last]));
     last -= 3;
-    gp_Pnt P(atof(a[last-2]),atof(a[last-1]),atof(a[last]));
+    gp_Pnt P(Draw::Atof(a[last-2]),Draw::Atof(a[last-1]),Draw::Atof(a[last]));
     last -= 3;
     T.SetRotation(gp_Ax1(P,D),ang);
   }
@@ -545,23 +545,23 @@ static Standard_Integer d2transform (Draw_Interpretor& di, Standard_Integer n, c
   gp_Trsf2d T;
   Standard_Integer i,last = n-1;
   if (!strcmp(a[0],"2dpscale")) {
-    Standard_Real s = atof(a[last]);
+    Standard_Real s = Draw::Atof(a[last]);
     last--;
     if (last < 3) return 1;
-    gp_Pnt2d P(atof(a[last-1]),atof(a[last]));
+    gp_Pnt2d P(Draw::Atof(a[last-1]),Draw::Atof(a[last]));
     T.SetScale(P,s);
   }
   else if ( (!strcmp(a[0],"2dpmirror")) || 
            (!strcmp(a[0],"2dlmirror"))   ) {
     if (last < 3) return 1;
-    gp_Pnt2d P(atof(a[last-1]),atof(a[last]));
+    gp_Pnt2d P(Draw::Atof(a[last-1]),Draw::Atof(a[last]));
     if (!strcmp(a[0],"2dpmirror")) {
       T.SetMirror(P);
     }
     else {
       last -= 2;
       if (last < 3) return 1;
-      gp_Pnt2d O(atof(a[last-1]),atof(a[last]));
+      gp_Pnt2d O(Draw::Atof(a[last-1]),Draw::Atof(a[last]));
       last -= 2;
       gp_Dir2d D(P.X(),P.Y());
       T.SetMirror(gp_Ax2d(O,D));
@@ -570,16 +570,16 @@ static Standard_Integer d2transform (Draw_Interpretor& di, Standard_Integer n, c
 
   else if (!strcmp(a[0],"2dtranslate")) {
     if (last < 3) return 1;
-    gp_Vec2d V(atof(a[last-1]),atof(a[last]));
+    gp_Vec2d V(Draw::Atof(a[last-1]),Draw::Atof(a[last]));
     last -= 2;
     T.SetTranslation(V);
   }
 
   else if (!strcmp(a[0],"2drotate")) {
     if (last < 4) return 1;
-    Standard_Real ang = atof(a[last]) * (M_PI / 180.0);
+    Standard_Real ang = Draw::Atof(a[last]) * (M_PI / 180.0);
     last --;
-    gp_Pnt2d P(atof(a[last-1]),atof(a[last]));
+    gp_Pnt2d P(Draw::Atof(a[last-1]),Draw::Atof(a[last]));
     last -= 2;
     T.SetRotation(P,ang);
   }
index 4aff962989178004b7e23494ae209e753556d3c7..983ba796c7af791c390bac656cec9cae3ab6a6c2 100755 (executable)
@@ -175,7 +175,7 @@ void DrawTrSurf_Triangulation::DrawOn(Draw_Display& dis) const
     dis.SetColor(Draw_jaune);
     n = myTriangulation->NbNodes();
     for (i = 1; i <= n; i++) {
-      sprintf(text,"%d",i);
+      Sprintf(text,"%d",i);
       dis.DrawString(Nodes(i),text);
     }
   }
@@ -193,7 +193,7 @@ void DrawTrSurf_Triangulation::DrawOn(Draw_Display& dis) const
        bary.Add(Nodes(t[j]).Coord());
       bary.Multiply(1./3.);
 
-      sprintf(text,"%d",i);
+      Sprintf(text,"%d",i);
       dis.DrawString(P,text);
     }
   }
index c8f3f048492aa945ffd05a6c77e1c32a2f0a013d..1f1ec0461c300e2b31f8f6d3fa8c09a624bcab14 100755 (executable)
@@ -164,7 +164,7 @@ void Dynamic_FuzzyDefinitionsDictionary::Creates(const Standard_CString afilenam
            fuzzydefinition->Parameter(new Dynamic_IntegerParameter(name,atoi(value)));
 
          else if(!strcasecmp(type,"Standard_Real"))
-           fuzzydefinition->Parameter(new Dynamic_RealParameter(name,atof(value)));
+           fuzzydefinition->Parameter(new Dynamic_RealParameter(name,Atof(value)));
 
          else if(!strcasecmp(type,"Standard_CString"))
            fuzzydefinition->Parameter(new Dynamic_StringParameter(name,value));
index 08dcd62ad87dc004594499ae801a944ea2150057..5676bef4dd3eaf07c25f92e3525efd6d3132a22e 100755 (executable)
@@ -175,7 +175,7 @@ void Dynamic_MethodDefinitionsDictionary::Creates(const Standard_CString afilena
            methoddefinition->AddVariable(new Dynamic_IntegerParameter(name,atoi(value)),Dynamic::Mode(mode),group);
 
          else if(!strcasecmp(type,"Standard_Real"))
-           methoddefinition->AddVariable(new Dynamic_RealParameter(name,atof(value)),Dynamic::Mode(mode),group);
+           methoddefinition->AddVariable(new Dynamic_RealParameter(name,Atof(value)),Dynamic::Mode(mode),group);
 
          else if(!strcasecmp(type,"Standard_CString"))
            methoddefinition->AddVariable(new Dynamic_StringParameter(name,value),Dynamic::Mode(mode),group);
index 70666b7cb81a953bec2da82762d0289cdcd42616..b51be99b61f4aa3f37ccec95bf55ed58c4e1766c 100755 (executable)
@@ -116,6 +116,6 @@ Standard_Real Expr_NumericValue::Evaluate(const Expr_Array1OfNamedUnknown&, cons
 TCollection_AsciiString Expr_NumericValue::String() const
 {
   char val[100];
-  sprintf(val,"%g",myValue);
+  Sprintf(val,"%g",myValue);
   return TCollection_AsciiString(val);
 }
index 1ceb7f8f182cc3c0c888e4d2bfc277453cfb4290..1c895a67fef305ede763f6ef93ca2e49cd9f7bae 100755 (executable)
@@ -481,7 +481,7 @@ extern "C" void ExprIntrp_NumValue()
   char num[30];
   int nbcar;
   nbcar = ExprIntrp_GetResult(num);
-  Standard_Real value = atof(num);
+  Standard_Real value = Atof(num);
   Handle(Expr_NumericValue) nval = new Expr_NumericValue(value);
   ExprIntrp_Recept.Push(nval);
 }
@@ -621,7 +621,7 @@ extern "C" void ExprIntrp_ConstantDefinition()
   char num[30];
   int nbcar;
   nbcar = ExprIntrp_GetResult(num);
-  Standard_Real val = atof(num);
+  Standard_Real val = Atof(num);
   Handle(Expr_NamedConstant) theconst = new Expr_NamedConstant(name,val);
   ExprIntrp_Recept.Use(theconst);
   ExprIntrp_Recept.Push(theconst);
index 417d10d247a72ef4706849ff10c1e57afff922b5..6288f80459adf78bc511b60d0db599fd1095e53b 100755 (executable)
@@ -30,8 +30,7 @@ uses Position    from Storage,
      SequenceOfAsciiString from TColStd,
      SequenceOfExtendedString from TColStd,
      ExtendedString from TCollection,
-     FStream     from FSD,
-     Real2String  from  OSD
+     FStream     from FSD
      
 raises StreamTypeMismatchError from Storage,
        StreamFormatError from Storage,
@@ -331,6 +330,5 @@ is
         
 fields
     
-       myStream    : FStream from FSD;
-       myRealConv  : Real2String  from  OSD;
+    myStream    : FStream from FSD;
 end;
index e753323544572195073269808f9d7c5544784091..7dea71241d281e6a6e2578a901b66378ce15414a 100755 (executable)
@@ -19,8 +19,6 @@
 #include <FSD_CmpFile.ixx>
 #include <OSD.hxx>
 
-#include <OSD_Real2String.hxx>
-
 #include <Storage_StreamModeError.hxx>
 #include <Storage_StreamUnknownTypeError.hxx>
 #include <Standard_PCharacter.hxx>
@@ -122,6 +120,7 @@ Storage_Error FSD_CmpFile::Open(const TCollection_AsciiString& aName,const Stora
     }
     else {
       myStream.precision(17);
+      myStream.imbue (std::locale::classic()); // use always C locale
       SetOpenMode(aMode);
     }
   }
@@ -529,29 +528,9 @@ Storage_BaseDriver& FSD_CmpFile::PutBoolean(const Standard_Boolean aValue)
 
 Storage_BaseDriver& FSD_CmpFile::PutReal(const Standard_Real aValue)
 {
-#ifdef BUC60808
-  char realbuffer[100];
-  Standard_PCharacter pChar;
-  //
-  pChar=realbuffer;
-  realbuffer[0] = '\0';
-  //
-  if (myRealConv.RealToCString(aValue,pChar)) {
-    myStream << realbuffer << " ";
-  }
-  else {
-    Storage_StreamWriteError::Raise();
-  }
-  if (myStream.bad()) Storage_StreamWriteError::Raise();
-
-  return *this;
-
-#else
   myStream << ((Standard_Real)aValue) << " ";
-
   if (myStream.bad()) Storage_StreamWriteError::Raise();
   return *this;
-#endif
 }
 
 //=======================================================================
@@ -561,28 +540,9 @@ Storage_BaseDriver& FSD_CmpFile::PutReal(const Standard_Real aValue)
 
 Storage_BaseDriver& FSD_CmpFile::PutShortReal(const Standard_ShortReal aValue)
 {
-#ifdef BUC60808
-  char realbuffer[100];
-  Standard_PCharacter pStr;
-  //
-  pStr=realbuffer;
-  realbuffer[0] = '\0';
-  //
-  if (myRealConv.RealToCString(aValue,pStr)) {
-    myStream << realbuffer << " ";
-  }
-  else {
-    Storage_StreamWriteError::Raise();
-  }
-  if (myStream.bad()) Storage_StreamWriteError::Raise();
-
-  return *this;
-#else
   myStream << aValue << " ";
-
   if (myStream.bad()) Storage_StreamWriteError::Raise();
   return *this;
-#endif
 }
 
 //=======================================================================
@@ -669,10 +629,9 @@ Storage_BaseDriver& FSD_CmpFile::GetReal(Standard_Real& aValue)
     cerr << "\t buffer is" << realbuffer<< endl;
     Storage_StreamTypeMismatchError::Raise();
   }
-  if (!myRealConv.CStringToReal(realbuffer,aValue)) {
+  if (!OSD::CStringToReal(realbuffer,aValue)) {
     cerr << "%%%ERROR: read error of double at offset " << myStream.tellg() << endl;
     cerr << "\t buffer is" << realbuffer<< endl;
-    //if (!OSD::CStringToReal(realbuffer,aValue))
     Storage_StreamTypeMismatchError::Raise();
   }
 
@@ -697,8 +656,8 @@ Storage_BaseDriver& FSD_CmpFile::GetShortReal(Standard_ShortReal& aValue)
 
   realbuffer[0] = '\0';
   if (!(myStream >> realbuffer)) Storage_StreamTypeMismatchError::Raise();
-  // if (!OSD::CStringToReal(realbuffer,r)) 
-  if (!myRealConv.CStringToReal(realbuffer,r))  Storage_StreamTypeMismatchError::Raise();
+  if (!OSD::CStringToReal(realbuffer,r))
+    Storage_StreamTypeMismatchError::Raise();
 
   aValue = (Standard_ShortReal)r;
 
index fe71914e2129b083c90811ed9d74c2e194956bbd..d755d6f509bb0406d2112f3001946da0f35be716 100755 (executable)
@@ -91,6 +91,7 @@ Storage_Error FSD_File::Open(const TCollection_AsciiString& aName,const Storage_
     }
     else {
       myStream.precision(17);
+      myStream.imbue (std::locale::classic()); // use always C locale
       SetOpenMode(aMode);
     }
   }
@@ -461,25 +462,9 @@ Storage_BaseDriver& FSD_File::PutBoolean(const Standard_Boolean aValue)
 
 Storage_BaseDriver& FSD_File::PutReal(const Standard_Real aValue)
 {
-#ifdef USEOSDREAL
-  char realbuffer[100];
-
-  realbuffer[0] = '\0';
-  if (OSD::RealToCString(aValue,realbuffer)) {
-    myStream << realbuffer << " ";
-  }
-  else {
-    Storage_StreamWriteError::Raise();
-  }
-  if (myStream.bad()) Storage_StreamWriteError::Raise();
-
-  return *this;
-#else
   myStream << ((Standard_Real)aValue) << " ";
-
   if (myStream.bad()) Storage_StreamWriteError::Raise();
   return *this;
-#endif
 }
 
 //=======================================================================
@@ -489,25 +474,9 @@ Storage_BaseDriver& FSD_File::PutReal(const Standard_Real aValue)
 
 Storage_BaseDriver& FSD_File::PutShortReal(const Standard_ShortReal aValue)
 {
-#ifdef USEOSDREAL
-  char realbuffer[100];
-
-  realbuffer[0] = '\0';
-  if (OSD::RealToCString(aValue,realbuffer)) {
-    myStream << realbuffer << " ";
-  }
-  else {
-    Storage_StreamWriteError::Raise();
-  }
-  if (myStream.bad()) Storage_StreamWriteError::Raise();
-
-  return *this;
-#else
   myStream << aValue << " ";
-
   if (myStream.bad()) Storage_StreamWriteError::Raise();
   return *this;
-#endif
 }
 
 //=======================================================================
index ce1fc3810e029071e0a944b23b79b3bc932707b2..dd73747d29d2b598c75f6711af5c7a3cccdf0cba 100755 (executable)
@@ -91,9 +91,9 @@ Handle(Geom2d_Curve) GeomProjLib::Curve2d(const Handle(Geom_Curve)& C,
 //POP pour NT
 //    char name[100];
     char* name = new char[100];
-    sprintf(name,"PROJCURV_%d",NBPROJ);
+    Sprintf(name,"PROJCURV_%d",NBPROJ);
     DrawTrSurf::Set(name,C);
-    sprintf(name,"PROJSURF_%d",NBPROJ);
+    Sprintf(name,"PROJSURF_%d",NBPROJ);
     DrawTrSurf::Set(name,S);
     NBPROJ++;
   }
index d36ccef3ad369292960941536b81411b9c55ee73..0311b23d9ada1950d8e97933c474ea893a12a0ec 100755 (executable)
@@ -55,7 +55,7 @@ static Standard_Integer proj (Draw_Interpretor& di, Standard_Integer n, const ch
 {
   if ( n < 4) return 1;
 
-  gp_Pnt2d P(atof(a[2]),atof(a[3]));
+  gp_Pnt2d P(Draw::Atof(a[2]),Draw::Atof(a[3]));
 
   char name[100];
 
@@ -72,7 +72,7 @@ static Standard_Integer proj (Draw_Interpretor& di, Standard_Integer n, const ch
     Handle(Geom2d_Line) L = new Geom2d_Line(P,gp_Vec2d(P,P1));
     Handle(Geom2d_TrimmedCurve) CT = 
       new Geom2d_TrimmedCurve(L, 0., P.Distance(P1));
-    sprintf(name,"%s%d","ext_",i);
+    Sprintf(name,"%s%d","ext_",i);
     char* temp = name; // portage WNT
     DrawTrSurf::Set(temp, CT);
     di << name << " ";
@@ -108,14 +108,14 @@ static Standard_Integer appro(Draw_Interpretor& di, Standard_Integer n, const ch
 
   if (n < 3) {
     if (n == 2) 
-      Tol2d = atof(a[1]);
+      Tol2d = Draw::Atof(a[1]);
     
     di << "Tolerance for 2d approx : "<< Tol2d << "\n";
     return 0;
   }
 
 
-  Standard_Integer i, Nb = atoi(a[2]);
+  Standard_Integer i, Nb = Draw::Atoi(a[2]);
   
   Standard_Boolean hasPoints = Standard_True;
   TColgp_Array1OfPnt2d Points(1, Nb);
@@ -170,17 +170,17 @@ static Standard_Integer appro(Draw_Interpretor& di, Standard_Integer n, const ch
        // points
        nc = 3;
        for (i = 1; i <= Nb; i++) {
-         Points(i).SetCoord(atof(a[nc]),atof(a[nc+1]));
+         Points(i).SetCoord(Draw::Atof(a[nc]),Draw::Atof(a[nc+1]));
          nc += 2;
        }
       }
       else if (nc - 2 == Nb) {
        // YValues
        nc = 5;
-       X0 = atof(a[3]);
-       DX = atof(a[4]);
+       X0 = Draw::Atof(a[3]);
+       DX = Draw::Atof(a[4]);
        for (i = 1; i <= Nb; i++) {
-         YValues(i) = atof(a[nc]);
+         YValues(i) = Draw::Atof(a[nc]);
          Points(i).SetCoord(X0+(i-1)*DX,YValues(i));
          nc++;
        }
@@ -245,7 +245,7 @@ static Standard_Integer extrema(Draw_Interpretor& di, Standard_Integer n, const
     Handle(Geom2d_Line) L = new Geom2d_Line(P1,gp_Vec2d(P1,P2));
     Handle(Geom2d_TrimmedCurve) CT = 
       new Geom2d_TrimmedCurve(L, 0., P1.Distance(P2));
-    sprintf(name,"%s%d","ext_",i);
+    Sprintf(name,"%s%d","ext_",i);
     char* temp = name; // portage WNT
     DrawTrSurf::Set(temp, CT);
     di << name << " ";
index 53ded2477e166d1f6745d5b4e3fb60c12879b8de..d5fe1ecdfd061e02be4ba10aeae3cff5bf935aac 100755 (executable)
@@ -62,7 +62,7 @@ static Standard_Integer proj (Draw_Interpretor& di, Standard_Integer n, const ch
     return 1;
   }
 
-  gp_Pnt P(atof(a[2]),atof(a[3]),atof(a[4]));
+  gp_Pnt P(Draw::Atof(a[2]),Draw::Atof(a[3]),Draw::Atof(a[4]));
 
   char name[100];
 
@@ -87,13 +87,13 @@ static Standard_Integer proj (Draw_Interpretor& di, Standard_Integer n, const ch
        Handle(Geom_Line) L = new Geom_Line(P,gp_Vec(P,P1));
        Handle(Geom_TrimmedCurve) CT = 
          new Geom_TrimmedCurve(L, 0., P.Distance(P1));
-       sprintf(name,"%s%d","ext_",i);
+       Sprintf(name,"%s%d","ext_",i);
        char* temp = name; // portage WNT
        DrawTrSurf::Set(temp, CT);
        di << name << " ";
       }
       else {
-       sprintf(name,"%s%d","ext_",i);
+       Sprintf(name,"%s%d","ext_",i);
        di << name << " ";
        char* temp = name; // portage WNT
        DrawTrSurf::Set(temp, P1);
@@ -117,13 +117,13 @@ static Standard_Integer proj (Draw_Interpretor& di, Standard_Integer n, const ch
        Handle(Geom_Line) L = new Geom_Line(P,gp_Vec(P,P1));
        Handle(Geom_TrimmedCurve) CT = 
          new Geom_TrimmedCurve(L, 0., P.Distance(P1));
-       sprintf(name,"%s%d","ext_",i);
+       Sprintf(name,"%s%d","ext_",i);
        char* temp = name; // portage WNT
        DrawTrSurf::Set(temp, CT);
        di << name << " ";
       }
       else {
-       sprintf(name,"%s%d","ext_",i);
+       Sprintf(name,"%s%d","ext_",i);
        char* temp = name; // portage WNT
        DrawTrSurf::Set(temp, P1);
        di << name << " ";
@@ -146,7 +146,7 @@ static Standard_Integer appro(Draw_Interpretor& di, Standard_Integer n, const ch
   if ( n<3) return 1;
 
   Handle(Geom_Curve) GC;
-  Standard_Integer Nb = atoi(a[2]);
+  Standard_Integer Nb = Draw::Atoi(a[2]);
 
   TColgp_Array1OfPnt Points(1, Nb);
 
@@ -218,20 +218,20 @@ static Standard_Integer grilapp(Draw_Interpretor& di, Standard_Integer n, const
   if ( n < 12) return 1;
 
   Standard_Integer i,j;
-  Standard_Integer Nu = atoi(a[2]);
-  Standard_Integer Nv = atoi(a[3]);
+  Standard_Integer Nu = Draw::Atoi(a[2]);
+  Standard_Integer Nv = Draw::Atoi(a[3]);
   TColStd_Array2OfReal ZPoints (1, Nu, 1, Nv);
 
-  Standard_Real X0 = atof(a[4]);
-  Standard_Real dX = atof(a[5]);
-  Standard_Real Y0 = atof(a[6]);
-  Standard_Real dY = atof(a[7]);
+  Standard_Real X0 = Draw::Atof(a[4]);
+  Standard_Real dX = Draw::Atof(a[5]);
+  Standard_Real Y0 = Draw::Atof(a[6]);
+  Standard_Real dY = Draw::Atof(a[7]);
 
   Standard_Integer Count = 8;
   for ( j = 1; j <= Nv; j++) {
     for ( i = 1; i <= Nu; i++) {
       if ( Count > n) return 1;
-      ZPoints(i,j) = atof(a[Count]);
+      ZPoints(i,j) = Draw::Atof(a[Count]);
       Count++;
     }
   }
@@ -255,8 +255,8 @@ static Standard_Integer surfapp(Draw_Interpretor& di, Standard_Integer n, const
   if ( n < 5 ) return 1;
 
   Standard_Integer i,j;
-  Standard_Integer Nu = atoi(a[2]);
-  Standard_Integer Nv = atoi(a[3]);
+  Standard_Integer Nu = Draw::Atoi(a[2]);
+  Standard_Integer Nv = Draw::Atoi(a[3]);
   TColgp_Array2OfPnt Points (1, Nu, 1, Nv);
 
   if ( n == 5) {
@@ -278,7 +278,7 @@ static Standard_Integer surfapp(Draw_Interpretor& di, Standard_Integer n, const
     for ( j = 1; j <= Nv; j++) {
       for ( i = 1; i <= Nu; i++) {
        if ( Count > n) return 1;
-       Points(i,j) = gp_Pnt(atof(a[Count]),atof(a[Count+1]),atof(a[Count+2]));
+       Points(i,j) = gp_Pnt(Draw::Atof(a[Count]),Draw::Atof(a[Count+1]),Draw::Atof(a[Count+2]));
        Count += 3;
       }
     }
@@ -287,7 +287,7 @@ static Standard_Integer surfapp(Draw_Interpretor& di, Standard_Integer n, const
   Standard_Integer Count = 1;
   for ( j = 1; j <= Nv; j++) {
     for ( i = 1; i <= Nu; i++) {
-      sprintf(name,"point_%d",Count++);
+      Sprintf(name,"point_%d",Count++);
       char* temp = name; // portage WNT
       DrawTrSurf::Set(temp,Points(i,j));
     }
@@ -362,7 +362,7 @@ static Standard_Integer extrema(Draw_Interpretor& di, Standard_Integer n, const
        Handle(Geom_Line) L = new Geom_Line(P1,gp_Vec(P1,P2));
        Handle(Geom_TrimmedCurve) CT = 
          new Geom_TrimmedCurve(L, 0., P1.Distance(P2));
-       sprintf(name,"%s%d","ext_",i);
+       Sprintf(name,"%s%d","ext_",i);
        char* temp = name; // portage WNT
        DrawTrSurf::Set(temp, CT);
        di << name << " ";
@@ -381,7 +381,7 @@ static Standard_Integer extrema(Draw_Interpretor& di, Standard_Integer n, const
       Handle(Geom_Line) L = new Geom_Line(P1,gp_Vec(P1,P2));
       Handle(Geom_TrimmedCurve) CT = 
        new Geom_TrimmedCurve(L, 0., P1.Distance(P2));
-      sprintf(name,"%s%d","ext_",i);
+      Sprintf(name,"%s%d","ext_",i);
       char* temp = name; // portage WNT
       DrawTrSurf::Set(temp, CT);
       di << name << " ";
@@ -396,7 +396,7 @@ static Standard_Integer extrema(Draw_Interpretor& di, Standard_Integer n, const
       Handle(Geom_Line) L = new Geom_Line(P1,gp_Vec(P1,P2));
       Handle(Geom_TrimmedCurve) CT = 
        new Geom_TrimmedCurve(L, 0., P1.Distance(P2));
-      sprintf(name,"%s%d","ext_",i);
+      Sprintf(name,"%s%d","ext_",i);
       char* temp = name; // portage WNT
       DrawTrSurf::Set(temp, CT);
       di << name << " ";
@@ -411,7 +411,7 @@ static Standard_Integer extrema(Draw_Interpretor& di, Standard_Integer n, const
       Handle(Geom_Line) L = new Geom_Line(P1,gp_Vec(P1,P2));
       Handle(Geom_TrimmedCurve) CT = 
        new Geom_TrimmedCurve(L, 0., P1.Distance(P2));
-      sprintf(name,"%s%d","ext_",i);
+      Sprintf(name,"%s%d","ext_",i);
       char* temp = name; // portage WNT
       DrawTrSurf::Set(temp, CT);
       di << name << " ";
@@ -466,7 +466,7 @@ static Standard_Integer totalextcc(Draw_Interpretor& di, Standard_Integer n, con
       Handle(Geom_Line) L = new Geom_Line(P1,gp_Vec(P1,P2));
       Handle(Geom_TrimmedCurve) CT = 
        new Geom_TrimmedCurve(L, 0., P1.Distance(P2));
-      sprintf(name,"%s%d","ext_",1);
+      Sprintf(name,"%s%d","ext_",1);
       char* temp = name; // portage WNT
       DrawTrSurf::Set(temp, CT);
       di << name << " ";
index b90f3a791b6277be87ceb58659cbd73c34a51b69..8cb6e1bfe2ff1447862670220af3f525f042737f 100755 (executable)
@@ -89,7 +89,7 @@ static Standard_Integer solutions(Draw_Interpretor& di,
   if (ct3.IsDone()) {
     for (Standard_Integer i = 1 ; i <= ct3.NbSolutions() ; i++) {
       Handle(Geom2d_Circle) C = new Geom2d_Circle(ct3.ThisSolution(i));
-      sprintf(solname,"%s_%d",name,i);
+      Sprintf(solname,"%s_%d",name,i);
       char* temp = solname; // pour portage WNT
       DrawTrSurf::Set(temp,C);
       di << solname << " ";
@@ -113,7 +113,7 @@ static Standard_Integer solutions(Draw_Interpretor& di,
   if (ct3.IsDone()) {
     for (Standard_Integer i = 1 ; i <= ct3.NbSolutions() ; i++) {
       Handle(Geom2d_Circle) C = new Geom2d_Circle(ct3.ThisSolution(i));
-      sprintf(solname,"%s_%d",name,i);
+      Sprintf(solname,"%s_%d",name,i);
       char* temp = solname; // pour portage WNT
       DrawTrSurf::Set(temp,C);
       di << solname << " ";
@@ -144,7 +144,7 @@ static Standard_Integer cirtang (Draw_Interpretor& di,Standard_Integer n, const
   Standard_Boolean ip3 = DrawTrSurf::GetPoint2d(a[4],P3);
   
   Standard_Real tol = Precision::Confusion();
-  if (n > 5) tol = atof(a[5]);
+  if (n > 5) tol = Draw::Atof(a[5]);
 
 
   if (!C1.IsNull()) {
@@ -173,7 +173,7 @@ static Standard_Integer cirtang (Draw_Interpretor& di,Standard_Integer n, const
        // C-C-R
        Geom2dGcc_Circ2d2TanRad ct3(Geom2dGcc::Unqualified(C1),
                                    Geom2dGcc::Unqualified(C2),
-                                   atof(a[4]),tol);
+                                   Draw::Atof(a[4]),tol);
        return solutions(di,ct3,a[1]);
       }
     }
@@ -201,7 +201,7 @@ static Standard_Integer cirtang (Draw_Interpretor& di,Standard_Integer n, const
        // C-P-R
        Geom2dGcc_Circ2d2TanRad ct3(Geom2dGcc::Unqualified(C1),
                                    new Geom2d_CartesianPoint(P2),
-                                   atof(a[4]),tol);
+                                   Draw::Atof(a[4]),tol);
        return solutions(di,ct3,a[1]);
       }
     }
@@ -212,7 +212,7 @@ static Standard_Integer cirtang (Draw_Interpretor& di,Standard_Integer n, const
        // C-R-C
        Geom2dGcc_Circ2d2TanRad ct3(Geom2dGcc::Unqualified(C1),
                                    Geom2dGcc::Unqualified(C3),
-                                   atof(a[3]),
+                                   Draw::Atof(a[3]),
                                    tol);
        return solutions(di,ct3,a[1]);
       }
@@ -221,7 +221,7 @@ static Standard_Integer cirtang (Draw_Interpretor& di,Standard_Integer n, const
        // C-R-P
        Geom2dGcc_Circ2d2TanRad ct3(Geom2dGcc::Unqualified(C1),
                                    new Geom2d_CartesianPoint(P3),
-                                   atof(a[3]),
+                                   Draw::Atof(a[3]),
                                    tol);
        return solutions(di,ct3,a[1]);
       }
@@ -260,7 +260,7 @@ static Standard_Integer cirtang (Draw_Interpretor& di,Standard_Integer n, const
        // P-C-R
        Geom2dGcc_Circ2d2TanRad ct3(Geom2dGcc::Unqualified(C2),
                                    new Geom2d_CartesianPoint(P1),
-                                   atof(a[4]),tol);
+                                   Draw::Atof(a[4]),tol);
        return solutions(di,ct3,a[1]);
       }
     }
@@ -288,7 +288,7 @@ static Standard_Integer cirtang (Draw_Interpretor& di,Standard_Integer n, const
        // P-P-R
        Geom2dGcc_Circ2d2TanRad ct3(new Geom2d_CartesianPoint(P1),
                                    new Geom2d_CartesianPoint(P2),
-                                   atof(a[4]),tol);
+                                   Draw::Atof(a[4]),tol);
        return solutions(di,ct3,a[1]);
       }
     }
@@ -299,7 +299,7 @@ static Standard_Integer cirtang (Draw_Interpretor& di,Standard_Integer n, const
        // P-R-C
        Geom2dGcc_Circ2d2TanRad ct3(Geom2dGcc::Unqualified(C3),
                                    new Geom2d_CartesianPoint(P1),
-                                   atof(a[3]),
+                                   Draw::Atof(a[3]),
                                    tol);
        return solutions(di,ct3,a[1]);
       }
@@ -308,7 +308,7 @@ static Standard_Integer cirtang (Draw_Interpretor& di,Standard_Integer n, const
        // P-R-P
        Geom2dGcc_Circ2d2TanRad ct3(new Geom2d_CartesianPoint(P1),
                                    new Geom2d_CartesianPoint(P3),
-                                   atof(a[3]),
+                                   Draw::Atof(a[3]),
                                    tol);
        return solutions(di,ct3,a[1]);
       }
@@ -329,7 +329,7 @@ static Standard_Integer cirtang (Draw_Interpretor& di,Standard_Integer n, const
        // R-C-C
        Geom2dGcc_Circ2d2TanRad ct3(Geom2dGcc::Unqualified(C2),
                                    Geom2dGcc::Unqualified(C3),
-                                   atof(a[2]),
+                                   Draw::Atof(a[2]),
                                    tol);
        return solutions(di,ct3,a[1]);
       }
@@ -338,7 +338,7 @@ static Standard_Integer cirtang (Draw_Interpretor& di,Standard_Integer n, const
        // R-C-P
        Geom2dGcc_Circ2d2TanRad ct3(Geom2dGcc::Unqualified(C2),
                                    new Geom2d_CartesianPoint(P3),
-                                   atof(a[2]),
+                                   Draw::Atof(a[2]),
                                    tol);
        return solutions(di,ct3,a[1]);
       }
@@ -355,7 +355,7 @@ static Standard_Integer cirtang (Draw_Interpretor& di,Standard_Integer n, const
        // R-P-C
        Geom2dGcc_Circ2d2TanRad ct3(Geom2dGcc::Unqualified(C3),
                                    new Geom2d_CartesianPoint(P2),
-                                   atof(a[2]),
+                                   Draw::Atof(a[2]),
                                    tol);
        return solutions(di,ct3,a[1]);
       }
@@ -364,7 +364,7 @@ static Standard_Integer cirtang (Draw_Interpretor& di,Standard_Integer n, const
        // R-P-P
        Geom2dGcc_Circ2d2TanRad ct3(new Geom2d_CartesianPoint(P2),
                                    new Geom2d_CartesianPoint(P3),
-                                   atof(a[2]),
+                                   Draw::Atof(a[2]),
                                    tol);
        return solutions(di,ct3,a[1]);
       }
@@ -411,7 +411,7 @@ static Standard_Integer lintang (Draw_Interpretor& di,Standard_Integer n, const
       di << "Second argument must be a line";
       return 1;
     }
-    Standard_Real ang = atof(a[4]) * (M_PI / 180.0);
+    Standard_Real ang = Draw::Atof(a[4]) * (M_PI / 180.0);
     Geom2dGcc_Lin2dTanObl ct3(Geom2dGcc::Unqualified(C1),
                              L->Lin2d(),
                              Precision::Angular(),
@@ -420,7 +420,7 @@ static Standard_Integer lintang (Draw_Interpretor& di,Standard_Integer n, const
     if (ct3.IsDone()) {
       for (Standard_Integer i = 1 ; i <= ct3.NbSolutions() ; i++) {
        Handle(Geom2d_Line) LS = new Geom2d_Line(ct3.ThisSolution(i));
-       sprintf(solname,"%s_%d",a[1],i);
+       Sprintf(solname,"%s_%d",a[1],i);
        char* temp = solname; // pour portage WNT
        DrawTrSurf::Set(temp,LS);
        di << solname << " ";
@@ -438,7 +438,7 @@ static Standard_Integer lintang (Draw_Interpretor& di,Standard_Integer n, const
     if (ct3.IsDone()) {
       for (Standard_Integer i = 1 ; i <= ct3.NbSolutions() ; i++) {
        Handle(Geom2d_Line) LS = new Geom2d_Line(ct3.ThisSolution(i));
-       sprintf(solname,"%s_%d",a[1],i);
+       Sprintf(solname,"%s_%d",a[1],i);
        char* temp = solname; // pour portage WNT
        DrawTrSurf::Set(temp,LS);
        di << solname << " ";
@@ -684,7 +684,7 @@ static Standard_Integer tanginterpol (Draw_Interpretor& di,
     periodic_flag = Standard_True ;
     num_read += 1 ;
   }
-  num_parameters = atoi(a[num_read]) ;
+  num_parameters = Draw::Atoi(a[num_read]) ;
 
   if (num_parameters < 2) {
     num_parameters = 2 ;
@@ -703,7 +703,7 @@ static Standard_Integer tanginterpol (Draw_Interpretor& di,
   num_read += 1 ;
   while (num_read <= num_parameters * 3 + num_start ) {
     for (jj = 1 ; jj <= 3 ; jj++) {
-      a_point.SetCoord(jj,atof(a[num_read])) ;
+      a_point.SetCoord(jj,Draw::Atof(a[num_read])) ;
       num_read += 1 ;
     }
     PointsArrayPtr->SetValue(ii,a_point) ;
@@ -728,7 +728,7 @@ static Standard_Integer tanginterpol (Draw_Interpretor& di,
     ii = 1 ;
     while (ii <= num_tangents) {
       for (jj = 1 ; jj <= 3 ; jj++) {
-       a_vector.SetCoord(jj,atof(a[num_read])) ;
+       a_vector.SetCoord(jj,Draw::Atof(a[num_read])) ;
        num_read += 1 ;
       }
       TangentsArray.SetValue(ii,a_vector) ;
index edd8d35f3ead3aff160eb1c9f384397c1c42bdff..9de8a3f10ddd7c5bfab0ac079df74b67ffe953c0 100755 (executable)
@@ -82,12 +82,12 @@ static Standard_Integer surfaceCcontinuity (Draw_Interpretor& di, Standard_Integ
   Handle(Geom_Surface) surf2 = DrawTrSurf::GetSurface(a[5]);
   if (surf2.IsNull()) return 1;
    
-      U1 = atof(a[3]);
-      U2 = atof(a[6]);
-      V1 = atof(a[4]); 
-      V2 = atof(a[7]); 
+      U1 = Draw::Atof(a[3]);
+      U2 = Draw::Atof(a[6]);
+      V1 = Draw::Atof(a[4]); 
+      V2 = Draw::Atof(a[7]); 
 
-      ord = atoi(a[1]);
+      ord = Draw::Atoi(a[1]);
 
       surf1->Bounds(u1, u2, v1, v2);
       b1 = ((((U1>=u1)&&(U1<=u2))||((U1<=u1)&&(U1>=u2))));
@@ -103,8 +103,8 @@ static Standard_Integer surfaceCcontinuity (Draw_Interpretor& di, Standard_Integ
        switch ( ord )
        { case 0 : { TypeCont=GeomAbs_C0;
                     switch(n)
-                       { case 10  : epsC0= atof(a[9]);
-                         case 9   : epsnl = atof(a[8]);
+                       { case 10  : epsC0= Draw::Atof(a[9]);
+                         case 9   : epsnl = Draw::Atof(a[8]);
                          case 8 : {} break;
                          default : return 1;
                        } 
@@ -118,9 +118,9 @@ static Standard_Integer surfaceCcontinuity (Draw_Interpretor& di, Standard_Integ
                  break;
         case 1 : { TypeCont=GeomAbs_C1;
                      switch(n)
-                       { case 11 : epsC1=atof(a[10]); 
-                          case 10  : epsC0= atof(a[9]);
-                         case 9  : epsnl = atof(a[8]);
+                       { case 11 : epsC1=Draw::Atof(a[10]); 
+                          case 10  : epsC0= Draw::Atof(a[9]);
+                         case 9  : epsnl = Draw::Atof(a[8]);
                          case 8  : {} break;
                          default : return 1;
                        } 
@@ -136,10 +136,10 @@ static Standard_Integer surfaceCcontinuity (Draw_Interpretor& di, Standard_Integ
         case 2 : { TypeCont=GeomAbs_C2;
                     switch(n)
                       {
-                          case 12 : epsC2= atof(a[11]); 
-                          case 11 : epsC1=atof(a[10]); 
-                          case 10 : epsC0= atof(a[9]);
-                         case 9  : epsnl = atof(a[8]);
+                          case 12 : epsC2= Draw::Atof(a[11]); 
+                          case 11 : epsC1=Draw::Atof(a[10]); 
+                          case 10 : epsC0= Draw::Atof(a[9]);
+                         case 9  : epsnl = Draw::Atof(a[8]);
                          case 8  : {} break;
                          default : return 1;
                        } 
@@ -176,12 +176,12 @@ static Standard_Integer surfaceGcontinuity (Draw_Interpretor& di, Standard_Integ
   Handle(Geom_Surface) surf2 = DrawTrSurf::GetSurface(a[5]);
   if (surf2.IsNull()) return 1;
    
-      U1 = atof(a[3]);
-      U2 = atof(a[6]);
-      V1 = atof(a[4]); 
-      V2 = atof(a[7]); 
+      U1 = Draw::Atof(a[3]);
+      U2 = Draw::Atof(a[6]);
+      V1 = Draw::Atof(a[4]); 
+      V2 = Draw::Atof(a[7]); 
 
-      ord = atoi(a[1]);
+      ord = Draw::Atoi(a[1]);
 
       surf1->Bounds(u1, u2, v1, v2);
       b1 = ((((U1>=u1)&&(U1<=u2))||((U1<=u1)&&(U1>=u2))));
@@ -198,9 +198,9 @@ static Standard_Integer surfaceGcontinuity (Draw_Interpretor& di, Standard_Integ
        { 
         case 1 : { TypeCont=GeomAbs_G1;
                      switch(n)
-                        { case 11 : epsG1=atof(a[10]); 
-                          case 10  : epsC0= atof(a[9]);
-                         case 9  : epsnl = atof(a[8]);
+                        { case 11 : epsG1=Draw::Atof(a[10]); 
+                          case 10  : epsC0= Draw::Atof(a[9]);
+                         case 9  : epsnl = Draw::Atof(a[8]);
                          case 8  : {} break;
                          default : return 1;
                        } 
@@ -215,11 +215,11 @@ static Standard_Integer surfaceGcontinuity (Draw_Interpretor& di, Standard_Integ
                  break;
         case 2 : { TypeCont=GeomAbs_G2;
                     switch(n)
-                     {   case 13 : maxlen =atof (a[12]);
-                          case 12 :  perce=atof(a[11]); 
-                          case 11 : epsG1=atof(a[10]); 
-                          case 10 : epsC0= atof(a[9]);
-                         case 9  : epsnl = atof(a[8]);
+                     {   case 13 : maxlen =Draw::Atof (a[12]);
+                          case 12 :  perce=Draw::Atof(a[11]); 
+                          case 11 : epsG1=Draw::Atof(a[10]); 
+                          case 10 : epsC0= Draw::Atof(a[9]);
+                         case 9  : epsnl = Draw::Atof(a[8]);
                          case 8  : {} break;
                          default : return 1;
                        } 
@@ -253,10 +253,10 @@ static Standard_Integer curveGcontinuity(Draw_Interpretor& di, Standard_Integer
   Handle(Geom_Curve) curv2 = DrawTrSurf::GetCurve(a[4]);
   if (curv2.IsNull()) return 1;
 
-  U1 = atof(a[3]);
-  U2 = atof(a[5]);
+  U1 = Draw::Atof(a[3]);
+  U2 = Draw::Atof(a[5]);
  
-  ord = atoi(a[1]);
+  ord = Draw::Atoi(a[1]);
 
   u1=curv1->FirstParameter();
   u2=curv1->LastParameter();
@@ -273,9 +273,9 @@ static Standard_Integer curveGcontinuity(Draw_Interpretor& di, Standard_Integer
        { 
          case 1 : {
                     switch(n)
-                       { case 9 :  epsG1=atof(a[8]); 
-                          case 8  : epsC0= atof(a[7]);
-                         case 7  : epsnl = atof(a[6]);
+                       { case 9 :  epsG1=Draw::Atof(a[8]); 
+                          case 8  : epsC0= Draw::Atof(a[7]);
+                         case 7  : epsnl = Draw::Atof(a[6]);
                          case 6  : {} break;
                          default : return 1;
                        }                         
@@ -291,12 +291,12 @@ static Standard_Integer curveGcontinuity(Draw_Interpretor& di, Standard_Integer
         case 2 : { 
                     TypeCont=GeomAbs_G2;
                     switch(n)
-                      {case 12 :maxlen =atof(a[11]);
-                       case  11 :percent=atof(a[10]);
-                        case 10 : epsG2= atof(a[9]); 
-                        case 9 : epsG1=atof(a[8]); 
-                        case 8  : epsC0= atof(a[7]);
-                       case 7  : epsnl = atof(a[6]);
+                      {case 12 :maxlen =Draw::Atof(a[11]);
+                       case  11 :percent=Draw::Atof(a[10]);
+                        case 10 : epsG2= Draw::Atof(a[9]); 
+                        case 9 : epsG1=Draw::Atof(a[8]); 
+                        case 8  : epsC0= Draw::Atof(a[7]);
+                       case 7  : epsnl = Draw::Atof(a[6]);
                        case 6  : {} break;
                        default : return 1;
                        } 
@@ -328,10 +328,10 @@ static Standard_Integer curveCcontinuity(Draw_Interpretor& di, Standard_Integer
   Handle(Geom_Curve) curv2 = DrawTrSurf::GetCurve(a[4]);
   if (curv2.IsNull()) return 1;
 
-   U1 = atof(a[3]);
-   U2 = atof(a[5]);
+   U1 = Draw::Atof(a[3]);
+   U2 = Draw::Atof(a[5]);
  
-   ord = atoi(a[1]);
+   ord = Draw::Atoi(a[1]);
 
    u1=curv1->FirstParameter();
    u2=curv1->LastParameter();
@@ -347,8 +347,8 @@ static Standard_Integer curveCcontinuity(Draw_Interpretor& di, Standard_Integer
    InitEpsCurv( epsnl,epsC0, epsC1, epsC2, epsG1, epsG2, percent,maxlen);
    switch ( ord )
        { case 0 : {  switch(n)
-                       { case 8  : epsC0= atof(a[7]);
-                         case 7  : epsnl = atof(a[6]);
+                       { case 8  : epsC0= Draw::Atof(a[7]);
+                         case 7  : epsnl = Draw::Atof(a[6]);
                          case 6  : {} break;
                          default : return 1;
                        }                     
@@ -362,9 +362,9 @@ static Standard_Integer curveCcontinuity(Draw_Interpretor& di, Standard_Integer
 
                   }  break;
         case 1 : { switch(n)
-                       { case 9 : epsC1 =atof(a[8]);
-                          case 8  : epsC0= atof(a[7]);
-                         case 7  : epsnl = atof(a[6]);
+                       { case 9 : epsC1 =Draw::Atof(a[8]);
+                          case 8  : epsC0= Draw::Atof(a[7]);
+                         case 7  : epsnl = Draw::Atof(a[6]);
                          case 6  : {} break;
                          default : return 1;
                        }                          
@@ -380,10 +380,10 @@ static Standard_Integer curveCcontinuity(Draw_Interpretor& di, Standard_Integer
         case 2 : {  TypeCont=GeomAbs_C2;
                      switch(n)
                       {
-                          case 10 : epsC2= atof(a[9]); 
-                          case 9  : epsC1=atof(a[8]); 
-                          case 8  : epsC0= atof(a[7]);
-                         case 7  : epsnl = atof(a[6]);
+                          case 10 : epsC2= Draw::Atof(a[9]); 
+                          case 9  : epsC1=Draw::Atof(a[8]); 
+                          case 8  : epsC0= Draw::Atof(a[7]);
+                         case 7  : epsnl = Draw::Atof(a[6]);
                          case 6  : {} break;
                          default : return 1;
                        } 
index e7abdd9b8b0a6c7b5a3c2792b645c3c23a625e1e..fe4878bdbd6b53ef586e06e9e0ae8613fe90cec6 100755 (executable)
@@ -153,17 +153,17 @@ static Standard_Integer polelaw (Draw_Interpretor& , Standard_Integer n, const c
 
   if (n < 3) return 1;
   Standard_Boolean periodic = Standard_False ;
-  Standard_Integer deg = atoi(a[2]);
-  Standard_Integer nbk = atoi(a[3]);
+  Standard_Integer deg = Draw::Atoi(a[2]);
+  Standard_Integer nbk = Draw::Atoi(a[3]);
   
   TColStd_Array1OfReal    knots(1, nbk);
   TColStd_Array1OfInteger mults(1, nbk);
   k = 4;
   Standard_Integer Sigma = 0;
   for (i = 1; i<=nbk; i++) {
-    knots( i) = atof(a[k]);
+    knots( i) = Draw::Atof(a[k]);
     k++;
-    mults( i) = atoi(a[k]);
+    mults( i) = Draw::Atoi(a[k]);
     Sigma += mults(i);
     k++;
   }
@@ -185,7 +185,7 @@ static Standard_Integer polelaw (Draw_Interpretor& , Standard_Integer n, const c
                                  flat_knots,
                                  schoenberg_points) ;
   for (i = 1; i <= np; i++) {
-    poles(i).SetCoord(schoenberg_points(i),atof(a[k]));
+    poles(i).SetCoord(schoenberg_points(i),Draw::Atof(a[k]));
     k++;
   }
     
@@ -270,9 +270,9 @@ static Standard_Integer gproject(Draw_Interpretor& di, Standard_Integer n, const
   Standard_Integer ONE = 1;
 
   if (n == 3)
-    sprintf(name,"p");
+    Sprintf(name,"p");
   else if (n == 4) {
-    sprintf(name,"%s",a[1]);
+    Sprintf(name,"%s",a[1]);
     ONE = 2;
   }
   else {
@@ -306,8 +306,8 @@ static Standard_Integer gproject(Draw_Interpretor& di, Standard_Integer n, const
   Handle(Geom2d_Curve) PCur2d; // Only for isoparametric projection
 
   for(k = 1; k <= Projector.NbCurves(); k++){
-    sprintf(newname,"%s_%d",name,k);
-    sprintf(newname1,"%s2d_%d",name,k);
+    Sprintf(newname,"%s_%d",name,k);
+    Sprintf(newname1,"%s2d_%d",name,k);
     if(Projector.IsSinglePnt(k, P2d)){
 //      cout<<"Part "<<k<<" of the projection is punctual"<<endl;
       Projector.GetSurface()->D0(P2d.X(), P2d.Y(), P);
@@ -430,7 +430,7 @@ static Standard_Integer project (Draw_Interpretor& di,
     if ( a[index][0] != '-') return 1;
 
     if ( a[index][1] == 'e') {
-      Standard_Real p = atof(a[index+1]);
+      Standard_Real p = Draw::Atof(a[index+1]);
       Standard_Real dU = p * (U2 - U1) / 100.;
       Standard_Real dV = p * (V2 - V1) / 100.;
       U1 -= dU; U2 += dU; V1 -= dV; V2 += dV;
@@ -438,10 +438,10 @@ static Standard_Integer project (Draw_Interpretor& di,
     }
     else if ( a[index][1] == 'v') {
       Verif = Standard_True;
-      NbPoints = atoi(a[index+1]);
+      NbPoints = Draw::Atoi(a[index+1]);
     }
     else if ( a[index][1] == 't') {
-      tolerance = atof(a[index+1]);
+      tolerance = Draw::Atof(a[index+1]);
     }
     index += 2;
   }
@@ -507,13 +507,13 @@ Standard_Integer projonplane(Draw_Interpretor& di,
   if ( C.IsNull()) return 1;
   
   Standard_Boolean Param = Standard_True;
-  if ((n == 5 && atoi(a[4]) == 0) ||
-      (n == 8 && atoi(a[7]) == 0)) Param = Standard_False;
+  if ((n == 5 && Draw::Atoi(a[4]) == 0) ||
+      (n == 8 && Draw::Atoi(a[7]) == 0)) Param = Standard_False;
 
   gp_Dir D;
   
   if ( n == 8) {
-    D = gp_Dir(atof(a[4]),atof(a[5]),atof(a[6]));
+    D = gp_Dir(Draw::Atof(a[4]),Draw::Atof(a[5]),Draw::Atof(a[6]));
   }
   else { 
     D = Pl->Pln().Position().Direction();
@@ -539,9 +539,9 @@ static void solution(const Handle(GccInt_Bisec)& Bis,
 {
   char solname[200];
   if ( i == 0) 
-    sprintf(solname,"%s",name);
+    Sprintf(solname,"%s",name);
   else
-    sprintf(solname,"%s_%d",name,i);
+    Sprintf(solname,"%s_%d",name,i);
   const char* temp = solname; // pour portage WNT
 
   switch ( Bis->ArcType()) {
@@ -591,7 +591,7 @@ static Standard_Integer bisec (Draw_Interpretor& di,
          char solname[200];
          NbSol = Bis.NbSolutions();
          for ( i = 1; i <= NbSol; i++) {
-           sprintf(solname,"%s_%d",a[1],i);
+           Sprintf(solname,"%s_%d",a[1],i);
            const char* temp = solname; // pour portage WNT
            DrawTrSurf::Set(temp,new Geom2d_Line(Bis.ThisSolution(i)));
          }
@@ -775,8 +775,8 @@ static Standard_Integer movelaw (Draw_Interpretor& di, Standard_Integer n, const
   tolerance,
   tx ;
 
-  u = atof(a[2]);
-  x = atof(a[3]);
+  u = Draw::Atof(a[2]);
+  x = Draw::Atof(a[3]);
   tolerance = 1.0e-5 ;
   dimension = 2 ;
   if (n < 5) {
@@ -784,9 +784,9 @@ static Standard_Integer movelaw (Draw_Interpretor& di, Standard_Integer n, const
   }
   Handle(Geom2d_BSplineCurve) G2 = DrawTrSurf::GetBSplineCurve2d(a[1]);
   if (!G2.IsNull()) {
-      tx = atof(a[4]) ;
+      tx = Draw::Atof(a[4]) ;
       if (n == 6) {
-       condition = Max(atoi(a[5]), -1)  ;
+       condition = Max(Draw::Atoi(a[5]), -1)  ;
        condition = Min(condition, G2->Degree()-1) ;
       }
       TColgp_Array1OfPnt2d   curve_poles(1,G2->NbPoles()) ;
@@ -891,7 +891,7 @@ static Standard_Integer crvpoints (Draw_Interpretor& di, Standard_Integer /*n*/,
   Standard_Real defl;
 
   Handle(Geom_Curve) C = DrawTrSurf::GetCurve(a[2]);
-  defl = atof(a[3]);
+  defl = Draw::Atof(a[3]);
 
   GeomAdaptor_Curve GAC(C);
   GCPnts_QuasiUniformDeflection PntGen(GAC, defl);
@@ -948,10 +948,10 @@ static Standard_Integer crvtpoints (Draw_Interpretor& di, Standard_Integer n, co
   Standard_Real defl, angle = Precision::Angular();
 
   Handle(Geom_Curve) C = DrawTrSurf::GetCurve(a[2]);
-  defl = atof(a[3]);
+  defl = Draw::Atof(a[3]);
 
   if(n > 3)
-    angle = atof(a[4]);
+    angle = Draw::Atof(a[4]);
 
   GeomAdaptor_Curve GAC(C);
   GCPnts_TangentialDeflection PntGen(GAC, angle, defl, 2);
@@ -1017,7 +1017,7 @@ static Standard_Integer uniformAbscissa (Draw_Interpretor& di, Standard_Integer
   }
 
   Standard_Integer nocp;
-  nocp = atoi(a[2]);
+  nocp = Draw::Atoi(a[2]);
   if(nocp < 2)
     return 1;
 
@@ -1065,12 +1065,12 @@ static Standard_Integer EllipsUniformAbscissa (Draw_Interpretor& di, Standard_In
     return 1;  
   
   Standard_Real R1;
-  R1 = atof(a[1]);
+  R1 = Draw::Atof(a[1]);
   Standard_Real R2;
-  R2 = atof(a[2]);
+  R2 = Draw::Atof(a[2]);
 
   Standard_Integer nocp;
-  nocp = atoi(a[3]);
+  nocp = Draw::Atoi(a[3]);
   if(nocp < 2)
     return 1;
   
@@ -1143,7 +1143,7 @@ static Standard_Integer mypoints (Draw_Interpretor& di, Standard_Integer /*n*/,
   Standard_Real defl;
 
   Handle(Geom_Curve) C = DrawTrSurf::GetCurve(a[2]);
-  defl = atof(a[3]);
+  defl = Draw::Atof(a[3]);
   const Handle(Geom_BSplineCurve)& aBS = Handle(Geom_BSplineCurve)::DownCast(C);
 
   if(aBS.IsNull()) return 1;
@@ -1271,7 +1271,7 @@ static Standard_Integer surfpoints (Draw_Interpretor& /*di*/, Standard_Integer /
   Standard_Real defl;
 
   Handle(Geom_Surface) S = DrawTrSurf::GetSurface(a[2]);
-  defl = atof(a[3]);
+  defl = Draw::Atof(a[3]);
 
   Handle(GeomAdaptor_HSurface) AS = new GeomAdaptor_HSurface(S);
 
@@ -1348,7 +1348,7 @@ static Standard_Integer intersection (Draw_Interpretor& di, Standard_Integer n,
   }
   //
   Standard_Real tol = Precision::Confusion();
-  if (n == 5 || n == 9 || n == 13 || n == 17) tol = atof(a[n-1]);
+  if (n == 5 || n == 9 || n == 13 || n == 17) tol = Draw::Atof(a[n-1]);
   //
   Handle(Geom_Curve) Result;
   gp_Pnt             Point;
@@ -1381,11 +1381,11 @@ static Standard_Integer intersection (Draw_Interpretor& di, Standard_Integer n,
       }
       if (useStart)
         for (Standard_Integer i=ista1; i <= ista2; i++)
-          UVsta[i-ista1] = atof(a[i]);
+          UVsta[i-ista1] = Draw::Atof(a[i]);
       if (useBnd) {
         Standard_Real UVbnd[8];
         for (Standard_Integer i=ibnd1; i <= ibnd2; i++)
-          UVbnd[i-ibnd1] = atof(a[i]);
+          UVbnd[i-ibnd1] = Draw::Atof(a[i]);
         AS1 = new GeomAdaptor_HSurface(GS1,UVbnd[0],UVbnd[1],UVbnd[2],UVbnd[3]);
         AS2 = new GeomAdaptor_HSurface(GS2,UVbnd[4],UVbnd[5],UVbnd[6],UVbnd[7]);
       }
@@ -1415,7 +1415,7 @@ static Standard_Integer intersection (Draw_Interpretor& di, Standard_Integer n,
     aNbLines = Inters.NbLines();
     if (aNbLines >= 2) {
       for (i=1; i<=aNbLines; ++i) {
-       sprintf(buf, "%s_%d",a[1],i);
+       Sprintf(buf, "%s_%d",a[1],i);
        Result = Inters.Line(i);
        const char* temp = buf; 
        DrawTrSurf::Set(temp,Result);
@@ -1429,7 +1429,7 @@ static Standard_Integer intersection (Draw_Interpretor& di, Standard_Integer n,
     aNbPoints=Inters.NbPoints();
     for (i=1; i<=aNbPoints; ++i) {
       Point=Inters.Point(i);
-      sprintf(buf,"%s_p_%d",a[1],i);
+      Sprintf(buf,"%s_p_%d",a[1],i);
       const char* temp =buf;
       DrawTrSurf::Set(temp, Point);
     }
@@ -1448,13 +1448,13 @@ static Standard_Integer intersection (Draw_Interpretor& di, Standard_Integer n,
       Standard_Integer i;
       Standard_Integer Compt = 1;
       for (i = 1; i <= nblines; i++, Compt++) {
-       sprintf(newname,"%s_%d",a[1],Compt);
+       Sprintf(newname,"%s_%d",a[1],Compt);
        Result = Inters.Segment(i);
        const char* temp = newname; // pour portage WNT
        DrawTrSurf::Set(temp,Result);
       }
       for (i = 1; i <= nbpoints; i++, Compt++) {
-       sprintf(newname,"%s_%d",a[1],i);
+       Sprintf(newname,"%s_%d",a[1],i);
        Point = Inters.Point(i);
        const char* temp = newname; // pour portage WNT
        DrawTrSurf::Set(temp,Point);
index df2c7ac2a35d461329757b46a834abb74df9026e..7e99d05719d1b623498941e7d634597782b71235 100755 (executable)
@@ -64,9 +64,9 @@ BattenCurve(Draw_Interpretor& di, Standard_Integer argc, const char** argv)
 
   Standard_Boolean Ok;
   FairCurve_AnalysisCode Iana;
-  Standard_Real a1 = atof(cangle1),
-                a2 = atof(cangle2),
-                h  = atof(cheigth);
+  Standard_Real a1 = Draw::Atof(cangle1),
+                a2 = Draw::Atof(cangle2),
+                h  = Draw::Atof(cheigth);
   gp_Pnt2d P1, P2;
 
 
@@ -108,9 +108,9 @@ MVCurve(Draw_Interpretor& di, Standard_Integer argc, const char** argv)
 
   Standard_Boolean Ok;
   FairCurve_AnalysisCode Iana;
-  Standard_Real a1 = atof(cangle1),
-                a2 = atof(cangle2),
-                h  = atof(cheigth);
+  Standard_Real a1 = Draw::Atof(cangle1),
+                a2 = Draw::Atof(cangle2),
+                h  = Draw::Atof(cheigth);
   gp_Pnt2d P1, P2;
 
 
@@ -146,7 +146,7 @@ SetPoint(Draw_Interpretor& di, Standard_Integer argc, const char** argv)
   const char *PointName = argv[2];
   const char *BattenName = argv[3];
 
-  Standard_Integer cote = atoi(side);
+  Standard_Integer cote = Draw::Atoi(side);
 
   Handle(DrawTrSurf_Point)
      Pnt =  Handle(DrawTrSurf_Point)::DownCast(Draw::Get(PointName));
@@ -173,8 +173,8 @@ SetAngle(Draw_Interpretor& di, Standard_Integer argc, const char** argv)
   const char *val = argv[2];
   const char *BattenName = argv[3];
 
-  Standard_Real angle = atof(val); 
-  Standard_Integer cote = atoi(side);
+  Standard_Real angle = Draw::Atof(val); 
+  Standard_Integer cote = Draw::Atoi(side);
  
   Handle(DrawFairCurve_Batten) 
     Bat = Handle(DrawFairCurve_Batten)::DownCast(Draw::Get(BattenName));
@@ -197,8 +197,8 @@ SetCurvature(Draw_Interpretor& di, Standard_Integer argc, const char** argv)
   const char *val = argv[2];
   const char *MVCName = argv[3];
 
-  Standard_Real rho = atof(val); 
-  Standard_Integer cote = atoi(side);
+  Standard_Real rho = Draw::Atof(val); 
+  Standard_Integer cote = Draw::Atoi(side);
  
   Handle(DrawFairCurve_MinimalVariation) 
     MVC = Handle(DrawFairCurve_MinimalVariation)::DownCast(Draw::Get(MVCName));
@@ -221,7 +221,7 @@ SetSlide(Draw_Interpretor& di, Standard_Integer argc, const char** argv)
   const char *val = argv[1];
   const char *BattenName = argv[2];
 
-  Standard_Real slide = atof(val); 
+  Standard_Real slide = Draw::Atof(val); 
  
   Handle(DrawFairCurve_Batten) 
     Bat = Handle(DrawFairCurve_Batten)::DownCast(Draw::Get(BattenName));
@@ -243,7 +243,7 @@ FreeAngle(Draw_Interpretor& di, Standard_Integer argc, const char** argv)
   const char *side = argv[1];
   const char *BattenName = argv[2];
  
-  Standard_Integer cote = atoi(side);
+  Standard_Integer cote = Draw::Atoi(side);
  
   Handle(DrawFairCurve_Batten) 
     Bat = Handle(DrawFairCurve_Batten)::DownCast(Draw::Get(BattenName));
@@ -264,7 +264,7 @@ FreeCurvature(Draw_Interpretor& di, Standard_Integer argc, const char** argv)
   const char *side = argv[1];
   const char *MVCName = argv[2];
  
-  Standard_Integer cote = atoi(side);
+  Standard_Integer cote = Draw::Atoi(side);
  
   Handle(DrawFairCurve_MinimalVariation) 
     MVC = Handle(DrawFairCurve_MinimalVariation)::DownCast(Draw::Get(MVCName));
@@ -303,7 +303,7 @@ SetHeight(Draw_Interpretor& di, Standard_Integer argc, const char** argv)
   const char *val = argv[1];
   const char *BattenName = argv[2];
 
-  Standard_Real Height = atof(val); 
+  Standard_Real Height = Draw::Atof(val); 
  
   Handle(DrawFairCurve_Batten) 
     Bat = Handle(DrawFairCurve_Batten)::DownCast(Draw::Get(BattenName));
@@ -324,7 +324,7 @@ SetSlope(Draw_Interpretor& di, Standard_Integer argc, const char** argv)
   const char *val = argv[1];
   const char *BattenName = argv[2];
 
-  Standard_Real Slope = atof(val); 
+  Standard_Real Slope = Draw::Atof(val); 
  
   Handle(DrawFairCurve_Batten) 
     Bat = Handle(DrawFairCurve_Batten)::DownCast(Draw::Get(BattenName));
@@ -344,7 +344,7 @@ SetPhysicalRatio(Draw_Interpretor& di, Standard_Integer argc, const char** argv)
   const char *val = argv[1];
   const char *MVCName = argv[2];
 
-  Standard_Real ratio = atof(val); 
+  Standard_Real ratio = Draw::Atof(val); 
  
   Handle(DrawFairCurve_MinimalVariation) 
       MVC = Handle(DrawFairCurve_MinimalVariation)::DownCast(Draw::Get(MVCName));
index 93f843d4e519856c0a018dd625fb54c584f3b522..1694d2cbca0e0fae8bfa33524693de548d528507 100755 (executable)
@@ -48,8 +48,8 @@ static Standard_Integer polytr(Draw_Interpretor& di, Standard_Integer n, const c
   if (n < 4)
     return 1;
 
-  Standard_Integer nbNodes = atoi(a[2]);
-  Standard_Integer nbTri   = atoi(a[3]);
+  Standard_Integer nbNodes = Draw::Atoi(a[2]);
+  Standard_Integer nbTri   = Draw::Atoi(a[3]);
 
   // read the nodes
   Standard_Integer i, j = 4;
@@ -60,7 +60,7 @@ static Standard_Integer polytr(Draw_Interpretor& di, Standard_Integer n, const c
       di << "Not enough nodes";
       return 1;
     }
-    Nodes(i).SetCoord(atof(a[j]),atof(a[j+1]),atof(a[j+2]));
+    Nodes(i).SetCoord(Draw::Atof(a[j]),Draw::Atof(a[j+1]),Draw::Atof(a[j+2]));
     j += 3;
   }
 
@@ -72,7 +72,7 @@ static Standard_Integer polytr(Draw_Interpretor& di, Standard_Integer n, const c
       di << "Not enough triangles";
       return 1;
     }
-    Triangles(i).Set(atoi(a[j]),atoi(a[j+1]),atoi(a[j+2]));
+    Triangles(i).Set(Draw::Atoi(a[j]),Draw::Atoi(a[j+1]),Draw::Atoi(a[j+2]));
     j += 3;
   }
 
@@ -94,7 +94,7 @@ static Standard_Integer polygon3d(Draw_Interpretor& di, Standard_Integer n, cons
   if (n < 4)
     return 1;
 
-  Standard_Integer nbNodes = atoi(a[2]);
+  Standard_Integer nbNodes = Draw::Atoi(a[2]);
 
   // read the nodes
   Standard_Integer i, j = 3;
@@ -105,7 +105,7 @@ static Standard_Integer polygon3d(Draw_Interpretor& di, Standard_Integer n, cons
       di << "Not enough nodes";
       return 1;
     }
-    Nodes(i).SetCoord(atof(a[j]),atof(a[j+1]),atof(a[j+2]));
+    Nodes(i).SetCoord(Draw::Atof(a[j]),Draw::Atof(a[j+1]),Draw::Atof(a[j+2]));
     j += 3;
   }
 
@@ -126,7 +126,7 @@ static Standard_Integer polygon2d(Draw_Interpretor& di, Standard_Integer n, cons
   if (n < 4)
     return 1;
 
-  Standard_Integer nbNodes = atoi(a[2]);
+  Standard_Integer nbNodes = Draw::Atoi(a[2]);
 
   // read the nodes
   Standard_Integer i, j = 3;
@@ -137,7 +137,7 @@ static Standard_Integer polygon2d(Draw_Interpretor& di, Standard_Integer n, cons
       di << "Not enough nodes";
       return 1;
     }
-    Nodes(i).SetCoord(atof(a[j]),atof(a[j+1]));
+    Nodes(i).SetCoord(Draw::Atof(a[j]),Draw::Atof(a[j+1]));
     j += 2;
   }
 
index c84fd82eb52e219beee0428f0d2e111b5abf2020..21c50fda46ba19109ddba4038eb94b74be164474 100755 (executable)
@@ -130,7 +130,7 @@ static Standard_Integer sweep (Draw_Interpretor&,
     Pipe.Init(path, Support, firstS);
   }
   else if (Option == GeomFill_IsConstantNormal) {
-    gp_Dir D ( atof(a[3]), atof(a[4]), atof(a[5]) );
+    gp_Dir D ( Draw::Atof(a[3]), Draw::Atof(a[4]), Draw::Atof(a[5]) );
     Handle(Geom_Curve) path = DrawTrSurf::GetCurve(a[6]);
     Handle(Geom_Curve) firstS = DrawTrSurf::GetCurve(a[7]);
     Pipe.Init(path, firstS, D);
@@ -146,8 +146,8 @@ static Standard_Integer sweep (Draw_Interpretor&,
   }     
 
   if (n >=isection+2) { 
-    MaxDegree = atoi(a[isection+1]);
-    if (n >isection+2) NbSeg = atoi(a[isection+2]);
+    MaxDegree = Draw::Atoi(a[isection+1]);
+    if (n >isection+2) NbSeg = Draw::Atoi(a[isection+2]);
   }
     
   Pipe.Perform(Tol, Standard_False,  GeomAbs_C2, MaxDegree, NbSeg);
@@ -188,7 +188,7 @@ static Standard_Integer tuyau (Draw_Interpretor&,
   if ( firstS.IsNull()) {
     if ( narg == 4) { 
       // tuyau a rayon constant.
-      Pipe.Init(path, atof(a[isect]));
+      Pipe.Init(path, Draw::Atof(a[isect]));
     }
     else 
       return 1;
@@ -321,7 +321,7 @@ static Standard_Integer fillcurves(Draw_Interpretor& di,
 
   Standard_Integer ist = 2;
   GeomFill_FillingStyle Style = GeomFill_CoonsStyle;
-  if(n > 6) ist = atoi(a[6]);
+  if(n > 6) ist = Draw::Atoi(a[6]);
 
   if(ist == 1) Style =  GeomFill_StretchStyle;
   if(ist == 2) Style =  GeomFill_CoonsStyle;
index 19f917be07dba1c3d7e7668bca8fffc5f12dde80..9ecc0bd5385ce0f821e8f3ad0fef53eded41b9d3 100644 (file)
@@ -70,12 +70,12 @@ static Standard_Integer xdistcs(Draw_Interpretor& , Standard_Integer n, const ch
     return 0;
   }
   //
-  aT1=atof(a[3]);
-  aT2=atof(a[4]);
+  aT1=Draw::Atof(a[3]);
+  aT2=Draw::Atof(a[4]);
   //
   aNbP=10;
   if (n>5) {
-    aNbP=atoi(a[5]);
+    aNbP=Draw::Atoi(a[5]);
   }
   //
   iSize=3;
index 44ad2eda1333821b379138f54bf01d019fa8d058..f8eeeb69c066779937fde866ceff7a679ac01078 100755 (executable)
@@ -57,7 +57,7 @@ static Standard_Integer proj (Draw_Interpretor& di, Standard_Integer n, const ch
 {
   if ( n < 4) return 1;
 
-  gp_Pnt2d P(atof(a[2]),atof(a[3]));
+  gp_Pnt2d P(Draw::Atof(a[2]),Draw::Atof(a[3]));
 
   char name[100];
 
@@ -74,7 +74,7 @@ static Standard_Integer proj (Draw_Interpretor& di, Standard_Integer n, const ch
     Handle(Geom2d_Line) L = new Geom2d_Line(P,gp_Vec2d(P,P1));
     Handle(Geom2d_TrimmedCurve) CT = 
       new Geom2d_TrimmedCurve(L, 0., P.Distance(P1));
-    sprintf(name,"%s%d","ext_",i);
+    Sprintf(name,"%s%d","ext_",i);
     char* temp = name; // portage WNT
     DrawTrSurf::Set(temp, CT);
     di << name << " ";
@@ -110,14 +110,14 @@ static Standard_Integer appro(Draw_Interpretor& di, Standard_Integer n, const ch
 
   if (n < 3) {
     if (n == 2) 
-      Tol2d = atof(a[1]);
+      Tol2d = Draw::Atof(a[1]);
     
     di << "Tolerance for 2d approx : "<< Tol2d << "\n";
     return 0;
   }
 
 
-  Standard_Integer i, Nb = atoi(a[2]);
+  Standard_Integer i, Nb = Draw::Atoi(a[2]);
   
   Standard_Boolean hasPoints = Standard_True;
   TColgp_Array1OfPnt2d Points(1, Nb);
@@ -172,17 +172,17 @@ static Standard_Integer appro(Draw_Interpretor& di, Standard_Integer n, const ch
        // points
        nc = 3;
        for (i = 1; i <= Nb; i++) {
-         Points(i).SetCoord(atof(a[nc]),atof(a[nc+1]));
+         Points(i).SetCoord(Draw::Atof(a[nc]),Draw::Atof(a[nc+1]));
          nc += 2;
        }
       }
       else if (nc - 2 == Nb) {
        // YValues
        nc = 5;
-       X0 = atof(a[3]);
-       DX = atof(a[4]);
+       X0 = Draw::Atof(a[3]);
+       DX = Draw::Atof(a[4]);
        for (i = 1; i <= Nb; i++) {
-         YValues(i) = atof(a[nc]);
+         YValues(i) = Draw::Atof(a[nc]);
          Points(i).SetCoord(X0+(i-1)*DX,YValues(i));
          nc++;
        }
@@ -260,7 +260,7 @@ static Standard_Integer extrema(Draw_Interpretor& di, Standard_Integer n, const
       Handle(Geom2d_Line) L = new Geom2d_Line(P1,gp_Vec2d(P1,P2));
       Handle(Geom2d_TrimmedCurve) CT = 
        new Geom2d_TrimmedCurve(L, 0., P1.Distance(P2));
-      sprintf(name,"%s%d","ext_",i);
+      Sprintf(name,"%s%d","ext_",i);
       char* temp = name; // portage WNT
       DrawTrSurf::Set(temp, CT);
       di << name << " ";
@@ -300,7 +300,7 @@ static Standard_Integer intersect(Draw_Interpretor& di, Standard_Integer n, cons
       return 1;
   }
   if(k < n)
-    Tol = atof(a[k]);
+    Tol = Draw::Atof(a[k]);
 
   if(!C2.IsNull())
   {
index 14ccfde3bcc90bcdec0793ec4843ce0060307353..71a80049ba0adfef1e76025702fcf295600502fa 100755 (executable)
@@ -356,7 +356,7 @@ static Standard_Integer smoothing (Draw_Interpretor& di,Standard_Integer n, cons
     return 0;
   }
   if (n == 3) {
-    Tolerance = atof(a[2]);
+    Tolerance = Draw::Atof(a[2]);
     if (Abs(Tolerance) < Precision::Confusion()*1.e-7)  {
       Constraint = AppParCurves_PassPoint;
     }
@@ -368,7 +368,7 @@ static Standard_Integer smoothing (Draw_Interpretor& di,Standard_Integer n, cons
   }
   else if (n >= 4) {
     Standard_Integer ific = 3;
-    Tolerance = atof(a[2]);
+    Tolerance = Draw::Atof(a[2]);
     if (Abs(Tolerance) < Precision::Confusion()*1.e-7)  {
       Constraint = AppParCurves_PassPoint;
     }
@@ -377,7 +377,7 @@ static Standard_Integer smoothing (Draw_Interpretor& di,Standard_Integer n, cons
     }
 
     if (! strcmp(a[3],"-D")) {
-       DegMax = atoi(a[4]);
+       DegMax = Draw::Atoi(a[4]);
        ific = 5;
     }
     
@@ -536,8 +536,8 @@ static Standard_Integer smoothingbybezier (Draw_Interpretor& di,
     return 0;
   }
   if (n >= 5) {
-    Tolerance = atof(a[2]);
-    Degree = atoi(a[3]);
+    Tolerance = Draw::Atof(a[2]);
+    Degree = Draw::Atoi(a[3]);
     if (! strcmp(a[4],"-GR")) {
       methode = 1;
     }
index 796c7885fe85879edf180ee472a57a8cf83c057f..cdf2697c48ea29cd0a500e2609fbc79a30ded664 100755 (executable)
@@ -129,11 +129,11 @@ static Standard_Integer anacurve (Draw_Interpretor& , Standard_Integer n, const
 
   if (!strcmp(a[0],"line")) {
     if (n == 6)
-      result2d = new Geom2d_Line(gp_Pnt2d(atof(a[2]),atof(a[3])),
-                                gp_Dir2d(atof(a[4]),atof(a[5])));
+      result2d = new Geom2d_Line(gp_Pnt2d(Draw::Atof(a[2]),Draw::Atof(a[3])),
+                                gp_Dir2d(Draw::Atof(a[4]),Draw::Atof(a[5])));
     else if (n == 8)
-      result = new Geom_Line(gp_Pnt(atof(a[2]),atof(a[3]),atof(a[4])),
-                            gp_Dir(atof(a[5]),atof(a[6]),atof(a[7])));
+      result = new Geom_Line(gp_Pnt(Draw::Atof(a[2]),Draw::Atof(a[3]),Draw::Atof(a[4])),
+                            gp_Dir(Draw::Atof(a[5]),Draw::Atof(a[6]),Draw::Atof(a[7])));
     else
       return 1;
   }
@@ -141,30 +141,30 @@ static Standard_Integer anacurve (Draw_Interpretor& , Standard_Integer n, const
   else if (!strcmp(a[0],"circle")) {
     if (n == 5)
       result2d = 
-       new Geom2d_Circle(gp_Ax22d(gp_Pnt2d(atof(a[2]),atof(a[3])),
+       new Geom2d_Circle(gp_Ax22d(gp_Pnt2d(Draw::Atof(a[2]),Draw::Atof(a[3])),
                                   gp_Dir2d(1,0)),
-                         atof(a[4]));
+                         Draw::Atof(a[4]));
     else if (n == 6)
       result = 
-       new Geom_Circle(gp_Ax2(gp_Pnt(atof(a[2]),atof(a[3]),atof(a[4])),
+       new Geom_Circle(gp_Ax2(gp_Pnt(Draw::Atof(a[2]),Draw::Atof(a[3]),Draw::Atof(a[4])),
                               gp_Dir(0,0,1)),
-                       atof(a[5]));
+                       Draw::Atof(a[5]));
     else if (n == 7)
       result2d =
-       new Geom2d_Circle(gp_Ax22d(gp_Pnt2d(atof(a[2]),atof(a[3])),
-                                  gp_Dir2d(atof(a[4]),atof(a[5]))),
-                         atof(a[6]));
+       new Geom2d_Circle(gp_Ax22d(gp_Pnt2d(Draw::Atof(a[2]),Draw::Atof(a[3])),
+                                  gp_Dir2d(Draw::Atof(a[4]),Draw::Atof(a[5]))),
+                         Draw::Atof(a[6]));
     else if (n == 9)
       result = 
-       new Geom_Circle(gp_Ax2(gp_Pnt(atof(a[2]),atof(a[3]),atof(a[4])),
-                              gp_Dir(atof(a[5]),atof(a[6]),atof(a[7]))),
-                       atof(a[8]));
+       new Geom_Circle(gp_Ax2(gp_Pnt(Draw::Atof(a[2]),Draw::Atof(a[3]),Draw::Atof(a[4])),
+                              gp_Dir(Draw::Atof(a[5]),Draw::Atof(a[6]),Draw::Atof(a[7]))),
+                       Draw::Atof(a[8]));
     else if (n == 12)
       result = 
-       new Geom_Circle(gp_Ax2(gp_Pnt(atof(a[2]),atof(a[3]),atof(a[4])),
-                              gp_Dir(atof(a[5]),atof(a[6]),atof(a[7])),
-                              gp_Dir(atof(a[8]),atof(a[9]),atof(a[10]))),
-                       atof(a[11]));
+       new Geom_Circle(gp_Ax2(gp_Pnt(Draw::Atof(a[2]),Draw::Atof(a[3]),Draw::Atof(a[4])),
+                              gp_Dir(Draw::Atof(a[5]),Draw::Atof(a[6]),Draw::Atof(a[7])),
+                              gp_Dir(Draw::Atof(a[8]),Draw::Atof(a[9]),Draw::Atof(a[10]))),
+                       Draw::Atof(a[11]));
     else
       return 1;
   }
@@ -172,30 +172,30 @@ static Standard_Integer anacurve (Draw_Interpretor& , Standard_Integer n, const
   else if (!strcmp(a[0],"parabola")) {
     if (n == 5)
       result2d = 
-       new Geom2d_Parabola(gp_Ax22d(gp_Pnt2d(atof(a[2]),atof(a[3])),
+       new Geom2d_Parabola(gp_Ax22d(gp_Pnt2d(Draw::Atof(a[2]),Draw::Atof(a[3])),
                                     gp_Dir2d(1,0)),
-                           atof(a[4]));
+                           Draw::Atof(a[4]));
     else if (n == 6)
       result = 
-       new Geom_Parabola(gp_Ax2(gp_Pnt(atof(a[2]),atof(a[3]),atof(a[4])),
+       new Geom_Parabola(gp_Ax2(gp_Pnt(Draw::Atof(a[2]),Draw::Atof(a[3]),Draw::Atof(a[4])),
                                 gp_Dir(0,0,1)),
-                         atof(a[5]));
+                         Draw::Atof(a[5]));
     else if (n == 7)
       result2d = 
-       new Geom2d_Parabola(gp_Ax22d(gp_Pnt2d(atof(a[2]),atof(a[3])),
-                                    gp_Dir2d(atof(a[4]),atof(a[5]))),
-                           atof(a[6]));
+       new Geom2d_Parabola(gp_Ax22d(gp_Pnt2d(Draw::Atof(a[2]),Draw::Atof(a[3])),
+                                    gp_Dir2d(Draw::Atof(a[4]),Draw::Atof(a[5]))),
+                           Draw::Atof(a[6]));
     else if (n == 9)
       result = 
-       new Geom_Parabola(gp_Ax2(gp_Pnt(atof(a[2]),atof(a[3]),atof(a[4])),
-                                gp_Dir(atof(a[5]),atof(a[6]),atof(a[7]))),
-                         atof(a[8]));
+       new Geom_Parabola(gp_Ax2(gp_Pnt(Draw::Atof(a[2]),Draw::Atof(a[3]),Draw::Atof(a[4])),
+                                gp_Dir(Draw::Atof(a[5]),Draw::Atof(a[6]),Draw::Atof(a[7]))),
+                         Draw::Atof(a[8]));
     else if (n == 12)
       result = 
-       new Geom_Parabola(gp_Ax2(gp_Pnt(atof(a[2]),atof(a[3]),atof(a[4])),
-                                gp_Dir(atof(a[5]),atof(a[6]),atof(a[7])),
-                                gp_Dir(atof(a[8]),atof(a[9]),atof(a[10]))),
-                         atof(a[11]));
+       new Geom_Parabola(gp_Ax2(gp_Pnt(Draw::Atof(a[2]),Draw::Atof(a[3]),Draw::Atof(a[4])),
+                                gp_Dir(Draw::Atof(a[5]),Draw::Atof(a[6]),Draw::Atof(a[7])),
+                                gp_Dir(Draw::Atof(a[8]),Draw::Atof(a[9]),Draw::Atof(a[10]))),
+                         Draw::Atof(a[11]));
     else
       return 1;
   }
@@ -203,30 +203,30 @@ static Standard_Integer anacurve (Draw_Interpretor& , Standard_Integer n, const
   else if (!strcmp(a[0],"ellipse")) {
     if (n == 6)
       result2d = 
-       new Geom2d_Ellipse(gp_Ax22d(gp_Pnt2d(atof(a[2]),atof(a[3])),
+       new Geom2d_Ellipse(gp_Ax22d(gp_Pnt2d(Draw::Atof(a[2]),Draw::Atof(a[3])),
                                    gp_Dir2d(1,0)),
-                          atof(a[4]),atof(a[5]));
+                          Draw::Atof(a[4]),Draw::Atof(a[5]));
     else if (n == 7)
       result = 
-       new Geom_Ellipse(gp_Ax2(gp_Pnt(atof(a[2]),atof(a[3]),atof(a[4])),
+       new Geom_Ellipse(gp_Ax2(gp_Pnt(Draw::Atof(a[2]),Draw::Atof(a[3]),Draw::Atof(a[4])),
                                gp_Dir(0,0,1)),
-                        atof(a[5]),atof(a[6]));
+                        Draw::Atof(a[5]),Draw::Atof(a[6]));
     else if (n == 8)
       result2d = 
-       new Geom2d_Ellipse(gp_Ax22d(gp_Pnt2d(atof(a[2]),atof(a[3])),
-                                   gp_Dir2d(atof(a[4]),atof(a[5]))),
-                          atof(a[6]), atof(a[7]));
+       new Geom2d_Ellipse(gp_Ax22d(gp_Pnt2d(Draw::Atof(a[2]),Draw::Atof(a[3])),
+                                   gp_Dir2d(Draw::Atof(a[4]),Draw::Atof(a[5]))),
+                          Draw::Atof(a[6]), Draw::Atof(a[7]));
     else if (n == 10)
       result = 
-       new Geom_Ellipse(gp_Ax2(gp_Pnt(atof(a[2]),atof(a[3]),atof(a[4])),
-                               gp_Dir(atof(a[5]),atof(a[6]),atof(a[7]))),
-                        atof(a[8]), atof(a[9]));
+       new Geom_Ellipse(gp_Ax2(gp_Pnt(Draw::Atof(a[2]),Draw::Atof(a[3]),Draw::Atof(a[4])),
+                               gp_Dir(Draw::Atof(a[5]),Draw::Atof(a[6]),Draw::Atof(a[7]))),
+                        Draw::Atof(a[8]), Draw::Atof(a[9]));
     else if (n == 13)
       result = 
-       new Geom_Ellipse(gp_Ax2(gp_Pnt(atof(a[2]),atof(a[3]),atof(a[4])),
-                               gp_Dir(atof(a[5]),atof(a[6]),atof(a[7])),
-                               gp_Dir(atof(a[8]),atof(a[9]),atof(a[10]))),
-                        atof(a[11]), atof(a[12]));
+       new Geom_Ellipse(gp_Ax2(gp_Pnt(Draw::Atof(a[2]),Draw::Atof(a[3]),Draw::Atof(a[4])),
+                               gp_Dir(Draw::Atof(a[5]),Draw::Atof(a[6]),Draw::Atof(a[7])),
+                               gp_Dir(Draw::Atof(a[8]),Draw::Atof(a[9]),Draw::Atof(a[10]))),
+                        Draw::Atof(a[11]), Draw::Atof(a[12]));
     else
       return 1;
   }
@@ -234,30 +234,30 @@ static Standard_Integer anacurve (Draw_Interpretor& , Standard_Integer n, const
   else if (!strcmp(a[0],"hyperbola")) {
     if (n == 6)
       result2d = 
-       new Geom2d_Hyperbola(gp_Ax22d(gp_Pnt2d(atof(a[2]),atof(a[3])),
+       new Geom2d_Hyperbola(gp_Ax22d(gp_Pnt2d(Draw::Atof(a[2]),Draw::Atof(a[3])),
                                      gp_Dir2d(1,0)),
-                            atof(a[4]),atof(a[5]));
+                            Draw::Atof(a[4]),Draw::Atof(a[5]));
     else if (n == 7)
       result = 
-       new Geom_Hyperbola(gp_Ax2(gp_Pnt(atof(a[2]),atof(a[3]),atof(a[4])),
+       new Geom_Hyperbola(gp_Ax2(gp_Pnt(Draw::Atof(a[2]),Draw::Atof(a[3]),Draw::Atof(a[4])),
                                  gp_Dir(0,0,1)),
-                          atof(a[5]),atof(a[6]));
+                          Draw::Atof(a[5]),Draw::Atof(a[6]));
     else if (n == 8)
       result2d = 
-       new Geom2d_Hyperbola(gp_Ax22d(gp_Pnt2d(atof(a[2]),atof(a[3])),
-                                     gp_Dir2d(atof(a[4]),atof(a[5]))),
-                            atof(a[6]), atof(a[7]));
+       new Geom2d_Hyperbola(gp_Ax22d(gp_Pnt2d(Draw::Atof(a[2]),Draw::Atof(a[3])),
+                                     gp_Dir2d(Draw::Atof(a[4]),Draw::Atof(a[5]))),
+                            Draw::Atof(a[6]), Draw::Atof(a[7]));
     else if (n == 10)
       result = 
-       new Geom_Hyperbola(gp_Ax2(gp_Pnt(atof(a[2]),atof(a[3]),atof(a[4])),
-                                 gp_Dir(atof(a[5]),atof(a[6]),atof(a[7]))),
-                          atof(a[8]), atof(a[9]));
+       new Geom_Hyperbola(gp_Ax2(gp_Pnt(Draw::Atof(a[2]),Draw::Atof(a[3]),Draw::Atof(a[4])),
+                                 gp_Dir(Draw::Atof(a[5]),Draw::Atof(a[6]),Draw::Atof(a[7]))),
+                          Draw::Atof(a[8]), Draw::Atof(a[9]));
     else if (n == 13)
       result = 
-       new Geom_Hyperbola(gp_Ax2(gp_Pnt(atof(a[2]),atof(a[3]),atof(a[4])),
-                                 gp_Dir(atof(a[5]),atof(a[6]),atof(a[7])),
-                                 gp_Dir(atof(a[8]),atof(a[9]),atof(a[10]))),
-                          atof(a[11]), atof(a[12]));
+       new Geom_Hyperbola(gp_Ax2(gp_Pnt(Draw::Atof(a[2]),Draw::Atof(a[3]),Draw::Atof(a[4])),
+                                 gp_Dir(Draw::Atof(a[5]),Draw::Atof(a[6]),Draw::Atof(a[7])),
+                                 gp_Dir(Draw::Atof(a[8]),Draw::Atof(a[9]),Draw::Atof(a[10]))),
+                          Draw::Atof(a[11]), Draw::Atof(a[12]));
     else
       return 1;
   }
@@ -286,7 +286,7 @@ static Standard_Integer polecurve (Draw_Interpretor& , Standard_Integer n, const
 
   if (!strcmp(a[0],"beziercurve")) {
     
-    Standard_Integer np = atoi(a[2]);
+    Standard_Integer np = Draw::Atoi(a[2]);
     if (np == 0) return 1;
     
     i = (n - 3) / (np);
@@ -298,10 +298,10 @@ static Standard_Integer polecurve (Draw_Interpretor& , Standard_Integer n, const
     
     k = 3;
     for (i = 1; i <= np; i++) {
-      poles(i).SetCoord(atof(a[k]),atof(a[k+1]),atof(a[k+2]));
+      poles(i).SetCoord(Draw::Atof(a[k]),Draw::Atof(a[k+1]),Draw::Atof(a[k+2]));
       k += 3;
       if (hasw) {
-       weights(i) = atof(a[k]);
+       weights(i) = Draw::Atof(a[k]);
        k++;
       }
     }
@@ -316,17 +316,17 @@ static Standard_Integer polecurve (Draw_Interpretor& , Standard_Integer n, const
   }
   
   else if (!strcmp((*a[0] == 'p') ? a[0]+1 : a[0],"bsplinecurve")) {
-    Standard_Integer deg = atoi(a[2]);
-    Standard_Integer nbk = atoi(a[3]);
+    Standard_Integer deg = Draw::Atoi(a[2]);
+    Standard_Integer nbk = Draw::Atoi(a[3]);
 
     TColStd_Array1OfReal    knots(1, nbk);
     TColStd_Array1OfInteger mults(1, nbk);
     k = 4;
     Standard_Integer Sigma = 0;
     for (i = 1; i<=nbk; i++) {
-      knots( i) = atof(a[k]);
+      knots( i) = Draw::Atof(a[k]);
       k++;
-      mults( i) = atoi(a[k]);
+      mults( i) = Draw::Atoi(a[k]);
       Sigma += mults(i);
       k++;
     }
@@ -342,9 +342,9 @@ static Standard_Integer polecurve (Draw_Interpretor& , Standard_Integer n, const
     TColStd_Array1OfReal weights(1, np);
     
     for (i = 1; i <= np; i++) {
-      poles(i).SetCoord(atof(a[k]),atof(a[k+1]),atof(a[k+2]));
+      poles(i).SetCoord(Draw::Atof(a[k]),Draw::Atof(a[k+1]),Draw::Atof(a[k+2]));
       k += 3;
-      weights(i) = atof(a[k]);
+      weights(i) = Draw::Atof(a[k]);
       k++;
     }
     
@@ -370,7 +370,7 @@ static Standard_Integer polecurve2d (Draw_Interpretor& , Standard_Integer n, con
 
   if (!strcmp(a[0],"2dbeziercurve")) {
     
-    Standard_Integer np = atoi(a[2]);
+    Standard_Integer np = Draw::Atoi(a[2]);
     if (np == 0) return 1;
     
     i = (n - 2) / (np);
@@ -382,10 +382,10 @@ static Standard_Integer polecurve2d (Draw_Interpretor& , Standard_Integer n, con
     
     k = 3;
     for (i = 1; i <= np; i++) {
-      poles(i).SetCoord(atof(a[k]),atof(a[k+1]));
+      poles(i).SetCoord(Draw::Atof(a[k]),Draw::Atof(a[k+1]));
       k += 2;
       if (hasw) {
-       weights(i) = atof(a[k]);
+       weights(i) = Draw::Atof(a[k]);
        k++;
       }
     }
@@ -400,17 +400,17 @@ static Standard_Integer polecurve2d (Draw_Interpretor& , Standard_Integer n, con
   }
   
   else if (!strcmp((*(a[0]+2) == 'p') ? a[0]+3 : a[0]+2,"bsplinecurve")) {
-    Standard_Integer deg = atoi(a[2]);
-    Standard_Integer nbk = atoi(a[3]);
+    Standard_Integer deg = Draw::Atoi(a[2]);
+    Standard_Integer nbk = Draw::Atoi(a[3]);
 
     TColStd_Array1OfReal    knots(1, nbk);
     TColStd_Array1OfInteger mults(1, nbk);
     k = 4;
     Standard_Integer Sigma = 0;
     for (i = 1; i<=nbk; i++) {
-      knots( i) = atof(a[k]);
+      knots( i) = Draw::Atof(a[k]);
       k++;
-      mults( i) = atoi(a[k]);
+      mults( i) = Draw::Atoi(a[k]);
       Sigma += mults(i);
       k++;
     }
@@ -426,9 +426,9 @@ static Standard_Integer polecurve2d (Draw_Interpretor& , Standard_Integer n, con
     TColStd_Array1OfReal weights(1, np);
     
     for (i = 1; i <= np; i++) {
-      poles(i).SetCoord(atof(a[k]),atof(a[k+1]));
+      poles(i).SetCoord(Draw::Atof(a[k]),Draw::Atof(a[k+1]));
       k += 2;
-      weights(i) = atof(a[k]);
+      weights(i) = Draw::Atof(a[k]);
       k++;
     }
     
@@ -475,11 +475,11 @@ static Standard_Integer cmovepole (Draw_Interpretor& , Standard_Integer n, const
 {
   if (n < 5) return 1;
 
-  Standard_Real dx = atof(a[3]);
-  Standard_Real dy = atof(a[4]);
+  Standard_Real dx = Draw::Atof(a[3]);
+  Standard_Real dy = Draw::Atof(a[4]);
   Standard_Real dz=0;
-  if (n >= 6) dz = atof(a[5]);
-  Standard_Integer Index = atoi(a[2]);
+  if (n >= 6) dz = Draw::Atof(a[5]);
+  Standard_Integer Index = Draw::Atoi(a[2]);
 
   Handle(Geom_BezierCurve) G1 = DrawTrSurf::GetBezierCurve(a[1]);
   if (!G1.IsNull()) {
@@ -542,9 +542,9 @@ static Standard_Integer cmovetangent (Draw_Interpretor& di, Standard_Integer n,
   tx,
   ty,
   tz ;
-  u = atof(a[2]);
-  x = atof(a[3]);
-  y = atof(a[4]);
+  u = Draw::Atof(a[2]);
+  x = Draw::Atof(a[3]);
+  y = Draw::Atof(a[4]);
   z = 0.0e0,
   tolerance = 1.0e-5 ;
   dimension = 3 ;
@@ -565,12 +565,12 @@ static Standard_Integer cmovetangent (Draw_Interpretor& di, Standard_Integer n,
   if (dimension == 3) {
     Handle(Geom_BSplineCurve) G2 = DrawTrSurf::GetBSplineCurve(a[1]);
     if (!G2.IsNull()) {
-      z  = atof(a[5]) ;
-      tx = atof(a[6]) ;
-      ty = atof(a[7]) ;
-      tz = atof(a[8]) ;
+      z  = Draw::Atof(a[5]) ;
+      tx = Draw::Atof(a[6]) ;
+      ty = Draw::Atof(a[7]) ;
+      tz = Draw::Atof(a[8]) ;
       if (n == 10) {
-       condition = Max(atoi(a[9]), -1)  ;
+       condition = Max(Draw::Atoi(a[9]), -1)  ;
        condition = Min(condition, G2->Degree()-1) ;
       }
       gp_Pnt p;
@@ -598,10 +598,10 @@ static Standard_Integer cmovetangent (Draw_Interpretor& di, Standard_Integer n,
   else {
     Handle(Geom2d_BSplineCurve) G2 = DrawTrSurf::GetBSplineCurve2d(a[1]);
     if (!G2.IsNull()) {
-      tx = atof(a[5]) ;
-      ty = atof(a[6]) ;
+      tx = Draw::Atof(a[5]) ;
+      ty = Draw::Atof(a[6]) ;
       if (n == 8) {
-       condition = Max(atoi(a[7]), -1)  ;
+       condition = Max(Draw::Atoi(a[7]), -1)  ;
        condition = Min(condition, G2->Degree()-1) ;
       }
       gp_Pnt2d p;
@@ -639,21 +639,21 @@ static Standard_Integer cmovepoint (Draw_Interpretor& , Standard_Integer n, cons
 {
   if (n < 5) return 1;
 
-  Standard_Real dx = atof(a[3]);
-  Standard_Real dy = atof(a[4]);
+  Standard_Real dx = Draw::Atof(a[3]);
+  Standard_Real dy = Draw::Atof(a[4]);
   Standard_Real dz=0;
-  if (n >= 6 && n != 7) dz = atof(a[5]);
-  Standard_Real u = atof(a[2]);
+  if (n >= 6 && n != 7) dz = Draw::Atof(a[5]);
+  Standard_Real u = Draw::Atof(a[2]);
   Standard_Integer index1 = 0;
   Standard_Integer index2 = 0;
   Standard_Integer fmodif, lmodif;
   if (n == 7) {
-    index1 = atoi(a[5]);
-    index2 = atoi(a[6]);
+    index1 = Draw::Atoi(a[5]);
+    index2 = Draw::Atoi(a[6]);
   }
   else if (n == 8) {
-    index1 = atoi(a[6]);
-    index2 = atoi(a[7]);
+    index1 = Draw::Atoi(a[6]);
+    index2 = Draw::Atoi(a[7]);
   }
 
   Handle(Geom_BSplineCurve) G2 = DrawTrSurf::GetBSplineCurve(a[1]);
@@ -701,9 +701,9 @@ static Standard_Integer cinsertknot (Draw_Interpretor& , Standard_Integer n, con
   if (GBs.IsNull() && GBs2d.IsNull()) return 1;
 
   if (n <= 4) {
-    Standard_Real    knot = atof(a[2]);
+    Standard_Real    knot = Draw::Atof(a[2]);
     Standard_Integer mult = 1;
-    if (n == 4) mult = atoi(a[3]);
+    if (n == 4) mult = Draw::Atoi(a[3]);
     if (!GBs.IsNull())
       GBs->InsertKnot(knot,mult,Precision::PConfusion());
     else
@@ -717,8 +717,8 @@ static Standard_Integer cinsertknot (Draw_Interpretor& , Standard_Integer n, con
     TColStd_Array1OfReal    knots(1,nbk);
     TColStd_Array1OfInteger mults(1,nbk);
     for (i = 2; i < n; i += 2) {
-      knots(i/2) = atof(a[i]);
-      mults(i/2) = atoi(a[i+1]);
+      knots(i/2) = Draw::Atof(a[i]);
+      mults(i/2) = Draw::Atoi(a[i+1]);
     }
 
     if (!GBs.IsNull())
@@ -746,8 +746,8 @@ static Standard_Integer csetknot (Draw_Interpretor& , Standard_Integer n, const
 
   if (GBs.IsNull() && GBs2d.IsNull()) return 1;
 
-  Standard_Integer index = atoi(a[2]);
-  Standard_Real    knot  = atof(a[3]);
+  Standard_Integer index = Draw::Atoi(a[2]);
+  Standard_Real    knot  = Draw::Atof(a[3]);
 
   if ( n == 4) {
     if (!GBs.IsNull())
@@ -756,7 +756,7 @@ static Standard_Integer csetknot (Draw_Interpretor& , Standard_Integer n, const
       GBs2d->SetKnot(index,knot);
   }
   else {
-    Standard_Integer mult  = atoi(a[4]);
+    Standard_Integer mult  = Draw::Atoi(a[4]);
     if (!GBs.IsNull())
       GBs->SetKnot(index,knot,mult);
     else
@@ -781,12 +781,12 @@ static Standard_Integer cremknot (Draw_Interpretor& di, Standard_Integer n, cons
 
   if (GBs.IsNull() && GBs2d.IsNull()) return 1;
 
-  Standard_Integer index = atoi(a[2]);
+  Standard_Integer index = Draw::Atoi(a[2]);
   Standard_Integer mult  = 0;
-  if (n >= 4) mult = atoi(a[3]);
+  if (n >= 4) mult = Draw::Atoi(a[3]);
 
   Standard_Real tol = RealLast();
-  if (n >= 5) tol = atof(a[4]);
+  if (n >= 5) tol = Draw::Atof(a[4]);
 
   if (!GBs.IsNull()) {
     if (!GBs->RemoveKnot(index,mult,tol))
@@ -810,7 +810,7 @@ static Standard_Integer increasedegree (Draw_Interpretor& , Standard_Integer n,
 {
   if (n < 3) return 1;
 
-  Standard_Integer Deg = atoi(a[2]);
+  Standard_Integer Deg = Draw::Atoi(a[2]);
 
   Handle(Geom_BezierCurve) GBz = DrawTrSurf::GetBezierCurve(a[1]);
   Handle(Geom_BSplineCurve) GBs = DrawTrSurf::GetBSplineCurve(a[1]);
@@ -841,7 +841,7 @@ static Standard_Integer removepole (Draw_Interpretor& di, Standard_Integer n, co
 {
   if (n < 3) return 1;
 
-  Standard_Integer Index = atoi(a[2]);
+  Standard_Integer Index = Draw::Atoi(a[2]);
 
   Handle(Geom_BezierCurve)   GBZ   = DrawTrSurf::GetBezierCurve(a[1]);
   Handle(Geom2d_BezierCurve) GBZ2d = DrawTrSurf::GetBezierCurve2d(a[1]);
@@ -869,21 +869,21 @@ static Standard_Integer insertpole (Draw_Interpretor& di, Standard_Integer n, co
 {
   if (n < 6) return 1;
 
-  Standard_Integer Index = atoi(a[2]);
+  Standard_Integer Index = Draw::Atoi(a[2]);
 
   Handle(Geom_BezierCurve)   GBZ   = DrawTrSurf::GetBezierCurve(a[1]);
   Handle(Geom2d_BezierCurve) GBZ2d = DrawTrSurf::GetBezierCurve2d(a[1]);
   if (!GBZ.IsNull()) {
-    gp_Pnt P (atof(a[3]),atof(a[4]),atof(a[5]));
+    gp_Pnt P (Draw::Atof(a[3]),Draw::Atof(a[4]),Draw::Atof(a[5]));
     if ( n == 7)
-      GBZ->InsertPoleAfter(Index,P,atof(a[6]));
+      GBZ->InsertPoleAfter(Index,P,Draw::Atof(a[6]));
     else
       GBZ->InsertPoleAfter(Index,P);
   }
   else if (!GBZ2d.IsNull()) {
-    gp_Pnt2d P (atof(a[3]),atof(a[4]));
+    gp_Pnt2d P (Draw::Atof(a[3]),Draw::Atof(a[4]));
     if ( n == 6)
-      GBZ2d->InsertPoleAfter(Index,P,atof(a[5]));
+      GBZ2d->InsertPoleAfter(Index,P,Draw::Atof(a[5]));
     else
       GBZ2d->InsertPoleAfter(Index,P);
   }
@@ -906,9 +906,9 @@ static Standard_Integer cfindp (Draw_Interpretor& , Standard_Integer n, const ch
   if (n < 6) return 1;
 
   Standard_Integer Index = 0;
-  Standard_Integer view = atoi(a[2]);
-  Standard_Real x = atof(a[3]);
-  Standard_Real y = atof(a[4]);
+  Standard_Integer view = Draw::Atoi(a[2]);
+  Standard_Real x = Draw::Atof(a[3]);
+  Standard_Real y = Draw::Atof(a[4]);
 
   Draw_Display d = dout.MakeDisplay(view);
 
@@ -989,7 +989,7 @@ static Standard_Integer value (Draw_Interpretor& ,
   Handle(Geom_Curve) GC = DrawTrSurf::GetCurve(a[1]);
   if (GC.IsNull()) return 1;
 
-  Standard_Real U = atof(a[2]);
+  Standard_Real U = Draw::Atof(a[2]);
 
   Standard_Boolean DrawPoint = ( n%3 == 1);
   if ( DrawPoint) n--;
@@ -1041,7 +1041,7 @@ static Standard_Integer value2d (Draw_Interpretor& ,
   Handle(Geom2d_Curve) GC = DrawTrSurf::GetCurve2d(a[1]);
   if (GC.IsNull()) return 1;
 
-  Standard_Real U = atof(a[2]);
+  Standard_Real U = Draw::Atof(a[2]);
 
   Standard_Boolean DrawPoint = ( n%2 == 0);
   if ( DrawPoint ) n--;
@@ -1090,7 +1090,7 @@ static Standard_Integer segment (Draw_Interpretor& , Standard_Integer n, const c
   Handle(Geom2d_BezierCurve) GBz2d = DrawTrSurf::GetBezierCurve2d(a[1]);
   Handle(Geom2d_BSplineCurve) GBs2d = DrawTrSurf::GetBSplineCurve2d(a[1]);
 
-  Standard_Real f = atof(a[2]), l = atof(a[3]);
+  Standard_Real f = Draw::Atof(a[2]), l = Draw::Atof(a[3]);
 
   if (!GBz.IsNull()) 
     GBz->Segment(f,l);
@@ -1121,9 +1121,9 @@ static Standard_Integer setorigin (Draw_Interpretor& , Standard_Integer n, const
   Handle(Geom2d_BSplineCurve) GBs2d = DrawTrSurf::GetBSplineCurve2d(a[1]);
 
   if (!GBs.IsNull())
-    GBs->SetOrigin(atoi(a[2])); 
+    GBs->SetOrigin(Draw::Atoi(a[2])); 
   if (!GBs2d.IsNull())
-    GBs2d->SetOrigin(atoi(a[2])); 
+    GBs2d->SetOrigin(Draw::Atoi(a[2])); 
   else
     return 1;
 
@@ -1141,11 +1141,11 @@ static Standard_Integer point(Draw_Interpretor& , Standard_Integer n, const char
 {
   if (n < 4) return 1;
   if (n >= 5) {
-    gp_Pnt P(atof(a[2]),atof(a[3]),atof(a[4]));
+    gp_Pnt P(Draw::Atof(a[2]),Draw::Atof(a[3]),Draw::Atof(a[4]));
     DrawTrSurf::Set(a[1],P);
   }
   else {
-    gp_Pnt2d P(atof(a[2]),atof(a[3]));
+    gp_Pnt2d P(Draw::Atof(a[2]),Draw::Atof(a[3]));
     DrawTrSurf::Set(a[1],P);
   }
 
@@ -1283,7 +1283,7 @@ static Standard_Integer radiusmax(Draw_Interpretor&,
                                  Standard_Integer argc, const char** argv)
 {
   if (argc < 3) return 1; 
-  Standard_Real Radius = atof(argv[2]);
+  Standard_Real Radius = Draw::Atof(argv[2]);
    Handle(DrawTrSurf_Curve2d) C2d =  Handle(DrawTrSurf_Curve2d)
                                   ::DownCast(Draw::Get(argv[1]));
    Handle(DrawTrSurf_Curve) C3d =  Handle(DrawTrSurf_Curve)
@@ -1308,7 +1308,7 @@ static Standard_Integer radiusratio(Draw_Interpretor&,
                                  Standard_Integer argc, const char** argv)
 {
   if (argc < 3) return 1;
-  Standard_Real Ratio = atof(argv[2]);
+  Standard_Real Ratio = Draw::Atof(argv[2]);
   Handle(DrawTrSurf_Curve2d) C2d =  Handle(DrawTrSurf_Curve2d)
                                   ::DownCast(Draw::Get(argv[1]));
   Handle(DrawTrSurf_Curve) C3d =  Handle(DrawTrSurf_Curve)
@@ -1334,7 +1334,7 @@ static Standard_Integer localprop(Draw_Interpretor& di,
 {
   if (argc < 3) return 1;
 
-  Standard_Real U =  atof(argv[2]);
+  Standard_Real U =  Draw::Atof(argv[2]);
 
   Handle(Geom2d_Curve)  C2d = DrawTrSurf::GetCurve2d(argv[1]);
   Handle(Geom_Curve)    C3d;
@@ -1416,9 +1416,9 @@ static Standard_Integer rawcont(Draw_Interpretor& di, Standard_Integer n, const
   Handle(Geom_Curve) GC2;
   GC2 = DrawTrSurf::GetCurve(a[2]);
   Standard_Real param1 =
-    atof(a[3]) ;
+    Draw::Atof(a[3]) ;
   Standard_Real param2 =
-    atof(a[4]) ;
+    Draw::Atof(a[4]) ;
   if (GC1.IsNull() || GC2.IsNull())
     return 1;
   gp_Pnt a_point1,
@@ -1481,19 +1481,19 @@ static Standard_Integer approxcurveonsurf(Draw_Interpretor& di, Standard_Integer
 
   if ( n>8 || n<4) return 1;
 
-  if (n>4) Tol = Max(atof(a[4]),1.e-10);
+  if (n>4) Tol = Max(Draw::Atof(a[4]),1.e-10);
 
   if (n>5) {
-    if (atoi(a[5]) == 0) Continuity = GeomAbs_C0;
-    if (atoi(a[5]) == 2) Continuity = GeomAbs_C2;
+    if (Draw::Atoi(a[5]) == 0) Continuity = GeomAbs_C0;
+    if (Draw::Atoi(a[5]) == 2) Continuity = GeomAbs_C2;
   }
 
   if (n>6) {
-    MaxDeg = atoi(a[6]);
+    MaxDeg = Draw::Atoi(a[6]);
     if (MaxDeg<1 || MaxDeg>14) MaxDeg = 14;
   }
 
-  if (n>7) MaxSeg = atoi(a[7]);
+  if (n>7) MaxSeg = Draw::Atoi(a[7]);
   Handle(Geom2d_Curve) curve2d = DrawTrSurf::GetCurve2d(a[2]);
   Handle(Geom_Surface) Surf = DrawTrSurf::GetSurface(a[3]);
 
@@ -1591,19 +1591,19 @@ static Standard_Integer approxcurve(Draw_Interpretor& di, Standard_Integer n, co
       Case = 1;
   }
   
-  if (n>shift) Tol = Max(atof(a[shift]),1.e-10);
+  if (n>shift) Tol = Max(Draw::Atof(a[shift]),1.e-10);
   
   if (n>shift+1) {
-    if (atoi(a[shift+1]) == 0) Continuity = GeomAbs_C0;
-    if (atoi(a[shift+1]) == 2) Continuity = GeomAbs_C2;
+    if (Draw::Atoi(a[shift+1]) == 0) Continuity = GeomAbs_C0;
+    if (Draw::Atoi(a[shift+1]) == 2) Continuity = GeomAbs_C2;
   }
   
   if (n>shift+2) {
-      MaxDeg = atoi(a[shift+2]);
+      MaxDeg = Draw::Atoi(a[shift+2]);
       if (MaxDeg<1 || MaxDeg>14) MaxDeg = 14;
     }
   
-  if (n>shift+3) MaxSeg = atoi(a[shift+3]);
+  if (n>shift+3) MaxSeg = Draw::Atoi(a[shift+3]);
     
   if (Case == 1) {
     GeomConvert_ApproxCurve appr(curve, Tol, Continuity, MaxSeg, MaxDeg);
@@ -1690,11 +1690,11 @@ static Standard_Integer splitc1(Draw_Interpretor& di,
  char name[100];
 
  if (n<3) return 1;
- optiontab=atoi(c[2]);
+ optiontab=Draw::Atoi(c[2]);
  if (n >= 4 )
-   tolerance=atof(c[3]);
+   tolerance=Draw::Atof(c[3]);
  if (n >= 5) {
-   angular_tolerance = atof(c[4]) ;
+   angular_tolerance = Draw::Atof(c[4]) ;
  }
  Handle(Geom_Curve) ACurve = Handle(Geom_Curve)::DownCast(DrawTrSurf::Get(c[1])) ;
  
@@ -1717,7 +1717,7 @@ static Standard_Integer splitc1(Draw_Interpretor& di,
                                                 angular_tolerance,
                                                 tolerance);
    for (i=0;i<=(tabBS->Length()-1);i++){
-     sprintf(name,"%s_%d",c[1],i+1);
+     Sprintf(name,"%s_%d",c[1],i+1);
      Standard_CString new_name = name ;
      DrawTrSurf::Set(new_name,
                      tabBS->Value(i));
@@ -1749,11 +1749,11 @@ static Standard_Integer splitc12d(Draw_Interpretor& di,
  char name[100];
 
  if (n<3) return 1;
- optiontab=atoi(c[2]);
+ optiontab=Draw::Atoi(c[2]);
  if (n==4)
-   tolerance=atof(c[3]);
+   tolerance=Draw::Atof(c[3]);
  if (n==5) 
-   angular_tolerance = atof(c[4]) ;
+   angular_tolerance = Draw::Atof(c[4]) ;
  Handle(Geom2d_Curve) ACurve = Handle(Geom2d_Curve)::DownCast(DrawTrSurf::GetCurve2d(c[1])) ;
  
  Standard_Real f = ACurve->FirstParameter();
@@ -1775,7 +1775,7 @@ static Standard_Integer splitc12d(Draw_Interpretor& di,
                                                   angular_tolerance,
                                                   tolerance);
    for (i=0;i<=(tabBS->Length()-1);i++){
-     sprintf(name,"%s_%d",c[1],i+1);
+     Sprintf(name,"%s_%d",c[1],i+1);
      Standard_CString new_name = name ;
      DrawTrSurf::Set(new_name,
                     tabBS->Value(i));
@@ -1802,8 +1802,8 @@ static Standard_Integer canceldenom(Draw_Interpretor& ,
  Standard_Boolean    udirection=Standard_False;
  Standard_Boolean    vdirection=Standard_False;
  if (n<4) return 1;
- uoption=atoi(c[2]);
- voption=atoi(c[3]);
+ uoption=Draw::Atoi(c[2]);
+ voption=Draw::Atoi(c[3]);
  if (uoption)
    udirection=Standard_True;
  if (voption)
@@ -1826,7 +1826,7 @@ static Standard_Integer length(Draw_Interpretor& di,
   Handle(Geom_Curve) GC = DrawTrSurf::GetCurve(a[1]);
   Handle(Geom2d_Curve) GC2d = DrawTrSurf::GetCurve2d(a[1]);
   Standard_Real Tol = Precision::Confusion(), L;
-  if (n==3) Tol = atof(a[2]);
+  if (n==3) Tol = Draw::Atof(a[2]);
 
   if (!GC.IsNull()) {
     GeomAdaptor_Curve AC(GC);
index fe75d18fdc73ba969057c8611f397679f512da65..5f3f2e5eb3e056fdbad9ac2781a06397e963abc0 100755 (executable)
@@ -59,7 +59,7 @@ static Standard_Integer extendcurve (Draw_Interpretor& di, Standard_Integer n, c
        apres = Standard_False ;
       }
   }
-  Standard_Integer cont=atoi(a[3]);  
+  Standard_Integer cont=Draw::Atoi(a[3]);  
   GeomLib::ExtendCurveToPoint(GB,P,cont,apres);
   DrawTrSurf::Set(a[1],GB);
   return 0;
@@ -80,8 +80,8 @@ static Standard_Integer extendsurf (Draw_Interpretor& di, Standard_Integer n, co
     di << "extendsurf needs a Bounded surface";
     return 1;
   }
-  Standard_Real chord=atof(a[2]);
-  Standard_Integer cont=atoi(a[3]);
+  Standard_Real chord=Draw::Atof(a[2]);
+  Standard_Integer cont=Draw::Atoi(a[3]);
   Standard_Boolean enU = Standard_True, apres = Standard_True;
   if (n >= 5) {
       if (strcmp(a[4], "V") == 0) {
@@ -116,10 +116,10 @@ static Standard_Integer samerange (Draw_Interpretor& di, Standard_Integer n, con
   Handle(Geom2d_Curve) C = DrawTrSurf::GetCurve2d(a[2]);
   Handle(Geom2d_Curve) Res;
   Standard_Real f, l, rf, rl;
-  f = atof(a[3]);
-  l = atof(a[4]);
-  rf = atof(a[5]);
-  rl = atof(a[6]);
+  f = Draw::Atof(a[3]);
+  l = Draw::Atof(a[4]);
+  rf = Draw::Atof(a[5]);
+  rl = Draw::Atof(a[6]);
 
   GeomLib::SameRange(Precision::PConfusion(), C, 
                     f, l, rf, rl, Res);
index ed4529530fdee958c8b36ada0b26680e2807aa12..9f2031ee954d5abb438be557b21aa33281fc50ba 100755 (executable)
@@ -116,8 +116,8 @@ static Standard_Integer surface_radius (Draw_Interpretor& di,
   if (n <  4) return 1;
   if (n >= 6) report_curvature = 1 ;
 
-  UParameter = atof(a[2]);
-  VParameter = atof(a[3]);
+  UParameter = Draw::Atof(a[2]);
+  VParameter = Draw::Atof(a[3]);
   Handle(Geom_Surface) SurfacePtr = DrawTrSurf::GetSurface(a[1]);
   if (!SurfacePtr.IsNull()) {
     GeomLProp_SLProps myProperties(SurfacePtr,
@@ -177,19 +177,19 @@ static Standard_Integer anasurface (Draw_Interpretor& ,
     i = 2;
   }
   else if (n < 8) {
-    loc = gp_Ax3(gp_Pnt(atof(a[2]),atof(a[3]),atof(a[4])),
+    loc = gp_Ax3(gp_Pnt(Draw::Atof(a[2]),Draw::Atof(a[3]),Draw::Atof(a[4])),
                 gp_Dir(0,0,1),gp_Dir(1,0,0));
     i = 5;
   }
   else if (n < 11) {
-    loc = gp_Ax3(gp_Pnt(atof(a[2]),atof(a[3]),atof(a[4])),
-                gp_Dir(atof(a[5]),atof(a[6]),atof(a[7])));
+    loc = gp_Ax3(gp_Pnt(Draw::Atof(a[2]),Draw::Atof(a[3]),Draw::Atof(a[4])),
+                gp_Dir(Draw::Atof(a[5]),Draw::Atof(a[6]),Draw::Atof(a[7])));
     i = 8;
   }
   else if (n < 14) {
-    loc = gp_Ax3(gp_Pnt(atof(a[2]),atof(a[3]),atof(a[4])),
-                gp_Dir(atof(a[5]),atof(a[6]),atof(a[7])),
-                gp_Dir(atof(a[8]),atof(a[9]),atof(a[10])));
+    loc = gp_Ax3(gp_Pnt(Draw::Atof(a[2]),Draw::Atof(a[3]),Draw::Atof(a[4])),
+                gp_Dir(Draw::Atof(a[5]),Draw::Atof(a[6]),Draw::Atof(a[7])),
+                gp_Dir(Draw::Atof(a[8]),Draw::Atof(a[9]),Draw::Atof(a[10])));
     i = 11;
   }
   else
@@ -203,7 +203,7 @@ static Standard_Integer anasurface (Draw_Interpretor& ,
   }
   else {
     if (i >= n) return 1;
-    Standard_Real par1 = atof(a[i]);
+    Standard_Real par1 = Draw::Atof(a[i]);
     
     if (!strcasecmp(a[0],"cylinder")) {
       Handle(Geom_CylindricalSurface) C = 
@@ -219,7 +219,7 @@ static Standard_Integer anasurface (Draw_Interpretor& ,
     
     else {
       if (i+1 >= n) return 1;
-      Standard_Real par2 = atof(a[i+1]);
+      Standard_Real par2 = Draw::Atof(a[i+1]);
       
       if (!strcasecmp(a[0],"cone")) {
        par1 *= (M_PI / 180.0);
@@ -255,8 +255,8 @@ static Standard_Integer polesurface (Draw_Interpretor& , Standard_Integer n, con
 
   if (!strcasecmp(a[0],"beziersurf")) {
     
-    Standard_Integer nup = atoi(a[2]);
-    Standard_Integer nvp = atoi(a[3]);
+    Standard_Integer nup = Draw::Atoi(a[2]);
+    Standard_Integer nvp = Draw::Atoi(a[3]);
     if (nup * nvp == 0) return 1;
     
     i = (n - 4) / (nup * nvp);
@@ -269,10 +269,10 @@ static Standard_Integer polesurface (Draw_Interpretor& , Standard_Integer n, con
     k = 4;
     for (j = 1; j <= nvp; j++) {
       for (i = 1; i <= nup; i++) {
-       poles(i, j).SetCoord(atof(a[k]),atof(a[k+1]),atof(a[k+2]));
+       poles(i, j).SetCoord(Draw::Atof(a[k]),Draw::Atof(a[k+1]),Draw::Atof(a[k+2]));
        k += 3;
        if (hasw) {
-         weights(i, j) = atof(a[k]);
+         weights(i, j) = Draw::Atof(a[k]);
          k++;
        }
       }
@@ -288,8 +288,8 @@ static Standard_Integer polesurface (Draw_Interpretor& , Standard_Integer n, con
   }
 
   else {
-    Standard_Integer udeg = atoi(a[2]);
-    Standard_Integer nbuk = atoi(a[3]);
+    Standard_Integer udeg = Draw::Atoi(a[2]);
+    Standard_Integer nbuk = Draw::Atoi(a[3]);
 
     Standard_Boolean uper = (*a[0] == 'u') || (*(a[0]+1) == 'u');
     Standard_Boolean vper = (*a[0] == 'v') || (*(a[0]+1) == 'v');
@@ -299,25 +299,25 @@ static Standard_Integer polesurface (Draw_Interpretor& , Standard_Integer n, con
     k = 4;
     Standard_Integer SigmaU = 0;
     for (i = 1; i<=nbuk; i++) {
-      uk( i) = atof(a[k]);
+      uk( i) = Draw::Atof(a[k]);
       k++;
-      umult( i) = atoi(a[k]);
+      umult( i) = Draw::Atoi(a[k]);
       SigmaU += umult(i);
       k++;
     }
 
-    Standard_Integer vdeg = atoi(a[k]);
+    Standard_Integer vdeg = Draw::Atoi(a[k]);
     k++;
-    Standard_Integer nbvk = atoi(a[k]);
+    Standard_Integer nbvk = Draw::Atoi(a[k]);
     k++;
 
     TColStd_Array1OfReal    vk   (1, nbvk);
     TColStd_Array1OfInteger vmult(1, nbvk);
     Standard_Integer SigmaV = 0;
     for (i = 1; i<=nbvk; i++) {
-      vk( i) = atof(a[k]);
+      vk( i) = Draw::Atof(a[k]);
       k++;
-      vmult( i) = atoi(a[k]);
+      vmult( i) = Draw::Atoi(a[k]);
       SigmaV += vmult(i);
       k++;
     }
@@ -336,9 +336,9 @@ static Standard_Integer polesurface (Draw_Interpretor& , Standard_Integer n, con
     
     for (j = 1; j <= nvp; j++) {
       for (i = 1; i <= nup; i++) {
-       poles(i, j).SetCoord(atof(a[k]),atof(a[k+1]),atof(a[k+2]));
+       poles(i, j).SetCoord(Draw::Atof(a[k]),Draw::Atof(a[k+1]),Draw::Atof(a[k+2]));
        k += 3;
-       weights(i, j) = atof(a[k]);
+       weights(i, j) = Draw::Atof(a[k]);
        k++;
       }
     }
@@ -372,7 +372,7 @@ static Standard_Integer algosurface (Draw_Interpretor& , Standard_Integer n, con
   gp_Pnt P;
 
   if (!strcasecmp(a[0],"extsurf")) {
-    D.SetCoord(atof(a[3]),atof(a[4]),atof(a[5]));
+    D.SetCoord(Draw::Atof(a[3]),Draw::Atof(a[4]),Draw::Atof(a[5]));
     Handle(Geom_SurfaceOfLinearExtrusion) result =
       new Geom_SurfaceOfLinearExtrusion(GC,D);
 
@@ -381,8 +381,8 @@ static Standard_Integer algosurface (Draw_Interpretor& , Standard_Integer n, con
   }
   else if (!strcasecmp(a[0],"revsurf")) {
     if (n<8) return 1;
-    P.SetCoord(atof(a[3]),atof(a[4]),atof(a[5]));
-    D.SetCoord(atof(a[6]),atof(a[7]),atof(a[8]));
+    P.SetCoord(Draw::Atof(a[3]),Draw::Atof(a[4]),Draw::Atof(a[5]));
+    D.SetCoord(Draw::Atof(a[6]),Draw::Atof(a[7]),Draw::Atof(a[8]));
     
     Handle(Geom_SurfaceOfRevolution) result =
       new Geom_SurfaceOfRevolution(GC,gp_Ax1(P,D));
@@ -432,8 +432,8 @@ static Standard_Integer trimming (Draw_Interpretor& ,
        
   if (n < 5) return 1;
 
-  Standard_Real u1 = atof(a[3]);
-  Standard_Real u2 = atof(a[4]);
+  Standard_Real u1 = Draw::Atof(a[3]);
+  Standard_Real u2 = Draw::Atof(a[4]);
 
   Handle(Geom_Geometry) result;
   Handle(Geom2d_Curve) result2d;
@@ -442,7 +442,7 @@ static Standard_Integer trimming (Draw_Interpretor& ,
     if (!GS.IsNull()) {
       if (n<7) return 1;
       result =
-       new Geom_RectangularTrimmedSurface(GS,u1,u2,atof(a[5]),atof(a[6]));
+       new Geom_RectangularTrimmedSurface(GS,u1,u2,Draw::Atof(a[5]),Draw::Atof(a[6]));
     }
     else if (!GC.IsNull()) {
       result = new Geom_TrimmedCurve(GC, u1, u2);
@@ -552,10 +552,10 @@ static Standard_Integer tobezier(Draw_Interpretor& di,
       if ( S.IsNull()) return 1;
       if (n == 7) {
        Standard_Real U1, U2, V1, V2;
-       U1 = atof(a[3]);
-       U2 = atof(a[4]);
-       V1 = atof(a[5]);
-       V2 = atof(a[6]);
+       U1 = Draw::Atof(a[3]);
+       U2 = Draw::Atof(a[4]);
+       V1 = Draw::Atof(a[5]);
+       V2 = Draw::Atof(a[6]);
        GeomConvert_BSplineSurfaceToBezierSurface 
          Conv(S, U1, U2, V1, V2, Precision::PConfusion());
        NbU = Conv.NbUPatches();
@@ -563,7 +563,7 @@ static Standard_Integer tobezier(Draw_Interpretor& di,
        di << NbU << " X " << NbV << " patches in the result" << "\n";
        for (i = 1; i <= NbU; i++) {
          for (j = 1; j <= NbV; j++) {
-           sprintf(name,"%s_%i_%i",a[1],i,j);
+           Sprintf(name,"%s_%i_%i",a[1],i,j);
            char *temp = name ;
            DrawTrSurf::Set(temp,Conv.Patch(i,j));
          }
@@ -576,7 +576,7 @@ static Standard_Integer tobezier(Draw_Interpretor& di,
        di << NbU << " X " << NbV << " patches in the result" << "\n";
        for (i = 1; i <= NbU; i++) {
          for (j = 1; j <= NbV; j++) {
-           sprintf(name,"%s_%i_%i",a[1],i,j);
+           Sprintf(name,"%s_%i_%i",a[1],i,j);
            char *temp = name ;
            DrawTrSurf::Set(temp,Conv.Patch(i,j));
          }
@@ -586,14 +586,14 @@ static Standard_Integer tobezier(Draw_Interpretor& di,
     else {
       if (n==5) {
        Standard_Real U1, U2;
-       U1 = atof(a[3]);
-       U2 = atof(a[4]);
+       U1 = Draw::Atof(a[3]);
+       U2 = Draw::Atof(a[4]);
        GeomConvert_BSplineCurveToBezierCurve Conv(C3d, U1, U2, 
                                                   Precision::PConfusion());
        NbArc = Conv.NbArcs();
        di << NbArc << " arcs in the result" << "\n";
        for (i = 1; i <= NbArc; i++) {
-         sprintf(name,"%s_%i",a[1],i);
+         Sprintf(name,"%s_%i",a[1],i);
          char *temp = name ;
          DrawTrSurf::Set(temp,Conv.Arc(i));
        }
@@ -603,7 +603,7 @@ static Standard_Integer tobezier(Draw_Interpretor& di,
        NbArc = Conv.NbArcs();
        di << NbArc << " arcs in the result" << "\n";
        for (i = 1; i <= NbArc; i++) {
-         sprintf(name,"%s_%i",a[1],i);
+         Sprintf(name,"%s_%i",a[1],i);
          char *temp = name ;
          DrawTrSurf::Set(temp,Conv.Arc(i));
        }
@@ -613,14 +613,14 @@ static Standard_Integer tobezier(Draw_Interpretor& di,
   else {
     if (n==5) {
       Standard_Real U1, U2;
-      U1 = atof(a[3]);
-      U2 = atof(a[4]);
+      U1 = Draw::Atof(a[3]);
+      U2 = Draw::Atof(a[4]);
       Geom2dConvert_BSplineCurveToBezierCurve Conv(C2d, U1, U2, 
                                                   Precision::PConfusion());
       NbArc = Conv.NbArcs();
       di << NbArc << " arcs in the result" << "\n";
       for (i = 1; i <= NbArc; i++) {
-       sprintf(name,"%s_%i",a[1],i);
+       Sprintf(name,"%s_%i",a[1],i);
        char *temp = name ;
        DrawTrSurf::Set(temp,Conv.Arc(i));
       }
@@ -630,7 +630,7 @@ static Standard_Integer tobezier(Draw_Interpretor& di,
       NbArc = Conv.NbArcs();
       di << NbArc << " arcs in the result" << "\n";
       for (i = 1; i <= NbArc; i++) {
-       sprintf(name,"%s_%i",a[1],i);
+       Sprintf(name,"%s_%i",a[1],i);
        char *temp = name ;
        DrawTrSurf::Set(temp,Conv.Arc(i));
       }
@@ -653,11 +653,11 @@ static Standard_Integer convbz(Draw_Interpretor& di,
   Standard_Integer ii, jj, kk=0, NbU, NbV;
   Standard_Real Tol = Precision::Confusion();
   
-  NbU = atoi(a[2]);
+  NbU = Draw::Atoi(a[2]);
   if ( (Handle(Geom_Curve)::
        DownCast(DrawTrSurf::Get(a[3]))).IsNull()) {    
     // Cas Surfacique
-    NbV = atoi(a[3]);
+    NbV = Draw::Atoi(a[3]);
     if (n<4+NbU*NbV) {
       di << "The number of bezier surface have to be " << NbU*NbV << "\n";
       return 1;
@@ -674,7 +674,7 @@ static Standard_Integer convbz(Draw_Interpretor& di,
        }
        kk++;
       }
-    if (kk<n) Tol = atof(a[kk]);
+    if (kk<n) Tol = Draw::Atof(a[kk]);
   
     GeomConvert_CompBezierSurfacesToBSplineSurface Conv(BZ, Tol);
     
@@ -745,28 +745,28 @@ static Standard_Integer approxsurf(Draw_Interpretor& di, Standard_Integer n, con
 
   if ( n>10 || n<3) return 1;
 
-  if (n>3) Tol = Max(atof(a[3]),1.e-10);
+  if (n>3) Tol = Max(Draw::Atof(a[3]),1.e-10);
 
   if (n==5)  return 1;
   
   if (n>5) {
-    if (atoi(a[4]) == 0) myUCont = GeomAbs_C0;
-    if (atoi(a[4]) == 2) myUCont = GeomAbs_C2;
-    if (atoi(a[5]) == 0) myVCont = GeomAbs_C0;
-    if (atoi(a[5]) == 2) myVCont = GeomAbs_C2;
+    if (Draw::Atoi(a[4]) == 0) myUCont = GeomAbs_C0;
+    if (Draw::Atoi(a[4]) == 2) myUCont = GeomAbs_C2;
+    if (Draw::Atoi(a[5]) == 0) myVCont = GeomAbs_C0;
+    if (Draw::Atoi(a[5]) == 2) myVCont = GeomAbs_C2;
   }
 
   if (n==7)  return 1;
 
   if (n>7) {
-    ( degU = (atoi(a[6])));
-    ( degV = (atoi(a[7])));
+    ( degU = (Draw::Atoi(a[6])));
+    ( degV = (Draw::Atoi(a[7])));
     if ((degU<1) || (degU>24)) degU = 14;
     if ((degV<1) || (degV>24)) degV = 14; 
   }  
 
-  if (n>8) nmax = atoi(a[8]);
-  if (n>9) myPrec =  atoi(a[9]);
+  if (n>8) nmax = Draw::Atoi(a[8]);
+  if (n>9) myPrec =  Draw::Atoi(a[9]);
 
   Handle(Geom_Surface) surf = DrawTrSurf::GetSurface(a[2]);
   if (surf.IsNull()) return 1;  
@@ -789,7 +789,7 @@ static Standard_Integer offseting (Draw_Interpretor& ,
   // test the Geom2d curve
   Handle(Geom2d_Curve) C2d = DrawTrSurf::GetCurve2d(a[2]);
   if (!C2d.IsNull()) {
-    Handle(Geom2d_OffsetCurve) OC = new Geom2d_OffsetCurve(C2d,atof(a[3]));
+    Handle(Geom2d_OffsetCurve) OC = new Geom2d_OffsetCurve(C2d,Draw::Atof(a[3]));
     DrawTrSurf::Set(a[1],OC);
     return 0;
   }
@@ -805,7 +805,7 @@ static Standard_Integer offseting (Draw_Interpretor& ,
     yasurf = Standard_True;
   }
 
-  Standard_Real dist = atof(a[3]);
+  Standard_Real dist = Draw::Atof(a[3]);
 
   Handle(Geom_Geometry) result;
 
@@ -815,7 +815,7 @@ static Standard_Integer offseting (Draw_Interpretor& ,
   }
   else {
     if (n < 7) return 1;
-    gp_Dir D(atof(a[4]),atof(a[5]),atof(a[6]));
+    gp_Dir D(Draw::Atof(a[4]),Draw::Atof(a[5]),Draw::Atof(a[6]));
     Handle(Geom_OffsetCurve) GT = new Geom_OffsetCurve(GC, dist, D);
     result = GT;
   }
@@ -859,7 +859,7 @@ static Standard_Integer iso (Draw_Interpretor& , Standard_Integer n, const char*
   if (n < 4) return 1;
 
   Handle(Geom_Curve) C;
-  Standard_Real par = atof(a[3]);
+  Standard_Real par = Draw::Atof(a[3]);
   Handle(Geom_Surface) GS = DrawTrSurf::GetSurface(a[2]);
   if (!GS.IsNull()) {
     if (*a[0] == 'u')
@@ -886,8 +886,8 @@ static Standard_Integer value (Draw_Interpretor& ,
   Handle(Geom_Surface) GS = DrawTrSurf::GetSurface(a[1]);
   if (GS.IsNull()) return 1;
 
-  Standard_Real U = atof(a[2]);
-  Standard_Real V = atof(a[3]);
+  Standard_Real U = Draw::Atof(a[2]);
+  Standard_Real V = Draw::Atof(a[3]);
 
   Standard_Boolean DrawPoint = ( n%3 == 2);
   if ( DrawPoint) n--;
@@ -952,9 +952,9 @@ static Standard_Integer movepole (Draw_Interpretor& , Standard_Integer n, const
       BSpline = Standard_True;
   }
 
-  Standard_Real dx = atof(a[n-3]);
-  Standard_Real dy = atof(a[n-2]);
-  Standard_Real dz = atof(a[n-1]);
+  Standard_Real dx = Draw::Atof(a[n-3]);
+  Standard_Real dy = Draw::Atof(a[n-2]);
+  Standard_Real dz = Draw::Atof(a[n-1]);
   
   Standard_Integer nup, nvp;
   if( !BSpline) {
@@ -972,22 +972,22 @@ static Standard_Integer movepole (Draw_Interpretor& , Standard_Integer n, const
 
   if (!strcasecmp(a[0],"movep")) {
     if (n<7) return 1;
-    FirstRow = atoi(a[2]);
-    FirstCol = atoi(a[3]);
+    FirstRow = Draw::Atoi(a[2]);
+    FirstCol = Draw::Atoi(a[3]);
     if ( FirstRow < 1  || FirstRow > nup ||
         FirstCol < 1  || FirstCol > nvp   ) return 1;
     LastRow = FirstRow;
     LastCol = FirstCol;
   }
   else if (!strcasecmp(a[0],"moverowp")) {
-    FirstRow = atoi(a[2]);
+    FirstRow = Draw::Atoi(a[2]);
     if ( FirstRow < 1  || FirstRow > nup ) return 1;
     LastRow = FirstRow;
     FirstCol = 1;
     LastCol  = nvp;
   }
   else if (!strcasecmp(a[0],"movecolp")) {
-    FirstCol = atoi(a[2]);
+    FirstCol = Draw::Atoi(a[2]);
     if ( FirstCol < 1  || FirstCol > nvp ) return 1;
     LastCol = FirstCol;
     FirstRow = 1;
@@ -1031,12 +1031,12 @@ static Standard_Integer movepoint (Draw_Interpretor& , Standard_Integer n, const
     return 1;
   }
 
-  Standard_Real u = atof(a[2]);
-  Standard_Real v = atof(a[3]);
+  Standard_Real u = Draw::Atof(a[2]);
+  Standard_Real v = Draw::Atof(a[3]);
 
-  Standard_Real dx = atof(a[4]);
-  Standard_Real dy = atof(a[5]);
-  Standard_Real dz = atof(a[6]);
+  Standard_Real dx = Draw::Atof(a[4]);
+  Standard_Real dy = Draw::Atof(a[5]);
+  Standard_Real dz = Draw::Atof(a[6]);
   
   Standard_Integer index1u = 0;
   Standard_Integer index2u = 0;
@@ -1045,10 +1045,10 @@ static Standard_Integer movepoint (Draw_Interpretor& , Standard_Integer n, const
 
   Standard_Integer fmodifu, lmodifu, fmodifv, lmodifv;
   if (n == 11) {
-    index1u = atoi(a[7]);
-    index2u = atoi(a[8]);
-    index1v = atoi(a[9]);
-    index2v = atoi(a[10]);
+    index1u = Draw::Atoi(a[7]);
+    index2u = Draw::Atoi(a[8]);
+    index1v = Draw::Atoi(a[9]);
+    index2v = Draw::Atoi(a[10]);
   }
   else {
     index1u = 2;
@@ -1085,13 +1085,13 @@ static Standard_Integer insertknot (Draw_Interpretor& , Standard_Integer n, cons
   if (  !strcasecmp(a[0],"insertuknot") ||
         !strcasecmp(a[0],"insertvknot")   ) {
     if (n<4) return 1;
-    knot = atof(a[2]);
-    mult = atoi(a[3]);
+    knot = Draw::Atof(a[2]);
+    mult = Draw::Atoi(a[3]);
   }
   else if (  !strcasecmp(a[0],"remuknot") ||
             !strcasecmp(a[0],"remvknot")   ) {
-    index = atoi(a[2]);
-    if (n>=4) mult  = atoi(a[3]);
+    index = Draw::Atoi(a[2]);
+    if (n>=4) mult  = Draw::Atoi(a[3]);
   }
 
   Standard_Real tol = RealLast();
@@ -1103,12 +1103,12 @@ static Standard_Integer insertknot (Draw_Interpretor& , Standard_Integer n, cons
     GBs->InsertVKnot(knot,mult,Precision::PConfusion());
   }
   else if (!strcasecmp(a[0],"remuknot")) {
-    if (n>=5) tol = atof(a[4]);
+    if (n>=5) tol = Draw::Atof(a[4]);
     if (!GBs->RemoveUKnot(index,mult,tol)) 
       return 1;
   }
   else if (!strcasecmp(a[0],"remvknot")) {
-    if (n>=5) tol = atof(a[4]);
+    if (n>=5) tol = Draw::Atof(a[4]);
     if (!GBs->RemoveVKnot(index,mult,tol))
       return 1;
   }
@@ -1126,7 +1126,7 @@ static Standard_Integer incdegree (Draw_Interpretor& di, Standard_Integer n, con
 {
   if (n < 3) return 1;
   
-  Standard_Integer NewDeg = atoi(a[2]);
+  Standard_Integer NewDeg = Draw::Atoi(a[2]);
   Standard_Boolean BSpline = Standard_False;
   
   Standard_Integer UDeg=0, VDeg=0;
@@ -1190,7 +1190,7 @@ static Standard_Integer rempole (Draw_Interpretor& di, Standard_Integer n, const
 {
   if (n < 3) return 1;
   
-  Standard_Integer NewIndex = atoi(a[2]);
+  Standard_Integer NewIndex = Draw::Atoi(a[2]);
   Standard_Boolean BSpline  = Standard_False;
   
   Handle(Geom_BezierSurface) GBz = DrawTrSurf::GetBezierSurface(a[1]);
@@ -1259,9 +1259,9 @@ static Standard_Integer sfindp (Draw_Interpretor& , Standard_Integer n, const ch
 
   Standard_Integer UIndex = 0;
   Standard_Integer VIndex = 0;
-  Standard_Integer view = atoi(a[2]);
-  Standard_Real x = atof(a[3]);
-  Standard_Real y = atof(a[4]);
+  Standard_Integer view = Draw::Atoi(a[2]);
+  Standard_Real x = Draw::Atof(a[3]);
+  Standard_Real y = Draw::Atof(a[4]);
 
   Draw_Display d = dout.MakeDisplay(view);
   
@@ -1381,10 +1381,10 @@ static Standard_Integer segsur (Draw_Interpretor& , Standard_Integer n, const ch
     GBs = DrawTrSurf::GetBSplineSurface(a[1]);
     if (GBs.IsNull())
       return 1;
-    GBs->Segment(atof(a[2]),atof(a[3]),atof(a[4]),atof(a[5])); 
+    GBs->Segment(Draw::Atof(a[2]),Draw::Atof(a[3]),Draw::Atof(a[4]),Draw::Atof(a[5])); 
   }
   else {
-    GBz->Segment(atof(a[2]),atof(a[3]),atof(a[4]),atof(a[5]));
+    GBz->Segment(Draw::Atof(a[2]),Draw::Atof(a[3]),Draw::Atof(a[4]),Draw::Atof(a[5]));
   }
 
   Draw::Repaint();
@@ -1460,10 +1460,10 @@ static Standard_Integer setuvorigin (Draw_Interpretor& , Standard_Integer n, con
   if (GBs.IsNull())
     return 1;
   if ( !strcasecmp(a[0],"setuorigin")) {
-    GBs->SetUOrigin(atoi(a[2])); 
+    GBs->SetUOrigin(Draw::Atoi(a[2])); 
   }
   else if ( !strcasecmp(a[0],"setvorigin")) {
-    GBs->SetVOrigin(atoi(a[2])); 
+    GBs->SetVOrigin(Draw::Atoi(a[2])); 
   }
   else 
     return 1;
@@ -1485,8 +1485,8 @@ static Standard_Integer parameters (Draw_Interpretor& di, Standard_Integer n, co
       // try to find parameters on a Surface
       Handle(Geom_Surface) S = DrawTrSurf::GetSurface(a[1]);
       if( S.IsNull() ) { di << "Unknown surface" << "\n"; return 1; }
-      gp_Pnt P(atof(a[2]), atof(a[3]), atof(a[4]));
-      Standard_Real Tol = atof(a[5]), U = 0., V = 0.;
+      gp_Pnt P(Draw::Atof(a[2]), Draw::Atof(a[3]), Draw::Atof(a[4]));
+      Standard_Real Tol = Draw::Atof(a[5]), U = 0., V = 0.;
       Standard_Boolean res = GeomLib_Tool::Parameters(S,P,Tol,U,V);
 
       Draw::Set(a[6],U);
@@ -1499,8 +1499,8 @@ static Standard_Integer parameters (Draw_Interpretor& di, Standard_Integer n, co
       // try to find parameters on a 3d Curve
       Handle(Geom_Curve) C = DrawTrSurf::GetCurve(a[1]);
       if( C.IsNull() ) { di << "Unknown curve" << "\n"; return 1; }
-      gp_Pnt P(atof(a[2]), atof(a[3]), atof(a[4]));
-      Standard_Real Tol = atof(a[5]), U = 0.;
+      gp_Pnt P(Draw::Atof(a[2]), Draw::Atof(a[3]), Draw::Atof(a[4]));
+      Standard_Real Tol = Draw::Atof(a[5]), U = 0.;
       Standard_Boolean res = GeomLib_Tool::Parameter(C,P,Tol,U);
     
       Draw::Set(a[6],U);
@@ -1512,8 +1512,8 @@ static Standard_Integer parameters (Draw_Interpretor& di, Standard_Integer n, co
       // try to find parameters on a 2d Curve
       Handle(Geom2d_Curve) C = DrawTrSurf::GetCurve2d(a[1]);
       if( C.IsNull() ) { di << "Unknown curve 2d" << "\n";  return 1; }
-      gp_Pnt2d P(atof(a[2]), atof(a[3]));
-      Standard_Real Tol = atof(a[4]), U = 0.;
+      gp_Pnt2d P(Draw::Atof(a[2]), Draw::Atof(a[3]));
+      Standard_Real Tol = Draw::Atof(a[4]), U = 0.;
       Standard_Boolean res = GeomLib_Tool::Parameter(C,P,Tol,U);
     
       Draw::Set(a[5],U);
index 06bc1d1b5e68566691a5b5f61fcd5caed6403abd..244b11dad18b382ebcdddee943bec830928293d9 100755 (executable)
@@ -95,22 +95,22 @@ hprj (Draw_Interpretor& , Standard_Integer n, const char** a)
 {
   Standard_Integer id = 1;
   if (n < 2) return 1;
-  if (n > 2) id = atoi(a[2]);
+  if (n > 2) id = Draw::Atoi(a[2]);
   //
   gp_Ax2 anAx2 = gp::XOY();
   if (n == 11)
   {
-    Standard_Real x = atof(a[2]);
-    Standard_Real y = atof(a[3]);
-    Standard_Real z = atof(a[4]);
+    Standard_Real x = Draw::Atof(a[2]);
+    Standard_Real y = Draw::Atof(a[3]);
+    Standard_Real z = Draw::Atof(a[4]);
 
-    Standard_Real dx = atof(a[5]);
-    Standard_Real dy = atof(a[6]);
-    Standard_Real dz = atof(a[7]);
+    Standard_Real dx = Draw::Atof(a[5]);
+    Standard_Real dy = Draw::Atof(a[6]);
+    Standard_Real dz = Draw::Atof(a[7]);
 
-    Standard_Real dx1 = atof(a[8]);
-    Standard_Real dy1 = atof(a[9]);
-    Standard_Real dz1 = atof(a[10]);
+    Standard_Real dx1 = Draw::Atof(a[8]);
+    Standard_Real dy1 = Draw::Atof(a[9]);
+    Standard_Real dz1 = Draw::Atof(a[10]);
 
     gp_Pnt anOrigin (x, y, z);
     gp_Dir aNormal  (dx, dy, dz);
@@ -152,7 +152,7 @@ hfil (Draw_Interpretor& di, Standard_Integer n, const char** a)
 {
   Standard_Integer nbIso = 0;
   if (n < 3) return 1;
-  if (n > 3) nbIso = atoi(a[3]);
+  if (n > 3) nbIso = Draw::Atoi(a[3]);
   const char *name1 = a[1];
   Handle(HLRTopoBRep_OutLiner) HS = HLRTest::GetOutLiner(name1);
   if (HS.IsNull()) {
index 7513d3acfd7fd22bcfd80f467847b5c16cfa3cb7..cce3f1e569a9d8e86c0a9da41c18aaea7c996f35 100755 (executable)
@@ -153,7 +153,7 @@ void IGESData_GlobalSection::Init(const Handle(Interface_ParamSet)& params,
     if (fpt == Interface_ParamInteger) {
        // but a real is expected 
       if ( i == 13 || i == 17 || i == 19 || i == 20)
-       realval = atof(val);
+       realval = Atof(val);
       intval  = atoi(val);
     }
 
@@ -168,7 +168,7 @@ void IGESData_GlobalSection::Init(const Handle(Interface_ParamSet)& params,
           text[j++] = val[k];  
         if (val[k] == '\0') break;
       }
-      realval = atof(text);//Interface_FileReaderData::Fastof(val);
+      realval = Atof(text);
     }
 
     // if the param is a text
index dd5fa27a0f542155509df5f82b6fd7c06f03a793..32a6b54ab646e5810cbe47dfb1f9884234057b7d 100755 (executable)
@@ -1249,9 +1249,9 @@ Standard_Boolean IGESData_ParamReader::ReadingReal (const Standard_Integer num,
       text[j++] = orig[i];  
     if (orig[i] == '\0') break;
   }
-  if (FP.ParamType() == Interface_ParamReal) val = atof(text);
-    //Interface_FileReaderData::Fastof(FP.CValue());
-   else if (FP.ParamType() == Interface_ParamEnum) {  // convention
+  if (FP.ParamType() == Interface_ParamReal) 
+    val = Atof(text);
+  else if (FP.ParamType() == Interface_ParamEnum) {  // convention
     if (!pbrealform) {
       if (testconv < 0) testconv = 0; //Interface_Static::IVal("iges.convert.read");
       if (testconv > 0) {
@@ -1266,7 +1266,7 @@ Standard_Boolean IGESData_ParamReader::ReadingReal (const Standard_Integer num,
     // mais avec exposant (sinon ce serait un entier)
     // -> un message avertissement + on ajoute le point puis on convertit
     
-    val = atof(text);//Interface_FileReaderData::Fastof(text);
+    val = Atof(text);
   } else if (FP.ParamType() == Interface_ParamVoid) {
     val = 0.0;    // DEFAULT
   } else {
@@ -1317,8 +1317,8 @@ Standard_Boolean IGESData_ParamReader::ReadingReal
       text[j++] = orig[i];  
     if (orig[i] == '\0') break;
   }
-  if (FP.ParamType() == Interface_ParamReal) val = atof(text);
-    //Interface_FileReaderData::Fastof(FP.CValue());
+  if (FP.ParamType() == Interface_ParamReal) 
+    val = Atof(text);
   else if (FP.ParamType() == Interface_ParamEnum) {  // convention
     if (!pbrealform) {
       if (testconv < 0) testconv = 0; //Interface_Static::IVal("iges.convert.read");
@@ -1334,7 +1334,7 @@ Standard_Boolean IGESData_ParamReader::ReadingReal
     // mais avec exposant (sinon ce serait un entier)
     // -> un message avertissement + on ajoute le point puis on convertit
     
-    val = atof(text);//Interface_FileReaderData::Fastof(text);
+    val = Atof(text);
   } else if (FP.ParamType() == Interface_ParamVoid) {
     val = 0.0;    // DEFAULT
   } else {
index ac4d2f6a42c3a6778b7ad03bceaa578b5275199c..83ebcae87e6d455a9da5ee1d42f36044bb1192db 100755 (executable)
@@ -125,7 +125,7 @@ void IGESGeom_ToolCircularArc::OwnCheck
   Standard_Real ratio = Abs(Rad1 - Rad2) / (Rad1+Rad2);
   if (ratio > eps) {
     char mess[80];
-    sprintf(mess,"Radius at Start & End Points, relative gap over %f",
+    Sprintf(mess,"Radius at Start & End Points, relative gap over %f",
            Interface_MSG::Intervalled (ratio));
     ach.AddFail(mess,"Radius at Start & End Points, relative gap over %f");
   }
index f6da547bd11eec61d0d6486bcc2a0702d27a843a..312a3123be036490ec0fa68b223b44a3b08459c9 100755 (executable)
@@ -217,7 +217,7 @@ void IGESGeom_ToolConicArc::OwnCheck(const Handle(IGESGeom_ConicArc)& ent,
   //Standard_Real eq = (A*x*x + B*x*y + C*y*y + D*x + E*y + F);
   // These messages are transfered in the translation procedure
 /*  if (eq < -eps || eq > eps) {
-    sprintf(mess,"Start point does not satisfy conic equation, gap over %f",
+    Sprintf(mess,"Start point does not satisfy conic equation, gap over %f",
            Interface_MSG::Intervalled(eq));
     ach.AddFail(mess,"Start point does not satisfy conic equation, gap over %f");
 
@@ -228,7 +228,7 @@ void IGESGeom_ToolConicArc::OwnCheck(const Handle(IGESGeom_ConicArc)& ent,
   //y = ent->EndPoint().Y();
   //eq = (A*x*x + B*x*y + C*y*y + D*x + E*y + F);
 /*  if (eq < -eps || eq > eps) {
-    sprintf(mess,"End point does not satisfy conic equation, gap over %f",
+    Sprintf(mess,"End point does not satisfy conic equation, gap over %f",
            Interface_MSG::Intervalled(eq));
     ach.AddFail(mess,"End point does not satisfy conic equation, gap over %f");
   }
index 28c92b36697388dacaa2e328316a4051d3711073..92bbb43862b652250ff70af9b065d8a052b1e343 100755 (executable)
@@ -244,7 +244,7 @@ void IGESGeom_ToolPlane::OwnCheck(const Handle(IGESGeom_Plane)& ent,
       C * ent->SymbolAttach().Z() - D;
   if ( ec > eps || ec < -eps) {
     char mess[80];
-    sprintf(mess,"Symbol Attach not in the Plane, gap/equation over %f",
+    Sprintf(mess,"Symbol Attach not in the Plane, gap/equation over %f",
            Interface_MSG::Intervalled(ec));
     ach.SendWarning(mess,"Symbol Attach not in the Plane");
 
index 804db54ef5b3685d8b37ad31e4d5430481557877..31d212946a8b14594b351db1c19b16ab57edfc54 100755 (executable)
@@ -290,8 +290,8 @@ static int initActivator = 0;
       }
       Standard_Real Rmin=0., Rmax=0.;
       if (argc > 4) {
-       Rmin = atof(pilot->Word(4).ToCString());
-       Rmax = atof(pilot->Word(5).ToCString());
+       Rmin = Atof(pilot->Word(4).ToCString());
+       Rmax = Atof(pilot->Word(5).ToCString());
        if (Rmin <= 0 || Rmax <= 0) { cout<<"intervalle : donner reels > 0"<<endl; return IFSelect_RetError; }
       }
       Handle(IGESSelect_FloatFormat) fm = new IGESSelect_FloatFormat;
index 8d28664506f41ec197de1f5d372fa18485bed3f6..f7560b3547f343f273097c6b9cd5c134d6d4c70e 100755 (executable)
@@ -99,9 +99,9 @@ IGESSelect_Dumper::IGESSelect_Dumper ()    {  }
     if (hasrange) {
       char flotrange[20];
       file.SendText(forminrange.ToCString());
-      sprintf(flotrange,"%f",rangemin);
+      Sprintf(flotrange,"%f",rangemin);
       file.SendText(flotrange);
-      sprintf(flotrange,"%f",rangemax);
+      Sprintf(flotrange,"%f",rangemax);
       file.SendText(flotrange);
     }
     return Standard_True;
@@ -214,8 +214,8 @@ IGESSelect_Dumper::IGESSelect_Dumper ()    {  }
     if (file.NbParams() >= 5) {
       //char flotrange[20]; //szv#4:S4163:12Mar99 unused
       Standard_Real    rangemin, rangemax;
-      rangemin = atof (file.ParamValue(4).ToCString());
-      rangemax = atof (file.ParamValue(5).ToCString());
+      rangemin = Atof (file.ParamValue(4).ToCString());
+      rangemax = Atof (file.ParamValue(5).ToCString());
       ff->SetFormatForRange (file.ParamValue(3).ToCString(),rangemin,rangemax);
     }
     item = ff;
index e677a88667a56b1fd6108971a2c4921c4d27d193..caa9740ae3bc65c97269b532df16118a729eb135 100755 (executable)
@@ -36,9 +36,9 @@ IGESSelect_FloatFormat::IGESSelect_FloatFormat ()
   } else {
     char format[20];
     char pourcent = '%'; char point = '.';
-    sprintf(format,  "%c%d%c%dE",pourcent,digits+2,point,digits);
+    Sprintf(format,  "%c%d%c%dE",pourcent,digits+2,point,digits);
     themainform.AssignCat  (format);
-    sprintf(format,  "%c%d%c%df",pourcent,digits+2,point,digits);
+    Sprintf(format,  "%c%d%c%df",pourcent,digits+2,point,digits);
     theformrange.AssignCat (format);
   }
   therangemin = 0.1; therangemax = 1000.;
@@ -90,7 +90,7 @@ IGESSelect_FloatFormat::IGESSelect_FloatFormat ()
   lab.AssignCat (themainform);
   if (theformrange.Length() > 0) {
     char mess[30];
-//    sprintf(mess,", in range %f %f %s",
+//    Sprintf(mess,", in range %f %f %s",
 //         therangemin,therangemax,theformrange.ToCString());
 //    lab.AssignCat(mess);
 //    ... FloatFormat a droit aussi a un beau format pour son propre compte ...
index 6afeadae9286f4aee2fbc44783efbc41f8d33c24..dd2c0d06bcee1d33b1b1f9a0761881d1cf23b76a 100755 (executable)
@@ -197,11 +197,11 @@ Standard_Integer IGESToBRep_Reader::LoadFile (const Standard_CString filename)
   Standard_Integer minute, hour;
   c.Show(second, minute, hour,cpu);
   if (hour > 0)
-    sprintf(t,"%dh:%dm:%.2fs",hour,minute,second);
+    Sprintf(t,"%dh:%dm:%.2fs",hour,minute,second);
   else if (minute > 0)
-    sprintf(t,"%dm:%.2fs",minute,second);
+    Sprintf(t,"%dm:%.2fs",minute,second);
   else
-    sprintf(t,"%.2fs",second);
+    Sprintf(t,"%.2fs",second);
   // Sending of message : End of Loading
   Msg8.Arg(t);
   TF->Send (Msg8, Message_Info);
@@ -467,11 +467,11 @@ void  IGESToBRep_Reader::TransferRoots (const Standard_Boolean onlyvisible)
   Standard_Integer minute, hour;
   c.Show(second, minute, hour,cpu);
   if (hour > 0)
-    sprintf(t,"%dh:%dm:%.2fs",hour,minute,second);
+    Sprintf(t,"%dh:%dm:%.2fs",hour,minute,second);
   else if (minute > 0)
-    sprintf(t,"%dm:%.2fs",minute,second);
+    Sprintf(t,"%dm:%.2fs",minute,second);
   else
-    sprintf(t,"%.2fs",second);
+    Sprintf(t,"%.2fs",second);
   // Sending of message : End of Loading
   msg2065.Arg(t);
   TF->Send (msg2065, Message_Info);
@@ -588,11 +588,11 @@ Standard_Boolean  IGESToBRep_Reader::Transfer(const Standard_Integer num)
   Standard_Integer minute, hour;
   c.Show(second, minute, hour,cpu);
   if (hour > 0)
-    sprintf(t,"%dh:%dm:%.2fs",hour,minute,second);
+    Sprintf(t,"%dh:%dm:%.2fs",hour,minute,second);
   else if (minute > 0)
-    sprintf(t,"%dm:%.2fs",minute,second);
+    Sprintf(t,"%dm:%.2fs",minute,second);
   else
-    sprintf(t,"%.2fs",second);
+    Sprintf(t,"%.2fs",second);
   // Sending of message : End of Loading
   msg2065.Arg(t);
   TF->Send (msg2065, Message_Info);
index 56576113c3406a69be29ca6acf79f042da4de55c..808e4d2e2a042eb205c7440f2328b820e50b11fd 100755 (executable)
@@ -405,10 +405,10 @@ static const Standard_Real vtab[] =
   je = jx*9;
   if (jx > jj) {
     valdiv = 1.;
-    if (jx >= 100 || grexp) return atof(ligne);  // issue de secours
+    if (jx >= 100 || grexp) return Atof(ligne);  // issue de secours
   } else {
     k = jj*9;
-    if (jj >= 100 || grexp || (k-je >= 900)) return atof(ligne);  // issue de secours
+    if (jj >= 100 || grexp || (k-je >= 900)) return Atof(ligne);  // issue de secours
     valdiv = vtab[k-je];
     je = k;
   }
index 7dea6115b0957047d75d2c0ea65c4888e9807768..9e3976fbdcdf9d48dd6a4d07a3fcd8202df87b42 100755 (executable)
@@ -55,8 +55,8 @@ Interface_FloatWriter::Interface_FloatWriter (const Standard_Integer chars)
     strcpy(therangeform ,"%f");
   } else {
     char pourcent = '%'; char point = '.';
-    sprintf(themainform,  "%c%d%c%dE",pourcent,chars+2,point,chars);
-    sprintf(therangeform, "%c%d%c%df",pourcent,chars+2,point,chars);
+    Sprintf(themainform,  "%c%d%c%dE",pourcent,chars+2,point,chars);
+    Sprintf(therangeform, "%c%d%c%df",pourcent,chars+2,point,chars);
   }
   therange1 = 0.1; therange2 = 1000.;
   thezerosup = Standard_True;
@@ -111,10 +111,10 @@ Standard_Integer Interface_FloatWriter::Convert (const Standard_Real val,
   //
   if ( (val >= R1 && val <  R2) ||
       (val <= -R1 && val > -R2) ) {
-    sprintf(pText,rangeform,val);
+    Sprintf(pText,rangeform,val);
   }
   else {
-    sprintf(pText,mainform,val);
+    Sprintf(pText,mainform,val);
   }
   
   if (zsup) {
index 1d979f02e432cd5c98ddfac0f8ca3a73e2ee0844..7b43d645844ec1fdf4ae13ae4311cf9001c77dbd 100755 (executable)
@@ -184,9 +184,9 @@ Standard_Boolean  Interface_Static::Init
       else if (init[0] == 'i' && init[2] == 'a')
        unstat->SetIntegerLimit (Standard_True ,atoi(&init[iblc]));
       else if (init[0] == 'r' && init[2] == 'i')
-       unstat->SetRealLimit (Standard_False,atof(&init[iblc]));
+       unstat->SetRealLimit (Standard_False,Atof(&init[iblc]));
       else if (init[0] == 'r' && init[2] == 'a')
-       unstat->SetRealLimit (Standard_True ,atof(&init[iblc]));
+       unstat->SetRealLimit (Standard_True ,Atof(&init[iblc]));
       else if (init[0] == 'u')
        unstat->SetUnitDef (&init[iblc]);
       else if (init[0] == 'e' && init[1] == 'm')
@@ -249,12 +249,12 @@ Standard_CString  Interface_Static::CDef
   if (part[0] == 'i') {
     Standard_Integer ilim;
     if (!stat->IntegerLimit((part[2] == 'a'),ilim)) return "";
-    sprintf(defmess,"%d",ilim);   return defmess;
+    Sprintf(defmess,"%d",ilim);   return defmess;
   }
   if (part[0] == 'r') {
     Standard_Real rlim;
     if (!stat->RealLimit((part[2] == 'a'),rlim)) return "";
-    sprintf(defmess,"%f",rlim);   return defmess;
+    Sprintf(defmess,"%f",rlim);   return defmess;
   }
   if (part[0] == 'u') return stat->UnitDef();
   return "";
index 69ba882b0f960446f3b855227ed5e26724ea75a9..264aa937862270cbff3585c6ff0a8cccc387b677 100755 (executable)
@@ -70,9 +70,9 @@ Handle(Dynamic_Parameter) Materials_MaterialDefinition::Switch(
       fr = sscanf(avalue,"%s%s%s",value1,value2,value3);
       
       Handle(Materials_Color) pcolor =
-       new Materials_Color(Quantity_Color(atof(value1),
-                                           atof(value2),
-                                           atof(value3),
+       new Materials_Color(Quantity_Color(Atof(value1),
+                                           Atof(value2),
+                                           Atof(value3),
                                            Quantity_TOC_RGB));
       objectparameter = new Dynamic_ObjectParameter(aname,pcolor);
       parameter = *(Handle_Dynamic_Parameter*)&objectparameter;
index cdfc1e192f65d5422e062a0fdfadd3c16efa15c3..b5db77308ceef49785b7088e9e9db78e377f5dd4 100755 (executable)
@@ -143,13 +143,13 @@ Materials_MaterialsDictionary::Materials_MaterialsDictionary()
          if     (!strcasecmp(type,"Materials_Color"))
             {
               Quantity_Color color
-               (atof(value1),atof(value2),atof(value3),Quantity_TOC_RGB);
+               (Atof(value1),Atof(value2),Atof(value3),Quantity_TOC_RGB);
               pcolor = new Materials_Color(color);
               material->Parameter(name,pcolor);
             }
          else if(!strcasecmp(type,"Standard_Real"))
             {
-              material->Parameter(name,atof(value1));
+              material->Parameter(name,Atof(value1));
             }
           else if(!strcasecmp(type,"Standard_CString"))
             {
index 956c2833a0530c2c5b8fa7708c07168933e55df1..5142232313b7386f062fbbf9dbba12894639c4b2 100755 (executable)
@@ -199,11 +199,11 @@ static Standard_Integer incrementalmesh(Draw_Interpretor& di, Standard_Integer n
     di << " null shapes is not allowed here\n";
     return 0;
   }
-  Standard_Real aDeflection = atof(argv[2]);
+  Standard_Real aDeflection = Draw::Atof(argv[2]);
 
   Standard_Boolean isInParallel = Standard_False;
   if (nbarg == 4) {
-       isInParallel = atoi(argv[3]) == 1;
+       isInParallel = Draw::Atoi(argv[3]) == 1;
   }
   di << "Incremental Mesh, multi-threading "
     << (isInParallel ? "ON\n" : "OFF\n");
@@ -280,17 +280,17 @@ static Standard_Integer fastdiscret(Draw_Interpretor& di, Standard_Integer nbarg
   TopoDS_Shape S = DBRep::Get(argv[1]);
   if (S.IsNull()) return 1;
 
-  const Standard_Real d = atof(argv[2]);
+  const Standard_Real d = Draw::Atof(argv[2]);
 
   Standard_Boolean WithShare = Standard_True;
-  if (nbarg > 3) WithShare = atoi(argv[3]);
+  if (nbarg > 3) WithShare = Draw::Atoi(argv[3]);
 
   Bnd_Box B;
   BRepBndLib::Add(S,B);
   BRepMesh_FastDiscret MESH(d,0.5,B,WithShare,Standard_True,Standard_False,Standard_True);
 
   //Standard_Integer NbIterations = MESH.NbIterations();
-  //if (nbarg > 4) NbIterations = atoi(argv[4]);
+  //if (nbarg > 4) NbIterations = Draw::Atoi(argv[4]);
   //MESH.NbIterations() = NbIterations;
 
   di<<"Starting FastDiscret with :"<<"\n";
@@ -472,19 +472,19 @@ static Standard_Integer triangule(Draw_Interpretor& di, Standard_Integer nbarg,
   TopoDS_Shape S = DBRep::Get(id1);
   if (S.IsNull()) return 1;
   di << argv[1] << " ";
-  Standard_Real Deflect=atof(argv[3]);
+  Standard_Real Deflect=Draw::Atof(argv[3]);
   if (Deflect<=0.) {
     di << " Donner la fleche !" << "\n";
     return 1;
   }
 
   if (nbarg >4) {
-    save = (atoi(argv[4])==1);
+    save = (Draw::Atoi(argv[4])==1);
   }
 
   Standard_Boolean partage=Standard_True;
   if (nbarg>5) {
-    partage=atoi(argv[5])==1;
+    partage=Draw::Atoi(argv[5])==1;
   }
 
   Handle(MeshTest_DrawableMesh) DM =
@@ -664,7 +664,7 @@ static Standard_Integer medge (Draw_Interpretor&, Standard_Integer n, const char
   Standard_Integer i,j,e;
   TColStd_SequenceOfInteger& eseq = D->Edges();
   for (i = 2; i < n; i++) {
-    e = atoi(a[i]);
+    e = Draw::Atoi(a[i]);
     if (e > 0)
       eseq.Append(e);
     else if (e < 0) {
@@ -702,7 +702,7 @@ static Standard_Integer mvertex (Draw_Interpretor&, Standard_Integer n, const ch
   Standard_Integer i,j,v;
   TColStd_SequenceOfInteger& vseq = D->Vertices();
   for (i = 2; i < n; i++) {
-    v = atoi(a[i]);
+    v = Draw::Atoi(a[i]);
     if (v > 0)
       vseq.Append(v);
     else if (v < 0) {
@@ -739,7 +739,7 @@ static Standard_Integer triangle (Draw_Interpretor&, Standard_Integer n, const c
   Standard_Integer i,j,v;
   TColStd_SequenceOfInteger& tseq = D->Triangles();
   for (i = 2; i < n; i++) {
-    v = atoi(a[i]);
+    v = Draw::Atoi(a[i]);
     if (v > 0)
       tseq.Append(v);
     else if (v < 0) {
@@ -810,12 +810,12 @@ Handle(BRepMesh_DataStructureOfDelaun) struc = D->Mesh()->Result();
 
 Standard_Integer in=1;
 if (argc>=3) {
-in=atoi(argv[2]);
+in=Draw::Atoi(argv[2]);
 in=Max(1,in);
 }
 Standard_Integer nbn=in;
 if (argc>=4) {
-nbn=atoi(argv[3]);
+nbn=Draw::Atoi(argv[3]);
 nbn=Min(nbn,struc->NbNodes());
 }
 
@@ -850,12 +850,12 @@ if (D.IsNull()) return 1;
 Handle(BRepMesh_DataStructureOfDelaun) struc=D->Mesh()->Result();
 Standard_Integer il=1;
 if (argc>=3) {
-il=atoi(argv[2]);
+il=Draw::Atoi(argv[2]);
 il=Max(1, il);
 }
 Standard_Integer nbl=il;
 if (argc>=4) {
-nbl=atoi(argv[3]);
+nbl=Draw::Atoi(argv[3]);
 nbl=Min(nbl, struc->NbLinks());
 }
 
@@ -890,12 +890,12 @@ if (D.IsNull()) return 1;
 Handle(BRepMesh_DataStructureOfDelaun) struc=D->Mesh()->Result();
 Standard_Integer ie=1;
 if (argc>=3) {
-ie=atoi(argv[2]);
+ie=Draw::Atoi(argv[2]);
 ie=Max(1, ie);
 }
 Standard_Integer nbe=ie;
 if (argc>=4) {
-nbe=atoi(argv[3]);
+nbe=Draw::Atoi(argv[3]);
 nbe=Min(nbe, struc->NbElements());
 }
 
@@ -1429,7 +1429,7 @@ Standard_Integer onetriangulation(Draw_Interpretor&, Standard_Integer nbarg, con
   }
   }
 
-  sprintf(name, "%s_%i", "tr", nbshell);
+  Sprintf(name, "%s_%i", "tr", nbshell);
   DrawTrSurf::Set(name, TFinale);
 
   }
@@ -1502,10 +1502,10 @@ Standard_Integer extrema(Draw_Interpretor& di, Standard_Integer nbarg, const cha
   Handle(Geom_Curve) C = DrawTrSurf::GetCurve(argv[1]);
 
   Standard_Real X, Y, Z, U0;
-  X = atof(argv[2]);
-  Y = atof(argv[3]);
-  Z = atof(argv[4]);
-  U0 = atof(argv[5]);
+  X = Draw::Atof(argv[2]);
+  Y = Draw::Atof(argv[3]);
+  Z = Draw::Atof(argv[4]);
+  U0 = Draw::Atof(argv[5]);
 
   gp_Pnt P(X, Y, Z);
   GeomAdaptor_Curve GC(C);
@@ -1586,9 +1586,9 @@ Standard_Integer triedgepoints(Draw_Interpretor& di, Standard_Integer nbarg, con
           P3d.Transform(aLoc.Transformation());
 
         if( anEdgeMap.Extent() > 1 )
-          sprintf(p,"%d_%d",nbEdge,j);
+          Sprintf(p,"%d_%d",nbEdge,j);
         else
-          sprintf(p,"%d",j);
+          Sprintf(p,"%d",j);
              DBRep::Set( newname, BRepBuilderAPI_MakeVertex(P3d) );
              di.AppendElement(newname);
       }
index 93ab93639066450ef01f22f4bc7c72d5b914d43b..7e33ef5cdd84acbeda135d2716b4d6e271be9865 100755 (executable)
@@ -29,6 +29,7 @@
 #include <BRepMesh_IncrementalMesh.hxx>
 #include <Bnd_Box.hxx>
 #include <BRepMesh_PDiscretRoot.hxx>
+#include <Draw.hxx>
 #include <DBRep.hxx>
 #include <TopTools_IndexedMapOfShape.hxx>
 #include <TopExp.hxx>
@@ -235,10 +236,10 @@ static Standard_Integer mpincmesh (Draw_Interpretor& , Standard_Integer n, const
     return 0;
   }
   //
-  aDeflection=atof(a[2]);
+  aDeflection=Draw::Atof(a[2]);
   aAngle=0.5;
   if (n>3) {
-    aAngle=atof(a[3]);
+    aAngle=Draw::Atof(a[3]);
   }
   //
   Handle(BRepMesh_DiscretRoot) aMeshAlgo = BRepMesh_DiscretFactory::Get().Discret (aS,
@@ -276,7 +277,7 @@ static Standard_Integer triarea (Draw_Interpretor& di, int n, const char ** a)
   if (shape.IsNull()) return 1;
   Standard_Real anEps = -1.;
   if (n > 2)
-    anEps = atof(a[2]);
+    anEps = Draw::Atof(a[2]);
 
   TopTools_IndexedMapOfShape aMapF;
   TopExp::MapShapes (shape, TopAbs_FACE, aMapF);
@@ -526,7 +527,7 @@ static int mpparallel (Draw_Interpretor& di, Standard_Integer argc, const char**
 {
   if (argc == 2)
   {
-    Standard_Boolean isParallelOn = atoi (argv[1]) == 1;
+    Standard_Boolean isParallelOn = Draw::Atoi (argv[1]) == 1;
     BRepMesh_IncrementalMesh::SetParallelDefault (isParallelOn);
     if (isParallelOn)
       Standard::SetReentrant(Standard_True);
index c5f30e5571dc164b39a787204264eec4363195dc..87872627d21a1dd0af40fc17013922a656dd148d 100755 (executable)
@@ -48,10 +48,10 @@ TCollection_AsciiString Message::FillTime (const Standard_Integer hour,
 {
   char t [30];
   if (hour > 0)
-    sprintf (t, "%02dh:%02dm:%.2fs", hour, minute, second);
+    Sprintf (t, "%02dh:%02dm:%.2fs", hour, minute, second);
   else if (minute > 0)
-    sprintf (t, "%02dm:%.2fs", minute, second);
+    Sprintf (t, "%02dm:%.2fs", minute, second);
   else
-    sprintf (t, "%.2fs", second);
+    Sprintf (t, "%.2fs", second);
   return TCollection_AsciiString (t);
 }
index 363f80b4c37c354340d51728f679f642a1e7c36a..2f89469a86691eff25b1db0002cc14f895980882 100755 (executable)
@@ -170,7 +170,7 @@ Message_Msg& Message_Msg::Arg (const Standard_CString theString)
 
   // print string according to format
   char * sStringBuffer = new char [Max ((Standard_Integer)strlen(theString)+1, 1024)];
-  sprintf (sStringBuffer, aFormat.ToCString(), theString);
+  Sprintf (sStringBuffer, aFormat.ToCString(), theString);
   TCollection_ExtendedString aStr ( sStringBuffer );
   delete [] sStringBuffer;
   sStringBuffer = 0;
@@ -216,7 +216,7 @@ Message_Msg& Message_Msg::Arg (const Standard_Integer theValue)
 
   // print string according to format
   char sStringBuffer [64];
-  sprintf (sStringBuffer, aFormat.ToCString(), theValue);
+  Sprintf (sStringBuffer, aFormat.ToCString(), theValue);
   TCollection_ExtendedString aStr ( sStringBuffer );
 
   // replace the format placeholder by the actual string
@@ -240,7 +240,7 @@ Message_Msg& Message_Msg::Arg (const Standard_Real theValue)
 
   // print string according to format
   char sStringBuffer [64];
-  sprintf (sStringBuffer, aFormat.ToCString(), theValue);
+  Sprintf (sStringBuffer, aFormat.ToCString(), theValue);
   TCollection_ExtendedString aStr ( sStringBuffer );
 
   // replace the format placeholder by the actual string
index b9c7f880bf4e655b25a95ed541742ea5ee9ef7ee..5bf0ca64653039c669c65d4219b28a69502d2cfe 100755 (executable)
@@ -40,7 +40,7 @@ void MoniTool_Timer::Dump(Standard_OStream &ostr)
   Standard_Real elapsed = seconds + minutes*60 + hours*3600;
   
   char buff[1024];
-  sprintf ( buff, "Elapsed:%6.1f sec, CPU User:%9.4f sec, CPU Sys:%9.4f sec, hits: %d",
+  Sprintf ( buff, "Elapsed:%6.1f sec, CPU User:%9.4f sec, CPU Sys:%9.4f sec, hits: %d",
                    elapsed, user, system, myCount );
     
   ostr << buff << endl;
@@ -113,7 +113,7 @@ void MoniTool_Timer::DumpTimers (Standard_OStream &ostr)
     }
     //Handle(MoniTool_Timer) MT = iter.Value();    
     char buff[1024];
-    sprintf ( buff, "%-20s\t", stmp );
+    Sprintf ( buff, "%-20s\t", stmp );
     ostr << "TIMER: " << buff;
     //iter.Value()->Dump ( ostr );
     Timer(stmp)->Dump(ostr);
index 13f25c5d787ab8744f6161bb5a963208207858f3..df4c4a8fc620f3f80d379d5cd4c962b8a9307c0e 100755 (executable)
@@ -156,11 +156,11 @@ static Standard_Boolean StaticPath(const Handle(TCollection_HAsciiString)& val)
       def.AssignCat("Integer");
       Standard_Integer ilim;
       if (IntegerLimit(Standard_False, ilim)) {
-       sprintf(mess,"  >= %d",ilim);
+       Sprintf(mess,"  >= %d",ilim);
        def.AssignCat(mess);
       }
       if (IntegerLimit(Standard_True,  ilim)) {
-       sprintf(mess,"  <= %d",ilim);
+       Sprintf(mess,"  <= %d",ilim);
        def.AssignCat(mess);
       }
     }
@@ -169,11 +169,11 @@ static Standard_Boolean StaticPath(const Handle(TCollection_HAsciiString)& val)
       def.AssignCat("Real");
       Standard_Real rlim;
       if (RealLimit(Standard_False, rlim)) {
-       sprintf(mess,"  >= %f",rlim);
+       Sprintf(mess,"  >= %f",rlim);
        def.AssignCat(mess);
       }
       if (RealLimit(Standard_True,  rlim)) {
-       sprintf(mess,"  <= %f",rlim);
+       Sprintf(mess,"  <= %f",rlim);
        def.AssignCat(mess);
       }
       if (theunidef.Length() > 0)
@@ -184,12 +184,12 @@ static Standard_Boolean StaticPath(const Handle(TCollection_HAsciiString)& val)
       def.AssignCat("Enum");
       Standard_Integer startcase, endcase; Standard_Boolean match;
       EnumDef (startcase,endcase,match);
-      sprintf(mess," [%s%d-%d]",(match ? "in " : ""),startcase,endcase);
+      Sprintf(mess," [%s%d-%d]",(match ? "in " : ""),startcase,endcase);
       def.AssignCat(mess);
       for (Standard_Integer i = startcase; i <= endcase; i ++) {
        Standard_CString enva = EnumVal(i);
        if (enva[0] == '?' || enva[0] == '\0') continue;
-       sprintf(mess," %d:%s",i,enva);
+       Sprintf(mess," %d:%s",i,enva);
        def.AssignCat (mess);
       }
       if (!theeadds.IsNull()) {
@@ -198,7 +198,7 @@ static Standard_Boolean StaticPath(const Handle(TCollection_HAsciiString)& val)
        for (listadd.Start(); listadd.More(); listadd.Next()) {
          Standard_CString enva = listadd.Name().ToCString();
          if (enva[0] == '?') continue;
-         sprintf(mess,":%d ",listadd.Value());
+         Sprintf(mess,":%d ",listadd.Value());
          def.AssignCat (enva);
          def.AssignCat (mess);
        }
@@ -216,7 +216,7 @@ static Standard_Boolean StaticPath(const Handle(TCollection_HAsciiString)& val)
     case MoniTool_ValueText    : {
       def.AssignCat("Text");
       if (themaxlen > 0) {
-       sprintf (mess," <= %d C.",themaxlen);
+       Sprintf (mess," <= %d C.",themaxlen);
        def.AssignCat (mess);
       }
       break;
@@ -280,9 +280,9 @@ static Standard_Boolean StaticPath(const Handle(TCollection_HAsciiString)& val)
   else if (init[0] == 'i' && init[2] == 'a')           // imax ival
     SetIntegerLimit (Standard_True ,atoi(&init[iblc]));
   else if (init[0] == 'r' && init[2] == 'i')           // rmin rval
-    SetRealLimit (Standard_False,atof(&init[iblc]));
+    SetRealLimit (Standard_False,Atof(&init[iblc]));
   else if (init[0] == 'r' && init[2] == 'a')           // rmax rval
-    SetRealLimit (Standard_True ,atof(&init[iblc]));
+    SetRealLimit (Standard_True ,Atof(&init[iblc]));
   else if (init[0] == 'u')                             // unit name
     SetUnitDef (&init[iblc]);
   else if (init[0] == 'e' && init[1] == 'm')           // ematch istart
index 8379d406710b29f754827ff4aabc871171839d18..28acd96926855525c3400262d802d13a8fa3b984 100755 (executable)
@@ -16,7 +16,6 @@ OSD_signal.cxx
 OSD_signal_WNT.cxx
 OSD_ThreadFunction.hxx
 OSD_PThread.hxx
-OSD_Localizer.cxx
 OSD_PerfMeter.cxx
 OSD_PerfMeter.h
 OSD_PerfMeter.hxx
index 7235c416ee55ffeffa1e3599fd1b9f1c201d9d51..5482440aebd553f7e67e83c083de8e8dc1dae038 100755 (executable)
@@ -176,13 +176,6 @@ is
          class Thread;
              ---Purpose: A tool to manage threads
 
-    class Real2String;
-             ---Purpose: Convertion of CString to Real and reciprocally
-
-    class Localizer;
-             ---Purpose: Manages locale.
-
-
     -----------------------------------------------
     --  UNIX specific exceptions and enumeration --
     -----------------------------------------------
index d7a8db373f22c43dd93517e5a4e03fda830ea855..26de1363b7d5f5a0e2d9addfa9b48be6d59455e3 100755 (executable)
 # define finite isfinite
 #endif
 
-static Standard_Integer DecimalPoint = 0 ;
-
-static void GetDecimalPoint() {
-  float F1 = (float ) 1.1 ;
-  char str[5] ;
-
-  sprintf(str,"%.1f",F1) ;
-                             //  printf("%s\n",str) ;
-  DecimalPoint = str[1] ;
-}
-
 // Convert Real to CString in format e with 16 significant digits.
 // The decimal point character is always a period.
 // The conversion is independant from current locale database
@@ -48,20 +37,9 @@ Standard_Boolean OSD::RealToCString(const Standard_Real aReal,
 {
   char *p, *q ;
   
-  // Get the local decimal point character 
-
-  if (!DecimalPoint)
-    GetDecimalPoint() ;
-
-  // Substitute it
-
-//  if (sprintf(aString,"%.15le",aReal)  <= 0)
-  if (sprintf(aString,"%.17e",aReal)  <= 0) //BUC60808
+  if (Sprintf(aString,"%.17e",aReal)  <= 0) //BUC60808
     return Standard_False ;
 
-  if ((p = strchr(aString,DecimalPoint)))
-    *p = '.' ;
-
   // Suppress "e+00" and unsignificant 0's 
 
   if ((p = strchr(aString,'e'))) {
@@ -83,25 +61,8 @@ Standard_Boolean OSD::RealToCString(const Standard_Real aReal,
 Standard_Boolean OSD::CStringToReal(const Standard_CString aString,
                                    Standard_Real& aReal)
 {
-  const char *p;
   char *endptr ;
-
-  // Get the local decimal point character 
-
-  if (!DecimalPoint)
-    GetDecimalPoint() ;
-
-  const char *str = aString;
-  char buff[1024];  
-  //if((p = strchr(aString,'.')))
-  if(DecimalPoint != '.' && (p = strchr(aString,'.'))&& ((p-aString) < 1000) )
-  {
-    strncpy(buff, aString, 1000);
-    buff[p-aString] = DecimalPoint ;
-    str = buff;
-  }
-  aReal = strtod(str,&endptr) ;
+  aReal = Strtod(aString, &endptr);
   if (*endptr)
     return Standard_False ;
   return Standard_True;
diff --git a/src/OSD/OSD_Localizer.cdl b/src/OSD/OSD_Localizer.cdl
deleted file mode 100755 (executable)
index 1f8c394..0000000
+++ /dev/null
@@ -1,60 +0,0 @@
--- Created on: 2010-08-27
--- Created by: Paul SUPRYATKIN
--- Copyright (c) 2010-2012 OPEN CASCADE SAS
---
--- The content of this file is subject to the Open CASCADE Technology Public
--- License Version 6.5 (the "License"). You may not use the content of this file
--- except in compliance with the License. Please obtain a copy of the License
--- at http://www.opencascade.org and read it completely before using this file.
---
--- The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
--- main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
---
--- The Original Code and all software distributed under the License is
--- distributed on an "AS IS" basis, without warranty of any kind, and the
--- Initial Developer hereby disclaims all such warranties, including without
--- limitation, any warranties of merchantability, fitness for a particular
--- purpose or non-infringement. Please see the License for the specific terms
--- and conditions governing the rights and limitations under the License.
-
-
-class Localizer from OSD 
-
-       ---Purpose:  Define the locale.
-
-is
- Create ( Category : Integer from Standard;
-          Locale   : CString from Standard);
-    ---Purpose: Set locale
-    ---Level: Public
-
- Restore( me: in out );
-    ---Purpose: Restore previously locale
-    ---Level: Public     
-
- SetLocale( me: in out;
-            Category : Integer from Standard;
-            Locale   : CString from Standard);
-    ---Purpose: Set locale
-    ---Level: Public
- Locale( me ) 
-   returns CString from Standard;
-    ---Purpose: Get locale
-    ---Level: Public
-
-
- Category( me ) 
-   returns Integer from Standard;
-    ---Purpose: Get Gategory
-    ---Level: Public
-
-
-fields
-
-   myLocale        : CString from Standard; 
-   myCategory      : Integer from Standard;    
-
-end Localizer from OSD;
-
-
diff --git a/src/OSD/OSD_Localizer.cxx b/src/OSD/OSD_Localizer.cxx
deleted file mode 100755 (executable)
index 37301dc..0000000
+++ /dev/null
@@ -1,54 +0,0 @@
-// Created on: 2010-08-27
-// Created by: Paul SUPRYATKIN
-// Copyright (c) 2010-2012 OPEN CASCADE SAS
-//
-// The content of this file is subject to the Open CASCADE Technology Public
-// License Version 6.5 (the "License"). You may not use the content of this file
-// except in compliance with the License. Please obtain a copy of the License
-// at http://www.opencascade.org and read it completely before using this file.
-//
-// The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
-// main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
-//
-// The Original Code and all software distributed under the License is
-// distributed on an "AS IS" basis, without warranty of any kind, and the
-// Initial Developer hereby disclaims all such warranties, including without
-// limitation, any warranties of merchantability, fitness for a particular
-// purpose or non-infringement. Please see the License for the specific terms
-// and conditions governing the rights and limitations under the License.
-
-
-#include <OSD_Localizer.hxx>
-#include <Standard.hxx>
-#include <locale.h>
-
-OSD_Localizer::OSD_Localizer(const Standard_Integer Category,const Standard_CString Locale )
-{
-  SetLocale( Category, Locale );
-}
-
-
-void OSD_Localizer::Restore()
-{
-  setlocale( myCategory, myLocale );
-}
-
-
-void OSD_Localizer::SetLocale(const Standard_Integer Category,const Standard_CString Locale )
-{
-  myLocale = setlocale( Category, 0 );
-  myCategory = Category;
-  setlocale( Category, Locale );
-}
-
-Standard_CString OSD_Localizer::Locale() const
-{
-  return myLocale;
-}
-
-Standard_Integer OSD_Localizer::Category() const
-{
-  return myCategory;
-}
-
-
diff --git a/src/OSD/OSD_Real2String.cdl b/src/OSD/OSD_Real2String.cdl
deleted file mode 100755 (executable)
index e15c688..0000000
+++ /dev/null
@@ -1,54 +0,0 @@
--- 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;
diff --git a/src/OSD/OSD_Real2String.cxx b/src/OSD/OSD_Real2String.cxx
deleted file mode 100755 (executable)
index 5b81c07..0000000
+++ /dev/null
@@ -1,124 +0,0 @@
-// 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;
-}
-
index 75a9b8fab295a58832df39e1aeb87b947c07616d..6b9b7387a3858987cb113e9b29e98c04f4ecf9f5 100755 (executable)
 // 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>
@@ -32,8 +29,6 @@
 #include <gl2ps.h>
 #endif
 
-#include <locale.h>
-
 /************************************************************************/
 /* Print Methods                                                        */
 /************************************************************************/
@@ -110,7 +105,7 @@ Standard_Boolean OpenGl_GraphicDriver::Export (const Standard_CString theFileNam
   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)
   {
@@ -139,7 +134,6 @@ Standard_Boolean OpenGl_GraphicDriver::Export (const Standard_CString theFileNam
       break;
   }
 
-  locate.Restore();
   return anErrCode == GL2PS_SUCCESS;
 #else
   return Standard_False;
index 617a138d3791095b9324c3bfec2f971e896d775c..54b899045d686267db1afea6abd5ced632c89e00 100755 (executable)
@@ -70,15 +70,10 @@ void PCDM_RetrievalDriver::RaiseIfUnknownTypes(const Handle(Storage_Schema)& aSc
 //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;
@@ -201,10 +196,6 @@ void PCDM_RetrievalDriver::Read(const TCollection_ExtendedString& theFileName,
 // 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);
 }
 
index 48707a987de47394e6a0c5c74cd21f5ebc6e9a5a..65b8b90444440b5162f030ef55b5ea387af33279 100755 (executable)
 
 
 
-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;
@@ -104,10 +98,6 @@ void PCDM_StorageDriver::Write(const Handle(CDM_Document)& aDocument, const TCol
   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());
 }
index f2fc6fdf1f991bf8c8f98deb3c64844de554f588..5e25c72dcdc93987e2fbf67301d1c259a9651081 100755 (executable)
@@ -402,7 +402,7 @@ Standard_Boolean PCollection_HAsciiString::IsRealValue () const
    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;
 }
index bd583951cd5a990515793a1e9fbb0eb3409432f7..343e0326d341dea827ab20b7b9c65e061ecb19d4 100755 (executable)
@@ -108,12 +108,12 @@ Standard_Boolean Poly_CoherentNode::RemoveTriangle
 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;
   }
 }
index 3f5101ef560750cc06b3f1975676bd429b5a812e..748912352993c58effacf1963d4809814aca82ec 100644 (file)
@@ -236,7 +236,7 @@ static Standard_Integer OCC145bug (Draw_Interpretor& di, Standard_Integer argc,
   }
 
   TCollection_AsciiString aFileName = argv[1];
-  Standard_Integer aMaxNbr = atoi(argv[2]);
+  Standard_Integer aMaxNbr = Draw::Atoi(argv[2]);
 
   BRep_Builder aBld;
   TopoDS_Shape aShape;
@@ -282,7 +282,7 @@ static Standard_Integer OCC73_SelectionMode (Draw_Interpretor& di, Standard_Inte
   //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 {
@@ -316,7 +316,7 @@ static Standard_Integer OCC10bug (Draw_Interpretor& di, Standard_Integer argc, c
   }
 
   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;
@@ -412,7 +412,7 @@ static Standard_Integer OCC74bug_set (Draw_Interpretor& di, Standard_Integer arg
   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";
index 15132d0cb504287f1592be10ed4916f2311abd77..1e3f220560f754adbedce2177730210f2746bc25 100755 (executable)
 // 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>
@@ -60,7 +59,7 @@ static Standard_Integer OCC426 (Draw_Interpretor& di, Standard_Integer argc, con
   }
   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)
@@ -231,12 +230,12 @@ static Standard_Integer OCC486(Draw_Interpretor& di, Standard_Integer argc, cons
       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);
@@ -306,8 +305,8 @@ static Standard_Integer OCC712 (Draw_Interpretor& di, Standard_Integer argc, con
   //      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;
@@ -466,7 +465,7 @@ static Standard_Integer OCC822_1 (Draw_Interpretor& di, Standard_Integer argc, c
   }
   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)
@@ -556,7 +555,7 @@ static Standard_Integer OCC822_2 (Draw_Interpretor& di,Standard_Integer argc, co
   }
   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)
@@ -623,7 +622,7 @@ static Standard_Integer OCC823 (Draw_Interpretor& di,Standard_Integer argc, cons
   }
   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)
@@ -691,7 +690,7 @@ static Standard_Integer OCC824 (Draw_Interpretor& di,Standard_Integer argc, cons
   }
   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)
@@ -760,7 +759,7 @@ static Standard_Integer OCC825 (Draw_Interpretor& di,Standard_Integer argc, cons
   }
   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)
@@ -866,7 +865,7 @@ static Standard_Integer OCC826 (Draw_Interpretor& di,Standard_Integer argc, cons
   }
   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)
@@ -945,7 +944,7 @@ static Standard_Integer OCC827 (Draw_Interpretor& di,Standard_Integer argc, cons
   }
   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)
index d1ed2872bd95d4eba628a6666e4e0503831f188f..fc2e9b6a4861983cf2e16623bdcfe831cac88d0e 100755 (executable)
@@ -23,6 +23,7 @@
 
 #include <QABugs.hxx>
 
+#include <Draw.hxx>
 #include <Draw_Interpretor.hxx>
 #include <DBRep.hxx>
 #include <DrawTrSurf.hxx>
@@ -164,7 +165,7 @@ static Standard_Integer  OCC128 (Draw_Interpretor& di, Standard_Integer /*argc*/
 //
 //    Standard_Integer aNum = -1;
 //
-//    if(atoi(argv[2])) {
+//    if(Draw::Atoi(argv[2])) {
 //      aNum = anAISCtx->OpenLocalContext();
 //    }
 //
@@ -274,7 +275,7 @@ static int BUC60610(Draw_Interpretor& di, Standard_Integer argc, const char ** a
     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);
     }
   }
@@ -304,7 +305,7 @@ static Standard_Integer BUC60661(Draw_Interpretor& di, Standard_Integer argc, co
 #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);
@@ -360,7 +361,7 @@ static int OCC105(Draw_Interpretor& di, Standard_Integer argc, const char ** arg
   }
 //  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;
@@ -445,10 +446,10 @@ static int pipe_OCC9 (Draw_Interpretor& di,
   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*/);
   }
@@ -530,7 +531,7 @@ Standard_Integer  OCC157(Draw_Interpretor& di,
     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()) {
@@ -897,13 +898,13 @@ Standard_Integer OCC299bug (Draw_Interpretor& di,
 
   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;
   }
@@ -914,14 +915,14 @@ Standard_Integer OCC299bug (Draw_Interpretor& di,
   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);
@@ -929,28 +930,28 @@ Standard_Integer OCC299bug (Draw_Interpretor& di,
   //
   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;
@@ -1006,7 +1007,7 @@ static Standard_Integer OCC277bug (Draw_Interpretor& di, Standard_Integer nb, co
   }
   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;
     }
@@ -1068,9 +1069,9 @@ static Standard_Integer OCC333bug (Draw_Interpretor& di, Standard_Integer n, con
   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)) {
@@ -1203,9 +1204,9 @@ static Standard_Integer OCC377 (Draw_Interpretor& di, Standard_Integer argc, con
 
     // 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;
@@ -1418,14 +1419,14 @@ static Standard_Integer OCC524 (Draw_Interpretor& di, Standard_Integer argc, con
     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);
@@ -1503,7 +1504,7 @@ static Standard_Integer OCC578 (Draw_Interpretor& di, Standard_Integer argc, con
   }
   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";
@@ -1769,10 +1770,10 @@ static Standard_Integer OCC867(Draw_Interpretor& di, Standard_Integer argc, cons
   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" ;
@@ -1899,7 +1900,7 @@ static Standard_Integer OCC1029_AISTransparency (Draw_Interpretor& di,
     Handle(TPrsStd_AISPresentation) prs;
     if(L.FindAttribute( TPrsStd_AISPresentation::GetID(), prs) ) {   
       if( nb == 4 ) {
-       prs->SetTransparency(atof(arg[3]));
+       prs->SetTransparency(Draw::Atof(arg[3]));
        TPrsStd_AISViewer::Update(L);
       }
       else {
@@ -1933,7 +1934,7 @@ static Standard_Integer OCC1030_AISColor (Draw_Interpretor& di,
     Handle(TPrsStd_AISPresentation) prs;
     if(L.FindAttribute( TPrsStd_AISPresentation::GetID(), prs) ) {   
       if( nb == 4 ) {
-       prs->SetColor((Quantity_NameOfColor)atoi(arg[3]));
+       prs->SetColor((Quantity_NameOfColor)Draw::Atoi(arg[3]));
        TPrsStd_AISViewer::Update(L);
       }
       else
@@ -1966,7 +1967,7 @@ static Standard_Integer OCC1031_AISMaterial (Draw_Interpretor& di,
     Handle(TPrsStd_AISPresentation) prs;
     if(L.FindAttribute( TPrsStd_AISPresentation::GetID(), prs) ) {   
       if( nb == 4 ) {
-       prs->SetMaterial((Graphic3d_NameOfMaterial)atoi(arg[3]));
+       prs->SetMaterial((Graphic3d_NameOfMaterial)Draw::Atoi(arg[3]));
        TPrsStd_AISViewer::Update(L);
       }
       else {
@@ -2000,7 +2001,7 @@ static Standard_Integer OCC1032_AISWidth (Draw_Interpretor& di,
     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 {
@@ -2034,7 +2035,7 @@ static Standard_Integer OCC1033_AISMode (Draw_Interpretor& di,
     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 {
@@ -2068,7 +2069,7 @@ static Standard_Integer OCC1034_AISSelectionMode (Draw_Interpretor& di,
     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 {
@@ -2099,7 +2100,7 @@ static Standard_Integer OCC1487 (Draw_Interpretor& di, Standard_Integer argc, co
   }
   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";
@@ -2107,7 +2108,7 @@ static Standard_Integer OCC1487 (Draw_Interpretor& di, Standard_Integer argc, co
     }
   }
 
-  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);
@@ -2306,7 +2307,7 @@ static Standard_Integer OCC5739_UniAbs (Draw_Interpretor& di, Standard_Integer a
     }
     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())
@@ -2322,7 +2323,7 @@ static Standard_Integer OCC5739_UniAbs (Draw_Interpretor& di, Standard_Integer a
       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<<" ";
     }
@@ -2340,8 +2341,8 @@ static Standard_Integer OCC6046 (Draw_Interpretor& di, Standard_Integer argc, co
     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];
 
@@ -2708,7 +2709,7 @@ static Standard_Integer OCC7141 (Draw_Interpretor& di, Standard_Integer argc, co
     }
 
   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-");
@@ -2868,8 +2869,8 @@ static Standard_Integer OCC10138 (Draw_Interpretor& di, Standard_Integer argc, c
     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");
@@ -3082,8 +3083,8 @@ static Standard_Integer OCC7639 (Draw_Interpretor& di, Standard_Integer argc, co
   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);
@@ -3210,7 +3211,7 @@ static Standard_Integer OCC11457 (Draw_Interpretor& di, Standard_Integer argc, c
   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();
@@ -3228,12 +3229,12 @@ static Standard_Integer OCC13963 (Draw_Interpretor& di, Standard_Integer argc, c
   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;
@@ -3256,7 +3257,7 @@ Standard_Integer OCC14376(Draw_Interpretor& di, Standard_Integer argc, const cha
 
   Standard_Real aDeflection = 0.45110277533;
   if (argc > 2) {
-    aDeflection = atof(argv[2]);
+    aDeflection = Draw::Atof(argv[2]);
   }
   di<<"deflection="<< aDeflection << "\n";
 
@@ -3282,7 +3283,7 @@ static Standard_Integer OCC15489 (Draw_Interpretor& di, Standard_Integer argc, c
   }
   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" ;
     }
@@ -4585,7 +4586,7 @@ static Standard_Integer OCC12584 (Draw_Interpretor& di, Standard_Integer argc, c
   Standard_Integer mode = 0;
   if (argc == 2)
   {
-    mode = atoi(argv[1]);
+    mode = Draw::Atoi(argv[1]);
   }
   if (mode > 2 || mode < 0)
   {
@@ -4689,7 +4690,7 @@ static Standard_Integer OCC18612igesbrep (Draw_Interpretor& di, Standard_Integer
 // 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
@@ -4724,7 +4725,7 @@ static Standard_Integer OCC18612igesbrep (Draw_Interpretor& di, Standard_Integer
         //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) {
@@ -4732,7 +4733,7 @@ static Standard_Integer OCC18612igesbrep (Draw_Interpretor& di, Standard_Integer
        // 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 {
@@ -4755,7 +4756,7 @@ static Standard_Integer OCC18612igesbrep (Draw_Interpretor& di, Standard_Integer
          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 {
@@ -4782,7 +4783,7 @@ static Standard_Integer OCC18612igesbrep (Draw_Interpretor& di, Standard_Integer
       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);
@@ -4820,7 +4821,7 @@ static Standard_Integer OCC18612igesbrep (Draw_Interpretor& di, Standard_Integer
         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
@@ -4868,7 +4869,7 @@ static Standard_Integer OCC18612igesbrep (Draw_Interpretor& di, Standard_Integer
           // 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) {
@@ -4895,7 +4896,7 @@ static Standard_Integer OCC18612igesbrep (Draw_Interpretor& di, Standard_Integer
            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);
@@ -4938,10 +4939,10 @@ static Standard_Integer OCC20766 (Draw_Interpretor& di, Standard_Integer argc, c
     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;
 
@@ -4959,7 +4960,7 @@ static Standard_Integer OCC20627 (Draw_Interpretor& di, Standard_Integer argc, c
       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++)
     {
@@ -4982,12 +4983,12 @@ Standard_Integer OCC22762 (Draw_Interpretor& di, Standard_Integer argc, const ch
            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);
@@ -5016,15 +5017,15 @@ Standard_Integer OCC17424 (Draw_Interpretor& di, Standard_Integer argc, const ch
     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());
@@ -5127,17 +5128,17 @@ Standard_Integer OCC22558 (Draw_Interpretor& di, Standard_Integer argc, const ch
        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);
@@ -5158,14 +5159,14 @@ Standard_Integer OCC22736 (Draw_Interpretor& di, Standard_Integer argc, const ch
     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;
 
@@ -5343,7 +5344,7 @@ Standard_Integer CR23234 (Draw_Interpretor& di, Standard_Integer argc, const cha
     return 1; //TCL_ERROR
   }
 
-  const Standard_Integer aMode = atoi(argv[1]);
+  const Standard_Integer aMode = Draw::Atoi(argv[1]);
 
   //===================================================================
 
index e06e6361141fa15fd92be2d71f9db4be69495274..e95b1e8c1d0f404a1ff026ac42a07c1f06264d7a 100755 (executable)
 // 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>
@@ -54,9 +53,9 @@ static Standard_Integer OCC895 (Draw_Interpretor& di, Standard_Integer argc, con
   }
 
   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.
   //
index 12179f48b48d88b183e9783bd4dc40313df0c8f1..29ed685cfaf9047f8517ea5c6866de5ed6077a30 100755 (executable)
 // 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>
@@ -74,11 +73,11 @@ static Standard_Integer OCC332bug (Draw_Interpretor& di, Standard_Integer argc,
   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)) {
@@ -203,20 +202,20 @@ static Standard_Integer OCC332bug (Draw_Interpretor& di, Standard_Integer argc,
   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");
@@ -292,7 +291,7 @@ static Standard_Integer OCC332bug (Draw_Interpretor& di, Standard_Integer argc,
   mkPipe1.MakeSolid();
   gasSolid = mkPipe1.Shape();
 
-  sprintf (name,"gasSolid_");
+  Sprintf (name,"gasSolid_");
   DBRep::Set(name,gasSolid);
 
   //getFaces.Clear();
@@ -313,7 +312,7 @@ static Standard_Integer OCC332bug (Draw_Interpretor& di, Standard_Integer argc,
   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.
@@ -385,7 +384,7 @@ static Standard_Integer OCC332bug (Draw_Interpretor& di, Standard_Integer argc,
   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();
@@ -415,7 +414,7 @@ static Standard_Integer OCC544 (Draw_Interpretor& di, Standard_Integer argc, con
   }
   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)
@@ -442,11 +441,11 @@ static Standard_Integer OCC544 (Draw_Interpretor& di, Standard_Integer argc, con
                    
 
   // 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)) {
@@ -538,19 +537,19 @@ static Standard_Integer OCC544 (Draw_Interpretor& di, Standard_Integer argc, con
   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");
@@ -559,10 +558,10 @@ static Standard_Integer OCC544 (Draw_Interpretor& di, Standard_Integer argc, con
 
   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
@@ -583,16 +582,16 @@ static Standard_Integer OCC544 (Draw_Interpretor& di, Standard_Integer argc, con
  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);
@@ -727,7 +726,7 @@ static Standard_Integer OCC544 (Draw_Interpretor& di, Standard_Integer argc, con
          {
            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();
@@ -736,7 +735,7 @@ static Standard_Integer OCC544 (Draw_Interpretor& di, Standard_Integer argc, con
     }
   }
 
-  sprintf(name,"result");
+  Sprintf(name,"result");
   DBRep::Set(name,wallSolid);
 
   // Now calculated the volume of the outside tube.
@@ -825,7 +824,7 @@ static Standard_Integer OCC817 (Draw_Interpretor& di, Standard_Integer argc, con
   }
   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)
@@ -840,7 +839,7 @@ static Standard_Integer OCC817 (Draw_Interpretor& di, Standard_Integer argc, con
   }
   
   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";
@@ -1050,7 +1049,7 @@ static Standard_Integer OCC817 (Draw_Interpretor& di, Standard_Integer argc, con
       if (err)
       {
         char astr[80];
-        sprintf(astr,"e_%d",l);
+        Sprintf(astr,"e_%d",l);
         DBRep::Set(astr,commonShape);
       }
     }
index 448917e63a8d0b989d2e7901742d9be162bcc58b..08e57ddde02814d1eb0f047b291b7b1bc63d46bd 100644 (file)
@@ -74,7 +74,7 @@ static Standard_Integer BUC60897 (Draw_Interpretor& di, Standard_Integer /*argc*
   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);
 
@@ -83,7 +83,7 @@ static Standard_Integer BUC60897 (Draw_Interpretor& di, Standard_Integer /*argc*
   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);
@@ -107,7 +107,7 @@ static Standard_Integer BUC60897 (Draw_Interpretor& di, Standard_Integer /*argc*
     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);
   }
@@ -137,7 +137,7 @@ static Standard_Integer BUC60889 (Draw_Interpretor& di, Standard_Integer argc, c
     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
@@ -159,7 +159,7 @@ static Standard_Integer BUC60852 (Draw_Interpretor& di, Standard_Integer argc, c
       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
@@ -278,11 +278,11 @@ static Standard_Integer BUC60870 (Draw_Interpretor& di, Standard_Integer argc, c
   }
   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 << " ";
@@ -294,9 +294,9 @@ static Standard_Integer BUC60870 (Draw_Interpretor& di, Standard_Integer argc, c
        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);
@@ -305,9 +305,9 @@ static Standard_Integer BUC60870 (Draw_Interpretor& di, Standard_Integer argc, c
        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);
@@ -573,7 +573,7 @@ static Standard_Integer BUC60924 (Draw_Interpretor& di, Standard_Integer argc, c
     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);
@@ -702,7 +702,7 @@ static Standard_Integer  OCC984 (Draw_Interpretor& di, Standard_Integer argc, co
   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)) {
@@ -728,7 +728,7 @@ static Standard_Integer OCC1786 (Draw_Interpretor& di, Standard_Integer argc, co
     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;
@@ -859,7 +859,7 @@ static Standard_Integer OCC1919_real (Draw_Interpretor& di, Standard_Integer arg
     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();
@@ -914,7 +914,7 @@ static Standard_Integer OCC2932_SetTag (Draw_Interpretor& di, Standard_Integer a
   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;
@@ -1001,12 +1001,12 @@ static Standard_Integer OCC6794 (Draw_Interpretor& di, Standard_Integer argc, co
   
   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";
 
index 618537101915360fd5d9875b7248bf77e8838835..2945bca2efe99424696f88bb7a206560214be75c 100755 (executable)
 // 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>
@@ -46,14 +45,14 @@ static Standard_Integer BUC60720 (Draw_Interpretor& di,Standard_Integer argc,con
     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();
index 350d3bc1944cd3b957e399792fa9437e3bb177e1..29246b5926c7f41587a0b5a94c26c8e1d4c77679 100755 (executable)
 // 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>
@@ -252,10 +251,10 @@ static Standard_Integer BUC60972 (Draw_Interpretor& di, Standard_Integer argc, c
   
   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;
@@ -535,7 +534,7 @@ static Standard_Integer OCC252 (Draw_Interpretor& di, Standard_Integer argc, con
   //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;
@@ -571,7 +570,7 @@ static Standard_Integer OCC307 (Draw_Interpretor& di, Standard_Integer argc, con
 
   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;
@@ -651,13 +650,13 @@ static Standard_Integer OCC394 (Draw_Interpretor& di, Standard_Integer argc, con
    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();
@@ -693,10 +692,10 @@ static Standard_Integer OCC301 (Draw_Interpretor& di, Standard_Integer argc, con
     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.);
@@ -757,10 +756,10 @@ static Standard_Integer OCC60 (Draw_Interpretor& di, Standard_Integer argc, cons
     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();
 
@@ -790,7 +789,7 @@ static Standard_Integer OCC70 (Draw_Interpretor& di, Standard_Integer argc, cons
   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;
   }
 
@@ -845,7 +844,7 @@ static Standard_Integer OCC904 (Draw_Interpretor& di, Standard_Integer argc, con
     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());
index 04b03479f7c188243a1b129ff10c8793b47e00c6..649e5a4e4484fc642950169f5c90ff957d1e7102 100755 (executable)
@@ -22,6 +22,7 @@
 
 #include <QABugs.hxx>
 
+#include <Draw.hxx>
 #include <Draw_Interpretor.hxx>
 #include <DBRep.hxx>
 #include <DrawTrSurf.hxx>
@@ -94,7 +95,7 @@ static Standard_Integer BUC60842 (Draw_Interpretor& di, Standard_Integer /*argc*
 
   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 = 
@@ -103,7 +104,7 @@ static Standard_Integer BUC60842 (Draw_Interpretor& di, Standard_Integer /*argc*
   }
 
   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 = 
@@ -117,7 +118,7 @@ static Standard_Integer BUC60842 (Draw_Interpretor& di, Standard_Integer /*argc*
   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()) {
@@ -139,11 +140,11 @@ static Standard_Integer BUC60843 (Draw_Interpretor& di, Standard_Integer argc,co
   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()) {
@@ -154,7 +155,7 @@ static Standard_Integer BUC60843 (Draw_Interpretor& di, Standard_Integer argc,co
   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);
@@ -431,13 +432,13 @@ static Standard_Integer BUC60821(Draw_Interpretor& di, Standard_Integer argc,con
     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;
@@ -507,7 +508,7 @@ static Standard_Integer OCC353 (Draw_Interpretor& di, Standard_Integer , const c
     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);
     }
@@ -535,14 +536,14 @@ static Standard_Integer OCC280 (Draw_Interpretor& di, Standard_Integer argc, con
     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);
   }
@@ -901,8 +902,8 @@ static Standard_Integer UPDATEVOL(Draw_Interpretor& di,
   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
@@ -1018,8 +1019,8 @@ static Standard_Integer OCC813 (Draw_Interpretor& di, Standard_Integer argc,cons
   }
 
   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:
 
@@ -1057,7 +1058,7 @@ static Standard_Integer OCC813 (Draw_Interpretor& di, Standard_Integer argc,cons
 
   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()) {
@@ -1128,7 +1129,7 @@ static Standard_Integer OCC814 (Draw_Interpretor& di, Standard_Integer argc,cons
 
   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()) {
@@ -1204,7 +1205,7 @@ static Standard_Integer OCC884 (Draw_Interpretor& di, Standard_Integer argc, con
   { 
     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);
   }
 
@@ -1212,8 +1213,8 @@ static Standard_Integer OCC884 (Draw_Interpretor& di, Standard_Integer argc, con
   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";
 
@@ -1443,9 +1444,9 @@ static Standard_Integer OCCN1 (Draw_Interpretor& di, Standard_Integer argc, cons
     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));
@@ -1499,7 +1500,7 @@ static Standard_Integer OCCN2 (Draw_Interpretor& di, Standard_Integer argc, cons
   }
   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)
@@ -1565,7 +1566,7 @@ static Standard_Integer OCC2569 (Draw_Interpretor& di, Standard_Integer argc, co
     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++) 
index 6fd759ab00f29136a2c2da393ef9e8378305df5b..16c7399a542b6db5d0ea986704dc8b653fe8e433 100755 (executable)
@@ -20,6 +20,7 @@
 
 #include <QABugs.hxx>
 
+#include <Draw.hxx>
 #include <Draw_Interpretor.hxx>
 #include <DBRep.hxx>
 #include <DrawTrSurf.hxx>
@@ -131,7 +132,7 @@ static Standard_Integer OCC181 (Draw_Interpretor& di, Standard_Integer argc, con
   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) {
@@ -180,11 +181,11 @@ static Standard_Integer OCC367 (Draw_Interpretor& di, Standard_Integer argc, con
   }
 
   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
index 637f31b6178fd61252af9e6801a0d81a883adc3b..001715e0e0b053ae1ee36cd4ae0976a97e1e1320 100755 (executable)
 // 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>
@@ -60,7 +59,7 @@ static Standard_Integer OCC527(Draw_Interpretor& di, Standard_Integer argc, cons
     }
     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)
@@ -76,13 +75,13 @@ static Standard_Integer OCC527(Draw_Interpretor& di, Standard_Integer argc, cons
 
     // 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 
@@ -150,15 +149,15 @@ static Standard_Integer OCC527(Draw_Interpretor& di, Standard_Integer argc, cons
 //       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)
index 6184282bc9fb290a2b142f721e357fd71197cc7c..0624b61dbae14756fc3928c1608bdad75eab4f30 100644 (file)
 #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)
 {
@@ -219,12 +220,12 @@ static int BUC60609(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;
@@ -335,7 +336,7 @@ static int BUC60585(Draw_Interpretor& di, Standard_Integer argc, const char ** a
   }
   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)
@@ -375,7 +376,7 @@ static int BUC60585(Draw_Interpretor& di, Standard_Integer argc, const char ** a
 #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);
@@ -497,24 +498,24 @@ static int BUC60547(Draw_Interpretor& di, Standard_Integer argc, const char ** a
  
   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 << " ";
   
@@ -540,14 +541,14 @@ static int BUC60547(Draw_Interpretor& di, Standard_Integer argc, const char ** a
   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); 
 
@@ -582,9 +583,9 @@ static Standard_Integer BUC60632(Draw_Interpretor& di, Standard_Integer /*n*/, c
   
   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;
 }
@@ -632,10 +633,10 @@ Standard_Integer ksection(Draw_Interpretor& di, Standard_Integer n, const char *
   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;
@@ -693,7 +694,7 @@ static Standard_Integer BUC60698(Draw_Interpretor& di, Standard_Integer argc, co
   }
   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)
@@ -819,7 +820,7 @@ static Standard_Integer GER61394(Draw_Interpretor& di, Standard_Integer argc, co
   }
   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();
@@ -899,9 +900,9 @@ switch (argc){
 //   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;
@@ -915,9 +916,9 @@ switch (argc){
 //  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);
@@ -944,16 +945,16 @@ static Standard_Integer BUC60726 (Draw_Interpretor& di,Standard_Integer argc, co
     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);
@@ -1065,7 +1066,7 @@ static Standard_Integer BUC60792(Draw_Interpretor& di, Standard_Integer /*argc*/
       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 ) 
@@ -1268,7 +1269,7 @@ static int OCC10006(Draw_Interpretor& di, Standard_Integer argc, const char ** a
   }
   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)
@@ -1398,7 +1399,7 @@ static Standard_Integer coordload (Draw_Interpretor& di, Standard_Integer argc,
   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(;;)
     {
@@ -1406,7 +1407,7 @@ static Standard_Integer coordload (Draw_Interpretor& di, Standard_Integer argc,
       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;
@@ -1444,7 +1445,7 @@ static Standard_Integer BUC60876_ (Draw_Interpretor& di,
   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;
 }
@@ -1477,7 +1478,7 @@ static int TestCMD(Draw_Interpretor& di, Standard_Integer argc, const char ** ar
   }
   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)
@@ -1670,7 +1671,7 @@ static Standard_Integer BUC60841(Draw_Interpretor& di, Standard_Integer argc, co
   }
   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)
@@ -2081,7 +2082,7 @@ static int AISWidth(Draw_Interpretor& di, Standard_Integer argc, const char ** a
     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 {
@@ -2148,7 +2149,7 @@ static Standard_Integer BUC60951_(Draw_Interpretor& di, Standard_Integer argc, c
   }
   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)
index 08977e54fa7da791ed28e0f31d4a20c35219a058..a6b9592738a931a0243b33aae0b6f0f2f95c419f 100755 (executable)
@@ -89,7 +89,7 @@ static int BUC60606(Draw_Interpretor& di, Standard_Integer argc, const char ** a
 //   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);
   
@@ -102,7 +102,7 @@ static int BUC60606(Draw_Interpretor& di, Standard_Integer argc, const char ** a
 //     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;
 //     }
index b4400685fa150fdf23af4def3f1c647bea5b8ab7..ce778d9347a97f6378ed04e41e7174eb1f8de8ea 100755 (executable)
@@ -83,7 +83,7 @@ static Standard_Integer OCC6001 (Draw_Interpretor& di, Standard_Integer argc, co
     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);
   }
 
index dfbe9b5b00a36413cf23e84bdd39f10f678ef61f..298887efacabd7cb6fde63f9280b1964ce5aea5a 100755 (executable)
 // 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>
@@ -47,9 +46,9 @@ static Standard_Integer OCC281bug (Draw_Interpretor& di, Standard_Integer argc,
   }
 
   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;
index 8c05282aae5a11c769b8770df8e6d04f1dd2da8a..7ccfefe6ed7ad99129353c4ffe3ab6a032723481 100755 (executable)
 // 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>
@@ -126,7 +125,7 @@ static Standard_Integer BUC60753 (Draw_Interpretor& di, Standard_Integer argc, c
   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 ();
@@ -194,7 +193,7 @@ static Standard_Integer  OCC204 (Draw_Interpretor& di, Standard_Integer argc, co
     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;
   }
@@ -245,8 +244,8 @@ static Standard_Integer OCC1651 (Draw_Interpretor& di, Standard_Integer argc, co
   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));
index b1f6646b28b3a75c77cf7583606197598cd3e3e5..5dfe86fdf29c5f9130cd459d56802e256fea3b2f 100755 (executable)
 // 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>
@@ -117,14 +116,14 @@ static Standard_Integer OCC137 (Draw_Interpretor& di, Standard_Integer argc, con
   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]));
         }
       }
     }
@@ -145,7 +144,7 @@ static Standard_Integer OCC137_z (Draw_Interpretor& di, Standard_Integer argc, c
     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;
 }
 
index f0c7ceb3dbd0942d2fb471bc633dc64034200c49..af2f76ed8b6668d824224625c1c434e12fc12c0d 100755 (executable)
@@ -191,7 +191,7 @@ static Standard_Integer QADNaming_CenterOfShape (Draw_Interpretor& di,
     }
     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;
     }
index fac177b2fd5d9a8a9d4f3d7d046d2e5060992e13..41ddd1425bf70cbd589aa39e62f8d0a53d324de7 100755 (executable)
@@ -86,7 +86,7 @@ static Standard_Integer Ascendants (Draw_Interpretor& di, Standard_Integer n, co
 
   Standard_Integer T;
 
-  if (n > 3) T = atoi(a[3]);
+  if (n > 3) T = Draw::Atoi(a[3]);
   else       T = ND->Transaction ();
 
   //TNaming_OldShapeIterator it (S, T, US);  
@@ -95,7 +95,7 @@ static Standard_Integer Ascendants (Draw_Interpretor& di, Standard_Integer n, co
   TCollection_AsciiString entry;
   for (;it.More (); it.Next ()) {
     S = it.Shape ();
-    sprintf (name,"%s_%s_%d",a[2],"old", i++);
+    Sprintf (name,"%s_%s_%d",a[2],"old", i++);
     DBRep::Set (name,it.Shape());
     TDF_Label Label = it.Label ();
     TDF_Tool::Entry(Label,entry);
@@ -127,7 +127,7 @@ static Standard_Integer Descendants (Draw_Interpretor& di, Standard_Integer n, c
 
   Standard_Integer T;
 
-  if (n > 3) T = atoi(a[3]);
+  if (n > 3) T = Draw::Atoi(a[3]);
   else       T = ND->Transaction ();
 
   TNaming_NewShapeIterator it (S, T, ND->Root());
@@ -135,7 +135,7 @@ static Standard_Integer Descendants (Draw_Interpretor& di, Standard_Integer n, c
   TCollection_AsciiString entry;
   for (;it.More (); it.Next ()) {
     S = it.Shape ();
-    sprintf (name,"%s_%s_%d",a[2],"new", i++);
+    Sprintf (name,"%s_%s_%d",a[2],"new", i++);
     DBRep::Set (name,it.Shape ());
     TDF_Label Label = it.Label ();
     TDF_Tool::Entry(Label,entry);
@@ -285,7 +285,7 @@ static Standard_Integer Exploreshape (Draw_Interpretor& di, Standard_Integer n,
 //  ND->Root().FindAttribute(TNaming_UsedShapes::GetID(),US);
   
   Standard_Integer Trans = ND->Transaction();
-  if (n == 5) { Trans = (Standard_Integer ) atof(a[4]);}
+  if (n == 5) { Trans = (Standard_Integer ) Draw::Atof(a[4]);}
   
   TDF_Label Lab;
   DDF::FindLabel(ND,a[2],Lab);
@@ -304,11 +304,11 @@ static Standard_Integer Exploreshape (Draw_Interpretor& di, Standard_Integer n,
   
   for (TNaming_Iterator itL(Lab,Trans) ; itL.More(); itL.Next()) {
     if (!itL.OldShape().IsNull()) {
-      sprintf(name,"%s%s_%d","old",a[3],NbShapes);
+      Sprintf(name,"%s%s_%d","old",a[3],NbShapes);
       DBRep::Set (name,itL.OldShape());
     }
     if (!itL.NewShape().IsNull()) {    
-      sprintf(name,"%s_%d",a[3],NbShapes);
+      Sprintf(name,"%s_%d",a[3],NbShapes);
       DBRep::Set (name,itL.NewShape());
     }
     NbShapes++;
@@ -393,7 +393,7 @@ static Standard_Integer Collect (Draw_Interpretor& di,
     if (!DDF::GetDF(arg[1],DF)) return 1;
     if (!DDF::Find(DF,arg[2],TNaming_NamedShape::GetID(),A)) return 1;
     if (nb >= 4) {
-      OnlyModif = atoi(arg[3]);
+      OnlyModif = Draw::Atoi(arg[3]);
     }
     TNaming_Tool::Collect(A,MNS,OnlyModif);
     for (TNaming_MapIteratorOfMapOfNamedShape it(MNS); it.More(); it.Next()) {
index 75c3977f073f9bfbe0e5518191a7781e25fd9d71..aad985277939f330ed973d185fb79d41b53b086d 100755 (executable)
@@ -76,7 +76,7 @@ static Standard_Integer BuildNamedShape (Draw_Interpretor& di,
     }
     
 //     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";
index 77e1aa373ea38d3d7b2c3ebdab6887d79a408826..785f9671020b7241f4ce94af74a7893359f556fa 100755 (executable)
@@ -75,7 +75,7 @@ static Standard_Integer GetNewShapes (Draw_Interpretor& di,
     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());
       }
     }
@@ -105,7 +105,7 @@ static Standard_Integer GetOldShapes (Draw_Interpretor& di,
     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());
       }
     }
index cca42fe43e83e30e99c9137b39753483886c9245..140c50893c3cbeea351f89da4e47f43f5c01a33a 100755 (executable)
@@ -160,7 +160,7 @@ static Standard_Integer QADNaming_SolveSelection (Draw_Interpretor& di, Standard
     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;
   }
index 5c26bd66d0d6e9005e697570b6e7344d33656a66..8a97930a806b441e43cb1d3999bce13ec15e16a9 100755 (executable)
@@ -35,6 +35,7 @@
 #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>
@@ -106,7 +107,7 @@ static Standard_Boolean shouldDUP() {
                                         "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;
   }
 
@@ -363,16 +364,16 @@ static Standard_Integer QAAISGetPixelColor (Draw_Interpretor& theDi,
   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;
@@ -495,9 +496,9 @@ static Standard_Integer QAAISGetColorCoord (Draw_Interpretor& di, Standard_Integ
   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;
@@ -524,8 +525,8 @@ static Standard_Integer QAAISGetColorCoord (Draw_Interpretor& di, Standard_Integ
     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);
   }
@@ -628,7 +629,7 @@ static int VTrihedronOrigins(Draw_Interpretor& di,
 
 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;
index b2ae67c17f32268ec99f202006f9189407f2c0aa..be35d79c274ef5dbd1e57527d9c841384524b146 100755 (executable)
 // 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);
 }
@@ -57,8 +56,8 @@ Standard_Integer CheckArguments1(Draw_Interpretor& di, Standard_Integer argc, co
     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;
@@ -76,10 +75,10 @@ Standard_Integer CheckArguments2(Draw_Interpretor& di, Standard_Integer argc, co
     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;
index 04b281b6d598420bffe0bda450c287f60cc9f24c..5d7ce9e5b04d4bd699ca1e44c4edc3405f6e6637 100755 (executable)
@@ -17,9 +17,9 @@
 // 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
@@ -45,8 +45,8 @@ Standard_Integer CheckArguments(Draw_Interpretor& di, Standard_Integer argc, con
     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;
index 64c16f41eca2d77a06d8729d2045bb844dfa1a72..a2c33fa3b0857b57a9c2056d2ba2310c5d28c9d0 100755 (executable)
@@ -189,14 +189,14 @@ static Standard_Integer QANewDBRepNaming_CheckNaming(Draw_Interpretor& di,Standa
 
 // ***
 
-  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;
@@ -266,7 +266,7 @@ static Standard_Integer QANewDBRepNaming_CheckNaming(Draw_Interpretor& di,Standa
       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;
@@ -338,7 +338,7 @@ static Standard_Integer QANewDBRepNaming_CheckSelectShape(Draw_Interpretor& di,
   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;
@@ -351,7 +351,7 @@ static Standard_Integer QANewDBRepNaming_CheckSelectShape(Draw_Interpretor& di,
     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 ";
index f4f00ca2a8a68173c3b64d4e618a36af244fc77b..fc704d06afa4ea4632b2e6135ff2da36ab7259bd 100755 (executable)
@@ -111,12 +111,12 @@ static Standard_Integer QANewDBRepNaming_NameBooleanOperationFeat (Draw_Interpre
   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: {
@@ -320,7 +320,7 @@ static Standard_Integer QANewDBRepNaming_NameLimit (Draw_Interpretor& di,
   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;
index 2c1aa58241f2a85ae93155e889c620200600aa84..04a0b0f1ac3e5dd66e04dbe0987b0038af713282 100755 (executable)
@@ -83,7 +83,7 @@ static Standard_Integer QANewDBRepNaming_NameBox (Draw_Interpretor& di,
     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()) {
@@ -112,10 +112,10 @@ static Standard_Integer QANewDBRepNaming_NameCylinder (Draw_Interpretor& di,
     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();
@@ -127,7 +127,7 @@ static Standard_Integer QANewDBRepNaming_NameCylinder (Draw_Interpretor& di,
 
     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;
@@ -148,15 +148,15 @@ static Standard_Integer QANewDBRepNaming_NameCylinder (Draw_Interpretor& di,
  {
    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);
@@ -196,7 +196,7 @@ static Standard_Integer QANewDBRepNaming_NamePrism (Draw_Interpretor& di,
   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;
@@ -205,7 +205,7 @@ static Standard_Integer QANewDBRepNaming_NamePrism (Draw_Interpretor& di,
   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;
@@ -222,7 +222,7 @@ static Standard_Integer QANewDBRepNaming_NamePrism (Draw_Interpretor& di,
       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()) {
@@ -295,7 +295,7 @@ static Standard_Integer QANewDBRepNaming_NameRevol (Draw_Interpretor& di,
   }
   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();
@@ -331,7 +331,7 @@ static Standard_Integer QANewDBRepNaming_NameFillet (Draw_Interpretor& di,
 
   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;
@@ -374,8 +374,8 @@ static Standard_Integer QANewDBRepNaming_NameChamfer (Draw_Interpretor& di,
   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;
index 403cf90eaa0251127d1cd7a20542d2d2b54550f0..d6276c22c3aedfe308c23b1232f7bae416d74a61 100755 (executable)
@@ -251,7 +251,7 @@ Standard_Boolean RWStl::WriteAscii (const Handle(StlMesh_Mesh)& theMesh,
         // 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"
@@ -411,7 +411,6 @@ Handle_StlMesh_Mesh RWStl::ReadAscii (const OSD_Path& thePath,
   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;
 
@@ -427,8 +426,6 @@ Handle_StlMesh_Mesh RWStl::ReadAscii (const OSD_Path& thePath,
   fclose(file);
   file = fopen(filename.ToCString(),"r");
 
-
-
   // count the number of lines
   for (ipos = 0; ipos < filesize; ++ipos) {
          if (getc(file) == '\n')
@@ -455,23 +452,33 @@ Handle_StlMesh_Mesh RWStl::ReadAscii (const OSD_Path& thePath,
   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");
@@ -488,5 +495,4 @@ Handle_StlMesh_Mesh RWStl::ReadAscii (const OSD_Path& thePath,
 #endif
   fclose(file);
   return ReadMesh;
-
 }
index a938ac4949ccb85cc0b7bc98932808ee920d02b1..bf45573d8826fd839c2a67f92f8ca02fc404389f 100755 (executable)
 
 #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>
@@ -162,9 +159,9 @@ static Standard_Integer NSPApply (Draw_Interpretor& di, Standard_Integer argc, c
     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
index 535c58dae2aad4ecc3546bda9ff5ddaff8a26042..25c3f42ed003f5d292e3667dba203de960c37c48 100755 (executable)
@@ -22,6 +22,7 @@
 
 #include <SWDRAW_ShapeAnalysis.ixx>
 #include <stdio.h>
+#include <Draw.hxx>
 #include <DBRep.hxx>
 #include <DrawTrSurf.hxx>
 #include <SWDRAW.hxx>
@@ -113,9 +114,9 @@ static Standard_Integer tolerance
     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) {
@@ -133,7 +134,7 @@ static Standard_Integer tolerance
     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));
     }
   }
@@ -152,10 +153,10 @@ static Standard_Integer projface
   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;
@@ -219,14 +220,14 @@ static Standard_Integer projcurve
     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";
 
@@ -477,42 +478,42 @@ static Standard_Integer XSHAPE_statshape(Draw_Interpretor& di, Standard_Integer
   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));
     }
   }
@@ -540,7 +541,7 @@ static Standard_Integer XSHAPE_comptoledge
   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];
     }
@@ -577,12 +578,12 @@ static Standard_Integer XSHAPE_comptoledge
           "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";
     }
@@ -593,7 +594,7 @@ static Standard_Integer XSHAPE_comptoledge
        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) {
@@ -622,10 +623,10 @@ static Standard_Integer freebounds (Draw_Interpretor& di,
   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)
@@ -635,11 +636,11 @@ static Standard_Integer freebounds (Draw_Interpretor& di,
 
   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";
 
@@ -662,7 +663,7 @@ static void PrintProps(Standard_Integer i,
   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";
 }
 
@@ -687,9 +688,9 @@ static Standard_Integer FreeBoundsProps(Draw_Interpretor& di,
 
   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);
@@ -724,10 +725,10 @@ static Standard_Integer FreeBoundsProps(Draw_Interpretor& di,
   }
 
   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;
@@ -744,10 +745,10 @@ static Standard_Integer closefreebounds (Draw_Interpretor& di,
   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)
@@ -757,11 +758,11 @@ static Standard_Integer closefreebounds (Draw_Interpretor& di,
 
   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";
 
@@ -783,7 +784,7 @@ static Standard_Integer MyVISEDG (Draw_Interpretor& /*di*/,
   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);
   //
@@ -798,7 +799,7 @@ static Standard_Integer MyVISEDG (Draw_Interpretor& /*di*/,
       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));
@@ -813,7 +814,7 @@ static Standard_Integer MyVISEDG (Draw_Interpretor& /*di*/,
       iwire = 0;
       while (S.More())
        {
-         sprintf (num,"%d",iwire);
+         Sprintf (num,"%d",iwire);
          name[0] = 'E';
          name[1] = '\0';
          strncat(name,num,strlen(num));
index 67ce5204d5b4ad149870fb11ecb47beb1c541163..a21fc04f994ccca68976a43aa08932790316f951 100755 (executable)
@@ -18,9 +18,9 @@
 // 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>
@@ -287,8 +287,8 @@ static Standard_Integer expshape(Draw_Interpretor& di, Standard_Integer argc, co
   }
   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)
@@ -407,7 +407,7 @@ static Standard_Integer scaleshape(Draw_Interpretor& di, Standard_Integer argc,
   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);
@@ -444,7 +444,7 @@ static Standard_Integer BSplRes(Draw_Interpretor& di, Standard_Integer argc, con
     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";
index 0d8ddf0019884ecbf7af5b57fc0bc42ed9c59ce7..a5051beedcc8e44acdd91362c7b7bc62f5725f43 100755 (executable)
@@ -18,9 +18,9 @@
 // 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>
@@ -125,10 +125,10 @@ static Standard_Integer settolerance (Draw_Interpretor& di, Standard_Integer arg
 
   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";
@@ -439,8 +439,8 @@ static Standard_Integer fixshape (Draw_Interpretor& di, Standard_Integer argc, c
         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++;
@@ -508,7 +508,7 @@ static Standard_Integer fixshape (Draw_Interpretor& di, Standard_Integer argc, c
     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);
     }
@@ -533,7 +533,7 @@ Standard_Integer fixgaps(Draw_Interpretor& di, Standard_Integer n, const char**
   }
 
   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());
@@ -558,7 +558,7 @@ Standard_Integer fixsmall(Draw_Interpretor& di, Standard_Integer n, const char**
     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);
   
@@ -588,13 +588,13 @@ static Standard_Integer fixsmalledges(Draw_Interpretor& di, Standard_Integer n,
   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;
@@ -642,9 +642,9 @@ static Standard_Integer checkoverlapedges(Draw_Interpretor& di, Standard_Integer
    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)) {
@@ -672,8 +672,8 @@ static Standard_Integer checkfclass2d(Draw_Interpretor& di, Standard_Integer n,
     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;
@@ -706,11 +706,11 @@ static Standard_Integer connectedges(Draw_Interpretor& di, Standard_Integer n, c
   }
   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;
index 3c7de48ab796a3ba1b52e2eaf3cdf723ab7b6133..fee64818f13f65e33a9156ffc87ba723e7f8365b 100755 (executable)
@@ -22,6 +22,7 @@
 // 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>
@@ -82,7 +83,7 @@ static Standard_Integer XSHAPE_edge
     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);
     }
@@ -139,11 +140,11 @@ static Standard_Integer XSHAPE_explorewire
   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));
     }
   }
@@ -207,7 +208,7 @@ static Standard_Integer XSHAPE_edgeregul
   }
   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 */;
@@ -234,10 +235,10 @@ static Standard_Integer samerange (Draw_Interpretor& di,  Standard_Integer argc,
     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,
index fc9f019c7a256998df1b66088b1280aaa2e36a94..9e0334aec6d2d4ca81c4826fc765625828e2fb9d 100755 (executable)
@@ -25,6 +25,7 @@
 #include <SWDRAW_ShapeUpgrade.ixx>
 //#include <SWDRAW_ShapeUpgrade.hxx>
 
+#include <Draw.hxx>
 #include <DBRep.hxx>
 #include <ShapeUpgrade.hxx>
 #include <ShapeUpgrade_SplitCurve3dContinuity.hxx>
@@ -124,7 +125,7 @@ static Standard_Integer DT_ShapeDivide (Draw_Interpretor& di,
     
   // tolerance is optional
   if (n==4) {
-    Standard_Real Tol=atof(a[3]);
+    Standard_Real Tol=Draw::Atof(a[3]);
     tool.SetTolerance(Tol);
   }
   
@@ -173,8 +174,8 @@ static Standard_Integer DT_ShapeConvertRev (Draw_Interpretor& di,
     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";}
@@ -240,7 +241,7 @@ static Standard_Integer DT_ShapeConvertRev (Draw_Interpretor& di,
     
     // tolerance is optional
     if (n==4) {
-      Standard_Real Tol=atof(a[n-1]);
+      Standard_Real Tol=Draw::Atof(a[n-1]);
       theTool.SetTolerance(Tol);
     }
 
@@ -275,7 +276,7 @@ static Standard_Integer DT_ShapeConvertRev (Draw_Interpretor& di,
   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);
 
@@ -323,8 +324,8 @@ static Standard_Integer DT_ShapeConvertRev (Draw_Interpretor& di,
        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;
@@ -411,8 +412,8 @@ static Standard_Integer DT_ShapeConvert (Draw_Interpretor& di,
     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);
@@ -464,7 +465,7 @@ static Standard_Integer DT_SplitAngle(Draw_Interpretor& di,
   
   Standard_Real maxangle = 95;
   if ( n >3 ) {
-    maxangle = atof ( a[3] );
+    maxangle = Draw::Atof ( a[3] );
     if ( maxangle <1 ) maxangle = 1;
   }
   
@@ -518,7 +519,7 @@ static Standard_Integer DT_PlaneDividedFace (Draw_Interpretor& di,
     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()) {
@@ -564,8 +565,8 @@ static Standard_Integer DT_PlaneGridShell (Draw_Interpretor& di,
   // 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;
@@ -575,13 +576,13 @@ static Standard_Integer DT_PlaneGridShell (Draw_Interpretor& di,
   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);
 
@@ -652,10 +653,10 @@ static Standard_Integer DT_SplitCurve (Draw_Interpretor& di,
     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);
@@ -670,7 +671,7 @@ static Standard_Integer DT_SplitCurve (Draw_Interpretor& di,
   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);
@@ -697,10 +698,10 @@ static Standard_Integer DT_SplitCurve2d (Draw_Interpretor& di,
     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);
@@ -715,7 +716,7 @@ static Standard_Integer DT_SplitCurve2d (Draw_Interpretor& di,
   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);
@@ -755,7 +756,7 @@ static Standard_Integer DT_SplitWire (Draw_Interpretor& di,
   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);
@@ -782,7 +783,7 @@ static Standard_Integer DT_SplitFace (Draw_Interpretor& di,
   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);
   }
   
@@ -839,8 +840,8 @@ static Standard_Integer DT_SplitSurface (Draw_Interpretor& di,
 
   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]);
@@ -848,8 +849,8 @@ static Standard_Integer DT_SplitSurface (Draw_Interpretor& di,
   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);
@@ -902,7 +903,7 @@ di << "transfert resultat" << "\n";
   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);
@@ -955,7 +956,7 @@ di << "transfert resultat" << "\n";
     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();
@@ -981,7 +982,7 @@ static Standard_Integer DT_Debug (Draw_Interpretor& di,
     return 1;
   }
 
-  if (atoi(a[1])==1) {
+  if (Draw::Atoi(a[1])==1) {
     di << "Activation of debug messages"<<"\n";
     ShapeUpgrade::SetDebug(Standard_True);
   }
@@ -1090,7 +1091,7 @@ static Standard_Integer offset2dcurve
   }
 //  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);
@@ -1113,7 +1114,7 @@ static Standard_Integer offsetcurve
   }
 //  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;
@@ -1174,7 +1175,7 @@ static Standard_Integer splitface
     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";
@@ -1339,12 +1340,12 @@ static Standard_Integer splitarea (Draw_Interpretor& di,
     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;
@@ -1364,7 +1365,7 @@ static Standard_Integer removeinternalwires (Draw_Interpretor& di,
     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";
@@ -1394,7 +1395,7 @@ static Standard_Integer removeinternalwires (Draw_Interpretor& di,
       }
     }
     if(!isShape) 
-      aModeRemoveFaces = (atoi(argv[k]) == 1);
+      aModeRemoveFaces = (Draw::Atoi(argv[k]) == 1);
   }
   
   aTool->MinArea() = aMinArea;
@@ -1475,9 +1476,9 @@ static Standard_Integer copytranslate(Draw_Interpretor& di,
   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);
index 39b374a7ffbe7065660ecb095148682a083019a9..4738b3c5ddef2f168f8407073dfc3c6fe4294286 100755 (executable)
@@ -21,6 +21,8 @@ Standard_Boolean.cxx
 Standard_Boolean.hxx
 Standard_Byte.hxx
 Standard_PByte.hxx
+Standard_CLocaleSentry.hxx
+Standard_CLocaleSentry.cxx
 Standard_CString.cxx
 Standard_CString.hxx
 Standard_Character.cxx
index 9341a9418e9fb1eea43a549b41a48abe04e3dd3b..47bb1bfd587c99c0ce77830e9b0d3287497b2120 100755 (executable)
@@ -29,8 +29,9 @@
 #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
@@ -63,12 +64,23 @@ class Standard_MMgrFactory {
 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)
diff --git a/src/Standard/Standard_CLocaleSentry.cxx b/src/Standard/Standard_CLocaleSentry.cxx
new file mode 100644 (file)
index 0000000..a3a6e60
--- /dev/null
@@ -0,0 +1,128 @@
+// 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
+}
diff --git a/src/Standard/Standard_CLocaleSentry.hxx b/src/Standard/Standard_CLocaleSentry.hxx
new file mode 100644 (file)
index 0000000..140fc36
--- /dev/null
@@ -0,0 +1,88 @@
+// 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__
index 7f6fdc7fb0e08229a05cf6661576a743c81407e4..8ee527d9e3ae8af289f871ecd0078b7083cedfa2 100755 (executable)
@@ -1,5 +1,5 @@
 // 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
@@ -30,9 +30,9 @@
 # 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
@@ -51,13 +51,14 @@ static const Standard_Integer static_MaskEndIntegerString[4] = { 0x00000000 ,
 
 #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;
@@ -72,7 +73,7 @@ Standard_EXPORT void ShallowDump (const Standard_CString Value, Standard_OStream
 //============================================================================
 //==== 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 ;
@@ -113,7 +114,7 @@ Standard_Integer HashCodes (const Standard_CString Value ,
                   *tmphash;
  char              tabchar[20];
 #endif
-  
+
  if (Value != NULL) {
 
 #if !OptJr
@@ -124,7 +125,7 @@ Standard_Integer HashCodes (const Standard_CString Value ,
            else tabchar[count] = charPtr[pos + count];
            i++;
         }
-        tmphash = (Standard_Integer *)tabchar;   
+        tmphash = (Standard_Integer *)tabchar;
         aHashCode = aHashCode ^ *tmphash;
       }
  }
@@ -256,4 +257,67 @@ Standard_Boolean ISSIMILAR(const Standard_CString One ,
   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;
+}
old mode 100755 (executable)
new mode 100644 (file)
index e6fef5d..acd19bf
@@ -19,7 +19,7 @@
 //============================================================================
 //==== 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>
@@ -79,6 +80,13 @@ inline Standard_Integer HASHCODE (const Standard_CString,
 __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
 //============================================================================
@@ -92,7 +100,7 @@ inline Standard_CString ShallowCopy (const Standard_CString Value)
 //============================================================================
 inline Standard_Boolean IsSimilar(const Standard_CString One
                                 ,const Standard_CString Two)
-{ 
+{
   return (strcmp(One,Two) == 0);
 }
 
@@ -101,7 +109,7 @@ inline Standard_Boolean IsSimilar(const Standard_CString One
 //====                              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 )
 {
@@ -127,7 +135,7 @@ inline Standard_Integer HashCode (const Standard_CString Value,
 //====                               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 )
 {
@@ -140,7 +148,7 @@ inline Standard_Integer HASHCODE (const Standard_CString Value,
 //==== 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 ;
@@ -159,7 +167,7 @@ inline Standard_Boolean ISEQUAL(const Standard_CString One ,
                                 const Standard_Integer LenOne ,
                                 const Standard_CString Two,
                                 const Standard_Integer LenTwo )
-{ 
+{
 
  if ( One == Two )
    return Standard_True ;
index c7e7401b85f669a8046fde7c6de090dedebecd07..dc30cc7ee6bb962da6e4b74f16bbd0b6f451d859 100755 (executable)
@@ -114,8 +114,8 @@ IFSelect_ReturnStatus  StepSelect_Activator::Do
       }
       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;
index 5b888acc8a5324c2fbe1034bc0ff9e36609d76da..f68097e803081ab0935e22d14d35f55ba35b4b94 100755 (executable)
@@ -36,9 +36,9 @@ StepSelect_FloatFormat::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.;
@@ -90,7 +90,7 @@ StepSelect_FloatFormat::StepSelect_FloatFormat ()
   lab.AssignCat (themainform);
   if (theformrange.Length() > 0) {
     char mess[30];
-    sprintf(mess,", in range %f %f %s",
+    Sprintf(mess,", in range %f %f %s",
            therangemin,therangemax,theformrange.ToCString());
     lab.AssignCat(mess);
   }
index d5d6e673574b6c879e67c40704e76b1872202eea..7436a45d64da68e35bc189a922af01b14b38f56e 100755 (executable)
@@ -1548,20 +1548,10 @@ Handle(Storage_Data)& Storage_Schema::ICurrentData()
 
 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);
@@ -1570,11 +1560,6 @@ TCollection_AsciiString Storage_Schema::ICreationDate()
     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;
 }
 
index 43d949d3e6c06388f7291c5268c6772c8eadf90c..29374177da45d709faf939c5fbe53910f04900d4 100755 (executable)
@@ -160,7 +160,7 @@ TCollection_AsciiString::TCollection_AsciiString(const Standard_Integer aValue)
 
   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
@@ -184,7 +184,7 @@ TCollection_AsciiString::TCollection_AsciiString(const Standard_Real aValue)
 
   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
@@ -1023,11 +1023,7 @@ Standard_Boolean TCollection_AsciiString::IsRealValue()const
 {
   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; 
   }
@@ -1161,7 +1157,7 @@ Standard_Real TCollection_AsciiString::RealValue()const
   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");
index 7b0dfa3dee1c07fc87474fd84a17d82c1507fff3..d9a70d845e2a5fb7caa0521bfa1dc821b82f0933 100755 (executable)
@@ -257,7 +257,7 @@ TCollection_ExtendedString::TCollection_ExtendedString
 {
   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
@@ -276,7 +276,7 @@ TCollection_ExtendedString::TCollection_ExtendedString
 {
   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
index 35baacaedbdbfceb339e0efec8b809c5efa2d10f..5d175694ee2239b6080f6348b2656bf3238ef701 100755 (executable)
@@ -318,14 +318,14 @@ static Standard_Integer setVal (Draw_Interpretor& di, Standard_Integer argc, con
   }
   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;
 }
index d719796d2d19984e1ff55ab28adfc077d1a3764f..935699eefbb78b61224f22f3206120a4f5ff656c 100755 (executable)
@@ -169,7 +169,7 @@ Standard_Integer TestTopOpe_BOOP::FindShape(const TCollection_AsciiString& name)
   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) { 
index b06745257df25b6c56b96430e8ebb190891417ee..3106068036eb6534c24325f9a3d88a6f83a9af1d 100755 (executable)
@@ -29,6 +29,7 @@
 #include <TopoDS.hxx>
 #include <TopExp_Explorer.hxx>
 #include <TColStd_HArray1OfBoolean.hxx>
+#include <Draw.hxx>
 #include <DBRep.hxx>
 #ifdef HAVE_STRINGS_H
 # include <strings.h>
@@ -99,18 +100,18 @@ Standard_Integer TOPOC(Draw_Interpretor& interpretor,Standard_Integer na,const c
            }
            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]));
        }
       }
     }
@@ -142,18 +143,18 @@ Standard_Integer TOPOC(Draw_Interpretor& interpretor,Standard_Integer na,const c
            }
            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]));
        }
       }
     }
@@ -186,7 +187,7 @@ Standard_Integer TOPOC(Draw_Interpretor& interpretor,Standard_Integer na,const c
       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);
@@ -327,7 +328,7 @@ Standard_Integer BOOPCHK(Draw_Interpretor& ,Standard_Integer na,const char** a)
 #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;
   }
@@ -345,21 +346,21 @@ Standard_Integer TOPOSETCOMMANDS(TestTopOpe_BOOP& PT,Standard_Integer na,const c
     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;
@@ -431,7 +432,7 @@ Standard_Integer VARSTOPOARGS(TestTopOpe_BOOP& PT,Standard_Integer& na,const cha
     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);
       }
@@ -441,7 +442,7 @@ Standard_Integer VARSTOPOARGS(TestTopOpe_BOOP& PT,Standard_Integer& na,const cha
          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);
        }
       }
@@ -449,7 +450,7 @@ Standard_Integer VARSTOPOARGS(TestTopOpe_BOOP& PT,Standard_Integer& na,const cha
     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);
       }
@@ -459,7 +460,7 @@ Standard_Integer VARSTOPOARGS(TestTopOpe_BOOP& PT,Standard_Integer& na,const cha
          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);
        }
       }
@@ -467,7 +468,7 @@ Standard_Integer VARSTOPOARGS(TestTopOpe_BOOP& PT,Standard_Integer& na,const cha
     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);
@@ -483,7 +484,7 @@ Standard_Integer VARSTOPOARGS(TestTopOpe_BOOP& PT,Standard_Integer& na,const cha
     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);
@@ -491,7 +492,7 @@ Standard_Integer VARSTOPOARGS(TestTopOpe_BOOP& PT,Standard_Integer& na,const cha
     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);
index b77d2f0b1f70631714cc77a716788a13570333f7..8f02967132178e60f5476048a2122c55145a27d1 100755 (executable)
@@ -67,6 +67,7 @@
 #include <TopOpeBRepTool_ShapeClassifier.hxx>
 #include <TopOpeBRepDS_EXPORT.hxx>
 
+#include <Draw.hxx>
 #include <Draw_Interpretor.hxx>
 #include <DrawTrSurf.hxx>
 #include <Draw_Color.hxx>
@@ -575,7 +576,7 @@ void FUN_mkBnd2dBREP(const TopoDS_Shape& W, const TopoDS_Shape& F,Bnd_Box2d& B2d
 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;
@@ -643,7 +644,7 @@ static Standard_Integer classifBnd2d(Draw_Interpretor& di, Standard_Integer n, c
 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);
@@ -655,7 +656,7 @@ static Standard_Integer pntonc(Draw_Interpretor& di, Standard_Integer n, const c
 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]);
@@ -701,7 +702,7 @@ static Standard_Integer solidclassifier(Draw_Interpretor& di, Standard_Integer n
   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;
@@ -725,7 +726,7 @@ static Standard_Integer class3dclassifier(Draw_Interpretor& di, Standard_Integer
   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;
@@ -783,7 +784,7 @@ static Standard_Integer normal(Draw_Interpretor& di, Standard_Integer n, const c
   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;}
@@ -805,9 +806,9 @@ static Standard_Integer curvature(Draw_Interpretor& di, Standard_Integer n, cons
   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);
index 48a4b03ea45870d72eb801d932b3522c8ed662e6..37834ccfb61a988a7850c1a1ae590431ce95abc4 100755 (executable)
@@ -165,7 +165,7 @@ void tsee_entity::Delete()
 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;
   
@@ -649,7 +649,7 @@ static void tsee_flags(Standard_Integer& na,const char** a) {
     }
     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;
       }
@@ -788,7 +788,7 @@ Standard_Integer tsee_SeeShapefunc(Draw_Interpretor& di,Standard_Integer na_in,c
   
   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());
@@ -809,7 +809,7 @@ Standard_Integer tsee_SeeShapefunc(Draw_Interpretor& di,Standard_Integer na_in,c
        }
        else {
          for (ia = i1arg+1; ia < na; ia++) { 
-           is = atoi(a[ia]);
+           is = Draw::Atoi(a[ia]);
            (*SeeShapefunc)(is,GetShape(is,Tpar.TS()));
          }
        }
@@ -817,7 +817,7 @@ Standard_Integer tsee_SeeShapefunc(Draw_Interpretor& di,Standard_Integer na_in,c
       }
       else {
        for (ia = i1arg+1; ia < na; ia++) { 
-         is = atoi(a[ia]);
+         is = Draw::Atoi(a[ia]);
          (*SeeShapefunc)(is,GetShape(is,Tpar.TS()));
        }
       }
@@ -826,9 +826,9 @@ Standard_Integer tsee_SeeShapefunc(Draw_Interpretor& di,Standard_Integer na_in,c
   
   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() ) {
@@ -841,14 +841,14 @@ Standard_Integer tsee_SeeShapefunc(Draw_Interpretor& di,Standard_Integer na_in,c
   
   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));
       }
     }
@@ -857,7 +857,7 @@ Standard_Integer tsee_SeeShapefunc(Draw_Interpretor& di,Standard_Integer na_in,c
   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()) {      
@@ -1173,7 +1173,7 @@ Standard_Integer tds(Draw_Interpretor& di,Standard_Integer na,const char** a)
     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
@@ -1183,7 +1183,7 @@ Standard_Integer tds(Draw_Interpretor& di,Standard_Integer na,const char** a)
       }
     }
     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 {
@@ -1216,8 +1216,8 @@ Standard_Integer TPPE(Draw_Interpretor& di,Standard_Integer na,const char** a)
   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";
@@ -1371,7 +1371,7 @@ Standard_Integer tcx(Draw_Interpretor& di,Standard_Integer na,const char** a)
   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;
@@ -1396,11 +1396,11 @@ Standard_Integer tdsri(Draw_Interpretor& di,Standard_Integer na_in,const char**
   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);
@@ -1413,7 +1413,7 @@ Standard_Integer tdsri(Draw_Interpretor& di,Standard_Integer na_in,const char**
     }
   }
   else if ( Tpar.isgeom() ) { 
-    ig = atoi(a[i1arg + 1]);
+    ig = Draw::Atoi(a[i1arg + 1]);
   }
   return 0;
 } // tdsri
index 7ba87830722add357b9e3cc290ce20fe44d5eba5..32909a9d225b39a890f0c8e9ed54873533c92915 100755 (executable)
@@ -132,7 +132,7 @@ Standard_Integer Mes(Draw_Interpretor& di,Standard_Integer na, const char** a)
     }
     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;
@@ -146,7 +146,7 @@ Standard_Integer Mes(Draw_Interpretor& di,Standard_Integer na, const char** a)
         (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);
@@ -156,7 +156,7 @@ Standard_Integer Mes(Draw_Interpretor& di,Standard_Integer na, const char** a)
          (*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);
        }
       
@@ -199,8 +199,8 @@ Standard_Integer Mes(Draw_Interpretor& di,Standard_Integer na, const char** a)
     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;
@@ -234,7 +234,7 @@ Standard_Integer Mes(Draw_Interpretor& di,Standard_Integer na, const char** a)
   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);
index 4ebb12b5582aae7f506f870a9dd52c406fed003b..2c1490d5f9f4f934e4c6c0a46ff70dbd63c7b161 100755 (executable)
@@ -237,15 +237,15 @@ Standard_Integer GRILLE(Draw_Interpretor& di, Standard_Integer narg, const char*
   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;
index 5e23afd9c915ec670e00cc60a5cf62f70eaf3370..ecf06faa6817427761e13ea1fd10387fd3d543aa 100755 (executable)
@@ -43,7 +43,7 @@
 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;
 }
 
@@ -102,13 +102,13 @@ void OthersCommands_flags(Standard_Integer& na,const char** a,TestTopOpeDraw_Dis
            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++;
          }
        }
@@ -229,8 +229,8 @@ static void BoopReadInitFile(Draw_Interpretor& di, const char* filename)
 
 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;
 }
@@ -325,7 +325,7 @@ public:
     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;
@@ -508,16 +508,16 @@ Standard_Integer cvx2d::displayedge(const TopoDS_Shape& S) {
   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();
 
@@ -567,7 +567,7 @@ Standard_Integer vx2d(Draw_Interpretor& di, Standard_Integer na, const char** a)
   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) {
@@ -585,7 +585,7 @@ Standard_Integer vx2d(Draw_Interpretor& di, Standard_Integer na, const char** a)
   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++) {
index fed9bc0086094b8e4d5833a004cc2eeb5f9de629..5be2c38d4654af774e5f6a775e064bfd5a33495d 100755 (executable)
@@ -255,7 +255,7 @@ Standard_EXPORT Standard_Integer TestTopOpeTools_SetFlags
   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 ) {
index 0ef930d20e2edb24270e8f20e948591d05e6b5f1..85e40edb1aed7949cd30158e5ddae9805705b63a 100755 (executable)
@@ -89,10 +89,10 @@ void TopOpeBRep_ALWL::Set(const Standard_Boolean b,
     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]));
index 898c660ac4686de9eb801a942c81d90fe4b5a0a1..1c30e111648df8d4c753a4b3fb9b3887d41f8c2a 100755 (executable)
@@ -296,7 +296,8 @@ void TopOpeBRepBuild_Builder::GdumpEDG(const TopoDS_Shape& E,
   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();
@@ -307,7 +308,9 @@ void TopOpeBRepBuild_Builder::GdumpEDG(const TopoDS_Shape& E,
     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();
index ce66b94709f82af38243a9fefbcbead99afbb84a..590dc19fb2bbd80146e508968f2f3231f016c6df 100755 (executable)
@@ -448,16 +448,10 @@ void  TopTools_ShapeSet::Dump(Standard_OStream& OS)const
 
 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
@@ -470,14 +464,6 @@ void  TopTools_ShapeSet::Write(Standard_OStream& OS)
   // 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);
@@ -487,12 +473,9 @@ void  TopTools_ShapeSet::Write(Standard_OStream& OS)
     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;
   }
 
@@ -515,7 +498,6 @@ void  TopTools_ShapeSet::Write(Standard_OStream& OS)
   Standard_Integer i, nbShapes = myShapes.Extent();
   
   OS << "\nTShapes " << nbShapes << "\n";
-  
 
   // subshapes are written first
   //OCC19559
@@ -566,15 +548,15 @@ void  TopTools_ShapeSet::Write(Standard_OStream& OS)
   
   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;
 }
 
 //=======================================================================
@@ -624,11 +606,8 @@ static TopAbs_ShapeEnum ReadShapeEnum(Standard_IStream& IS)
 
 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();
 
@@ -648,9 +627,7 @@ void  TopTools_ShapeSet::Read(Standard_IStream& IS)
   } 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);
@@ -664,8 +641,7 @@ void  TopTools_ShapeSet::Read(Standard_IStream& IS)
   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() ) 
@@ -680,8 +656,7 @@ void  TopTools_ShapeSet::Read(Standard_IStream& IS)
   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;
   }
 
@@ -705,8 +680,7 @@ void  TopTools_ShapeSet::Read(Standard_IStream& IS)
   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;
   }
 
@@ -764,8 +738,7 @@ void  TopTools_ShapeSet::Read(Standard_IStream& IS)
   }
 
   // on remet le LC_NUMERIC a la precedente valeur
-  setlocale(LC_NUMERIC, oldnum) ;
-  delete[] oldnum;
+  IS.imbue (anOldLocale);
 }
 
 //=======================================================================
index 53c2e0d7e8a52b6b853737614b2488db5f87dda6..f80220016c0cd951c81beca5ef695d1eea1aeed5 100755 (executable)
 #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  : 
index c5f70b7f535878a537b234e5eb5d73d1b5e40a9b..47980f3f3c30028ad0632202ce505a0fc7f7ed17 100755 (executable)
@@ -677,18 +677,18 @@ static int VSelPrecision(Draw_Interpretor& di, Standard_Integer argc, const char
   }
   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 );
       }
     }
@@ -727,8 +727,8 @@ static Standard_Integer VDump (Draw_Interpretor& di, Standard_Integer argc, cons
     }
   }
 
-  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;
@@ -855,7 +855,7 @@ static int VDispMode (Draw_Interpretor& , Standard_Integer argc, const char** ar
     }
   }
   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);
@@ -878,7 +878,7 @@ static int VDispMode (Draw_Interpretor& , Standard_Integer argc, const char** ar
     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;
 }
@@ -891,7 +891,7 @@ static int VDispMode (Draw_Interpretor& , Standard_Integer argc, const char** ar
 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){
@@ -1095,14 +1095,14 @@ static int VTransparency  (Draw_Interpretor& di, Standard_Integer argc,
         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();
       }
@@ -1118,7 +1118,7 @@ static int VTransparency  (Draw_Interpretor& di, Standard_Integer argc,
       {
         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);
       }
@@ -1136,7 +1136,7 @@ static int VTransparency  (Draw_Interpretor& di, Standard_Integer argc,
           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();
@@ -1281,14 +1281,14 @@ static int VWidth (Draw_Interpretor& di, Standard_Integer argc, const char** arg
         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]) );
       }
     }
 
@@ -1303,7 +1303,7 @@ static int VWidth (Draw_Interpretor& di, Standard_Integer argc, const char** arg
       {
         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);
       }
@@ -1320,7 +1320,7 @@ static int VWidth (Draw_Interpretor& di, Standard_Integer argc, const char** arg
          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();
@@ -1387,7 +1387,7 @@ static int VInteriorStyle (Draw_Interpretor& di, Standard_Integer argc, const ch
       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);
       }
     }
     //=======================================================================
@@ -1400,7 +1400,7 @@ static int VInteriorStyle (Draw_Interpretor& di, Standard_Integer argc, const ch
            TheAISContext() ->NextCurrent() )
       {
         Handle(AIS_InteractiveObject) ashape =  TheAISContext() -> Current();
-        SetInteriorStyle (ashape, atoi (argv[1]), di);
+        SetInteriorStyle (ashape, Draw::Atoi (argv[1]), di);
       }
     }
     //=======================================================================
@@ -1413,7 +1413,7 @@ static int VInteriorStyle (Draw_Interpretor& di, Standard_Integer argc, const ch
         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();
       }
     }
@@ -1773,8 +1773,8 @@ Standard_Integer VTexture (Draw_Interpretor& di,Standard_Integer argc, const cha
        }
 
       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
@@ -1784,8 +1784,8 @@ Standard_Integer VTexture (Draw_Interpretor& di,Standard_Integer argc, const cha
          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
@@ -1797,7 +1797,7 @@ Standard_Integer VTexture (Draw_Interpretor& di,Standard_Integer argc, const cha
       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
        {
@@ -2040,7 +2040,7 @@ static int VPerf(Draw_Interpretor& di, Standard_Integer , const char** argv) {
 
   myTimer.Start();
 
-  if (atoi(argv[3])==1 ) {
+  if (Draw::Atoi(argv[3])==1 ) {
     di<<" Primitives sensibles OFF"<<"\n";
     TheAISContext()->Deactivate(aIO);
   }
@@ -2048,7 +2048,7 @@ static int VPerf(Draw_Interpretor& di, Standard_Integer , const char** argv) {
     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++) {
 
@@ -2075,7 +2075,7 @@ static int VPerf(Draw_Interpretor& di, Standard_Integer , const char** argv) {
       TheAISContext() ->UpdateCurrentViewer();
     }
   }
-  if (atoi(argv[3])==1 ){
+  if (Draw::Atoi(argv[3])==1 ){
     // On reactive la selection des primitives sensibles
     TheAISContext()->Activate(aIO,0);
   }
@@ -2219,7 +2219,7 @@ static int VShading(Draw_Interpretor& ,Standard_Integer argc, const char** argv)
   if (argc < 3) {
     myDevCoef  = 0.0008;
   } else {
-    myDevCoef  =atof(argv[2]);
+    myDevCoef  =Draw::Atof(argv[2]);
   }
 
   TCollection_AsciiString name=argv[1];
@@ -2294,7 +2294,7 @@ static int VActivatedMode (Draw_Interpretor& di, Standard_Integer argc, const ch
 
     // 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) {
@@ -2406,7 +2406,7 @@ static int VActivatedMode (Draw_Interpretor& di, Standard_Integer argc, const ch
       }
     }
     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]));
 
@@ -3173,20 +3173,20 @@ static int VSetTransMode ( Draw_Interpretor& di, Standard_Integer argc, const ch
 
   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);
@@ -3247,7 +3247,7 @@ Standard_Integer hlrtest(Draw_Interpretor&,   Standard_Integer n,   const char**
   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;
 
@@ -3256,17 +3256,17 @@ Standard_Integer hlrtest(Draw_Interpretor&,   Standard_Integer n,   const char**
 
   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);
@@ -3307,7 +3307,7 @@ Standard_Integer phlrtest(Draw_Interpretor&,   Standard_Integer n,   const char*
   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;
 
@@ -3316,17 +3316,17 @@ Standard_Integer phlrtest(Draw_Interpretor&,   Standard_Integer n,   const char*
 
   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);
@@ -3623,7 +3623,7 @@ static Standard_Integer TDraft(Draw_Interpretor& di, Standard_Integer argc, cons
 // 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;
@@ -3635,7 +3635,7 @@ static Standard_Integer TDraft(Draw_Interpretor& di, Standard_Integer argc, cons
     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;
@@ -3643,7 +3643,7 @@ static Standard_Integer TDraft(Draw_Interpretor& di, Standard_Integer argc, cons
   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;
   }
 
index 0da56aec5124c6cccb5da82b65c5ea5a102b75c1..03b0f5fb719030b9ac92a5c44f38a53ce2b10729 100755 (executable)
@@ -104,10 +104,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;
@@ -149,7 +149,7 @@ static Standard_Integer VBLEND(Draw_Interpretor& di, Standard_Integer narg, cons
   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));
index 32dc2811028e588eaecf142ac634f8916ba33989..d64bf6b4e6aa6f05551ff1ae78f866610d43a342 100755 (executable)
@@ -266,19 +266,19 @@ static int VTrihedron (Draw_Interpretor& theDi,
   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);
     }
   }
@@ -323,8 +323,8 @@ static int VSize (Draw_Interpretor& di, Standard_Integer argc, const char** argv
 
   // 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())
@@ -564,7 +564,7 @@ static int VAxisBuilder(Draw_Interpretor& di, Standard_Integer argc, const char*
   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]) ;
 
@@ -816,7 +816,7 @@ static int VPointBuilder(Draw_Interpretor& di, Standard_Integer argc, const char
   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);
@@ -990,23 +990,23 @@ static Standard_Integer VPlaneBuilder (Draw_Interpretor& di,
           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;
@@ -1682,8 +1682,8 @@ static int VLineBuilder(Draw_Interpretor& di, Standard_Integer argc, const char*
 
     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] );
@@ -1927,7 +1927,7 @@ static int VCircleBuilder(Draw_Interpretor& di, Standard_Integer argc, const cha
   {
     // 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;
@@ -1976,25 +1976,25 @@ static int VCircleBuilder(Draw_Interpretor& di, Standard_Integer argc, const cha
           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 
@@ -2028,7 +2028,7 @@ static int VCircleBuilder(Draw_Interpretor& di, Standard_Integer argc, const cha
         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 
@@ -2047,7 +2047,7 @@ static int VCircleBuilder(Draw_Interpretor& di, Standard_Integer argc, const cha
       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 
@@ -2416,32 +2416,32 @@ static int VDrawText (Draw_Interpretor& di, Standard_Integer argc, const char**
   }
 
   // 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;
@@ -2451,7 +2451,7 @@ static int VDrawText (Draw_Interpretor& di, Standard_Integer argc, const char**
     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;
@@ -2769,12 +2769,12 @@ static int VDrawSphere (Draw_Interpretor& di, Standard_Integer argc, const char*
 
   // 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)());
@@ -2908,7 +2908,7 @@ static int VClipPlane (Draw_Interpretor& di, Standard_Integer argc, const char**
   }
   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();
@@ -3001,12 +3001,12 @@ static int VClipPlane (Draw_Interpretor& di, Standard_Integer argc, const char**
     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));
@@ -3093,9 +3093,9 @@ static int VComputeHLR (Draw_Interpretor& di,
   {
     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);
@@ -3377,38 +3377,38 @@ static int VDrawPArray (Draw_Interpretor& di, Standard_Integer argc, const char*
     // 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);
@@ -3416,7 +3416,7 @@ static int VDrawPArray (Draw_Interpretor& di, Standard_Integer argc, const char*
     // 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))
@@ -3461,9 +3461,9 @@ static Standard_Integer VSetLocation (Draw_Interpretor& di,
   }
 
   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();
@@ -3620,15 +3620,15 @@ static Standard_Integer VConnect(Draw_Interpretor& di,
   }
 
   // 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);
@@ -3803,15 +3803,15 @@ static Standard_Integer VConnectShape(Draw_Interpretor& di,
   }
 
   // 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);
@@ -3907,8 +3907,8 @@ static Standard_Integer VSetSelectionMode(Draw_Interpretor& di,
   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;
@@ -3962,8 +3962,8 @@ static Standard_Integer VSetSelectionMode(Draw_Interpretor& di,
   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
@@ -4116,9 +4116,9 @@ Standard_Boolean IsPoint (const TCollection_AsciiString& theName,
 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;
   }
@@ -4380,7 +4380,7 @@ static Standard_Integer VObjZLayer (Draw_Interpretor& di,
   // 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"))
@@ -4439,9 +4439,9 @@ static Standard_Integer VPolygonOffset(Draw_Interpretor& di,
   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();
@@ -4547,28 +4547,28 @@ static Standard_Integer VShowFaceBoundary (Draw_Interpretor& di,
     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;
index ededd567c4140e4d29373727cb7510b7c1eab2b5..3ba400dea4511f7f464d87e12cf2c8bec3641213 100755 (executable)
@@ -328,10 +328,10 @@ void ViewerTest::ViewerInit (const Standard_Integer thePxLeft,  const Standard_I
 
 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;
 }
@@ -475,7 +475,7 @@ void VT_ProcessKeyPress (const char* buf_ret)
   }
   // Number
   else{
-    Standard_Integer Num = atoi(buf_ret);
+    Standard_Integer Num = Draw::Atoi(buf_ret);
     if(Num>=0 && Num<=7)
       ViewerTest::StandardModeActivation(Num);
   }
@@ -1606,17 +1606,17 @@ static int VSetGradientBg(Draw_Interpretor& di, Standard_Integer argc, const cha
   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";
@@ -1656,7 +1656,7 @@ static int VSetGradientBgMode(Draw_Interpretor& di, Standard_Integer argc, const
   }
   if (argc == 2)
   {
-    int aType = atoi(argv[1]);
+    int aType = Draw::Atoi(argv[1]);
     if( aType < 0 || aType > 8 )
     {
       di << "Wrong fill type " << "\n";
@@ -1696,9 +1696,9 @@ static int VSetColorBg(Draw_Interpretor& di, Standard_Integer argc, const char**
   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();
@@ -1723,7 +1723,7 @@ static int VScale(Draw_Interpretor& di, Standard_Integer argc, const char** argv
     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;
 }
 //==============================================================================
@@ -1774,12 +1774,12 @@ static int VTestZBuffTrihedron(Draw_Interpretor& di, Standard_Integer argc, cons
       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 )
     {
@@ -1829,10 +1829,10 @@ static int VRotate( Draw_Interpretor& di, Standard_Integer argc, const char** ar
   }
 
   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";
@@ -1852,12 +1852,12 @@ static int VZoom( Draw_Interpretor& di, Standard_Integer argc, const char** argv
   }
 
   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";
@@ -1875,7 +1875,7 @@ static int VPan( Draw_Interpretor& di, Standard_Integer argc, const char** argv
   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";
@@ -1993,18 +1993,18 @@ static int VColorScale (Draw_Interpretor& di, Standard_Integer argc, const char
   {
      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( );
@@ -2068,7 +2068,7 @@ static int VGraduatedTrihedron(Draw_Interpretor& di, Standard_Integer argc, cons
   }
 
   // Erase (==0) or display (!=0)
-  const int display = atoi(argv[1]);
+  const int display = Draw::Atoi(argv[1]);
 
   if (display)
   {
@@ -2080,7 +2080,7 @@ static int VGraduatedTrihedron(Draw_Interpretor& di, Standard_Integer argc, cons
       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;
@@ -2173,12 +2173,12 @@ static int VPrintView (Draw_Interpretor& di, Standard_Integer argc,
   }
 
   // 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)
@@ -2316,7 +2316,7 @@ static int VZLayer (Draw_Interpretor& di, Standard_Integer argc, const char** ar
       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";
@@ -2519,10 +2519,10 @@ static int VLayerLine(Draw_Interpretor& di, Standard_Integer argc, const char**
   }
 
   // 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;
@@ -2530,16 +2530,16 @@ static int VLayerLine(Draw_Interpretor& di, Standard_Integer argc, const char**
 
   // 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;
   }
@@ -2609,9 +2609,9 @@ static int VOverlayText (Draw_Interpretor& di, Standard_Integer argc, const char
   }
 
   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";
@@ -2624,9 +2624,9 @@ static int VOverlayText (Draw_Interpretor& di, Standard_Integer argc, const char
   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
@@ -2648,9 +2648,9 @@ static int VOverlayText (Draw_Interpretor& di, Standard_Integer argc, const char
   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
@@ -2750,13 +2750,13 @@ static int VGrid (Draw_Interpretor& theDI,
     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);
@@ -2767,13 +2767,13 @@ static int VGrid (Draw_Interpretor& theDI,
     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);
@@ -2800,7 +2800,7 @@ static int VFps (Draw_Interpretor& theDI,
     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";
@@ -2867,7 +2867,7 @@ static int VVbo (Draw_Interpretor& theDI,
     return 1;
   }
 
-  aDriver->EnableVBO (atoi(theArgVec[1]) != 0);
+  aDriver->EnableVBO (Draw::Atoi(theArgVec[1]) != 0);
   return 0;
 }
 
@@ -2942,8 +2942,8 @@ static int VReadPixel (Draw_Interpretor& theDI,
 
   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";
@@ -3068,14 +3068,14 @@ static int VDiffImage (Draw_Interpretor& theDI, Standard_Integer theArgNb, const
   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;
index a6749ed1de6b163afcd11954aefea2d56581376c..326843d20f9e0773aa5a6cae0a18db4ed91270db 100755 (executable)
@@ -161,13 +161,13 @@ Standard_Boolean Voxel_Reader::ReadBoolAsciiVoxels(const TCollection_ExtendedStr
     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);
@@ -238,13 +238,13 @@ Standard_Boolean Voxel_Reader::ReadColorAsciiVoxels(const TCollection_ExtendedSt
     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);
@@ -315,13 +315,13 @@ Standard_Boolean Voxel_Reader::ReadFloatAsciiVoxels(const TCollection_ExtendedSt
     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);
@@ -359,7 +359,7 @@ Standard_Boolean Voxel_Reader::ReadFloatAsciiVoxels(const TCollection_ExtendedSt
          return Standard_False;
        }
       }
-      value = atof(line);
+      value = Atof(line);
 
       // Set value
       if (!((Standard_ShortReal**)((Voxel_DS*)myFloatVoxels)->myData)[i1])
index ca634a52ed8fafa6ba745b0a52d7604d3ee27067..421f4696c2331c31895e8ebc6cff6ac2f7df2d8e 100755 (executable)
@@ -157,7 +157,7 @@ VrmlData_ErrorStatus VrmlData_Box::Write (const char * thePrefix) const
   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();
   }
@@ -259,12 +259,12 @@ VrmlData_ErrorStatus VrmlData_Cone::Write (const char * thePrefix) const
   {
     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)
@@ -393,12 +393,12 @@ VrmlData_ErrorStatus VrmlData_Cylinder::Write (const char * thePrefix) const
   {
     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)
@@ -494,7 +494,7 @@ VrmlData_ErrorStatus VrmlData_Sphere::Write (const char * thePrefix) const
   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();
   }
index cea02f526811181fbff624bef3437bb774739fd9..d4c48c50bf7b6246f21694fc8307c7cc29970166 100755 (executable)
@@ -478,13 +478,13 @@ VrmlData_ErrorStatus VrmlData_Group::Write (const char * thePrefix) const
         };
         // 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());
@@ -499,7 +499,7 @@ VrmlData_ErrorStatus VrmlData_Group::Write (const char * thePrefix) const
         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);
         }
@@ -507,7 +507,7 @@ VrmlData_ErrorStatus VrmlData_Group::Write (const char * thePrefix) const
         // 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);
         }
@@ -517,7 +517,7 @@ VrmlData_ErrorStatus VrmlData_Group::Write (const char * thePrefix) const
         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);
         }
index a040a2b425637a55aefab0409b546052260314ec..e172b532b0c5328d226e8e722f2e4ba2df422c4a 100755 (executable)
@@ -371,7 +371,7 @@ VrmlData_ErrorStatus VrmlData_IndexedFaceSet::Write
       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);
     }
 
index 86fd7e256304b9a312a157fbd6cc66d328c41110..56819362728602c062fca754cdf4d76b38f32686 100755 (executable)
@@ -202,7 +202,7 @@ VrmlData_ErrorStatus VrmlData_Material::Write (const char * thePrefix) const
     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)) {
@@ -211,30 +211,30 @@ VrmlData_ErrorStatus VrmlData_Material::Write (const char * thePrefix) const
           (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);
     }
 
index 3c568a7067ecb52cecb27da4ccff7e56e9ae4a7b..b5d11dd1a8dfdf72ba54272f9983c84926273759 100755 (executable)
@@ -677,7 +677,7 @@ VrmlData_ErrorStatus VrmlData_Scene::ReadReal
   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())
@@ -707,7 +707,7 @@ VrmlData_ErrorStatus VrmlData_Scene::ReadXYZ
     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;
@@ -746,7 +746,7 @@ VrmlData_ErrorStatus VrmlData_Scene::ReadXY
     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;
@@ -871,23 +871,23 @@ VrmlData_ErrorStatus VrmlData_Scene::WriteArrIndex
         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);
@@ -918,11 +918,11 @@ VrmlData_ErrorStatus VrmlData_Scene::WriteXYZ
   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);
 }
@@ -1005,7 +1005,7 @@ VrmlData_ErrorStatus VrmlData_Scene::WriteNode
           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));
@@ -1116,7 +1116,7 @@ void dumpNode (Standard_OStream&                theStream,
     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) {
@@ -1133,7 +1133,7 @@ void dumpNode (Standard_OStream&                theStream,
     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 =
@@ -1142,7 +1142,7 @@ void dumpNode (Standard_OStream&                theStream,
     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 = 
@@ -1159,7 +1159,7 @@ void dumpNode (Standard_OStream&                theStream,
     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());
   }
 }
index af8ea8b1b380920a61344db6f527769a0953a3bc..74a7950b2368e1435752ca80c8a412074c21d6e2 100755 (executable)
@@ -155,7 +155,7 @@ VrmlData_ErrorStatus VrmlData_WorldInfo::Write (const char * thePrefix) const
   {
     char buf[4096];
     if (myTitle) {
-      sprintf (buf, "title \"%s\"", myTitle);
+      Sprintf (buf, "title \"%s\"", myTitle);
       aStatus = aScene.WriteLine (buf);
     }
 
@@ -163,7 +163,7 @@ VrmlData_ErrorStatus VrmlData_WorldInfo::Write (const char * thePrefix) const
       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, ",");
index d5f4330b02f44d14508474a2fe4c5f8717f8d2bd..55957740544dc409e295bb061749c246a061c3a2 100755 (executable)
@@ -600,7 +600,7 @@ static int __fastcall _createColorRamp ( HPALETTE* pal ) {
 
  if (  GetEnvironmentVariable ( "CSF_GammaValue", buff, 32 )  ) {
  
-  gamma = atof ( buff );
+  gamma = Atof ( buff );
 
   if ( gamma == 0.0 )
 
index bde3e350f20333ce4ef95db4f8812e278d82b85f..54b9510982e593fd5bd6878731ec756fc1f20197 100755 (executable)
@@ -227,7 +227,7 @@ static Standard_Integer dump (Draw_Interpretor& di, Standard_Integer argc, const
 
   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;
 }
@@ -483,7 +483,7 @@ static Standard_Integer show (Draw_Interpretor& di, Standard_Integer argc, const
 
   // 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;
@@ -589,7 +589,7 @@ static Standard_Integer XAttributeValue (Draw_Interpretor& di, Standard_Integer
   TDF_Tool::Label(browser->Data(),argv[2],lab);
   if ( lab.IsNull() ) { di << "ERROR: label is Null: " << argv[2] << "\n"; return 0; }
 
-  Standard_Integer num = atoi ( argv[3] );
+  Standard_Integer num = Draw::Atoi ( argv[3] );
   TDF_AttributeIterator itr(lab,Standard_False);
   for (Standard_Integer i=1; itr.More() && i < num; i++) itr.Next();
 
@@ -713,7 +713,7 @@ static Standard_Integer XAttributeValue (Draw_Interpretor& di, Standard_Integer
     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;
   }
@@ -811,7 +811,7 @@ static Standard_Integer setviewName (Draw_Interpretor& di, Standard_Integer argc
     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;
 }
@@ -845,7 +845,7 @@ static Standard_Integer XSetTransparency (Draw_Interpretor& di, Standard_Integer
   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());
@@ -965,28 +965,28 @@ static Standard_Integer XShowFaceBoundary (Draw_Interpretor& di,
   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;
index 2a7d12f07939a3203a10ecce96e86514a2efdc3a..98e5d38ae2e70f04f54cf2561c2c8e5807620bd4 100755 (executable)
@@ -17,9 +17,9 @@
 // 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>
 
@@ -52,7 +52,7 @@ static Standard_Integer setColor (Draw_Interpretor& di, Standard_Integer argc, c
   
   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 : 
@@ -154,7 +154,7 @@ static Standard_Integer addColor (Draw_Interpretor& di, Standard_Integer argc, c
   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;
@@ -193,7 +193,7 @@ static Standard_Integer findColor (Draw_Interpretor& di, Standard_Integer argc,
 
   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);
@@ -235,7 +235,7 @@ static Standard_Integer setVisibility (Draw_Interpretor& di, Standard_Integer ar
   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);
@@ -341,7 +341,7 @@ static Standard_Integer setStyledcolor (Draw_Interpretor& di, Standard_Integer a
   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;
index 140aef3cb719c08285236fd241d47f2c04544e00..3143a721dff1848086ffbd5eabaa1ef17b136e16 100755 (executable)
@@ -163,7 +163,7 @@ static Standard_Integer FromShape (Draw_Interpretor& di, Standard_Integer argc,
   }
   
   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 );
   
index faf20f9e3765ea5e70965b1354b38659edf7826a..cecddd901ea7fb7dbc4cc7d4e02a0af3c2c9ac51 100755 (executable)
@@ -20,6 +20,7 @@
 
 #include <XDEDRAW_Layers.ixx>
 
+#include <Draw.hxx>
 #include <DBRep.hxx>
 #include <DDocStd.hxx>
 
@@ -108,7 +109,7 @@ static Standard_Integer setLayer (Draw_Interpretor& di, Standard_Integer argc, c
     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; }
@@ -220,7 +221,7 @@ static Standard_Integer setLinkLayer (Draw_Interpretor& di, Standard_Integer arg
     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; }
@@ -365,7 +366,7 @@ static Standard_Integer setVisibility (Draw_Interpretor& di, Standard_Integer ar
   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);
index 3c88be1bb0470ed5e1d510fb6661ab38d5ed0910..4af43fd044539a84781123d94e03c2451fb5b73d 100755 (executable)
@@ -21,6 +21,7 @@
 
 #include <XDEDRAW_Props.ixx>
 
+#include <Draw.hxx>
 #include <DBRep.hxx>
 #include <DDocStd.hxx>
 
@@ -233,7 +234,7 @@ static Standard_Integer SetProps (Draw_Interpretor& di, Standard_Integer argc, c
     
     // 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;
@@ -288,7 +289,7 @@ static Standard_Integer SetVolume (Draw_Interpretor& di, Standard_Integer argc,
     }
   }
   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);
@@ -326,7 +327,7 @@ static Standard_Integer SetArea (Draw_Interpretor& di, Standard_Integer argc, co
     }
   }
   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);
@@ -363,13 +364,13 @@ static Standard_Integer SetCentroid (Draw_Interpretor& di, Standard_Integer argc
     }
   }
   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;
 }
@@ -518,7 +519,7 @@ static Standard_Integer CheckProps (Draw_Interpretor& di, Standard_Integer argc,
   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 ) {
@@ -567,7 +568,7 @@ static Standard_Integer CheckProps (Draw_Interpretor& di, Standard_Integer argc,
     //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 ) {
@@ -594,7 +595,7 @@ static Standard_Integer CheckProps (Draw_Interpretor& di, Standard_Integer argc,
        //      (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" ));
@@ -603,14 +604,14 @@ static Standard_Integer CheckProps (Draw_Interpretor& di, Standard_Integer argc,
       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;
     }
 
@@ -621,7 +622,7 @@ static Standard_Integer CheckProps (Draw_Interpretor& di, Standard_Integer argc,
        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;
@@ -641,7 +642,7 @@ static Standard_Integer CheckProps (Draw_Interpretor& di, Standard_Integer argc,
                //  (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" ));
@@ -650,7 +651,7 @@ static Standard_Integer CheckProps (Draw_Interpretor& di, Standard_Integer argc,
        else if ( wholeDoc ) {
          //printf ( "%16.16s", "" );
          char string6[260];
-         sprintf (string6, "%16.16s", "" );
+         Sprintf (string6, "%16.16s", "" );
          di << string6;
        }
 
@@ -660,12 +661,12 @@ static Standard_Integer CheckProps (Draw_Interpretor& di, Standard_Integer argc,
          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;
@@ -673,14 +674,14 @@ static Standard_Integer CheckProps (Draw_Interpretor& di, Standard_Integer argc,
        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 );
@@ -693,7 +694,7 @@ static Standard_Integer CheckProps (Draw_Interpretor& di, Standard_Integer argc,
     else if ( wholeDoc ) {
       //printf ( "%40.40s", "" );
       char string10[260];
-      sprintf (string10, "%40.40s", "" );
+      Sprintf (string10, "%40.40s", "" );
       di << string10;
     }
     //fflush ( stdout );
@@ -725,7 +726,7 @@ static Standard_Integer ShapeVolume (Draw_Interpretor& di, Standard_Integer argc
   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;
@@ -845,7 +846,7 @@ static Standard_Integer ShapeMassProps (Draw_Interpretor& di, Standard_Integer a
   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;
@@ -915,7 +916,7 @@ static Standard_Integer SetMaterial (Draw_Interpretor& di, Standard_Integer argc
   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"));
 
index 9a547f7ccd25547689f234108be236daf6b4c6b8..db0713481b237ed1a914b723980952e857a194bb 100755 (executable)
@@ -20,6 +20,7 @@
 
 #include <XDEDRAW_Shapes.ixx>
 
+#include <Draw.hxx>
 #include <DBRep.hxx>
 #include <DDocStd.hxx>
 
@@ -63,7 +64,7 @@ static Standard_Integer addShape (Draw_Interpretor& di, Standard_Integer argc, c
   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";
@@ -160,7 +161,7 @@ static Standard_Integer removeShape (Draw_Interpretor& di, Standard_Integer argc
 //  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);
   
@@ -238,7 +239,7 @@ static Standard_Integer getUsers (Draw_Interpretor& di, Standard_Integer argc, c
     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);
@@ -262,7 +263,7 @@ static Standard_Integer nbComponents (Draw_Interpretor& di, Standard_Integer arg
     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; }
@@ -413,7 +414,7 @@ static Standard_Integer getFreeShapes (Draw_Interpretor& di, Standard_Integer ar
     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 << " ";
     }
index d653647af3bb4b6429a1cdd7deaa21eeac7589a9..ab02f3dbc90d505d7e8903655ef8dd8141038819 100755 (executable)
@@ -130,7 +130,7 @@ void XSDRAW::LoadDraw (Draw_Interpretor& theCommands)
       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());
@@ -141,7 +141,7 @@ void XSDRAW::LoadDraw (Draw_Interpretor& theCommands)
     (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
index 56a29a8c466b7e8d5e44a478fb00f7b80472156f..fba8546a231fa163e7df4b3f699188af011d9ab7 100755 (executable)
@@ -152,7 +152,7 @@ static Standard_Integer igesbrep (Draw_Interpretor& di, Standard_Integer argc, c
 // 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
@@ -187,7 +187,7 @@ static Standard_Integer igesbrep (Draw_Interpretor& di, Standard_Integer argc, c
         //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) {
@@ -195,7 +195,7 @@ static Standard_Integer igesbrep (Draw_Interpretor& di, Standard_Integer argc, c
        // 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 {
@@ -218,7 +218,7 @@ static Standard_Integer igesbrep (Draw_Interpretor& di, Standard_Integer argc, c
          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 {
@@ -245,7 +245,7 @@ static Standard_Integer igesbrep (Draw_Interpretor& di, Standard_Integer argc, c
       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);
@@ -283,7 +283,7 @@ static Standard_Integer igesbrep (Draw_Interpretor& di, Standard_Integer argc, c
         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
@@ -331,7 +331,7 @@ static Standard_Integer igesbrep (Draw_Interpretor& di, Standard_Integer argc, c
           // 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) {
@@ -358,7 +358,7 @@ static Standard_Integer igesbrep (Draw_Interpretor& di, Standard_Integer argc, c
            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);
index 7999b98cf5139a9c860a6dba8a085f254af48e7d..7a828e7df75da06cd3a0605c8185490fe42f29ae 100755 (executable)
@@ -195,7 +195,7 @@ static Standard_Integer stepread (Draw_Interpretor& di/*theCommands*/, Standard_
       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);
@@ -211,7 +211,7 @@ static Standard_Integer stepread (Draw_Interpretor& di/*theCommands*/, Standard_
       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);
@@ -261,7 +261,7 @@ static Standard_Integer stepread (Draw_Interpretor& di/*theCommands*/, Standard_
         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);
index 9c5b0d181890afe5d374a4525c3c3cf9b2b1e4c6..e6f75d5158127d9efd6428490d55b032c40bd87e 100755 (executable)
@@ -97,9 +97,9 @@ static Standard_Integer writestl
     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);
       }
     }
@@ -222,9 +222,9 @@ static Standard_Integer storevrml
   }
   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);
 
@@ -347,8 +347,7 @@ static Standard_Integer meshdm
     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();
 
@@ -381,8 +380,7 @@ static Standard_Integer meshsm
     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();
 
@@ -438,10 +436,9 @@ static Standard_Integer setcolor
     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();
@@ -477,8 +474,7 @@ static Standard_Integer meshmat
     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;
@@ -507,8 +503,7 @@ static Standard_Integer shrink
     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();
@@ -773,7 +768,7 @@ static Standard_Integer meshcolors( Draw_Interpretor& di,
         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"));
@@ -928,13 +923,13 @@ static Standard_Integer mesh_edge_width( Draw_Interpretor& di,
       }
 
       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() )
index edfa94566926b236193fb8982b5b9fecd5747c4d..8d4fc6f21751f3bb95c2840716d47b7d86b2238c 100755 (executable)
@@ -76,10 +76,6 @@ Handle(Standard_Transient) XmlLDrivers::Factory(const Standard_GUID& theGUID)
 //=======================================================================
 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;
@@ -92,7 +88,6 @@ TCollection_AsciiString XmlLDrivers::CreationDate ()
   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;
 }
 
index eb48b03a22a5a6fe2e3f8e83d74f8149d8c3314e..f8e5fb564c47e2b566440fbcb0a8766d0fb4548f 100755 (executable)
@@ -195,10 +195,6 @@ void XmlLDrivers_DocumentRetrievalDriver::Read
 {
   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);
 
@@ -216,8 +212,6 @@ void XmlLDrivers_DocumentRetrievalDriver::Read
   ::take_time (0, " +++++ Fin parsing XML :       ", aMessageDriver);
 
   ReadFromDomDocument (anElement, theNewDocument, theApplication);
-
-  setlocale(LC_NUMERIC, (char *) anOldNumLocale.ToCString()) ;
 }
 
 //=======================================================================
@@ -497,7 +491,7 @@ static void take_time (const Standard_Integer isReset, const char * aHeader,
   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;
index 7a45f9889e41af044db1e0384af11661b896a145..38257068defd71002e9d43247712fe71b5e8471a 100755 (executable)
@@ -108,10 +108,6 @@ void XmlLDrivers_DocumentStorageDriver::Write
                           (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);
@@ -143,7 +139,6 @@ void XmlLDrivers_DocumentStorageDriver::Write
         Standard_Failure::Raise("File cannot be opened for writing");
     }
   }
-  setlocale(LC_NUMERIC, (char *) anOldNumLocale.ToCString()) ;
 }
 
 //=======================================================================
@@ -402,7 +397,7 @@ static void take_time (const Standard_Integer isReset, const char * aHeader,
   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;
index 9193e2cf86b7ee5a57a7d4a510a1b030dec297dd..eb4cfef45e5375f0de55911893f57ddb0ff6f12a 100755 (executable)
@@ -767,7 +767,7 @@ void XmlMDataStd_NamedDataDriver::Paste(const Handle(TDF_Attribute)& theSource,
        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
index bd63f93330302d26b420595bcb80eca1d323b255..d0edf72ed963f740d89f1a52cccdbdd14a572a73 100755 (executable)
@@ -172,7 +172,7 @@ void XmlMDataStd_RealArrayDriver::Paste (const Handle(TDF_Attribute)& theSource,
     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;
index 34222f2b65ead6567b641a912252cdd70fe972e1..582f2d481ef173402f89ecd4857e4c55d62f38b9 100755 (executable)
@@ -84,7 +84,7 @@ void XmlMDataStd_RealDriver::Paste (const Handle(TDF_Attribute)& theSource,
   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
index cbfef6fd583a192b607e09e2f190e76fc90c22c5..01aa1f68640a92968d2c0c2932570dea0e242c32 100755 (executable)
@@ -144,7 +144,7 @@ void  XmlMNaming_Shape1::SetShape (const Standard_Integer       theID,
   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);
@@ -160,12 +160,12 @@ void XmlMNaming_Shape1::SetVertex (const TopoDS_Shape& theVertex)
   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);
 }
index 350e416ca0b61d0e632ce6e6ab85483075b6eb27..01a91afe314835819a71652a9d31e63f446845fc 100755 (executable)
@@ -122,7 +122,7 @@ void XmlMPrsStd_PositionDriver::Paste
   {
     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);
   }
 }
index 1e7fc768f6aa953985a472cad5e22c562d7003d7..4430b984340fc126fe6c95629402030bae2f4da9 100755 (executable)
@@ -122,7 +122,7 @@ void XmlMXCAFDoc_CentroidDriver::Paste
   {
     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);
   }
 }
index 29563e59d1252147e8bf96c01311f187fc54eddf..79fb481543f9ed1c61d4b96f5db7a57ab3636fdf 100755 (executable)
@@ -166,7 +166,7 @@ void XmlMXCAFDoc_DimTolDriver::Paste (const Handle(TDF_Attribute)& theSource,
     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 += ' ';
index ee9501a884dbefac96e123b45a4bcc49448bc79a..86c8ed24799970127cb6ae4bd44c49f802c10843 100755 (executable)
@@ -120,16 +120,16 @@ Standard_Boolean XmlObjMgt::SetExtendedString
     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';
@@ -346,7 +346,7 @@ Standard_Boolean XmlObjMgt::GetReal (Standard_CString& theString,
 {
   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);
@@ -376,7 +376,7 @@ Standard_Boolean XmlObjMgt::GetReal (const XmlObjMgt_DOMString& theString,
       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);
index 694d8895dde2e7cb03522b7ae364c21b7cb5b086..acca8e94b7aa3836ecd1df20299019a351bcfd01 100755 (executable)
@@ -36,7 +36,7 @@ XmlObjMgt_DOMString XmlObjMgt_GP::Translate (const gp_Trsf& aTrsf)
   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);
@@ -52,7 +52,7 @@ XmlObjMgt_DOMString XmlObjMgt_GP::Translate (const gp_Mat& aMat)
   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);
 }
 
@@ -63,7 +63,7 @@ XmlObjMgt_DOMString XmlObjMgt_GP::Translate (const gp_Mat& aMat)
 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);
 }
 
@@ -80,7 +80,7 @@ Standard_Boolean XmlObjMgt_GP::Translate
   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);
@@ -154,15 +154,15 @@ static const char * Translate (const char * theStr, gp_XYZ& P)
   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;
index c9605c565a934f2a1ca3e0e5451b1b9b3cad9a73..4f8190810292dbf825511a9b004efb1c7d9bd275 100755 (executable)
@@ -26,6 +26,7 @@ if { [info exists test_image] == 0 } {
 }
 
 # 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"
@@ -35,7 +36,22 @@ proc checkreal {name value expected tol_abs tol_rel} {
     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
 
index e00d71107adb20ef53e3f1c31e72effad47ae320..eab3eb50266d6c87b4cab5216f62729368e34913 100755 (executable)
@@ -1,3 +1,4 @@
 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
diff --git a/tests/bugs/xde/bug22898 b/tests/bugs/xde/bug22898
new file mode 100644 (file)
index 0000000..ae19c8a
--- /dev/null
@@ -0,0 +1,53 @@
+# 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