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.
19 #include <Draw_Interpretor.hxx>
21 #include <DrawTrSurf.hxx>
22 #include <AIS_InteractiveContext.hxx>
23 #include <ViewerTest.hxx>
24 #include <AIS_Shape.hxx>
25 #include <TopoDS_Shape.hxx>
27 #include <GProp_GProps.hxx>
28 #include <BRepGProp.hxx>
29 #include <TopoDS_Edge.hxx>
30 #include <BRepBuilderAPI_MakeEdge.hxx>
31 #include <AIS_Trihedron.hxx>
32 #include <Geom_Axis2Placement.hxx>
34 #include <Geom_Circle.hxx>
35 #include <AIS_Circle.hxx>
37 #include <Geom_Plane.hxx>
39 #include <AIS_AngleDimension.hxx>
41 #include <Aspect_Window.hxx>
42 #include <V3d_View.hxx>
44 #include <TopExp_Explorer.hxx>
45 #include <BRepAdaptor_Curve.hxx>
46 #include <GC_MakePlane.hxx>
47 #include <AIS_PlaneTrihedron.hxx>
48 #include <ViewerTest_DoubleMapOfInteractiveAndName.hxx>
50 #include <BRep_Tool.hxx>
51 #include <Geom_BSplineCurve.hxx>
52 #include <GeomConvert_CompCurveToBSplineCurve.hxx>
53 #include <BRepBuilderAPI_MakeEdge.hxx>
54 #include <Precision.hxx>
56 #include <GProp_PrincipalProps.hxx>
58 #include <OSD_Path.hxx>
59 #include <Standard_ProgramError.hxx>
61 #include <ShapeFix_Wireframe.hxx>
62 #include <ShapeBuild_ReShape.hxx>
64 #include <BRepBuilderAPI_MakeEdge.hxx>
66 #include <ViewerTest_EventManager.hxx>
68 #include <TColgp_Array1OfPnt2d.hxx>
70 #include <DDocStd.hxx>
71 #include <TDocStd_Document.hxx>
72 #include <Standard_ErrorHandler.hxx>
75 extern ViewerTest_DoubleMapOfInteractiveAndName& GetMapOfAIS();
77 Standard_EXPORT ViewerTest_DoubleMapOfInteractiveAndName& GetMapOfAIS();
80 static Standard_Integer BUC60848 (Draw_Interpretor& di, Standard_Integer argc, const char ** argv)
83 di << "Usage : " << argv[0] << " shape \n";
86 TopoDS_Shape S = DBRep::Get( argv[1] );
88 di << "Shape is empty\n";
92 BRepGProp::VolumeProperties( S,G );
96 di << "Result is negative : " << GRes << "\n";
99 di << "Volume : " << GRes << "\n";
105 static Standard_Integer BUC60828 (Draw_Interpretor& di, Standard_Integer /*argc*/, const char ** /*argv*/)
107 TopoDS_Edge anEdge = BRepBuilderAPI_MakeEdge(gp_Pnt(0.,0.,0.), gp_Pnt(0.,0.,1.));
108 Standard_Boolean aValue;
109 aValue=anEdge.Infinite();
110 di << "Initial flag : " << (Standard_Integer) aValue << "\n";
111 anEdge.Infinite(Standard_True);
112 Standard_Boolean aValue1;
113 aValue1=anEdge.Infinite();
114 di << "Current flag : " << (Standard_Integer) aValue1 << "\n";
115 if(aValue1) di << "Flag was set properly.\n";
116 else di << "Faulty : flag was not set properly.\n";
120 static Standard_Integer BUC60814(Draw_Interpretor& di, Standard_Integer argc, const char ** argv)
124 di << "Usage : " << argv[0] << "\n";
129 Handle(AIS_InteractiveContext) myAISContext = ViewerTest::GetAISContext();
130 if(myAISContext.IsNull()) {
131 di << "use 'vinit' command before " << argv[0] << "\n";
136 Handle(AIS_InteractiveObject) aTrihedron;
137 Handle(Geom_Axis2Placement) aTrihedronAxis=new Geom_Axis2Placement(gp::XOY());
138 aTrihedron=new AIS_Trihedron(aTrihedronAxis);
139 myAISContext->Display (aTrihedron, Standard_False);
146 Handle(Geom_Circle) ahCircle=new Geom_Circle(aAx2,20);
147 Handle(AIS_InteractiveObject) aCircle=new AIS_Circle(ahCircle);
148 myAISContext->Display (aCircle, Standard_False);
150 const Handle(Prs3d_Drawer)& aSelStyle = myAISContext->SelectionStyle();
151 aSelStyle->SetColor (Quantity_NOC_BLUE1);
153 myAISContext->AddOrRemoveSelected (aTrihedron, Standard_False);
154 myAISContext->AddOrRemoveSelected (aCircle, Standard_True);
159 //=======================================================================
160 //function : BUC60774
162 //=======================================================================
163 static Standard_Integer BUC60774 (Draw_Interpretor& theDi,
164 Standard_Integer theArgNb,
165 const char** theArgv)
169 std::cout << "Usage : " << theArgv[0] << "\n";
173 const Handle(AIS_InteractiveContext)& anAISContext = ViewerTest::GetAISContext();
174 if (anAISContext.IsNull())
176 std::cout << "use 'vinit' command before " << theArgv[0] << "\n";
180 const Handle(V3d_View)& aV3dView = ViewerTest::CurrentView();
182 Standard_Integer aWinWidth = 0;
183 Standard_Integer aWinHeight = 0;
184 aV3dView->Window()->Size (aWinWidth, aWinHeight);
186 Standard_Integer aXPixMin = 0;
187 Standard_Integer aYPixMin = 0;
188 Standard_Integer aXPixMax = aWinWidth;
189 Standard_Integer aYPixMax = aWinHeight;
191 AIS_StatusOfPick aPickStatus = anAISContext->Select (aXPixMin, aYPixMin, aXPixMax, aYPixMax, aV3dView, Standard_False);
192 theDi << (aPickStatus == AIS_SOP_NothingSelected
193 ? "status = AIS_SOP_NothingSelected : OK"
194 : "status = AIS_SOP_NothingSelected : bugged - Faulty ");
197 theDi.Eval ("box b 10 10 10");
198 theDi.Eval (" vdisplay b");
200 aPickStatus = anAISContext->Select (aXPixMin, aYPixMin, aXPixMax, aYPixMax, aV3dView, Standard_False);
201 theDi << (aPickStatus == AIS_SOP_OneSelected
202 ? "status = AIS_SOP_OneSelected : OK"
203 : "status = AIS_SOP_OneSelected : bugged - Faulty ");
206 theDi.Eval ("box w 20 20 20 20 20 20");
207 theDi.Eval (" vdisplay w");
209 aPickStatus = anAISContext->Select (aXPixMin, aYPixMin, aXPixMax, aYPixMax, aV3dView, Standard_True);
210 theDi << (aPickStatus == AIS_SOP_SeveralSelected
211 ? "status = AIS_SOP_SeveralSelected : OK"
212 : "status = AIS_SOP_SeveralSelected : bugged - Faulty ");
218 static Standard_Integer BUC60972 (Draw_Interpretor& di, Standard_Integer argc, const char ** argv)
220 Handle(AIS_InteractiveContext) aContext = ViewerTest::GetAISContext();
221 if(aContext.IsNull()) {
222 di << "use 'vinit' command before " << argv[0] << "\n";
227 di << "Usage : " << argv[0] << " edge edge plane val text\n";
231 TopoDS_Edge aFirst = TopoDS::Edge(DBRep::Get(argv[1],TopAbs_EDGE));
232 TopoDS_Edge aSecond = TopoDS::Edge(DBRep::Get(argv[2],TopAbs_EDGE));
233 Handle(Geom_Plane) aPlane = Handle(Geom_Plane)::DownCast(DrawTrSurf::GetSurface(argv[3]));
237 di << aPlane->Pln().SquareDistance( gp_Pnt(0,0,0) ) << "\n";
239 TCollection_ExtendedString aText(argv[5]);
240 //Standard_ExtString ExtString_aText = aText.ToExtString();
241 //di << ExtString_aText << " " << Draw::Atof(argv[4]) << "\n";
242 di << argv[5] << " " << Draw::Atof(argv[4]) << "\n";
244 Handle(AIS_AngleDimension) aDim = new AIS_AngleDimension(aFirst, aSecond);
245 aContext->Display (aDim, Standard_True);
250 static Standard_Integer OCC218bug (Draw_Interpretor& di, Standard_Integer argc, const char ** argv)
252 Handle(AIS_InteractiveContext) aContext = ViewerTest::GetAISContext();
253 if(aContext.IsNull()) {
254 di << "use 'vinit' command before " << argv[0] << "\n";
259 di << "Usage : " << argv[0] << " name plane Xlabel Ylabel\n";
263 TopoDS_Shape S = DBRep::Get( argv[2] );
265 di << "Shape is empty\n";
269 TCollection_AsciiString name(argv[1]);
270 TCollection_AsciiString Xlabel(argv[3]);
271 TCollection_AsciiString Ylabel(argv[4]);
273 // Construction de l'AIS_PlaneTrihedron
274 Handle(AIS_PlaneTrihedron) theAISPlaneTri;
276 Standard_Boolean IsBound = GetMapOfAIS().IsBound2(name);
278 // on recupere la shape dans la map des objets displayes
279 Handle(AIS_InteractiveObject) aShape = GetMapOfAIS().Find2(name);
281 // On verifie que l'AIS InteraciveObject est bien
282 // un AIS_PlaneTrihedron
283 if (aShape->Type()==AIS_KOI_Datum && aShape->Signature()==4) {
284 // On downcast aShape de AIS_InteractiveObject a AIS_PlaneTrihedron
285 theAISPlaneTri = Handle(AIS_PlaneTrihedron)::DownCast (aShape);
287 theAISPlaneTri->SetXLabel(Xlabel);
288 theAISPlaneTri->SetYLabel(Ylabel);
290 aContext->Redisplay(theAISPlaneTri, Standard_False);
291 aContext->UpdateCurrentViewer();
294 TopoDS_Face FaceB=TopoDS::Face(S);
296 // Construction du Plane
297 // recuperation des edges des faces.
298 TopExp_Explorer FaceExpB(FaceB,TopAbs_EDGE);
300 TopoDS_Edge EdgeB=TopoDS::Edge(FaceExpB.Current() );
304 // si il y a plusieurs edges
305 if (FaceExpB.More() ) {
307 TopoDS_Edge EdgeC=TopoDS::Edge(FaceExpB.Current() );
308 BRepAdaptor_Curve theCurveB(EdgeB);
309 BRepAdaptor_Curve theCurveC(EdgeC);
310 A=theCurveC.Value(0.1);
311 B=theCurveC.Value(0.9);
312 C=theCurveB.Value(0.5);
315 // FaceB a 1 unique edge courbe
316 BRepAdaptor_Curve theCurveB(EdgeB);
317 A=theCurveB.Value(0.1);
318 B=theCurveB.Value(0.9);
319 C=theCurveB.Value(0.5);
321 // Construction du Geom_Plane
322 GC_MakePlane MkPlane(A,B,C);
323 Handle(Geom_Plane) theGeomPlane=MkPlane.Value();
325 // on le display & bind
326 theAISPlaneTri= new AIS_PlaneTrihedron(theGeomPlane );
328 theAISPlaneTri->SetXLabel(Xlabel);
329 theAISPlaneTri->SetYLabel(Ylabel);
331 GetMapOfAIS().Bind ( theAISPlaneTri, name);
332 aContext->Display (theAISPlaneTri, Standard_True);
337 static Standard_Integer OCC295(Draw_Interpretor& di, Standard_Integer argc, const char ** argv)
340 di << "Usage : " << argv[0] << " edge_result edge1 edge2\n";
344 TopoDS_Shape Sh1 = DBRep::Get(argv[2]);
345 TopoDS_Shape Sh2 = DBRep::Get(argv[3]);
346 if(Sh1.IsNull() || Sh2.IsNull()) return 1;
347 if(Sh1.ShapeType() != TopAbs_EDGE || Sh2.ShapeType() != TopAbs_EDGE) return 1;
348 TopoDS_Edge e1 = TopoDS::Edge(Sh1);
349 TopoDS_Edge e2 = TopoDS::Edge(Sh2);
350 Standard_Real f1,l1,f2,l2;
351 Standard_Boolean After = Standard_True;
352 Handle(Geom_Curve) ac1 = BRep_Tool::Curve(e1,f1,l1);
353 Handle(Geom_Curve) ac2 = BRep_Tool::Curve(e2,f2,l2);
354 Handle(Geom_BSplineCurve) bsplc1 = Handle(Geom_BSplineCurve)::DownCast(ac1);
355 Handle(Geom_BSplineCurve) bsplc2 = Handle(Geom_BSplineCurve)::DownCast(ac2);
356 if(bsplc1.IsNull() || bsplc2.IsNull()) return 1;
357 gp_Pnt pmid = 0.5 * ( bsplc1->Pole(bsplc1->NbPoles()).XYZ() + bsplc2->Pole(1).XYZ() );
358 bsplc1->SetPole(bsplc1->NbPoles(), pmid);
359 bsplc2->SetPole(1, pmid);
360 GeomConvert_CompCurveToBSplineCurve connect3d(bsplc1);
361 if(!connect3d.Add(bsplc2,Precision::Confusion(), After, Standard_False)) return 1;
362 BRepBuilderAPI_MakeEdge MkEdge(connect3d.BSplineCurve());
363 if(MkEdge.IsDone()) {
364 TopoDS_Edge nedge = MkEdge.Edge();
365 DBRep::Set ( argv[1], nedge );
371 static Standard_Integer OCC49 (Draw_Interpretor& di, Standard_Integer argc, const char ** argv)
375 di << "Usage : " << argv[0] << " name\n";
379 TopoDS_Shape S = DBRep::Get(argv[1]);
380 if (S.IsNull()) return 0;
383 BRepGProp::VolumeProperties(S,G);
384 GProp_PrincipalProps Pr = G.PrincipalProperties();
385 Standard_Boolean Result = Pr.HasSymmetryAxis();
394 static Standard_Integer OCC132 (Draw_Interpretor& di, Standard_Integer argc, const char ** argv)
400 ... the validation of the name of files in Analyse_DOS and Analyse_UNIX is :
402 characters not allowed in DOS/WNT names are
411 and more than one dot in filename.
415 di << "Usage : " << argv[0] << " DependentName\n";
419 OSD_SysType SysType1 = OSD_OS2;
420 OSD_SysType SysType2 = OSD_WindowsNT;
425 OSD_Path Path (argv[1], SysType1);
427 catch (Standard_ProgramError const&) {
436 OSD_Path Path (argv[1], SysType2);
438 catch (Standard_ProgramError const&) {
448 static Standard_Integer OCC405 (Draw_Interpretor& di, Standard_Integer argc, const char ** argv)
451 di << "Usage : " << argv[0] << " edge_result edge1 edge2; merge two edges\n";
455 TopoDS_Shape Sh1 = DBRep::Get(argv[2]);
456 TopoDS_Shape Sh2 = DBRep::Get(argv[3]);
457 if(Sh1.IsNull() || Sh2.IsNull()) return 1;
458 if(Sh1.ShapeType() != TopAbs_EDGE || Sh2.ShapeType() != TopAbs_EDGE) return 1;
459 TopoDS_Edge e1 = TopoDS::Edge(Sh1);
460 TopoDS_Edge e2 = TopoDS::Edge(Sh2);
461 Standard_Real f1,l1,f2,l2;
462 Standard_Boolean After = Standard_True;
463 Handle(Geom_Curve) ac1 = BRep_Tool::Curve(e1,f1,l1);
464 Handle(Geom_Curve) ac2 = BRep_Tool::Curve(e2,f2,l2);
465 if(e1.Orientation() == TopAbs_REVERSED) {
466 Standard_Real cf = f1;
467 f1 = ac1->ReversedParameter ( l1 );
468 l1 = ac1->ReversedParameter ( cf );
469 ac1 = ac1->Reversed();
471 if(e2.Orientation() == TopAbs_REVERSED) {
472 Standard_Real cf = f2;
473 f2 = ac2->ReversedParameter ( l2 );
474 l2 = ac2->ReversedParameter ( cf );
475 ac2 = ac2->Reversed();
477 Handle(Geom_BSplineCurve) bsplc1 = Handle(Geom_BSplineCurve)::DownCast(ac1);
478 Handle(Geom_BSplineCurve) bsplc2 = Handle(Geom_BSplineCurve)::DownCast(ac2);
479 if(bsplc1.IsNull() || bsplc2.IsNull()) return 1;
480 if(bsplc1->FirstParameter() < f1 - Precision::PConfusion() ||
481 bsplc1->LastParameter() > l1 + Precision::PConfusion()) {
482 Handle(Geom_BSplineCurve) aBstmp = Handle(Geom_BSplineCurve)::DownCast(bsplc1->Copy());
483 aBstmp->Segment(f1,l1);
486 if(bsplc2->FirstParameter() < f2 - Precision::PConfusion() ||
487 bsplc2->LastParameter() > l2 + Precision::PConfusion()) {
488 Handle(Geom_BSplineCurve) aBstmp = Handle(Geom_BSplineCurve)::DownCast(bsplc2->Copy());
489 aBstmp->Segment(f2,l2);
492 gp_Pnt pmid = 0.5 * ( bsplc1->Pole(bsplc1->NbPoles()).XYZ() + bsplc2->Pole(1).XYZ() );
493 bsplc1->SetPole(bsplc1->NbPoles(), pmid);
494 bsplc2->SetPole(1, pmid);
495 GeomConvert_CompCurveToBSplineCurve connect3d(bsplc1);
496 if(!connect3d.Add(bsplc2,Precision::Confusion(), After, Standard_False)) return 1;
497 BRepBuilderAPI_MakeEdge MkEdge(connect3d.BSplineCurve());
498 if(MkEdge.IsDone()) {
499 TopoDS_Edge nedge = MkEdge.Edge();
500 DBRep::Set ( argv[1], nedge );
506 static Standard_Integer OCC395 (Draw_Interpretor& di, Standard_Integer argc, const char ** argv)
509 di << "Usage : " << argv[0] << " edge_result edge1 edge2\n";
512 //TCollection_AsciiString fnom(a[1]);
513 //Standard_Boolean modfic = XSDRAW::FileAndVar(a[1],a[2],a[3],"IGES",fnom,rnom,resnom);
514 TopoDS_Shape Sh1 = DBRep::Get(argv[2]);
515 TopoDS_Shape Sh2 = DBRep::Get(argv[3]);
516 if(Sh1.IsNull() || Sh2.IsNull()) return 1;
517 if(Sh1.ShapeType() != TopAbs_EDGE || Sh2.ShapeType() != TopAbs_EDGE) return 1;
518 TopoDS_Edge e1 = TopoDS::Edge(Sh1);
519 TopoDS_Edge e2 = TopoDS::Edge(Sh2);
520 Standard_Real f1,l1,f2,l2;
521 Standard_Boolean After = Standard_True;
522 Handle(Geom_Curve) ac1 = BRep_Tool::Curve(e1,f1,l1);
523 Handle(Geom_Curve) ac2 = BRep_Tool::Curve(e2,f2,l2);
524 if(e1.Orientation() == TopAbs_REVERSED) {
525 //Standard_Real cf = cf1;
526 //cf1 = ac1->ReversedParameter ( cl1 );
527 //cl1 = ac1->ReversedParameter ( cf );
528 ac1 = ac1->Reversed();
530 if(e2.Orientation() == TopAbs_REVERSED) {
531 //Standard_Real cf = cf2;
532 //ac2 = ac2->ReversedParameter ( cl2 );
533 //ac2 = ac2->ReversedParameter ( cf );
534 ac2 = ac2->Reversed();
536 Handle(Geom_BSplineCurve) bsplc1 = Handle(Geom_BSplineCurve)::DownCast(ac1);
537 Handle(Geom_BSplineCurve) bsplc2 = Handle(Geom_BSplineCurve)::DownCast(ac2);
538 if(bsplc1.IsNull() || bsplc2.IsNull()) return 1;
539 gp_Pnt pmid = 0.5 * ( bsplc1->Pole(bsplc1->NbPoles()).XYZ() + bsplc2->Pole(1).XYZ() );
540 bsplc1->SetPole(bsplc1->NbPoles(), pmid);
541 bsplc2->SetPole(1, pmid);
542 GeomConvert_CompCurveToBSplineCurve connect3d(bsplc1);
543 if(!connect3d.Add(bsplc2,Precision::Confusion(), After, Standard_False)) return 1;
544 BRepBuilderAPI_MakeEdge MkEdge(connect3d.BSplineCurve());
545 if(MkEdge.IsDone()) {
546 TopoDS_Edge nedge = MkEdge.Edge();
547 DBRep::Set ( argv[1], nedge );
553 static Standard_Integer OCC394 (Draw_Interpretor& di, Standard_Integer argc, const char ** argv)
556 di << "Usage : " << argv[0] << " edge_result edge [tol [mode [tolang]]]\n";
559 TopoDS_Shape Sh = DBRep::Get(argv[2]);
561 Standard_Integer k = 3;
562 Standard_Real tol = 100000;
563 Standard_Integer mode = 2;
564 Standard_Real tolang = M_PI/2;
566 tol = Draw::Atof(argv[k++]);
569 mode= Draw::Atoi(argv[k++]);
572 tolang = Draw::Atof(argv[k++]);
575 Handle(ShapeFix_Wireframe) aSfwr = new ShapeFix_Wireframe();
576 Handle(ShapeBuild_ReShape) aReShape = new ShapeBuild_ReShape;
577 aSfwr->SetContext(aReShape);
579 aSfwr->SetPrecision(tol);
580 Standard_Boolean aModeDrop = Standard_True;
582 aModeDrop = Standard_False;
584 TopTools_MapOfShape theSmallEdges, theMultyEdges;
585 TopTools_DataMapOfShapeListOfShape theEdgeToFaces,theFaceWithSmall;
586 aSfwr->CheckSmallEdges(theSmallEdges,theEdgeToFaces,theFaceWithSmall, theMultyEdges);
587 aSfwr->MergeSmallEdges (theSmallEdges,theEdgeToFaces,theFaceWithSmall, theMultyEdges, aModeDrop,tolang);
588 //aSfwr->FixSmallEdges();
589 TopoDS_Shape resShape = aSfwr->Shape();
590 DBRep::Set ( argv[1], resShape );
594 static Standard_Integer OCC301 (Draw_Interpretor& di, Standard_Integer argc, const char ** argv)
596 Handle(AIS_InteractiveContext) context = ViewerTest::GetAISContext();
597 if(context.IsNull()) {
598 di << "use 'vinit' command before " << argv[0] << "\n";
602 di << "Usage : " << argv[0] << " ArcRadius ArrowSize\n";
606 Standard_Real aRadius = Draw::Atof(argv[1]);
607 Standard_Real anArrowSize = Draw::Atof(argv[2]);
609 gp_Pnt p1 = gp_Pnt(10.,10.,0.);
610 gp_Pnt p2 = gp_Pnt(50.,10.,0.);
611 gp_Pnt p3 = gp_Pnt(50.,50.,0.);
613 TopoDS_Edge E1 = BRepBuilderAPI_MakeEdge(p1, p2);
614 TopoDS_Edge E2 = BRepBuilderAPI_MakeEdge(p2, p3);
616 context->Display (new AIS_Shape(E1), Standard_False);
617 context->Display (new AIS_Shape(E2), Standard_True);
619 gp_Pnt plnpt(0, 0, 0);
620 gp_Dir plndir(0, 0, 1);
621 Handle(Geom_Plane) pln = new Geom_Plane(plnpt,plndir);
623 Handle(AIS_AngleDimension) anAngleDimension = new AIS_AngleDimension (p1.Mirrored (p2), p2, p3);
625 Handle(Prs3d_DimensionAspect) anAspect = new Prs3d_DimensionAspect;
626 anAspect->MakeArrows3d (Standard_True);
627 anAspect->ArrowAspect()->SetLength (anArrowSize);
628 anAspect->SetTextHorizontalPosition (Prs3d_DTHP_Right);
629 anAspect->TextAspect ()->SetColor (Quantity_NOC_YELLOW);
630 anAngleDimension->SetDimensionAspect (anAspect);
631 // Another position of dimension
632 anAngleDimension->SetFlyout (aRadius);
633 context->Display (anAngleDimension, 0);
637 static Standard_Integer OCC261 (Draw_Interpretor& di, Standard_Integer argc, const char ** argv)
640 di << "Usage : " << argv[0] << " Doc\n";
644 Handle(TDocStd_Document) Doc;
645 if(DDocStd::GetDocument(argv[1], Doc)) {
652 #include <OSD_File.hxx>
653 static Standard_Integer OCC710 (Draw_Interpretor& di, Standard_Integer argc, const char ** argv)
656 di << "Usage : " << argv[0] << " path\n";
659 TCollection_AsciiString in(argv[1]);
660 OSD_File* aFile = new OSD_File(in);
661 Standard_Boolean anExists = aFile->Exists();
662 if(anExists == Standard_True)
669 #include <ShapeFix_Shell.hxx>
670 #include <AIS_InteractiveObject.hxx>
671 static Standard_Integer OCC904 (Draw_Interpretor& di, Standard_Integer argc, const char ** argv)
674 di << "Usage : " << argv[0] << " result shape nonmanifoldmode(0/1)\n";
676 TopoDS_Shape S = DBRep::Get(argv[2]);
677 if (S.IsNull() || S.ShapeType() != TopAbs_SHELL) {
678 di << " Shape is null\n";
681 Standard_Boolean nonmanifmode = (Draw::Atoi(argv[3]) != 0);
682 Handle(ShapeFix_Shell) SFSh = new ShapeFix_Shell;
683 SFSh->FixFaceOrientation(TopoDS::Shell(S),Standard_True,nonmanifmode);
684 DBRep::Set(argv[1],SFSh->Shape());
688 void QABugs::Commands_16(Draw_Interpretor& theCommands) {
689 const char *group = "QABugs";
691 theCommands.Add ("BUC60848", "BUC60848 shape", __FILE__, BUC60848, group);
692 theCommands.Add ("BUC60828", "BUC60828", __FILE__, BUC60828, group);
693 theCommands.Add ("BUC60814", "BUC60814", __FILE__, BUC60814, group);
694 theCommands.Add ("BUC60774", "BUC60774", __FILE__, BUC60774, group);
695 theCommands.Add ("BUC60972", "BUC60972 edge edge plane val text ", __FILE__, BUC60972, group);
696 theCommands.Add ("OCC218", "OCC218 name plane Xlabel Ylabel", __FILE__, OCC218bug, group);
697 theCommands.Add ("OCC295", "OCC295 edge_result edge1 edge2", __FILE__, OCC295, group);
698 theCommands.Add ("OCC49", "OCC49 name", __FILE__, OCC49, group);
699 theCommands.Add ("OCC132", "OCC132 DependentName", __FILE__, OCC132, group);
700 theCommands.Add ("OCC405", "OCC405 edge_result edge1 edge2; merge two edges", __FILE__, OCC405, group);
701 theCommands.Add ("OCC395", "OCC395 edge_result edge1 edge2", __FILE__, OCC395, group);
702 theCommands.Add ("OCC394", "OCC394 edge_result edge [tol [mode [tolang]]]", __FILE__, OCC394, group);
703 theCommands.Add ("OCC301", "OCC301 ArcRadius ArrowSize", __FILE__, OCC301, group);
704 theCommands.Add ("OCC261", "OCC261 Doc", __FILE__, OCC261, group);
705 theCommands.Add ("OCC710", "OCC710 path", __FILE__, OCC710, group);
706 theCommands.Add ("OCC904", "OCC904 result shape nonmanifoldmode(0/1)", __FILE__, OCC904, group);