1 // Created on: 2002-03-18
2 // Created by: QA Admin
3 // Copyright (c) 2002-2012 OPEN CASCADE SAS
5 // The content of this file is subject to the Open CASCADE Technology Public
6 // License Version 6.5 (the "License"). You may not use the content of this file
7 // except in compliance with the License. Please obtain a copy of the License
8 // at http://www.opencascade.org and read it completely before using this file.
10 // The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
11 // main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
13 // The Original Code and all software distributed under the License is
14 // distributed on an "AS IS" basis, without warranty of any kind, and the
15 // Initial Developer hereby disclaims all such warranties, including without
16 // limitation, any warranties of merchantability, fitness for a particular
17 // purpose or non-infringement. Please see the License for the specific terms
18 // and conditions governing the rights and limitations under the License.
26 #include <Draw_Interpretor.hxx>
28 #include <DrawTrSurf.hxx>
29 #include <AIS_InteractiveContext.hxx>
30 #include <ViewerTest.hxx>
31 #include <ViewerTest_EventManager.hxx>
32 #include <AIS_Shape.hxx>
33 #include <TopoDS_Shape.hxx>
35 #include <Geom_Circle.hxx>
36 #include <Geom_Ellipse.hxx>
37 #include <Geom_Plane.hxx>
39 #include <Geom2d_Curve.hxx>
40 #include <GeomAPI.hxx>
41 #include <Geom2dAdaptor_Curve.hxx>
42 #include <Geom2dGcc_QualifiedCurve.hxx>
43 #include <Geom2dGcc_Lin2d2Tan.hxx>
44 #include <Geom2d_Line.hxx>
45 #include <BRepBuilderAPI_MakeEdge.hxx>
46 #include <TopoDS_Edge.hxx>
47 #include <Precision.hxx>
48 #include <Geom2d_Circle.hxx>
49 #include <Geom2dGcc_MyQCurve.hxx>
50 #include <GccEnt_QualifiedCirc.hxx>
51 #include <Geom2dGcc_MyL2d2Tan.hxx>
52 #include <BRepBuilderAPI_MakeWire.hxx>
53 #include <TopExp_Explorer.hxx>
55 #include <TopoDS_Wire.hxx>
56 #include <BRep_Tool.hxx>
57 #include <gp_Circ.hxx>
58 #include <BRepOffsetAPI_MakePipeShell.hxx>
59 #include <AIS_Trihedron.hxx>
60 #include <Geom_Axis2Placement.hxx>
61 #include <V3d_View.hxx>
62 #include <ViewerTest_Tool.hxx>
63 #include <BRepBuilderAPI_MakeVertex.hxx>
64 #include <AIS_LengthDimension.hxx>
65 #include <AIS_RadiusDimension.hxx>
66 #include <BRepPrimAPI_MakeBox.hxx>
67 #include <GeomAdaptor_Surface.hxx>
68 #include <Extrema_ExtPS.hxx>
69 #include <Geom_CartesianPoint.hxx>
70 #include <Geom2d_CartesianPoint.hxx>
71 #include <Geom2dGcc_Circ2d3Tan.hxx>
72 #include <Aspect_Window.hxx>
74 #include <TopoDS_Compound.hxx>
75 #include <TopoDS_CompSolid.hxx>
76 #include <StdSelect_ShapeTypeFilter.hxx>
77 #include <QABugs_MyText.hxx>
78 #include <Prs3d_Projector.hxx>
79 #include <HLRAlgo_Projector.hxx>
80 #include <Standard_ErrorHandler.hxx>
81 #include <Font_NameOfFont.hxx>
83 static Standard_Integer BUC60842 (Draw_Interpretor& di, Standard_Integer /*argc*/,const char ** /*argv*/)
85 Standard_Character abuf[16];
86 //Standard_Character * abuf = new Standard_Character[16];
88 Standard_CString st = abuf;
90 Handle(Geom_Circle) cir = new Geom_Circle (gp_Ax2 (gp_Pnt (823.687192, 502.366825, 478.960440), gp_Dir (0.173648, 0.984808, 0.000000), gp_Dir (-0.932169, 0.164367, -0.322560)), 50);
91 Handle(Geom_Ellipse) ell = new Geom_Ellipse (gp_Ax2 (gp_Pnt (1262.224429, 425.040878, 363.609716), gp_Dir (0.173648, 0.984808, 0.000000), gp_Dir (-0.932169, 0.164367, -0.322560)), 150, 100);
92 Handle(Geom_Plane) plne = new Geom_Plane (gp_Ax3 (gp_Ax2 (gp_Pnt (1262.224429, 425.040878, 363.609716), gp_Dir (0.173648, 0.984808, 0.000000), gp_Dir (-0.932169, 0.164367, -0.322560))));
94 Handle(AIS_InteractiveContext) aContext = ViewerTest::GetAISContext();
96 gp_Pln pln = plne->Pln();
97 Handle(Geom2d_Curve) curve2d = GeomAPI::To2d (ell, pln);
99 DrawTrSurf::Set(st,curve2d);
100 if(!aContext.IsNull()) {
101 Handle(AIS_Shape) aisp =
102 new AIS_Shape (BRepBuilderAPI_MakeEdge(GeomAPI::To3d(curve2d, pln)).Edge());
103 aContext->Display (aisp);
106 Handle(Geom2d_Curve) fromcurve2d = GeomAPI::To2d (cir, pln);
108 DrawTrSurf::Set(st,fromcurve2d);
109 if(!aContext.IsNull()) {
110 Handle(AIS_Shape) aisp =
111 new AIS_Shape (BRepBuilderAPI_MakeEdge(GeomAPI::To3d(fromcurve2d, pln)).Edge());
112 aContext->Display (aisp);
115 Geom2dAdaptor_Curve acur (curve2d), afromcur (fromcurve2d);
116 Geom2dGcc_QualifiedCurve qcur (acur, GccEnt_outside);
117 Geom2dGcc_QualifiedCurve qfromcur (afromcur, GccEnt_outside);
118 Geom2dGcc_Lin2d2Tan lintan (qcur, qfromcur, 0.1, 0.0, 0.0);
119 Standard_Integer i=0;
120 for(i=0;i<lintan.NbSolutions();i++) {
121 Sprintf(abuf,"lintan_%d",i);
122 Handle(Geom2d_Line) glin = new Geom2d_Line(lintan.ThisSolution(i));
123 DrawTrSurf::Set(st,glin);
124 if(!aContext.IsNull()) {
125 Handle(AIS_Shape) aisp =
126 new AIS_Shape (BRepBuilderAPI_MakeEdge(GeomAPI::To3d(glin, pln)).Edge()); aContext->Display (aisp);
129 di << " Is Done = \n" << (Standard_Integer) lintan.IsDone();
133 static Standard_Integer BUC60843 (Draw_Interpretor& di, Standard_Integer argc,const char ** argv)
135 if (argc != 4 && argc != 5 && argc != 6 && argc != 7) {
136 di << "Usage : " << argv[0] << "result_shape name_of_circle name_of_curve [ par1 [ tol ] ]" << "\n";
140 Standard_Real par1 = 0.0, par2 = 0.0;
141 Standard_Real tol = Precision::Angular();
143 par1 = Draw::Atof(argv[4]);
145 par2 = Draw::Atof(argv[5]);
147 tol = Draw::Atof(argv[6]);
148 Handle(Geom2d_Curve) aCur2d1 = DrawTrSurf::GetCurve2d(argv[2]);
149 Handle(Geom2d_Curve) aCur2d2 = DrawTrSurf::GetCurve2d(argv[3]);
150 if (aCur2d1.IsNull() || aCur2d2.IsNull()) {
151 di << "Faulty : not curves" << "\n";
154 Standard_Boolean c1IsCircle = Standard_False;
155 Handle(Geom2d_Circle) aCir2d = Handle(Geom2d_Circle)::DownCast(aCur2d1);
156 if (!aCir2d.IsNull()) {
157 c1IsCircle = Standard_True;
158 if (argc == 6) tol = Draw::Atof(argv[5]);
161 Geom2dAdaptor_Curve acur(aCur2d2);
162 Geom2dGcc_MyQCurve qcur(acur, GccEnt_unqualified);
163 GccEnt_QualifiedCirc qfromcur(aCir2d->Circ2d(), GccEnt_unqualified);
164 Geom2dGcc_MyL2d2Tan lintan(qfromcur, qcur , par1, tol);
165 if (lintan.IsDone()) {
166 gp_Lin2d lin = lintan.ThisSolution();
167 Handle(Geom2d_Line) glin = new Geom2d_Line(lin);
168 DrawTrSurf::Set(argv[1], glin);
170 di << "Faulty : tangent line is not done." << "\n";
174 Geom2dAdaptor_Curve acur1(aCur2d1);
175 Geom2dAdaptor_Curve acur2(aCur2d2);
176 Geom2dGcc_MyQCurve qcur1(acur1, GccEnt_unqualified);
177 Geom2dGcc_MyQCurve qcur2(acur2, GccEnt_unqualified);
178 Geom2dGcc_MyL2d2Tan lintan(qcur1, qcur2 , par1, par2, tol);
179 if (lintan.IsDone()) {
180 gp_Lin2d lin = lintan.ThisSolution();
181 Handle(Geom2d_Line) glin = new Geom2d_Line(lin);
182 DrawTrSurf::Set(argv[1], glin);
184 di << "Faulty : tangent line is not done." << "\n";
190 static Standard_Integer BUC60970 (Draw_Interpretor& di, Standard_Integer argc, const char ** argv)
194 di << "Usage : " << argv[0] << " shape result" <<"\n";
198 Handle(AIS_InteractiveContext) aContext = ViewerTest::GetAISContext();
199 if(aContext.IsNull()) {
200 di << "use 'vinit' command before " << argv[0] << "\n";
204 TopoDS_Shape aResult = DBRep::Get(argv[1]);
206 BRepBuilderAPI_MakeWire bRepSpineWire;
207 TopExp_Explorer exp_(aResult, TopAbs_WIRE);
209 Standard_Integer i = 0;
210 for(;exp_.More();exp_.Next()){
212 bRepSpineWire.Add(TopoDS::Wire(exp_.Current()));
215 //printf("total no of wires are ............. %d\n", i);
216 di << "total no of wires are ............. " << i << "\n";
218 TopoDS_Wire spineWire = bRepSpineWire.Wire();
219 aContext->Display(new AIS_Shape(spineWire));
221 DBRep::Set("slineW",spineWire);
223 TopExp_Explorer spineWireExp(spineWire, TopAbs_EDGE);
224 Standard_Real first, last;
225 Handle_Geom_Curve curl_ = BRep_Tool::Curve(TopoDS::Edge(spineWireExp.Current()), first, last);
228 curl_->D1(first, firstPnt, tanVec);
230 gp_Dir tanDir(tanVec.X(), tanVec.Y(), tanVec.Z());
231 gp_Ax2 gpAx2(firstPnt, tanDir);
232 gp_Circ gpCirc(gpAx2, 2.5);
233 BRepBuilderAPI_MakeWire aMWire(BRepBuilderAPI_MakeEdge(new Geom_Circle(gpCirc)).Edge());
234 TopoDS_Wire topoWire(aMWire);
235 aContext->Display(new AIS_Shape(topoWire));
237 DBRep::Set("topoW",topoWire);
239 BRepOffsetAPI_MakePipeShell bRepPipe(spineWire);
240 bRepPipe.Add(topoWire);
243 aContext->Display(new AIS_Shape(bRepPipe.Shape()));
245 DBRep::Set(argv[2],bRepPipe.Shape());
250 static Standard_Integer BUC60818(Draw_Interpretor& di, Standard_Integer argc, const char ** argv)
254 di << "Usage : " << argv[0] << "\n";
258 Handle(AIS_InteractiveContext) myAISContext = ViewerTest::GetAISContext();
259 if(myAISContext.IsNull())
261 di << "use 'vinit' command before " << argv[0] << "\n";
266 Handle(AIS_Trihedron) aTrihedron;
267 Handle(Geom_Axis2Placement) aTrihedronAxis=new Geom_Axis2Placement(gp::XOY());
268 aTrihedron=new AIS_Trihedron(aTrihedronAxis);
269 myAISContext->Display(aTrihedron);
271 myAISContext->OpenLocalContext();
272 myAISContext->Load(aTrihedron,0);
274 myAISContext->SetAutomaticHilight( Standard_False );
276 Handle(V3d_View) myV3dView = ViewerTest::CurrentView();
278 myV3dView->Project(0,0,0,Xv,Yv);
280 Standard_Integer Xp,Yp;
281 myV3dView->Convert(Xv,Yv,Xp,Yp);
283 myAISContext->MoveTo( Xp,Yp, myV3dView );
284 myAISContext->MoveTo( Xp,Yp, myV3dView );
286 if (myAISContext->HasDetected( ))
287 di << "has detected shape : OK" << "\n";
288 else di << "has detected shape : bugged - Faulty " << "\n";
290 myAISContext->SetAutomaticHilight( Standard_True );
295 static Standard_Integer BUC60915_1(Draw_Interpretor& di, Standard_Integer argc, const char ** /*argv*/)
298 di<<"Function don't has parameters"<<"\n";
302 Handle(AIS_InteractiveContext) context= ViewerTest_Tool::MakeContext ("buc60915");
303 ViewerTest_Tool::InitViewerTest (context);
305 //The following dimesion code has problems regarding arrow_size. The desired effect is not produced.
306 /***************************************/
308 /***************************************/
309 gp_Pnt p1 = gp_Pnt(602.51,50.,0.);
310 gp_Pnt p2 = gp_Pnt(602.51,200.,0.);
311 gp_Pnt p3 = gp_Pnt(102.51,200.,0.);
312 gp_Pnt p4 = gp_Pnt(102.51,170.,0.);
313 gp_Pnt p5 = gp_Pnt(502.51,170.,0.);
314 gp_Pnt p6 = gp_Pnt(502.51,80.,0.);
315 gp_Pnt p7 = gp_Pnt(102.51,80.,0.);
316 gp_Pnt p8 = gp_Pnt(102.51,50.,0.);
317 TopoDS_Vertex V1 = BRepBuilderAPI_MakeVertex(p1);
318 TopoDS_Vertex V2 = BRepBuilderAPI_MakeVertex(p2);
319 TopoDS_Vertex V3 = BRepBuilderAPI_MakeVertex(p3);
320 TopoDS_Vertex V4 = BRepBuilderAPI_MakeVertex(p4);
321 TopoDS_Vertex V5 = BRepBuilderAPI_MakeVertex(p5);
322 TopoDS_Vertex V6 = BRepBuilderAPI_MakeVertex(p6);
323 TopoDS_Vertex V7 = BRepBuilderAPI_MakeVertex(p7);
324 TopoDS_Vertex V8 = BRepBuilderAPI_MakeVertex(p8);
325 gp_Pnt plnpt(0, 0, 0);
326 gp_Dir plndir(0, 0, 1);
327 Handle(Geom_Plane) pln = new Geom_Plane(plnpt,plndir);
328 /***************************************/
329 //dimension "L 502.51"
330 /***************************************/
331 Handle(AIS_LengthDimension) len = new AIS_LengthDimension(V2, V3, pln, 502.51, "502.51");
332 len->SetPosition(gp_Pnt(350, 250, 0));
333 len->SetTypeOfDist(AIS_TOD_Horizontal);
334 len->SetArrowSize(30.0);
335 context->Display(len);
336 /***************************************/
338 /***************************************/
339 Handle(AIS_LengthDimension) len1 = new AIS_LengthDimension(V4, V7, pln, 90, "90");
340 len1->SetPosition(gp_Pnt(70, 120, 0));
341 len1->SetTypeOfDist(AIS_TOD_Vertical);
342 len1->SetArrowSize(100.0);
343 context->Display(len1);
344 /***************************************/
346 /***************************************/
347 Handle(AIS_LengthDimension) len2 = new AIS_LengthDimension(V1, V2, pln, 150, "150",gp_Pnt(650, 120, 0),DsgPrs_AS_BOTHAR,
348 AIS_TOD_Vertical, 100.0 );
349 //len2->SetPosition(gp_Pnt(650, 120, 0));
350 //len2->SetTypeOfDist(AIS_TOD_Vertical);
351 //len1->SetArrowSize(100.0);
352 context->Display(len2);
353 /***************************************/
354 //dimension "R 88.58"
355 /***************************************/
356 gp_Circ cir = gp_Circ(gp_Ax2(gp_Pnt(191.09, -88.58, 0), gp_Dir(0, 0, 1)), 88.58);
357 TopoDS_Edge E1 = BRepBuilderAPI_MakeEdge(cir,gp_Pnt(191.09,0,0.),gp_Pnt(191.09,-177.16,0.) );
358 Handle(AIS_RadiusDimension) dim1 = new AIS_RadiusDimension(E1,88.58, "R 88.58",gp_Pnt(-30.0, -80.0, 0.0),DsgPrs_AS_BOTHAR,
360 context->Display(dim1);
361 /***************************************/
362 //dimension "R 43.80"
363 /***************************************/
364 gp_Circ cir1 = gp_Circ(gp_Ax2(gp_Pnt(191.09, -88.58, 0), gp_Dir(0, 0, 1)), 43.80);
365 TopoDS_Edge E_cir1 = BRepBuilderAPI_MakeEdge(cir1);
366 dim1 = new AIS_RadiusDimension(E_cir1,43.80, "R 43.80",gp_Pnt(0.0, -50.0, 0.0),DsgPrs_AS_LASTAR, 60.0 );
367 context->Display(dim1);
368 /***************************************/
369 //dimension "R 17.86"
370 /***************************************/
371 gp_Circ cir2 = gp_Circ(gp_Ax2(gp_Pnt(566.11, -88.58, 0), gp_Dir(0, 0, -1)), 17.86);
372 TopoDS_Edge E_cir2 = BRepBuilderAPI_MakeEdge(cir2);
373 dim1 = new AIS_RadiusDimension(E_cir2,17.86, "R 17.86",gp_Pnt(600.0, -50.0, 0.0),DsgPrs_AS_LASTAR, 40.0 );
374 context->Display(dim1);
379 static Standard_Integer OCC138 (Draw_Interpretor& di, Standard_Integer /*argc*/, const char ** argv)
381 Handle(AIS_InteractiveContext) aContext = ViewerTest::GetAISContext();
382 if(aContext.IsNull()) {
383 di << "use 'vinit' command before " << argv[0] << "\n";
387 BRepPrimAPI_MakeBox box1(gp_Pnt(0, 0, 0), gp_Pnt(100, 100, 100));
388 BRepPrimAPI_MakeBox box2(gp_Pnt(120, 120, 120), gp_Pnt(300, 300,300));
389 BRepPrimAPI_MakeBox box3(gp_Pnt(320, 320, 320), gp_Pnt(500, 500,500));
391 Handle_AIS_Shape ais1 = new AIS_Shape(box1.Shape());
392 Handle_AIS_Shape ais2 = new AIS_Shape(box2.Shape());
393 Handle_AIS_Shape ais3 = new AIS_Shape(box3.Shape());
395 aContext->Display(ais1);
396 aContext->Display(ais2);
397 aContext->Display(ais3);
399 aContext->AddOrRemoveCurrentObject(ais1);
400 aContext->AddOrRemoveCurrentObject(ais2);
401 aContext->AddOrRemoveCurrentObject(ais3);
403 di << "\n No of currents = " << aContext->NbCurrents();
405 aContext->InitCurrent();
408 while(aContext->MoreCurrent())
410 di << "\n count is = " << count++;
411 Handle_AIS_InteractiveObject ais = aContext->Current();
412 aContext->AddOrRemoveCurrentObject(ais);
413 aContext->InitCurrent();
419 static Standard_Integer BUC60821(Draw_Interpretor& di, Standard_Integer argc,const char ** argv )
423 di << "Usage: " << argv[0] << " TextHight1 TextHight2 TextHight2";
427 Handle(AIS_InteractiveContext) aContext = ViewerTest::GetAISContext();
429 if(aContext.IsNull())
431 di << "use 'vinit' command before " << argv[0] << "\n";
435 Handle(QABugs_MyText) txt1 = new QABugs_MyText("Gosha1",gp_Pnt(0,0,0),Font_NOF_ASCII_SIMPLEX,Quantity_NOC_RED,Draw::Atoi(argv[1]));
436 aContext->Display(txt1);
438 Handle(QABugs_MyText) txt2 = new QABugs_MyText("Gosha2",gp_Pnt(0,0,100),Font_NOF_ASCII_SIMPLEX,Quantity_NOC_YELLOW,Draw::Atoi(argv[2]));
439 aContext->Display(txt2);
441 Handle(QABugs_MyText) txt3 = new QABugs_MyText("Gosha3",gp_Pnt(0,100,100),Font_NOF_ASCII_SIMPLEX,Quantity_NOC_SKYBLUE,Draw::Atoi(argv[3]));
442 aContext->Display(txt3);
447 static int geom_get_2Dpt_from_3Dpt(const gp_Pnt& pnt3d, const gp_Pln& pln, gp_Pnt2d& pnt2d)
450 Handle_Geom_Plane gpln = new Geom_Plane(pln);
451 GeomAdaptor_Surface adsur(gpln);
452 Extrema_ExtPS extps(pnt3d, adsur, 0.001, 0.001);
456 for(index=1; index<= extps.NbExt(); index++ )
458 Extrema_POnSurf pons = extps.Point(index);
460 pons.Parameter(U, V);
461 pnt2d.SetCoord(U, V);
468 static Standard_Integer OCC353 (Draw_Interpretor& di, Standard_Integer , const char ** )
470 gp_Ax2 ax21( gp_Pnt(100,0,0), gp_Dir(0,0,1) );
471 Handle_Geom_Circle h_cir1 = new Geom_Circle( ax21, 25 );
473 gp_Ax2 ax22( gp_Pnt(-100,0,0), gp_Dir(0,0,1) );
474 Handle_Geom_Circle h_cir2 = new Geom_Circle( ax22, 25 );
476 gp_Pln refpln( gp_Pnt(0,0,0), gp_Dir(0,0,1) );
477 Handle_Geom2d_Curve cir2d1 = GeomAPI::To2d(h_cir1, refpln);
478 Handle_Geom2d_Curve cir2d2 = GeomAPI::To2d(h_cir2, refpln);
480 Geom2dAdaptor_Curve adop1(cir2d1);
481 Geom2dAdaptor_Curve adop2(cir2d2);
483 Geom2dGcc_QualifiedCurve qcur1(adop1, GccEnt_enclosing);
484 Geom2dGcc_QualifiedCurve qcur2(adop2, GccEnt_enclosing);
486 Handle_Geom_CartesianPoint h_carpt = new Geom_CartesianPoint(0,175,0);
488 gp_Pnt pt3d = h_carpt->Pnt();
490 geom_get_2Dpt_from_3Dpt(pt3d, refpln, pt2d);
494 DrawTrSurf::Set(st,cir2d1);
496 DrawTrSurf::Set(st,cir2d2);
498 DrawTrSurf::Set(st,pt2d);
500 Handle_Geom2d_CartesianPoint pt = new Geom2d_CartesianPoint(pt2d);
501 Geom2dGcc_Circ2d3Tan sol( qcur1, qcur2, pt, 0.001, 0.0, 0.0);
504 Standard_Character buf[10];
508 res = sol.NbSolutions();
509 for(Standard_Integer i=1;i<=res;i++) {
510 Handle(Geom2d_Circle) aC = new Geom2d_Circle(sol.ThisSolution(i));
511 Sprintf(buf,"Result_%d",i);
513 DrawTrSurf::Set(st,aC);
517 di << "\n Faulty: no solutions found ";
518 //printf("\n Faulty: no solutions found ");
520 //printf("\n Num of solutions are %d ", res );
521 di << "\n Num of solutions are " << res << " ";
526 static Standard_Integer OCC280 (Draw_Interpretor& di, Standard_Integer argc, const char ** argv)
528 Handle(AIS_InteractiveContext) aContext = ViewerTest::GetAISContext();
529 if(aContext.IsNull())
531 di << "use 'vinit' command before " << argv[0] << "\n";
535 di << "ERROR : Usage : " << argv[0] << " hlr=0/1 setsurfecedetail=0/1; set perspecrive view" << "\n";
539 Standard_Integer HLR = Draw::Atoi(argv[1]);
544 Handle(V3d_View) anOldView = ViewerTest::CurrentView();
545 Handle(V3d_Viewer) aViewer = ViewerTest::GetViewerFromContext();
546 if (Draw::Atoi (argv[2]))
548 aViewer->SetDefaultSurfaceDetail (V3d_TEX_ALL);
550 aViewer->SetDefaultTypeOfView (V3d_PERSPECTIVE);
552 Handle(Aspect_Window) asp = anOldView->Window();
553 aViewer->SetViewOff (anOldView);
555 Handle(V3d_View) aNewView = aViewer->CreateView();
556 ViewerTest::CurrentView (aNewView);
558 aNewView->SetWindow (asp);
559 if (!asp->IsMapped()) asp->Map();
566 // replace view in event manager
567 ViewerTest::UnsetEventManager();
568 ViewerTest::SetEventManager (new ViewerTest_EventManager (aNewView, ViewerTest::GetAISContext()));
572 aNewView->SetDegenerateModeOff();
578 static Standard_Integer OCC232 (Draw_Interpretor& di, Standard_Integer argc, const char ** argv)
580 Handle(AIS_InteractiveContext) aContext = ViewerTest::GetAISContext();
581 if(aContext.IsNull()) {
582 di << "use 'vinit' command before " << argv[0] << "\n";
586 BRep_Builder builder;
587 TopoDS_Compound comp;
588 TopoDS_CompSolid cs1, cs2;
590 builder.MakeCompound(comp);
591 builder.MakeCompSolid(cs1);
592 builder.MakeCompSolid(cs2);
594 TopoDS_Shape sh1 = BRepPrimAPI_MakeBox(gp_Pnt(0, 0, 0), 100, 100, 100).Shape();
595 TopoDS_Shape sh2 = BRepPrimAPI_MakeBox(gp_Pnt(100, 0, 0), 100, 100, 100).Shape();
596 TopoDS_Shape sh3 = BRepPrimAPI_MakeBox(gp_Pnt(200, 0, 0), 100, 100, 100).Shape();
597 builder.Add(cs1, sh1);
598 builder.Add(cs1, sh2);
599 builder.Add(cs1, sh3);
601 TopoDS_Shape sh4 = BRepPrimAPI_MakeBox(gp_Pnt(0, 500, 0), 100, 100, 100).Shape();
602 TopoDS_Shape sh5 = BRepPrimAPI_MakeBox(gp_Pnt(100, 500, 0), 100, 100, 100).Shape();
603 TopoDS_Shape sh6 = BRepPrimAPI_MakeBox(gp_Pnt(200, 500, 0), 100, 100, 100).Shape();
605 builder.Add(cs2, sh4);
606 builder.Add(cs2, sh5);
607 builder.Add(cs2, sh6);
609 builder.Add(comp, cs1);
610 builder.Add(comp, cs2);
612 Handle_AIS_Shape ais = new AIS_Shape(comp);
613 aContext->Display(ais);
615 TopExp_Explorer exp(comp, TopAbs_COMPSOLID);
618 //printf("\n TopAbs_COMPSOLID is there \n");
619 di << "\n TopAbs_COMPSOLID is there \n";
623 Handle (StdSelect_ShapeTypeFilter) filt = new StdSelect_ShapeTypeFilter(TopAbs_COMPSOLID);
624 aContext->AddFilter(filt);
625 aContext->CloseAllContexts();
626 aContext->OpenLocalContext();
627 aContext->ActivateStandardMode(TopAbs_SOLID);
632 static Standard_Integer OCC138LC (Draw_Interpretor& di, Standard_Integer /*argc*/, const char ** argv)
634 Handle(AIS_InteractiveContext) aContext = ViewerTest::GetAISContext();
635 if(aContext.IsNull()) {
636 di << "use 'vinit' command before " << argv[0] << "\n";
640 BRepPrimAPI_MakeBox box1(gp_Pnt(0, 0, 0), gp_Pnt(100, 100, 100));
641 BRepPrimAPI_MakeBox box2(gp_Pnt(120, 120, 120), gp_Pnt(300, 300,300));
642 BRepPrimAPI_MakeBox box3(gp_Pnt(320, 320, 320), gp_Pnt(500, 500,500));
644 Handle_AIS_Shape ais1 = new AIS_Shape(box1.Shape());
645 Handle_AIS_Shape ais2 = new AIS_Shape(box2.Shape());
646 Handle_AIS_Shape ais3 = new AIS_Shape(box3.Shape());
648 aContext->Display(ais1);
649 aContext->Display(ais2);
650 aContext->Display(ais3);
652 aContext->AddOrRemoveSelected(ais1);
653 aContext->AddOrRemoveSelected(ais2);
654 aContext->AddOrRemoveSelected(ais3);
656 di << "\n No of selected = " << aContext->NbSelected();
658 aContext->InitSelected();
661 while(aContext->MoreSelected())
663 di << "\n count is = %d" << count++;
664 Handle_AIS_InteractiveObject ais = aContext->SelectedInteractive();
665 aContext->AddOrRemoveSelected(ais);
666 aContext->InitSelected();
672 static Standard_Integer OCC189 (Draw_Interpretor& di, Standard_Integer /*argc*/, const char ** argv)
674 Handle(AIS_InteractiveContext) aContext1 = ViewerTest::GetAISContext();
675 if(aContext1.IsNull()) {
676 di << "use 'vinit' command before " << argv[0] << "\n";
679 Handle(AIS_InteractiveContext) aContext2 = ViewerTest::GetAISContext();
680 if(aContext2.IsNull()) {
681 di << "use 'vinit' command before " << argv[0] << "\n";
685 BRepPrimAPI_MakeBox box1(gp_Pnt(0, 0, 0), gp_Pnt(100, 100, 100));
686 BRepPrimAPI_MakeBox box2(gp_Pnt(120, 120, 120), gp_Pnt(300, 300, 300));
687 BRepPrimAPI_MakeBox box3(gp_Pnt(320, 320, 320), gp_Pnt(500, 500, 500));
689 Handle_AIS_Shape ais1 = new AIS_Shape(box1.Shape());
690 Handle_AIS_Shape ais2 = new AIS_Shape(box2.Shape());
691 Handle_AIS_Shape ais3 = new AIS_Shape(box3.Shape());
693 aContext1->Display(ais1);
694 aContext1->Display(ais2);
695 aContext1->Display(ais3);
697 aContext2->Display(ais1);
698 aContext2->Display(ais2);
699 aContext2->Display(ais3);
701 aContext1->AddOrRemoveCurrentObject(ais1);
702 aContext1->AddOrRemoveCurrentObject(ais2);
703 aContext1->AddOrRemoveCurrentObject(ais3);
705 di << "\n Stage : 1";
706 di << "\n \t No of currents on aContext1 = " << aContext1->NbCurrents();
707 di << "\n \t No of currents on aContext2 = " << aContext2->NbCurrents() << "\n\n";
709 di << "\n aContext1->IsCurrent = " << (Standard_Integer) aContext1->IsCurrent(ais1) << ", aContext2->IsCurrent = " << (Standard_Integer) aContext2->IsCurrent(ais1) << " ";
711 aContext2->AddOrRemoveCurrentObject(ais1);
712 aContext2->AddOrRemoveCurrentObject(ais2);
713 aContext2->AddOrRemoveCurrentObject(ais3);
715 di << "\n Stage : 2";
716 di << "\n \t No of currents on aContext1 = " << aContext1->NbCurrents();
717 di << "\n \t No of currents on aContext2 = " << aContext2->NbCurrents() << "\n\n";
719 aContext1->InitCurrent();
721 while(aContext1->MoreCurrent())
723 di << "\n count1 is = " << count1++;
724 Handle_AIS_InteractiveObject ais = aContext1->Current();
725 aContext1->AddOrRemoveCurrentObject(ais);
726 aContext1->InitCurrent();
729 di << "\n Stage : 3";
730 di << "\n \t No of currents on aContext1 = " << aContext1->NbCurrents();
731 di << "\n \t No of currents on aContext2 = " << aContext2->NbCurrents() << "\n\n";
733 aContext2->InitCurrent();
735 while(aContext2->MoreCurrent())
737 di << "\n count2 is = " << count2++;
738 Handle_AIS_InteractiveObject ais = aContext2->Current();
739 aContext2->AddOrRemoveCurrentObject(ais);
740 aContext2->InitCurrent();
743 di << "\n\n Stage : 4";
744 di << "\n \t No of currents on aContext1 = " << aContext1->NbCurrents();
745 di << "\n \t No of currents on aContext2 = " << aContext2->NbCurrents();
750 #include <BRepBndLib.hxx>
752 //=======================================================================
755 //=======================================================================
756 static Standard_Integer OCC566(Draw_Interpretor& di,Standard_Integer n,const char ** a)
759 di<<"Usage: " << a[0] << " shape [ xmin ymin zmin xmax ymax zmax]"<<"\n";
762 TopoDS_Shape S = DBRep::Get(a[1]);
763 if (S.IsNull()) return 1;
765 BRepBndLib::AddClose(S,B);
766 Standard_Real axmin,aymin,azmin,axmax,aymax,azmax;
767 B.Get(axmin,aymin,azmin,axmax,aymax,azmax);
768 di << axmin<<" "<< aymin<<" "<< azmin<<" "<< axmax<<" "<< aymax<<" "<< azmax;
770 Draw::Set(a[2],axmin) ;
771 Draw::Set(a[3],aymin) ;
772 Draw::Set(a[4],azmin) ;
773 Draw::Set(a[5],axmax) ;
774 Draw::Set(a[6],aymax) ;
775 Draw::Set(a[7],azmax) ;
780 #include <BRepFilletAPI_MakeFillet.hxx>
781 //=======================================================================
784 //=======================================================================
785 static Standard_Integer OCC570 (Draw_Interpretor& di, Standard_Integer argc,const char ** argv)
788 di<<"Usage: " << argv[0] << " result"<<"\n";
792 BRepPrimAPI_MakeBox mkBox(100.,100.,100.);
793 TopoDS_Shape aBox = mkBox.Shape();
795 TopExp_Explorer aExp;
796 aExp.Init(aBox,TopAbs_WIRE);
799 TopoDS_Shape aWire = aExp.Current();
801 aExp.Init(aWire,TopAbs_EDGE);
802 TopoDS_Edge e1 = TopoDS::Edge(aExp.Current()); aExp.Next();
803 TopoDS_Edge e2 = TopoDS::Edge(aExp.Current()); aExp.Next();
804 TopoDS_Edge e3 = TopoDS::Edge(aExp.Current()); aExp.Next();
805 TopoDS_Edge e4 = TopoDS::Edge(aExp.Current());
810 BRepFilletAPI_MakeFillet mkFillet(aBox);
811 mkFillet.SetContinuity(GeomAbs_C1,.001);
813 // Setup variable fillet data
814 TColgp_Array1OfPnt2d t_pnt(1,4);
815 t_pnt.SetValue(1,gp_Pnt2d(0.0,5.0));
816 t_pnt.SetValue(2,gp_Pnt2d(0.3,15.0));
817 t_pnt.SetValue(3,gp_Pnt2d(0.7,15.0));
818 t_pnt.SetValue(4,gp_Pnt2d(1.0,5.0));
821 // It is impossible to build fillet if at least one edge
822 // with variable radius is added!!! If all are constant, everything is ok.
823 mkFillet.Add(t_pnt,e1);
824 mkFillet.Add(5.0,e2);
825 mkFillet.Add(t_pnt,e3);
826 mkFillet.Add(5.0,e4);
829 TopoDS_Shape aFinalShape = mkFillet.Shape();
831 DBRep::Set(argv[1],aFinalShape);
833 catch(Standard_Failure)
835 di << argv[0] << ": Exception in fillet"<<"\n";
843 #include <Law_Interpol.hxx>
845 static Standard_Real t3d = 1.e-4;
846 static Standard_Real t2d = 1.e-5;
847 static Standard_Real ta = 1.e-2;
848 static Standard_Real fl = 1.e-3;
849 static Standard_Real tapp_angle = 1.e-2;
850 static GeomAbs_Shape blend_cont = GeomAbs_C1;
852 static BRepFilletAPI_MakeFillet* Rakk = 0;
853 static BRepFilletAPI_MakeFillet* Rake = 0;
854 static char name[100];
856 static void printtolblend(Draw_Interpretor& di)
858 di<<"tolerance ang : "<<ta<<"\n";
859 di<<"tolerance 3d : "<<t3d<<"\n";
860 di<<"tolerance 2d : "<<t2d<<"\n";
861 di<<"fleche : "<<fl<<"\n";
863 di<<"tolblend "<<ta<<" "<<t3d<<" "<<t2d<<" "<<fl<<"\n";
866 static Standard_Integer MKEVOL(Draw_Interpretor& di,
867 Standard_Integer narg,
870 if(Rake != 0) {delete Rake; Rake = 0;}
872 if (narg < 3) return 1;
873 TopoDS_Shape V = DBRep::Get(a[2]);
874 Rake = new BRepFilletAPI_MakeFillet(V);
875 Rake->SetParams(ta,t3d,t2d,t3d,t2d,fl);
876 Rake->SetContinuity(blend_cont, tapp_angle);
878 ChFi3d_FilletShape FSh = ChFi3d_Rational;
879 if (!strcasecmp(a[3], "Q")) {
880 FSh = ChFi3d_QuasiAngular;
882 else if (!strcasecmp(a[3], "P")) {
883 FSh = ChFi3d_Polynomial;
885 Rake->SetFilletShape(FSh);
891 static Standard_Integer UPDATEVOL(Draw_Interpretor& di,
892 Standard_Integer narg,
896 di << "MakeFillet non initialise"<<"\n";
899 if(narg%2 != 0 || narg < 4) return 1;
900 TColgp_Array1OfPnt2d uandr(1,(narg/2)-1);
901 Standard_Real Rad, Par;
902 TopoDS_Shape aLocalEdge(DBRep::Get(a[1],TopAbs_EDGE));
903 TopoDS_Edge E = TopoDS::Edge(aLocalEdge);
904 for (Standard_Integer ii = 1; ii <= (narg/2)-1; ii++){
905 Par = Draw::Atof(a[2*ii]);
906 Rad = Draw::Atof(a[2*ii + 1]);
907 uandr.ChangeValue(ii).SetCoord(Par,Rad);
909 //HELPDESK: Add law creation
910 const Standard_Boolean aLawMode = !strcmp(a[0],"OCC570evollaw");
913 di<<"INFO: Using law to define variable fillet"<<"\n";
914 Handle(Law_Interpol) law = new Law_Interpol;
924 static Standard_Integer BUILDEVOL(Draw_Interpretor& di,
929 di << "MakeFillet non initialise"<<"\n";
934 TopoDS_Shape result = Rake->Shape();
935 DBRep::Set(name,result);
936 if(Rake != 0) {delete Rake; Rake = 0;}
939 if(Rake != 0) {delete Rake; Rake = 0;}
943 #include <TColGeom_SequenceOfCurve.hxx>
944 #include <Geom_TrimmedCurve.hxx>
945 #include <GeomFill_NSections.hxx>
946 #include <BRepBuilderAPI_MakeFace.hxx>
947 //=======================================================================
950 //=======================================================================
951 static Standard_Integer OCC606 ( Draw_Interpretor& di, Standard_Integer n, const char ** a )
953 if (n != 3 && n != 4)
955 di << "Usage : " << a[0] << " result shape [-t]" << "\n";
959 Standard_Boolean TrimMode = (n == 4);
960 if (TrimMode) di<<"INFO: Using trimmed curves..."<<"\n";
961 else di<<"INFO: Using non trimmed curves..."<<"\n";
963 TopoDS_Shape S = DBRep::Get(a[2]);
965 TopExp_Explorer t_exp(S,TopAbs_EDGE);
966 TColGeom_SequenceOfCurve n_curves1;
967 TColStd_SequenceOfReal np;
968 Standard_Real param = 5.0;
970 for (;t_exp.More();t_exp.Next())
973 Handle(Geom_Curve) h_cur = BRep_Tool::Curve(TopoDS::Edge(t_exp.Current()),f,l);
976 if (TrimMode) h_cur = new Geom_TrimmedCurve(h_cur,f,l);
978 n_curves1.Append(h_cur);
984 if (n_curves1.Length()>1 && !np.IsEmpty())
989 GeomFill_NSections b_surface1(n_curves1, np);
990 b_surface1.ComputeSurface();
991 Handle(Geom_BSplineSurface) result_surf1 = b_surface1.BSplineSurface();
992 if (!result_surf1.IsNull())
994 BRepBuilderAPI_MakeFace b_face1(result_surf1, Precision::Confusion());
995 TopoDS_Face bsp_face1 = b_face1.Face();
996 DBRep::Set(a[1],bsp_face1);
999 catch(Standard_Failure)
1001 di<<"ERROR: Exception in GeomFill_NSections"<<"\n";
1009 //=======================================================================
1012 //=======================================================================
1013 static Standard_Integer OCC813 (Draw_Interpretor& di, Standard_Integer argc,const char ** argv)
1017 di << "Usage : " << argv[0] << " U V" << "\n";
1021 Standard_CString str;
1022 Standard_Real U = Draw::Atof(argv[1]);
1023 Standard_Real V = Draw::Atof(argv[2]);
1025 //Between ellipse and point:
1027 Handle(Geom_Ellipse) ell = new Geom_Ellipse(gp_Ax2(gp_Pnt(1262.224429,425.040878,363.609716),
1028 gp_Dir(0.173648,0.984808,0.000000),
1029 gp_Dir(-0.932169,0.164367,-0.322560)), 150, 100);
1030 Handle(Geom_Plane) plne = new Geom_Plane(gp_Ax3(gp_Ax2(gp_Pnt(1262.224429,425.040878,363.609716),
1031 gp_Dir(0.173648,0.984808,0.000000),
1032 gp_Dir(-0.932169,0.164367,-0.322560))) );
1034 Handle(AIS_InteractiveContext) aContext = ViewerTest::GetAISContext();
1037 gp_Pln pln = plne->Pln();
1039 str = "OCC813_pnt"; DrawTrSurf::Set(str,pt2d);
1041 Handle(Geom2d_Curve) curve2d = GeomAPI::To2d(ell,pln);
1042 Geom2dAdaptor_Curve acur(curve2d);
1043 Geom2dGcc_QualifiedCurve qcur(acur, GccEnt_outside);
1045 str = "OCC813_ell"; DrawTrSurf::Set(str,curve2d);
1046 if(!aContext.IsNull()) {
1047 Handle(AIS_Shape) aisp =
1048 new AIS_Shape (BRepBuilderAPI_MakeEdge(GeomAPI::To3d(curve2d, pln)).Edge());
1049 aContext->Display (aisp);
1052 //This does not give any solutions.
1053 Geom2dGcc_Lin2d2Tan lintan(qcur, pt2d, 0.1);
1054 di<<"OCC813 nb of solutions = "<<lintan.NbSolutions()<<"\n";
1056 Standard_Character abuf[16];
1057 Standard_CString st = abuf;
1060 for(i=1;i<=lintan.NbSolutions();i++) {
1061 Sprintf(abuf,"lintan_%d",i);
1062 Handle(Geom2d_Line) glin = new Geom2d_Line(lintan.ThisSolution(i));
1063 DrawTrSurf::Set(st,glin);
1064 if(!aContext.IsNull()) {
1065 Handle(AIS_Shape) aisp =
1066 new AIS_Shape (BRepBuilderAPI_MakeEdge(GeomAPI::To3d(glin, pln)).Edge()); aContext->Display (aisp);
1073 //=======================================================================
1076 //=======================================================================
1077 static Standard_Integer OCC814 (Draw_Interpretor& di, Standard_Integer argc,const char ** argv)
1081 di << "Usage : " << argv[0] << "\n";
1085 Standard_CString str;
1087 //Between Ellipse and Circle:
1089 Handle(Geom_Circle) cir = new Geom_Circle(gp_Ax2(gp_Pnt(823.687192,502.366825,478.960440),
1090 gp_Dir(0.173648,0.984808,0.000000),
1091 gp_Dir(-0.932169,0.164367,-0.322560)), 50);
1092 Handle(Geom_Ellipse) ell = new Geom_Ellipse(gp_Ax2(gp_Pnt(1262.224429,425.040878,363.609716),
1093 gp_Dir(0.173648,0.984808,0.000000),
1094 gp_Dir(-0.932169,0.164367,-0.322560)), 150, 100);
1095 Handle(Geom_Plane) plne = new Geom_Plane(gp_Ax3(gp_Ax2(gp_Pnt(1262.224429,425.040878,363.609716),
1096 gp_Dir(0.173648,0.984808,0.000000),
1097 gp_Dir(-0.932169,0.164367,-0.322560))) );
1099 Handle(AIS_InteractiveContext) aContext = ViewerTest::GetAISContext();
1101 gp_Pln pln = plne->Pln();
1102 Handle(Geom2d_Curve) curve2d = GeomAPI::To2d(ell, pln);
1103 Handle(Geom2d_Curve) fromcurve2d = GeomAPI::To2d(cir, pln);
1105 str = "OCC814_cir"; DrawTrSurf::Set(str,curve2d);
1106 str = "OCC814_ell"; DrawTrSurf::Set(str,fromcurve2d);
1107 if(!aContext.IsNull()) {
1108 Handle(AIS_Shape) aisp =
1109 new AIS_Shape (BRepBuilderAPI_MakeEdge(GeomAPI::To3d(curve2d, pln)).Edge());
1110 aContext->Display (aisp);
1112 if(!aContext.IsNull()) {
1113 Handle(AIS_Shape) aisp =
1114 new AIS_Shape (BRepBuilderAPI_MakeEdge(GeomAPI::To3d(fromcurve2d, pln)).Edge());
1115 aContext->Display (aisp);
1118 Geom2dAdaptor_Curve acur(curve2d), afromcur(fromcurve2d);
1120 Geom2dGcc_QualifiedCurve qcur(acur, GccEnt_outside) ;
1121 Geom2dGcc_QualifiedCurve qfromcur(afromcur, GccEnt_outside) ;
1123 //This does not give any solutions.
1124 Geom2dGcc_Lin2d2Tan lintan(qcur, qfromcur, 0.1);
1125 di<<"OCC814 nb of solutions = "<<lintan.NbSolutions()<<"\n";
1127 Standard_Character abuf[16];
1128 Standard_CString st = abuf;
1131 for(i=1;i<=lintan.NbSolutions();i++) {
1132 Sprintf(abuf,"lintan_%d",i);
1133 Handle(Geom2d_Line) glin = new Geom2d_Line(lintan.ThisSolution(i));
1134 DrawTrSurf::Set(st,glin);
1135 if(!aContext.IsNull()) {
1136 Handle(AIS_Shape) aisp =
1137 new AIS_Shape (BRepBuilderAPI_MakeEdge(GeomAPI::To3d(glin, pln)).Edge()); aContext->Display (aisp);
1144 #include <ShapeAnalysis_Wire.hxx>
1145 #include <IntRes2d_SequenceOfIntersectionPoint.hxx>
1146 #include <TColgp_SequenceOfPnt.hxx>
1147 #include <ShapeFix_Wire.hxx>
1148 //=======================================================================
1151 //=======================================================================
1152 static Standard_Integer OCC884 (Draw_Interpretor& di, Standard_Integer argc, const char ** argv)
1154 if (argc < 3 || argc > 5)
1156 di << "Usage : " << argv[0] << " result shape [toler [maxtoler]]" << "\n";
1160 TopoDS_Shape shape = DBRep::Get(argv[2]); //read the shape
1162 TopExp_Explorer exp(shape, TopAbs_EDGE);
1165 di<<"Error: no edge found"<<"\n";
1169 BRep_Builder builder;
1171 builder.MakeWire(wire);
1172 builder.Add(wire, TopoDS::Edge(exp.Current()));
1174 // HelpDesk: Create planar face if possible
1175 TopoDS_Face face = BRepBuilderAPI_MakeFace(wire,Standard_True);
1177 Handle(ShapeAnalysis_Wire) advWA = new ShapeAnalysis_Wire;
1179 advWA->SetFace(face);
1180 advWA->SetPrecision(0.001);
1182 IntRes2d_SequenceOfIntersectionPoint points2d;
1183 TColgp_SequenceOfPnt points3d;
1185 di << "Info: CheckSelfIntersectingEdge = " << (Standard_Integer) advWA->CheckSelfIntersectingEdge(1,points2d,points3d) << "\n";
1187 ShapeExtend_Status status = ShapeExtend_FAIL1;
1188 if (advWA->StatusSelfIntersection(status))
1189 di << "Info: No P Curve found in the edge\n";
1191 status = ShapeExtend_FAIL2;
1192 if (advWA->StatusSelfIntersection(status))
1193 di << "Info: No Vertices found in the edge\n";
1195 status = ShapeExtend_DONE1;
1196 if (advWA->StatusSelfIntersection(status))
1197 di << "Info: Self-intersection found in the edge\n";
1199 Standard_Integer i, num = points2d.Length();
1200 di << "Info: No. of self-intersection points : " << num << "\n";
1203 Standard_CString name = str;
1204 for (i = 1; i <= num; ++i)
1206 gp_Pnt pt = points3d(i);
1207 di << "Info: Intersecting pt : (" << pt.X() << ", " << pt.Y() << ", " << pt.Z() << ")\n";
1208 Sprintf(str,"p_%d",i);
1209 DrawTrSurf::Set(name,pt);
1212 Handle(ShapeFix_Wire) sfw = new ShapeFix_Wire;
1216 if (argc > 3) sfw->SetPrecision(Draw::Atof(argv[3])/*0.1*/);
1217 if (argc > 4) sfw->SetMaxTolerance(Draw::Atof(argv[4]));
1218 di << "Info: Precision is set to " << sfw->Precision() << "\n";
1219 di << "Info: MaxTolerance is set to " << sfw->MaxTolerance() << "\n";
1221 sfw->ModifyTopologyMode() = 1;
1222 sfw->ModifyGeometryMode() = 1;
1223 sfw->FixSelfIntersectingEdgeMode() = 1;
1224 //printf("Info: FixSelfIntersection = %d\n",sfw->FixSelfIntersection());
1225 di << "Info: FixSelfIntersection = " << (Standard_Integer) sfw->FixSelfIntersection() << "\n";
1227 DBRep::Set(argv[1],sfw->Wire());
1229 status = ShapeExtend_OK;
1230 if (sfw->StatusSelfIntersection(status))
1231 di << "Info: ShapeExtend_OK : No intersection found\n";
1232 //printf("Info: ShapeExtend_OK : No intersection found\n");
1234 status = ShapeExtend_FAIL1;
1235 if (sfw->StatusSelfIntersection(status))
1236 di << "Info: ShapeExtend_FAIL1 : analysis failed (edge has no pcurve, or no vertices etc.)\n";
1238 status = ShapeExtend_FAIL2;
1239 if (sfw->StatusSelfIntersection(status))
1240 di << "Info: ShapeExtend_FAIL2 : self-intersection was found, but not fixed because of limit of increasing tolerance (MaxTolerance)\n";
1242 status = ShapeExtend_FAIL3;
1243 if (sfw->StatusSelfIntersection(status))
1244 di << "Info: ShapeExtend_FAIL3 : intercestion of non adjacent edges found, but not fixed because of limit of increasing tolerance (MaxTolerance)\n";
1246 status = ShapeExtend_DONE1;
1247 if (sfw->StatusSelfIntersection(status))
1248 di << "Info: ShapeExtend_DONE1 : tolerance of vertex was increased to fix self-intersection\n";
1250 status = ShapeExtend_DONE2;
1251 if (sfw->StatusSelfIntersection(status))
1252 di << "Info: ShapeExtend_DONE2 : vertex was moved to fix self-intersection\n";
1254 status = ShapeExtend_DONE3;
1255 if (sfw->StatusSelfIntersection(status))
1256 di << "Info: ShapeExtend_DONE3 : some edges were removed because of intersection\n";
1258 status = ShapeExtend_DONE4;
1259 if (sfw->StatusSelfIntersection(status))
1260 di << "Info: ShapeExtend_DONE4 : pcurve(s) was(were) modified\n";
1262 status = ShapeExtend_DONE5;
1263 if (sfw->StatusSelfIntersection(status))
1264 di << "Info: ShapeExtend_DONE5 : non adjacent intersection fixed by increasing tolerance of vertex(vertices)\n";
1266 status = ShapeExtend_DONE6;
1267 if (sfw->StatusSelfIntersection(status))
1268 di << "Info: ShapeExtend_DONE6 : tolerance of edge was increased to hide intersection\n";
1270 status = ShapeExtend_DONE7;
1271 if (sfw->StatusSelfIntersection(status))
1272 di << "Info: ShapeExtend_DONE7 : range of some edges was decreased to avoid intersection\n";
1277 #include <Aspect_FillMethod.hxx>
1278 //=======================================================================
1279 //function : OCC1188
1281 //=======================================================================
1282 static Standard_Integer OCC1188 (Draw_Interpretor& di, Standard_Integer argc, const char ** argv)
1284 if (argc < 2 || argc > 3)
1286 di << "Usage : " << argv[0] << " imagefile [filltype] : Load image as background" << "\n";
1290 Handle(AIS_InteractiveContext) AISContext = ViewerTest::GetAISContext();
1291 if(AISContext.IsNull())
1293 di << "use 'vinit' command before " << argv[0] << "\n";
1297 Aspect_FillMethod aFillType = Aspect_FM_CENTERED;
1300 const char* szType = argv[2];
1301 if (strcmp(szType, "NONE" ) == 0) aFillType = Aspect_FM_NONE;
1302 else if (strcmp(szType, "CENTERED") == 0) aFillType = Aspect_FM_CENTERED;
1303 else if (strcmp(szType, "TILED" ) == 0) aFillType = Aspect_FM_TILED;
1304 else if (strcmp(szType, "STRETCH" ) == 0) aFillType = Aspect_FM_STRETCH;
1307 di << "Wrong fill type : " << szType << "\n";
1308 di << "Must be one of CENTERED, TILED, STRETCH, NONE" << "\n";
1313 Handle(V3d_View) V3dView = ViewerTest::CurrentView();
1314 V3dView->SetBackgroundImage(argv[1], aFillType, Standard_True);
1319 #include <AIS_Drawer.hxx>
1320 #include <Graphic3d_MaterialAspect.hxx>
1321 #include <Prs3d_ShadingAspect.hxx>
1322 //=======================================================================
1323 //function : OCC1174_1
1325 //=======================================================================
1326 static Standard_Integer OCC1174_1 (Draw_Interpretor& di, Standard_Integer argc, const char ** argv)
1330 di << "Usage : " << argv[0] << " shape" << "\n";
1334 Handle(AIS_InteractiveContext) AISContext = ViewerTest::GetAISContext();
1335 if(AISContext.IsNull())
1337 di << "use 'vinit' command before " << argv[0] << "\n";
1341 TopoDS_Shape sh = DBRep::Get(argv[1]);
1343 Handle(AIS_Shape) ais = new AIS_Shape(sh);
1345 Quantity_Color colf(0.0, 0.4, 0.0, Quantity_TOC_RGB);
1346 Quantity_Color colb(0.0, 0.0, 0.6, Quantity_TOC_RGB);
1348 Handle(Prs3d_ShadingAspect) sa = ais->Attributes()->ShadingAspect();
1350 Graphic3d_MaterialAspect front = sa->Material(Aspect_TOFM_FRONT_SIDE);
1351 front.SetAmbientColor(colf);
1352 front.SetDiffuseColor(colf);
1353 front.SetSpecularColor(colf);
1354 front.SetEmissiveColor(colf);
1355 front.SetTransparency(0.0);
1356 sa->SetMaterial(front,Aspect_TOFM_FRONT_SIDE);
1358 Graphic3d_MaterialAspect back = sa->Material(Aspect_TOFM_BACK_SIDE);
1359 back.SetAmbientColor(colb);
1360 back.SetDiffuseColor(colb);
1361 back.SetSpecularColor(colb);
1362 back.SetEmissiveColor(colb);
1363 back.SetTransparency(0.0);
1364 sa->SetMaterial(back,Aspect_TOFM_BACK_SIDE);
1366 AISContext->Display(ais,1,0);
1368 Standard_Real r, g, b;
1369 sa->Color(Aspect_TOFM_FRONT_SIDE).Values(r,g,b, Quantity_TOC_RGB);
1370 di << "Info: color on front side (" << r << "," << g << "," << b << ")\n";
1371 sa->Color(Aspect_TOFM_BACK_SIDE).Values(r,g,b, Quantity_TOC_RGB);
1372 di << "Info: color on back side (" << r << "," << g << "," << b << ")\n";
1377 //=======================================================================
1378 //function : OCC1174_2
1380 //=======================================================================
1381 static Standard_Integer OCC1174_2 (Draw_Interpretor& di, Standard_Integer argc, const char ** argv)
1385 di << "Usage : " << argv[0] << " shape" << "\n";
1389 Handle(AIS_InteractiveContext) AISContext = ViewerTest::GetAISContext();
1390 if(AISContext.IsNull())
1392 di << "use 'vinit' command before " << argv[0] << "\n";
1396 TopoDS_Shape sh = DBRep::Get(argv[1]);
1398 Handle(AIS_Shape) ais = new AIS_Shape(sh);
1399 AISContext->Display(ais,1,0);
1400 AISContext->SetMaterial(ais,Graphic3d_NOM_SHINY_PLASTIC);
1402 Quantity_Color colf(0.0, 0.4, 0.0, Quantity_TOC_RGB);
1403 Quantity_Color colb(0.0, 0.0, 0.6, Quantity_TOC_RGB);
1404 Handle(Prs3d_ShadingAspect) sa = ais->Attributes()->ShadingAspect();
1406 Graphic3d_MaterialAspect front = sa->Material(Aspect_TOFM_FRONT_SIDE);
1407 front.SetAmbientColor(colf);
1408 front.SetDiffuseColor(colf);
1409 front.SetSpecularColor(colf);
1410 front.SetEmissiveColor(colf);
1411 front.SetTransparency(0.4);
1412 sa->SetMaterial(front,Aspect_TOFM_FRONT_SIDE);
1414 Graphic3d_MaterialAspect back = sa->Material(Aspect_TOFM_BACK_SIDE);
1415 back.SetAmbientColor(colb);
1416 back.SetDiffuseColor(colb);
1417 back.SetSpecularColor(colb);
1418 back.SetEmissiveColor(colb);
1419 back.SetTransparency(0.2);
1420 sa->SetMaterial(back,Aspect_TOFM_BACK_SIDE);
1422 AISContext->Redisplay(ais,1,0);
1427 #include <TopoDS_Solid.hxx>
1428 #include <BRepFeat_MakeDPrism.hxx>
1429 //=======================================================================
1431 //purpose : FEATURE OPERATION (BOSS and SLOT)
1432 //=======================================================================
1433 static Standard_Integer OCCN1 (Draw_Interpretor& di, Standard_Integer argc, const char ** argv)
1437 di << "Usage : " << argv[0] << " angle fuse(1 for boss / 0 for slot) length" << "\n";
1441 Handle(AIS_InteractiveContext) aContext = ViewerTest::GetAISContext();
1442 if(aContext.IsNull())
1444 di << "use 'vinit' command before " << argv[0] << "\n";
1447 Standard_Real angle = Draw::Atof(argv[1]);
1448 Standard_Integer fuse = Draw::Atoi(argv[2]);
1449 Standard_Real length = Draw::Atof(argv[3]);
1451 BRepBuilderAPI_MakeEdge edge1(gp_Pnt(0, 0, 0), gp_Pnt(50, 0, 0));
1452 BRepBuilderAPI_MakeEdge edge2(gp_Pnt(50, 0, 0), gp_Pnt(50, 50, 0));
1453 BRepBuilderAPI_MakeEdge edge3(gp_Pnt(50, 50, 0), gp_Pnt(0, 50, 0));
1454 BRepBuilderAPI_MakeEdge edge4(gp_Pnt(0, 50, 0), gp_Pnt(0, 0, 0));
1455 TopoDS_Edge ted1 = edge1.Edge();
1456 TopoDS_Edge ted2 = edge2.Edge();
1457 TopoDS_Edge ted3 = edge3.Edge();
1458 TopoDS_Edge ted4 = edge4.Edge();
1460 BRepBuilderAPI_MakeWire wire(ted1, ted2, ted3, ted4);
1461 TopoDS_Wire twire = wire.Wire();
1463 BRepBuilderAPI_MakeFace face(twire);
1464 TopoDS_Face tface = face.Face();
1465 ////////Handle_AIS_Shape face_ais = new AIS_Shape( tface );
1466 ////////aContext->Display(face_ais);
1469 BRepPrimAPI_MakeBox block(gp_Pnt(-50, -50, -150), 150, 150, 100);
1470 box = block.Solid();
1472 TopoDS_Face top_face;
1473 top_face = block.TopFace();
1475 BRepFeat_MakeDPrism slot(box, tface, top_face, angle, fuse,
1478 slot.Perform(length);
1479 TopoDS_Shape S2 = slot.Shape();
1481 DBRep::Set("OCCN1_tface",tface);
1482 DBRep::Set("OCCN1_slot",S2);
1487 #include <BRepPrimAPI_MakeCylinder.hxx>
1488 #include <BRepPrimAPI_MakeSphere.hxx>
1489 #include <BRepAlgoAPI_Section.hxx>
1490 #include <BRepAlgo_Section.hxx>
1491 //=======================================================================
1493 //purpose : BOOLEAN OPERATION
1494 //=======================================================================
1495 static Standard_Integer OCCN2 (Draw_Interpretor& di, Standard_Integer argc, const char ** argv)
1498 di << "Usage : " << argv[0] << " [BRepAlgoAPI/BRepAlgo = 1/0]" << "\n";
1501 Standard_Boolean IsBRepAlgoAPI = Standard_True;
1503 Standard_Integer IsB = Draw::Atoi(argv[1]);
1505 IsBRepAlgoAPI = Standard_False;
1506 #if ! defined(BRepAlgo_def04)
1511 Handle(AIS_InteractiveContext) aContext = ViewerTest::GetAISContext();
1512 if(aContext.IsNull())
1514 di << "use 'vinit' command before " << argv[0] << "\n";
1518 BRepPrimAPI_MakeCylinder cylinder(50,200);
1519 TopoDS_Shape cylinder_sh = cylinder.Shape();
1521 BRepPrimAPI_MakeSphere sphere(gp_Pnt(60,0,100),50);
1522 TopoDS_Shape sphere_sh = sphere.Shape();
1524 //BRepAlgoAPI_Section section(cylinder_sh, sphere_sh);
1525 //TopoDS_Shape shape = section.Shape();
1528 if (IsBRepAlgoAPI) {
1529 di << "BRepAlgoAPI_Section section(cylinder_sh, sphere_sh)" <<"\n";
1530 BRepAlgoAPI_Section section(cylinder_sh, sphere_sh);
1532 if(!section.IsDone()){
1533 di << "Error performing intersection: not done." << "\n";
1535 shape = section.Shape();
1537 di << "BRepAlgo_Section section(cylinder_sh, sphere_sh)" <<"\n";
1538 BRepAlgo_Section section(cylinder_sh, sphere_sh);
1540 if(!section.IsDone()){
1541 di << "Error performing intersection: not done." << "\n";
1543 shape = section.Shape();
1546 DBRep::Set("OCCN2_cylinder",cylinder_sh);
1547 DBRep::Set("OCCN2_sphere",sphere_sh);
1548 DBRep::Set("OCCN2_section",shape);
1553 #include <TColgp_Array1OfPnt.hxx>
1554 #include <Geom_BezierCurve.hxx>
1556 static Standard_Integer OCC2569 (Draw_Interpretor& di, Standard_Integer argc, const char ** argv)
1558 Handle(AIS_InteractiveContext) aContext = ViewerTest::GetAISContext();
1559 if(aContext.IsNull())
1561 di << "use 'vinit' command before " << argv[0] << "\n";
1565 di << "Usage : " << argv[0] << " nbpoles result" << "\n";
1569 int poles=Draw::Atoi(argv[1]);
1571 TColgp_Array1OfPnt arr(1, poles);
1572 for(int i=1; i<=poles; i++)
1573 arr.SetValue(i, gp_Pnt(i+10, i*2+20, i*3+45));
1575 Handle_Geom_BezierCurve bez = new Geom_BezierCurve(arr);
1577 di << "\n The curve is not created.\n";
1579 di << "\n Degree = " << bez->Degree() << "\n";
1581 TopoDS_Edge sh = BRepBuilderAPI_MakeEdge(bez).Edge();
1582 Handle_AIS_Shape ais = new AIS_Shape(sh);
1583 aContext->Display(ais);
1584 DrawTrSurf::Set(argv[2],bez);
1588 #include <TopTools_IndexedMapOfShape.hxx>
1589 #include <TopExp.hxx>
1591 static Standard_Integer OCC1642 (Draw_Interpretor& di, Standard_Integer argc, const char ** argv)
1594 di<<"Usage: " << argv[0] << " FinalWare FinalFace InitWare InitFace shape FixReorder FixDegenerated FixConnected FixSelfIntersection"<<"\n";
1598 TopoDS_Shape shape = DBRep::Get(argv[5]);
1600 TopExp_Explorer exp(shape, TopAbs_WIRE);
1601 TopoDS_Shape wire = exp.Current();
1603 Handle(ShapeAnalysis_Wire) advWA = new ShapeAnalysis_Wire;
1604 advWA->Load(TopoDS::Wire(wire));
1606 DBRep::Set(argv[3],wire);
1609 BRepBuilderAPI_MakeFace(TopoDS::Wire(wire),Standard_True);
1611 DBRep::Set(argv[4],face);
1613 advWA->SetFace(face);
1614 Standard_Real precision_to_ana = 0.0001;
1615 advWA->SetPrecision(precision_to_ana);
1617 TopTools_IndexedMapOfShape M;
1618 TopExp::MapShapes(wire, TopAbs_EDGE, M);
1621 for(j= 1; j<=M.Extent(); ++j) {
1622 Standard_Integer num=1;
1623 IntRes2d_SequenceOfIntersectionPoint points2d;
1624 TColgp_SequenceOfPnt points3d;
1626 cout << "\n j =" << j << ", CheckSelfIntersectingEdge = " <<
1627 advWA->CheckSelfIntersectingEdge(j, points2d, points3d);
1630 ShapeExtend_Status status = ShapeExtend_FAIL1;
1631 if(advWA->StatusSelfIntersection(status))
1633 status = ShapeExtend_FAIL2;
1634 if(advWA->StatusSelfIntersection(status))
1635 di << "\n No Vertices found in the edge";
1637 status = ShapeExtend_DONE1;
1638 if(advWA->StatusSelfIntersection(status))
1639 di << "\n Self-intersection found in the edge";
1641 num = points2d.Length();
1642 di << "\n No. of self-intersecting edges : " << num;
1644 for(int i=1; i<=num; ++i) {
1645 gp_Pnt pt = points3d(i);
1646 di << "\n Intersecting pt : (" << pt.X() << ", " << pt.Y()<< ", " << pt.Z() << ")";
1651 Handle_ShapeFix_Wire sfw = new ShapeFix_Wire;
1652 sfw->Load(TopoDS::Wire(wire));
1654 sfw->SetPrecision(Precision::Confusion());
1656 sfw->FixReorderMode() = 1;
1657 sfw->ClosedWireMode() = 1;
1658 sfw->FixDegeneratedMode() = 1;
1659 sfw->FixConnectedMode() = 1;
1660 sfw->ModifyTopologyMode() = 1;
1661 sfw->ModifyGeometryMode() = 1;
1662 sfw->FixSelfIntersectionMode() = 1;
1663 sfw->FixSelfIntersectingEdgeMode() = 1;
1664 sfw->FixIntersectingEdgesMode() = 1;
1665 sfw->FixNonAdjacentIntersectingEdgesMode() = 1;
1666 sfw->FixEdgeCurvesMode() = 1;
1668 sfw->ModifyRemoveLoopMode() = 1;
1669 sfw->SetMaxTolerance(1.0);
1671 di << "\n FixReorder = " << (Standard_Integer) sfw->FixReorder();
1672 di << "\n FixDegenerated = " << (Standard_Integer) sfw->FixDegenerated();
1673 di << "\n FixConnected = " << (Standard_Integer) sfw->FixConnected();
1675 di << "\n FixSelfIntersection = " << (Standard_Integer) sfw->FixSelfIntersection();
1678 Draw::Set(argv[6],sfw->FixReorder()) ;
1679 Draw::Set(argv[7],sfw->FixDegenerated()) ;
1680 Draw::Set(argv[8],sfw->FixConnected()) ;
1681 Draw::Set(argv[9],sfw->FixSelfIntersection()) ;
1683 ShapeExtend_Status status = ShapeExtend_OK;
1684 if(sfw->StatusSelfIntersection(status))
1685 di << "\n ShapeExtend_OK : No intersection found";
1687 status = ShapeExtend_FAIL1;
1688 if(sfw->StatusSelfIntersection(status))
1689 di << "\n ShapeExtend_FAIL1 : analysis failed (edge has no pcurve,or no vertices etc.)";
1691 status = ShapeExtend_FAIL2;
1692 if(sfw->StatusSelfIntersection(status))
1693 di << "\n ShapeExtend_FAIL2 : self-intersection was found, but not fixed because of limit of increasing tolerance (MaxTolerance)";
1695 status = ShapeExtend_FAIL3;
1696 if(sfw->StatusSelfIntersection(status))
1697 di << "\n ShapeExtend_FAIL3 : intercestion of non adjacent edges found, but not fixed because of limit of increasing tolerance (MaxTolerance)";
1699 status = ShapeExtend_DONE1;
1700 if(sfw->StatusSelfIntersection(status))
1701 di << "\n ShapeExtend_DONE1 : tolerance of vertex was increased to fix self-intersection";
1703 status = ShapeExtend_DONE2;
1704 if(sfw->StatusSelfIntersection(status))
1705 di << "\n ShapeExtend_DONE2 : vertex was moved to fix self-intersection";
1707 status = ShapeExtend_DONE3;
1708 if(sfw->StatusSelfIntersection(status))
1709 di << "\n ShapeExtend_DONE3 : some edges were removed because of intersection";
1711 status = ShapeExtend_DONE4;
1712 if(sfw->StatusSelfIntersection(status))
1713 di << "\n ShapeExtend_DONE4 : pcurve(s) was(were) modified";
1715 status = ShapeExtend_DONE5;
1716 if(sfw->StatusSelfIntersection(status))
1717 di << "\n ShapeExtend_DONE5 : non adjacent intersection fixed by increasing tolerance of vertex(vertices)";
1719 status = ShapeExtend_DONE6;
1720 if(sfw->StatusSelfIntersection(status))
1721 di << "\n ShapeExtend_DONE6 : tolerance of edge was increased to hide intersection";
1723 status = ShapeExtend_DONE7;
1724 if(sfw->StatusSelfIntersection(status))
1725 di << "\n ShapeExtend_DONE7 : range of some edges was decreased to avoid intersection";
1727 TopoDS_Wire finalwire = sfw->Wire();
1729 DBRep::Set(argv[1],finalwire);
1732 advWA->Load(TopoDS::Wire(finalwire));
1735 BRepBuilderAPI_MakeFace(TopoDS::Wire(finalwire),Standard_True);
1737 DBRep::Set(argv[2],fface);
1739 advWA->SetFace(fface);
1741 TopTools_IndexedMapOfShape fM;
1742 TopExp::MapShapes(finalwire, TopAbs_EDGE, fM);
1744 for(j= 1; j<=fM.Extent(); ++j) {
1745 Standard_Integer num=1;
1746 IntRes2d_SequenceOfIntersectionPoint points2d;
1747 TColgp_SequenceOfPnt points3d;
1749 di << "\n j =" << j << ", CheckSelfIntersectingEdge = " <<
1750 (Standard_Integer) advWA->CheckSelfIntersectingEdge(j, points2d, points3d);
1753 ShapeExtend_Status status = ShapeExtend_FAIL1;
1754 if(advWA->StatusSelfIntersection(status))
1756 status = ShapeExtend_FAIL2;
1757 if(advWA->StatusSelfIntersection(status))
1758 di << "\n No Vertices found in the edge";
1760 status = ShapeExtend_DONE1;
1761 if(advWA->StatusSelfIntersection(status))
1762 di << "\n Self-intersection found in the edge";
1764 num = points2d.Length();
1765 di << "\n No. of self-intersecting edges : " << num;
1767 for(int i=1; i<=num; ++i) {
1768 gp_Pnt pt = points3d(i);
1769 di << "\n Intersecting pt : (" << pt.X() << ", " << pt.Y() << ", " << pt.Z() << ")";
1779 void QABugs::Commands_17(Draw_Interpretor& theCommands) {
1780 const char *group = "QABugs";
1782 theCommands.Add ("BUC60842", "BUC60842", __FILE__, BUC60842, group);
1783 theCommands.Add ("BUC60843", "BUC60843 result_shape name_of_circle name_of_curve [ par1 [ tol ] ]", __FILE__, BUC60843, group);
1784 theCommands.Add ("BUC60970", "BUC60970 shape result", __FILE__, BUC60970, group);
1785 theCommands.Add ("BUC60818", "BUC60818", __FILE__, BUC60818, group);
1786 theCommands.Add ("BUC60915", "BUC60915", __FILE__, BUC60915_1, group);
1787 theCommands.Add ("OCC138", "OCC138", __FILE__, OCC138, group);
1788 theCommands.Add ("BUC60821","BUC60821",__FILE__,BUC60821,group);
1789 theCommands.Add ("OCC353","OCC353",__FILE__,OCC353,group);
1790 theCommands.Add ("OCC280","OCC280 hlr=0/1 setsurfecedetail=0/1; set perspecrive view",__FILE__,OCC280,group);
1791 theCommands.Add ("OCC232", "OCC232", __FILE__, OCC232 , group);
1792 theCommands.Add ("OCC138LC", "OCC138LC", __FILE__, OCC138LC, group);
1793 theCommands.Add ("OCC189", "OCC189", __FILE__, OCC189, group);
1794 theCommands.Add ("OCC566", "OCC566 shape [ xmin ymin zmin xmax ymax zmax] ; print bounding box", __FILE__, OCC566, group);
1795 theCommands.Add ("OCC570", "OCC570 result", __FILE__, OCC570, group);
1797 theCommands.Add("OCC570mkevol",
1798 "OCC570mkevol result object (then use updatevol) [R/Q/P]; mkevol",
1799 __FILE__, MKEVOL,group);
1800 theCommands.Add("OCC570updatevol",
1801 "OCC570updatevol edge u1 rad1 u2 rad2 ...; updatevol",
1802 __FILE__, UPDATEVOL,group);
1803 theCommands.Add("OCC570updatevollaw",
1804 "OCC570updatevollaw edge u1 rad1 u2 rad2 ...; updatevollaw",
1805 __FILE__, UPDATEVOL,group);
1806 theCommands.Add("OCC570buildevol",
1807 "OCC570buildevol; end of the evol fillet computation",
1808 __FILE__, BUILDEVOL,group);
1810 theCommands.Add ("OCC606", "OCC606 result shape [-t]", __FILE__, OCC606, group);
1812 theCommands.Add ("OCC813", "OCC813 U V", __FILE__, OCC813, group);
1813 theCommands.Add ("OCC814", "OCC814", __FILE__, OCC814, group);
1814 theCommands.Add ("OCC884", "OCC884 result shape [toler [maxtoler]]", __FILE__, OCC884, group);
1815 theCommands.Add ("OCC1188", "OCC1188 imagefile [filltype] : Load image as background", __FILE__, OCC1188, group);
1817 theCommands.Add ("OCC1174_1", "OCC1174_1 shape", __FILE__, OCC1174_1, group);
1818 theCommands.Add ("OCC1174_2", "OCC1174_2 shape", __FILE__, OCC1174_2, group);
1820 theCommands.Add ("OCCN1", "OCCN1 angle fuse(1 for boss / 0 for slot) length", __FILE__, OCCN1, group);
1821 theCommands.Add ("OCCN2", "OCCN2", __FILE__, OCCN2, group);
1823 theCommands.Add ("OCC2569", "OCC2569 nbpoles result", __FILE__, OCC2569, group);
1825 theCommands.Add ("OCC1642", "OCC1642 FinalWare FinalFace InitWare InitFace shape FixReorder FixDegenerated FixConnected FixSelfIntersection", __FILE__, OCC1642, group);