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_MyQCurve.hxx>
45 #include <GccEnt_QualifiedCirc.hxx>
46 #include <Geom2dGcc_MyL2d2Tan.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 <ViewerTest_Tool.hxx>
58 #include <BRepBuilderAPI_MakeVertex.hxx>
59 #include <AIS_LengthDimension.hxx>
60 #include <AIS_RadiusDimension.hxx>
61 #include <BRepPrimAPI_MakeBox.hxx>
62 #include <GeomAdaptor_Surface.hxx>
63 #include <Extrema_ExtPS.hxx>
64 #include <Geom_CartesianPoint.hxx>
65 #include <Geom2d_CartesianPoint.hxx>
66 #include <Geom2dGcc_Circ2d3Tan.hxx>
67 #include <Aspect_Window.hxx>
69 #include <TopoDS_Compound.hxx>
70 #include <TopoDS_CompSolid.hxx>
71 #include <StdSelect_ShapeTypeFilter.hxx>
72 #include <QABugs_MyText.hxx>
73 #include <Prs3d_Projector.hxx>
74 #include <HLRAlgo_Projector.hxx>
75 #include <Standard_ErrorHandler.hxx>
76 #include <Font_NameOfFont.hxx>
78 static Standard_Integer BUC60842 (Draw_Interpretor& di, Standard_Integer /*argc*/,const char ** /*argv*/)
80 Standard_Character abuf[16];
81 //Standard_Character * abuf = new Standard_Character[16];
83 Standard_CString st = abuf;
85 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);
86 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);
87 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))));
89 Handle(AIS_InteractiveContext) aContext = ViewerTest::GetAISContext();
91 gp_Pln pln = plne->Pln();
92 Handle(Geom2d_Curve) curve2d = GeomAPI::To2d (ell, pln);
94 DrawTrSurf::Set(st,curve2d);
95 if(!aContext.IsNull()) {
96 Handle(AIS_Shape) aisp =
97 new AIS_Shape (BRepBuilderAPI_MakeEdge(GeomAPI::To3d(curve2d, pln)).Edge());
98 aContext->Display (aisp);
101 Handle(Geom2d_Curve) fromcurve2d = GeomAPI::To2d (cir, pln);
103 DrawTrSurf::Set(st,fromcurve2d);
104 if(!aContext.IsNull()) {
105 Handle(AIS_Shape) aisp =
106 new AIS_Shape (BRepBuilderAPI_MakeEdge(GeomAPI::To3d(fromcurve2d, pln)).Edge());
107 aContext->Display (aisp);
110 Geom2dAdaptor_Curve acur (curve2d), afromcur (fromcurve2d);
111 Geom2dGcc_QualifiedCurve qcur (acur, GccEnt_outside);
112 Geom2dGcc_QualifiedCurve qfromcur (afromcur, GccEnt_outside);
113 Geom2dGcc_Lin2d2Tan lintan (qcur, qfromcur, 0.1, 0.0, 0.0);
114 Standard_Integer i=0;
115 for(i=0;i<lintan.NbSolutions();i++) {
116 Sprintf(abuf,"lintan_%d",i);
117 Handle(Geom2d_Line) glin = new Geom2d_Line(lintan.ThisSolution(i));
118 DrawTrSurf::Set(st,glin);
119 if(!aContext.IsNull()) {
120 Handle(AIS_Shape) aisp =
121 new AIS_Shape (BRepBuilderAPI_MakeEdge(GeomAPI::To3d(glin, pln)).Edge()); aContext->Display (aisp);
124 di << " Is Done = \n" << (Standard_Integer) lintan.IsDone();
128 static Standard_Integer BUC60843 (Draw_Interpretor& di, Standard_Integer argc,const char ** argv)
130 if (argc != 4 && argc != 5 && argc != 6 && argc != 7) {
131 di << "Usage : " << argv[0] << "result_shape name_of_circle name_of_curve [ par1 [ tol ] ]" << "\n";
135 Standard_Real par1 = 0.0, par2 = 0.0;
136 Standard_Real tol = Precision::Angular();
138 par1 = Draw::Atof(argv[4]);
140 par2 = Draw::Atof(argv[5]);
142 tol = Draw::Atof(argv[6]);
143 Handle(Geom2d_Curve) aCur2d1 = DrawTrSurf::GetCurve2d(argv[2]);
144 Handle(Geom2d_Curve) aCur2d2 = DrawTrSurf::GetCurve2d(argv[3]);
145 if (aCur2d1.IsNull() || aCur2d2.IsNull()) {
146 di << "Faulty : not curves" << "\n";
149 Standard_Boolean c1IsCircle = Standard_False;
150 Handle(Geom2d_Circle) aCir2d = Handle(Geom2d_Circle)::DownCast(aCur2d1);
151 if (!aCir2d.IsNull()) {
152 c1IsCircle = Standard_True;
153 if (argc == 6) tol = Draw::Atof(argv[5]);
156 Geom2dAdaptor_Curve acur(aCur2d2);
157 Geom2dGcc_MyQCurve qcur(acur, GccEnt_unqualified);
158 GccEnt_QualifiedCirc qfromcur(aCir2d->Circ2d(), GccEnt_unqualified);
159 Geom2dGcc_MyL2d2Tan lintan(qfromcur, qcur , par1, tol);
160 if (lintan.IsDone()) {
161 gp_Lin2d lin = lintan.ThisSolution();
162 Handle(Geom2d_Line) glin = new Geom2d_Line(lin);
163 DrawTrSurf::Set(argv[1], glin);
165 di << "Faulty : tangent line is not done." << "\n";
169 Geom2dAdaptor_Curve acur1(aCur2d1);
170 Geom2dAdaptor_Curve acur2(aCur2d2);
171 Geom2dGcc_MyQCurve qcur1(acur1, GccEnt_unqualified);
172 Geom2dGcc_MyQCurve qcur2(acur2, GccEnt_unqualified);
173 Geom2dGcc_MyL2d2Tan lintan(qcur1, qcur2 , par1, par2, tol);
174 if (lintan.IsDone()) {
175 gp_Lin2d lin = lintan.ThisSolution();
176 Handle(Geom2d_Line) glin = new Geom2d_Line(lin);
177 DrawTrSurf::Set(argv[1], glin);
179 di << "Faulty : tangent line is not done." << "\n";
185 static Standard_Integer BUC60970 (Draw_Interpretor& di, Standard_Integer argc, const char ** argv)
189 di << "Usage : " << argv[0] << " shape result" <<"\n";
193 Handle(AIS_InteractiveContext) aContext = ViewerTest::GetAISContext();
194 if(aContext.IsNull()) {
195 di << "use 'vinit' command before " << argv[0] << "\n";
199 TopoDS_Shape aResult = DBRep::Get(argv[1]);
201 BRepBuilderAPI_MakeWire bRepSpineWire;
202 TopExp_Explorer exp_(aResult, TopAbs_WIRE);
204 Standard_Integer i = 0;
205 for(;exp_.More();exp_.Next()){
207 bRepSpineWire.Add(TopoDS::Wire(exp_.Current()));
210 //printf("total no of wires are ............. %d\n", i);
211 di << "total no of wires are ............. " << i << "\n";
213 TopoDS_Wire spineWire = bRepSpineWire.Wire();
214 aContext->Display(new AIS_Shape(spineWire));
216 DBRep::Set("slineW",spineWire);
218 TopExp_Explorer spineWireExp(spineWire, TopAbs_EDGE);
219 Standard_Real first, last;
220 Handle_Geom_Curve curl_ = BRep_Tool::Curve(TopoDS::Edge(spineWireExp.Current()), first, last);
223 curl_->D1(first, firstPnt, tanVec);
225 gp_Dir tanDir(tanVec.X(), tanVec.Y(), tanVec.Z());
226 gp_Ax2 gpAx2(firstPnt, tanDir);
227 gp_Circ gpCirc(gpAx2, 2.5);
228 BRepBuilderAPI_MakeWire aMWire(BRepBuilderAPI_MakeEdge(new Geom_Circle(gpCirc)).Edge());
229 TopoDS_Wire topoWire(aMWire);
230 aContext->Display(new AIS_Shape(topoWire));
232 DBRep::Set("topoW",topoWire);
234 BRepOffsetAPI_MakePipeShell bRepPipe(spineWire);
235 bRepPipe.Add(topoWire);
238 aContext->Display(new AIS_Shape(bRepPipe.Shape()));
240 DBRep::Set(argv[2],bRepPipe.Shape());
245 static Standard_Integer BUC60818(Draw_Interpretor& di, Standard_Integer argc, const char ** argv)
249 di << "Usage : " << argv[0] << "\n";
253 Handle(AIS_InteractiveContext) myAISContext = ViewerTest::GetAISContext();
254 if(myAISContext.IsNull())
256 di << "use 'vinit' command before " << argv[0] << "\n";
261 Handle(AIS_Trihedron) aTrihedron;
262 Handle(Geom_Axis2Placement) aTrihedronAxis=new Geom_Axis2Placement(gp::XOY());
263 aTrihedron=new AIS_Trihedron(aTrihedronAxis);
264 myAISContext->Display(aTrihedron);
266 myAISContext->OpenLocalContext();
267 myAISContext->Load(aTrihedron,0);
269 myAISContext->SetAutomaticHilight( Standard_False );
271 Handle(V3d_View) myV3dView = ViewerTest::CurrentView();
273 myV3dView->Project(0,0,0,Xv,Yv);
275 Standard_Integer Xp,Yp;
276 myV3dView->Convert(Xv,Yv,Xp,Yp);
278 myAISContext->MoveTo( Xp,Yp, myV3dView );
279 myAISContext->MoveTo( Xp,Yp, myV3dView );
281 if (myAISContext->HasDetected( ))
282 di << "has detected shape : OK" << "\n";
283 else di << "has detected shape : bugged - Faulty " << "\n";
285 myAISContext->SetAutomaticHilight( Standard_True );
290 static Standard_Integer BUC60915_1(Draw_Interpretor& di, Standard_Integer argc, const char ** argv)
293 di<<"Function don't has parameters"<<"\n";
297 if(ViewerTest::GetAISContext().IsNull())
299 di << "View was not created. Use 'vinit' command before "
303 Handle(AIS_InteractiveContext) context = ViewerTest::GetAISContext();
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 Handle(Prs3d_DimensionAspect) anAspect = new Prs3d_DimensionAspect();
329 anAspect->MakeArrows3d (Standard_True);
330 anAspect->ArrowAspect()->SetAngle (M_PI/180.0 * 10.0);
331 /***************************************/
332 //dimension "L 502.51"
333 /***************************************/
334 Handle(AIS_LengthDimension) len = new AIS_LengthDimension(V2, V3, pln->Pln());
335 anAspect->ArrowAspect()->SetLength (30.0);
336 len->SetDimensionAspect (anAspect);
337 context->Display(len);
338 /***************************************/
340 /***************************************/
341 Handle(AIS_LengthDimension) len1 = new AIS_LengthDimension(V7, V4, pln->Pln());
342 len1->SetDimensionAspect (anAspect);
343 len1->SetFlyout (30.0);
344 anAspect->ArrowAspect()->SetLength (100.0);
345 context->Display(len1);
346 /***************************************/
348 /***************************************/
349 Handle(AIS_LengthDimension) len2 = new AIS_LengthDimension(V1, V2, pln->Pln());
350 len2->SetDimensionAspect (anAspect);
351 context->Display(len2);
352 /***************************************/
353 //dimension "R 88.58"
354 /***************************************/
355 gp_Circ cir = gp_Circ(gp_Ax2(gp_Pnt(191.09, -88.58, 0), gp_Dir(0, 0, 1)), 88.58);
356 TopoDS_Edge E1 = BRepBuilderAPI_MakeEdge(cir,gp_Pnt(191.09,0,0.),gp_Pnt(191.09,-177.16,0.) );
357 Handle(AIS_RadiusDimension) dim1 = new AIS_RadiusDimension(E1);
358 dim1->SetDimensionAspect (anAspect);
359 context->Display(dim1);
360 /***************************************/
361 //dimension "R 43.80"
362 /***************************************/
363 gp_Circ cir1 = gp_Circ(gp_Ax2(gp_Pnt(191.09, -88.58, 0), gp_Dir(0, 0, 1)), 43.80);
364 TopoDS_Edge E_cir1 = BRepBuilderAPI_MakeEdge(cir1);
365 dim1 = new AIS_RadiusDimension(E_cir1);
366 anAspect->ArrowAspect()->SetLength (60.0);
367 dim1->SetDimensionAspect (anAspect);
368 context->Display(dim1);
369 /***************************************/
370 //dimension "R 17.86"
371 /***************************************/
372 gp_Circ cir2 = gp_Circ(gp_Ax2(gp_Pnt(566.11, -88.58, 0), gp_Dir(0, 0, -1)), 17.86);
373 TopoDS_Edge E_cir2 = BRepBuilderAPI_MakeEdge(cir2);
374 dim1 = new AIS_RadiusDimension(E_cir2);
375 anAspect->ArrowAspect()->SetLength (40.0);
376 dim1->SetDimensionAspect (anAspect);
377 context->Display(dim1);
382 static Standard_Integer OCC138 (Draw_Interpretor& di, Standard_Integer /*argc*/, const char ** argv)
384 Handle(AIS_InteractiveContext) aContext = ViewerTest::GetAISContext();
385 if(aContext.IsNull()) {
386 di << "use 'vinit' command before " << argv[0] << "\n";
390 BRepPrimAPI_MakeBox box1(gp_Pnt(0, 0, 0), gp_Pnt(100, 100, 100));
391 BRepPrimAPI_MakeBox box2(gp_Pnt(120, 120, 120), gp_Pnt(300, 300,300));
392 BRepPrimAPI_MakeBox box3(gp_Pnt(320, 320, 320), gp_Pnt(500, 500,500));
394 Handle_AIS_Shape ais1 = new AIS_Shape(box1.Shape());
395 Handle_AIS_Shape ais2 = new AIS_Shape(box2.Shape());
396 Handle_AIS_Shape ais3 = new AIS_Shape(box3.Shape());
398 aContext->Display(ais1);
399 aContext->Display(ais2);
400 aContext->Display(ais3);
402 aContext->AddOrRemoveCurrentObject(ais1);
403 aContext->AddOrRemoveCurrentObject(ais2);
404 aContext->AddOrRemoveCurrentObject(ais3);
406 di << "\n No of currents = " << aContext->NbCurrents();
408 aContext->InitCurrent();
411 while(aContext->MoreCurrent())
413 di << "\n count is = " << count++;
414 Handle_AIS_InteractiveObject ais = aContext->Current();
415 aContext->AddOrRemoveCurrentObject(ais);
416 aContext->InitCurrent();
422 static Standard_Integer BUC60821(Draw_Interpretor& di, Standard_Integer argc,const char ** argv )
426 di << "Usage: " << argv[0] << " TextHight1 TextHight2 TextHight2";
430 Handle(AIS_InteractiveContext) aContext = ViewerTest::GetAISContext();
432 if(aContext.IsNull())
434 di << "use 'vinit' command before " << argv[0] << "\n";
438 Handle(QABugs_MyText) txt1 = new QABugs_MyText("Gosha1",gp_Pnt(0,0,0),Font_NOF_ASCII_SIMPLEX,Quantity_NOC_RED,Draw::Atoi(argv[1]));
439 aContext->Display(txt1);
441 Handle(QABugs_MyText) txt2 = new QABugs_MyText("Gosha2",gp_Pnt(0,0,100),Font_NOF_ASCII_SIMPLEX,Quantity_NOC_YELLOW,Draw::Atoi(argv[2]));
442 aContext->Display(txt2);
444 Handle(QABugs_MyText) txt3 = new QABugs_MyText("Gosha3",gp_Pnt(0,100,100),Font_NOF_ASCII_SIMPLEX,Quantity_NOC_SKYBLUE,Draw::Atoi(argv[3]));
445 aContext->Display(txt3);
450 static int geom_get_2Dpt_from_3Dpt(const gp_Pnt& pnt3d, const gp_Pln& pln, gp_Pnt2d& pnt2d)
453 Handle_Geom_Plane gpln = new Geom_Plane(pln);
454 GeomAdaptor_Surface adsur(gpln);
455 Extrema_ExtPS extps(pnt3d, adsur, 0.001, 0.001);
459 for(index=1; index<= extps.NbExt(); index++ )
461 Extrema_POnSurf pons = extps.Point(index);
463 pons.Parameter(U, V);
464 pnt2d.SetCoord(U, V);
471 static Standard_Integer OCC353 (Draw_Interpretor& di, Standard_Integer , const char ** )
473 gp_Ax2 ax21( gp_Pnt(100,0,0), gp_Dir(0,0,1) );
474 Handle_Geom_Circle h_cir1 = new Geom_Circle( ax21, 25 );
476 gp_Ax2 ax22( gp_Pnt(-100,0,0), gp_Dir(0,0,1) );
477 Handle_Geom_Circle h_cir2 = new Geom_Circle( ax22, 25 );
479 gp_Pln refpln( gp_Pnt(0,0,0), gp_Dir(0,0,1) );
480 Handle_Geom2d_Curve cir2d1 = GeomAPI::To2d(h_cir1, refpln);
481 Handle_Geom2d_Curve cir2d2 = GeomAPI::To2d(h_cir2, refpln);
483 Geom2dAdaptor_Curve adop1(cir2d1);
484 Geom2dAdaptor_Curve adop2(cir2d2);
486 Geom2dGcc_QualifiedCurve qcur1(adop1, GccEnt_enclosing);
487 Geom2dGcc_QualifiedCurve qcur2(adop2, GccEnt_enclosing);
489 Handle_Geom_CartesianPoint h_carpt = new Geom_CartesianPoint(0,175,0);
491 gp_Pnt pt3d = h_carpt->Pnt();
493 geom_get_2Dpt_from_3Dpt(pt3d, refpln, pt2d);
497 DrawTrSurf::Set(st,cir2d1);
499 DrawTrSurf::Set(st,cir2d2);
501 DrawTrSurf::Set(st,pt2d);
503 Handle_Geom2d_CartesianPoint pt = new Geom2d_CartesianPoint(pt2d);
504 Geom2dGcc_Circ2d3Tan sol( qcur1, qcur2, pt, 0.001, 0.0, 0.0);
507 Standard_Character buf[10];
511 res = sol.NbSolutions();
512 for(Standard_Integer i=1;i<=res;i++) {
513 Handle(Geom2d_Circle) aC = new Geom2d_Circle(sol.ThisSolution(i));
514 Sprintf(buf,"Result_%d",i);
516 DrawTrSurf::Set(st,aC);
520 di << "\n Faulty: no solutions found ";
521 //printf("\n Faulty: no solutions found ");
523 //printf("\n Num of solutions are %d ", res );
524 di << "\n Num of solutions are " << res << " ";
529 static Standard_Integer OCC280 (Draw_Interpretor& di, Standard_Integer argc, const char ** argv)
531 Handle(AIS_InteractiveContext) aContext = ViewerTest::GetAISContext();
532 if(aContext.IsNull())
534 di << "use 'vinit' command before " << argv[0] << "\n";
538 di << "ERROR : Usage : " << argv[0] << " hlr=0/1 setsurfecedetail=0/1; set perspecrive view" << "\n";
542 Standard_Integer HLR = Draw::Atoi(argv[1]);
547 TCollection_AsciiString anOldName = ViewerTest::GetCurrentViewName();
548 Handle(V3d_Viewer) aViewer = ViewerTest::GetViewerFromContext();
549 if (Draw::Atoi (argv[2]))
551 aViewer->SetDefaultSurfaceDetail (V3d_TEX_ALL);
553 aViewer->SetDefaultTypeOfView (V3d_PERSPECTIVE);
554 Handle(Aspect_Window) asp = ViewerTest::CurrentView()->Window();
555 Handle(V3d_View) aNewView = aViewer->CreateView();
556 ViewerTest::CurrentView (aNewView);
557 TCollection_AsciiString aNewName=anOldName + "_new";
558 ViewerTest::InitViewName(aNewName,ViewerTest::CurrentView());
559 aNewView->SetWindow (asp);
560 if (!asp->IsMapped()) asp->Map();
562 ViewerTest::RemoveView(anOldName,false);
563 ViewerTest::UnsetEventManager();
564 ViewerTest::SetEventManager (new ViewerTest_EventManager (aNewView, ViewerTest::GetAISContext()));
569 ViewerTest::CurrentView()->SetComputedMode (Standard_True);
575 static Standard_Integer OCC232 (Draw_Interpretor& di, Standard_Integer /*argc*/, const char ** argv)
577 Handle(AIS_InteractiveContext) aContext = ViewerTest::GetAISContext();
578 if(aContext.IsNull()) {
579 di << "use 'vinit' command before " << argv[0] << "\n";
583 BRep_Builder builder;
584 TopoDS_Compound comp;
585 TopoDS_CompSolid cs1, cs2;
587 builder.MakeCompound(comp);
588 builder.MakeCompSolid(cs1);
589 builder.MakeCompSolid(cs2);
591 TopoDS_Shape sh1 = BRepPrimAPI_MakeBox(gp_Pnt(0, 0, 0), 100, 100, 100).Shape();
592 TopoDS_Shape sh2 = BRepPrimAPI_MakeBox(gp_Pnt(100, 0, 0), 100, 100, 100).Shape();
593 TopoDS_Shape sh3 = BRepPrimAPI_MakeBox(gp_Pnt(200, 0, 0), 100, 100, 100).Shape();
594 builder.Add(cs1, sh1);
595 builder.Add(cs1, sh2);
596 builder.Add(cs1, sh3);
598 TopoDS_Shape sh4 = BRepPrimAPI_MakeBox(gp_Pnt(0, 500, 0), 100, 100, 100).Shape();
599 TopoDS_Shape sh5 = BRepPrimAPI_MakeBox(gp_Pnt(100, 500, 0), 100, 100, 100).Shape();
600 TopoDS_Shape sh6 = BRepPrimAPI_MakeBox(gp_Pnt(200, 500, 0), 100, 100, 100).Shape();
602 builder.Add(cs2, sh4);
603 builder.Add(cs2, sh5);
604 builder.Add(cs2, sh6);
606 builder.Add(comp, cs1);
607 builder.Add(comp, cs2);
609 Handle_AIS_Shape ais = new AIS_Shape(comp);
610 aContext->Display(ais);
612 TopExp_Explorer exp(comp, TopAbs_COMPSOLID);
615 //printf("\n TopAbs_COMPSOLID is there \n");
616 di << "\n TopAbs_COMPSOLID is there \n";
620 Handle (StdSelect_ShapeTypeFilter) filt = new StdSelect_ShapeTypeFilter(TopAbs_COMPSOLID);
621 aContext->AddFilter(filt);
622 aContext->CloseAllContexts();
623 aContext->OpenLocalContext();
624 aContext->ActivateStandardMode(TopAbs_SOLID);
629 static Standard_Integer OCC138LC (Draw_Interpretor& di, Standard_Integer /*argc*/, const char ** argv)
631 Handle(AIS_InteractiveContext) aContext = ViewerTest::GetAISContext();
632 if(aContext.IsNull()) {
633 di << "use 'vinit' command before " << argv[0] << "\n";
637 BRepPrimAPI_MakeBox box1(gp_Pnt(0, 0, 0), gp_Pnt(100, 100, 100));
638 BRepPrimAPI_MakeBox box2(gp_Pnt(120, 120, 120), gp_Pnt(300, 300,300));
639 BRepPrimAPI_MakeBox box3(gp_Pnt(320, 320, 320), gp_Pnt(500, 500,500));
641 Handle_AIS_Shape ais1 = new AIS_Shape(box1.Shape());
642 Handle_AIS_Shape ais2 = new AIS_Shape(box2.Shape());
643 Handle_AIS_Shape ais3 = new AIS_Shape(box3.Shape());
645 aContext->Display(ais1);
646 aContext->Display(ais2);
647 aContext->Display(ais3);
649 aContext->AddOrRemoveSelected(ais1);
650 aContext->AddOrRemoveSelected(ais2);
651 aContext->AddOrRemoveSelected(ais3);
653 di << "\n No of selected = " << aContext->NbSelected();
655 aContext->InitSelected();
658 while(aContext->MoreSelected())
660 di << "\n count is = %d" << count++;
661 Handle_AIS_InteractiveObject ais = aContext->SelectedInteractive();
662 aContext->AddOrRemoveSelected(ais);
663 aContext->InitSelected();
669 static Standard_Integer OCC189 (Draw_Interpretor& di, Standard_Integer /*argc*/, const char ** argv)
671 Handle(AIS_InteractiveContext) aContext1 = ViewerTest::GetAISContext();
672 if(aContext1.IsNull()) {
673 di << "use 'vinit' command before " << argv[0] << "\n";
676 Handle(AIS_InteractiveContext) aContext2 = ViewerTest::GetAISContext();
677 if(aContext2.IsNull()) {
678 di << "use 'vinit' command before " << argv[0] << "\n";
682 BRepPrimAPI_MakeBox box1(gp_Pnt(0, 0, 0), gp_Pnt(100, 100, 100));
683 BRepPrimAPI_MakeBox box2(gp_Pnt(120, 120, 120), gp_Pnt(300, 300, 300));
684 BRepPrimAPI_MakeBox box3(gp_Pnt(320, 320, 320), gp_Pnt(500, 500, 500));
686 Handle_AIS_Shape ais1 = new AIS_Shape(box1.Shape());
687 Handle_AIS_Shape ais2 = new AIS_Shape(box2.Shape());
688 Handle_AIS_Shape ais3 = new AIS_Shape(box3.Shape());
690 aContext1->Display(ais1);
691 aContext1->Display(ais2);
692 aContext1->Display(ais3);
694 aContext2->Display(ais1);
695 aContext2->Display(ais2);
696 aContext2->Display(ais3);
698 aContext1->AddOrRemoveCurrentObject(ais1);
699 aContext1->AddOrRemoveCurrentObject(ais2);
700 aContext1->AddOrRemoveCurrentObject(ais3);
702 di << "\n Stage : 1";
703 di << "\n \t No of currents on aContext1 = " << aContext1->NbCurrents();
704 di << "\n \t No of currents on aContext2 = " << aContext2->NbCurrents() << "\n\n";
706 di << "\n aContext1->IsCurrent = " << (Standard_Integer) aContext1->IsCurrent(ais1) << ", aContext2->IsCurrent = " << (Standard_Integer) aContext2->IsCurrent(ais1) << " ";
708 aContext2->AddOrRemoveCurrentObject(ais1);
709 aContext2->AddOrRemoveCurrentObject(ais2);
710 aContext2->AddOrRemoveCurrentObject(ais3);
712 di << "\n Stage : 2";
713 di << "\n \t No of currents on aContext1 = " << aContext1->NbCurrents();
714 di << "\n \t No of currents on aContext2 = " << aContext2->NbCurrents() << "\n\n";
716 aContext1->InitCurrent();
718 while(aContext1->MoreCurrent())
720 di << "\n count1 is = " << count1++;
721 Handle_AIS_InteractiveObject ais = aContext1->Current();
722 aContext1->AddOrRemoveCurrentObject(ais);
723 aContext1->InitCurrent();
726 di << "\n Stage : 3";
727 di << "\n \t No of currents on aContext1 = " << aContext1->NbCurrents();
728 di << "\n \t No of currents on aContext2 = " << aContext2->NbCurrents() << "\n\n";
730 aContext2->InitCurrent();
732 while(aContext2->MoreCurrent())
734 di << "\n count2 is = " << count2++;
735 Handle_AIS_InteractiveObject ais = aContext2->Current();
736 aContext2->AddOrRemoveCurrentObject(ais);
737 aContext2->InitCurrent();
740 di << "\n\n Stage : 4";
741 di << "\n \t No of currents on aContext1 = " << aContext1->NbCurrents();
742 di << "\n \t No of currents on aContext2 = " << aContext2->NbCurrents();
747 #include <BRepBndLib.hxx>
749 //=======================================================================
752 //=======================================================================
753 static Standard_Integer OCC566(Draw_Interpretor& di,Standard_Integer n,const char ** a)
756 di<<"Usage: " << a[0] << " shape [ xmin ymin zmin xmax ymax zmax]"<<"\n";
759 TopoDS_Shape S = DBRep::Get(a[1]);
760 if (S.IsNull()) return 1;
762 BRepBndLib::AddClose(S,B);
763 Standard_Real axmin,aymin,azmin,axmax,aymax,azmax;
764 B.Get(axmin,aymin,azmin,axmax,aymax,azmax);
765 di << axmin<<" "<< aymin<<" "<< azmin<<" "<< axmax<<" "<< aymax<<" "<< azmax;
767 Draw::Set(a[2],axmin) ;
768 Draw::Set(a[3],aymin) ;
769 Draw::Set(a[4],azmin) ;
770 Draw::Set(a[5],axmax) ;
771 Draw::Set(a[6],aymax) ;
772 Draw::Set(a[7],azmax) ;
777 #include <BRepFilletAPI_MakeFillet.hxx>
778 //=======================================================================
781 //=======================================================================
782 static Standard_Integer OCC570 (Draw_Interpretor& di, Standard_Integer argc,const char ** argv)
785 di<<"Usage: " << argv[0] << " result"<<"\n";
789 BRepPrimAPI_MakeBox mkBox(100.,100.,100.);
790 TopoDS_Shape aBox = mkBox.Shape();
792 TopExp_Explorer aExp;
793 aExp.Init(aBox,TopAbs_WIRE);
796 TopoDS_Shape aWire = aExp.Current();
798 aExp.Init(aWire,TopAbs_EDGE);
799 TopoDS_Edge e1 = TopoDS::Edge(aExp.Current()); aExp.Next();
800 TopoDS_Edge e2 = TopoDS::Edge(aExp.Current()); aExp.Next();
801 TopoDS_Edge e3 = TopoDS::Edge(aExp.Current()); aExp.Next();
802 TopoDS_Edge e4 = TopoDS::Edge(aExp.Current());
807 BRepFilletAPI_MakeFillet mkFillet(aBox);
808 mkFillet.SetContinuity(GeomAbs_C1,.001);
810 // Setup variable fillet data
811 TColgp_Array1OfPnt2d t_pnt(1,4);
812 t_pnt.SetValue(1,gp_Pnt2d(0.0,5.0));
813 t_pnt.SetValue(2,gp_Pnt2d(0.3,15.0));
814 t_pnt.SetValue(3,gp_Pnt2d(0.7,15.0));
815 t_pnt.SetValue(4,gp_Pnt2d(1.0,5.0));
818 // It is impossible to build fillet if at least one edge
819 // with variable radius is added!!! If all are constant, everything is ok.
820 mkFillet.Add(t_pnt,e1);
821 mkFillet.Add(5.0,e2);
822 mkFillet.Add(t_pnt,e3);
823 mkFillet.Add(5.0,e4);
826 TopoDS_Shape aFinalShape = mkFillet.Shape();
828 DBRep::Set(argv[1],aFinalShape);
830 catch(Standard_Failure)
832 di << argv[0] << ": Exception in fillet"<<"\n";
840 #include <Law_Interpol.hxx>
842 static Standard_Real t3d = 1.e-4;
843 static Standard_Real t2d = 1.e-5;
844 static Standard_Real ta = 1.e-2;
845 static Standard_Real fl = 1.e-3;
846 static Standard_Real tapp_angle = 1.e-2;
847 static GeomAbs_Shape blend_cont = GeomAbs_C1;
849 static BRepFilletAPI_MakeFillet* Rake = 0;
850 static char name[100];
852 static void printtolblend(Draw_Interpretor& di)
854 di<<"tolerance ang : "<<ta<<"\n";
855 di<<"tolerance 3d : "<<t3d<<"\n";
856 di<<"tolerance 2d : "<<t2d<<"\n";
857 di<<"fleche : "<<fl<<"\n";
859 di<<"tolblend "<<ta<<" "<<t3d<<" "<<t2d<<" "<<fl<<"\n";
862 static Standard_Integer MKEVOL(Draw_Interpretor& di,
863 Standard_Integer narg,
866 if(Rake != 0) {delete Rake; Rake = 0;}
868 if (narg < 3) return 1;
869 TopoDS_Shape V = DBRep::Get(a[2]);
870 Rake = new BRepFilletAPI_MakeFillet(V);
871 Rake->SetParams(ta,t3d,t2d,t3d,t2d,fl);
872 Rake->SetContinuity(blend_cont, tapp_angle);
874 ChFi3d_FilletShape FSh = ChFi3d_Rational;
875 if (!strcasecmp(a[3], "Q")) {
876 FSh = ChFi3d_QuasiAngular;
878 else if (!strcasecmp(a[3], "P")) {
879 FSh = ChFi3d_Polynomial;
881 Rake->SetFilletShape(FSh);
887 static Standard_Integer UPDATEVOL(Draw_Interpretor& di,
888 Standard_Integer narg,
892 di << "MakeFillet non initialise"<<"\n";
895 if(narg%2 != 0 || narg < 4) return 1;
896 TColgp_Array1OfPnt2d uandr(1,(narg/2)-1);
897 Standard_Real Rad, Par;
898 TopoDS_Shape aLocalEdge(DBRep::Get(a[1],TopAbs_EDGE));
899 TopoDS_Edge E = TopoDS::Edge(aLocalEdge);
900 for (Standard_Integer ii = 1; ii <= (narg/2)-1; ii++){
901 Par = Draw::Atof(a[2*ii]);
902 Rad = Draw::Atof(a[2*ii + 1]);
903 uandr.ChangeValue(ii).SetCoord(Par,Rad);
905 //HELPDESK: Add law creation
906 const Standard_Boolean aLawMode = !strcmp(a[0],"OCC570evollaw");
909 di<<"INFO: Using law to define variable fillet"<<"\n";
910 Handle(Law_Interpol) law = new Law_Interpol;
920 static Standard_Integer BUILDEVOL(Draw_Interpretor& di,
925 di << "MakeFillet non initialise"<<"\n";
930 TopoDS_Shape result = Rake->Shape();
931 DBRep::Set(name,result);
932 if(Rake != 0) {delete Rake; Rake = 0;}
935 if(Rake != 0) {delete Rake; Rake = 0;}
939 #include <TColGeom_SequenceOfCurve.hxx>
940 #include <Geom_TrimmedCurve.hxx>
941 #include <GeomFill_NSections.hxx>
942 #include <BRepBuilderAPI_MakeFace.hxx>
943 //=======================================================================
946 //=======================================================================
947 static Standard_Integer OCC606 ( Draw_Interpretor& di, Standard_Integer n, const char ** a )
949 if (n != 3 && n != 4)
951 di << "Usage : " << a[0] << " result shape [-t]" << "\n";
955 Standard_Boolean TrimMode = (n == 4);
956 if (TrimMode) di<<"INFO: Using trimmed curves..."<<"\n";
957 else di<<"INFO: Using non trimmed curves..."<<"\n";
959 TopoDS_Shape S = DBRep::Get(a[2]);
961 TopExp_Explorer t_exp(S,TopAbs_EDGE);
962 TColGeom_SequenceOfCurve n_curves1;
963 TColStd_SequenceOfReal np;
964 Standard_Real param = 5.0;
966 for (;t_exp.More();t_exp.Next())
969 Handle(Geom_Curve) h_cur = BRep_Tool::Curve(TopoDS::Edge(t_exp.Current()),f,l);
972 if (TrimMode) h_cur = new Geom_TrimmedCurve(h_cur,f,l);
974 n_curves1.Append(h_cur);
980 if (n_curves1.Length()>1 && !np.IsEmpty())
985 GeomFill_NSections b_surface1(n_curves1, np);
986 b_surface1.ComputeSurface();
987 Handle(Geom_BSplineSurface) result_surf1 = b_surface1.BSplineSurface();
988 if (!result_surf1.IsNull())
990 BRepBuilderAPI_MakeFace b_face1(result_surf1, Precision::Confusion());
991 TopoDS_Face bsp_face1 = b_face1.Face();
992 DBRep::Set(a[1],bsp_face1);
995 catch(Standard_Failure)
997 di<<"ERROR: Exception in GeomFill_NSections"<<"\n";
1005 //=======================================================================
1008 //=======================================================================
1009 static Standard_Integer OCC813 (Draw_Interpretor& di, Standard_Integer argc,const char ** argv)
1013 di << "Usage : " << argv[0] << " U V" << "\n";
1017 Standard_CString str;
1018 Standard_Real U = Draw::Atof(argv[1]);
1019 Standard_Real V = Draw::Atof(argv[2]);
1021 //Between ellipse and point:
1023 Handle(Geom_Ellipse) ell = new Geom_Ellipse(gp_Ax2(gp_Pnt(1262.224429,425.040878,363.609716),
1024 gp_Dir(0.173648,0.984808,0.000000),
1025 gp_Dir(-0.932169,0.164367,-0.322560)), 150, 100);
1026 Handle(Geom_Plane) plne = new Geom_Plane(gp_Ax3(gp_Ax2(gp_Pnt(1262.224429,425.040878,363.609716),
1027 gp_Dir(0.173648,0.984808,0.000000),
1028 gp_Dir(-0.932169,0.164367,-0.322560))) );
1030 Handle(AIS_InteractiveContext) aContext = ViewerTest::GetAISContext();
1033 gp_Pln pln = plne->Pln();
1035 str = "OCC813_pnt"; DrawTrSurf::Set(str,pt2d);
1037 Handle(Geom2d_Curve) curve2d = GeomAPI::To2d(ell,pln);
1038 Geom2dAdaptor_Curve acur(curve2d);
1039 Geom2dGcc_QualifiedCurve qcur(acur, GccEnt_outside);
1041 str = "OCC813_ell"; DrawTrSurf::Set(str,curve2d);
1042 if(!aContext.IsNull()) {
1043 Handle(AIS_Shape) aisp =
1044 new AIS_Shape (BRepBuilderAPI_MakeEdge(GeomAPI::To3d(curve2d, pln)).Edge());
1045 aContext->Display (aisp);
1048 //This does not give any solutions.
1049 Geom2dGcc_Lin2d2Tan lintan(qcur, pt2d, 0.1);
1050 di<<"OCC813 nb of solutions = "<<lintan.NbSolutions()<<"\n";
1052 Standard_Character abuf[16];
1053 Standard_CString st = abuf;
1056 for(i=1;i<=lintan.NbSolutions();i++) {
1057 Sprintf(abuf,"lintan_%d",i);
1058 Handle(Geom2d_Line) glin = new Geom2d_Line(lintan.ThisSolution(i));
1059 DrawTrSurf::Set(st,glin);
1060 if(!aContext.IsNull()) {
1061 Handle(AIS_Shape) aisp =
1062 new AIS_Shape (BRepBuilderAPI_MakeEdge(GeomAPI::To3d(glin, pln)).Edge()); aContext->Display (aisp);
1069 //=======================================================================
1072 //=======================================================================
1073 static Standard_Integer OCC814 (Draw_Interpretor& di, Standard_Integer argc,const char ** argv)
1077 di << "Usage : " << argv[0] << "\n";
1081 Standard_CString str;
1083 //Between Ellipse and Circle:
1085 Handle(Geom_Circle) cir = new Geom_Circle(gp_Ax2(gp_Pnt(823.687192,502.366825,478.960440),
1086 gp_Dir(0.173648,0.984808,0.000000),
1087 gp_Dir(-0.932169,0.164367,-0.322560)), 50);
1088 Handle(Geom_Ellipse) ell = new Geom_Ellipse(gp_Ax2(gp_Pnt(1262.224429,425.040878,363.609716),
1089 gp_Dir(0.173648,0.984808,0.000000),
1090 gp_Dir(-0.932169,0.164367,-0.322560)), 150, 100);
1091 Handle(Geom_Plane) plne = new Geom_Plane(gp_Ax3(gp_Ax2(gp_Pnt(1262.224429,425.040878,363.609716),
1092 gp_Dir(0.173648,0.984808,0.000000),
1093 gp_Dir(-0.932169,0.164367,-0.322560))) );
1095 Handle(AIS_InteractiveContext) aContext = ViewerTest::GetAISContext();
1097 gp_Pln pln = plne->Pln();
1098 Handle(Geom2d_Curve) curve2d = GeomAPI::To2d(ell, pln);
1099 Handle(Geom2d_Curve) fromcurve2d = GeomAPI::To2d(cir, pln);
1101 str = "OCC814_cir"; DrawTrSurf::Set(str,curve2d);
1102 str = "OCC814_ell"; DrawTrSurf::Set(str,fromcurve2d);
1103 if(!aContext.IsNull()) {
1104 Handle(AIS_Shape) aisp =
1105 new AIS_Shape (BRepBuilderAPI_MakeEdge(GeomAPI::To3d(curve2d, pln)).Edge());
1106 aContext->Display (aisp);
1108 if(!aContext.IsNull()) {
1109 Handle(AIS_Shape) aisp =
1110 new AIS_Shape (BRepBuilderAPI_MakeEdge(GeomAPI::To3d(fromcurve2d, pln)).Edge());
1111 aContext->Display (aisp);
1114 Geom2dAdaptor_Curve acur(curve2d), afromcur(fromcurve2d);
1116 Geom2dGcc_QualifiedCurve qcur(acur, GccEnt_outside) ;
1117 Geom2dGcc_QualifiedCurve qfromcur(afromcur, GccEnt_outside) ;
1119 //This does not give any solutions.
1120 Geom2dGcc_Lin2d2Tan lintan(qcur, qfromcur, 0.1);
1121 di<<"OCC814 nb of solutions = "<<lintan.NbSolutions()<<"\n";
1123 Standard_Character abuf[16];
1124 Standard_CString st = abuf;
1127 for(i=1;i<=lintan.NbSolutions();i++) {
1128 Sprintf(abuf,"lintan_%d",i);
1129 Handle(Geom2d_Line) glin = new Geom2d_Line(lintan.ThisSolution(i));
1130 DrawTrSurf::Set(st,glin);
1131 if(!aContext.IsNull()) {
1132 Handle(AIS_Shape) aisp =
1133 new AIS_Shape (BRepBuilderAPI_MakeEdge(GeomAPI::To3d(glin, pln)).Edge()); aContext->Display (aisp);
1140 #include <ShapeAnalysis_Wire.hxx>
1141 #include <IntRes2d_SequenceOfIntersectionPoint.hxx>
1142 #include <TColgp_SequenceOfPnt.hxx>
1143 #include <ShapeFix_Wire.hxx>
1144 //=======================================================================
1147 //=======================================================================
1148 static Standard_Integer OCC884 (Draw_Interpretor& di, Standard_Integer argc, const char ** argv)
1150 if (argc < 3 || argc > 5)
1152 di << "Usage : " << argv[0] << " result shape [toler [maxtoler]]" << "\n";
1156 TopoDS_Shape shape = DBRep::Get(argv[2]); //read the shape
1158 TopExp_Explorer exp(shape, TopAbs_EDGE);
1161 di<<"Error: no edge found"<<"\n";
1165 BRep_Builder builder;
1167 builder.MakeWire(wire);
1168 builder.Add(wire, TopoDS::Edge(exp.Current()));
1170 // HelpDesk: Create planar face if possible
1171 TopoDS_Face face = BRepBuilderAPI_MakeFace(wire,Standard_True);
1173 Handle(ShapeAnalysis_Wire) advWA = new ShapeAnalysis_Wire;
1175 advWA->SetFace(face);
1176 advWA->SetPrecision(0.001);
1178 IntRes2d_SequenceOfIntersectionPoint points2d;
1179 TColgp_SequenceOfPnt points3d;
1181 di << "Info: CheckSelfIntersectingEdge = " << (Standard_Integer) advWA->CheckSelfIntersectingEdge(1,points2d,points3d) << "\n";
1183 ShapeExtend_Status status = ShapeExtend_FAIL1;
1184 if (advWA->StatusSelfIntersection(status))
1185 di << "Info: No P Curve found in the edge\n";
1187 status = ShapeExtend_FAIL2;
1188 if (advWA->StatusSelfIntersection(status))
1189 di << "Info: No Vertices found in the edge\n";
1191 status = ShapeExtend_DONE1;
1192 if (advWA->StatusSelfIntersection(status))
1193 di << "Info: Self-intersection found in the edge\n";
1195 Standard_Integer i, num = points2d.Length();
1196 di << "Info: No. of self-intersection points : " << num << "\n";
1199 Standard_CString aName = str;
1200 for (i = 1; i <= num; ++i)
1202 gp_Pnt pt = points3d(i);
1203 di << "Info: Intersecting pt : (" << pt.X() << ", " << pt.Y() << ", " << pt.Z() << ")\n";
1204 Sprintf(str,"p_%d",i);
1205 DrawTrSurf::Set(aName,pt);
1208 Handle(ShapeFix_Wire) sfw = new ShapeFix_Wire;
1212 if (argc > 3) sfw->SetPrecision(Draw::Atof(argv[3])/*0.1*/);
1213 if (argc > 4) sfw->SetMaxTolerance(Draw::Atof(argv[4]));
1214 di << "Info: Precision is set to " << sfw->Precision() << "\n";
1215 di << "Info: MaxTolerance is set to " << sfw->MaxTolerance() << "\n";
1217 sfw->ModifyTopologyMode() = 1;
1218 sfw->ModifyGeometryMode() = 1;
1219 sfw->FixSelfIntersectingEdgeMode() = 1;
1220 //printf("Info: FixSelfIntersection = %d\n",sfw->FixSelfIntersection());
1221 di << "Info: FixSelfIntersection = " << (Standard_Integer) sfw->FixSelfIntersection() << "\n";
1223 DBRep::Set(argv[1],sfw->Wire());
1225 status = ShapeExtend_OK;
1226 if (sfw->StatusSelfIntersection(status))
1227 di << "Info: ShapeExtend_OK : No intersection found\n";
1228 //printf("Info: ShapeExtend_OK : No intersection found\n");
1230 status = ShapeExtend_FAIL1;
1231 if (sfw->StatusSelfIntersection(status))
1232 di << "Info: ShapeExtend_FAIL1 : analysis failed (edge has no pcurve, or no vertices etc.)\n";
1234 status = ShapeExtend_FAIL2;
1235 if (sfw->StatusSelfIntersection(status))
1236 di << "Info: ShapeExtend_FAIL2 : self-intersection was found, but not fixed because of limit of increasing tolerance (MaxTolerance)\n";
1238 status = ShapeExtend_FAIL3;
1239 if (sfw->StatusSelfIntersection(status))
1240 di << "Info: ShapeExtend_FAIL3 : intercestion of non adjacent edges found, but not fixed because of limit of increasing tolerance (MaxTolerance)\n";
1242 status = ShapeExtend_DONE1;
1243 if (sfw->StatusSelfIntersection(status))
1244 di << "Info: ShapeExtend_DONE1 : tolerance of vertex was increased to fix self-intersection\n";
1246 status = ShapeExtend_DONE2;
1247 if (sfw->StatusSelfIntersection(status))
1248 di << "Info: ShapeExtend_DONE2 : vertex was moved to fix self-intersection\n";
1250 status = ShapeExtend_DONE3;
1251 if (sfw->StatusSelfIntersection(status))
1252 di << "Info: ShapeExtend_DONE3 : some edges were removed because of intersection\n";
1254 status = ShapeExtend_DONE4;
1255 if (sfw->StatusSelfIntersection(status))
1256 di << "Info: ShapeExtend_DONE4 : pcurve(s) was(were) modified\n";
1258 status = ShapeExtend_DONE5;
1259 if (sfw->StatusSelfIntersection(status))
1260 di << "Info: ShapeExtend_DONE5 : non adjacent intersection fixed by increasing tolerance of vertex(vertices)\n";
1262 status = ShapeExtend_DONE6;
1263 if (sfw->StatusSelfIntersection(status))
1264 di << "Info: ShapeExtend_DONE6 : tolerance of edge was increased to hide intersection\n";
1266 status = ShapeExtend_DONE7;
1267 if (sfw->StatusSelfIntersection(status))
1268 di << "Info: ShapeExtend_DONE7 : range of some edges was decreased to avoid intersection\n";
1273 #include <Aspect_FillMethod.hxx>
1274 //=======================================================================
1275 //function : OCC1188
1277 //=======================================================================
1278 static Standard_Integer OCC1188 (Draw_Interpretor& di, Standard_Integer argc, const char ** argv)
1280 if (argc < 2 || argc > 3)
1282 di << "Usage : " << argv[0] << " imagefile [filltype] : Load image as background" << "\n";
1286 Handle(AIS_InteractiveContext) AISContext = ViewerTest::GetAISContext();
1287 if(AISContext.IsNull())
1289 di << "use 'vinit' command before " << argv[0] << "\n";
1293 Aspect_FillMethod aFillType = Aspect_FM_CENTERED;
1296 const char* szType = argv[2];
1297 if (strcmp(szType, "NONE" ) == 0) aFillType = Aspect_FM_NONE;
1298 else if (strcmp(szType, "CENTERED") == 0) aFillType = Aspect_FM_CENTERED;
1299 else if (strcmp(szType, "TILED" ) == 0) aFillType = Aspect_FM_TILED;
1300 else if (strcmp(szType, "STRETCH" ) == 0) aFillType = Aspect_FM_STRETCH;
1303 di << "Wrong fill type : " << szType << "\n";
1304 di << "Must be one of CENTERED, TILED, STRETCH, NONE" << "\n";
1309 Handle(V3d_View) V3dView = ViewerTest::CurrentView();
1310 V3dView->SetBackgroundImage(argv[1], aFillType, Standard_True);
1315 #include <AIS_Drawer.hxx>
1316 #include <Graphic3d_MaterialAspect.hxx>
1317 #include <Prs3d_ShadingAspect.hxx>
1318 //=======================================================================
1319 //function : OCC1174_1
1321 //=======================================================================
1322 static Standard_Integer OCC1174_1 (Draw_Interpretor& di, Standard_Integer argc, const char ** argv)
1326 di << "Usage : " << argv[0] << " shape" << "\n";
1330 Handle(AIS_InteractiveContext) AISContext = ViewerTest::GetAISContext();
1331 if(AISContext.IsNull())
1333 di << "use 'vinit' command before " << argv[0] << "\n";
1337 TopoDS_Shape sh = DBRep::Get(argv[1]);
1339 Handle(AIS_Shape) ais = new AIS_Shape(sh);
1341 Quantity_Color colf(0.0, 0.4, 0.0, Quantity_TOC_RGB);
1342 Quantity_Color colb(0.0, 0.0, 0.6, Quantity_TOC_RGB);
1344 Handle(Prs3d_ShadingAspect) sa = ais->Attributes()->ShadingAspect();
1346 Graphic3d_MaterialAspect front = sa->Material(Aspect_TOFM_FRONT_SIDE);
1347 front.SetAmbientColor(colf);
1348 front.SetDiffuseColor(colf);
1349 front.SetSpecularColor(colf);
1350 front.SetEmissiveColor(colf);
1351 front.SetTransparency(0.0);
1352 sa->SetMaterial(front,Aspect_TOFM_FRONT_SIDE);
1354 Graphic3d_MaterialAspect back = sa->Material(Aspect_TOFM_BACK_SIDE);
1355 back.SetAmbientColor(colb);
1356 back.SetDiffuseColor(colb);
1357 back.SetSpecularColor(colb);
1358 back.SetEmissiveColor(colb);
1359 back.SetTransparency(0.0);
1360 sa->SetMaterial(back,Aspect_TOFM_BACK_SIDE);
1362 AISContext->Display(ais,1,0);
1364 Standard_Real r, g, b;
1365 sa->Color(Aspect_TOFM_FRONT_SIDE).Values(r,g,b, Quantity_TOC_RGB);
1366 di << "Info: color on front side (" << r << "," << g << "," << b << ")\n";
1367 sa->Color(Aspect_TOFM_BACK_SIDE).Values(r,g,b, Quantity_TOC_RGB);
1368 di << "Info: color on back side (" << r << "," << g << "," << b << ")\n";
1373 //=======================================================================
1374 //function : OCC1174_2
1376 //=======================================================================
1377 static Standard_Integer OCC1174_2 (Draw_Interpretor& di, Standard_Integer argc, const char ** argv)
1381 di << "Usage : " << argv[0] << " shape" << "\n";
1385 Handle(AIS_InteractiveContext) AISContext = ViewerTest::GetAISContext();
1386 if(AISContext.IsNull())
1388 di << "use 'vinit' command before " << argv[0] << "\n";
1392 TopoDS_Shape sh = DBRep::Get(argv[1]);
1394 Handle(AIS_Shape) ais = new AIS_Shape(sh);
1395 AISContext->Display(ais,1,0);
1396 AISContext->SetMaterial(ais,Graphic3d_NOM_SHINY_PLASTIC);
1398 Quantity_Color colf(0.0, 0.4, 0.0, Quantity_TOC_RGB);
1399 Quantity_Color colb(0.0, 0.0, 0.6, Quantity_TOC_RGB);
1400 Handle(Prs3d_ShadingAspect) sa = ais->Attributes()->ShadingAspect();
1402 Graphic3d_MaterialAspect front = sa->Material(Aspect_TOFM_FRONT_SIDE);
1403 front.SetAmbientColor(colf);
1404 front.SetDiffuseColor(colf);
1405 front.SetSpecularColor(colf);
1406 front.SetEmissiveColor(colf);
1407 front.SetTransparency(0.4);
1408 sa->SetMaterial(front,Aspect_TOFM_FRONT_SIDE);
1410 Graphic3d_MaterialAspect back = sa->Material(Aspect_TOFM_BACK_SIDE);
1411 back.SetAmbientColor(colb);
1412 back.SetDiffuseColor(colb);
1413 back.SetSpecularColor(colb);
1414 back.SetEmissiveColor(colb);
1415 back.SetTransparency(0.2);
1416 sa->SetMaterial(back,Aspect_TOFM_BACK_SIDE);
1418 AISContext->Redisplay(ais,1,0);
1423 #include <TopoDS_Solid.hxx>
1424 #include <BRepFeat_MakeDPrism.hxx>
1425 //=======================================================================
1427 //purpose : FEATURE OPERATION (BOSS and SLOT)
1428 //=======================================================================
1429 static Standard_Integer OCCN1 (Draw_Interpretor& di, Standard_Integer argc, const char ** argv)
1433 di << "Usage : " << argv[0] << " angle fuse(1 for boss / 0 for slot) length" << "\n";
1437 Handle(AIS_InteractiveContext) aContext = ViewerTest::GetAISContext();
1438 if(aContext.IsNull())
1440 di << "use 'vinit' command before " << argv[0] << "\n";
1443 Standard_Real angle = Draw::Atof(argv[1]);
1444 Standard_Integer fuse = Draw::Atoi(argv[2]);
1445 Standard_Real length = Draw::Atof(argv[3]);
1447 BRepBuilderAPI_MakeEdge edge1(gp_Pnt(0, 0, 0), gp_Pnt(50, 0, 0));
1448 BRepBuilderAPI_MakeEdge edge2(gp_Pnt(50, 0, 0), gp_Pnt(50, 50, 0));
1449 BRepBuilderAPI_MakeEdge edge3(gp_Pnt(50, 50, 0), gp_Pnt(0, 50, 0));
1450 BRepBuilderAPI_MakeEdge edge4(gp_Pnt(0, 50, 0), gp_Pnt(0, 0, 0));
1451 TopoDS_Edge ted1 = edge1.Edge();
1452 TopoDS_Edge ted2 = edge2.Edge();
1453 TopoDS_Edge ted3 = edge3.Edge();
1454 TopoDS_Edge ted4 = edge4.Edge();
1456 BRepBuilderAPI_MakeWire wire(ted1, ted2, ted3, ted4);
1457 TopoDS_Wire twire = wire.Wire();
1459 BRepBuilderAPI_MakeFace face(twire);
1460 TopoDS_Face tface = face.Face();
1461 ////////Handle_AIS_Shape face_ais = new AIS_Shape( tface );
1462 ////////aContext->Display(face_ais);
1465 BRepPrimAPI_MakeBox block(gp_Pnt(-50, -50, -150), 150, 150, 100);
1466 box = block.Solid();
1468 TopoDS_Face top_face;
1469 top_face = block.TopFace();
1471 BRepFeat_MakeDPrism slot(box, tface, top_face, angle, fuse,
1474 slot.Perform(length);
1475 TopoDS_Shape S2 = slot.Shape();
1477 DBRep::Set("OCCN1_tface",tface);
1478 DBRep::Set("OCCN1_slot",S2);
1483 #include <BRepPrimAPI_MakeCylinder.hxx>
1484 #include <BRepPrimAPI_MakeSphere.hxx>
1485 #include <BRepAlgoAPI_Section.hxx>
1486 #include <BRepAlgo_Section.hxx>
1487 //=======================================================================
1489 //purpose : BOOLEAN OPERATION
1490 //=======================================================================
1491 static Standard_Integer OCCN2 (Draw_Interpretor& di, Standard_Integer argc, const char ** argv)
1494 di << "Usage : " << argv[0] << " [BRepAlgoAPI/BRepAlgo = 1/0]" << "\n";
1497 Standard_Boolean IsBRepAlgoAPI = Standard_True;
1499 Standard_Integer IsB = Draw::Atoi(argv[1]);
1501 IsBRepAlgoAPI = Standard_False;
1502 #if ! defined(BRepAlgo_def04)
1507 Handle(AIS_InteractiveContext) aContext = ViewerTest::GetAISContext();
1508 if(aContext.IsNull())
1510 di << "use 'vinit' command before " << argv[0] << "\n";
1514 BRepPrimAPI_MakeCylinder cylinder(50,200);
1515 TopoDS_Shape cylinder_sh = cylinder.Shape();
1517 BRepPrimAPI_MakeSphere sphere(gp_Pnt(60,0,100),50);
1518 TopoDS_Shape sphere_sh = sphere.Shape();
1520 //BRepAlgoAPI_Section section(cylinder_sh, sphere_sh);
1521 //TopoDS_Shape shape = section.Shape();
1524 if (IsBRepAlgoAPI) {
1525 di << "BRepAlgoAPI_Section section(cylinder_sh, sphere_sh)" <<"\n";
1526 BRepAlgoAPI_Section section(cylinder_sh, sphere_sh);
1528 if(!section.IsDone()){
1529 di << "Error performing intersection: not done." << "\n";
1531 shape = section.Shape();
1533 di << "BRepAlgo_Section section(cylinder_sh, sphere_sh)" <<"\n";
1534 BRepAlgo_Section section(cylinder_sh, sphere_sh);
1536 if(!section.IsDone()){
1537 di << "Error performing intersection: not done." << "\n";
1539 shape = section.Shape();
1542 DBRep::Set("OCCN2_cylinder",cylinder_sh);
1543 DBRep::Set("OCCN2_sphere",sphere_sh);
1544 DBRep::Set("OCCN2_section",shape);
1549 #include <TColgp_Array1OfPnt.hxx>
1550 #include <Geom_BezierCurve.hxx>
1552 static Standard_Integer OCC2569 (Draw_Interpretor& di, Standard_Integer argc, const char ** argv)
1554 Handle(AIS_InteractiveContext) aContext = ViewerTest::GetAISContext();
1555 if(aContext.IsNull())
1557 di << "use 'vinit' command before " << argv[0] << "\n";
1561 di << "Usage : " << argv[0] << " nbpoles result" << "\n";
1565 int poles=Draw::Atoi(argv[1]);
1567 TColgp_Array1OfPnt arr(1, poles);
1568 for(int i=1; i<=poles; i++)
1569 arr.SetValue(i, gp_Pnt(i+10, i*2+20, i*3+45));
1571 Handle_Geom_BezierCurve bez = new Geom_BezierCurve(arr);
1573 di << "\n The curve is not created.\n";
1575 di << "\n Degree = " << bez->Degree() << "\n";
1577 TopoDS_Edge sh = BRepBuilderAPI_MakeEdge(bez).Edge();
1578 Handle_AIS_Shape ais = new AIS_Shape(sh);
1579 aContext->Display(ais);
1580 DrawTrSurf::Set(argv[2],bez);
1584 #include <TopTools_IndexedMapOfShape.hxx>
1585 #include <TopExp.hxx>
1587 static Standard_Integer OCC1642 (Draw_Interpretor& di, Standard_Integer argc, const char ** argv)
1590 di<<"Usage: " << argv[0] << " FinalWare FinalFace InitWare InitFace shape FixReorder FixDegenerated FixConnected FixSelfIntersection"<<"\n";
1594 TopoDS_Shape shape = DBRep::Get(argv[5]);
1596 TopExp_Explorer exp(shape, TopAbs_WIRE);
1597 TopoDS_Shape wire = exp.Current();
1599 Handle(ShapeAnalysis_Wire) advWA = new ShapeAnalysis_Wire;
1600 advWA->Load(TopoDS::Wire(wire));
1602 DBRep::Set(argv[3],wire);
1605 BRepBuilderAPI_MakeFace(TopoDS::Wire(wire),Standard_True);
1607 DBRep::Set(argv[4],face);
1609 advWA->SetFace(face);
1610 Standard_Real precision_to_ana = 0.0001;
1611 advWA->SetPrecision(precision_to_ana);
1613 TopTools_IndexedMapOfShape M;
1614 TopExp::MapShapes(wire, TopAbs_EDGE, M);
1617 for(j= 1; j<=M.Extent(); ++j) {
1618 Standard_Integer num=1;
1619 IntRes2d_SequenceOfIntersectionPoint points2d;
1620 TColgp_SequenceOfPnt points3d;
1622 cout << "\n j =" << j << ", CheckSelfIntersectingEdge = " <<
1623 advWA->CheckSelfIntersectingEdge(j, points2d, points3d);
1626 ShapeExtend_Status status = ShapeExtend_FAIL1;
1627 if(advWA->StatusSelfIntersection(status))
1629 status = ShapeExtend_FAIL2;
1630 if(advWA->StatusSelfIntersection(status))
1631 di << "\n No Vertices found in the edge";
1633 status = ShapeExtend_DONE1;
1634 if(advWA->StatusSelfIntersection(status))
1635 di << "\n Self-intersection found in the edge";
1637 num = points2d.Length();
1638 di << "\n No. of self-intersecting edges : " << num;
1640 for(int i=1; i<=num; ++i) {
1641 gp_Pnt pt = points3d(i);
1642 di << "\n Intersecting pt : (" << pt.X() << ", " << pt.Y()<< ", " << pt.Z() << ")";
1647 Handle_ShapeFix_Wire sfw = new ShapeFix_Wire;
1648 sfw->Load(TopoDS::Wire(wire));
1650 sfw->SetPrecision(Precision::Confusion());
1652 sfw->FixReorderMode() = 1;
1653 sfw->ClosedWireMode() = 1;
1654 sfw->FixDegeneratedMode() = 1;
1655 sfw->FixConnectedMode() = 1;
1656 sfw->ModifyTopologyMode() = 1;
1657 sfw->ModifyGeometryMode() = 1;
1658 sfw->FixSelfIntersectionMode() = 1;
1659 sfw->FixSelfIntersectingEdgeMode() = 1;
1660 sfw->FixIntersectingEdgesMode() = 1;
1661 sfw->FixNonAdjacentIntersectingEdgesMode() = 1;
1662 sfw->FixEdgeCurvesMode() = 1;
1664 sfw->ModifyRemoveLoopMode() = 1;
1665 sfw->SetMaxTolerance(1.0);
1667 di << "\n FixReorder = " << (Standard_Integer) sfw->FixReorder();
1668 di << "\n FixDegenerated = " << (Standard_Integer) sfw->FixDegenerated();
1669 di << "\n FixConnected = " << (Standard_Integer) sfw->FixConnected();
1671 di << "\n FixSelfIntersection = " << (Standard_Integer) sfw->FixSelfIntersection();
1674 Draw::Set(argv[6],sfw->FixReorder()) ;
1675 Draw::Set(argv[7],sfw->FixDegenerated()) ;
1676 Draw::Set(argv[8],sfw->FixConnected()) ;
1677 Draw::Set(argv[9],sfw->FixSelfIntersection()) ;
1679 ShapeExtend_Status status = ShapeExtend_OK;
1680 if(sfw->StatusSelfIntersection(status))
1681 di << "\n ShapeExtend_OK : No intersection found";
1683 status = ShapeExtend_FAIL1;
1684 if(sfw->StatusSelfIntersection(status))
1685 di << "\n ShapeExtend_FAIL1 : analysis failed (edge has no pcurve,or no vertices etc.)";
1687 status = ShapeExtend_FAIL2;
1688 if(sfw->StatusSelfIntersection(status))
1689 di << "\n ShapeExtend_FAIL2 : self-intersection was found, but not fixed because of limit of increasing tolerance (MaxTolerance)";
1691 status = ShapeExtend_FAIL3;
1692 if(sfw->StatusSelfIntersection(status))
1693 di << "\n ShapeExtend_FAIL3 : intercestion of non adjacent edges found, but not fixed because of limit of increasing tolerance (MaxTolerance)";
1695 status = ShapeExtend_DONE1;
1696 if(sfw->StatusSelfIntersection(status))
1697 di << "\n ShapeExtend_DONE1 : tolerance of vertex was increased to fix self-intersection";
1699 status = ShapeExtend_DONE2;
1700 if(sfw->StatusSelfIntersection(status))
1701 di << "\n ShapeExtend_DONE2 : vertex was moved to fix self-intersection";
1703 status = ShapeExtend_DONE3;
1704 if(sfw->StatusSelfIntersection(status))
1705 di << "\n ShapeExtend_DONE3 : some edges were removed because of intersection";
1707 status = ShapeExtend_DONE4;
1708 if(sfw->StatusSelfIntersection(status))
1709 di << "\n ShapeExtend_DONE4 : pcurve(s) was(were) modified";
1711 status = ShapeExtend_DONE5;
1712 if(sfw->StatusSelfIntersection(status))
1713 di << "\n ShapeExtend_DONE5 : non adjacent intersection fixed by increasing tolerance of vertex(vertices)";
1715 status = ShapeExtend_DONE6;
1716 if(sfw->StatusSelfIntersection(status))
1717 di << "\n ShapeExtend_DONE6 : tolerance of edge was increased to hide intersection";
1719 status = ShapeExtend_DONE7;
1720 if(sfw->StatusSelfIntersection(status))
1721 di << "\n ShapeExtend_DONE7 : range of some edges was decreased to avoid intersection";
1723 TopoDS_Wire finalwire = sfw->Wire();
1725 DBRep::Set(argv[1],finalwire);
1728 advWA->Load(TopoDS::Wire(finalwire));
1731 BRepBuilderAPI_MakeFace(TopoDS::Wire(finalwire),Standard_True);
1733 DBRep::Set(argv[2],fface);
1735 advWA->SetFace(fface);
1737 TopTools_IndexedMapOfShape fM;
1738 TopExp::MapShapes(finalwire, TopAbs_EDGE, fM);
1740 for(j= 1; j<=fM.Extent(); ++j) {
1741 Standard_Integer num=1;
1742 IntRes2d_SequenceOfIntersectionPoint points2d;
1743 TColgp_SequenceOfPnt points3d;
1745 di << "\n j =" << j << ", CheckSelfIntersectingEdge = " <<
1746 (Standard_Integer) advWA->CheckSelfIntersectingEdge(j, points2d, points3d);
1749 ShapeExtend_Status status = ShapeExtend_FAIL1;
1750 if(advWA->StatusSelfIntersection(status))
1752 status = ShapeExtend_FAIL2;
1753 if(advWA->StatusSelfIntersection(status))
1754 di << "\n No Vertices found in the edge";
1756 status = ShapeExtend_DONE1;
1757 if(advWA->StatusSelfIntersection(status))
1758 di << "\n Self-intersection found in the edge";
1760 num = points2d.Length();
1761 di << "\n No. of self-intersecting edges : " << num;
1763 for(int i=1; i<=num; ++i) {
1764 gp_Pnt pt = points3d(i);
1765 di << "\n Intersecting pt : (" << pt.X() << ", " << pt.Y() << ", " << pt.Z() << ")";
1775 void QABugs::Commands_17(Draw_Interpretor& theCommands) {
1776 const char *group = "QABugs";
1778 theCommands.Add ("BUC60842", "BUC60842", __FILE__, BUC60842, group);
1779 theCommands.Add ("BUC60843", "BUC60843 result_shape name_of_circle name_of_curve [ par1 [ tol ] ]", __FILE__, BUC60843, group);
1780 theCommands.Add ("BUC60970", "BUC60970 shape result", __FILE__, BUC60970, group);
1781 theCommands.Add ("BUC60818", "BUC60818", __FILE__, BUC60818, group);
1782 theCommands.Add ("BUC60915", "BUC60915", __FILE__, BUC60915_1, group);
1783 theCommands.Add ("OCC138", "OCC138", __FILE__, OCC138, group);
1784 theCommands.Add ("BUC60821","BUC60821",__FILE__,BUC60821,group);
1785 theCommands.Add ("OCC353","OCC353",__FILE__,OCC353,group);
1786 theCommands.Add ("OCC280","OCC280 hlr=0/1 setsurfecedetail=0/1; set perspecrive view",__FILE__,OCC280,group);
1787 theCommands.Add ("OCC232", "OCC232", __FILE__, OCC232 , group);
1788 theCommands.Add ("OCC138LC", "OCC138LC", __FILE__, OCC138LC, group);
1789 theCommands.Add ("OCC189", "OCC189", __FILE__, OCC189, group);
1790 theCommands.Add ("OCC566", "OCC566 shape [ xmin ymin zmin xmax ymax zmax] ; print bounding box", __FILE__, OCC566, group);
1791 theCommands.Add ("OCC570", "OCC570 result", __FILE__, OCC570, group);
1793 theCommands.Add("OCC570mkevol",
1794 "OCC570mkevol result object (then use updatevol) [R/Q/P]; mkevol",
1795 __FILE__, MKEVOL,group);
1796 theCommands.Add("OCC570updatevol",
1797 "OCC570updatevol edge u1 rad1 u2 rad2 ...; updatevol",
1798 __FILE__, UPDATEVOL,group);
1799 theCommands.Add("OCC570updatevollaw",
1800 "OCC570updatevollaw edge u1 rad1 u2 rad2 ...; updatevollaw",
1801 __FILE__, UPDATEVOL,group);
1802 theCommands.Add("OCC570buildevol",
1803 "OCC570buildevol; end of the evol fillet computation",
1804 __FILE__, BUILDEVOL,group);
1806 theCommands.Add ("OCC606", "OCC606 result shape [-t]", __FILE__, OCC606, group);
1808 theCommands.Add ("OCC813", "OCC813 U V", __FILE__, OCC813, group);
1809 theCommands.Add ("OCC814", "OCC814", __FILE__, OCC814, group);
1810 theCommands.Add ("OCC884", "OCC884 result shape [toler [maxtoler]]", __FILE__, OCC884, group);
1811 theCommands.Add ("OCC1188", "OCC1188 imagefile [filltype] : Load image as background", __FILE__, OCC1188, group);
1813 theCommands.Add ("OCC1174_1", "OCC1174_1 shape", __FILE__, OCC1174_1, group);
1814 theCommands.Add ("OCC1174_2", "OCC1174_2 shape", __FILE__, OCC1174_2, group);
1816 theCommands.Add ("OCCN1", "OCCN1 angle fuse(1 for boss / 0 for slot) length", __FILE__, OCCN1, group);
1817 theCommands.Add ("OCCN2", "OCCN2", __FILE__, OCCN2, group);
1819 theCommands.Add ("OCC2569", "OCC2569 nbpoles result", __FILE__, OCC2569, group);
1821 theCommands.Add ("OCC1642", "OCC1642 FinalWare FinalFace InitWare InitFace shape FixReorder FixDegenerated FixConnected FixSelfIntersection", __FILE__, OCC1642, group);