// purpose or non-infringement. Please see the License for the specific terms
// and conditions governing the rights and limitations under the License.
-
-
#include <stdio.h>
#include <QABugs.hxx>
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];
#include <BRepClass3d_SolidClassifier.hxx>
-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<<sbf;
+ TopoDS_Shape aS = DBRep::Get (theArgVec[1]);
+ if (aS.IsNull())
+ {
+ theDi << " Null Shape is not allowed here\n";
return 1;
}
-
- if (aS.ShapeType()!=TopAbs_SOLID) {
- Sprintf(sbf, " Shape type must be SOLID\n");
- di<<sbf;
+ else if (aS.ShapeType() != TopAbs_SOLID)
+ {
+ theDi << " Shape type must be SOLID\n";
return 1;
}
- //
- Standard_Real aTol=1.e-7;
- TCollection_AsciiString sIN("IN"), sOUT("OUT of"), sON("ON"), sUNKNOWN("UNKNOWN");
- TopAbs_State aState = TopAbs_UNKNOWN;
- gp_Pnt aP(8., 9., 10.);
-
- if (!DrawTrSurf::GetPoint(a[2], aP) ) {
- Sprintf(sbf, " Null Point is not allowed here\n");
- di<<sbf;
+
+ gp_Pnt aP (8., 9., 10.);
+ if (!DrawTrSurf::GetPoint (theArgVec[2], aP))
+ {
+ theDi << " Null Point is not allowed here\n";
return 1;
}
+ const Standard_Real aTol = (theArgNb == 4) ? Draw::Atof (theArgVec[3]) : 1.e-7;
- aTol=1.e-7;
- if (n==4) {
- aTol=Draw::Atof(a[3]);
- }
- //
- BRepClass3d_SolidClassifier aSC(aS);
- aSC.Perform(aP,aTol);
- //
- aState = aSC.State();
- //
- Sprintf(sbf, "The point is "); di<<sbf;
- //
- switch (aState) {
- case TopAbs_IN:
- Sprintf(sbf, sIN.ToCString());
- break;
- case TopAbs_OUT:
- Sprintf(sbf, sOUT.ToCString());
- break;
- case TopAbs_ON:
- Sprintf(sbf, sON.ToCString());
- break;
- case TopAbs_UNKNOWN:
- Sprintf(sbf, sUNKNOWN.ToCString());
- break;
- default:
- Sprintf(sbf, sUNKNOWN.ToCString());
- break;
- }
- di<<sbf;
- //
- Sprintf(sbf, " shape\n");
- di<<sbf;
+ BRepClass3d_SolidClassifier aSC (aS);
+ aSC.Perform (aP, aTol);
- return 0;
+ switch (aSC.State())
+ {
+ case TopAbs_IN: theDi << "The point is IN shape\n"; return 0;
+ case TopAbs_OUT: theDi << "The point is OUT of shape\n"; return 0;
+ case TopAbs_ON: theDi << "The point is ON shape\n"; return 0;
+ case TopAbs_UNKNOWN:
+ default: theDi << "The point is UNKNOWN shape\n"; return 0;
+ }
}
#include <OSD_Process.hxx>
di << aSStream1;
di<<"\n";
+ if (Matrix.RowNumber() > 1) {
+ Matrix(Matrix.LowerRow() + 1, Matrix.LowerCol()) += 1.;
+ }
Vector2.TMultiply(Vector, Matrix);
//Vector2.Dump(cout);
return 1;
}
- Standard_Boolean updateviewer = Standard_True, PutInCollector = Standard_True;
+ Standard_Boolean updateviewer = Standard_True;
ViewerTest_DoubleMapOfInteractiveAndName& aMap = GetMapOfAIS();
if (!aContext->HasOpenedContext()) {
aContext->OpenLocalContext();
}
- aContext->Erase(AISObj, updateviewer, PutInCollector);
+ aContext->Erase(AISObj, updateviewer);
aContext->UpdateCurrentViewer();
aContext->Display(AISObj, updateviewer);
aContext->UpdateCurrentViewer();
static char sarr[2000];
static int si=1;
+
+#ifdef WNT
static int StackOverflow(int i = -1)
{
char arr[2000];
si = 0;
memcpy(arr,sarr,2000);
arr[1999]=0;
- int n = strlen(arr), s=0;
+ int n = (int)strlen(arr), s=0;
while (n--)
s += StackOverflow(i-1);
return i + s + StackOverflow(i-1);
return i;
}
-#ifdef WNT
// this code does not work with optimize mode on Windows
#pragma optimize( "", off )
#endif
{
int nCount = 10;
- if (argc > 2)
+ if (argc > 3)
{
- di << "Usage : " << argv[0] << " [nCount]" << "\n";
+ di << "Usage : " << argv[0] << " [nCount] path" << "\n";
return 1;
}
- if (argc > 1)
+ if (argc > 2)
nCount = Draw::Atoi(argv[1]);
+ TCollection_AsciiString aFilePath = argv[2];
STEPCAFControl_Writer writer;
Handle_TDocStd_Document document;
document = new TDocStd_Document("Pace Test-StepExporter-");
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) {
}
}
- // 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;
}
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;
return 0;
}
-#include <BOPTColStd_CArray1OfInteger.hxx>
-//=======================================================================
-//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: " <<iLength << "\n";
- aDI<< "FactLength: " <<iFactLength << "\n";
- aDI<< "BlockLength: " <<iBlockLength << "\n";
-}
-//=======================================================================
-//function : bcarray
-//purpose :
-//=======================================================================
-Standard_Integer bcarray (Draw_Interpretor& di, Standard_Integer argc, const char ** argv)
-{
-
- if (argc != 1) {
- di << "Usage : " << argv[0] << "\n";
- return 1;
- }
-
- Standard_Integer i, aBL;
- BOPTColStd_CArray1OfInteger aC;
- //
- aBL=100000;
- aC.SetBlockLength(aBL);
- //
- for (i=1; i<=10; ++i) {
- aC.Append(-i*10);
- }
- di<< "\nstate before release the unused memory\n";
- DumpArray(aC, di);
- //
- aC.Purge();
- //
- di<< "\nstate after release the unused memory\n";
- DumpArray(aC, di);
- //
- return 0;
-}
-
#include <ExprIntrp_GenExp.hxx>
Standard_Integer CR23403 (Draw_Interpretor& di, Standard_Integer argc, const char ** argv)
{
{
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)
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);
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);