1 // Created on: 2002-03-18
2 // Created by: QA Admin
3 // Copyright (c) 2002-2014 OPEN CASCADE SAS
5 // This file is part of Open CASCADE Technology software library.
7 // This library is free software; you can redistribute it and/or modify it under
8 // the terms of the GNU Lesser General Public License version 2.1 as published
9 // by the Free Software Foundation, with special exception defined in the file
10 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
11 // distribution for complete text of the license and disclaimer of any warranty.
13 // Alternatively, this file may be used under the terms of Open CASCADE
14 // commercial license or contractual agreement.
21 #include <Draw_Interpretor.hxx>
23 #include <DrawTrSurf.hxx>
24 #include <AIS_InteractiveContext.hxx>
25 #include <ViewerTest.hxx>
26 #include <ViewerTest_EventManager.hxx>
27 #include <AIS_Shape.hxx>
28 #include <TopoDS_Shape.hxx>
30 #include <Geom_Circle.hxx>
31 #include <Geom_Ellipse.hxx>
32 #include <Geom_Plane.hxx>
34 #include <Geom2d_Curve.hxx>
35 #include <GeomAPI.hxx>
36 #include <Geom2dAdaptor_Curve.hxx>
37 #include <Geom2dGcc_QualifiedCurve.hxx>
38 #include <Geom2dGcc_Lin2d2Tan.hxx>
39 #include <Geom2d_Line.hxx>
40 #include <BRepBuilderAPI_MakeEdge.hxx>
41 #include <TopoDS_Edge.hxx>
42 #include <Precision.hxx>
43 #include <Geom2d_Circle.hxx>
44 #include <Geom2dGcc_QCurve.hxx>
45 #include <GccEnt_QualifiedCirc.hxx>
46 #include <Geom2dGcc_Lin2d2TanIter.hxx>
47 #include <BRepBuilderAPI_MakeWire.hxx>
48 #include <TopExp_Explorer.hxx>
50 #include <TopoDS_Wire.hxx>
51 #include <BRep_Tool.hxx>
52 #include <gp_Circ.hxx>
53 #include <BRepOffsetAPI_MakePipeShell.hxx>
54 #include <AIS_Trihedron.hxx>
55 #include <Geom_Axis2Placement.hxx>
56 #include <V3d_View.hxx>
57 #include <BRepBuilderAPI_MakeVertex.hxx>
58 #include <AIS_LengthDimension.hxx>
59 #include <AIS_RadiusDimension.hxx>
60 #include <BRepPrimAPI_MakeBox.hxx>
61 #include <GeomAdaptor_Surface.hxx>
62 #include <Extrema_ExtPS.hxx>
63 #include <Geom_CartesianPoint.hxx>
64 #include <Geom2d_CartesianPoint.hxx>
65 #include <Geom2dGcc_Circ2d3Tan.hxx>
66 #include <Aspect_Window.hxx>
68 #include <TopoDS_Compound.hxx>
69 #include <TopoDS_CompSolid.hxx>
70 #include <StdSelect_ShapeTypeFilter.hxx>
71 #include <QABugs_MyText.hxx>
72 #include <Prs3d_Projector.hxx>
73 #include <HLRAlgo_Projector.hxx>
74 #include <Standard_ErrorHandler.hxx>
75 #include <Font_NameOfFont.hxx>
77 static Standard_Integer BUC60842 (Draw_Interpretor& di, Standard_Integer /*argc*/,const char ** /*argv*/)
79 Standard_Character abuf[16];
80 //Standard_Character * abuf = new Standard_Character[16];
82 Standard_CString st = abuf;
84 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);
85 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);
86 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))));
88 Handle(AIS_InteractiveContext) aContext = ViewerTest::GetAISContext();
90 gp_Pln pln = plne->Pln();
91 Handle(Geom2d_Curve) curve2d = GeomAPI::To2d (ell, pln);
93 DrawTrSurf::Set(st,curve2d);
94 if(!aContext.IsNull()) {
95 Handle(AIS_Shape) aisp =
96 new AIS_Shape (BRepBuilderAPI_MakeEdge(GeomAPI::To3d(curve2d, pln)).Edge());
97 aContext->Display (aisp);
100 Handle(Geom2d_Curve) fromcurve2d = GeomAPI::To2d (cir, pln);
102 DrawTrSurf::Set(st,fromcurve2d);
103 if(!aContext.IsNull()) {
104 Handle(AIS_Shape) aisp =
105 new AIS_Shape (BRepBuilderAPI_MakeEdge(GeomAPI::To3d(fromcurve2d, pln)).Edge());
106 aContext->Display (aisp);
109 Geom2dAdaptor_Curve acur (curve2d), afromcur (fromcurve2d);
110 Geom2dGcc_QualifiedCurve qcur (acur, GccEnt_outside);
111 Geom2dGcc_QualifiedCurve qfromcur (afromcur, GccEnt_outside);
112 Geom2dGcc_Lin2d2Tan lintan (qcur, qfromcur, 0.1, 0.0, 0.0);
113 Standard_Integer i=0;
114 for(i=0;i<lintan.NbSolutions();i++) {
115 Sprintf(abuf,"lintan_%d",i);
116 Handle(Geom2d_Line) glin = new Geom2d_Line(lintan.ThisSolution(i));
117 DrawTrSurf::Set(st,glin);
118 if(!aContext.IsNull()) {
119 Handle(AIS_Shape) aisp =
120 new AIS_Shape (BRepBuilderAPI_MakeEdge(GeomAPI::To3d(glin, pln)).Edge()); aContext->Display (aisp);
123 di << " Is Done = \n" << (Standard_Integer) lintan.IsDone();
127 static Standard_Integer BUC60843 (Draw_Interpretor& di, Standard_Integer argc,const char ** argv)
129 if (argc != 4 && argc != 5 && argc != 6 && argc != 7) {
130 di << "Usage : " << argv[0] << "result_shape name_of_circle name_of_curve [ par1 [ tol ] ]" << "\n";
134 Standard_Real par1 = 0.0, par2 = 0.0;
135 Standard_Real tol = Precision::Angular();
137 par1 = Draw::Atof(argv[4]);
139 par2 = Draw::Atof(argv[5]);
141 tol = Draw::Atof(argv[6]);
142 Handle(Geom2d_Curve) aCur2d1 = DrawTrSurf::GetCurve2d(argv[2]);
143 Handle(Geom2d_Curve) aCur2d2 = DrawTrSurf::GetCurve2d(argv[3]);
144 if (aCur2d1.IsNull() || aCur2d2.IsNull()) {
145 di << "Faulty : not curves" << "\n";
148 Standard_Boolean c1IsCircle = Standard_False;
149 Handle(Geom2d_Circle) aCir2d = Handle(Geom2d_Circle)::DownCast(aCur2d1);
150 if (!aCir2d.IsNull()) {
151 c1IsCircle = Standard_True;
152 if (argc == 6) tol = Draw::Atof(argv[5]);
155 Geom2dAdaptor_Curve acur(aCur2d2);
156 Geom2dGcc_QCurve qcur(acur, GccEnt_unqualified);
157 GccEnt_QualifiedCirc qfromcur(aCir2d->Circ2d(), GccEnt_unqualified);
158 Geom2dGcc_Lin2d2TanIter lintan(qfromcur, qcur , par1, tol);
159 if (lintan.IsDone()) {
160 gp_Lin2d lin = lintan.ThisSolution();
161 Handle(Geom2d_Line) glin = new Geom2d_Line(lin);
162 DrawTrSurf::Set(argv[1], glin);
164 di << "Faulty : tangent line is not done." << "\n";
168 Geom2dAdaptor_Curve acur1(aCur2d1);
169 Geom2dAdaptor_Curve acur2(aCur2d2);
170 Geom2dGcc_QCurve qcur1(acur1, GccEnt_unqualified);
171 Geom2dGcc_QCurve qcur2(acur2, GccEnt_unqualified);
172 Geom2dGcc_Lin2d2TanIter lintan(qcur1, qcur2 , par1, par2, tol);
173 if (lintan.IsDone()) {
174 gp_Lin2d lin = lintan.ThisSolution();
175 Handle(Geom2d_Line) glin = new Geom2d_Line(lin);
176 DrawTrSurf::Set(argv[1], glin);
178 di << "Faulty : tangent line is not done." << "\n";
184 static Standard_Integer BUC60970 (Draw_Interpretor& di, Standard_Integer argc, const char ** argv)
188 di << "Usage : " << argv[0] << " shape result" <<"\n";
192 Handle(AIS_InteractiveContext) aContext = ViewerTest::GetAISContext();
193 if(aContext.IsNull()) {
194 di << "use 'vinit' command before " << argv[0] << "\n";
198 TopoDS_Shape aResult = DBRep::Get(argv[1]);
200 BRepBuilderAPI_MakeWire bRepSpineWire;
201 TopExp_Explorer exp_(aResult, TopAbs_WIRE);
203 Standard_Integer i = 0;
204 for(;exp_.More();exp_.Next()){
206 bRepSpineWire.Add(TopoDS::Wire(exp_.Current()));
209 //printf("total no of wires are ............. %d\n", i);
210 di << "total no of wires are ............. " << i << "\n";
212 TopoDS_Wire spineWire = bRepSpineWire.Wire();
213 aContext->Display(new AIS_Shape(spineWire));
215 DBRep::Set("slineW",spineWire);
217 TopExp_Explorer spineWireExp(spineWire, TopAbs_EDGE);
218 Standard_Real first, last;
219 Handle(Geom_Curve) curl_ = BRep_Tool::Curve(TopoDS::Edge(spineWireExp.Current()), first, last);
222 curl_->D1(first, firstPnt, tanVec);
224 gp_Dir tanDir(tanVec.X(), tanVec.Y(), tanVec.Z());
225 gp_Ax2 gpAx2(firstPnt, tanDir);
226 gp_Circ gpCirc(gpAx2, 2.5);
227 BRepBuilderAPI_MakeWire aMWire(BRepBuilderAPI_MakeEdge(new Geom_Circle(gpCirc)).Edge());
228 TopoDS_Wire topoWire(aMWire);
229 aContext->Display(new AIS_Shape(topoWire));
231 DBRep::Set("topoW",topoWire);
233 BRepOffsetAPI_MakePipeShell bRepPipe(spineWire);
234 bRepPipe.Add(topoWire);
237 aContext->Display(new AIS_Shape(bRepPipe.Shape()));
239 DBRep::Set(argv[2],bRepPipe.Shape());
244 static Standard_Integer BUC60818(Draw_Interpretor& di, Standard_Integer argc, const char ** argv)
248 di << "Usage : " << argv[0] << "\n";
252 Handle(AIS_InteractiveContext) myAISContext = ViewerTest::GetAISContext();
253 if(myAISContext.IsNull())
255 di << "use 'vinit' command before " << argv[0] << "\n";
260 Handle(AIS_Trihedron) aTrihedron;
261 Handle(Geom_Axis2Placement) aTrihedronAxis=new Geom_Axis2Placement(gp::XOY());
262 aTrihedron=new AIS_Trihedron(aTrihedronAxis);
263 myAISContext->Display(aTrihedron);
265 myAISContext->OpenLocalContext();
266 myAISContext->Load(aTrihedron,0);
268 myAISContext->SetAutomaticHilight( Standard_False );
270 Handle(V3d_View) myV3dView = ViewerTest::CurrentView();
272 myV3dView->Project(0,0,0,Xv,Yv);
274 Standard_Integer Xp,Yp;
275 myV3dView->Convert(Xv,Yv,Xp,Yp);
277 myAISContext->MoveTo( Xp,Yp, myV3dView );
278 myAISContext->MoveTo( Xp,Yp, myV3dView );
280 if (myAISContext->HasDetected( ))
281 di << "has detected shape : OK" << "\n";
282 else di << "has detected shape : bugged - Faulty " << "\n";
284 myAISContext->SetAutomaticHilight( Standard_True );
289 static Standard_Integer BUC60915_1(Draw_Interpretor& di, Standard_Integer argc, const char ** argv)
292 di<<"Function don't has parameters"<<"\n";
296 if(ViewerTest::GetAISContext().IsNull())
298 di << "View was not created. Use 'vinit' command before "
302 Handle(AIS_InteractiveContext) context = ViewerTest::GetAISContext();
304 //The following dimesion code has problems regarding arrow_size. The desired effect is not produced.
305 /***************************************/
307 /***************************************/
308 gp_Pnt p1 = gp_Pnt(602.51,50.,0.);
309 gp_Pnt p2 = gp_Pnt(602.51,200.,0.);
310 gp_Pnt p3 = gp_Pnt(102.51,200.,0.);
311 gp_Pnt p4 = gp_Pnt(102.51,170.,0.);
312 gp_Pnt p5 = gp_Pnt(502.51,170.,0.);
313 gp_Pnt p6 = gp_Pnt(502.51,80.,0.);
314 gp_Pnt p7 = gp_Pnt(102.51,80.,0.);
315 gp_Pnt p8 = gp_Pnt(102.51,50.,0.);
316 TopoDS_Vertex V1 = BRepBuilderAPI_MakeVertex(p1);
317 TopoDS_Vertex V2 = BRepBuilderAPI_MakeVertex(p2);
318 TopoDS_Vertex V3 = BRepBuilderAPI_MakeVertex(p3);
319 TopoDS_Vertex V4 = BRepBuilderAPI_MakeVertex(p4);
320 TopoDS_Vertex V5 = BRepBuilderAPI_MakeVertex(p5);
321 TopoDS_Vertex V6 = BRepBuilderAPI_MakeVertex(p6);
322 TopoDS_Vertex V7 = BRepBuilderAPI_MakeVertex(p7);
323 TopoDS_Vertex V8 = BRepBuilderAPI_MakeVertex(p8);
324 gp_Pnt plnpt(0, 0, 0);
325 gp_Dir plndir(0, 0, 1);
326 Handle(Geom_Plane) pln = new Geom_Plane(plnpt,plndir);
327 Handle(Prs3d_DimensionAspect) anAspect = new Prs3d_DimensionAspect();
328 anAspect->MakeArrows3d (Standard_True);
329 anAspect->ArrowAspect()->SetAngle (M_PI/180.0 * 10.0);
330 /***************************************/
331 //dimension "L 502.51"
332 /***************************************/
333 Handle(AIS_LengthDimension) len = new AIS_LengthDimension(V2, V3, pln->Pln());
334 anAspect->ArrowAspect()->SetLength (30.0);
335 len->SetDimensionAspect (anAspect);
336 context->Display(len);
337 /***************************************/
339 /***************************************/
340 Handle(AIS_LengthDimension) len1 = new AIS_LengthDimension(V7, V4, pln->Pln());
341 len1->SetDimensionAspect (anAspect);
342 len1->SetFlyout (30.0);
343 anAspect->ArrowAspect()->SetLength (100.0);
344 context->Display(len1);
345 /***************************************/
347 /***************************************/
348 Handle(AIS_LengthDimension) len2 = new AIS_LengthDimension(V1, V2, pln->Pln());
349 len2->SetDimensionAspect (anAspect);
350 context->Display(len2);
351 /***************************************/
352 //dimension "R 88.58"
353 /***************************************/
354 gp_Circ cir = gp_Circ(gp_Ax2(gp_Pnt(191.09, -88.58, 0), gp_Dir(0, 0, 1)), 88.58);
355 TopoDS_Edge E1 = BRepBuilderAPI_MakeEdge(cir,gp_Pnt(191.09,0,0.),gp_Pnt(191.09,-177.16,0.) );
356 Handle(AIS_RadiusDimension) dim1 = new AIS_RadiusDimension(E1);
357 dim1->SetDimensionAspect (anAspect);
358 context->Display(dim1);
359 /***************************************/
360 //dimension "R 43.80"
361 /***************************************/
362 gp_Circ cir1 = gp_Circ(gp_Ax2(gp_Pnt(191.09, -88.58, 0), gp_Dir(0, 0, 1)), 43.80);
363 TopoDS_Edge E_cir1 = BRepBuilderAPI_MakeEdge(cir1);
364 dim1 = new AIS_RadiusDimension(E_cir1);
365 anAspect->ArrowAspect()->SetLength (60.0);
366 dim1->SetDimensionAspect (anAspect);
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);
374 anAspect->ArrowAspect()->SetLength (40.0);
375 dim1->SetDimensionAspect (anAspect);
376 context->Display(dim1);
381 static Standard_Integer OCC138 (Draw_Interpretor& di, Standard_Integer /*argc*/, const char ** argv)
383 Handle(AIS_InteractiveContext) aContext = ViewerTest::GetAISContext();
384 if(aContext.IsNull()) {
385 di << "use 'vinit' command before " << argv[0] << "\n";
389 BRepPrimAPI_MakeBox box1(gp_Pnt(0, 0, 0), gp_Pnt(100, 100, 100));
390 BRepPrimAPI_MakeBox box2(gp_Pnt(120, 120, 120), gp_Pnt(300, 300,300));
391 BRepPrimAPI_MakeBox box3(gp_Pnt(320, 320, 320), gp_Pnt(500, 500,500));
393 Handle(AIS_Shape) ais1 = new AIS_Shape(box1.Shape());
394 Handle(AIS_Shape) ais2 = new AIS_Shape(box2.Shape());
395 Handle(AIS_Shape) ais3 = new AIS_Shape(box3.Shape());
397 aContext->Display(ais1);
398 aContext->Display(ais2);
399 aContext->Display(ais3);
401 aContext->AddOrRemoveCurrentObject(ais1);
402 aContext->AddOrRemoveCurrentObject(ais2);
403 aContext->AddOrRemoveCurrentObject(ais3);
405 di << "\n No of currents = " << aContext->NbCurrents();
407 aContext->InitCurrent();
410 while(aContext->MoreCurrent())
412 di << "\n count is = " << count++;
413 Handle(AIS_InteractiveObject) ais = aContext->Current();
414 aContext->AddOrRemoveCurrentObject(ais);
415 aContext->InitCurrent();
421 static Standard_Integer BUC60821(Draw_Interpretor& di, Standard_Integer argc,const char ** argv )
425 di << "Usage: " << argv[0] << " TextHight1 TextHight2 TextHight2";
429 Handle(AIS_InteractiveContext) aContext = ViewerTest::GetAISContext();
431 if(aContext.IsNull())
433 di << "use 'vinit' command before " << argv[0] << "\n";
437 Handle(QABugs_MyText) txt1 = new QABugs_MyText("Gosha1",gp_Pnt(0,0,0),Font_NOF_ASCII_SIMPLEX,Quantity_NOC_RED,Draw::Atoi(argv[1]));
438 aContext->Display(txt1);
440 Handle(QABugs_MyText) txt2 = new QABugs_MyText("Gosha2",gp_Pnt(0,0,100),Font_NOF_ASCII_SIMPLEX,Quantity_NOC_YELLOW,Draw::Atoi(argv[2]));
441 aContext->Display(txt2);
443 Handle(QABugs_MyText) txt3 = new QABugs_MyText("Gosha3",gp_Pnt(0,100,100),Font_NOF_ASCII_SIMPLEX,Quantity_NOC_SKYBLUE,Draw::Atoi(argv[3]));
444 aContext->Display(txt3);
449 static int geom_get_2Dpt_from_3Dpt(const gp_Pnt& pnt3d, const gp_Pln& pln, gp_Pnt2d& pnt2d)
452 Handle(Geom_Plane) gpln = new Geom_Plane(pln);
453 GeomAdaptor_Surface adsur(gpln);
454 Extrema_ExtPS extps(pnt3d, adsur, 0.001, 0.001);
458 for(index=1; index<= extps.NbExt(); index++ )
460 Extrema_POnSurf pons = extps.Point(index);
462 pons.Parameter(U, V);
463 pnt2d.SetCoord(U, V);
470 static Standard_Integer OCC353 (Draw_Interpretor& di, Standard_Integer , const char ** )
472 gp_Ax2 ax21( gp_Pnt(100,0,0), gp_Dir(0,0,1) );
473 Handle(Geom_Circle) h_cir1 = new Geom_Circle( ax21, 25 );
475 gp_Ax2 ax22( gp_Pnt(-100,0,0), gp_Dir(0,0,1) );
476 Handle(Geom_Circle) h_cir2 = new Geom_Circle( ax22, 25 );
478 gp_Pln refpln( gp_Pnt(0,0,0), gp_Dir(0,0,1) );
479 Handle(Geom2d_Curve) cir2d1 = GeomAPI::To2d(h_cir1, refpln);
480 Handle(Geom2d_Curve) cir2d2 = GeomAPI::To2d(h_cir2, refpln);
482 Geom2dAdaptor_Curve adop1(cir2d1);
483 Geom2dAdaptor_Curve adop2(cir2d2);
485 Geom2dGcc_QualifiedCurve qcur1(adop1, GccEnt_enclosing);
486 Geom2dGcc_QualifiedCurve qcur2(adop2, GccEnt_enclosing);
488 Handle(Geom_CartesianPoint) h_carpt = new Geom_CartesianPoint(0,175,0);
490 gp_Pnt pt3d = h_carpt->Pnt();
492 geom_get_2Dpt_from_3Dpt(pt3d, refpln, pt2d);
496 DrawTrSurf::Set(st,cir2d1);
498 DrawTrSurf::Set(st,cir2d2);
500 DrawTrSurf::Set(st,pt2d);
502 Handle(Geom2d_CartesianPoint) pt = new Geom2d_CartesianPoint(pt2d);
503 Geom2dGcc_Circ2d3Tan sol( qcur1, qcur2, pt, 0.001, 0.0, 0.0);
506 Standard_Character buf[10];
510 res = sol.NbSolutions();
511 for(Standard_Integer i=1;i<=res;i++) {
512 Handle(Geom2d_Circle) aC = new Geom2d_Circle(sol.ThisSolution(i));
513 Sprintf(buf,"Result_%d",i);
515 DrawTrSurf::Set(st,aC);
519 di << "\n Faulty: no solutions found ";
520 //printf("\n Faulty: no solutions found ");
522 //printf("\n Num of solutions are %d ", res );
523 di << "\n Num of solutions are " << res << " ";
528 static Standard_Integer OCC280 (Draw_Interpretor& di, Standard_Integer argc, const char ** argv)
530 Handle(AIS_InteractiveContext) aContext = ViewerTest::GetAISContext();
531 if(aContext.IsNull())
533 di << "use 'vinit' command before " << argv[0] << "\n";
537 di << "ERROR : Usage : " << argv[0] << " hlr=0/1 setsurfecedetail=0/1; set perspecrive view" << "\n";
541 Standard_Integer HLR = Draw::Atoi(argv[1]);
546 TCollection_AsciiString anOldName = ViewerTest::GetCurrentViewName();
547 Handle(V3d_Viewer) aViewer = ViewerTest::GetViewerFromContext();
548 if (Draw::Atoi (argv[2]))
550 aViewer->SetDefaultSurfaceDetail (V3d_TEX_ALL);
552 aViewer->SetDefaultTypeOfView (V3d_PERSPECTIVE);
553 Handle(Aspect_Window) asp = ViewerTest::CurrentView()->Window();
554 Handle(V3d_View) aNewView = aViewer->CreateView();
555 ViewerTest::CurrentView (aNewView);
556 TCollection_AsciiString aNewName=anOldName + "_new";
557 ViewerTest::InitViewName(aNewName,ViewerTest::CurrentView());
558 aNewView->SetWindow (asp);
559 if (!asp->IsMapped()) asp->Map();
561 ViewerTest::RemoveView(anOldName,false);
562 ViewerTest::UnsetEventManager();
563 ViewerTest::SetEventManager (new ViewerTest_EventManager (aNewView, ViewerTest::GetAISContext()));
568 ViewerTest::CurrentView()->SetComputedMode (Standard_True);
574 static Standard_Integer OCC232 (Draw_Interpretor& di, Standard_Integer /*argc*/, const char ** argv)
576 Handle(AIS_InteractiveContext) aContext = ViewerTest::GetAISContext();
577 if(aContext.IsNull()) {
578 di << "use 'vinit' command before " << argv[0] << "\n";
582 BRep_Builder builder;
583 TopoDS_Compound comp;
584 TopoDS_CompSolid cs1, cs2;
586 builder.MakeCompound(comp);
587 builder.MakeCompSolid(cs1);
588 builder.MakeCompSolid(cs2);
590 TopoDS_Shape sh1 = BRepPrimAPI_MakeBox(gp_Pnt(0, 0, 0), 100, 100, 100).Shape();
591 TopoDS_Shape sh2 = BRepPrimAPI_MakeBox(gp_Pnt(100, 0, 0), 100, 100, 100).Shape();
592 TopoDS_Shape sh3 = BRepPrimAPI_MakeBox(gp_Pnt(200, 0, 0), 100, 100, 100).Shape();
593 builder.Add(cs1, sh1);
594 builder.Add(cs1, sh2);
595 builder.Add(cs1, sh3);
597 TopoDS_Shape sh4 = BRepPrimAPI_MakeBox(gp_Pnt(0, 500, 0), 100, 100, 100).Shape();
598 TopoDS_Shape sh5 = BRepPrimAPI_MakeBox(gp_Pnt(100, 500, 0), 100, 100, 100).Shape();
599 TopoDS_Shape sh6 = BRepPrimAPI_MakeBox(gp_Pnt(200, 500, 0), 100, 100, 100).Shape();
601 builder.Add(cs2, sh4);
602 builder.Add(cs2, sh5);
603 builder.Add(cs2, sh6);
605 builder.Add(comp, cs1);
606 builder.Add(comp, cs2);
608 Handle(AIS_Shape) ais = new AIS_Shape(comp);
609 aContext->Display(ais);
611 TopExp_Explorer exp(comp, TopAbs_COMPSOLID);
614 //printf("\n TopAbs_COMPSOLID is there \n");
615 di << "\n TopAbs_COMPSOLID is there \n";
619 Handle (StdSelect_ShapeTypeFilter) filt = new StdSelect_ShapeTypeFilter(TopAbs_COMPSOLID);
620 aContext->AddFilter(filt);
621 aContext->CloseAllContexts();
622 aContext->OpenLocalContext();
623 aContext->ActivateStandardMode(TopAbs_SOLID);
628 static Standard_Integer OCC138LC (Draw_Interpretor& di, Standard_Integer /*argc*/, const char ** argv)
630 Handle(AIS_InteractiveContext) aContext = ViewerTest::GetAISContext();
631 if(aContext.IsNull()) {
632 di << "use 'vinit' command before " << argv[0] << "\n";
636 BRepPrimAPI_MakeBox box1(gp_Pnt(0, 0, 0), gp_Pnt(100, 100, 100));
637 BRepPrimAPI_MakeBox box2(gp_Pnt(120, 120, 120), gp_Pnt(300, 300,300));
638 BRepPrimAPI_MakeBox box3(gp_Pnt(320, 320, 320), gp_Pnt(500, 500,500));
640 Handle(AIS_Shape) ais1 = new AIS_Shape(box1.Shape());
641 Handle(AIS_Shape) ais2 = new AIS_Shape(box2.Shape());
642 Handle(AIS_Shape) ais3 = new AIS_Shape(box3.Shape());
644 aContext->Display(ais1);
645 aContext->Display(ais2);
646 aContext->Display(ais3);
648 aContext->AddOrRemoveSelected(ais1);
649 aContext->AddOrRemoveSelected(ais2);
650 aContext->AddOrRemoveSelected(ais3);
652 di << "\n No of selected = " << aContext->NbSelected();
654 aContext->InitSelected();
657 while(aContext->MoreSelected())
659 di << "\n count is = %d" << count++;
660 Handle(AIS_InteractiveObject) ais = aContext->SelectedInteractive();
661 aContext->AddOrRemoveSelected(ais);
662 aContext->InitSelected();
668 static Standard_Integer OCC189 (Draw_Interpretor& di, Standard_Integer /*argc*/, const char ** argv)
670 Handle(AIS_InteractiveContext) aContext1 = ViewerTest::GetAISContext();
671 if(aContext1.IsNull()) {
672 di << "use 'vinit' command before " << argv[0] << "\n";
675 Handle(AIS_InteractiveContext) aContext2 = ViewerTest::GetAISContext();
676 if(aContext2.IsNull()) {
677 di << "use 'vinit' command before " << argv[0] << "\n";
681 BRepPrimAPI_MakeBox box1(gp_Pnt(0, 0, 0), gp_Pnt(100, 100, 100));
682 BRepPrimAPI_MakeBox box2(gp_Pnt(120, 120, 120), gp_Pnt(300, 300, 300));
683 BRepPrimAPI_MakeBox box3(gp_Pnt(320, 320, 320), gp_Pnt(500, 500, 500));
685 Handle(AIS_Shape) ais1 = new AIS_Shape(box1.Shape());
686 Handle(AIS_Shape) ais2 = new AIS_Shape(box2.Shape());
687 Handle(AIS_Shape) ais3 = new AIS_Shape(box3.Shape());
689 aContext1->Display(ais1);
690 aContext1->Display(ais2);
691 aContext1->Display(ais3);
693 aContext2->Display(ais1);
694 aContext2->Display(ais2);
695 aContext2->Display(ais3);
697 aContext1->AddOrRemoveCurrentObject(ais1);
698 aContext1->AddOrRemoveCurrentObject(ais2);
699 aContext1->AddOrRemoveCurrentObject(ais3);
701 di << "\n Stage : 1";
702 di << "\n \t No of currents on aContext1 = " << aContext1->NbCurrents();
703 di << "\n \t No of currents on aContext2 = " << aContext2->NbCurrents() << "\n\n";
705 di << "\n aContext1->IsCurrent = " << (Standard_Integer) aContext1->IsCurrent(ais1) << ", aContext2->IsCurrent = " << (Standard_Integer) aContext2->IsCurrent(ais1) << " ";
707 aContext2->AddOrRemoveCurrentObject(ais1);
708 aContext2->AddOrRemoveCurrentObject(ais2);
709 aContext2->AddOrRemoveCurrentObject(ais3);
711 di << "\n Stage : 2";
712 di << "\n \t No of currents on aContext1 = " << aContext1->NbCurrents();
713 di << "\n \t No of currents on aContext2 = " << aContext2->NbCurrents() << "\n\n";
715 aContext1->InitCurrent();
717 while(aContext1->MoreCurrent())
719 di << "\n count1 is = " << count1++;
720 Handle(AIS_InteractiveObject) ais = aContext1->Current();
721 aContext1->AddOrRemoveCurrentObject(ais);
722 aContext1->InitCurrent();
725 di << "\n Stage : 3";
726 di << "\n \t No of currents on aContext1 = " << aContext1->NbCurrents();
727 di << "\n \t No of currents on aContext2 = " << aContext2->NbCurrents() << "\n\n";
729 aContext2->InitCurrent();
731 while(aContext2->MoreCurrent())
733 di << "\n count2 is = " << count2++;
734 Handle(AIS_InteractiveObject) ais = aContext2->Current();
735 aContext2->AddOrRemoveCurrentObject(ais);
736 aContext2->InitCurrent();
739 di << "\n\n Stage : 4";
740 di << "\n \t No of currents on aContext1 = " << aContext1->NbCurrents();
741 di << "\n \t No of currents on aContext2 = " << aContext2->NbCurrents();
746 #include <BRepBndLib.hxx>
748 //=======================================================================
751 //=======================================================================
752 static Standard_Integer OCC566(Draw_Interpretor& di,Standard_Integer n,const char ** a)
755 di<<"Usage: " << a[0] << " shape [ xmin ymin zmin xmax ymax zmax]"<<"\n";
758 TopoDS_Shape S = DBRep::Get(a[1]);
759 if (S.IsNull()) return 1;
761 BRepBndLib::AddClose(S,B);
762 Standard_Real axmin,aymin,azmin,axmax,aymax,azmax;
763 B.Get(axmin,aymin,azmin,axmax,aymax,azmax);
764 di << axmin<<" "<< aymin<<" "<< azmin<<" "<< axmax<<" "<< aymax<<" "<< azmax;
766 Draw::Set(a[2],axmin) ;
767 Draw::Set(a[3],aymin) ;
768 Draw::Set(a[4],azmin) ;
769 Draw::Set(a[5],axmax) ;
770 Draw::Set(a[6],aymax) ;
771 Draw::Set(a[7],azmax) ;
776 #include <BRepFilletAPI_MakeFillet.hxx>
777 //=======================================================================
780 //=======================================================================
781 static Standard_Integer OCC570 (Draw_Interpretor& di, Standard_Integer argc,const char ** argv)
784 di<<"Usage: " << argv[0] << " result"<<"\n";
788 BRepPrimAPI_MakeBox mkBox(100.,100.,100.);
789 TopoDS_Shape aBox = mkBox.Shape();
791 TopExp_Explorer aExp;
792 aExp.Init(aBox,TopAbs_WIRE);
795 TopoDS_Shape aWire = aExp.Current();
797 aExp.Init(aWire,TopAbs_EDGE);
798 TopoDS_Edge e1 = TopoDS::Edge(aExp.Current()); aExp.Next();
799 TopoDS_Edge e2 = TopoDS::Edge(aExp.Current()); aExp.Next();
800 TopoDS_Edge e3 = TopoDS::Edge(aExp.Current()); aExp.Next();
801 TopoDS_Edge e4 = TopoDS::Edge(aExp.Current());
806 BRepFilletAPI_MakeFillet mkFillet(aBox);
807 mkFillet.SetContinuity(GeomAbs_C1,.001);
809 // Setup variable fillet data
810 TColgp_Array1OfPnt2d t_pnt(1,4);
811 t_pnt.SetValue(1,gp_Pnt2d(0.0,5.0));
812 t_pnt.SetValue(2,gp_Pnt2d(0.3,15.0));
813 t_pnt.SetValue(3,gp_Pnt2d(0.7,15.0));
814 t_pnt.SetValue(4,gp_Pnt2d(1.0,5.0));
817 // It is impossible to build fillet if at least one edge
818 // with variable radius is added!!! If all are constant, everything is ok.
819 mkFillet.Add(t_pnt,e1);
820 mkFillet.Add(5.0,e2);
821 mkFillet.Add(t_pnt,e3);
822 mkFillet.Add(5.0,e4);
825 TopoDS_Shape aFinalShape = mkFillet.Shape();
827 DBRep::Set(argv[1],aFinalShape);
829 catch(Standard_Failure)
831 di << argv[0] << ": Exception in fillet"<<"\n";
839 #include <Law_Interpol.hxx>
841 static Standard_Real t3d = 1.e-4;
842 static Standard_Real t2d = 1.e-5;
843 static Standard_Real ta = 1.e-2;
844 static Standard_Real fl = 1.e-3;
845 static Standard_Real tapp_angle = 1.e-2;
846 static GeomAbs_Shape blend_cont = GeomAbs_C1;
848 static BRepFilletAPI_MakeFillet* Rake = 0;
849 static char name[100];
851 static void printtolblend(Draw_Interpretor& di)
853 di<<"tolerance ang : "<<ta<<"\n";
854 di<<"tolerance 3d : "<<t3d<<"\n";
855 di<<"tolerance 2d : "<<t2d<<"\n";
856 di<<"fleche : "<<fl<<"\n";
858 di<<"tolblend "<<ta<<" "<<t3d<<" "<<t2d<<" "<<fl<<"\n";
861 static Standard_Integer MKEVOL(Draw_Interpretor& di,
862 Standard_Integer narg,
865 if(Rake != 0) {delete Rake; Rake = 0;}
867 if (narg < 3) return 1;
868 TopoDS_Shape V = DBRep::Get(a[2]);
869 Rake = new BRepFilletAPI_MakeFillet(V);
870 Rake->SetParams(ta,t3d,t2d,t3d,t2d,fl);
871 Rake->SetContinuity(blend_cont, tapp_angle);
873 ChFi3d_FilletShape FSh = ChFi3d_Rational;
874 if (!strcasecmp(a[3], "Q")) {
875 FSh = ChFi3d_QuasiAngular;
877 else if (!strcasecmp(a[3], "P")) {
878 FSh = ChFi3d_Polynomial;
880 Rake->SetFilletShape(FSh);
886 static Standard_Integer UPDATEVOL(Draw_Interpretor& di,
887 Standard_Integer narg,
891 di << "MakeFillet non initialise"<<"\n";
894 if(narg%2 != 0 || narg < 4) return 1;
895 TColgp_Array1OfPnt2d uandr(1,(narg/2)-1);
896 Standard_Real Rad, Par;
897 TopoDS_Shape aLocalEdge(DBRep::Get(a[1],TopAbs_EDGE));
898 TopoDS_Edge E = TopoDS::Edge(aLocalEdge);
899 for (Standard_Integer ii = 1; ii <= (narg/2)-1; ii++){
900 Par = Draw::Atof(a[2*ii]);
901 Rad = Draw::Atof(a[2*ii + 1]);
902 uandr.ChangeValue(ii).SetCoord(Par,Rad);
904 //HELPDESK: Add law creation
905 const Standard_Boolean aLawMode = !strcmp(a[0],"OCC570evollaw");
908 di<<"INFO: Using law to define variable fillet"<<"\n";
909 Handle(Law_Interpol) law = new Law_Interpol;
919 static Standard_Integer BUILDEVOL(Draw_Interpretor& di,
924 di << "MakeFillet non initialise"<<"\n";
929 TopoDS_Shape result = Rake->Shape();
930 DBRep::Set(name,result);
931 if(Rake != 0) {delete Rake; Rake = 0;}
934 if(Rake != 0) {delete Rake; Rake = 0;}
938 #include <TColGeom_SequenceOfCurve.hxx>
939 #include <Geom_TrimmedCurve.hxx>
940 #include <GeomFill_NSections.hxx>
941 #include <BRepBuilderAPI_MakeFace.hxx>
942 //=======================================================================
945 //=======================================================================
946 static Standard_Integer OCC606 ( Draw_Interpretor& di, Standard_Integer n, const char ** a )
948 if (n != 3 && n != 4)
950 di << "Usage : " << a[0] << " result shape [-t]" << "\n";
954 Standard_Boolean TrimMode = (n == 4);
955 if (TrimMode) di<<"INFO: Using trimmed curves..."<<"\n";
956 else di<<"INFO: Using non trimmed curves..."<<"\n";
958 TopoDS_Shape S = DBRep::Get(a[2]);
960 TopExp_Explorer t_exp(S,TopAbs_EDGE);
961 TColGeom_SequenceOfCurve n_curves1;
962 TColStd_SequenceOfReal np;
963 Standard_Real param = 5.0;
965 for (;t_exp.More();t_exp.Next())
968 Handle(Geom_Curve) h_cur = BRep_Tool::Curve(TopoDS::Edge(t_exp.Current()),f,l);
971 if (TrimMode) h_cur = new Geom_TrimmedCurve(h_cur,f,l);
973 n_curves1.Append(h_cur);
979 if (n_curves1.Length()>1 && !np.IsEmpty())
984 GeomFill_NSections b_surface1(n_curves1, np);
985 b_surface1.ComputeSurface();
986 Handle(Geom_BSplineSurface) result_surf1 = b_surface1.BSplineSurface();
987 if (!result_surf1.IsNull())
989 BRepBuilderAPI_MakeFace b_face1(result_surf1, Precision::Confusion());
990 TopoDS_Face bsp_face1 = b_face1.Face();
991 DBRep::Set(a[1],bsp_face1);
994 catch(Standard_Failure)
996 di<<"ERROR: Exception in GeomFill_NSections"<<"\n";
1004 //=======================================================================
1007 //=======================================================================
1008 static Standard_Integer OCC813 (Draw_Interpretor& di, Standard_Integer argc,const char ** argv)
1012 di << "Usage : " << argv[0] << " U V" << "\n";
1016 Standard_CString str;
1017 Standard_Real U = Draw::Atof(argv[1]);
1018 Standard_Real V = Draw::Atof(argv[2]);
1020 //Between ellipse and point:
1022 Handle(Geom_Ellipse) ell = new Geom_Ellipse(gp_Ax2(gp_Pnt(1262.224429,425.040878,363.609716),
1023 gp_Dir(0.173648,0.984808,0.000000),
1024 gp_Dir(-0.932169,0.164367,-0.322560)), 150, 100);
1025 Handle(Geom_Plane) plne = new Geom_Plane(gp_Ax3(gp_Ax2(gp_Pnt(1262.224429,425.040878,363.609716),
1026 gp_Dir(0.173648,0.984808,0.000000),
1027 gp_Dir(-0.932169,0.164367,-0.322560))) );
1029 Handle(AIS_InteractiveContext) aContext = ViewerTest::GetAISContext();
1032 gp_Pln pln = plne->Pln();
1034 str = "OCC813_pnt"; DrawTrSurf::Set(str,pt2d);
1036 Handle(Geom2d_Curve) curve2d = GeomAPI::To2d(ell,pln);
1037 Geom2dAdaptor_Curve acur(curve2d);
1038 Geom2dGcc_QualifiedCurve qcur(acur, GccEnt_outside);
1040 str = "OCC813_ell"; DrawTrSurf::Set(str,curve2d);
1041 if(!aContext.IsNull()) {
1042 Handle(AIS_Shape) aisp =
1043 new AIS_Shape (BRepBuilderAPI_MakeEdge(GeomAPI::To3d(curve2d, pln)).Edge());
1044 aContext->Display (aisp);
1047 //This does not give any solutions.
1048 Geom2dGcc_Lin2d2Tan lintan(qcur, pt2d, 0.1);
1049 di<<"OCC813 nb of solutions = "<<lintan.NbSolutions()<<"\n";
1051 Standard_Character abuf[16];
1052 Standard_CString st = abuf;
1055 for(i=1;i<=lintan.NbSolutions();i++) {
1056 Sprintf(abuf,"lintan_%d",i);
1057 Handle(Geom2d_Line) glin = new Geom2d_Line(lintan.ThisSolution(i));
1058 DrawTrSurf::Set(st,glin);
1059 if(!aContext.IsNull()) {
1060 Handle(AIS_Shape) aisp =
1061 new AIS_Shape (BRepBuilderAPI_MakeEdge(GeomAPI::To3d(glin, pln)).Edge()); aContext->Display (aisp);
1068 //=======================================================================
1071 //=======================================================================
1072 static Standard_Integer OCC814 (Draw_Interpretor& di, Standard_Integer argc,const char ** argv)
1076 di << "Usage : " << argv[0] << "\n";
1080 Standard_CString str;
1082 //Between Ellipse and Circle:
1084 Handle(Geom_Circle) cir = new Geom_Circle(gp_Ax2(gp_Pnt(823.687192,502.366825,478.960440),
1085 gp_Dir(0.173648,0.984808,0.000000),
1086 gp_Dir(-0.932169,0.164367,-0.322560)), 50);
1087 Handle(Geom_Ellipse) ell = new Geom_Ellipse(gp_Ax2(gp_Pnt(1262.224429,425.040878,363.609716),
1088 gp_Dir(0.173648,0.984808,0.000000),
1089 gp_Dir(-0.932169,0.164367,-0.322560)), 150, 100);
1090 Handle(Geom_Plane) plne = new Geom_Plane(gp_Ax3(gp_Ax2(gp_Pnt(1262.224429,425.040878,363.609716),
1091 gp_Dir(0.173648,0.984808,0.000000),
1092 gp_Dir(-0.932169,0.164367,-0.322560))) );
1094 Handle(AIS_InteractiveContext) aContext = ViewerTest::GetAISContext();
1096 gp_Pln pln = plne->Pln();
1097 Handle(Geom2d_Curve) curve2d = GeomAPI::To2d(ell, pln);
1098 Handle(Geom2d_Curve) fromcurve2d = GeomAPI::To2d(cir, pln);
1100 str = "OCC814_cir"; DrawTrSurf::Set(str,curve2d);
1101 str = "OCC814_ell"; DrawTrSurf::Set(str,fromcurve2d);
1102 if(!aContext.IsNull()) {
1103 Handle(AIS_Shape) aisp =
1104 new AIS_Shape (BRepBuilderAPI_MakeEdge(GeomAPI::To3d(curve2d, pln)).Edge());
1105 aContext->Display (aisp);
1107 if(!aContext.IsNull()) {
1108 Handle(AIS_Shape) aisp =
1109 new AIS_Shape (BRepBuilderAPI_MakeEdge(GeomAPI::To3d(fromcurve2d, pln)).Edge());
1110 aContext->Display (aisp);
1113 Geom2dAdaptor_Curve acur(curve2d), afromcur(fromcurve2d);
1115 Geom2dGcc_QualifiedCurve qcur(acur, GccEnt_outside) ;
1116 Geom2dGcc_QualifiedCurve qfromcur(afromcur, GccEnt_outside) ;
1118 //This does not give any solutions.
1119 Geom2dGcc_Lin2d2Tan lintan(qcur, qfromcur, 0.1);
1120 di<<"OCC814 nb of solutions = "<<lintan.NbSolutions()<<"\n";
1122 Standard_Character abuf[16];
1123 Standard_CString st = abuf;
1126 for(i=1;i<=lintan.NbSolutions();i++) {
1127 Sprintf(abuf,"lintan_%d",i);
1128 Handle(Geom2d_Line) glin = new Geom2d_Line(lintan.ThisSolution(i));
1129 DrawTrSurf::Set(st,glin);
1130 if(!aContext.IsNull()) {
1131 Handle(AIS_Shape) aisp =
1132 new AIS_Shape (BRepBuilderAPI_MakeEdge(GeomAPI::To3d(glin, pln)).Edge()); aContext->Display (aisp);
1139 #include <ShapeAnalysis_Wire.hxx>
1140 #include <IntRes2d_SequenceOfIntersectionPoint.hxx>
1141 #include <TColgp_SequenceOfPnt.hxx>
1142 #include <ShapeFix_Wire.hxx>
1143 //=======================================================================
1146 //=======================================================================
1147 static Standard_Integer OCC884 (Draw_Interpretor& di, Standard_Integer argc, const char ** argv)
1149 if (argc < 3 || argc > 5)
1151 di << "Usage : " << argv[0] << " result shape [toler [maxtoler]]" << "\n";
1155 TopoDS_Shape shape = DBRep::Get(argv[2]); //read the shape
1157 TopExp_Explorer exp(shape, TopAbs_EDGE);
1160 di<<"Error: no edge found"<<"\n";
1164 BRep_Builder builder;
1166 builder.MakeWire(wire);
1167 builder.Add(wire, TopoDS::Edge(exp.Current()));
1169 // HelpDesk: Create planar face if possible
1170 TopoDS_Face face = BRepBuilderAPI_MakeFace(wire,Standard_True);
1172 Handle(ShapeAnalysis_Wire) advWA = new ShapeAnalysis_Wire;
1174 advWA->SetFace(face);
1175 advWA->SetPrecision(0.001);
1177 IntRes2d_SequenceOfIntersectionPoint points2d;
1178 TColgp_SequenceOfPnt points3d;
1180 di << "Info: CheckSelfIntersectingEdge = " << (Standard_Integer) advWA->CheckSelfIntersectingEdge(1,points2d,points3d) << "\n";
1182 ShapeExtend_Status status = ShapeExtend_FAIL1;
1183 if (advWA->StatusSelfIntersection(status))
1184 di << "Info: No P Curve found in the edge\n";
1186 status = ShapeExtend_FAIL2;
1187 if (advWA->StatusSelfIntersection(status))
1188 di << "Info: No Vertices found in the edge\n";
1190 status = ShapeExtend_DONE1;
1191 if (advWA->StatusSelfIntersection(status))
1192 di << "Info: Self-intersection found in the edge\n";
1194 Standard_Integer i, num = points2d.Length();
1195 di << "Info: No. of self-intersection points : " << num << "\n";
1198 Standard_CString aName = str;
1199 for (i = 1; i <= num; ++i)
1201 gp_Pnt pt = points3d(i);
1202 di << "Info: Intersecting pt : (" << pt.X() << ", " << pt.Y() << ", " << pt.Z() << ")\n";
1203 Sprintf(str,"p_%d",i);
1204 DrawTrSurf::Set(aName,pt);
1207 Handle(ShapeFix_Wire) sfw = new ShapeFix_Wire;
1211 if (argc > 3) sfw->SetPrecision(Draw::Atof(argv[3])/*0.1*/);
1212 if (argc > 4) sfw->SetMaxTolerance(Draw::Atof(argv[4]));
1213 di << "Info: Precision is set to " << sfw->Precision() << "\n";
1214 di << "Info: MaxTolerance is set to " << sfw->MaxTolerance() << "\n";
1216 sfw->ModifyTopologyMode() = 1;
1217 sfw->ModifyGeometryMode() = 1;
1218 sfw->FixSelfIntersectingEdgeMode() = 1;
1219 //printf("Info: FixSelfIntersection = %d\n",sfw->FixSelfIntersection());
1220 di << "Info: FixSelfIntersection = " << (Standard_Integer) sfw->FixSelfIntersection() << "\n";
1222 DBRep::Set(argv[1],sfw->Wire());
1224 status = ShapeExtend_OK;
1225 if (sfw->StatusSelfIntersection(status))
1226 di << "Info: ShapeExtend_OK : No intersection found\n";
1227 //printf("Info: ShapeExtend_OK : No intersection found\n");
1229 status = ShapeExtend_FAIL1;
1230 if (sfw->StatusSelfIntersection(status))
1231 di << "Info: ShapeExtend_FAIL1 : analysis failed (edge has no pcurve, or no vertices etc.)\n";
1233 status = ShapeExtend_FAIL2;
1234 if (sfw->StatusSelfIntersection(status))
1235 di << "Info: ShapeExtend_FAIL2 : self-intersection was found, but not fixed because of limit of increasing tolerance (MaxTolerance)\n";
1237 status = ShapeExtend_FAIL3;
1238 if (sfw->StatusSelfIntersection(status))
1239 di << "Info: ShapeExtend_FAIL3 : intercestion of non adjacent edges found, but not fixed because of limit of increasing tolerance (MaxTolerance)\n";
1241 status = ShapeExtend_DONE1;
1242 if (sfw->StatusSelfIntersection(status))
1243 di << "Info: ShapeExtend_DONE1 : tolerance of vertex was increased to fix self-intersection\n";
1245 status = ShapeExtend_DONE2;
1246 if (sfw->StatusSelfIntersection(status))
1247 di << "Info: ShapeExtend_DONE2 : vertex was moved to fix self-intersection\n";
1249 status = ShapeExtend_DONE3;
1250 if (sfw->StatusSelfIntersection(status))
1251 di << "Info: ShapeExtend_DONE3 : some edges were removed because of intersection\n";
1253 status = ShapeExtend_DONE4;
1254 if (sfw->StatusSelfIntersection(status))
1255 di << "Info: ShapeExtend_DONE4 : pcurve(s) was(were) modified\n";
1257 status = ShapeExtend_DONE5;
1258 if (sfw->StatusSelfIntersection(status))
1259 di << "Info: ShapeExtend_DONE5 : non adjacent intersection fixed by increasing tolerance of vertex(vertices)\n";
1261 status = ShapeExtend_DONE6;
1262 if (sfw->StatusSelfIntersection(status))
1263 di << "Info: ShapeExtend_DONE6 : tolerance of edge was increased to hide intersection\n";
1265 status = ShapeExtend_DONE7;
1266 if (sfw->StatusSelfIntersection(status))
1267 di << "Info: ShapeExtend_DONE7 : range of some edges was decreased to avoid intersection\n";
1272 #include <Aspect_FillMethod.hxx>
1273 //=======================================================================
1274 //function : OCC1188
1276 //=======================================================================
1277 static Standard_Integer OCC1188 (Draw_Interpretor& di, Standard_Integer argc, const char ** argv)
1279 if (argc < 2 || argc > 3)
1281 di << "Usage : " << argv[0] << " imagefile [filltype] : Load image as background" << "\n";
1285 Handle(AIS_InteractiveContext) AISContext = ViewerTest::GetAISContext();
1286 if(AISContext.IsNull())
1288 di << "use 'vinit' command before " << argv[0] << "\n";
1292 Aspect_FillMethod aFillType = Aspect_FM_CENTERED;
1295 const char* szType = argv[2];
1296 if (strcmp(szType, "NONE" ) == 0) aFillType = Aspect_FM_NONE;
1297 else if (strcmp(szType, "CENTERED") == 0) aFillType = Aspect_FM_CENTERED;
1298 else if (strcmp(szType, "TILED" ) == 0) aFillType = Aspect_FM_TILED;
1299 else if (strcmp(szType, "STRETCH" ) == 0) aFillType = Aspect_FM_STRETCH;
1302 di << "Wrong fill type : " << szType << "\n";
1303 di << "Must be one of CENTERED, TILED, STRETCH, NONE" << "\n";
1308 Handle(V3d_View) V3dView = ViewerTest::CurrentView();
1309 V3dView->SetBackgroundImage(argv[1], aFillType, Standard_True);
1314 #include <AIS_Drawer.hxx>
1315 #include <Graphic3d_MaterialAspect.hxx>
1316 #include <Prs3d_ShadingAspect.hxx>
1317 //=======================================================================
1318 //function : OCC1174_1
1320 //=======================================================================
1321 static Standard_Integer OCC1174_1 (Draw_Interpretor& di, Standard_Integer argc, const char ** argv)
1325 di << "Usage : " << argv[0] << " shape" << "\n";
1329 Handle(AIS_InteractiveContext) AISContext = ViewerTest::GetAISContext();
1330 if(AISContext.IsNull())
1332 di << "use 'vinit' command before " << argv[0] << "\n";
1336 TopoDS_Shape sh = DBRep::Get(argv[1]);
1338 Handle(AIS_Shape) ais = new AIS_Shape(sh);
1340 Quantity_Color colf(0.0, 0.4, 0.0, Quantity_TOC_RGB);
1341 Quantity_Color colb(0.0, 0.0, 0.6, Quantity_TOC_RGB);
1343 Handle(Prs3d_ShadingAspect) sa = ais->Attributes()->ShadingAspect();
1345 Graphic3d_MaterialAspect front = sa->Material(Aspect_TOFM_FRONT_SIDE);
1346 front.SetAmbientColor(colf);
1347 front.SetDiffuseColor(colf);
1348 front.SetSpecularColor(colf);
1349 front.SetEmissiveColor(colf);
1350 front.SetTransparency(0.0);
1351 sa->SetMaterial(front,Aspect_TOFM_FRONT_SIDE);
1353 Graphic3d_MaterialAspect back = sa->Material(Aspect_TOFM_BACK_SIDE);
1354 back.SetAmbientColor(colb);
1355 back.SetDiffuseColor(colb);
1356 back.SetSpecularColor(colb);
1357 back.SetEmissiveColor(colb);
1358 back.SetTransparency(0.0);
1359 sa->SetMaterial(back,Aspect_TOFM_BACK_SIDE);
1361 AISContext->Display(ais,1,0);
1363 Standard_Real r, g, b;
1364 sa->Color(Aspect_TOFM_FRONT_SIDE).Values(r,g,b, Quantity_TOC_RGB);
1365 di << "Info: color on front side (" << r << "," << g << "," << b << ")\n";
1366 sa->Color(Aspect_TOFM_BACK_SIDE).Values(r,g,b, Quantity_TOC_RGB);
1367 di << "Info: color on back side (" << r << "," << g << "," << b << ")\n";
1372 //=======================================================================
1373 //function : OCC1174_2
1375 //=======================================================================
1376 static Standard_Integer OCC1174_2 (Draw_Interpretor& di, Standard_Integer argc, const char ** argv)
1380 di << "Usage : " << argv[0] << " shape" << "\n";
1384 Handle(AIS_InteractiveContext) AISContext = ViewerTest::GetAISContext();
1385 if(AISContext.IsNull())
1387 di << "use 'vinit' command before " << argv[0] << "\n";
1391 TopoDS_Shape sh = DBRep::Get(argv[1]);
1393 Handle(AIS_Shape) ais = new AIS_Shape(sh);
1394 AISContext->Display(ais,1,0);
1395 AISContext->SetMaterial(ais,Graphic3d_NOM_SHINY_PLASTIC);
1397 Quantity_Color colf(0.0, 0.4, 0.0, Quantity_TOC_RGB);
1398 Quantity_Color colb(0.0, 0.0, 0.6, Quantity_TOC_RGB);
1399 Handle(Prs3d_ShadingAspect) sa = ais->Attributes()->ShadingAspect();
1401 Graphic3d_MaterialAspect front = sa->Material(Aspect_TOFM_FRONT_SIDE);
1402 front.SetAmbientColor(colf);
1403 front.SetDiffuseColor(colf);
1404 front.SetSpecularColor(colf);
1405 front.SetEmissiveColor(colf);
1406 front.SetTransparency(0.4);
1407 sa->SetMaterial(front,Aspect_TOFM_FRONT_SIDE);
1409 Graphic3d_MaterialAspect back = sa->Material(Aspect_TOFM_BACK_SIDE);
1410 back.SetAmbientColor(colb);
1411 back.SetDiffuseColor(colb);
1412 back.SetSpecularColor(colb);
1413 back.SetEmissiveColor(colb);
1414 back.SetTransparency(0.2);
1415 sa->SetMaterial(back,Aspect_TOFM_BACK_SIDE);
1417 AISContext->Redisplay(ais,1,0);
1422 #include <TopoDS_Solid.hxx>
1423 #include <BRepFeat_MakeDPrism.hxx>
1424 //=======================================================================
1426 //purpose : FEATURE OPERATION (BOSS and SLOT)
1427 //=======================================================================
1428 static Standard_Integer OCCN1 (Draw_Interpretor& di, Standard_Integer argc, const char ** argv)
1432 di << "Usage : " << argv[0] << " angle fuse(1 for boss / 0 for slot) length" << "\n";
1436 Handle(AIS_InteractiveContext) aContext = ViewerTest::GetAISContext();
1437 if(aContext.IsNull())
1439 di << "use 'vinit' command before " << argv[0] << "\n";
1442 Standard_Real angle = Draw::Atof(argv[1]);
1443 Standard_Integer fuse = Draw::Atoi(argv[2]);
1444 Standard_Real length = Draw::Atof(argv[3]);
1446 BRepBuilderAPI_MakeEdge edge1(gp_Pnt(0, 0, 0), gp_Pnt(50, 0, 0));
1447 BRepBuilderAPI_MakeEdge edge2(gp_Pnt(50, 0, 0), gp_Pnt(50, 50, 0));
1448 BRepBuilderAPI_MakeEdge edge3(gp_Pnt(50, 50, 0), gp_Pnt(0, 50, 0));
1449 BRepBuilderAPI_MakeEdge edge4(gp_Pnt(0, 50, 0), gp_Pnt(0, 0, 0));
1450 TopoDS_Edge ted1 = edge1.Edge();
1451 TopoDS_Edge ted2 = edge2.Edge();
1452 TopoDS_Edge ted3 = edge3.Edge();
1453 TopoDS_Edge ted4 = edge4.Edge();
1455 BRepBuilderAPI_MakeWire wire(ted1, ted2, ted3, ted4);
1456 TopoDS_Wire twire = wire.Wire();
1458 BRepBuilderAPI_MakeFace face(twire);
1459 TopoDS_Face tface = face.Face();
1460 ////////Handle(AIS_Shape) face_ais = new AIS_Shape( tface );
1461 ////////aContext->Display(face_ais);
1464 BRepPrimAPI_MakeBox block(gp_Pnt(-50, -50, -150), 150, 150, 100);
1465 box = block.Solid();
1467 TopoDS_Face top_face;
1468 top_face = block.TopFace();
1470 BRepFeat_MakeDPrism slot(box, tface, top_face, angle, fuse,
1473 slot.Perform(length);
1474 TopoDS_Shape S2 = slot.Shape();
1476 DBRep::Set("OCCN1_tface",tface);
1477 DBRep::Set("OCCN1_slot",S2);
1482 #include <BRepPrimAPI_MakeCylinder.hxx>
1483 #include <BRepPrimAPI_MakeSphere.hxx>
1484 #include <BRepAlgoAPI_Section.hxx>
1485 #include <BRepAlgo_Section.hxx>
1486 //=======================================================================
1488 //purpose : BOOLEAN OPERATION
1489 //=======================================================================
1490 static Standard_Integer OCCN2 (Draw_Interpretor& di, Standard_Integer argc, const char ** argv)
1493 di << "Usage : " << argv[0] << " [BRepAlgoAPI/BRepAlgo = 1/0]" << "\n";
1496 Standard_Boolean IsBRepAlgoAPI = Standard_True;
1498 Standard_Integer IsB = Draw::Atoi(argv[1]);
1500 IsBRepAlgoAPI = Standard_False;
1501 #if ! defined(BRepAlgo_def04)
1506 Handle(AIS_InteractiveContext) aContext = ViewerTest::GetAISContext();
1507 if(aContext.IsNull())
1509 di << "use 'vinit' command before " << argv[0] << "\n";
1513 BRepPrimAPI_MakeCylinder cylinder(50,200);
1514 TopoDS_Shape cylinder_sh = cylinder.Shape();
1516 BRepPrimAPI_MakeSphere sphere(gp_Pnt(60,0,100),50);
1517 TopoDS_Shape sphere_sh = sphere.Shape();
1519 //BRepAlgoAPI_Section section(cylinder_sh, sphere_sh);
1520 //TopoDS_Shape shape = section.Shape();
1523 if (IsBRepAlgoAPI) {
1524 di << "BRepAlgoAPI_Section section(cylinder_sh, sphere_sh)" <<"\n";
1525 BRepAlgoAPI_Section section(cylinder_sh, sphere_sh);
1527 if(!section.IsDone()){
1528 di << "Error performing intersection: not done." << "\n";
1530 shape = section.Shape();
1532 di << "BRepAlgo_Section section(cylinder_sh, sphere_sh)" <<"\n";
1533 BRepAlgo_Section section(cylinder_sh, sphere_sh);
1535 if(!section.IsDone()){
1536 di << "Error performing intersection: not done." << "\n";
1538 shape = section.Shape();
1541 DBRep::Set("OCCN2_cylinder",cylinder_sh);
1542 DBRep::Set("OCCN2_sphere",sphere_sh);
1543 DBRep::Set("OCCN2_section",shape);
1548 #include <TColgp_Array1OfPnt.hxx>
1549 #include <Geom_BezierCurve.hxx>
1551 static Standard_Integer OCC2569 (Draw_Interpretor& di, Standard_Integer argc, const char ** argv)
1553 Handle(AIS_InteractiveContext) aContext = ViewerTest::GetAISContext();
1554 if(aContext.IsNull())
1556 di << "use 'vinit' command before " << argv[0] << "\n";
1560 di << "Usage : " << argv[0] << " nbpoles result" << "\n";
1564 int poles=Draw::Atoi(argv[1]);
1566 TColgp_Array1OfPnt arr(1, poles);
1567 for(int i=1; i<=poles; i++)
1568 arr.SetValue(i, gp_Pnt(i+10, i*2+20, i*3+45));
1570 Handle(Geom_BezierCurve) bez = new Geom_BezierCurve(arr);
1572 di << "\n The curve is not created.\n";
1574 di << "\n Degree = " << bez->Degree() << "\n";
1576 TopoDS_Edge sh = BRepBuilderAPI_MakeEdge(bez).Edge();
1577 Handle(AIS_Shape) ais = new AIS_Shape(sh);
1578 aContext->Display(ais);
1579 DrawTrSurf::Set(argv[2],bez);
1583 #include <TopTools_IndexedMapOfShape.hxx>
1584 #include <TopExp.hxx>
1586 static Standard_Integer OCC1642 (Draw_Interpretor& di, Standard_Integer argc, const char ** argv)
1589 di<<"Usage: " << argv[0] << " FinalWare FinalFace InitWare InitFace shape FixReorder FixDegenerated FixConnected FixSelfIntersection"<<"\n";
1593 TopoDS_Shape shape = DBRep::Get(argv[5]);
1595 TopExp_Explorer exp(shape, TopAbs_WIRE);
1596 TopoDS_Shape wire = exp.Current();
1598 Handle(ShapeAnalysis_Wire) advWA = new ShapeAnalysis_Wire;
1599 advWA->Load(TopoDS::Wire(wire));
1601 DBRep::Set(argv[3],wire);
1604 BRepBuilderAPI_MakeFace(TopoDS::Wire(wire),Standard_True);
1606 DBRep::Set(argv[4],face);
1608 advWA->SetFace(face);
1609 Standard_Real precision_to_ana = 0.0001;
1610 advWA->SetPrecision(precision_to_ana);
1612 TopTools_IndexedMapOfShape M;
1613 TopExp::MapShapes(wire, TopAbs_EDGE, M);
1616 for(j= 1; j<=M.Extent(); ++j) {
1617 Standard_Integer num=1;
1618 IntRes2d_SequenceOfIntersectionPoint points2d;
1619 TColgp_SequenceOfPnt points3d;
1621 cout << "\n j =" << j << ", CheckSelfIntersectingEdge = " <<
1622 advWA->CheckSelfIntersectingEdge(j, points2d, points3d);
1625 ShapeExtend_Status status = ShapeExtend_FAIL1;
1626 if(advWA->StatusSelfIntersection(status))
1628 status = ShapeExtend_FAIL2;
1629 if(advWA->StatusSelfIntersection(status))
1630 di << "\n No Vertices found in the edge";
1632 status = ShapeExtend_DONE1;
1633 if(advWA->StatusSelfIntersection(status))
1634 di << "\n Self-intersection found in the edge";
1636 num = points2d.Length();
1637 di << "\n No. of self-intersecting edges : " << num;
1639 for(int i=1; i<=num; ++i) {
1640 gp_Pnt pt = points3d(i);
1641 di << "\n Intersecting pt : (" << pt.X() << ", " << pt.Y()<< ", " << pt.Z() << ")";
1646 Handle(ShapeFix_Wire) sfw = new ShapeFix_Wire;
1647 sfw->Load(TopoDS::Wire(wire));
1649 sfw->SetPrecision(Precision::Confusion());
1651 sfw->FixReorderMode() = 1;
1652 sfw->ClosedWireMode() = 1;
1653 sfw->FixDegeneratedMode() = 1;
1654 sfw->FixConnectedMode() = 1;
1655 sfw->ModifyTopologyMode() = 1;
1656 sfw->ModifyGeometryMode() = 1;
1657 sfw->FixSelfIntersectionMode() = 1;
1658 sfw->FixSelfIntersectingEdgeMode() = 1;
1659 sfw->FixIntersectingEdgesMode() = 1;
1660 sfw->FixNonAdjacentIntersectingEdgesMode() = 1;
1661 sfw->FixEdgeCurvesMode() = 1;
1663 sfw->ModifyRemoveLoopMode() = 1;
1664 sfw->SetMaxTolerance(1.0);
1666 di << "\n FixReorder = " << (Standard_Integer) sfw->FixReorder();
1667 di << "\n FixDegenerated = " << (Standard_Integer) sfw->FixDegenerated();
1668 di << "\n FixConnected = " << (Standard_Integer) sfw->FixConnected();
1670 di << "\n FixSelfIntersection = " << (Standard_Integer) sfw->FixSelfIntersection();
1673 Draw::Set(argv[6],sfw->FixReorder()) ;
1674 Draw::Set(argv[7],sfw->FixDegenerated()) ;
1675 Draw::Set(argv[8],sfw->FixConnected()) ;
1676 Draw::Set(argv[9],sfw->FixSelfIntersection()) ;
1678 ShapeExtend_Status status = ShapeExtend_OK;
1679 if(sfw->StatusSelfIntersection(status))
1680 di << "\n ShapeExtend_OK : No intersection found";
1682 status = ShapeExtend_FAIL1;
1683 if(sfw->StatusSelfIntersection(status))
1684 di << "\n ShapeExtend_FAIL1 : analysis failed (edge has no pcurve,or no vertices etc.)";
1686 status = ShapeExtend_FAIL2;
1687 if(sfw->StatusSelfIntersection(status))
1688 di << "\n ShapeExtend_FAIL2 : self-intersection was found, but not fixed because of limit of increasing tolerance (MaxTolerance)";
1690 status = ShapeExtend_FAIL3;
1691 if(sfw->StatusSelfIntersection(status))
1692 di << "\n ShapeExtend_FAIL3 : intercestion of non adjacent edges found, but not fixed because of limit of increasing tolerance (MaxTolerance)";
1694 status = ShapeExtend_DONE1;
1695 if(sfw->StatusSelfIntersection(status))
1696 di << "\n ShapeExtend_DONE1 : tolerance of vertex was increased to fix self-intersection";
1698 status = ShapeExtend_DONE2;
1699 if(sfw->StatusSelfIntersection(status))
1700 di << "\n ShapeExtend_DONE2 : vertex was moved to fix self-intersection";
1702 status = ShapeExtend_DONE3;
1703 if(sfw->StatusSelfIntersection(status))
1704 di << "\n ShapeExtend_DONE3 : some edges were removed because of intersection";
1706 status = ShapeExtend_DONE4;
1707 if(sfw->StatusSelfIntersection(status))
1708 di << "\n ShapeExtend_DONE4 : pcurve(s) was(were) modified";
1710 status = ShapeExtend_DONE5;
1711 if(sfw->StatusSelfIntersection(status))
1712 di << "\n ShapeExtend_DONE5 : non adjacent intersection fixed by increasing tolerance of vertex(vertices)";
1714 status = ShapeExtend_DONE6;
1715 if(sfw->StatusSelfIntersection(status))
1716 di << "\n ShapeExtend_DONE6 : tolerance of edge was increased to hide intersection";
1718 status = ShapeExtend_DONE7;
1719 if(sfw->StatusSelfIntersection(status))
1720 di << "\n ShapeExtend_DONE7 : range of some edges was decreased to avoid intersection";
1722 TopoDS_Wire finalwire = sfw->Wire();
1724 DBRep::Set(argv[1],finalwire);
1727 advWA->Load(TopoDS::Wire(finalwire));
1730 BRepBuilderAPI_MakeFace(TopoDS::Wire(finalwire),Standard_True);
1732 DBRep::Set(argv[2],fface);
1734 advWA->SetFace(fface);
1736 TopTools_IndexedMapOfShape fM;
1737 TopExp::MapShapes(finalwire, TopAbs_EDGE, fM);
1739 for(j= 1; j<=fM.Extent(); ++j) {
1740 Standard_Integer num=1;
1741 IntRes2d_SequenceOfIntersectionPoint points2d;
1742 TColgp_SequenceOfPnt points3d;
1744 di << "\n j =" << j << ", CheckSelfIntersectingEdge = " <<
1745 (Standard_Integer) advWA->CheckSelfIntersectingEdge(j, points2d, points3d);
1748 ShapeExtend_Status status = ShapeExtend_FAIL1;
1749 if(advWA->StatusSelfIntersection(status))
1751 status = ShapeExtend_FAIL2;
1752 if(advWA->StatusSelfIntersection(status))
1753 di << "\n No Vertices found in the edge";
1755 status = ShapeExtend_DONE1;
1756 if(advWA->StatusSelfIntersection(status))
1757 di << "\n Self-intersection found in the edge";
1759 num = points2d.Length();
1760 di << "\n No. of self-intersecting edges : " << num;
1762 for(int i=1; i<=num; ++i) {
1763 gp_Pnt pt = points3d(i);
1764 di << "\n Intersecting pt : (" << pt.X() << ", " << pt.Y() << ", " << pt.Z() << ")";
1774 void QABugs::Commands_17(Draw_Interpretor& theCommands) {
1775 const char *group = "QABugs";
1777 theCommands.Add ("BUC60842", "BUC60842", __FILE__, BUC60842, group);
1778 theCommands.Add ("BUC60843", "BUC60843 result_shape name_of_circle name_of_curve [ par1 [ tol ] ]", __FILE__, BUC60843, group);
1779 theCommands.Add ("BUC60970", "BUC60970 shape result", __FILE__, BUC60970, group);
1780 theCommands.Add ("BUC60818", "BUC60818", __FILE__, BUC60818, group);
1781 theCommands.Add ("BUC60915", "BUC60915", __FILE__, BUC60915_1, group);
1782 theCommands.Add ("OCC138", "OCC138", __FILE__, OCC138, group);
1783 theCommands.Add ("BUC60821","BUC60821",__FILE__,BUC60821,group);
1784 theCommands.Add ("OCC353","OCC353",__FILE__,OCC353,group);
1785 theCommands.Add ("OCC280","OCC280 hlr=0/1 setsurfecedetail=0/1; set perspecrive view",__FILE__,OCC280,group);
1786 theCommands.Add ("OCC232", "OCC232", __FILE__, OCC232 , group);
1787 theCommands.Add ("OCC138LC", "OCC138LC", __FILE__, OCC138LC, group);
1788 theCommands.Add ("OCC189", "OCC189", __FILE__, OCC189, group);
1789 theCommands.Add ("OCC566", "OCC566 shape [ xmin ymin zmin xmax ymax zmax] ; print bounding box", __FILE__, OCC566, group);
1790 theCommands.Add ("OCC570", "OCC570 result", __FILE__, OCC570, group);
1792 theCommands.Add("OCC570mkevol",
1793 "OCC570mkevol result object (then use updatevol) [R/Q/P]; mkevol",
1794 __FILE__, MKEVOL,group);
1795 theCommands.Add("OCC570updatevol",
1796 "OCC570updatevol edge u1 rad1 u2 rad2 ...; updatevol",
1797 __FILE__, UPDATEVOL,group);
1798 theCommands.Add("OCC570updatevollaw",
1799 "OCC570updatevollaw edge u1 rad1 u2 rad2 ...; updatevollaw",
1800 __FILE__, UPDATEVOL,group);
1801 theCommands.Add("OCC570buildevol",
1802 "OCC570buildevol; end of the evol fillet computation",
1803 __FILE__, BUILDEVOL,group);
1805 theCommands.Add ("OCC606", "OCC606 result shape [-t]", __FILE__, OCC606, group);
1807 theCommands.Add ("OCC813", "OCC813 U V", __FILE__, OCC813, group);
1808 theCommands.Add ("OCC814", "OCC814", __FILE__, OCC814, group);
1809 theCommands.Add ("OCC884", "OCC884 result shape [toler [maxtoler]]", __FILE__, OCC884, group);
1810 theCommands.Add ("OCC1188", "OCC1188 imagefile [filltype] : Load image as background", __FILE__, OCC1188, group);
1812 theCommands.Add ("OCC1174_1", "OCC1174_1 shape", __FILE__, OCC1174_1, group);
1813 theCommands.Add ("OCC1174_2", "OCC1174_2 shape", __FILE__, OCC1174_2, group);
1815 theCommands.Add ("OCCN1", "OCCN1 angle fuse(1 for boss / 0 for slot) length", __FILE__, OCCN1, group);
1816 theCommands.Add ("OCCN2", "OCCN2", __FILE__, OCCN2, group);
1818 theCommands.Add ("OCC2569", "OCC2569 nbpoles result", __FILE__, OCC2569, group);
1820 theCommands.Add ("OCC1642", "OCC1642 FinalWare FinalFace InitWare InitFace shape FixReorder FixDegenerated FixConnected FixSelfIntersection", __FILE__, OCC1642, group);