return 0;
}
+//=======================================================================
+//function : OCC26553
+//purpose :
+//=======================================================================
+#include <BRepBuilderAPI_MakeWire.hxx>
+
+static Standard_Integer OCC26553 (Draw_Interpretor& theDI, Standard_Integer theArgc, const char** theArgv)
+{
+ if (theArgc < 2)
+ {
+ theDI << "Error: path to file with shell is missing\n";
+ return 1;
+ }
+
+ BRep_Builder aBuilder;
+ TopoDS_Shape aShell;
+ BRepTools::Read(aShell, theArgv[1], aBuilder);
+
+ if (aShell.IsNull())
+ {
+ theDI << "Error: shell not loaded\n";
+ return 1;
+ }
+
+ TopoDS_Edge aPipeEdge = BRepBuilderAPI_MakeEdge (gp_Pnt (0, 0, 0), gp_Pnt (0, 0, 10));
+ TopoDS_Wire aPipeWire = BRepBuilderAPI_MakeWire(aPipeEdge).Wire();
+
+ BRepOffsetAPI_MakePipe aPipeBuilder(aPipeWire, aShell);
+ if (!aPipeBuilder.IsDone())
+ {
+ theDI << "Error: failed to create pipe\n";
+ return 1;
+ }
+
+ for (TopExp_Explorer aShapeExplorer(aShell, TopAbs_EDGE); aShapeExplorer.More(); aShapeExplorer.Next ()) {
+ const TopoDS_Shape& aGeneratedShape = aPipeBuilder.Generated(aPipeEdge, aShapeExplorer.Current());
+ if (aGeneratedShape.IsNull())
+ {
+ theDI << "Error: null shape\n";
+ return 1;
+ }
+ }
+
+ theDI << "History returned successfully\n";
+ return 0;
+}
+
+//=======================================================================
+//function : OCC26195
+//purpose :
+//=======================================================================
+#include <SelectMgr_SelectingVolumeManager.hxx>
+#include <BRepBuilderAPI_MakePolygon.hxx>
+#include <Geom_CartesianPoint.hxx>
+#include <AIS_Line.hxx>
+#include <Aspect_Window.hxx>
+static Standard_Integer OCC26195 (Draw_Interpretor& theDI, Standard_Integer theArgNb, const char** theArgVec)
+{
+ if (theArgNb < 3)
+ {
+ std::cerr << "Error: wrong number of arguments! See usage:\n";
+ theDI.PrintHelp (theArgVec[0]);
+ return 1;
+ }
+
+ if (ViewerTest::GetAISContext().IsNull())
+ {
+ std::cerr << "Error: No opened context!\n";
+ return 1;
+ }
+
+ gp_Pnt2d aPxPnt1, aPxPnt2;
+ aPxPnt1.SetX (Draw::Atof (theArgVec[1]));
+ aPxPnt1.SetY (Draw::Atof (theArgVec[2]));
+ if (theArgNb > 4)
+ {
+ aPxPnt2.SetX (Draw::Atof (theArgVec[3]));
+ aPxPnt2.SetY (Draw::Atof (theArgVec[4]));
+ }
+ Standard_Boolean toPrint = Standard_False;
+ if (theArgNb % 2 == 0)
+ {
+ toPrint = Draw::Atoi (theArgVec[theArgNb - 1]);
+ }
+
+ SelectMgr_SelectingVolumeManager* aMgr = new SelectMgr_SelectingVolumeManager();
+ aMgr->SetActiveSelectionType (theArgNb > 4 ?
+ SelectMgr_SelectingVolumeManager::Box : SelectMgr_SelectingVolumeManager::Point);
+ aMgr->SetCamera (ViewerTest::CurrentView()->Camera());
+ aMgr->SetPixelTolerance (ViewerTest::GetAISContext()->PixelTolerance());
+ Standard_Integer aWidth, aHeight;
+ ViewerTest::CurrentView()->View()->Window()->Size (aWidth, aHeight);
+ aMgr->SetWindowSize (aWidth, aHeight);
+ if (theArgNb > 4)
+ {
+ aMgr->BuildSelectingVolume (aPxPnt1, aPxPnt2);
+ }
+ else
+ {
+ aMgr->BuildSelectingVolume (aPxPnt1);
+ }
+ const gp_Pnt* aVerts = aMgr->GetVertices();
+ gp_Pnt aNearPnt = aMgr->GetNearPnt();
+ gp_Pnt aFarPnt = aMgr->GetFarPnt();
+ BRepBuilderAPI_MakePolygon aWireBldrs[4];
+
+ aWireBldrs[0].Add (gp_Pnt (aVerts[0].X(), aVerts[0].Y(), aVerts[0].Z()));
+ aWireBldrs[0].Add (gp_Pnt (aVerts[4].X(), aVerts[4].Y(), aVerts[4].Z()));
+ aWireBldrs[0].Add (gp_Pnt (aVerts[6].X(), aVerts[6].Y(), aVerts[6].Z()));
+ aWireBldrs[0].Add (gp_Pnt (aVerts[2].X(), aVerts[2].Y(), aVerts[2].Z()));
+ aWireBldrs[0].Add (gp_Pnt (aVerts[0].X(), aVerts[0].Y(), aVerts[0].Z()));
+
+ aWireBldrs[1].Add (gp_Pnt (aVerts[4].X(), aVerts[4].Y(), aVerts[4].Z()));
+ aWireBldrs[1].Add (gp_Pnt (aVerts[5].X(), aVerts[5].Y(), aVerts[5].Z()));
+ aWireBldrs[1].Add (gp_Pnt (aVerts[7].X(), aVerts[7].Y(), aVerts[7].Z()));
+ aWireBldrs[1].Add (gp_Pnt (aVerts[6].X(), aVerts[6].Y(), aVerts[6].Z()));
+ aWireBldrs[1].Add (gp_Pnt (aVerts[4].X(), aVerts[4].Y(), aVerts[4].Z()));
+
+ aWireBldrs[2].Add (gp_Pnt (aVerts[1].X(), aVerts[1].Y(), aVerts[1].Z()));
+ aWireBldrs[2].Add (gp_Pnt (aVerts[5].X(), aVerts[5].Y(), aVerts[5].Z()));
+ aWireBldrs[2].Add (gp_Pnt (aVerts[7].X(), aVerts[7].Y(), aVerts[7].Z()));
+ aWireBldrs[2].Add (gp_Pnt (aVerts[3].X(), aVerts[3].Y(), aVerts[3].Z()));
+ aWireBldrs[2].Add (gp_Pnt (aVerts[1].X(), aVerts[1].Y(), aVerts[1].Z()));
+
+ aWireBldrs[3].Add (gp_Pnt (aVerts[0].X(), aVerts[0].Y(), aVerts[0].Z()));
+ aWireBldrs[3].Add (gp_Pnt (aVerts[1].X(), aVerts[1].Y(), aVerts[1].Z()));
+ aWireBldrs[3].Add (gp_Pnt (aVerts[3].X(), aVerts[3].Y(), aVerts[3].Z()));
+ aWireBldrs[3].Add (gp_Pnt (aVerts[2].X(), aVerts[2].Y(), aVerts[2].Z()));
+ aWireBldrs[3].Add (gp_Pnt (aVerts[0].X(), aVerts[0].Y(), aVerts[0].Z()));
+
+ TopoDS_Compound aComp;
+ BRep_Builder aCompBuilder;
+ aCompBuilder.MakeCompound (aComp);
+ for (Standard_Integer aWireIdx = 0; aWireIdx < 4; ++aWireIdx)
+ {
+ aCompBuilder.Add (aComp, aWireBldrs[aWireIdx].Shape());
+ }
+ DBRep::Set ("c", aComp);
+
+ Handle(AIS_InteractiveObject) aCmp = new AIS_Shape (aComp);
+ aCmp->SetColor (Quantity_NOC_GREEN);
+ ViewerTest::Display ("c", aCmp, Standard_True, Standard_True);
+
+ Handle(Geom_CartesianPoint) aPnt1 = new Geom_CartesianPoint (aNearPnt);
+ Handle(Geom_CartesianPoint) aPnt2 = new Geom_CartesianPoint (aFarPnt);
+
+ Handle(AIS_Line) aLine = new AIS_Line (aPnt1, aPnt2);
+ ViewerTest::Display ("l", aLine, Standard_True, Standard_True);
+
+ if (toPrint)
+ {
+ theDI << "Near: " << aNearPnt.X() << " " << aNearPnt.Y() << " " << aNearPnt.Z() << "\n";
+ theDI << "Far: " << aFarPnt.X() << " " << aFarPnt.Y() << " " << aFarPnt.Z() << "\n";
+ }
+
+ return 0;
+}
+
+//=======================================================================
+//function : OCC26462
+//purpose :
+//=======================================================================
+static Standard_Integer OCC26462 (Draw_Interpretor& theDI, Standard_Integer /*theArgNb*/, const char** /*theArgVec*/)
+{
+ if (ViewerTest::GetAISContext().IsNull())
+ {
+ std::cerr << "Error: No opened context!\n";
+ return 1;
+ }
+
+ BRepPrimAPI_MakeBox aBuilder1 (gp_Pnt (10.0, 10.0, 0.0), 10.0, 10.0, 10.0);
+ BRepPrimAPI_MakeBox aBuilder2 (10.0, 10.0, 10.0);
+ Handle(AIS_InteractiveObject) aBox1 = new AIS_Shape (aBuilder1.Shape());
+ Handle(AIS_InteractiveObject) aBox2 = new AIS_Shape (aBuilder2.Shape());
+
+ const Handle(AIS_InteractiveContext) aCtx = ViewerTest::GetAISContext();
+ aCtx->OpenLocalContext();
+ aCtx->Display (aBox1, 0, 2);
+ aCtx->Display (aBox2, 0, 2);
+ ViewerTest::CurrentView()->FitAll();
+ aCtx->SetWidth (aBox1, 3);
+ aCtx->SetWidth (aBox2, 3);
+
+ aCtx->MoveTo (305, 322, ViewerTest::CurrentView());
+ aCtx->ShiftSelect();
+ aCtx->MoveTo (103, 322, ViewerTest::CurrentView());
+ aCtx->ShiftSelect();
+ if (aCtx->NbSelected() != 0)
+ {
+ theDI << "ERROR: no boxes must be selected!\n";
+ return 1;
+ }
+
+ aCtx->SetSelectionSensitivity (aBox1, 2, 5);
+
+ aCtx->MoveTo (305, 322, ViewerTest::CurrentView());
+ aCtx->ShiftSelect();
+ if (aCtx->NbSelected() != 1)
+ {
+ theDI << "ERROR: b1 was not selected\n";
+ return 1;
+ }
+ aCtx->MoveTo (103, 322, ViewerTest::CurrentView());
+ aCtx->ShiftSelect();
+ if (aCtx->NbSelected() != 1)
+ {
+ theDI << "ERROR: b2 is selected after b1's tolerance increased\n";
+ return 1;
+ }
+
+ return 0;
+}
+
void QABugs::Commands_19(Draw_Interpretor& theCommands) {
const char *group = "QABugs";
theCommands.Add ("OCC26448", "OCC26448: check method Prepend() of sequence", __FILE__, OCC26448, group);
theCommands.Add ("OCC26407", "OCC26407 result_name", __FILE__, OCC26407, group);
theCommands.Add ("OCC26485", "OCC26485 shape", __FILE__, OCC26485, group);
+ theCommands.Add ("OCC26553", "OCC26553 file_path", __FILE__, OCC26553, group);
+ theCommands.Add ("OCC26195",
+ "OCC26195: x1_pix y1_pix [x2_pix y2_pix] [toPrintPixelCoord 0|1]"
+ "\n\t\t: Draws rectangular selecting frustum defined by point selection in pixel coordinates"
+ "\n\t\t: [x1_pix, y1_pix] or rectangular selection in pixel coordinates [x1_pix, y1_pix,"
+ "\n\t\t: x2_pix, y2_pix]."
+ "\n\t\t: [toPrintPixelCoord 0|1] - prints 3d projection of pixel coordinate or center of"
+ "\n\t\t: selecting rectangle onto near and far view frustum planes",
+ __FILE__, OCC26195, group);
+ theCommands.Add ("OCC26462",
+ "OCC26462: Checks the ability to manage sensitivity of a particular selection mode in local context",
+ __FILE__, OCC26462, group);
return;
}