X-Git-Url: http://git.dev.opencascade.org/gitweb/?p=occt.git;a=blobdiff_plain;f=src%2FQABugs%2FQABugs_11.cxx;h=a7099d56810872630a099bc5bbf705578c7e5e60;hp=947ef99a77386efbca9a78096ab7c48aa3af9c75;hb=0717ddc13291e099f92171b66858fb6718bb2ca8;hpb=64e2d3bd71e0e5e739904e64a63e85fa7243dfe2 diff --git a/src/QABugs/QABugs_11.cxx b/src/QABugs/QABugs_11.cxx old mode 100755 new mode 100644 index 947ef99a77..a7099d5681 --- a/src/QABugs/QABugs_11.cxx +++ b/src/QABugs/QABugs_11.cxx @@ -1,28 +1,23 @@ // Created on: 2002-03-20 // Created by: QA Admin -// Copyright (c) 2002-2012 OPEN CASCADE SAS +// Copyright (c) 2002-2014 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. +// This file is part of Open CASCADE Technology software library. // -// 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. +// This library is free software; you can redistribute it and/or modify it under +// the terms of the GNU Lesser General Public License version 2.1 as published +// by the Free Software Foundation, with special exception defined in the file +// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT +// distribution for complete text of the license and disclaimer of any warranty. // -// 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. - - +// Alternatively, this file may be used under the terms of Open CASCADE +// commercial license or contractual agreement. #include #include +#include #include #include #include @@ -93,8 +88,6 @@ #include #include -#include - #if ! defined(WNT) extern ViewerTest_DoubleMapOfInteractiveAndName& GetMapOfAIS(); #else @@ -164,7 +157,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(); // } // @@ -255,7 +248,7 @@ static int BUC60610(Draw_Interpretor& di, Standard_Integer argc, const char ** a printf("Usage: %s iges_input [name]\n",argv[0]); return(1); } - Standard_Character *Ch; + Standard_Character *Ch = NULL; if(argc > 2) { Ch = new Standard_Character[strlen(argv[2])+3]; @@ -274,60 +267,13 @@ 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); } } return (1); } -static Standard_Integer BUC60661(Draw_Interpretor& di, Standard_Integer argc, const char ** a) -{ - if(argc!=2) - { - di << "Usage : " << a[0] << " file.igs" << "\n"; - return -1; - } - - Handle(AIS_InteractiveContext) myContext = ViewerTest::GetAISContext(); - - if(myContext.IsNull()) { - di << "use 'vinit' command before " << a[0] << "\n"; - return -1; - } - - // MKV 30.03.05 -#if ((TCL_MAJOR_VERSION > 8) || ((TCL_MAJOR_VERSION == 8) && (TCL_MINOR_VERSION >= 4))) && !defined(USE_NON_CONST) - const Standard_Character *DD = Tcl_GetVar(di.Interp(),"Draw_DataDir",TCL_GLOBAL_ONLY); -#else - Standard_Character *DD = Tcl_GetVar(di.Interp(),"Draw_DataDir",TCL_GLOBAL_ONLY); -#endif - - Standard_Character *file1 = new Standard_Character [strlen(DD)+strlen(a[1])+2]; - sprintf(file1,"%s/%s",DD,a[1]); - - IGESToBRep_Reader reader; - Standard_Integer status = reader.LoadFile(file1); - if( !status ) { - IGESToBRep::Init(); - reader.TransferRoots(); - TopoDS_Shape shape = reader.OneShape(); - - Handle(AIS_Shape) importedShape = new AIS_Shape(shape); - - Handle(V3d_Viewer) myPView = myContext->CurrentViewer(); - - if( ! myPView.IsNull() && (myPView->DefaultVisualization() == V3d_WIREFRAME) ) - importedShape->SetDisplayMode(AIS_WireFrame); - else importedShape->SetDisplayMode(AIS_Shaded); - myContext->Display(importedShape); - } - - printf("\n End of my IGES to 3D-viewer *****************>\n"); - return 0; -} - - //==================================================== // // Following code is inserted from @@ -360,7 +306,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 +391,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 +476,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()) { @@ -829,17 +775,32 @@ static Standard_Integer OCC381_Save (Draw_Interpretor& di, Standard_Integer nb, PCDM_StoreStatus theStatus = A->Save(D, theStatusMessage); if (theStatus != PCDM_SS_OK ) { switch ( theStatus ) { - case PCDM_SS_DriverFailure: { - di << " Could not store , no driver found to make it " <<"\n" ; - break ; - } - case PCDM_SS_WriteFailure: { - di << " Write access failure " << "\n" ; - break; - } - case PCDM_SS_Failure: { - di << " Write failure " << "\n" ; - } + case PCDM_SS_DriverFailure: { + di << "Error saving document: Could not store , no driver found to make it" << "\n"; + break ; + } + case PCDM_SS_WriteFailure: { + di << "Error saving document: Write access failure" << "\n"; + break; + } + case PCDM_SS_Failure: { + di << "Error saving document: Write failure" << "\n" ; + break; + } + case PCDM_SS_Doc_IsNull: { + di << "Error saving document: No document to save" << "\n"; + break ; + } + case PCDM_SS_No_Obj: { + di << "Error saving document: No objects written" << "\n"; + break; + } + case PCDM_SS_Info_Section_Error: { + di << "Error saving document: Write info section failure" << "\n" ; + break; + } + default: + break; } return 1; } @@ -864,17 +825,32 @@ static Standard_Integer OCC381_SaveAs (Draw_Interpretor& di, Standard_Integer nb PCDM_StoreStatus theStatus = A->SaveAs(D,path, theStatusMessage); if (theStatus != PCDM_SS_OK ) { switch ( theStatus ) { - case PCDM_SS_DriverFailure: { - di << " Could not store , no driver found to make it " <<"\n" ; - break ; - } - case PCDM_SS_WriteFailure: { - di << " Write access failure " << "\n" ; - break; - } - case PCDM_SS_Failure: { - di << " Write failure " << "\n" ; - } + case PCDM_SS_DriverFailure: { + di << "Error saving document: Could not store , no driver found to make it" << "\n"; + break ; + } + case PCDM_SS_WriteFailure: { + di << "Error saving document: Write access failure" << "\n"; + break; + } + case PCDM_SS_Failure: { + di << "Error saving document: Write failure" << "\n" ; + break; + } + case PCDM_SS_Doc_IsNull: { + di << "Error saving document: No document to save" << "\n"; + break ; + } + case PCDM_SS_No_Obj: { + di << "Error saving document: No objects written" << "\n"; + break; + } + case PCDM_SS_Info_Section_Error: { + di << "Error saving document: Write info section failure" << "\n" ; + break; + } + default: + break; } return 1; } @@ -884,76 +860,47 @@ static Standard_Integer OCC381_SaveAs (Draw_Interpretor& di, Standard_Integer nb #include -Standard_Integer OCC299bug (Draw_Interpretor& di, - Standard_Integer n, - const char ** a) +Standard_Integer OCC299bug (Draw_Interpretor& theDi, + Standard_Integer theArgNb, + const char** theArgVec) { - char sbf[512]; - - if (n < 3) { - di << "Usage : " << a[0] << " Solid Point [Tolerance=1.e-7]" << "\n"; + if (theArgNb < 3) + { + theDi << "Usage : " << theArgVec[0] << " Solid Point [Tolerance=1.e-7]\n"; return -1; } - TopoDS_Shape aS = DBRep::Get(a[1]); - if (aS.IsNull()) { - sprintf(sbf, " Null Shape is not allowed here\n"); - di< @@ -1006,7 +953,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 +1015,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 +1150,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; @@ -1401,7 +1348,7 @@ static Standard_Integer OCC369(Draw_Interpretor& di, Standard_Integer argc, cons if(aShape.IsNull()) {di << "OCC369 FAULTY. Entry shape is NULL \n"; return 0;} // 3. Build mesh - BRepMesh_IncrementalMesh aMesh(aShape, 0.2, Standard_True, M_PI/6); + BRepMesh_IncrementalMesh aMesh(aShape, 0.2, Standard_True, M_PI / 6); } catch (Standard_Failure) {di << "OCC369 Exception \n" ;return 0;} @@ -1418,14 +1365,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); @@ -1447,6 +1394,9 @@ static Standard_Integer OCC524 (Draw_Interpretor& di, Standard_Integer argc, con di << aSStream1; di<<"\n"; + if (Matrix.RowNumber() > 1) { + Matrix(Matrix.LowerRow() + 1, Matrix.LowerCol()) += 1.; + } Vector2.TMultiply(Vector, Matrix); //Vector2.Dump(cout); @@ -1478,50 +1428,6 @@ static Standard_Integer OCC525(Draw_Interpretor& di, Standard_Integer /*argc*/, return 0; } -#include -#include - -#include -#include -#include -#include - -#if ! defined(WNT) -extern Viewer2dTest_DoubleMapOfInteractiveAndName& GetMapOfAIS2D(); -#else -Standard_EXPORT Viewer2dTest_DoubleMapOfInteractiveAndName& GetMapOfAIS2D(); -#endif - -//======================================================================= -//function : OCC543 -//purpose : -//======================================================================= -static Standard_Integer OCC543 (Draw_Interpretor& di, Standard_Integer argc, const char ** argv) -{ - Handle(AIS2D_InteractiveContext) aContext = Viewer2dTest::GetAIS2DContext(); - if(aContext.IsNull()) { - di << "ERROR: Use 'v2dinit' command before " << argv[0] << "\n"; - return -1; - } - if(argc != 2){ - di<<"Usage : " << argv[0] << " name\n"; - return -1; - } - Handle(V2d_View) V = Viewer2dTest::CurrentView(); - - TCollection_AsciiString name = argv[1]; - - if (!GetMapOfAIS2D().IsBound2(name)) { -// di << "There is not an object with name " << name.ToCString() << "\n"; -// return -1; - } - - Handle(AIS2D_InteractiveObject) aShape = GetMapOfAIS2D().Find2(name); - Standard_Integer PickedIndex = aShape->PickedIndex(); - di << "PickedIndex = " << PickedIndex << "\n"; - return 0; -} - #include #include #include @@ -1547,7 +1453,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"; @@ -1658,34 +1564,6 @@ static Standard_Integer OCC578 (Draw_Interpretor& di, Standard_Integer argc, con return 0; } -#include -#include - -//======================================================================= -//function : OCC627 -//purpose : -//======================================================================= -static Standard_Integer OCC627 (Draw_Interpretor& di, Standard_Integer argc, const char ** argv) -{ - Handle(AIS2D_InteractiveContext) aContext = Viewer2dTest::GetAIS2DContext(); - if(aContext.IsNull()) { - di << "ERROR: Use 'v2dinit' command before " << argv[0] << "\n"; - return -1; - } - if(argc != 1){ - di<<"Usage : " << argv[0] << "\n"; - return -1; - } - - Handle(V2d_View) V = Viewer2dTest::CurrentView(); - Handle(Graphic2d_View) View = V->View(); - Handle(Graphic2d_DisplayList) DisplayList = View->DisplayList(); - Standard_Integer Length = DisplayList->Length(); - di << "Length = " << Length << "\n"; - - return 0; -} - #include //======================================================================= //function : OCC669 @@ -1781,7 +1659,7 @@ static Standard_Integer OCC708 (Draw_Interpretor& di, Standard_Integer argc, con return 1; } - Standard_Boolean updateviewer = Standard_True, PutInCollector = Standard_True; + Standard_Boolean updateviewer = Standard_True; ViewerTest_DoubleMapOfInteractiveAndName& aMap = GetMapOfAIS(); @@ -1797,11 +1675,11 @@ static Standard_Integer OCC708 (Draw_Interpretor& di, Standard_Integer argc, con di << argv[1] << " : No interactive object" << "\n"; return 1; } - AISObj->UnsetTransformation(); + AISObj->ResetTransformation(); if (!aContext->HasOpenedContext()) { aContext->OpenLocalContext(); } - aContext->Erase(AISObj, updateviewer, PutInCollector); + aContext->Erase(AISObj, updateviewer); aContext->UpdateCurrentViewer(); aContext->Display(AISObj, updateviewer); aContext->UpdateCurrentViewer(); @@ -1841,10 +1719,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" ; @@ -1971,7 +1849,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 { @@ -2005,7 +1883,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 @@ -2038,7 +1916,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 { @@ -2072,7 +1950,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 { @@ -2106,7 +1984,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 { @@ -2140,7 +2018,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 { @@ -2171,7 +2049,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"; @@ -2179,7 +2057,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); @@ -2258,7 +2136,7 @@ TopoDS_Shape OCC1077_boolbl(BRepAlgoAPI_BooleanOperation& aBoolenaOperation,cons TopoDS_Shape ShapeCut = aBoolenaOperation.Shape(); //#ifdef OCC40 -// Handle_TopOpeBRepBuild_HBuilder build = aBoolenaOperation.Builder(); +// Handle(TopOpeBRepBuild_HBuilder) build = aBoolenaOperation.Builder(); //#endif TopTools_ListIteratorOfListOfShape its; @@ -2324,7 +2202,7 @@ TopoDS_Shape OCC1077_Bug() TopoDS_Shape theCylinder3 = BRepPrimAPI_MakeCylinder(gp_Ax2(gp_Pnt(0, - 10, 0), gp_Dir(0, 1, 0)), 3, 20).Shape(); TopoDS_Shape theTmp1 = OCC1077_cut_blend(theCommon,theCylinder1,0.7); - Handle_ShapeFix_Shape fixer = new ShapeFix_Shape(theTmp1); + Handle(ShapeFix_Shape) fixer = new ShapeFix_Shape(theTmp1); fixer->Perform(); theTmp1 = fixer->Shape(); TopoDS_Shape theTmp2 = OCC1077_cut_blend(theTmp1,theCylinder2,0.7); @@ -2378,7 +2256,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()) @@ -2394,7 +2272,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< 2) + if (argc > 3) { - di << "Usage : " << argv[0] << " [nCount]" << "\n"; + di << "Usage : " << argv[0] << " [nCount] path" << "\n"; return 1; } - if (argc > 1) - nCount = atoi(argv[1]); + if (argc > 2) + nCount = Draw::Atoi(argv[1]); + TCollection_AsciiString aFilePath = argv[2]; STEPCAFControl_Writer writer; - Handle_TDocStd_Document document; + Handle(TDocStd_Document) document; document = new TDocStd_Document("Pace Test-StepExporter-"); - Handle_XCAFDoc_ShapeTool shapeTool; + Handle(XCAFDoc_ShapeTool) shapeTool; shapeTool = XCAFDoc_DocumentTool::ShapeTool(document->Main()); shapeTool->AddShape(AddTestStructure(nCount), Standard_True); STEPControl_StepModelType mode = STEPControl_AsIs; @@ -2795,8 +2670,7 @@ static Standard_Integer OCC7141 (Draw_Interpretor& di, Standard_Integer argc, co try { OCC_CATCH_SIGNALS if( writer.Transfer(document, mode)) { - IFSelect_ReturnStatus stat = - writer.Write("TestExportStructure.step"); + writer.Write(aFilePath.ToCString()); } } catch(OSD_Exception_STACK_OVERFLOW) { @@ -2940,8 +2814,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"); @@ -3154,8 +3028,8 @@ static Standard_Integer OCC7639 (Draw_Interpretor& di, Standard_Integer argc, co NCollection_Vector 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::Iterator it(vec); @@ -3256,18 +3130,6 @@ static Standard_Integer OCC7068 (Draw_Interpretor& di, Standard_Integer argc, co } } - // ObjectsInCollector - AIS_ListOfInteractive ListOfIO_2; - AISContext->ObjectsInCollector(ListOfIO_2); - di<< "ObjectsInCollector = " << ListOfIO_2.Extent() <<"\n"; - if (!ListOfIO_2.IsEmpty() ) { - AIS_ListIteratorOfListOfInteractive iter; - for (iter.Initialize(ListOfIO_2); iter.More() ; iter.Next() ) { - Handle(AIS_InteractiveObject) aIO=iter.Value(); - di<< GetMapOfAIS().Find1(aIO).ToCString() <<"\n"; - } - } - return 0; } @@ -3282,7 +3144,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(); @@ -3300,12 +3162,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< 2) { - aDeflection = atof(argv[2]); + aDeflection = Draw::Atof(argv[2]); } di<<"deflection="<< aDeflection << "\n"; - BRepMesh_IncrementalMesh aIMesh(aShape, aDeflection, Standard_False, M_PI/9.); + BRepMesh_IncrementalMesh aIMesh(aShape, aDeflection, Standard_False, M_PI / 9.); TopLoc_Location aLocation; Handle(Poly_Triangulation) aTriang = BRep_Tool::Triangulation(TopoDS::Face(aShape), aLocation); @@ -3354,7 +3216,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" ; } @@ -4657,7 +4519,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) { @@ -4761,7 +4623,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 @@ -4796,7 +4658,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) { @@ -4804,7 +4666,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 { @@ -4827,7 +4689,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 { @@ -4854,7 +4716,7 @@ static Standard_Integer OCC18612igesbrep (Draw_Interpretor& di, Standard_Integer if (!Reader.TransferOne (nent)) di<<"Transfer entity n0 "< DRAW Shape: "<>str_answer; - answer = atoi(str_answer); + answer = Draw::Atoi(str_answer); } if (answer <= 0 || answer > 3) continue; if (answer == 3) { @@ -4967,7 +4829,7 @@ static Standard_Integer OCC18612igesbrep (Draw_Interpretor& di, Standard_Integer if (!Reader.TransferOne(nent)) di<<"Transfer entity n0 "< DRAW Shape: "< aMap; aMap.Bind(anExtString, 0); @@ -5199,17 +5061,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); @@ -5230,14 +5092,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; @@ -5282,7 +5144,7 @@ Standard_Integer OCC22736 (Draw_Interpretor& di, Standard_Integer argc, const ch return 0; } -Standard_Integer OCC23429(Draw_Interpretor& di, +Standard_Integer OCC23429(Draw_Interpretor& /*di*/, Standard_Integer narg, const char** a) { if (narg < 4) return 1; @@ -5330,56 +5192,6 @@ Standard_Integer OCC23429(Draw_Interpretor& di, return 0; } -#include -//======================================================================= -//function : DumpArray -//purpose : -//======================================================================= -void DumpArray(const BOPTColStd_CArray1OfInteger& aC, - Draw_Interpretor& aDI) -{ - Standard_Integer iLength, iFactLength, iBlockLength; - // - iLength=aC.Length(); - iFactLength=aC.FactLength(); - iBlockLength=aC.BlockLength(); - // - aDI<< "Length: " < Standard_Integer CR23403 (Draw_Interpretor& di, Standard_Integer argc, const char ** argv) { @@ -5415,7 +5227,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]); //=================================================================== @@ -5430,9 +5242,9 @@ Standard_Integer CR23234 (Draw_Interpretor& di, Standard_Integer argc, const cha { aisContext->CloseAllContexts(); aisContext->RemoveAll(false); - aisContext->EraseSelected(false, false); + aisContext->EraseSelected(false); } - aisContext->EraseAll(false,false); + aisContext->EraseAll(false); Handle(Geom_Axis2Placement) trihedronAxis = new Geom_Axis2Placement(gp::XOY()); Handle(AIS_Trihedron) trihedron = new AIS_Trihedron(trihedronAxis); if (aMode) @@ -5466,7 +5278,6 @@ void QABugs::Commands_11(Draw_Interpretor& theCommands) { theCommands.Add("OCC136", "OCC136", __FILE__, OCC136, group); theCommands.Add("BUC60610","BUC60610 iges_input [name]",__FILE__,BUC60610,group); - theCommands.Add("BUC60661","BUC60661 file.igs",__FILE__,BUC60661, group); //==================================================== // @@ -5511,10 +5322,8 @@ void QABugs::Commands_11(Draw_Interpretor& theCommands) { theCommands.Add("OCC369", "OCC369 Shape", __FILE__, OCC369, group); theCommands.Add("OCC524", "OCC524 LowerVector UpperVector InitialValueVector LowerRowMatrix UpperRowMatrix LowerColMatrix UpperColMatrix InitialValueMatrix", __FILE__, OCC524, group); theCommands.Add("OCC525", "OCC525", __FILE__, OCC525, group); - theCommands.Add("OCC543", "OCC543 name", __FILE__, OCC543, group); //theCommands.Add("OCC578", "OCC578 shape1 shape2 shape3", __FILE__, OCC578, group); theCommands.Add("OCC578", "OCC578 shape1 shape2 shape3 [BRepAlgoAPI/BRepAlgo = 1/0]", __FILE__, OCC578, group); - theCommands.Add("OCC627", "OCC627", __FILE__, OCC627, group); theCommands.Add("OCC669", "OCC669 GUID", __FILE__, OCC669, group); theCommands.Add("OCC738_ShapeRef", "OCC738_ShapeRef", __FILE__, OCC738_ShapeRef, group); theCommands.Add("OCC738_Assembly", "OCC738_Assembly", __FILE__, OCC738_Assembly, group); @@ -5540,7 +5349,7 @@ void QABugs::Commands_11(Draw_Interpretor& theCommands) { theCommands.Add("OCC6046", "OCC6046 nb_of_vectors size", __FILE__, OCC6046, group); theCommands.Add("OCC5698", "OCC5698 wire", __FILE__, OCC5698, group); theCommands.Add("OCC6143", "OCC6143", __FILE__, OCC6143, group); - theCommands.Add("OCC7141", "OCC7141 [nCount]", __FILE__, OCC7141, group); + theCommands.Add("OCC7141", "OCC7141 [nCount] aPath", __FILE__, OCC7141, group); theCommands.Add("OCC7372", "OCC7372", __FILE__, OCC7372, group); theCommands.Add("OCC8169", "OCC8169 edge1 edge2 plane", __FILE__, OCC8169, group); theCommands.Add("OCC10138", "OCC10138 lower upper", __FILE__, OCC10138, group); @@ -5562,7 +5371,6 @@ void QABugs::Commands_11(Draw_Interpretor& theCommands) { theCommands.Add("OCC22586", "OCC22586 shape resshape", __FILE__, OCC22586, group); theCommands.Add("OCC22736", "OCC22736 X_mirrorFirstPoint Y_mirrorFirstPoint X_mirrorSecondPoint Y_mirrorSecondPoint X_p1 Y_p1 X_p2 Y_p2", __FILE__, OCC22736, group); theCommands.Add("OCC22744", "OCC22744", __FILE__, OCC22744, group); - theCommands.Add("bcarray", "bcarray", __FILE__, bcarray, group); theCommands.Add("OCC22762", "OCC22762 x1 y1 z1 x2 y2 z3", __FILE__, OCC22762, group); theCommands.Add("OCC22558", "OCC22558 x_vec y_vec z_vec x_dir y_dir z_dit x_pnt y_pnt z_pnt", __FILE__, OCC22558, group); theCommands.Add("CR23403", "CR23403 string", __FILE__, CR23403, group);