0031336: Modeling data - extend BRepPrimAPI_MakeBox with planar shape creation

-Create a new package BRepPreviewAPI, inherited from BRepPrimAPI to create both, valid and degenerative shapes
-Create a new class BRepPreviewAPI_MakeBox for working with a box
    Preview can be vertex, edge, rectangle or box
-BRepPrim_GWedge: in the case of non-valid data, the exception does not happen in the constructor, but at the moment of access to the shape
-BRepPrimAPI_MakeBox: myWedge is now not private, but protected, because used in  BRepPreviewAPI_MakeBox which inherits from BRepPrimAPI_MakeBox
-Add tests for checking of a creation a preview in tests/geometry/preview (vertex, edge, rectangle, box)
-Update a command "box": add new parameters
This commit is contained in:
sshutina
2020-02-10 16:32:56 +03:00
committed by bugmaster
parent 7e1c1e4869
commit 10ac040338
16 changed files with 584 additions and 51 deletions

View File

@@ -102,6 +102,56 @@ BRepPrimAPI_MakeBox::BRepPrimAPI_MakeBox(const gp_Ax2& Axes,
{
}
//=======================================================================
//function : Init
//purpose :
//=======================================================================
void BRepPrimAPI_MakeBox::Init (const Standard_Real theDX, const Standard_Real theDY, const Standard_Real theDZ)
{
myWedge = BRepPrim_Wedge (gp_Ax2 (pmin (gp_Pnt (0, 0, 0), theDX, theDY, theDZ), gp_Dir (0, 0, 1), gp_Dir (1, 0, 0)),
Abs (theDX), Abs (theDY), Abs (theDZ));
}
//=======================================================================
//function : Init
//purpose :
//=======================================================================
void BRepPrimAPI_MakeBox::Init (const gp_Pnt& thePnt,
const Standard_Real theDX,
const Standard_Real theDY,
const Standard_Real theDZ)
{
myWedge = BRepPrim_Wedge (gp_Ax2 (pmin (thePnt, theDX, theDY, theDZ), gp_Dir (0, 0, 1), gp_Dir (1, 0, 0)),
Abs (theDX), Abs (theDY), Abs (theDZ));
}
//=======================================================================
//function : Init
//purpose :
//=======================================================================
void BRepPrimAPI_MakeBox::Init (const gp_Pnt& thePnt1, const gp_Pnt& thePnt2)
{
myWedge = BRepPrim_Wedge (gp_Ax2 (pmin (thePnt1,thePnt2), gp_Dir (0, 0, 1), gp_Dir (1, 0, 0)),
Abs (thePnt2.X() - thePnt1.X()),
Abs (thePnt2.Y() - thePnt1.Y()),
Abs (thePnt2.Z() - thePnt1.Z()));
}
//=======================================================================
//function : Init
//purpose :
//=======================================================================
void BRepPrimAPI_MakeBox::Init (const gp_Ax2& theAxes,
const Standard_Real theDX,
const Standard_Real theDY,
const Standard_Real theDZ)
{
myWedge = BRepPrim_Wedge (theAxes, theDX, theDY, theDZ);
}
//=======================================================================
//function : Wedge