- Addition of `gp_Dir::D` and `gp_Dir2d::D` enums for standard directions (X, Y, Z, NX, NY, NZ)
- Constexpr/noexcept constructors for geometric primitives (circles, cones, cylinders, etc.)
- Enhanced axis placement classes with enum-based constructors
- Replacement of hardcoded direction values throughout the codebase
aSurf->Bounds(U1, U2, V1, V2);
Standard_Real aCenter = 0.5 * (U1 + U2);
gp_Trsf2d T;
- gp_Ax2d axis(gp_Pnt2d(aCenter, V1), gp_Dir2d(0., 1.));
+ gp_Ax2d axis(gp_Pnt2d(aCenter, V1), gp_Dir2d(gp_Dir2d::D::Y));
T.SetMirror(axis);
NCollection_Map<TopoDS_Shape, TopTools_ShapeMapHasher> aMap(101, new NCollection_IncAllocator);
for (ex.Init(start, TopAbs_EDGE); ex.More(); ex.Next())
// creation of the generatrix : Generatrix
Handle(Geom_Line) Ligne =
- new Geom_Line(gp_Pnt(start->Cylinder().Radius(), 0.0, 0.0), gp_Dir(0.0, 0.0, 1.0));
+ new Geom_Line(gp_Pnt(start->Cylinder().Radius(), 0.0, 0.0), gp_Dir(gp_Dir::D::Z));
GeomToIGES_GeomCurve GC(*this);
Handle(IGESData_IGESEntity) Generatrix = GC.TransferCurve(Ligne, V1, V2);
gp_Pnt gen1 = Ligne->Value(V1);
gp_Dir IGESGeom_CircularArc::Axis() const
{
- gp_Dir axis(0.0, 0.0, 1.0);
+ gp_Dir axis(gp_Dir::D::Z);
return axis;
}
gp_Dir IGESGeom_ConicArc::Axis() const
{
- gp_Dir axis(0.0, 0.0, 1.0);
+ gp_Dir axis(gp_Dir::D::Z);
return axis;
}
{
Standard_Real xc = -D / (2 * A);
Standard_Real yc = -E / (2 * C);
- gp_Dir2d d0(1, 0);
+ gp_Dir2d d0(gp_Dir2d::D::X);
gp_Dir2d d1(ent->StartPoint().X() - xc, ent->StartPoint().Y() - yc);
gp_Dir2d d2(ent->EndPoint().X() - xc, ent->EndPoint().Y() - yc);
Standard_Real t1 = d0.Angle(d1);
{
Standard_Real xc = -D / (2 * A);
Standard_Real yc = -E / (2 * C);
- gp_Dir2d d0(1, 0);
+ gp_Dir2d d0(gp_Dir2d::D::X);
gp_Dir2d d1(ent->StartPoint().X() - xc, ent->StartPoint().Y() - yc);
gp_Dir2d d2(ent->EndPoint().X() - xc, ent->EndPoint().Y() - yc);
Standard_Real t1 = d0.Angle(d1);
{
DeclareAndCast(IGESGeom_CircularArc, circ, generatrix);
gp_Pnt2d startpoint = circ->StartPoint();
- paramv -=
- ElCLib::Parameter(gp_Circ2d(gp_Ax2d(circ->Center(), gp_Dir2d(1, 0)), circ->Radius()),
- startpoint);
+ paramv -= ElCLib::Parameter(
+ gp_Circ2d(gp_Ax2d(circ->Center(), gp_Dir2d(gp_Dir2d::D::X)), circ->Radius()),
+ startpoint);
if (Surf->IsKind(STANDARD_TYPE(Geom_SphericalSurface)))
paramv += ShapeAnalysis::AdjustToPeriod(paramv, -M_PI, M_PI);
else if (Surf->IsKind(STANDARD_TYPE(Geom_ToroidalSurface)))
{
DeclareAndCast(IGESGeom_CircularArc, circ, directrix);
gp_Pnt2d startpoint = circ->StartPoint();
- paramu -=
- ElCLib::Parameter(gp_Circ2d(gp_Ax2d(circ->Center(), gp_Dir2d(1, 0)), circ->Radius()),
- startpoint);
+ paramu -= ElCLib::Parameter(
+ gp_Circ2d(gp_Ax2d(circ->Center(), gp_Dir2d(gp_Dir2d::D::X)), circ->Radius()),
+ startpoint);
paramu += ShapeAnalysis::AdjustToPeriod(paramu, 0, M_PI * 2);
}
}
GeomToStep_MakeAxis2Placement3d::GeomToStep_MakeAxis2Placement3d(
const StepData_Factors& theLocalFactors)
{
- gp_Ax2 A(gp_Pnt(0., 0., 0.), gp_Dir(0., 0., 1.), gp_Dir(1., 0., 0.));
+ gp_Ax2 A(gp_Pnt(0., 0., 0.), gp_Dir(gp_Dir::D::Z), gp_Dir(gp_Dir::D::X));
// le reste inchange
Handle(StepGeom_Axis2Placement3d) Axe = MakeAxis2Placement3d(A.Location(),
const gp_Trsf& T,
const StepData_Factors& theLocalFactors)
{
- gp_Ax2 A(gp_Pnt(0., 0., 0.), gp_Dir(0., 0., 1.), gp_Dir(1., 0., 0.));
+ gp_Ax2 A(gp_Pnt(0., 0., 0.), gp_Dir(gp_Dir::D::Z), gp_Dir(gp_Dir::D::X));
A.Transform(T);
// le reste inchange
Handle(Geom_Axis2Placement) aTargAP = StepToGeom::MakeAxis2Placement(aCS, aLocalFactors);
if (!aTargAP.IsNull())
{
- const gp_Ax3 ax3Orig(gp_Pnt(0., 0., 0), gp_Vec(0., 0., 1.), gp_Vec(1., 0., 0.));
+ const gp_Ax3 ax3Orig(gp_Pnt(0., 0., 0), gp_Dir(gp_Dir::D::Z), gp_Dir(gp_Dir::D::X));
const gp_Ax3 ax3Targ(aTargAP->Ax2());
if (ax3Targ.Location().SquareDistance(ax3Orig.Location()) < Precision::SquareConfusion()
&& ax3Targ.Direction().IsEqual(ax3Orig.Direction(), Precision::Angular())
{
// sln 22.10.2001. CTS23496: If problems with creation of axis direction occur default direction
// is used
- gp_Dir D(0., 0., 1.);
+ gp_Dir D(gp_Dir::D::Z);
if (SA->HasAxis())
{
Handle(Geom_Direction) D1 = MakeDirection(SA->Axis());
// sln 22.10.2001. CTS23496: If problems with creation of direction occur default direction is
// used (MakeLine(...) function)
- gp_Dir Ngp(0., 0., 1.);
+ gp_Dir Ngp(gp_Dir::D::Z);
if (SA->HasAxis())
{
Handle(Geom_Direction) D = MakeDirection(SA->Axis());
{
// sln 23.10.2001. CTS23496: If problems with creation of direction occur default direction is
// used
- gp_Dir2d Vxgp(1., 0.);
+ gp_Dir2d Vxgp(gp_Dir2d::D::X);
if (SA->HasRefDirection())
{
Handle(Geom2d_Direction) Vx = MakeDirection2d(SA->RefDirection());
Handle(Geom2d_CartesianPoint) CP = MakeCartesianPoint2d(SCTO->LocalOrigin(), theLocalFactors);
if (!CP.IsNull())
{
- gp_Dir2d D1(1., 0.);
+ gp_Dir2d D1(gp_Dir2d::D::X);
// sln 23.10.2001. CTS23496: If problems with creation of direction occur default direction is
// used
const Handle(StepGeom_Direction) A = SCTO->Axis1();
// sln 23.10.2001. CTS23496: If problems with creation of direction occur default direction is
// used
- gp_Dir D1(1., 0., 0.);
+ gp_Dir D1(gp_Dir::D::X);
const Handle(StepGeom_Direction) A1 = SCTO->Axis1();
if (!A1.IsNull())
{
D1 = D->Dir();
}
- gp_Dir D2(0., 1., 0.);
+ gp_Dir D2(gp_Dir::D::Y);
const Handle(StepGeom_Direction) A2 = SCTO->Axis2();
if (!A2.IsNull())
{
Handle(Poly_Triangulation) aTriangulation = new Poly_Triangulation(aNodes, aTriangles);
// Create a simple planar face
- gp_Pln aPlane(gp_Pnt(0.0, 0.0, 0.0), gp_Dir(0, 0, 1));
+ gp_Pln aPlane(gp_Pnt(0.0, 0.0, 0.0), gp_Dir(gp_Dir::D::Z));
BRepBuilderAPI_MakeFace aFaceBuilder(aPlane, 0.0, 10.0, 0.0, 10.0);
if (!aFaceBuilder.IsDone())
Handle(Poly_Triangulation) aTriangulation = new Poly_Triangulation(aNodes, aTriangles);
- gp_Pln aPlane(gp_Pnt(0.0, 0.0, 0.0), gp_Dir(0, 0, 1));
+ gp_Pln aPlane(gp_Pnt(0.0, 0.0, 0.0), gp_Dir(gp_Dir::D::Z));
BRepBuilderAPI_MakeFace aFaceBuilder(aPlane, 0.0, 5.0, 0.0, 5.0);
TopoDS_Face aTriangleFace = aFaceBuilder.Face();
Handle(Poly_Triangulation) aTriangulation = new Poly_Triangulation(aNodes, aTriangles);
// Create a simple planar face
- gp_Pln aPlane(gp_Pnt(0.0, 0.0, 0.0), gp_Dir(0, 0, 1));
+ gp_Pln aPlane(gp_Pnt(0.0, 0.0, 0.0), gp_Dir(gp_Dir::D::Z));
BRepBuilderAPI_MakeFace aFaceBuilder(aPlane, 0.0, 10.0, 0.0, 10.0);
if (!aFaceBuilder.IsDone())
{
/*
- gp_Dir Zmain (0,0,1);
- gp_Dir Xmain (1,0,0);
+ gp_Dir Zmain (gp_Dir::D::Z);
+ gp_Dir Xmain (gp_Dir::D::X);
gp_Dir Dturn;
{
try
{
- gp_Ax2 aLocalAxis(gp_Pnt(0., -0.5 * myHeight, 0.), gp_Dir(0., 1., 0.));
+ gp_Ax2 aLocalAxis(gp_Pnt(0., -0.5 * myHeight, 0.), gp_Dir(gp_Dir::D::Y));
BRepPrim_Cone aBuilder(aLocalAxis, myBottomRadius, 0., myHeight);
if (!myHasBottom)
myTShape = aBuilder.LateralFace().TShape();
{
try
{
- gp_Ax2 aLocalAxis(gp_Pnt(0., -0.5 * myHeight, 0.), gp_Dir(0., 1., 0.));
+ gp_Ax2 aLocalAxis(gp_Pnt(0., -0.5 * myHeight, 0.), gp_Dir(gp_Dir::D::Y));
BRepPrim_Cylinder aBuilder(aLocalAxis, myRadius, myHeight);
BRepPrim_Builder aShapeBuilder;
TopoDS_Shell aShell;
{
aCenter = BRep_Tool::Pnt(TopoDS::Vertex(aCntShape));
}
- gp_Ax2 anAxis = gp_Ax2(aCenter, gp_Dir(0, 0, 1), gp_Dir(1, 0, 0));
+ gp_Ax2 anAxis = gp_Ax2(aCenter, gp_Dir(gp_Dir::D::Z), gp_Dir(gp_Dir::D::X));
BRepPrimAPI_MakeSphere aMakeSphere(anAxis, aRadius);
aMakeSphere.Build();
if (StepU > confusion)
{
Standard_Real UPrm = myUMin + StepU / 2.;
- gp_Dir2d Dir(0., 1.);
+ gp_Dir2d Dir(gp_Dir2d::D::Y);
for (IIso = 1; IIso <= NbIsos; IIso++)
{
myUPrm(IIso) = UPrm;
if (StepV > confusion)
{
Standard_Real VPrm = myVMin + StepV / 2.;
- gp_Dir2d Dir(1., 0.);
+ gp_Dir2d Dir(gp_Dir2d::D::X);
for (IIso = 1; IIso <= NbIsos; IIso++)
{
myVPrm(IIso) = VPrm;
//=================================================================================================
Draw_Axis2D::Draw_Axis2D(const Draw_Color& col, const Standard_Integer Size)
- : myAxes(gp_Pnt2d(0, 0), gp_Dir2d(1, 0)),
+ : myAxes(gp_Pnt2d(0, 0), gp_Dir2d(gp_Dir2d::D::X)),
myColor(col),
mySize(Size)
{
//=================================================================================================
Draw_Axis2D::Draw_Axis2D(const gp_Pnt2d& p, const Draw_Color& col, const Standard_Integer Size)
- : myAxes(p, gp_Dir2d(1, 0)),
+ : myAxes(p, gp_Dir2d(gp_Dir2d::D::X)),
myColor(col),
mySize(Size)
{
}
else if (!strcmp("-Y+X", theType))
{
- const gp_Dir aD(0., 0., 1.);
+ const gp_Dir aD(gp_Dir::D::Z);
myMatrix.SetRotation(gp_Ax1(Pvise, aD), 0.5 * M_PI);
}
else if (!strcmp("-X-Y", theType))
{
- const gp_Dir aD(0., 0., 1.);
+ const gp_Dir aD(gp_Dir::D::Z);
myMatrix.SetRotation(gp_Ax1(Pvise, aD), M_PI);
}
else if (!strcmp("+Y-X", theType))
{
- const gp_Dir aD(0., 0., 1.);
+ const gp_Dir aD(gp_Dir::D::Z);
myMatrix.SetRotation(gp_Ax1(Pvise, aD), -0.5 * M_PI);
}
else if (!strcmp("+Y+X", theType))
{
- const gp_Dir aD1(0., 0., 1.);
- const gp_Dir aD2(0., 1., 0.);
+ const gp_Dir aD1(gp_Dir::D::Z);
+ const gp_Dir aD2(gp_Dir::D::Y);
myMatrix.SetRotation(gp_Ax1(Pvise, aD1), -0.5 * M_PI);
aRotation.SetRotation(gp_Ax1(Pvise, aD2), M_PI);
}
else if (!strcmp("-X+Y", theType))
{
- const gp_Dir aD(0., 1., 0.);
+ const gp_Dir aD(gp_Dir::D::Y);
myMatrix.SetRotation(gp_Ax1(Pvise, aD), M_PI);
}
else if (!strcmp("-Y-X", theType))
{
- const gp_Dir aD1(0., 0., 1.);
- const gp_Dir aD2(1., 0., 0.);
+ const gp_Dir aD1(gp_Dir::D::Z);
+ const gp_Dir aD2(gp_Dir::D::X);
myMatrix.SetRotation(gp_Ax1(Pvise, aD1), -0.5 * M_PI);
aRotation.SetRotation(gp_Ax1(Pvise, aD2), M_PI);
}
else if (!strcmp("+X-Y", theType))
{
- const gp_Dir aD(1., 0., 0.);
+ const gp_Dir aD(gp_Dir::D::X);
myMatrix.SetRotation(gp_Ax1(Pvise, aD), M_PI);
}
else if (!strcmp("+X+Z", theType))
{
- const gp_Dir aD(1., 0., 0.);
+ const gp_Dir aD(gp_Dir::D::X);
myMatrix.SetRotation(gp_Ax1(Pvise, aD), -0.5 * M_PI);
}
else if (!strcmp("-Z+X", theType))
{
- const gp_Dir aD1(1., 0., 0.);
- const gp_Dir aD2(0., 1., 0.);
+ const gp_Dir aD1(gp_Dir::D::X);
+ const gp_Dir aD2(gp_Dir::D::Y);
myMatrix.SetRotation(gp_Ax1(Pvise, aD1), -0.5 * M_PI);
aRotation.SetRotation(gp_Ax1(Pvise, aD2), -0.5 * M_PI);
}
else if (!strcmp("-X-Z", theType))
{
- const gp_Dir aD1(1., 0., 0.);
- const gp_Dir aD2(0., 1., 0.);
+ const gp_Dir aD1(gp_Dir::D::X);
+ const gp_Dir aD2(gp_Dir::D::Y);
myMatrix.SetRotation(gp_Ax1(Pvise, aD1), -0.5 * M_PI);
aRotation.SetRotation(gp_Ax1(Pvise, aD2), -M_PI);
}
else if (!strcmp("+Z-X", theType))
{
- const gp_Dir aD1(1., 0., 0.);
- const gp_Dir aD2(0., 1., 0.);
+ const gp_Dir aD1(gp_Dir::D::X);
+ const gp_Dir aD2(gp_Dir::D::Y);
myMatrix.SetRotation(gp_Ax1(Pvise, aD1), -0.5 * M_PI);
aRotation.SetRotation(gp_Ax1(Pvise, aD2), 0.5 * M_PI);
}
else if (!strcmp("+Z+X", theType))
{
- const gp_Dir aD1(1., 0., 0.);
- const gp_Dir aD2(0., 1., 0.);
+ const gp_Dir aD1(gp_Dir::D::X);
+ const gp_Dir aD2(gp_Dir::D::Y);
myMatrix.SetRotation(gp_Ax1(Pvise, aD1), 0.5 * M_PI);
aRotation.SetRotation(gp_Ax1(Pvise, aD2), 0.5 * M_PI);
}
else if (!strcmp("-X+Z", theType))
{
- const gp_Dir aD1(1., 0., 0.);
- const gp_Dir aD2(0., 1., 0.);
+ const gp_Dir aD1(gp_Dir::D::X);
+ const gp_Dir aD2(gp_Dir::D::Y);
myMatrix.SetRotation(gp_Ax1(Pvise, aD1), 0.5 * M_PI);
aRotation.SetRotation(gp_Ax1(Pvise, aD2), M_PI);
}
else if (!strcmp("-Z-X", theType))
{
- const gp_Dir aD1(1., 0., 0.);
- const gp_Dir aD2(0., 1., 0.);
+ const gp_Dir aD1(gp_Dir::D::X);
+ const gp_Dir aD2(gp_Dir::D::Y);
myMatrix.SetRotation(gp_Ax1(Pvise, aD1), 0.5 * M_PI);
aRotation.SetRotation(gp_Ax1(Pvise, aD2), -0.5 * M_PI);
}
else if (!strcmp("+X-Z", theType))
{
- const gp_Dir aD(1., 0., 0.);
+ const gp_Dir aD(gp_Dir::D::X);
myMatrix.SetRotation(gp_Ax1(Pvise, aD), 0.5 * M_PI);
}
else if (!strcmp("+Y+Z", theType))
{
- const gp_Dir aD1(0., 1., 0.);
- const gp_Dir aD2(1., 0., 0.);
+ const gp_Dir aD1(gp_Dir::D::Y);
+ const gp_Dir aD2(gp_Dir::D::X);
myMatrix.SetRotation(gp_Ax1(Pvise, aD1), -0.5 * M_PI);
aRotation.SetRotation(gp_Ax1(Pvise, aD2), -0.5 * M_PI);
}
else if (!strcmp("-Z+Y", theType))
{
- const gp_Dir aD(0., 1., 0.);
+ const gp_Dir aD(gp_Dir::D::Y);
myMatrix.SetRotation(gp_Ax1(Pvise, aD), -0.5 * M_PI);
}
else if (!strcmp("-Y-Z", theType))
{
- const gp_Dir aD1(0., 1., 0.);
- const gp_Dir aD2(1., 0., 0.);
+ const gp_Dir aD1(gp_Dir::D::Y);
+ const gp_Dir aD2(gp_Dir::D::X);
myMatrix.SetRotation(gp_Ax1(Pvise, aD1), -0.5 * M_PI);
aRotation.SetRotation(gp_Ax1(Pvise, aD2), 0.5 * M_PI);
}
else if (!strcmp("+Z-Y", theType))
{
- const gp_Dir aD1(0., 1., 0.);
- const gp_Dir aD2(1., 0., 0.);
+ const gp_Dir aD1(gp_Dir::D::Y);
+ const gp_Dir aD2(gp_Dir::D::X);
myMatrix.SetRotation(gp_Ax1(Pvise, aD1), -0.5 * M_PI);
aRotation.SetRotation(gp_Ax1(Pvise, aD2), M_PI);
}
else if (!strcmp("+Z+Y", theType))
{
- const gp_Dir aD(0., 1., 0.);
+ const gp_Dir aD(gp_Dir::D::Y);
myMatrix.SetRotation(gp_Ax1(Pvise, aD), 0.5 * M_PI);
}
else if (!strcmp("-Y+Z", theType))
{
- const gp_Dir aD1(0., 1., 0.);
- const gp_Dir aD2(1., 0., 0.);
+ const gp_Dir aD1(gp_Dir::D::Y);
+ const gp_Dir aD2(gp_Dir::D::X);
myMatrix.SetRotation(gp_Ax1(Pvise, aD1), 0.5 * M_PI);
aRotation.SetRotation(gp_Ax1(Pvise, aD2), -0.5 * M_PI);
}
else if (!strcmp("-Z-Y", theType))
{
- const gp_Dir aD1(0., 1., 0.);
- const gp_Dir aD2(1., 0., 0.);
+ const gp_Dir aD1(gp_Dir::D::Y);
+ const gp_Dir aD2(gp_Dir::D::X);
myMatrix.SetRotation(gp_Ax1(Pvise, aD1), 0.5 * M_PI);
aRotation.SetRotation(gp_Ax1(Pvise, aD2), M_PI);
}
else if (!strcmp("+Y-Z", theType))
{
- const gp_Dir aD1(0., 1., 0.);
- const gp_Dir aD2(1., 0., 0.);
+ const gp_Dir aD1(gp_Dir::D::Y);
+ const gp_Dir aD2(gp_Dir::D::X);
myMatrix.SetRotation(gp_Ax1(Pvise, aD1), 0.5 * M_PI);
aRotation.SetRotation(gp_Ax1(Pvise, aD2), 0.5 * M_PI);
}
else if (!strcmp("AXON", theType))
{
- const gp_Dir aD1(1., 0., 0.);
- const gp_Dir aD2(0., 0., 1.);
+ const gp_Dir aD1(gp_Dir::D::X);
+ const gp_Dir aD2(gp_Dir::D::Z);
myMatrix.SetRotation(gp_Ax1(Pvise, aD1), -0.25 * M_PI);
aRotation.SetRotation(gp_Ax1(Pvise, aD2), -0.25 * M_PI);
}
else if (!strcmp("PERS", theType))
{
- const gp_Dir aD1(1., 0., 0.);
- const gp_Dir aD2(0., 0., 1.);
+ const gp_Dir aD1(gp_Dir::D::X);
+ const gp_Dir aD2(gp_Dir::D::Z);
myMatrix.SetRotation(gp_Ax1(Pvise, aD1), -0.25 * M_PI);
aRotation.SetRotation(gp_Ax1(Pvise, aD2), -0.25 * M_PI);
try
{
OCC_CATCH_SIGNALS
- gp_Dir slabDir(0, 0, 1);
+ gp_Dir slabDir(gp_Dir::D::Z);
gp_Vec slabVect(slabDir);
slabVect *= slabThick;
int index = 1;
gp_Pnt P1(0, 0, 0);
- gp_Dir D1(0, 0, 1);
+ gp_Dir D1(gp_Dir::D::Z);
gp_Ax2 A1(P1, D1);
BRepPrimAPI_MakeCylinder cylMakerIn(A1, 40, 110);
TopoDS_Shape cylOut = cylMakerOut.Shape();
gp_Pnt P2(0, 0, 0);
- gp_Dir D2(0, 0, -1);
+ gp_Dir D2(gp_Dir::D::NZ);
gp_Ax2 A2(P2, D2);
BRepPrimAPI_MakeCone conMakerIn(A2, 40, 60, 110);
int index = 1;
- gp_Dir xDir(1, 0, 0);
- gp_Dir zDir(0, 0, 1);
+ gp_Dir xDir(gp_Dir::D::X);
+ gp_Dir zDir(gp_Dir::D::Z);
gp_Pnt cen1(0, 0, 0);
gp_Ax2 cor1(cen1, zDir, xDir);
BRepPrimAPI_MakeBox boxMaker(cor1, 100, 100, 100);
int index = 1;
gp_Pnt P1(100, 0, 0);
- gp_Dir D1(-1, 0, 0);
+ gp_Dir D1(gp_Dir::D::NX);
gp_Ax2 A1(P1, D1);
BRepPrimAPI_MakeCylinder mkCyl(A1, 20, 100);
TopoDS_Shape cyl = mkCyl.Shape();
try
{
OCC_CATCH_SIGNALS
- gp_Dir slabDir(0, 0, 1);
+ gp_Dir slabDir(gp_Dir::D::Z);
gp_Vec slabVect(slabDir);
slabVect *= slabThick;
DBRep::Set("Face", sol1_);
- gp_Ax1 ax1_(gp_Pnt(0., 0., -100.), gp_Dir(0., 0., 1.));
-
Standard_Real x = 0., y = 0., z = -80.;
BRepPrimAPI_MakeBox box(gp_Pnt(x, y, z), gp_Pnt(x + 150, y + 200, z + 200));
// 0.1, 0.1 , 0.4, 0.4 );
TopoDS_Shape wedge1 = BRepPrimAPI_MakeWedge(0.5, 0.05, 0.5, 0.1, 0.1, 0.4, 0.4).Shape();
- gp_Trsf rotate = gce_MakeRotation(gp_Pnt(0.0, 0.0, 0.0), gp_Dir(1.0, 0.0, 0.0), 1.570795);
+ gp_Trsf rotate = gce_MakeRotation(gp_Pnt(0.0, 0.0, 0.0), gp_Dir(gp_Dir::D::X), 1.570795);
gp_Trsf translate = gce_MakeTranslation(gp_Pnt(0.0, -0.5, 0.0), gp_Pnt(0.25, 0.25, 0.5));
// 0.1, 0.1 , 0.4, 0.4 );
TopoDS_Shape wedge2 = BRepPrimAPI_MakeWedge(0.5, 0.3, 0.5, 0.1, 0.1, 0.4, 0.4).Shape();
- gp_Trsf rotate2 = gce_MakeRotation(gp_Pnt(0.0, 0.0, 0.0), gp_Dir(1.0, 0.0, 0.0), 1.570795 * 3.0);
+ gp_Trsf rotate2 = gce_MakeRotation(gp_Pnt(0.0, 0.0, 0.0), gp_Dir(gp_Dir::D::X), 1.570795 * 3.0);
gp_Trsf translate2 = gce_MakeTranslation(gp_Pnt(0.0, 0.0, 0.0), gp_Pnt(0.25, 0.25, 0.5));
Standard_Integer CaseNumber = Draw::Atoi(argv[1]);
- // BRepPrimAPI_MakeCylinder o_mc1 (gp_Ax2 (gp_Pnt(0,-50,140), gp_Dir(1,0,0)), 50,1000);
- gp_Dir myDir(1, 0, 0);
+ // BRepPrimAPI_MakeCylinder o_mc1 (gp_Ax2 (gp_Pnt(0,-50,140), gp_Dir(gp_Dir::D::X)), 50,1000);
+ gp_Dir myDir(gp_Dir::D::X);
gp_Pnt myPnt(0, -50, 140);
gp_Ax2 myAx2(myPnt, myDir);
BRepPrimAPI_MakeCylinder o_mc1(myAx2, 50, 1000);
TopoDS_Shape theCommon = BRepAlgoAPI_Common(theBox, theSphere);
TopoDS_Shape theCylinder1 =
- BRepPrimAPI_MakeCylinder(gp_Ax2(gp_Pnt(0, 0, -10), gp_Dir(0, 0, 1)), 3, 20).Shape();
+ BRepPrimAPI_MakeCylinder(gp_Ax2(gp_Pnt(0, 0, -10), gp_Dir(gp_Dir::D::Z)), 3, 20).Shape();
TopoDS_Shape theCylinder2 =
- BRepPrimAPI_MakeCylinder(gp_Ax2(gp_Pnt(-10, 0, 0), gp_Dir(1, 0, 0)), 3, 20).Shape();
+ BRepPrimAPI_MakeCylinder(gp_Ax2(gp_Pnt(-10, 0, 0), gp_Dir(gp_Dir::D::X)), 3, 20).Shape();
TopoDS_Shape theCylinder3 =
- BRepPrimAPI_MakeCylinder(gp_Ax2(gp_Pnt(0, -10, 0), gp_Dir(0, 1, 0)), 3, 20).Shape();
+ BRepPrimAPI_MakeCylinder(gp_Ax2(gp_Pnt(0, -10, 0), gp_Dir(gp_Dir::D::Y)), 3, 20).Shape();
TopoDS_Shape theTmp1 = OCC1077_cut_blend(theCommon, theCylinder1, 0.7);
Handle(ShapeFix_Shape) fixer = new ShapeFix_Shape(theTmp1);
fixer->Perform();
{
Standard_Character abuf[16];
- Handle(Geom2d_Line) aLine = new Geom2d_Line(gp_Pnt2d(100, 0), gp_Dir2d(-1, 0));
+ Handle(Geom2d_Line) aLine = new Geom2d_Line(gp_Pnt2d(100, 0), gp_Dir2d(gp_Dir2d::D::NX));
Sprintf(abuf, "line");
Standard_CString st = abuf;
DrawTrSurf::Set(st, aLine);
// Circle
gp_Pnt P(10, 10, 10);
- gp_Dir V(1, 0, 0);
+ gp_Dir V(gp_Dir::D::X);
gp_Ax2 aAx2(P, V);
Handle(Geom_Circle) ahCircle = new Geom_Circle(aAx2, 20);
context->Display(new AIS_Shape(E2), Standard_True);
gp_Pnt plnpt(0, 0, 0);
- gp_Dir plndir(0, 0, 1);
+ gp_Dir plndir(gp_Dir::D::Z);
Handle(Geom_Plane) pln = new Geom_Plane(plnpt, plndir);
Handle(PrsDim_AngleDimension) anAngleDimension =
TopoDS_Vertex V7 = BRepBuilderAPI_MakeVertex(p7);
TopoDS_Vertex V8 = BRepBuilderAPI_MakeVertex(p8);
gp_Pnt plnpt(0, 0, 0);
- gp_Dir plndir(0, 0, 1);
+ gp_Dir plndir(gp_Dir::D::Z);
Handle(Geom_Plane) pln = new Geom_Plane(plnpt, plndir);
Handle(Prs3d_DimensionAspect) anAspect = new Prs3d_DimensionAspect();
anAspect->MakeArrows3d(Standard_True);
/***************************************/
// dimension "R 88.58"
/***************************************/
- gp_Circ cir = gp_Circ(gp_Ax2(gp_Pnt(191.09, -88.58, 0), gp_Dir(0, 0, 1)), 88.58);
+ gp_Circ cir = gp_Circ(gp_Ax2(gp_Pnt(191.09, -88.58, 0), gp_Dir(gp_Dir::D::Z)), 88.58);
TopoDS_Edge E1 = BRepBuilderAPI_MakeEdge(cir, gp_Pnt(191.09, 0, 0.), gp_Pnt(191.09, -177.16, 0.));
Handle(PrsDim_RadiusDimension) dim1 = new PrsDim_RadiusDimension(E1);
dim1->SetDimensionAspect(anAspect);
/***************************************/
// dimension "R 43.80"
/***************************************/
- gp_Circ cir1 = gp_Circ(gp_Ax2(gp_Pnt(191.09, -88.58, 0), gp_Dir(0, 0, 1)), 43.80);
+ gp_Circ cir1 = gp_Circ(gp_Ax2(gp_Pnt(191.09, -88.58, 0), gp_Dir(gp_Dir::D::Z)), 43.80);
TopoDS_Edge E_cir1 = BRepBuilderAPI_MakeEdge(cir1);
dim1 = new PrsDim_RadiusDimension(E_cir1);
anAspect->ArrowAspect()->SetLength(60.0);
/***************************************/
// dimension "R 17.86"
/***************************************/
- gp_Circ cir2 = gp_Circ(gp_Ax2(gp_Pnt(566.11, -88.58, 0), gp_Dir(0, 0, -1)), 17.86);
+ gp_Circ cir2 = gp_Circ(gp_Ax2(gp_Pnt(566.11, -88.58, 0), gp_Dir(gp_Dir::D::NZ)), 17.86);
TopoDS_Edge E_cir2 = BRepBuilderAPI_MakeEdge(cir2);
dim1 = new PrsDim_RadiusDimension(E_cir2);
anAspect->ArrowAspect()->SetLength(40.0);
static Standard_Integer OCC353(Draw_Interpretor& di, Standard_Integer, const char**)
{
- gp_Ax2 ax21(gp_Pnt(100, 0, 0), gp_Dir(0, 0, 1));
+ gp_Ax2 ax21(gp_Pnt(100, 0, 0), gp_Dir(gp_Dir::D::Z));
Handle(Geom_Circle) h_cir1 = new Geom_Circle(ax21, 25);
- gp_Ax2 ax22(gp_Pnt(-100, 0, 0), gp_Dir(0, 0, 1));
+ gp_Ax2 ax22(gp_Pnt(-100, 0, 0), gp_Dir(gp_Dir::D::Z));
Handle(Geom_Circle) h_cir2 = new Geom_Circle(ax22, 25);
- gp_Pln refpln(gp_Pnt(0, 0, 0), gp_Dir(0, 0, 1));
+ gp_Pln refpln(gp_Pnt(0, 0, 0), gp_Dir(gp_Dir::D::Z));
Handle(Geom2d_Curve) cir2d1 = GeomAPI::To2d(h_cir1, refpln);
Handle(Geom2d_Curve) cir2d2 = GeomAPI::To2d(h_cir2, refpln);
gp_Pnt p(0, 0, 2);
gp_Trsf t1, t2;
- t1.SetRotation(gp_Ax1(p, gp_Dir(0, 1, 0)), -0.49328285294022267);
- t2.SetRotation(gp_Ax1(p, gp_Dir(0, 0, 1)), 0.87538474718473880);
+ t1.SetRotation(gp_Ax1(p, gp_Dir(gp_Dir::D::Y)), -0.49328285294022267);
+ t2.SetRotation(gp_Ax1(p, gp_Dir(gp_Dir::D::Z)), 0.87538474718473880);
gp_Trsf tComp = t2 * t1;
}
gp_Pnt aP3D(-1725.97, 843.257, -4.22741e-013);
- gp_Ax2 aAxis(gp_Pnt(0, 843.257, 0), gp_Dir(0, -1, 0), gp::DX());
+ gp_Ax2 aAxis(gp_Pnt(0, 843.257, 0), gp_Dir(gp_Dir::D::NY), gp::DX());
Handle(Geom_Circle) aCircle = new Geom_Circle(aAxis, 1725.9708621929999);
GeomAdaptor_Curve aC3D(aCircle);
{
// Curves
Handle(Geom2d_Circle) aCircle1 =
- new Geom2d_Circle(gp_Ax22d(gp_Pnt2d(25, -25), gp_Dir2d(1, 0), gp_Dir2d(-0, 1)), 155);
+ new Geom2d_Circle(gp_Ax22d(gp_Pnt2d(25, -25), gp_Dir2d(gp_Dir2d::D::X), gp_Dir2d(-0, 1)), 155);
Handle(Geom2d_Circle) aCircle2 =
- new Geom2d_Circle(gp_Ax22d(gp_Pnt2d(25, 25), gp_Dir2d(1, 0), gp_Dir2d(-0, 1)), 155);
+ new Geom2d_Circle(gp_Ax22d(gp_Pnt2d(25, 25), gp_Dir2d(gp_Dir2d::D::X), gp_Dir2d(-0, 1)), 155);
Handle(Geom2d_TrimmedCurve) aTrim[2] = {
new Geom2d_TrimmedCurve(aCircle1, 1.57079632679490, 2.97959469729228),
Bnd_Box aBndBox;
BRepBndLib::Add(aShape, aBndBox);
- gp_Dir aDir(0., 1., 0.);
+ gp_Dir aDir(gp_Dir::D::Y);
const int N = 250;
Standard_Real xMin = aBndBox.CornerMin().X();
Standard_Real zMin = aBndBox.CornerMin().Z();
Standard_Real angle)
{
// Use maximum face-to-taper z-offset.
- const gp_Pln neutral_plane(gp_Ax3(gp_Pnt(0.0, 0.0, 140.0), gp_Dir(0.0, 0.0, 1.0)));
+ const gp_Pln neutral_plane(gp_Ax3(gp_Pnt(0.0, 0.0, 140.0), gp_Dir(gp_Dir::D::Z)));
// Draft angle needs to be in radians, and flipped to adhere to our own (arbitrary) draft
// angle definition.
// Add face to draft. The first argument indicates that all material added/removed during
// drafting is located below the neutral plane
BRepOffsetAPI_DraftAngle drafter(shape);
- drafter.Add(face_a, gp_Dir(0.0, 0.0, -1.0), draft_angle, neutral_plane);
- drafter.Add(face_b, gp_Dir(0.0, 0.0, -1.0), draft_angle, neutral_plane);
+ drafter.Add(face_a, gp_Dir(gp_Dir::D::NZ), draft_angle, neutral_plane);
+ drafter.Add(face_b, gp_Dir(gp_Dir::D::NZ), draft_angle, neutral_plane);
drafter.Build();
return drafter.Shape();
theDI << "Error in gp_Vec2d. Vectors should be normal.\n";
}
- const gp_Dir2d aD1(1.0, 0.0);
- const gp_Dir2d aD2(0.0, -1.0);
+ const gp_Dir2d aD1(gp_Dir2d::D::X);
+ const gp_Dir2d aD2(gp_Dir2d::D::NY);
if (aD1.IsNormal(aD2, Precision::Angular()))
{
// OR
// 0 * X^2 + 1 * Y^2 + 2*0*X*Y + 2*(-1)*X + 2*(-3)*Y + 10 = 0.
- Parab2d_Bug26747::Axes = gp_Ax2d(gp_Pnt2d(0.0, 3.0), gp_Dir2d(0.0, 1.0));
+ Parab2d_Bug26747::Axes = gp_Ax2d(gp_Pnt2d(0.0, 3.0), gp_Dir2d(gp_Dir2d::D::Y));
Parab2d_Bug26747::FocusPoint.SetCoord(1.0, 3.0);
Parab2d_Bug26747::FocalLength = 0.5;
// A * X^2 + B * (Y^2) + 2*C*(X*Y) + 2*D*X + 2*E*Y + F = 0.
// 0 * X^2 + 1 * (Y^2) + 2*0*(X*Y) + 2*1*X + 2*(-3)*Y + 10 = 0.
- Parab2d_Bug26747::Axes = gp_Ax2d(gp_Pnt2d(0.0, 0.0), gp_Dir2d(0.0, 1.0));
+ Parab2d_Bug26747::Axes = gp_Ax2d(gp_Pnt2d(0.0, 0.0), gp_Dir2d(gp_Dir2d::D::Y));
Parab2d_Bug26747::FocusPoint.SetCoord(-1.0, 3.0);
Parab2d_Bug26747::FocalLength = 0.5;
// A * X^2 + B * (Y^2) + 2*C*(X*Y) + 2*D*X + 2*E*Y + F = 0.
// 0 * X^2 + 1 * (Y^2) + 2*0*(X*Y) + 2*0*X + 2*(-3)*Y + 9 = 0.
- Parab2d_Bug26747::Axes = gp_Ax2d(gp_Pnt2d(0.0, 0.0), gp_Dir2d(0.0, 1.0));
+ Parab2d_Bug26747::Axes = gp_Ax2d(gp_Pnt2d(0.0, 0.0), gp_Dir2d(gp_Dir2d::D::Y));
Parab2d_Bug26747::FocusPoint.SetCoord(0.0, 3.0);
Parab2d_Bug26747::FocalLength = 0.0;
Handle(Geom2d_BSplineCurve) c = anInterpolation.Curve();
- gp_Pln pln(gp_Ax3(gp_Pnt(), gp_Dir(1, 0, 0), gp_Dir(0, -1, 0)));
+ gp_Pln pln{gp_Ax3(gp_Pnt(), gp_Dir(gp_Dir::D::X), gp_Dir(gp_Dir::D::NY))};
Handle(Geom_BSplineCurve) c3d = Handle(Geom_BSplineCurve)::DownCast(GeomAPI::To3d(c, pln));
curve1 = c3d;
anInterpolation.Perform();
Handle(Geom2d_BSplineCurve) c = anInterpolation.Curve();
- gp_Pln pln(gp_Ax3(gp_Pnt(), gp_Dir(0, -1, 0), gp_Dir(-1, 0, 0)));
+ gp_Pln pln{gp_Ax3(gp_Pnt(), gp_Dir(gp_Dir::D::NY), gp_Dir(gp_Dir::D::NX))};
Handle(Geom_BSplineCurve) c3d = Handle(Geom_BSplineCurve)::DownCast(GeomAPI::To3d(c, pln));
curve2 = c3d;
}
static Standard_Integer OCC29289(Draw_Interpretor&, Standard_Integer, const char**)
{
- gp_Elips2d e1(gp_Ax2d(gp_Pnt2d(0., 0.), gp_Dir2d(1., 0)), 2., 1.);
+ gp_Elips2d e1(gp_Ax2d(gp_Pnt2d(0., 0.), gp_Dir2d(gp_Dir2d::D::X)), 2., 1.);
Handle(Geom2d_Ellipse) Ge1 = new Geom2d_Ellipse(e1);
gp_Elips2d e2(gp_Ax2d(gp_Pnt2d(0.5, 0.5), gp_Dir2d(1., 1.)), 2., 1.);
Handle(Geom2d_Ellipse) Ge2 = new Geom2d_Ellipse(e2);
const Standard_Real r45 = M_PI / 4.0, r225 = 3.0 * M_PI / 4.0;
GC_MakeArcOfCircle arcMaker(
- gp_Circ(gp_Ax2(gp_Pnt(0.0, 0.0, 0.0), gp_Dir(0.0, 0.0, 1.0), gp_Dir(1.0, 0.0, 0.0)), 1.0),
+ gp_Circ(gp_Ax2(gp_Pnt(0.0, 0.0, 0.0), gp_Dir(gp_Dir::D::Z), gp_Dir(gp_Dir::D::X)), 1.0),
r45,
r225,
Standard_True);
myAIScontext->Display(Ve1, Standard_False);
myAIScontext->Display(Ve2, Standard_False);
- Handle(Geom_Plane) Plane1 = new Geom_Plane(gp_Pnt(0, 0, 0), gp_Dir(0, 0, 1));
+ Handle(Geom_Plane) Plane1 = new Geom_Plane(gp_Pnt(0, 0, 0), gp_Dir(gp_Dir::D::Z));
TCollection_ExtendedString Ext1("Dim1");
Handle(PrsDim_LengthDimension) Dim1 = new PrsDim_LengthDimension(V1, V2, Plane1->Pln());
Dim1->SetCustomValue(Draw::Atof(a[2]));
}
gp_Pnt pt3d(0, 20, 150);
- gp_Ax2 anAx2(gp_Pnt(0, 0, 0), gp_Dir(1, 0, 0), gp_Dir(0, 0, 1));
+ gp_Ax2 anAx2(gp_Pnt(0, 0, 0), gp_Dir(gp_Dir::D::X), gp_Dir(gp_Dir::D::Z));
gp_Circ circ(anAx2, 50.0);
Handle(Geom_Circle) gcir = new Geom_Circle(circ);
- Handle(Geom_Plane) pln = new Geom_Plane(gp_Ax3(gp_Pnt(0, 0, 0), gp_Dir(1, 0, 0)));
+ Handle(Geom_Plane) pln = new Geom_Plane(gp_Ax3(gp_Pnt(0, 0, 0), gp_Dir(gp_Dir::D::X)));
Handle(Geom2d_Curve) gcir1 = GeomAPI::To2d(gcir, pln->Pln());
TopoDS_Shape sh1 = BRepBuilderAPI_MakeEdge(gcir1, pln).Shape();
Handle(AIS_Shape) ais1 = new AIS_Shape(sh1);
return -1;
}
- gp_Ax2 Cone_Ax;
double R1 = 8, R2 = 16;
gp_Pnt P1(0, 0, 20), P2(0, 0, 45);
Handle(Geom_RectangularTrimmedSurface) S = GC_MakeTrimmedCone(P1, P2, R1, R2).Value();
return 1;
}
- gp_Ax2 Ax2 = gp_Ax2(gp_Pnt(0, 621, 78), gp_Dir(0, 1, 0));
+ gp_Ax2 Ax2 = gp_Ax2(gp_Pnt(0, 621, 78), gp_Dir(gp_Dir::D::Y));
BRepPrimAPI_MakeCylinder cyl(Ax2, 260, 150);
- // BRepPrimAPI_MakeCylinder cyl(gp_Ax2(gp_Pnt(0, 621, 78), gp_Dir(0, 1,0)), 260, 150);
+ // BRepPrimAPI_MakeCylinder cyl(gp_Ax2(gp_Pnt(0, 621, 78), gp_Dir(gp_Dir::D::Y)), 260, 150);
TopoDS_Shape sh1 = cyl.Shape();
DBRep::Set("sh1", sh1);
BRepPrimAPI_MakeHalfSpace half(shell, gp_Pnt(0, 0, 20));
const TopoDS_Solid& sol = half.Solid();
- gp_Ax2 anAx2(gp_Pnt(-800.0, 0.0, 0), gp_Dir(0, 0, -1));
+ gp_Ax2 anAx2(gp_Pnt(-800.0, 0.0, 0), gp_Dir(gp_Dir::D::NZ));
BRepPrimAPI_MakeCylinder cyl(anAx2, 50, 300);
TopoDS_Shape sh = cyl.Shape();
static Standard_Integer BUC60857(Draw_Interpretor& di, Standard_Integer /*argc*/, const char** argv)
{
- gp_Ax2 Cone_Ax;
double R1 = 8, R2 = 16;
gp_Pnt P1(0, 0, 20), P2(0, 0, 45);
}
case 1: {
aPrims->AddVertex(gp_Pnt(5.0, 0.0, 0.0),
- gp_Dir(0.0, 0.0, 1.0),
+ gp_Dir(gp_Dir::D::Z),
Quantity_Color(Quantity_NOC_RED));
aPrims->AddVertex(gp_Pnt(5.0, 5.0, 1.0),
gp_Dir(1.0, 1.0, 1.0),
gp_Dir(1.0, 1.0, 1.0),
Quantity_Color(Quantity_NOC_BLUE1));
aPrims->AddVertex(gp_Pnt(10.0, 5.0, -1.0),
- gp_Dir(0.0, 0.0, -1.0),
+ gp_Dir(gp_Dir::D::NZ),
Quantity_Color(Quantity_NOC_GREEN));
aPrims->AddVertex(gp_Pnt(10.0, 0.0, 1.0),
gp_Dir(0.0, 1.0, 1.0),
if (uiso)
{
C = TS->UIso(p);
- L = new Geom2d_Line(gp_Pnt2d(p, 0), gp_Dir2d(0, 1));
+ L = new Geom2d_Line(gp_Pnt2d(p, 0), gp_Dir2d(gp_Dir2d::D::Y));
}
else
{
C = TS->VIso(p);
- L = new Geom2d_Line(gp_Pnt2d(0, p), gp_Dir2d(1, 0));
+ L = new Geom2d_Line(gp_Pnt2d(0, p), gp_Dir2d(gp_Dir2d::D::X));
}
TopoDS_Edge E = BRepBuilderAPI_MakeEdge(C, p1, p2);
#include <BRepTest.hxx>
Standard_IMPORT Draw_Viewer dout;
-static gp_Ax3 theHelixAxis(gp_Pnt(0., 0., 0), gp_Dir(0., 0., 1.), gp_Dir(1., 0., 0.));
+static gp_Ax3 theHelixAxis(gp_Pnt(0., 0., 0), gp_Dir(gp_Dir::D::Z), gp_Dir(gp_Dir::D::X));
static Standard_Integer comphelix(Draw_Interpretor&, Standard_Integer, const char**);
static Standard_Integer helix(Draw_Interpretor&, Standard_Integer, const char**);
{
gp_Pnt location;
location = gp_Pnt(0.0, 0.0, 0.0);
- gp_Dir main_direction(0.0, 0.0, 1.0);
+ gp_Dir main_direction(gp_Dir::D::Z);
- gp_Dir x_direction(1.0, 0.0, 0.0);
+ gp_Dir x_direction(gp_Dir::D::X);
gp_Ax2 mainaxis(location, main_direction);
mainaxis.SetXDirection(x_direction);
if (!strcmp(theArgVec[0], "qcircle"))
{
if (theArgsNb == 5 || theArgsNb == 6)
- aResult2d = new Geom2d_Circle(
- gp_Ax22d(gp_Pnt2d(Draw::Atof(theArgVec[2]), Draw::Atof(theArgVec[3])), gp_Dir2d(1, 0)),
- Draw::Atof(theArgVec[4]));
+ aResult2d =
+ new Geom2d_Circle(gp_Ax22d(gp_Pnt2d(Draw::Atof(theArgVec[2]), Draw::Atof(theArgVec[3])),
+ gp_Dir2d(gp_Dir2d::D::X)),
+ Draw::Atof(theArgVec[4]));
else if (theArgsNb == 7 || theArgsNb == 8)
aResult2d =
new Geom2d_Circle(gp_Ax22d(gp_Pnt2d(Draw::Atof(theArgVec[2]), Draw::Atof(theArgVec[3])),
else if (!strcmp(a[0], "circle"))
{
if (n == 5)
- result2d =
- new Geom2d_Circle(gp_Ax22d(gp_Pnt2d(Draw::Atof(a[2]), Draw::Atof(a[3])), gp_Dir2d(1, 0)),
- Draw::Atof(a[4]));
+ result2d = new Geom2d_Circle(
+ gp_Ax22d(gp_Pnt2d(Draw::Atof(a[2]), Draw::Atof(a[3])), gp_Dir2d(gp_Dir2d::D::X)),
+ Draw::Atof(a[4]));
else if (n == 6)
result = new Geom_Circle(
- gp_Ax2(gp_Pnt(Draw::Atof(a[2]), Draw::Atof(a[3]), Draw::Atof(a[4])), gp_Dir(0, 0, 1)),
+ gp_Ax2(gp_Pnt(Draw::Atof(a[2]), Draw::Atof(a[3]), Draw::Atof(a[4])), gp_Dir(gp_Dir::D::Z)),
Draw::Atof(a[5]));
else if (n == 7)
result2d = new Geom2d_Circle(gp_Ax22d(gp_Pnt2d(Draw::Atof(a[2]), Draw::Atof(a[3])),
else if (!strcmp(a[0], "parabola"))
{
if (n == 5)
- result2d =
- new Geom2d_Parabola(gp_Ax22d(gp_Pnt2d(Draw::Atof(a[2]), Draw::Atof(a[3])), gp_Dir2d(1, 0)),
- Draw::Atof(a[4]));
+ result2d = new Geom2d_Parabola(
+ gp_Ax22d(gp_Pnt2d(Draw::Atof(a[2]), Draw::Atof(a[3])), gp_Dir2d(gp_Dir2d::D::X)),
+ Draw::Atof(a[4]));
else if (n == 6)
result = new Geom_Parabola(
- gp_Ax2(gp_Pnt(Draw::Atof(a[2]), Draw::Atof(a[3]), Draw::Atof(a[4])), gp_Dir(0, 0, 1)),
+ gp_Ax2(gp_Pnt(Draw::Atof(a[2]), Draw::Atof(a[3]), Draw::Atof(a[4])), gp_Dir(gp_Dir::D::Z)),
Draw::Atof(a[5]));
else if (n == 7)
result2d = new Geom2d_Parabola(gp_Ax22d(gp_Pnt2d(Draw::Atof(a[2]), Draw::Atof(a[3])),
else if (!strcmp(a[0], "ellipse"))
{
if (n == 6)
- result2d =
- new Geom2d_Ellipse(gp_Ax22d(gp_Pnt2d(Draw::Atof(a[2]), Draw::Atof(a[3])), gp_Dir2d(1, 0)),
- Draw::Atof(a[4]),
- Draw::Atof(a[5]));
+ result2d = new Geom2d_Ellipse(
+ gp_Ax22d(gp_Pnt2d(Draw::Atof(a[2]), Draw::Atof(a[3])), gp_Dir2d(gp_Dir2d::D::X)),
+ Draw::Atof(a[4]),
+ Draw::Atof(a[5]));
else if (n == 7)
result = new Geom_Ellipse(
- gp_Ax2(gp_Pnt(Draw::Atof(a[2]), Draw::Atof(a[3]), Draw::Atof(a[4])), gp_Dir(0, 0, 1)),
+ gp_Ax2(gp_Pnt(Draw::Atof(a[2]), Draw::Atof(a[3]), Draw::Atof(a[4])), gp_Dir(gp_Dir::D::Z)),
Draw::Atof(a[5]),
Draw::Atof(a[6]));
else if (n == 8)
else if (!strcmp(a[0], "hyperbola"))
{
if (n == 6)
- result2d =
- new Geom2d_Hyperbola(gp_Ax22d(gp_Pnt2d(Draw::Atof(a[2]), Draw::Atof(a[3])), gp_Dir2d(1, 0)),
- Draw::Atof(a[4]),
- Draw::Atof(a[5]));
+ result2d = new Geom2d_Hyperbola(
+ gp_Ax22d(gp_Pnt2d(Draw::Atof(a[2]), Draw::Atof(a[3])), gp_Dir2d(gp_Dir2d::D::X)),
+ Draw::Atof(a[4]),
+ Draw::Atof(a[5]));
else if (n == 7)
result = new Geom_Hyperbola(
- gp_Ax2(gp_Pnt(Draw::Atof(a[2]), Draw::Atof(a[3]), Draw::Atof(a[4])), gp_Dir(0, 0, 1)),
+ gp_Ax2(gp_Pnt(Draw::Atof(a[2]), Draw::Atof(a[3]), Draw::Atof(a[4])), gp_Dir(gp_Dir::D::Z)),
Draw::Atof(a[5]),
Draw::Atof(a[6]));
else if (n == 8)
if (n < 5)
{
- loc = gp_Ax3(gp_Pnt(0, 0, 0), gp_Dir(0, 0, 1), gp_Dir(1, 0, 0));
+ loc = gp_Ax3(gp_Pnt(0, 0, 0), gp_Dir(gp_Dir::D::Z), gp_Dir(gp_Dir::D::X));
i = 2;
}
else if (n < 8)
{
loc = gp_Ax3(gp_Pnt(Draw::Atof(a[2]), Draw::Atof(a[3]), Draw::Atof(a[4])),
- gp_Dir(0, 0, 1),
- gp_Dir(1, 0, 0));
+ gp_Dir(gp_Dir::D::Z),
+ gp_Dir(gp_Dir::D::X));
i = 5;
}
else if (n < 11)
}
TCollection_AsciiString aName(theArgVec[1]);
- gp_Pln aWorkingPlane;
Standard_Boolean toUpdate = Standard_True;
NCollection_DataMap<TCollection_AsciiString, Standard_Real> aRealParams;
if (modmax > Tol)
Nor = gp_Dir(eqPlan);
else
- Nor = gp_Dir(0., 0., 1.);
+ Nor = gp_Dir(gp_Dir::D::Z);
polyTriangulation->SetNormal(i, Nor.XYZ());
}
Font_FontAspect aFontAspect = Font_FA_Regular;
Standard_Boolean anIsCompositeCurve = Standard_False;
gp_Ax3 aPenAx3(gp::XOY());
- gp_Dir aNormal(0.0, 0.0, 1.0);
- gp_Dir aDirection(1.0, 0.0, 0.0);
+ gp_Dir aNormal(gp_Dir::D::Z);
+ gp_Dir aDirection(gp_Dir::D::X);
gp_Pnt aPenLoc;
Graphic3d_HorizontalTextAlignment aHJustification = Graphic3d_HTA_LEFT;
}
TCollection_AsciiString aName(theArgVec[1]);
- gp_Pln aWorkingPlane;
Standard_Boolean toUpdate = Standard_True;
NCollection_DataMap<TCollection_AsciiString, TCollection_AsciiString> aStringParams;
myDrawer->SetTextAspect(aTextAspect);
}
{
- const gp_Dir aNorm(0.0, 0.0, 1.0);
+ const gp_Dir aNorm(gp_Dir::D::Z);
myTris = new Graphic3d_ArrayOfTriangles(4, 6, true, false, true);
myTris->AddVertex(gp_Pnt(-myWidth * 0.5, -myHeight * 0.5, 0.0), aNorm, gp_Pnt2d(0.0, 0.0));
myTris->AddVertex(gp_Pnt(myWidth * 0.5, -myHeight * 0.5, 0.0), aNorm, gp_Pnt2d(1.0, 0.0));
const Standard_Boolean isOBB =
myAxes[0].SquareModulus() * myAxes[1].SquareModulus() * myAxes[2].SquareModulus() > 1.0e-14;
- const gp_Dir aXDir = isOBB ? myAxes[0] : gp_Dir(1, 0, 0);
- const gp_Dir aYDir = isOBB ? myAxes[1] : gp_Dir(0, 1, 0);
- const gp_Dir aZDir = isOBB ? myAxes[2] : gp_Dir(0, 0, 1);
+ const gp_Dir aXDir = isOBB ? myAxes[0] : gp_Dir(gp_Dir::D::X);
+ const gp_Dir aYDir = isOBB ? myAxes[1] : gp_Dir(gp_Dir::D::Y);
+ const gp_Dir aZDir = isOBB ? myAxes[2] : gp_Dir(gp_Dir::D::Z);
const Standard_Integer aNbPoints = 6;
Standard_Real aParams[aNbPoints];
// Create a plane that intersects the large box but not others
gp_Pnt point(0.0, 0.0, 9.0);
- gp_Dir direction(0.0, 0.0, 1.0);
+ gp_Dir direction(gp_Dir::D::Z);
gp_Pln plane(point, direction);
const TColStd_ListOfInteger& result = sortBox.Compare(plane);
{
Bnd_Box aBox;
gp_Pnt aPnt(1.0, 2.0, 3.0);
- gp_Dir aDir(1.0, 0.0, 0.0);
+ gp_Dir aDir(gp_Dir::D::X);
aBox.Set(aPnt, aDir);
{
Bnd_Box aVoidBox;
gp_Trsf aRotation;
- aRotation.SetRotation(gp_Ax1(gp_Pnt(0, 0, 0), gp_Dir(0, 0, 1)), M_PI / 4);
+ aRotation.SetRotation(gp_Ax1(gp_Pnt(0, 0, 0), gp_Dir(gp_Dir::D::Z)), M_PI / 4);
Bnd_Box aTransformed = aVoidBox.Transformed(aRotation);
Bnd_Box aBox;
aBox.Update(0.0, 0.0, 0.0, 1.0, 1.0, 1.0);
- gp_Dir aDir(1.0, 0.0, 0.0);
+ gp_Dir aDir(gp_Dir::D::X);
aBox.Add(aDir);
EXPECT_TRUE(aBox.IsOpenXmax()) << "Positive X direction should open Xmax";
{
Bnd_Box aBox;
gp_Pnt aPnt(1.0, 2.0, 3.0);
- gp_Dir aDir(-1.0, 0.0, 0.0);
+ gp_Dir aDir(gp_Dir::D::NX);
aBox.Add(aPnt, aDir);
aBox.Update(-1.0, -1.0, -1.0, 1.0, 1.0, 1.0);
// Plane that intersects the box
- gp_Pln anIntersectingPln(gp_Pnt(0, 0, 0), gp_Dir(1, 0, 0));
+ gp_Pln anIntersectingPln(gp_Pnt(0, 0, 0), gp_Dir(gp_Dir::D::X));
// Plane that doesn't intersect the box
- gp_Pln aSeparatePln(gp_Pnt(2, 0, 0), gp_Dir(1, 0, 0));
+ gp_Pln aSeparatePln(gp_Pnt(2, 0, 0), gp_Dir(gp_Dir::D::X));
EXPECT_FALSE(aBox.IsOut(anIntersectingPln)) << "Intersecting plane should not be out";
EXPECT_TRUE(aBox.IsOut(aSeparatePln)) << "Separate plane should be out";
aBox.Update(0.0, 0.0, 0.0, 2.0, 2.0, 2.0);
// Line that passes through the box
- gp_Lin anIntersectingLin(gp_Pnt(-1, 1, 1), gp_Dir(1, 0, 0));
+ gp_Lin anIntersectingLin(gp_Pnt(-1, 1, 1), gp_Dir(gp_Dir::D::X));
// Line that misses the box
- gp_Lin aSeparateLin(gp_Pnt(-1, 3, 1), gp_Dir(1, 0, 0));
+ gp_Lin aSeparateLin(gp_Pnt(-1, 3, 1), gp_Dir(gp_Dir::D::X));
EXPECT_FALSE(aBox.IsOut(anIntersectingLin)) << "Intersecting line should not be out";
EXPECT_TRUE(aBox.IsOut(aSeparateLin)) << "Separate line should be out";
aBox.OpenXmax();
gp_Trsf aRotation;
- aRotation.SetRotation(gp_Ax1(gp_Pnt(0, 0, 0), gp_Dir(0, 0, 1)), M_PI / 2);
+ aRotation.SetRotation(gp_Ax1(gp_Pnt(0, 0, 0), gp_Dir(gp_Dir::D::Z)), M_PI / 2);
Bnd_Box aTransformed = aBox.Transformed(aRotation);
// Line segment that passes through box
gp_Pnt aP1(-1.0, 1.0, 1.0);
gp_Pnt aP2(3.0, 1.0, 1.0);
- gp_Dir aDir(1.0, 0.0, 0.0);
+ gp_Dir aDir(gp_Dir::D::X);
EXPECT_FALSE(aBox.IsOut(aP1, aP2, aDir)) << "Line segment through box should not be out";
TEST(ElClibTests, Line3D)
{
const gp_Pnt aLoc(1.0, 2.0, 3.0);
- const gp_Dir aDir(0.0, 0.0, 1.0);
+ const gp_Dir aDir(gp_Dir::D::Z);
const gp_Lin aLin(aLoc, aDir);
const Standard_Real aParam = 5.0;
TEST(ElClibTests, Circle3D)
{
const gp_Pnt aLoc(0.0, 0.0, 0.0);
- const gp_Dir aDirZ(0.0, 0.0, 1.0);
- const gp_Dir aDirX(1.0, 0.0, 0.0);
+ const gp_Dir aDirZ(gp_Dir::D::Z);
+ const gp_Dir aDirX(gp_Dir::D::X);
const gp_Ax2 anAxis(aLoc, aDirZ, aDirX);
const Standard_Real aRadius = 2.0;
const gp_Circ aCircle(anAxis, aRadius);
TEST(ElClibTests, Ellipse3D)
{
const gp_Pnt aLoc(0.0, 0.0, 0.0);
- const gp_Dir aDirZ(0.0, 0.0, 1.0);
- const gp_Dir aDirX(1.0, 0.0, 0.0);
+ const gp_Dir aDirZ(gp_Dir::D::Z);
+ const gp_Dir aDirX(gp_Dir::D::X);
const gp_Ax2 anAxis(aLoc, aDirZ, aDirX);
const Standard_Real aMajorRadius = 3.0;
const Standard_Real aMinorRadius = 2.0;
TEST(ElClibTests, Hyperbola3D)
{
const gp_Pnt aLoc(0.0, 0.0, 0.0);
- const gp_Dir aDirZ(0.0, 0.0, 1.0);
- const gp_Dir aDirX(1.0, 0.0, 0.0);
+ const gp_Dir aDirZ(gp_Dir::D::Z);
+ const gp_Dir aDirX(gp_Dir::D::X);
const gp_Ax2 anAxis(aLoc, aDirZ, aDirX);
const Standard_Real aMajorRadius = 3.0;
const Standard_Real aMinorRadius = 2.0;
TEST(ElClibTests, Parabola3D)
{
const gp_Pnt aLoc(0.0, 0.0, 0.0);
- const gp_Dir aDirZ(0.0, 0.0, 1.0);
- const gp_Dir aDirX(1.0, 0.0, 0.0);
+ const gp_Dir aDirZ(gp_Dir::D::Z);
+ const gp_Dir aDirX(gp_Dir::D::X);
const gp_Ax2 anAxis(aLoc, aDirZ, aDirX);
const Standard_Real aFocal = 2.0;
const gp_Parab aParabola(anAxis, aFocal);
TEST(ElClibTests, To3dConversion)
{
const gp_Pnt aLoc(1.0, 2.0, 3.0);
- const gp_Dir aDirZ(0.0, 0.0, 1.0);
- const gp_Dir aDirX(1.0, 0.0, 0.0);
+ const gp_Dir aDirZ(gp_Dir::D::Z);
+ const gp_Dir aDirX(gp_Dir::D::X);
const gp_Ax2 anAxis(aLoc, aDirZ, aDirX);
// Test conversion of a point
// Test conversion of a circle
const gp_Pnt2d aLoc2d(0.0, 0.0);
- const gp_Dir2d aDir2dX(1.0, 0.0);
+ const gp_Dir2d aDir2dX(gp_Dir2d::D::X);
const gp_Ax22d anAxis2d(aLoc2d, aDir2dX, true);
const Standard_Real aRadius = 2.0;
const gp_Circ2d aCirc2d(anAxis2d, aRadius);
#include <gp.hxx>
+#include <gp_Ax1.hxx>
#include <gp_Ax2.hxx>
#include <gp_Ax2d.hxx>
#include <gp_Dir.hxx>
//=================================================================================================
-const gp_Pnt& gp::Origin()
+const gp_Pnt& gp::Origin() noexcept
{
- static gp_Pnt gp_Origin(0, 0, 0);
+ static const gp_Pnt gp_Origin(0, 0, 0);
return gp_Origin;
}
//=================================================================================================
-const gp_Dir& gp::DX()
+const gp_Dir& gp::DX() noexcept
{
- static gp_Dir gp_DX(1, 0, 0);
+ static const gp_Dir gp_DX(gp_Dir::D::X);
return gp_DX;
}
//=================================================================================================
-const gp_Dir& gp::DY()
+const gp_Dir& gp::DY() noexcept
{
- static gp_Dir gp_DY(0, 1, 0);
+ static const gp_Dir gp_DY(gp_Dir::D::Y);
return gp_DY;
}
//=================================================================================================
-const gp_Dir& gp::DZ()
+const gp_Dir& gp::DZ() noexcept
{
- static gp_Dir gp_DZ(0, 0, 1);
+ static const gp_Dir gp_DZ(gp_Dir::D::Z);
return gp_DZ;
}
//=================================================================================================
-const gp_Ax1& gp::OX()
+const gp_Ax1& gp::OX() noexcept
{
- static gp_Ax1 gp_OX(gp_Pnt(0, 0, 0), gp_Dir(1, 0, 0));
+ static const gp_Ax1 gp_OX(gp_Pnt(0, 0, 0), gp_Dir::D::X);
return gp_OX;
}
//=================================================================================================
-const gp_Ax1& gp::OY()
+const gp_Ax1& gp::OY() noexcept
{
- static gp_Ax1 gp_OY(gp_Pnt(0, 0, 0), gp_Dir(0, 1, 0));
+ static const gp_Ax1 gp_OY(gp_Pnt(0, 0, 0), gp_Dir::D::Y);
return gp_OY;
}
//=================================================================================================
-const gp_Ax1& gp::OZ()
+const gp_Ax1& gp::OZ() noexcept
{
- static gp_Ax1 gp_OZ(gp_Pnt(0, 0, 0), gp_Dir(0, 0, 1));
+ static const gp_Ax1 gp_OZ(gp_Pnt(0, 0, 0), gp_Dir::D::Z);
return gp_OZ;
}
//=================================================================================================
-const gp_Ax2& gp::XOY()
+const gp_Ax2& gp::XOY() noexcept
{
- static gp_Ax2 gp_XOY(gp_Pnt(0, 0, 0), gp_Dir(0, 0, 1), gp_Dir(1, 0, 0));
+ static const gp_Ax2 gp_XOY(gp_Pnt(0, 0, 0), gp_Dir::D::Z);
return gp_XOY;
}
//=================================================================================================
-const gp_Ax2& gp::ZOX()
+const gp_Ax2& gp::ZOX() noexcept
{
- static gp_Ax2 gp_ZOX(gp_Pnt(0, 0, 0), gp_Dir(0, 1, 0), gp_Dir(0, 0, 1));
+ static const gp_Ax2 gp_ZOX(gp_Pnt(0, 0, 0), gp_Dir::D::Y);
return gp_ZOX;
}
//=================================================================================================
-const gp_Ax2& gp::YOZ()
+const gp_Ax2& gp::YOZ() noexcept
{
- static gp_Ax2 gp_YOZ(gp_Pnt(0, 0, 0), gp_Dir(1, 0, 0), gp_Dir(0, 1, 0));
+ static const gp_Ax2 gp_YOZ(gp_Pnt(0, 0, 0), gp_Dir::D::X);
return gp_YOZ;
}
//=================================================================================================
-const gp_Pnt2d& gp::Origin2d()
+const gp_Pnt2d& gp::Origin2d() noexcept
{
- static gp_Pnt2d gp_Origin2d(0, 0);
+ static const gp_Pnt2d gp_Origin2d(0, 0);
return gp_Origin2d;
}
//=================================================================================================
-const gp_Dir2d& gp::DX2d()
+const gp_Dir2d& gp::DX2d() noexcept
{
- static gp_Dir2d gp_DX2d(1, 0);
+ static const gp_Dir2d gp_DX2d(gp_Dir2d::D::X);
return gp_DX2d;
}
//=================================================================================================
-const gp_Dir2d& gp::DY2d()
+const gp_Dir2d& gp::DY2d() noexcept
{
- static gp_Dir2d gp_DY2d(0, 1);
+ static const gp_Dir2d gp_DY2d(gp_Dir2d::D::Y);
return gp_DY2d;
}
//=================================================================================================
-const gp_Ax2d& gp::OX2d()
+const gp_Ax2d& gp::OX2d() noexcept
{
- static gp_Ax2d gp_OX2d(gp_Pnt2d(0, 0), gp_Dir2d(1, 0));
+ static const gp_Ax2d gp_OX2d(gp_Pnt2d(0, 0), gp_Dir2d::D::X);
return gp_OX2d;
}
//=================================================================================================
-const gp_Ax2d& gp::OY2d()
+const gp_Ax2d& gp::OY2d() noexcept
{
- static gp_Ax2d gp_OY2d(gp_Pnt2d(0, 0), gp_Dir2d(0, 1));
+ static const gp_Ax2d gp_OY2d(gp_Pnt2d(0, 0), gp_Dir2d::D::Y);
return gp_OY2d;
}
//! surfaces.
//! These entities are defined in 2d and 3d space.
//! All the classes of this package are non-persistent.
+//! This is a utility class that cannot be instantiated.
class gp
{
-public:
- DEFINE_STANDARD_ALLOC
+private:
+ // Non-instantiable utility class
+ gp() = delete;
+ gp(const gp&) = delete;
+ gp& operator=(const gp&) = delete;
+public:
//! Method of package gp
//!
//! In geometric computations, defines the tolerance criterion
static constexpr Standard_Real Resolution() { return RealSmall(); }
//! Identifies a Cartesian point with coordinates X = Y = Z = 0.0.0
- Standard_EXPORT static const gp_Pnt& Origin();
+ Standard_EXPORT static const gp_Pnt& Origin() noexcept;
//! Returns a unit vector with the combination (1,0,0)
- Standard_EXPORT static const gp_Dir& DX();
+ Standard_EXPORT static const gp_Dir& DX() noexcept;
//! Returns a unit vector with the combination (0,1,0)
- Standard_EXPORT static const gp_Dir& DY();
+ Standard_EXPORT static const gp_Dir& DY() noexcept;
//! Returns a unit vector with the combination (0,0,1)
- Standard_EXPORT static const gp_Dir& DZ();
+ Standard_EXPORT static const gp_Dir& DZ() noexcept;
//! Identifies an axis where its origin is Origin
//! and its unit vector coordinates X = 1.0, Y = Z = 0.0
- Standard_EXPORT static const gp_Ax1& OX();
+ Standard_EXPORT static const gp_Ax1& OX() noexcept;
//! Identifies an axis where its origin is Origin
//! and its unit vector coordinates Y = 1.0, X = Z = 0.0
- Standard_EXPORT static const gp_Ax1& OY();
+ Standard_EXPORT static const gp_Ax1& OY() noexcept;
//! Identifies an axis where its origin is Origin
//! and its unit vector coordinates Z = 1.0, Y = X = 0.0
- Standard_EXPORT static const gp_Ax1& OZ();
+ Standard_EXPORT static const gp_Ax1& OZ() noexcept;
//! Identifies a coordinate system where its origin is Origin,
//! and its "main Direction" and "X Direction" coordinates
//! Z = 1.0, X = Y =0.0 and X direction coordinates X = 1.0, Y = Z = 0.0
- Standard_EXPORT static const gp_Ax2& XOY();
+ Standard_EXPORT static const gp_Ax2& XOY() noexcept;
//! Identifies a coordinate system where its origin is Origin,
//! and its "main Direction" and "X Direction" coordinates
//! Y = 1.0, X = Z =0.0 and X direction coordinates Z = 1.0, X = Y = 0.0
- Standard_EXPORT static const gp_Ax2& ZOX();
+ Standard_EXPORT static const gp_Ax2& ZOX() noexcept;
//! Identifies a coordinate system where its origin is Origin,
//! and its "main Direction" and "X Direction" coordinates
//! X = 1.0, Z = Y =0.0 and X direction coordinates Y = 1.0, X = Z = 0.0
//! In 2D space
- Standard_EXPORT static const gp_Ax2& YOZ();
+ Standard_EXPORT static const gp_Ax2& YOZ() noexcept;
//! Identifies a Cartesian point with coordinates X = Y = 0.0
- Standard_EXPORT static const gp_Pnt2d& Origin2d();
+ Standard_EXPORT static const gp_Pnt2d& Origin2d() noexcept;
//! Returns a unit vector with the combinations (1,0)
- Standard_EXPORT static const gp_Dir2d& DX2d();
+ Standard_EXPORT static const gp_Dir2d& DX2d() noexcept;
//! Returns a unit vector with the combinations (0,1)
- Standard_EXPORT static const gp_Dir2d& DY2d();
+ Standard_EXPORT static const gp_Dir2d& DY2d() noexcept;
//! Identifies an axis where its origin is Origin2d
//! and its unit vector coordinates are: X = 1.0, Y = 0.0
- Standard_EXPORT static const gp_Ax2d& OX2d();
+ Standard_EXPORT static const gp_Ax2d& OX2d() noexcept;
//! Identifies an axis where its origin is Origin2d
//! and its unit vector coordinates are Y = 1.0, X = 0.0
- Standard_EXPORT static const gp_Ax2d& OY2d();
+ Standard_EXPORT static const gp_Ax2d& OY2d() noexcept;
};
#endif // _gp_HeaderFile
//! Creates an axis object representing Z axis of
//! the reference coordinate system.
- gp_Ax1()
+ constexpr gp_Ax1() noexcept
: loc(0., 0., 0.),
- vdir(0., 0., 1.)
+ vdir(gp_Dir::D::Z)
{
}
{
}
+ //! Creates an axis with the given location point and standard direction.
+ constexpr gp_Ax1(const gp_Pnt& theP, const gp_Dir::D theDir) noexcept
+ : loc(theP),
+ vdir(theDir)
+ {
+ }
+
+ //! Creates an axis at the origin with the given standard direction.
+ //! Replaces gp::OX(), gp::OY(), gp::OZ() static functions.
+ constexpr explicit gp_Ax1(const gp_Dir::D theDir) noexcept
+ : loc(0., 0., 0.),
+ vdir(theDir)
+ {
+ }
+
//! Assigns V as the "Direction" of this axis.
constexpr void SetDirection(const gp_Dir& theV) noexcept { vdir = theV; }
//! Creates an object corresponding to the reference
//! coordinate system (OXYZ).
- gp_Ax2()
- : vydir(0., 1., 0.)
- // vxdir(1.,0.,0.) use default ctor of gp_Dir, as it creates the same dir(1,0,0)
+ constexpr gp_Ax2() noexcept
+ : vydir(gp_Dir::D::Y),
+ vxdir(gp_Dir::D::X)
+ // axis uses default ctor which creates Z axis at origin
{
}
vydir.Cross(vxdir);
}
+ //! Creates an axis placement with standard directions.
+ constexpr gp_Ax2(const gp_Pnt& theP, const gp_Dir::D theN, const gp_Dir::D theVx) noexcept
+ : axis(theP, theN),
+ vydir(crossStandardDir(theN, theVx)), // Y = Z x X (right-handed)
+ vxdir(theVx)
+ {
+ // Note: For standard directions, cross product is computed at compile time
+ // This constructor assumes theN and theVx are orthogonal standard directions
+ }
+
//! Creates - a coordinate system with an origin P, where V
//! gives the "main Direction" (here, "X Direction" and "Y
//! Direction" are defined automatically).
Standard_EXPORT gp_Ax2(const gp_Pnt& P, const gp_Dir& V);
+ //! Creates a coordinate system with an origin P and standard main direction.
+ constexpr gp_Ax2(const gp_Pnt& theP, const gp_Dir::D theV) noexcept
+ : axis(theP, theV),
+ vydir(getPerpendicularYDir(theV)),
+ vxdir(getPerpendicularXDir(theV))
+ {
+ }
+
+ //! Creates a coordinate system at the origin with the given standard main direction.
+ //! Replaces gp::XOY(), gp::YOZ(), gp::ZOX() static functions.
+ constexpr explicit gp_Ax2(const gp_Dir::D theV) noexcept
+ : axis(gp_Pnt(0., 0., 0.), theV),
+ vydir(getPerpendicularYDir(theV)),
+ vxdir(getPerpendicularXDir(theV))
+ {
+ }
+
//! Assigns the origin and "main Direction" of the axis A1 to
//! this coordinate system, then recomputes its "X Direction" and "Y Direction".
//! Note: The new "X Direction" is computed as follows:
Standard_EXPORT Standard_Boolean InitFromJson(const Standard_SStream& theSStream,
Standard_Integer& theStreamPos);
+protected:
+ //! Helper to compute perpendicular X direction for standard main directions
+ static constexpr gp_Dir::D getPerpendicularXDir(const gp_Dir::D theMainDir) noexcept;
+
+ //! Helper to compute Y direction (main x X) for standard directions
+ static constexpr gp_Dir::D getPerpendicularYDir(const gp_Dir::D theMainDir) noexcept;
+
+ //! Helper to compute cross product of two standard directions (right-handed: A x B)
+ static constexpr gp_Dir::D crossStandardDir(const gp_Dir::D theA, const gp_Dir::D theB) noexcept;
+
private:
gp_Ax1 axis;
gp_Dir vydir;
//=================================================================================================
+inline constexpr gp_Dir::D gp_Ax2::getPerpendicularXDir(const gp_Dir::D theMainDir) noexcept
+{
+ return (theMainDir == gp_Dir::D::X || theMainDir == gp_Dir::D::NX) ? gp_Dir::D::Y
+ : (theMainDir == gp_Dir::D::Y || theMainDir == gp_Dir::D::NY) ? gp_Dir::D::Z
+ : gp_Dir::D::X;
+}
+
+//=================================================================================================
+
+inline constexpr gp_Dir::D gp_Ax2::getPerpendicularYDir(const gp_Dir::D theMainDir) noexcept
+{
+ return (theMainDir == gp_Dir::D::Z) ? gp_Dir::D::Y
+ : (theMainDir == gp_Dir::D::NZ) ? gp_Dir::D::NY
+ : (theMainDir == gp_Dir::D::X) ? gp_Dir::D::Z
+ : (theMainDir == gp_Dir::D::NX) ? gp_Dir::D::NZ
+ : (theMainDir == gp_Dir::D::Y) ? gp_Dir::D::X
+ : gp_Dir::D::NX; // NY case
+}
+
+//=================================================================================================
+
+inline constexpr gp_Dir::D gp_Ax2::crossStandardDir(const gp_Dir::D theA,
+ const gp_Dir::D theB) noexcept
+{
+ // Handle positive directions first
+ if (theA == gp_Dir::D::X)
+ {
+ if (theB == gp_Dir::D::Y)
+ return gp_Dir::D::Z;
+ if (theB == gp_Dir::D::Z)
+ return gp_Dir::D::NY;
+ if (theB == gp_Dir::D::NY)
+ return gp_Dir::D::NZ;
+ if (theB == gp_Dir::D::NZ)
+ return gp_Dir::D::Y;
+ // X x X = 0, X x NX = 0 (parallel, should not happen)
+ return gp_Dir::D::Z; // fallback
+ }
+ if (theA == gp_Dir::D::Y)
+ {
+ if (theB == gp_Dir::D::Z)
+ return gp_Dir::D::X;
+ if (theB == gp_Dir::D::X)
+ return gp_Dir::D::NZ;
+ if (theB == gp_Dir::D::NX)
+ return gp_Dir::D::Z;
+ if (theB == gp_Dir::D::NZ)
+ return gp_Dir::D::NX;
+ // Y x Y = 0, Y x NY = 0 (parallel, should not happen)
+ return gp_Dir::D::X; // fallback
+ }
+ if (theA == gp_Dir::D::Z)
+ {
+ if (theB == gp_Dir::D::X)
+ return gp_Dir::D::Y;
+ if (theB == gp_Dir::D::Y)
+ return gp_Dir::D::NX;
+ if (theB == gp_Dir::D::NX)
+ return gp_Dir::D::NY;
+ if (theB == gp_Dir::D::NY)
+ return gp_Dir::D::X;
+ // Z x Z = 0, Z x NZ = 0 (parallel, should not happen)
+ return gp_Dir::D::Y; // fallback
+ }
+ // Handle negative directions: -A x B = -(A x B)
+ if (theA == gp_Dir::D::NX)
+ {
+ if (theB == gp_Dir::D::Y)
+ return gp_Dir::D::NZ;
+ if (theB == gp_Dir::D::Z)
+ return gp_Dir::D::Y;
+ if (theB == gp_Dir::D::NY)
+ return gp_Dir::D::Z;
+ if (theB == gp_Dir::D::NZ)
+ return gp_Dir::D::NY;
+ return gp_Dir::D::NZ; // fallback
+ }
+ if (theA == gp_Dir::D::NY)
+ {
+ if (theB == gp_Dir::D::Z)
+ return gp_Dir::D::NX;
+ if (theB == gp_Dir::D::X)
+ return gp_Dir::D::Z;
+ if (theB == gp_Dir::D::NX)
+ return gp_Dir::D::NZ;
+ if (theB == gp_Dir::D::NZ)
+ return gp_Dir::D::X;
+ return gp_Dir::D::NX; // fallback
+ }
+ if (theA == gp_Dir::D::NZ)
+ {
+ if (theB == gp_Dir::D::X)
+ return gp_Dir::D::NY;
+ if (theB == gp_Dir::D::Y)
+ return gp_Dir::D::X;
+ if (theB == gp_Dir::D::NX)
+ return gp_Dir::D::Y;
+ if (theB == gp_Dir::D::NY)
+ return gp_Dir::D::NX;
+ return gp_Dir::D::NY; // fallback
+ }
+ return gp_Dir::D::Z; // fallback
+}
+
+//=================================================================================================
+
inline void gp_Ax2::SetAxis(const gp_Ax1& theA1)
{
Standard_Real a = theA1.Direction() * vxdir;
//! Creates an object representing the reference
//! coordinate system (OXY).
- gp_Ax22d()
- : vydir(0., 1.)
- // vxdir(1.,0.) use default ctor of gp_Dir2d, as it creates the same dir(1, 0)
+ constexpr gp_Ax22d() noexcept
+ : vydir(gp_Dir2d::D::Y)
+ // vxdir default ctor creates X direction (1, 0)
{
}
{
}
+ //! Creates an axis with the given location point and standard direction.
+ constexpr gp_Ax2d(const gp_Pnt2d& theP, const gp_Dir2d::D theDir) noexcept
+ : loc(theP),
+ vdir(theDir)
+ {
+ }
+
+ //! Creates an axis at the origin with the given standard direction.
+ //! Replaces gp::OX2d(), gp::OY2d() static functions.
+ constexpr explicit gp_Ax2d(const gp_Dir2d::D theDir) noexcept
+ : loc(0., 0.),
+ vdir(theDir)
+ {
+ }
+
//! Changes the "Location" point (origin) of <me>.
constexpr void SetLocation(const gp_Pnt2d& theP) noexcept { loc = theP; }
//! Creates an object corresponding to the reference
//! coordinate system (OXYZ).
- gp_Ax3()
- : vydir(0., 1., 0.)
- // vxdir(1.,0.,0.) use default ctor of gp_Dir, as it creates the same dir(1,0,0)
+ constexpr gp_Ax3() noexcept
+ : vydir(gp_Dir::D::Y),
+ vxdir(gp_Dir::D::X)
+ // axis uses default ctor which creates Z axis at origin
{
}
vydir.Cross(vxdir);
}
+ //! Creates an axis placement with standard directions.
+ //! This constructor allows constexpr and noexcept construction when using standard directions.
+ constexpr gp_Ax3(const gp_Pnt& theP, const gp_Dir::D theN, const gp_Dir::D theVx) noexcept
+ : axis(theP, theN),
+ vydir(crossStandardDir(theN, theVx)), // Y = Z x X (right-handed)
+ vxdir(theVx)
+ {
+ // Note: For standard directions, cross product is computed at compile time
+ // This constructor assumes theN and theVx are orthogonal standard directions
+ }
+
//! Creates an axis placement with the "Location" point <theP>
//! and the normal direction <theV>.
Standard_EXPORT gp_Ax3(const gp_Pnt& theP, const gp_Dir& theV);
+ //! Creates an axis placement with the given location point and standard direction.
+ constexpr gp_Ax3(const gp_Pnt& theP, const gp_Dir::D theV) noexcept
+ : axis(theP, theV),
+ vydir(getPerpendicularYDir(theV)),
+ vxdir(getPerpendicularXDir(theV))
+ {
+ }
+
+ //! Creates an axis placement at the origin with the given standard direction.
+ constexpr explicit gp_Ax3(const gp_Dir::D theV) noexcept
+ : axis(gp_Pnt(0., 0., 0.), theV),
+ vydir(getPerpendicularYDir(theV)),
+ vxdir(getPerpendicularXDir(theV))
+ {
+ }
+
//! Reverses the X direction of <me>.
constexpr void XReverse() noexcept { vxdir.Reverse(); }
Standard_Integer& theStreamPos);
private:
+ //! Helper to compute perpendicular X direction for standard main directions
+ static constexpr gp_Dir::D getPerpendicularXDir(const gp_Dir::D theMainDir) noexcept;
+
+ //! Helper to compute Y direction (main x X) for standard directions
+ static constexpr gp_Dir::D getPerpendicularYDir(const gp_Dir::D theMainDir) noexcept;
+
+ //! Helper to compute cross product of two standard directions (right-handed: A x B)
+ static constexpr gp_Dir::D crossStandardDir(const gp_Dir::D theA, const gp_Dir::D theB) noexcept;
+
gp_Ax1 axis;
gp_Dir vydir;
gp_Dir vxdir;
//=================================================================================================
+inline constexpr gp_Dir::D gp_Ax3::getPerpendicularXDir(const gp_Dir::D theMainDir) noexcept
+{
+ return (theMainDir == gp_Dir::D::X || theMainDir == gp_Dir::D::NX) ? gp_Dir::D::Y
+ : (theMainDir == gp_Dir::D::Y || theMainDir == gp_Dir::D::NY) ? gp_Dir::D::Z
+ : gp_Dir::D::X;
+}
+
+//=================================================================================================
+
+inline constexpr gp_Dir::D gp_Ax3::getPerpendicularYDir(const gp_Dir::D theMainDir) noexcept
+{
+ return (theMainDir == gp_Dir::D::Z) ? gp_Dir::D::Y
+ : (theMainDir == gp_Dir::D::NZ) ? gp_Dir::D::NY
+ : (theMainDir == gp_Dir::D::X) ? gp_Dir::D::Z
+ : (theMainDir == gp_Dir::D::NX) ? gp_Dir::D::NZ
+ : (theMainDir == gp_Dir::D::Y) ? gp_Dir::D::X
+ : gp_Dir::D::NX; // NY case
+}
+
+//=================================================================================================
+
+inline constexpr gp_Dir::D gp_Ax3::crossStandardDir(const gp_Dir::D theA,
+ const gp_Dir::D theB) noexcept
+{
+ // Handle positive directions first
+ if (theA == gp_Dir::D::X)
+ {
+ if (theB == gp_Dir::D::Y)
+ return gp_Dir::D::Z;
+ if (theB == gp_Dir::D::Z)
+ return gp_Dir::D::NY;
+ if (theB == gp_Dir::D::NY)
+ return gp_Dir::D::NZ;
+ if (theB == gp_Dir::D::NZ)
+ return gp_Dir::D::Y;
+ // X x X = 0, X x NX = 0 (parallel, should not happen)
+ return gp_Dir::D::Z; // fallback
+ }
+ if (theA == gp_Dir::D::Y)
+ {
+ if (theB == gp_Dir::D::Z)
+ return gp_Dir::D::X;
+ if (theB == gp_Dir::D::X)
+ return gp_Dir::D::NZ;
+ if (theB == gp_Dir::D::NX)
+ return gp_Dir::D::Z;
+ if (theB == gp_Dir::D::NZ)
+ return gp_Dir::D::NX;
+ // Y x Y = 0, Y x NY = 0 (parallel, should not happen)
+ return gp_Dir::D::X; // fallback
+ }
+ if (theA == gp_Dir::D::Z)
+ {
+ if (theB == gp_Dir::D::X)
+ return gp_Dir::D::Y;
+ if (theB == gp_Dir::D::Y)
+ return gp_Dir::D::NX;
+ if (theB == gp_Dir::D::NX)
+ return gp_Dir::D::NY;
+ if (theB == gp_Dir::D::NY)
+ return gp_Dir::D::X;
+ // Z x Z = 0, Z x NZ = 0 (parallel, should not happen)
+ return gp_Dir::D::Y; // fallback
+ }
+ // Handle negative directions: -A x B = -(A x B)
+ if (theA == gp_Dir::D::NX)
+ {
+ if (theB == gp_Dir::D::Y)
+ return gp_Dir::D::NZ;
+ if (theB == gp_Dir::D::Z)
+ return gp_Dir::D::Y;
+ if (theB == gp_Dir::D::NY)
+ return gp_Dir::D::Z;
+ if (theB == gp_Dir::D::NZ)
+ return gp_Dir::D::NY;
+ return gp_Dir::D::NZ; // fallback
+ }
+ if (theA == gp_Dir::D::NY)
+ {
+ if (theB == gp_Dir::D::Z)
+ return gp_Dir::D::NX;
+ if (theB == gp_Dir::D::X)
+ return gp_Dir::D::Z;
+ if (theB == gp_Dir::D::NX)
+ return gp_Dir::D::NZ;
+ if (theB == gp_Dir::D::NZ)
+ return gp_Dir::D::X;
+ return gp_Dir::D::NX; // fallback
+ }
+ if (theA == gp_Dir::D::NZ)
+ {
+ if (theB == gp_Dir::D::X)
+ return gp_Dir::D::NY;
+ if (theB == gp_Dir::D::Y)
+ return gp_Dir::D::X;
+ if (theB == gp_Dir::D::NX)
+ return gp_Dir::D::Y;
+ if (theB == gp_Dir::D::NY)
+ return gp_Dir::D::NX;
+ return gp_Dir::D::NY; // fallback
+ }
+ return gp_Dir::D::Z; // fallback
+}
+
+//=================================================================================================
+
inline gp_Ax3::gp_Ax3(const gp_Ax2& theA)
: axis(theA.Axis()),
vydir(theA.YDirection()),
DEFINE_STANDARD_ALLOC
//! Creates an indefinite circle.
- gp_Circ()
+ constexpr gp_Circ() noexcept
: radius(RealLast())
{
}
DEFINE_STANDARD_ALLOC
//! creates an indefinite circle.
- gp_Circ2d() noexcept
+ constexpr gp_Circ2d() noexcept
: radius(RealLast())
{
}
DEFINE_STANDARD_ALLOC
//! Creates an indefinite Cone.
- gp_Cone()
+ constexpr gp_Cone() noexcept
: radius(RealLast()),
semiAngle(M_PI * 0.25)
{
DEFINE_STANDARD_ALLOC
//! Creates a indefinite cylinder.
- gp_Cylinder() { radius = RealLast(); }
+ constexpr gp_Cylinder() noexcept
+ : radius(RealLast())
+ {
+ }
//! Creates a cylinder of radius Radius, whose axis is the "main
//! Axis" of theA3. theA3 is the local coordinate system of the cylinder. Raises
class gp_Dir
{
public:
+ //! Standard directions in 3D space for optimized constexpr construction
+ enum class D
+ {
+ X, //!< Direction along positive X axis (1, 0, 0)
+ Y, //!< Direction along positive Y axis (0, 1, 0)
+ Z, //!< Direction along positive Z axis (0, 0, 1)
+ NX, //!< Direction along negative X axis (-1, 0, 0)
+ NY, //!< Direction along negative Y axis (0, -1, 0)
+ NZ //!< Direction along negative Z axis (0, 0, -1)
+ };
+
DEFINE_STANDARD_ALLOC
//! Creates a direction corresponding to X axis.
{
}
+ //! Creates a direction from a standard direction enumeration.
+ constexpr explicit gp_Dir(const D theDir) noexcept
+ : coord(theDir == D::X ? 1.0
+ : theDir == D::NX ? -1.0
+ : 0.0,
+ theDir == D::Y ? 1.0
+ : theDir == D::NY ? -1.0
+ : 0.0,
+ theDir == D::Z ? 1.0
+ : theDir == D::NZ ? -1.0
+ : 0.0)
+ {
+ }
+
//! Normalizes the vector theV and creates a direction. Raises ConstructionError if
//! theV.Magnitude() <= Resolution.
gp_Dir(const gp_Vec& theV);
class gp_Dir2d
{
public:
+ //! Standard directions in 2D space for optimized constexpr construction
+ enum class D
+ {
+ X, //!< Direction along positive X axis (1, 0)
+ Y, //!< Direction along positive Y axis (0, 1)
+ NX, //!< Direction along negative X axis (-1, 0)
+ NY //!< Direction along negative Y axis (0, -1)
+ };
+
DEFINE_STANDARD_ALLOC
//! Creates a direction corresponding to X axis.
{
}
+ //! Creates a direction from a standard direction enumeration.
+ constexpr explicit gp_Dir2d(const D theDir) noexcept
+ : coord(theDir == D::X ? 1.0
+ : theDir == D::NX ? -1.0
+ : 0.0,
+ theDir == D::Y ? 1.0
+ : theDir == D::NY ? -1.0
+ : 0.0)
+ {
+ }
+
//! Normalizes the vector theV and creates a Direction. Raises ConstructionError if
//! theV.Magnitude() <= Resolution from gp.
gp_Dir2d(const gp_Vec2d& theV);
DEFINE_STANDARD_ALLOC
//! Creates an indefinite ellipse.
- gp_Elips()
+ constexpr gp_Elips() noexcept
: majorRadius(RealLast()),
minorRadius(RealSmall())
{
DEFINE_STANDARD_ALLOC
//! Creates an indefinite ellipse.
- gp_Elips2d() noexcept
+ constexpr gp_Elips2d() noexcept
: majorRadius(RealLast()),
minorRadius(RealSmall())
{
DEFINE_STANDARD_ALLOC
//! Creates of an indefinite hyperbola.
- gp_Hypr()
+ constexpr gp_Hypr() noexcept
: majorRadius(RealLast()),
minorRadius(RealFirst())
{
DEFINE_STANDARD_ALLOC
//! Creates of an indefinite hyperbola.
- gp_Hypr2d() noexcept
+ constexpr gp_Hypr2d() noexcept
: majorRadius(RealLast()),
minorRadius(RealLast())
{
//! Creates a Line corresponding to Z axis of the
//! reference coordinate system.
- gp_Lin() {}
+ constexpr gp_Lin() noexcept {}
//! Creates a line defined by axis theA1.
- gp_Lin(const gp_Ax1& theA1)
+ constexpr gp_Lin(const gp_Ax1& theA1) noexcept
: pos(theA1)
{
}
DEFINE_STANDARD_ALLOC
//! Creates an indefinite Parabola.
- gp_Parab()
+ constexpr gp_Parab() noexcept
: focalLength(RealLast())
{
}
DEFINE_STANDARD_ALLOC
//! Creates an indefinite parabola.
- gp_Parab2d() noexcept
+ constexpr gp_Parab2d() noexcept
: focalLength(RealLast())
{
}
//! Creates a plane coincident with OXY plane of the
//! reference coordinate system.
- gp_Pln() {}
+ constexpr gp_Pln() noexcept {}
//! The coordinate system of the plane is defined with the axis
//! placement theA3.
//! The "Location" of theA3 defines the location (origin) of the plane.
//! The "XDirection" and "YDirection" of theA3 define the "XAxis" and
//! the "YAxis" of the plane used to parametrize the plane.
- gp_Pln(const gp_Ax3& theA3)
+ constexpr gp_Pln(const gp_Ax3& theA3) noexcept
: pos(theA3)
{
}
DEFINE_STANDARD_ALLOC
//! Creates an indefinite sphere.
- gp_Sphere()
+ constexpr gp_Sphere() noexcept
: radius(RealLast())
{
}
DEFINE_STANDARD_ALLOC
//! creates an indefinite Torus.
- gp_Torus()
+ constexpr gp_Torus() noexcept
: majorRadius(RealLast()),
minorRadius(RealSmall())
{
TEST(Standard_DumpTest, gp_Ax3_DumpAndInit_MultipleSeparators)
{
// Test gp_Ax3 which has multiple fields requiring separators
- gp_Ax3 anAxis(gp_Pnt(1, 2, 3), gp_Dir(0, 0, 1), gp_Dir(1, 0, 0));
+ gp_Ax3 anAxis(gp_Pnt(1, 2, 3), gp_Dir(gp_Dir::D::Z), gp_Dir(gp_Dir::D::X));
// Serialize
std::ostringstream anOStream;
Standard_Real Angle(const gp_Dir2d& aDir2D)
{
- gp_Dir2d aRefDir(1., 0.);
+ gp_Dir2d aRefDir(gp_Dir2d::D::X);
Standard_Real anAngle;
anAngle = aRefDir.Angle(aDir2D);
//
aT = BOPTools_AlgoTools2D::IntermediatePoint(a, b);
C2D1->D1(aT, aP2D, aVec2D);
- gp_Dir2d aDir2D1(aVec2D), aDOX(-1., 0.), aDOY(0., 1.);
+ gp_Dir2d aDir2D1(aVec2D), aDOX(gp_Dir2d::D::NX), aDOY(gp_Dir2d::D::Y);
//
anU = aP2D.X();
anV = aP2D.Y();
//
theContext->UVBounds(theF, aUMin, aUMax, aVMin, aVMax);
//
- gp_Dir2d aD2D(0., 1.);
+ gp_Dir2d aD2D(gp_Dir2d::D::Y);
aUx = IntTools_Tools::IntermediatePoint(aUMin, aUMax);
//
for (i = 0; i < 2; ++i)
const std::vector<ProfileOperation>& theOperations)
{
// Use default plane (XY plane)
- const gp_Pln aPlane(gp_Pnt(0, 0, 0), gp_Dir(0, 0, 1));
+ const gp_Pln aPlane(gp_Pnt(0, 0, 0), gp_Dir(gp_Dir::D::Z));
return CreateProfile(aPlane, theOperations);
}
static TopoDS_Shape RotateZ(const TopoDS_Shape& theShape, Standard_Real theAngleDeg)
{
gp_Trsf aRotation;
- aRotation.SetRotation(gp_Ax1(gp_Pnt(0, 0, 0), gp_Dir(0, 0, 1)), theAngleDeg * M_PI / 180.0);
+ aRotation.SetRotation(gp_Ax1(gp_Pnt(0, 0, 0), gp_Dir(gp_Dir::D::Z)),
+ theAngleDeg * M_PI / 180.0);
BRepBuilderAPI_Transform aTransform(theShape, aRotation);
return aTransform.Shape();
}
static TopoDS_Shape RotateY(const TopoDS_Shape& theShape, Standard_Real theAngleDeg)
{
gp_Trsf aRotation;
- aRotation.SetRotation(gp_Ax1(gp_Pnt(0, 0, 0), gp_Dir(0, 1, 0)), theAngleDeg * M_PI / 180.0);
+ aRotation.SetRotation(gp_Ax1(gp_Pnt(0, 0, 0), gp_Dir(gp_Dir::D::Y)),
+ theAngleDeg * M_PI / 180.0);
BRepBuilderAPI_Transform aTransform(theShape, aRotation);
return aTransform.Shape();
}
static TopoDS_Shape RotateX(const TopoDS_Shape& theShape, Standard_Real theAngleDeg)
{
gp_Trsf aRotation;
- aRotation.SetRotation(gp_Ax1(gp_Pnt(0, 0, 0), gp_Dir(1, 0, 0)), theAngleDeg * M_PI / 180.0);
+ aRotation.SetRotation(gp_Ax1(gp_Pnt(0, 0, 0), gp_Dir(gp_Dir::D::X)),
+ theAngleDeg * M_PI / 180.0);
BRepBuilderAPI_Transform aTransform(theShape, aRotation);
return aTransform.Shape();
}
static TopoDS_Shape RotateY90(const TopoDS_Shape& theShape)
{
gp_Trsf aRotation;
- aRotation.SetRotation(gp_Ax1(gp_Pnt(0, 0, 1), gp_Dir(0, 1, 0)), 90.0 * M_PI / 180.0);
+ aRotation.SetRotation(gp_Ax1(gp_Pnt(0, 0, 1), gp_Dir(gp_Dir::D::Y)), 90.0 * M_PI / 180.0);
BRepBuilderAPI_Transform aTransform(theShape, aRotation);
return aTransform.Shape();
}
constexpr Standard_Real r = M_SQRT2;
TopoDS_Shape aRectangularBox = BOPTest_Utilities::CreateBox(gp_Pnt(0, 0, 0), r, r / 2.0, 1.0);
aRectangularBox = BOPTest_Utilities::RotateShape(aRectangularBox,
- gp_Ax1(gp_Pnt(0, 0, 0), gp_Dir(0, 0, 1)),
+ gp_Ax1(gp_Pnt(0, 0, 0), gp_Dir(gp_Dir::D::Z)),
45.0 * M_PI / 180.0);
const TopoDS_Shape aResult = PerformCut(aNurbsBox, aRectangularBox);
ValidateResult(aResult, 4.41421);
constexpr Standard_Real r = M_SQRT2;
TopoDS_Shape aRectangularBox = BOPTest_Utilities::CreateBox(gp_Pnt(0, 0, 0), r, r / 2.0, 1.0);
aRectangularBox = BOPTest_Utilities::RotateShape(aRectangularBox,
- gp_Ax1(gp_Pnt(0, 0, 0), gp_Dir(0, 0, 1)),
+ gp_Ax1(gp_Pnt(0, 0, 0), gp_Dir(gp_Dir::D::Z)),
45.0 * M_PI / 180.0);
const TopoDS_Shape aResult = PerformCut(aRectangularBox, aNurbsBox);
ValidateResult(aResult, 5.82843);
const Standard_Real r = sqrt(2.0) / 2.0;
TopoDS_Shape aSquareBox = BOPTest_Utilities::CreateBox(gp_Pnt(0, 0, 0), r, r, 1.0);
aSquareBox = BOPTest_Utilities::RotateShape(aSquareBox,
- gp_Ax1(gp_Pnt(0, 0, 0), gp_Dir(0, 0, 1)),
+ gp_Ax1(gp_Pnt(0, 0, 0), gp_Dir(gp_Dir::D::Z)),
45.0 * M_PI / 180.0);
const TopoDS_Shape aResult = PerformCut(aNurbsBox, aSquareBox);
ValidateResult(aResult, 5.91421);
const Standard_Real r = sqrt(2.0) / 2.0;
TopoDS_Shape aSquareBox = BOPTest_Utilities::CreateBox(gp_Pnt(0, 0, 0), r, r, 1.0);
aSquareBox = BOPTest_Utilities::RotateShape(aSquareBox,
- gp_Ax1(gp_Pnt(0, 0, 0), gp_Dir(0, 0, 1)),
+ gp_Ax1(gp_Pnt(0, 0, 0), gp_Dir(gp_Dir::D::Z)),
45.0 * M_PI / 180.0);
const TopoDS_Shape aResult = PerformCut(aSquareBox, aNurbsBox);
ValidateResult(aResult, 2.91421);
constexpr Standard_Real r = M_SQRT2;
TopoDS_Shape aThinBox = BOPTest_Utilities::CreateBox(gp_Pnt(0, 0, 0), r, 0.25, 1.0);
aThinBox = BOPTest_Utilities::RotateShape(aThinBox,
- gp_Ax1(gp_Pnt(0, 0, 0), gp_Dir(0, 0, 1)),
+ gp_Ax1(gp_Pnt(0, 0, 0), gp_Dir(gp_Dir::D::Z)),
45.0 * M_PI / 180.0);
const TopoDS_Shape aResult = PerformCut(aNurbsBox, aThinBox);
ValidateResult(aResult, 7.03921);
constexpr Standard_Real r = M_SQRT2;
TopoDS_Shape aThinBox = BOPTest_Utilities::CreateBox(gp_Pnt(0, 0, 0), r, 0.25, 1.0);
aThinBox = BOPTest_Utilities::RotateShape(aThinBox,
- gp_Ax1(gp_Pnt(0, 0, 0), gp_Dir(0, 0, 1)),
+ gp_Ax1(gp_Pnt(0, 0, 0), gp_Dir(gp_Dir::D::Z)),
45.0 * M_PI / 180.0);
const TopoDS_Shape aResult = PerformCut(aThinBox, aNurbsBox);
ValidateResult(aResult, 1.83211);
constexpr Standard_Real r = 5.5677643628300219; // sqrt(31.0)
TopoDS_Shape aNarrowBox = BOPTest_Utilities::CreateBox(gp_Pnt(0, 0, 0), r / 4.0, 0.25, 1.0);
aNarrowBox = BOPTest_Utilities::RotateShape(aNarrowBox,
- gp_Ax1(gp_Pnt(0, 0, 0), gp_Dir(0, 0, 1)),
+ gp_Ax1(gp_Pnt(0, 0, 0), gp_Dir(gp_Dir::D::Z)),
34.73 * M_PI / 180.0);
const TopoDS_Shape aResult = PerformCut(aNurbsBox, aNarrowBox);
ValidateResult(aResult, 7.21677);
constexpr Standard_Real r = 5.5677643628300219;
TopoDS_Shape aNarrowBox = BOPTest_Utilities::CreateBox(gp_Pnt(0, 0, 0), r / 4.0, 0.25, 1.0);
aNarrowBox = BOPTest_Utilities::RotateShape(aNarrowBox,
- gp_Ax1(gp_Pnt(0, 0, 0), gp_Dir(0, 0, 1)),
+ gp_Ax1(gp_Pnt(0, 0, 0), gp_Dir(gp_Dir::D::Z)),
34.73 * M_PI / 180.0);
const TopoDS_Shape aResult = PerformCut(aNarrowBox, aNurbsBox);
ValidateResult(aResult, 1.54631);
{
TopoDS_Shape aSphere = BOPTest_Utilities::CreateSphere(gp_Pnt(0, 0, 0), 1.0);
aSphere = BOPTest_Utilities::RotateShape(aSphere,
- gp_Ax1(gp_Pnt(0, 0, 0), gp_Dir(0, 0, 1)),
+ gp_Ax1(gp_Pnt(0, 0, 0), gp_Dir(gp_Dir::D::Z)),
-90.0 * M_PI / 180.0);
aSphere = BOPTest_Utilities::RotateShape(aSphere,
- gp_Ax1(gp_Pnt(0, 0, 0), gp_Dir(0, 1, 0)),
+ gp_Ax1(gp_Pnt(0, 0, 0), gp_Dir(gp_Dir::D::Y)),
-45.0 * M_PI / 180.0);
const TopoDS_Shape aBox = BOPTest_Utilities::CreateBox(gp_Pnt(0, 0, 0), 1.0, 1.0, 1.0);
const TopoDS_Shape aResult = PerformCut(aSphere, aBox);
{
TopoDS_Shape aSphere = BOPTest_Utilities::CreateSphere(gp_Pnt(0, 0, 0), 1.0);
aSphere = BOPTest_Utilities::RotateShape(aSphere,
- gp_Ax1(gp_Pnt(0, 0, 0), gp_Dir(0, 0, 1)),
+ gp_Ax1(gp_Pnt(0, 0, 0), gp_Dir(gp_Dir::D::Z)),
-90.0 * M_PI / 180.0);
aSphere = BOPTest_Utilities::RotateShape(aSphere,
- gp_Ax1(gp_Pnt(0, 0, 0), gp_Dir(0, 1, 0)),
+ gp_Ax1(gp_Pnt(0, 0, 0), gp_Dir(gp_Dir::D::Y)),
-45.0 * M_PI / 180.0);
const TopoDS_Shape aBox = BOPTest_Utilities::CreateBox(gp_Pnt(0, 0, 0), 1.0, 1.0, 1.0);
const TopoDS_Shape aResult = PerformCut(aBox, aSphere);
const TopoDS_Shape aSphere = BOPTest_Utilities::CreateSphere(gp_Pnt(0, 0, 0), 1.0);
TopoDS_Shape aBox = BOPTest_Utilities::CreateBox(gp_Pnt(0, 0, 0), 1.0, 1.0, 1.0);
aBox = BOPTest_Utilities::RotateShape(aBox,
- gp_Ax1(gp_Pnt(0, 0, 1), gp_Dir(0, 1, 0)),
+ gp_Ax1(gp_Pnt(0, 0, 1), gp_Dir(gp_Dir::D::Y)),
90.0 * M_PI / 180.0);
const TopoDS_Shape aResult = PerformCut(aSphere, aBox);
ValidateResult(aResult, 13.3517);
const TopoDS_Shape aSphere = BOPTest_Utilities::CreateSphere(gp_Pnt(0, 0, 0), 1.0);
TopoDS_Shape aBox = BOPTest_Utilities::CreateBox(gp_Pnt(0, 0, 0), 1.0, 1.0, 1.0);
aBox = BOPTest_Utilities::RotateShape(aBox,
- gp_Ax1(gp_Pnt(0, 0, 1), gp_Dir(0, 1, 0)),
+ gp_Ax1(gp_Pnt(0, 0, 1), gp_Dir(gp_Dir::D::Y)),
90.0 * M_PI / 180.0);
const TopoDS_Shape aResult = PerformCut(aBox, aSphere);
ValidateResult(aResult, 5.2146);
const TopoDS_Shape aBox = BOPTest_Utilities::CreateBox(gp_Pnt(0, 0, 0), 100.0, 100.0, 40.0);
// Create exact G6 profile: "profile rev S b_4 F 50 20 Y 50 C 10 180 Y -50 C 10 180"
- gp_Pln aPlane(gp_Pnt(0, 0, 40), gp_Dir(0, 0, 1)); // Face b_4 of box (top face at Z=40)
+ gp_Pln aPlane(gp_Pnt(0, 0, 40), gp_Dir(gp_Dir::D::Z)); // Face b_4 of box (top face at Z=40)
std::vector<BOPTest_Utilities::ProfileOperation> aProfileOps = {
BOPTest_Utilities::ProfileOperation(BOPTest_Utilities::ProfileCmd::F, 50.0, 20.0), // F 50 20
BOPTest_Utilities::ProfileOperation(BOPTest_Utilities::ProfileCmd::Y, 50.0), // Y 50
// Create revolution: "revol rev2 rev 0 0 50 0 1 0 360" (around Y-axis at Z=50)
const TopoDS_Shape aRevolution =
BOPTest_Utilities::CreateRevolution(aProfile,
- gp_Ax1(gp_Pnt(0, 0, 50), gp_Dir(0, 1, 0)),
+ gp_Ax1(gp_Pnt(0, 0, 50), gp_Dir(gp_Dir::D::Y)),
2.0 * M_PI);
// Perform boolean cut operation: "bcut result b rev2"
TEST_F(BCutSimpleTest, ComplexProfileForwardForward_H4)
{
// Create profile p1: "profile p1 o 0 0 40 x 150 y 200 x -150"
- gp_Pln aPlane1(gp_Pnt(0, 0, 40), gp_Dir(0, 0, 1));
+ gp_Pln aPlane1(gp_Pnt(0, 0, 40), gp_Dir(gp_Dir::D::Z));
std::vector<BOPTest_Utilities::ProfileOperation> aProfileOps1 = {
BOPTest_Utilities::ProfileOperation(BOPTest_Utilities::ProfileCmd::O,
0.0,
const TopoDS_Shape aPrism1 = BOPTest_Utilities::CreatePrism(aProfile1, gp_Vec(0, 0, -40));
// Create profile p2: "profile p2 o 0 0 50 f 25 25 y 100 x 75 y -100"
- gp_Pln aPlane2(gp_Pnt(0, 0, 50), gp_Dir(0, 0, 1));
+ gp_Pln aPlane2(gp_Pnt(0, 0, 50), gp_Dir(gp_Dir::D::Z));
std::vector<BOPTest_Utilities::ProfileOperation> aProfileOps2 = {
BOPTest_Utilities::ProfileOperation(BOPTest_Utilities::ProfileCmd::O,
0.0,
// H5 has same profiles as H4, but p3 has different sequence: "f 50 -75 y -100 x 75 y 100"
// Create profile p1: same as H4 "profile p1 o 0 0 40 x 150 y 200 x -150"
- gp_Pln aPlane1(gp_Pnt(0, 0, 40), gp_Dir(0, 0, 1));
+ gp_Pln aPlane1(gp_Pnt(0, 0, 40), gp_Dir(gp_Dir::D::Z));
std::vector<BOPTest_Utilities::ProfileOperation> aProfileOps1 = {
BOPTest_Utilities::ProfileOperation(BOPTest_Utilities::ProfileCmd::O,
0.0,
const TopoDS_Shape aPrism1 = BOPTest_Utilities::CreatePrism(aProfile1, gp_Vec(0, 0, -40));
// Create profile p2: same as H4 "profile p2 o 0 0 50 f 25 25 y 100 x 75 y -100"
- gp_Pln aPlane2(gp_Pnt(0, 0, 50), gp_Dir(0, 0, 1));
+ gp_Pln aPlane2(gp_Pnt(0, 0, 50), gp_Dir(gp_Dir::D::Z));
std::vector<BOPTest_Utilities::ProfileOperation> aProfileOps2 = {
BOPTest_Utilities::ProfileOperation(BOPTest_Utilities::ProfileCmd::O,
0.0,
TEST_F(BCutSimpleTest, ComplexProfileForwardReversed_H6)
{
// Create profile p1: same as H4/H5 "profile p1 o 0 0 40 x 150 y 200 x -150"
- gp_Pln aPlane1(gp_Pnt(0, 0, 40), gp_Dir(0, 0, 1));
+ gp_Pln aPlane1(gp_Pnt(0, 0, 40), gp_Dir(gp_Dir::D::Z));
std::vector<BOPTest_Utilities::ProfileOperation> aProfileOps1 = {
BOPTest_Utilities::ProfileOperation(BOPTest_Utilities::ProfileCmd::O,
0.0,
const TopoDS_Shape aPrism1 = BOPTest_Utilities::CreatePrism(aProfile1, gp_Vec(0, 0, -40));
// Create profile p2: same as H4/H5 "profile p2 o 0 0 50 f 25 25 y 100 x 75 y -100"
- gp_Pln aPlane2(gp_Pnt(0, 0, 50), gp_Dir(0, 0, 1));
+ gp_Pln aPlane2(gp_Pnt(0, 0, 50), gp_Dir(gp_Dir::D::Z));
std::vector<BOPTest_Utilities::ProfileOperation> aProfileOps2 = {
BOPTest_Utilities::ProfileOperation(BOPTest_Utilities::ProfileCmd::O,
0.0,
TEST_F(BCutSimpleTest, ComplexProfileForwardReversedVariation_H7)
{
// Create profile p1: same as other H tests "profile p1 o 0 0 40 x 150 y 200 x -150"
- gp_Pln aPlane1(gp_Pnt(0, 0, 40), gp_Dir(0, 0, 1));
+ gp_Pln aPlane1(gp_Pnt(0, 0, 40), gp_Dir(gp_Dir::D::Z));
std::vector<BOPTest_Utilities::ProfileOperation> aProfileOps1 = {
BOPTest_Utilities::ProfileOperation(BOPTest_Utilities::ProfileCmd::O,
0.0,
const TopoDS_Shape aPrism1 = BOPTest_Utilities::CreatePrism(aProfile1, gp_Vec(0, 0, -40));
// Create profile p2: same as other H tests "profile p2 o 0 0 50 f 25 25 y 100 x 75 y -100"
- gp_Pln aPlane2(gp_Pnt(0, 0, 50), gp_Dir(0, 0, 1));
+ gp_Pln aPlane2(gp_Pnt(0, 0, 50), gp_Dir(gp_Dir::D::Z));
std::vector<BOPTest_Utilities::ProfileOperation> aProfileOps2 = {
BOPTest_Utilities::ProfileOperation(BOPTest_Utilities::ProfileCmd::O,
0.0,
TEST_F(BCutSimpleTest, ComplexProfileReversedForward_H8)
{
// Create profile p1: "profile p1 p 0 0 -1 1 0 0 o 0 0 40 y -200 x 150 y 200"
- gp_Pln aPlane1(gp_Pnt(0, 0, 40), gp_Dir(0, 0, 1)); // Use same approach as working H4/H5
+ gp_Pln aPlane1(gp_Pnt(0, 0, 40), gp_Dir(gp_Dir::D::Z)); // Use same approach as working H4/H5
std::vector<BOPTest_Utilities::ProfileOperation> aProfileOps1 = {
BOPTest_Utilities::ProfileOperation(BOPTest_Utilities::ProfileCmd::O,
0.0,
const TopoDS_Shape aPrism1 = BOPTest_Utilities::CreatePrism(aProfile1, gp_Vec(0, 0, -40));
// Create profile p2: "profile p2 p 0 0 -1 1 0 0 o 0 0 50 f 25 -25 x 75 y -100 x -75"
- gp_Pln aPlane2(gp_Pnt(0, 0, 50), gp_Dir(0, 0, 1));
+ gp_Pln aPlane2(gp_Pnt(0, 0, 50), gp_Dir(gp_Dir::D::Z));
std::vector<BOPTest_Utilities::ProfileOperation> aProfileOps2 = {
BOPTest_Utilities::ProfileOperation(BOPTest_Utilities::ProfileCmd::O,
0.0,
TEST_F(BCutSimpleTest, ComplexProfileReversedForwardVariation_H9)
{
// Create profile p1: same as H8 "profile p1 p 0 0 -1 1 0 0 o 0 0 40 y -200 x 150 y 200"
- gp_Pln aPlane1(gp_Pnt(0, 0, 40), gp_Dir(0, 0, 1));
+ gp_Pln aPlane1(gp_Pnt(0, 0, 40), gp_Dir(gp_Dir::D::Z));
std::vector<BOPTest_Utilities::ProfileOperation> aProfileOps1 = {
BOPTest_Utilities::ProfileOperation(BOPTest_Utilities::ProfileCmd::O,
0.0,
const TopoDS_Shape aPrism1 = BOPTest_Utilities::CreatePrism(aProfile1, gp_Vec(0, 0, -40));
// Create profile p2: same as H8 "profile p2 p 0 0 -1 1 0 0 o 0 0 50 f 25 -25 x 75 y -100 x -75"
- gp_Pln aPlane2(gp_Pnt(0, 0, 50), gp_Dir(0, 0, 1));
+ gp_Pln aPlane2(gp_Pnt(0, 0, 50), gp_Dir(gp_Dir::D::Z));
std::vector<BOPTest_Utilities::ProfileOperation> aProfileOps2 = {
BOPTest_Utilities::ProfileOperation(BOPTest_Utilities::ProfileCmd::O,
0.0,
TEST_F(BCutSimpleTest, ComplexProfileReversedReversed_I1)
{
// Create profile p1: same as H8/H9 "profile p1 p 0 0 -1 1 0 0 o 0 0 40 y -200 x 150 y 200"
- gp_Pln aPlane1(gp_Pnt(0, 0, 40), gp_Dir(0, 0, 1));
+ gp_Pln aPlane1(gp_Pnt(0, 0, 40), gp_Dir(gp_Dir::D::Z));
std::vector<BOPTest_Utilities::ProfileOperation> aProfileOps1 = {
BOPTest_Utilities::ProfileOperation(BOPTest_Utilities::ProfileCmd::O,
0.0,
// Create profile p2: same as H8/H9 "profile p2 p 0 0 -1 1 0 0 o 0 0 50 f 25 -25 x 75 y -100 x
// -75"
- gp_Pln aPlane2(gp_Pnt(0, 0, 50), gp_Dir(0, 0, 1));
+ gp_Pln aPlane2(gp_Pnt(0, 0, 50), gp_Dir(gp_Dir::D::Z));
std::vector<BOPTest_Utilities::ProfileOperation> aProfileOps2 = {
BOPTest_Utilities::ProfileOperation(BOPTest_Utilities::ProfileCmd::O,
0.0,
TEST_F(BCutSimpleTest, ComplexProfileReversedReversedVariation_I2)
{
// Create profile p1: same as I1 "profile p1 p 0 0 -1 1 0 0 o 0 0 40 y -200 x 150 y 200"
- gp_Pln aPlane1(gp_Pnt(0, 0, 40), gp_Dir(0, 0, 1));
+ gp_Pln aPlane1(gp_Pnt(0, 0, 40), gp_Dir(gp_Dir::D::Z));
std::vector<BOPTest_Utilities::ProfileOperation> aProfileOps1 = {
BOPTest_Utilities::ProfileOperation(BOPTest_Utilities::ProfileCmd::O,
0.0,
const TopoDS_Shape aPrism1 = BOPTest_Utilities::CreatePrism(aProfile1, gp_Vec(0, 0, -40));
// Create profile p2: same as I1 "profile p2 p 0 0 -1 1 0 0 o 0 0 50 f 25 -25 x 75 y -100 x -75"
- gp_Pln aPlane2(gp_Pnt(0, 0, 50), gp_Dir(0, 0, 1));
+ gp_Pln aPlane2(gp_Pnt(0, 0, 50), gp_Dir(gp_Dir::D::Z));
std::vector<BOPTest_Utilities::ProfileOperation> aProfileOps2 = {
BOPTest_Utilities::ProfileOperation(BOPTest_Utilities::ProfileCmd::O,
0.0,
TEST_F(BCutSimpleTest, ComplexProfileForwardForwardVariation2_I3)
{
// Create profile p1: "profile p1 o 0 0 40 f 0 50 x 150 y 100 x -150"
- gp_Pln aPlane1(gp_Pnt(0, 0, 40), gp_Dir(0, 0, 1));
+ gp_Pln aPlane1(gp_Pnt(0, 0, 40), gp_Dir(gp_Dir::D::Z));
std::vector<BOPTest_Utilities::ProfileOperation> aProfileOps1 = {
BOPTest_Utilities::ProfileOperation(BOPTest_Utilities::ProfileCmd::O,
0.0,
// Create profile p2: same as I1/I2 but different plane "profile p2 o 0 0 50 f 25 25 y 100 x 75 y
// -100"
- gp_Pln aPlane2(gp_Pnt(0, 0, 50), gp_Dir(0, 0, 1));
+ gp_Pln aPlane2(gp_Pnt(0, 0, 50), gp_Dir(gp_Dir::D::Z));
std::vector<BOPTest_Utilities::ProfileOperation> aProfileOps2 = {
BOPTest_Utilities::ProfileOperation(BOPTest_Utilities::ProfileCmd::O,
0.0,
TEST_F(BCutSimpleTest, ComplexProfileForwardForwardVariation3_I4)
{
// Create profile p1: same as I3 "profile p1 o 0 0 40 f 0 50 x 150 y 100 x -150"
- gp_Pln aPlane1(gp_Pnt(0, 0, 40), gp_Dir(0, 0, 1));
+ gp_Pln aPlane1(gp_Pnt(0, 0, 40), gp_Dir(gp_Dir::D::Z));
std::vector<BOPTest_Utilities::ProfileOperation> aProfileOps1 = {
BOPTest_Utilities::ProfileOperation(BOPTest_Utilities::ProfileCmd::O,
0.0,
const TopoDS_Shape aPrism1 = BOPTest_Utilities::CreatePrism(aProfile1, gp_Vec(0, 0, -40));
// Create profile p2: same as I3 "profile p2 o 0 0 50 f 25 25 y 100 x 75 y -100"
- gp_Pln aPlane2(gp_Pnt(0, 0, 50), gp_Dir(0, 0, 1));
+ gp_Pln aPlane2(gp_Pnt(0, 0, 50), gp_Dir(gp_Dir::D::Z));
std::vector<BOPTest_Utilities::ProfileOperation> aProfileOps2 = {
BOPTest_Utilities::ProfileOperation(BOPTest_Utilities::ProfileCmd::O,
0.0,
TEST_F(BCutSimpleTest, ComplexProfileForwardReversedVariation2_I5)
{
// Create profile p1: same as I3/I4 "profile p1 o 0 0 40 f 0 50 x 150 y 100 x -150"
- gp_Pln aPlane1(gp_Pnt(0, 0, 40), gp_Dir(0, 0, 1));
+ gp_Pln aPlane1(gp_Pnt(0, 0, 40), gp_Dir(gp_Dir::D::Z));
std::vector<BOPTest_Utilities::ProfileOperation> aProfileOps1 = {
BOPTest_Utilities::ProfileOperation(BOPTest_Utilities::ProfileCmd::O,
0.0,
const TopoDS_Shape aPrism1 = BOPTest_Utilities::CreatePrism(aProfile1, gp_Vec(0, 0, -40));
// Create profile p2: same as I3/I4 "profile p2 o 0 0 50 f 25 25 y 100 x 75 y -100"
- gp_Pln aPlane2(gp_Pnt(0, 0, 50), gp_Dir(0, 0, 1));
+ gp_Pln aPlane2(gp_Pnt(0, 0, 50), gp_Dir(gp_Dir::D::Z));
std::vector<BOPTest_Utilities::ProfileOperation> aProfileOps2 = {
BOPTest_Utilities::ProfileOperation(BOPTest_Utilities::ProfileCmd::O,
0.0,
TEST_F(BCutSimpleTest, ComplexProfileForwardReversedVariation3_I6)
{
// Same profiles as I5 but different p3 - "profile p3 o 0 0 50 f 50 75 y 100 x 75 y -100"
- gp_Pln aPlane1(gp_Pnt(0, 0, 40), gp_Dir(0, 0, 1));
+ gp_Pln aPlane1(gp_Pnt(0, 0, 40), gp_Dir(gp_Dir::D::Z));
std::vector<BOPTest_Utilities::ProfileOperation> aProfileOps1 = {
BOPTest_Utilities::ProfileOperation(BOPTest_Utilities::ProfileCmd::O, 0.0, 0.0, 40.0),
BOPTest_Utilities::ProfileOperation(BOPTest_Utilities::ProfileCmd::F, 0.0, 50.0),
const TopoDS_Shape aProfile1 = BOPTest_Utilities::CreateProfile(aPlane1, aProfileOps1);
const TopoDS_Shape aPrism1 = BOPTest_Utilities::CreatePrism(aProfile1, gp_Vec(0, 0, -40));
- gp_Pln aPlane2(gp_Pnt(0, 0, 50), gp_Dir(0, 0, 1));
+ gp_Pln aPlane2(gp_Pnt(0, 0, 50), gp_Dir(gp_Dir::D::Z));
std::vector<BOPTest_Utilities::ProfileOperation> aProfileOps2 = {
BOPTest_Utilities::ProfileOperation(BOPTest_Utilities::ProfileCmd::O, 0.0, 0.0, 50.0),
BOPTest_Utilities::ProfileOperation(BOPTest_Utilities::ProfileCmd::F, 25.0, 25.0),
TEST_F(BCutSimpleTest, ComplexProfileReversedForwardVariation2_I7)
{
// Create profile p1: "profile p1 p 0 0 -1 1 0 0 o 0 0 40 f 0 -50 y -100 x 150 y 100"
- gp_Pln aPlane1(gp_Pnt(0, 0, 40), gp_Dir(0, 0, 1));
+ gp_Pln aPlane1(gp_Pnt(0, 0, 40), gp_Dir(gp_Dir::D::Z));
std::vector<BOPTest_Utilities::ProfileOperation> aProfileOps1 = {
BOPTest_Utilities::ProfileOperation(BOPTest_Utilities::ProfileCmd::O,
0.0,
const TopoDS_Shape aPrism1 = BOPTest_Utilities::CreatePrism(aProfile1, gp_Vec(0, 0, -40));
// Create profile p2: "profile p2 p 0 0 -1 1 0 0 o 0 0 50 f 25 -25 x 75 y -100 x -75"
- gp_Pln aPlane2(gp_Pnt(0, 0, 50), gp_Dir(0, 0, 1));
+ gp_Pln aPlane2(gp_Pnt(0, 0, 50), gp_Dir(gp_Dir::D::Z));
std::vector<BOPTest_Utilities::ProfileOperation> aProfileOps2 = {
BOPTest_Utilities::ProfileOperation(BOPTest_Utilities::ProfileCmd::O,
0.0,
TEST_F(BCutSimpleTest, ComplexProfileReversedForwardVariation3_I8)
{
// Create profile p1: "profile p1 p 0 0 -1 1 0 0 o 0 0 40 f 0 -50 y -100 x 150 y 100"
- gp_Pln aPlane1(gp_Pnt(0, 0, 40), gp_Dir(0, 0, 1));
+ gp_Pln aPlane1(gp_Pnt(0, 0, 40), gp_Dir(gp_Dir::D::Z));
std::vector<BOPTest_Utilities::ProfileOperation> aProfileOps1 = {
BOPTest_Utilities::ProfileOperation(BOPTest_Utilities::ProfileCmd::O,
0.0,
const TopoDS_Shape aPrism1 = BOPTest_Utilities::CreatePrism(aProfile1, gp_Vec(0, 0, -40));
// Create profile p2: "profile p2 p 0 0 -1 1 0 0 o 0 0 50 f 25 -25 x 75 y -100 x -75"
- gp_Pln aPlane2(gp_Pnt(0, 0, 50), gp_Dir(0, 0, 1));
+ gp_Pln aPlane2(gp_Pnt(0, 0, 50), gp_Dir(gp_Dir::D::Z));
std::vector<BOPTest_Utilities::ProfileOperation> aProfileOps2 = {
BOPTest_Utilities::ProfileOperation(BOPTest_Utilities::ProfileCmd::O,
0.0,
TEST_F(BCutSimpleTest, ComplexProfileReversedReversedVariation2_I9)
{
// Create profile p1: "profile p1 p 0 0 -1 1 0 0 o 0 0 40 f 0 -50 y -100 x 150 y 100"
- gp_Pln aPlane1(gp_Pnt(0, 0, 40), gp_Dir(0, 0, 1));
+ gp_Pln aPlane1(gp_Pnt(0, 0, 40), gp_Dir(gp_Dir::D::Z));
std::vector<BOPTest_Utilities::ProfileOperation> aProfileOps1 = {
BOPTest_Utilities::ProfileOperation(BOPTest_Utilities::ProfileCmd::O,
0.0,
const TopoDS_Shape aPrism1 = BOPTest_Utilities::CreatePrism(aProfile1, gp_Vec(0, 0, -40));
// Create profile p2: "profile p2 p 0 0 -1 1 0 0 o 0 0 50 f 25 -25 x 75 y -100 x -75"
- gp_Pln aPlane2(gp_Pnt(0, 0, 50), gp_Dir(0, 0, 1));
+ gp_Pln aPlane2(gp_Pnt(0, 0, 50), gp_Dir(gp_Dir::D::Z));
std::vector<BOPTest_Utilities::ProfileOperation> aProfileOps2 = {
BOPTest_Utilities::ProfileOperation(BOPTest_Utilities::ProfileCmd::O,
0.0,
TEST_F(BCutSimpleTest1, ComplexProfileReversedReversedVariation3_J1)
{
// Create profile p1: "profile p1 p 0 0 -1 1 0 0 o 0 0 40 f 0 -50 y -100 x 150 y 100"
- gp_Pln aPlane1(gp_Pnt(0, 0, 40), gp_Dir(0, 0, 1));
+ gp_Pln aPlane1(gp_Pnt(0, 0, 40), gp_Dir(gp_Dir::D::Z));
std::vector<BOPTest_Utilities::ProfileOperation> aProfileOps1 = {
BOPTest_Utilities::ProfileOperation(BOPTest_Utilities::ProfileCmd::O,
0.0,
const TopoDS_Shape aPrism1 = BOPTest_Utilities::CreatePrism(aProfile1, gp_Vec(0, 0, -40));
// Create profile p2: "profile p2 p 0 0 -1 1 0 0 o 0 0 50 f 25 -25 x 75 y -100 x -75"
- gp_Pln aPlane2(gp_Pnt(0, 0, 50), gp_Dir(0, 0, 1));
+ gp_Pln aPlane2(gp_Pnt(0, 0, 50), gp_Dir(gp_Dir::D::Z));
std::vector<BOPTest_Utilities::ProfileOperation> aProfileOps2 = {
BOPTest_Utilities::ProfileOperation(BOPTest_Utilities::ProfileCmd::O,
0.0,
BOPTest_Utilities::CreateRectangularPrism(gp_Pnt(0, 0, 40), 175, 250, -40);
// Create profile p2: "profile p2 o 0 0 50 f 25 25 y 75 x 50 y -75"
- gp_Pln aPlane2(gp_Pnt(0, 0, 50), gp_Dir(0, 0, 1));
+ gp_Pln aPlane2(gp_Pnt(0, 0, 50), gp_Dir(gp_Dir::D::Z));
std::vector<BOPTest_Utilities::ProfileOperation> aProfileOps2 = {
BOPTest_Utilities::ProfileOperation(BOPTest_Utilities::ProfileCmd::O,
0.0,
BOPTest_Utilities::CreateRectangularPrism(gp_Pnt(0, 0, 40), 175, 250, -40);
// Create profile p2: "profile p2 p 0 0 -1 1 0 0 o 0 0 50 f 25 -25 y -75 x 50 y 75"
- gp_Pln aPlane2(gp_Pnt(0, 0, 0), gp_Dir(0, 0, 1));
+ gp_Pln aPlane2(gp_Pnt(0, 0, 0), gp_Dir(gp_Dir::D::Z));
std::vector<BOPTest_Utilities::ProfileOperation> aProfileOps2 = {
BOPTest_Utilities::ProfileOperation(BOPTest_Utilities::ProfileCmd::P,
0.0,
BOPTest_Utilities::CreateRectangularPrism(gp_Pnt(0, 0, 40), 175, 250, -40);
// Create profile p2: "profile p2 o 0 0 50 f 25 25 y 75 x 50 y -75"
- gp_Pln aPlane2(gp_Pnt(0, 0, 50), gp_Dir(0, 0, 1));
+ gp_Pln aPlane2(gp_Pnt(0, 0, 50), gp_Dir(gp_Dir::D::Z));
std::vector<BOPTest_Utilities::ProfileOperation> aProfileOps2 = {
BOPTest_Utilities::ProfileOperation(BOPTest_Utilities::ProfileCmd::O,
0.0,
BOPTest_Utilities::CreateRectangularPrism(gp_Pnt(0, 0, 40), 175, 250, -40);
// Create profile p2: "profile p2 o 0 0 50 f 25 25 y 75 x 50 y -75"
- gp_Pln aPlane2(gp_Pnt(0, 0, 50), gp_Dir(0, 0, 1));
+ gp_Pln aPlane2(gp_Pnt(0, 0, 50), gp_Dir(gp_Dir::D::Z));
std::vector<BOPTest_Utilities::ProfileOperation> aProfileOps2 = {
BOPTest_Utilities::ProfileOperation(BOPTest_Utilities::ProfileCmd::O,
0.0,
BOPTest_Utilities::CreateRectangularPrism(gp_Pnt(0, 0, 40), 175, 250, -40);
// Create profile p2: "profile p2 p 0 0 -1 1 0 0 o 0 0 50 f 25 -25 y -75 x 50 y 75"
- gp_Pln aPlane2(gp_Pnt(0, 0, 0), gp_Dir(0, 0, 1));
+ gp_Pln aPlane2(gp_Pnt(0, 0, 0), gp_Dir(gp_Dir::D::Z));
std::vector<BOPTest_Utilities::ProfileOperation> aProfileOps2 = {
BOPTest_Utilities::ProfileOperation(BOPTest_Utilities::ProfileCmd::P,
0.0,
BOPTest_Utilities::CreateRectangularPrism(gp_Pnt(0, 0, 40), 150, 200, -40);
// Create profile p2: "profile p2 o 0 0 50 f 25 25 y 100 x 75 y -100"
- gp_Pln aPlane2(gp_Pnt(0, 0, 50), gp_Dir(0, 0, 1));
+ gp_Pln aPlane2(gp_Pnt(0, 0, 50), gp_Dir(gp_Dir::D::Z));
std::vector<BOPTest_Utilities::ProfileOperation> aProfileOps2 = {
BOPTest_Utilities::ProfileOperation(BOPTest_Utilities::ProfileCmd::O,
0.0,
const TopoDS_Shape aIntermediate = aCutOp1.Shape();
// Create profile p3: "profile p3 o 0 0 -10 f 50 75 y 100 x 75 y -100"
- gp_Pln aPlane3(gp_Pnt(0, 0, -10), gp_Dir(0, 0, 1));
+ gp_Pln aPlane3(gp_Pnt(0, 0, -10), gp_Dir(gp_Dir::D::Z));
std::vector<BOPTest_Utilities::ProfileOperation> aProfileOps3 = {
BOPTest_Utilities::ProfileOperation(BOPTest_Utilities::ProfileCmd::O,
0.0,
BOPTest_Utilities::CreateRectangularPrism(gp_Pnt(0, 0, 40), 150, 200, -40);
// Create profile p2: "profile p2 o 0 0 50 f 25 25 y 100 x 75 y -100"
- gp_Pln aPlane2(gp_Pnt(0, 0, 50), gp_Dir(0, 0, 1));
+ gp_Pln aPlane2(gp_Pnt(0, 0, 50), gp_Dir(gp_Dir::D::Z));
std::vector<BOPTest_Utilities::ProfileOperation> aProfileOps2 = {
BOPTest_Utilities::ProfileOperation(BOPTest_Utilities::ProfileCmd::O,
0.0,
const TopoDS_Shape aIntermediate = aCutOp1.Shape();
// Create profile p3: "profile p3 o 0 0 -10 f 50 75 x 75 y 100 x -75"
- gp_Pln aPlane3(gp_Pnt(0, 0, -10), gp_Dir(0, 0, 1));
+ gp_Pln aPlane3(gp_Pnt(0, 0, -10), gp_Dir(gp_Dir::D::Z));
std::vector<BOPTest_Utilities::ProfileOperation> aProfileOps3 = {
BOPTest_Utilities::ProfileOperation(BOPTest_Utilities::ProfileCmd::O,
0.0,
BOPTest_Utilities::CreateRectangularPrism(gp_Pnt(0, 0, 40), 150, 200, -40);
// Create profile p2: "profile p2 o 0 0 50 f 25 25 y 100 x 75 y -100"
- gp_Pln aPlane2(gp_Pnt(0, 0, 50), gp_Dir(0, 0, 1));
+ gp_Pln aPlane2(gp_Pnt(0, 0, 50), gp_Dir(gp_Dir::D::Z));
std::vector<BOPTest_Utilities::ProfileOperation> aProfileOps2 = {
BOPTest_Utilities::ProfileOperation(BOPTest_Utilities::ProfileCmd::O,
0.0,
const TopoDS_Shape aIntermediate = aCutOp1.Shape();
// Create profile p3: "profile p3 p 0 0 -1 1 0 0 o 0 0 -10 f 50 -75 y -100 x 75 y 100"
- gp_Pln aPlane3(gp_Pnt(0, 0, -1), gp_Dir(1, 0, 0));
+ gp_Pln aPlane3(gp_Pnt(0, 0, -1), gp_Dir(gp_Dir::D::X));
std::vector<BOPTest_Utilities::ProfileOperation> aProfileOps3 = {
BOPTest_Utilities::ProfileOperation(BOPTest_Utilities::ProfileCmd::O,
0.0,
BOPTest_Utilities::CreateRectangularPrism(gp_Pnt(0, 0, 40), 150, 200, -40);
// Create profile p2: "profile p2 o 0 0 50 f 25 25 y 100 x 75 y -100"
- gp_Pln aPlane2(gp_Pnt(0, 0, 50), gp_Dir(0, 0, 1));
+ gp_Pln aPlane2(gp_Pnt(0, 0, 50), gp_Dir(gp_Dir::D::Z));
std::vector<BOPTest_Utilities::ProfileOperation> aProfileOps2 = {
BOPTest_Utilities::ProfileOperation(BOPTest_Utilities::ProfileCmd::O,
0.0,
const TopoDS_Shape aIntermediate = aCutOp1.Shape();
// Create profile p3: "profile p3 p 0 0 -1 1 0 0 o 0 0 -10 f 50 -75 x 75 y -100 x -75"
- gp_Pln aPlane3(gp_Pnt(0, 0, -1), gp_Dir(1, 0, 0));
+ gp_Pln aPlane3(gp_Pnt(0, 0, -1), gp_Dir(gp_Dir::D::X));
std::vector<BOPTest_Utilities::ProfileOperation> aProfileOps3 = {
BOPTest_Utilities::ProfileOperation(BOPTest_Utilities::ProfileCmd::O,
0.0,
TEST_F(BCutSimpleTest1, SameOrientedProfileReversedObjectForwardTool_K3)
{
// Create profile p1: "profile p1 p 0 0 -1 1 0 0 o 0 0 40 y -200 x 150 y 200"
- gp_Pln aPlane1(gp_Pnt(0, 0, 0), gp_Dir(0, 0, 1));
+ gp_Pln aPlane1(gp_Pnt(0, 0, 0), gp_Dir(gp_Dir::D::Z));
std::vector<BOPTest_Utilities::ProfileOperation> aProfileOps1 = {
BOPTest_Utilities::ProfileOperation(BOPTest_Utilities::ProfileCmd::P,
0.0,
const TopoDS_Shape aPrism1 = BOPTest_Utilities::CreatePrism(aProfile1, gp_Vec(0, 0, -40));
// Create profile p2: "profile p2 p 0 0 -1 1 0 0 o 0 0 50 f 25 -25 x 75 y -100 x -75"
- gp_Pln aPlane2(gp_Pnt(0, 0, 0), gp_Dir(0, 0, 1));
+ gp_Pln aPlane2(gp_Pnt(0, 0, 0), gp_Dir(gp_Dir::D::Z));
std::vector<BOPTest_Utilities::ProfileOperation> aProfileOps2 = {
BOPTest_Utilities::ProfileOperation(BOPTest_Utilities::ProfileCmd::P,
0.0,
const TopoDS_Shape aIntermediate = aCutOp1.Shape();
// Create profile p3: "profile p3 o 0 0 -10 f 50 75 y 100 x 75 y -100"
- gp_Pln aPlane3(gp_Pnt(0, 0, -10), gp_Dir(0, 0, 1));
+ gp_Pln aPlane3(gp_Pnt(0, 0, -10), gp_Dir(gp_Dir::D::Z));
std::vector<BOPTest_Utilities::ProfileOperation> aProfileOps3 = {
BOPTest_Utilities::ProfileOperation(BOPTest_Utilities::ProfileCmd::O,
0.0,
TEST_F(BCutSimpleTest1, SameOrientedProfileReversedObjectReversedTool_K4)
{
// Create profile p1: "profile p1 p 0 0 -1 1 0 0 o 0 0 40 y -200 x 150 y 200"
- gp_Pln aPlane1(gp_Pnt(0, 0, 0), gp_Dir(0, 0, 1));
+ gp_Pln aPlane1(gp_Pnt(0, 0, 0), gp_Dir(gp_Dir::D::Z));
std::vector<BOPTest_Utilities::ProfileOperation> aProfileOps1 = {
BOPTest_Utilities::ProfileOperation(BOPTest_Utilities::ProfileCmd::P,
0.0,
const TopoDS_Shape aPrism1 = BOPTest_Utilities::CreatePrism(aProfile1, gp_Vec(0, 0, -40));
// Create profile p2: "profile p2 p 0 0 -1 1 0 0 o 0 0 50 f 25 -25 x 75 y -100 x -75"
- gp_Pln aPlane2(gp_Pnt(0, 0, 0), gp_Dir(0, 0, 1));
+ gp_Pln aPlane2(gp_Pnt(0, 0, 0), gp_Dir(gp_Dir::D::Z));
std::vector<BOPTest_Utilities::ProfileOperation> aProfileOps2 = {
BOPTest_Utilities::ProfileOperation(BOPTest_Utilities::ProfileCmd::P,
0.0,
const TopoDS_Shape aIntermediate = aCutOp1.Shape();
// Create profile p3: "profile p3 o 0 0 -10 f 50 75 x 75 y 100 x -75"
- gp_Pln aPlane3(gp_Pnt(0, 0, -10), gp_Dir(0, 0, 1));
+ gp_Pln aPlane3(gp_Pnt(0, 0, -10), gp_Dir(gp_Dir::D::Z));
std::vector<BOPTest_Utilities::ProfileOperation> aProfileOps3 = {
BOPTest_Utilities::ProfileOperation(BOPTest_Utilities::ProfileCmd::O,
0.0,
BOPTest_Utilities::CreateRectangularPrism(gp_Pnt(0, 0, 40), 150, 200, -40);
// Create profile p2: "profile p2 o 0 0 50 f 25 25 y 100 x 75 y -100"
- gp_Pln aPlane2(gp_Pnt(0, 0, 50), gp_Dir(0, 0, 1));
+ gp_Pln aPlane2(gp_Pnt(0, 0, 50), gp_Dir(gp_Dir::D::Z));
std::vector<BOPTest_Utilities::ProfileOperation> aProfileOps2 = {
BOPTest_Utilities::ProfileOperation(BOPTest_Utilities::ProfileCmd::O,
0.0,
const TopoDS_Shape aIntermediate = aCutOp1.Shape();
// Create profile p3: "profile p3 p 0 0 -1 1 0 0 o 0 0 -10 f 50 -75 y -100 x 75 y 100"
- gp_Pln aPlane3(gp_Pnt(0, 0, -1), gp_Dir(1, 0, 0));
+ gp_Pln aPlane3(gp_Pnt(0, 0, -1), gp_Dir(gp_Dir::D::X));
std::vector<BOPTest_Utilities::ProfileOperation> aProfileOps3 = {
BOPTest_Utilities::ProfileOperation(BOPTest_Utilities::ProfileCmd::O,
0.0,
BOPTest_Utilities::CreateRectangularPrism(gp_Pnt(0, 0, 40), 150, 200, -40);
// Create profile p2: "profile p2 o 0 0 50 f 25 25 y 100 x 75 y -100"
- gp_Pln aPlane2(gp_Pnt(0, 0, 50), gp_Dir(0, 0, 1));
+ gp_Pln aPlane2(gp_Pnt(0, 0, 50), gp_Dir(gp_Dir::D::Z));
std::vector<BOPTest_Utilities::ProfileOperation> aProfileOps2 = {
BOPTest_Utilities::ProfileOperation(BOPTest_Utilities::ProfileCmd::O,
0.0,
const TopoDS_Shape aIntermediate = aCutOp1.Shape();
// Create profile p3: "profile p3 p 0 0 -1 1 0 0 o 0 0 -10 f 50 -75 x 75 y -100 x -75"
- gp_Pln aPlane3(gp_Pnt(0, 0, -1), gp_Dir(1, 0, 0));
+ gp_Pln aPlane3(gp_Pnt(0, 0, -1), gp_Dir(gp_Dir::D::X));
std::vector<BOPTest_Utilities::ProfileOperation> aProfileOps3 = {
BOPTest_Utilities::ProfileOperation(BOPTest_Utilities::ProfileCmd::O,
0.0,
BOPTest_Utilities::CreateRectangularPrism(gp_Pnt(0, 0, 40), 175, 250, -40);
// Create profile p2: "profile p2 o 0 0 50 f 25 25 y 75 x 50 y -75"
- gp_Pln aPlane2(gp_Pnt(0, 0, 50), gp_Dir(0, 0, 1));
+ gp_Pln aPlane2(gp_Pnt(0, 0, 50), gp_Dir(gp_Dir::D::Z));
std::vector<BOPTest_Utilities::ProfileOperation> aProfileOps2 = {
BOPTest_Utilities::ProfileOperation(BOPTest_Utilities::ProfileCmd::O,
0.0,
const TopoDS_Shape aIntermediate1 = aCutOp1.Shape();
// Create profile p3: "profile p3 p 0 0 -1 1 0 0 o 0 0 20 f 100 -150 y -75 x 50 y 75"
- gp_Pln aPlane3(gp_Pnt(0, 0, -1), gp_Dir(1, 0, 0));
+ gp_Pln aPlane3(gp_Pnt(0, 0, -1), gp_Dir(gp_Dir::D::X));
std::vector<BOPTest_Utilities::ProfileOperation> aProfileOps3 = {
BOPTest_Utilities::ProfileOperation(BOPTest_Utilities::ProfileCmd::O,
0.0,
const TopoDS_Shape aIntermediate2 = aCutOp2.Shape();
// Create profile p4: "profile p4 o 0 0 25 f 50 75 x 75 y 100 x -75"
- gp_Pln aPlane4(gp_Pnt(0, 0, 25), gp_Dir(0, 0, 1));
+ gp_Pln aPlane4(gp_Pnt(0, 0, 25), gp_Dir(gp_Dir::D::Z));
std::vector<BOPTest_Utilities::ProfileOperation> aProfileOps4 = {
BOPTest_Utilities::ProfileOperation(BOPTest_Utilities::ProfileCmd::O,
0.0,
BOPTest_Utilities::CreateRectangularPrism(gp_Pnt(0, 0, 40), 150, 200, -40);
// Create profile p2: "profile p2 o 0 0 50 f 25 25 y 100 x 75 y -100"
- gp_Pln aPlane2(gp_Pnt(0, 0, 50), gp_Dir(0, 0, 1));
+ gp_Pln aPlane2(gp_Pnt(0, 0, 50), gp_Dir(gp_Dir::D::Z));
std::vector<BOPTest_Utilities::ProfileOperation> aProfileOps2 = {
BOPTest_Utilities::ProfileOperation(BOPTest_Utilities::ProfileCmd::O,
0.0,
const TopoDS_Shape aIntermediate = aCutOp1.Shape();
// Create profile p3: "profile p3 p 0 0 -1 1 0 0 o 0 0 50 f 50 -125 x 75 y -50 x -75"
- gp_Pln aPlane3(gp_Pnt(0, 0, -1), gp_Dir(1, 0, 0));
+ gp_Pln aPlane3(gp_Pnt(0, 0, -1), gp_Dir(gp_Dir::D::X));
std::vector<BOPTest_Utilities::ProfileOperation> aProfileOps3 = {
BOPTest_Utilities::ProfileOperation(BOPTest_Utilities::ProfileCmd::O,
0.0,
BOPTest_Utilities::CreateRectangularPrism(gp_Pnt(0, 0, 40), 150, 200, -40);
// Create profile p2: "profile p2 o 0 0 50 f 25 25 y 100 x 75 y -100"
- gp_Pln aPlane2(gp_Pnt(0, 0, 50), gp_Dir(0, 0, 1));
+ gp_Pln aPlane2(gp_Pnt(0, 0, 50), gp_Dir(gp_Dir::D::Z));
std::vector<BOPTest_Utilities::ProfileOperation> aProfileOps2 = {
BOPTest_Utilities::ProfileOperation(BOPTest_Utilities::ProfileCmd::O,
0.0,
const TopoDS_Shape aIntermediate = aCutOp1.Shape();
// Create profile p3: "profile p3 p 0 0 -1 1 0 0 o 0 0 50 f 25 -125 x 50 y -50 x -50"
- gp_Pln aPlane3(gp_Pnt(0, 0, -1), gp_Dir(1, 0, 0));
+ gp_Pln aPlane3(gp_Pnt(0, 0, -1), gp_Dir(gp_Dir::D::X));
std::vector<BOPTest_Utilities::ProfileOperation> aProfileOps3 = {
BOPTest_Utilities::ProfileOperation(BOPTest_Utilities::ProfileCmd::O,
0.0,
BOPTest_Utilities::CreateRectangularPrism(gp_Pnt(0, 0, 40), 150, 200, -40);
// Create profile p2: "profile p2 o 0 0 50 f 25 25 y 100 x 75 y -100"
- gp_Pln aPlane2(gp_Pnt(0, 0, 50), gp_Dir(0, 0, 1));
+ gp_Pln aPlane2(gp_Pnt(0, 0, 50), gp_Dir(gp_Dir::D::Z));
std::vector<BOPTest_Utilities::ProfileOperation> aProfileOps2 = {
BOPTest_Utilities::ProfileOperation(BOPTest_Utilities::ProfileCmd::O,
0.0,
const TopoDS_Shape aIntermediate = aCutOp1.Shape();
// Create profile p3: "profile p3 p 0 0 -1 1 0 0 o 0 0 50 f 50 25 x 25 y -280 x -25"
- gp_Pln aPlane3(gp_Pnt(0, 0, -1), gp_Dir(1, 0, 0));
+ gp_Pln aPlane3(gp_Pnt(0, 0, -1), gp_Dir(gp_Dir::D::X));
std::vector<BOPTest_Utilities::ProfileOperation> aProfileOps3 = {
BOPTest_Utilities::ProfileOperation(BOPTest_Utilities::ProfileCmd::O,
0.0,
BOPTest_Utilities::CreateRectangularPrism(gp_Pnt(0, 0, 40), 150, 200, -40);
// Create profile p2: "profile p2 o 0 0 50 f 25 25 y 100 x 75 y -100"
- gp_Pln aPlane2(gp_Pnt(0, 0, 50), gp_Dir(0, 0, 1));
+ gp_Pln aPlane2(gp_Pnt(0, 0, 50), gp_Dir(gp_Dir::D::Z));
std::vector<BOPTest_Utilities::ProfileOperation> aProfileOps2 = {
BOPTest_Utilities::ProfileOperation(BOPTest_Utilities::ProfileCmd::O,
0.0,
const TopoDS_Shape aIntermediate = aCutOp1.Shape();
// Create profile p3: "profile p3 o 0 0 20 f 50 255 y -280 x 25 y 280"
- gp_Pln aPlane3(gp_Pnt(0, 0, 20), gp_Dir(0, 0, 1));
+ gp_Pln aPlane3(gp_Pnt(0, 0, 20), gp_Dir(gp_Dir::D::Z));
std::vector<BOPTest_Utilities::ProfileOperation> aProfileOps3 = {
BOPTest_Utilities::ProfileOperation(BOPTest_Utilities::ProfileCmd::O,
0.0,
TEST_F(BCutSimpleTest1, RolexCaseForwardForward_L3)
{
// Create profile f1: "profile f1 c 60 360"
- gp_Pln aPlane1(gp_Pnt(0, 0, 0), gp_Dir(0, 0, 1));
+ gp_Pln aPlane1(gp_Pnt(0, 0, 0), gp_Dir(gp_Dir::D::Z));
std::vector<BOPTest_Utilities::ProfileOperation> aProfileOps1 = {
BOPTest_Utilities::ProfileOperation(BOPTest_Utilities::ProfileCmd::C, 60.0, 360.0) // c 60 360
};
const TopoDS_Shape aPrism1 = BOPTest_Utilities::CreatePrism(aProfile1, gp_Vec(0, 0, 20));
// Create profile f2: "profile f2 o 0 0 20 f 10 -20 c 40 360"
- gp_Pln aPlane2(gp_Pnt(0, 0, 20), gp_Dir(0, 0, 1));
+ gp_Pln aPlane2(gp_Pnt(0, 0, 20), gp_Dir(gp_Dir::D::Z));
std::vector<BOPTest_Utilities::ProfileOperation> aProfileOps2 = {
BOPTest_Utilities::ProfileOperation(BOPTest_Utilities::ProfileCmd::O,
0.0,
const TopoDS_Shape aIntermediate = aCutOp1.Shape();
// Create profile f3: "profile f3 p 0 0 -1 1 0 0 o 0 0 23 f 50 -10 c -30 360"
- gp_Pln aPlane3(gp_Pnt(0, 0, -1), gp_Dir(1, 0, 0));
+ gp_Pln aPlane3(gp_Pnt(0, 0, -1), gp_Dir(gp_Dir::D::X));
std::vector<BOPTest_Utilities::ProfileOperation> aProfileOps3 = {
BOPTest_Utilities::ProfileOperation(BOPTest_Utilities::ProfileCmd::O,
0.0,
constexpr Standard_Real r = M_SQRT2;
TopoDS_Shape aBox2 = BOPTest_Utilities::CreateBox(gp_Pnt(0, 0, 0), r, 0.25, 1.0);
gp_Trsf aTrsf;
- aTrsf.SetRotation(gp_Ax1(gp_Pnt(0, 0, 0), gp_Dir(0, 0, 1)), M_PI / 4.0); // 45 degrees
+ aTrsf.SetRotation(gp_Ax1(gp_Pnt(0, 0, 0), gp_Dir(gp_Dir::D::Z)), M_PI / 4.0); // 45 degrees
aBox2.Move(aTrsf);
const TopoDS_Shape aResult = PerformFuse(aBox2, aBox1);
constexpr Standard_Real r = 5.5677643628300219;
TopoDS_Shape aBox2 = BOPTest_Utilities::CreateBox(gp_Pnt(0, 0, 0), r / 4.0, 0.25, 1.0);
gp_Trsf aTrsf;
- aTrsf.SetRotation(gp_Ax1(gp_Pnt(0, 0, 0), gp_Dir(0, 0, 1)), 34.73 * M_PI / 180.0);
+ aTrsf.SetRotation(gp_Ax1(gp_Pnt(0, 0, 0), gp_Dir(gp_Dir::D::Z)), 34.73 * M_PI / 180.0);
aBox2.Move(aTrsf);
const TopoDS_Shape aResult = PerformFuse(aBox2, aBox1);
// Apply rotations: -90 degrees around Z, then -45 degrees around Y
gp_Trsf aTrsf1, aTrsf2, aTrsfCombined;
- aTrsf1.SetRotation(gp_Ax1(gp_Pnt(0, 0, 0), gp_Dir(0, 0, 1)), -M_PI / 2.0); // -90 degrees Z
- aTrsf2.SetRotation(gp_Ax1(gp_Pnt(0, 0, 0), gp_Dir(0, 1, 0)), -M_PI / 4.0); // -45 degrees Y
+ aTrsf1.SetRotation(gp_Ax1(gp_Pnt(0, 0, 0), gp_Dir(gp_Dir::D::Z)), -M_PI / 2.0); // -90 degrees Z
+ aTrsf2.SetRotation(gp_Ax1(gp_Pnt(0, 0, 0), gp_Dir(gp_Dir::D::Y)), -M_PI / 4.0); // -45 degrees Y
aTrsfCombined = aTrsf2 * aTrsf1;
aSphere.Move(aTrsfCombined);
// Apply rotations: -90 degrees around Z, then -45 degrees around Y
gp_Trsf aTrsf1, aTrsf2, aTrsfCombined;
- aTrsf1.SetRotation(gp_Ax1(gp_Pnt(0, 0, 0), gp_Dir(0, 0, 1)), -M_PI / 2.0);
- aTrsf2.SetRotation(gp_Ax1(gp_Pnt(0, 0, 0), gp_Dir(0, 1, 0)), -M_PI / 4.0);
+ aTrsf1.SetRotation(gp_Ax1(gp_Pnt(0, 0, 0), gp_Dir(gp_Dir::D::Z)), -M_PI / 2.0);
+ aTrsf2.SetRotation(gp_Ax1(gp_Pnt(0, 0, 0), gp_Dir(gp_Dir::D::Y)), -M_PI / 4.0);
aTrsfCombined = aTrsf2 * aTrsf1;
aSphere.Move(aTrsfCombined);
TopoDS_Shape aBox = BOPTest_Utilities::CreateBox(gp_Pnt(0, 0, 0), 1.0, 1.0, 1.0);
// Rotate box 90 degrees around Y axis: "trotate b 0 0 1 0 1 0 90"
gp_Trsf aTrsf;
- aTrsf.SetRotation(gp_Ax1(gp_Pnt(0, 0, 1), gp_Dir(0, 1, 0)), M_PI / 2.0); // 90 degrees Y
+ aTrsf.SetRotation(gp_Ax1(gp_Pnt(0, 0, 1), gp_Dir(gp_Dir::D::Y)), M_PI / 2.0); // 90 degrees Y
aBox.Move(aTrsf);
const TopoDS_Shape aResult = PerformFuse(aSphere, aBox);
TopoDS_Shape aBox = BOPTest_Utilities::CreateBox(gp_Pnt(0, 0, 0), 1.0, 1.0, 1.0);
// Rotate box 90 degrees around Y axis: "trotate b 0 0 1 0 1 0 90"
gp_Trsf aTrsf;
- aTrsf.SetRotation(gp_Ax1(gp_Pnt(0, 0, 1), gp_Dir(0, 1, 0)), M_PI / 2.0); // 90 degrees Y
+ aTrsf.SetRotation(gp_Ax1(gp_Pnt(0, 0, 1), gp_Dir(gp_Dir::D::Y)), M_PI / 2.0); // 90 degrees Y
aBox.Move(aTrsf);
const TopoDS_Shape aResult = PerformFuse(aBox, aSphere);
{
// Create first profile: "profile f1 x 100 y 100 x -200 y -200 x 100"
// This creates a closed rectangular profile starting at origin
- gp_Pln aPlane1(gp_Ax3(gp_Pnt(0, 0, 0), gp_Dir(0, 0, 1)));
+ gp_Pln aPlane1(gp_Ax3(gp_Pnt(0, 0, 0), gp_Dir(gp_Dir::D::Z)));
std::vector<BOPTest_Utilities::ProfileOperation> aProfileOps1 = {
BOPTest_Utilities::ProfileOperation(BOPTest_Utilities::ProfileCmd::X,
100.0), // move to (100, 0)
// Create second profile: "profile f2 x -100 y 100 x 100; ttranslate f2 0 0 100"
// This creates a triangular profile translated to z=100
- gp_Pln aPlane2(gp_Ax3(gp_Pnt(0, 0, 100), gp_Dir(0, 0, 1)));
+ gp_Pln aPlane2(gp_Ax3(gp_Pnt(0, 0, 100), gp_Dir(gp_Dir::D::Z)));
std::vector<BOPTest_Utilities::ProfileOperation> aProfileOps2 = {
BOPTest_Utilities::ProfileOperation(BOPTest_Utilities::ProfileCmd::X,
-100.0), // move to (-100, 0)
const Standard_Real SCALE = 100.0;
// Create first profile: "profile f1 c 50*SCALE 180 x -100*SCALE c 50*SCALE 180"
- gp_Pln aPlane1(gp_Ax3(gp_Pnt(0, 0, 0), gp_Dir(0, 0, 1)));
+ gp_Pln aPlane1(gp_Ax3(gp_Pnt(0, 0, 0), gp_Dir(gp_Dir::D::Z)));
std::vector<BOPTest_Utilities::ProfileOperation> aProfileOps1 = {
BOPTest_Utilities::ProfileOperation(BOPTest_Utilities::ProfileCmd::C, 50.0 * SCALE, 180.0),
BOPTest_Utilities::ProfileOperation(BOPTest_Utilities::ProfileCmd::X, -100.0 * SCALE),
// Create second profile: "profile f2 x 300*SCALE y 200*SCALE x -300*SCALE; ttranslate f2
// -200*SCALE -50*SCALE 0"
- gp_Pln aPlane2(gp_Ax3(gp_Pnt(-200.0 * SCALE, -50.0 * SCALE, 0), gp_Dir(0, 0, 1)));
+ gp_Pln aPlane2(gp_Ax3(gp_Pnt(-200.0 * SCALE, -50.0 * SCALE, 0), gp_Dir(gp_Dir::D::Z)));
std::vector<BOPTest_Utilities::ProfileOperation> aProfileOps2 = {
BOPTest_Utilities::ProfileOperation(BOPTest_Utilities::ProfileCmd::X, 300.0 * SCALE),
BOPTest_Utilities::ProfileOperation(BOPTest_Utilities::ProfileCmd::Y, 200.0 * SCALE),
// Create revolution: "revol cyla pa 0 0 0 0 0 1 360"
const TopoDS_Shape aRevolution =
BOPTest_Utilities::CreateRevolution(aFace,
- gp_Ax1(gp_Pnt(0, 0, 0), gp_Dir(0, 0, 1)),
+ gp_Ax1(gp_Pnt(0, 0, 0), gp_Dir(gp_Dir::D::Z)),
2.0 * M_PI);
// Create cylinder: "pcylinder cylb 1 9; ttranslate cylb 5 0 -2"
// Create revolution: "revol ring f 0 0 0 0 0 1 269"
const TopoDS_Shape aRing =
BOPTest_Utilities::CreateRevolution(aFace,
- gp_Ax1(gp_Pnt(0, 0, 0), gp_Dir(0, 0, 1)),
+ gp_Ax1(gp_Pnt(0, 0, 0), gp_Dir(gp_Dir::D::Z)),
269.0 * M_PI / 180.0);
const TopoDS_Shape aResult = PerformFuse(aCylinder, aRing);
const TopoDS_Shape aRingFace = BOPTest_Utilities::CreateFaceFromWire(aRingWire);
// Create revolution: revol ring f 0 0 0 0 0 1 269
- const gp_Ax1 aAxis(gp_Pnt(0, 0, 0), gp_Dir(0, 0, 1));
+ const gp_Ax1 aAxis(gp_Pnt(0, 0, 0), gp_Dir(gp_Dir::D::Z));
const TopoDS_Shape aRing =
BOPTest_Utilities::CreateRevolution(aRingFace, aAxis, 269.0 * M_PI / 180.0);
{BOPTest_Utilities::ProfileCmd::Y, -25},
{BOPTest_Utilities::ProfileCmd::X, -60},
{BOPTest_Utilities::ProfileCmd::W, {}}};
- const gp_Pln aPlane(gp_Pnt(0, 0, 0), gp_Dir(1, 0, 0)); // pl 1 0 0 0 0 1 (normal 1,0,0)
+ const gp_Pln aPlane(gp_Pnt(0, 0, 0), gp_Dir(gp_Dir::D::X)); // pl 1 0 0 0 0 1 (normal 1,0,0)
const TopoDS_Shape aProfile = BOPTest_Utilities::CreateProfile(aPlane, aOps);
// Create revolution: revol rv wr 50 100 50 0 0 1 360
- const gp_Ax1 aRevAxis(gp_Pnt(50, 100, 50), gp_Dir(0, 0, 1));
+ const gp_Ax1 aRevAxis(gp_Pnt(50, 100, 50), gp_Dir(gp_Dir::D::Z));
const TopoDS_Shape aRevolution =
BOPTest_Utilities::CreateRevolution(aProfile, aRevAxis, 2 * M_PI);
const TopoDS_Shape aCylinder = BOPTest_Utilities::CreateCylinder(100.0, 50.0);
// Create plane and cylinder: plane pl1 100 100 100 0 0 1 1 0 0, pcylinder pc pl1 100 50
- // const gp_Ax3 anAx3(gp_Pnt(100, 100, 100), gp_Dir(0, 0, 1), gp_Dir(1, 0, 0));
+ // const gp_Ax3 anAx3(gp_Pnt(100, 100, 100), gp_Dir(gp_Dir::D::Z), gp_Dir(gp_Dir::D::X));
// const gp_Pln aPlane(anAx3);
// const TopoDS_Shape aCylinder = BOPTest_Utilities::CreateCylinderOnPlane(aPlane, 100.0, 50.0);
EXPECT_FALSE(aBlendedBox.IsNull()) << "Blend operation failed";
// Create plane and cylinder: plane pl1 100 100 100 0 0 1 -1 0 0, pcylinder pc pl1 100 50
- const gp_Ax3 anAx3(gp_Pnt(100, 100, 100), gp_Dir(0, 0, 1), gp_Dir(-1, 0, 0));
+ const gp_Ax3 anAx3(gp_Pnt(100, 100, 100), gp_Dir(gp_Dir::D::Z), gp_Dir(gp_Dir::D::NX));
const gp_Pln aPlane(anAx3);
const TopoDS_Shape aCylinder = BOPTest_Utilities::CreateCylinderOnPlane(aPlane, 100.0, 50.0);
EXPECT_FALSE(aCylinder.IsNull()) << "Cylinder creation failed";
const TopoDS_Shape aBlendedBox = BOPTest_Utilities::CreateBlend(aBox, 1, 100.0);
// Create plane and cylinder: plane pl1 100 100 100 0 0 1 0 1 0, pcylinder pc pl1 100 50
- const gp_Ax3 anAx3(gp_Pnt(100, 100, 100), gp_Dir(0, 0, 1), gp_Dir(0, 1, 0));
+ const gp_Ax3 anAx3(gp_Pnt(100, 100, 100), gp_Dir(gp_Dir::D::Z), gp_Dir(gp_Dir::D::Y));
const gp_Pln aPlane(anAx3);
const TopoDS_Shape aCylinder = BOPTest_Utilities::CreateCylinderOnPlane(aPlane, 100.0, 50.0);
const TopoDS_Shape aBlendedBox = BOPTest_Utilities::CreateBlend(aBox, 1, 100.0);
// Create plane and cylinder: plane pl1 100 100 100 0 0 1 0 -1 0, pcylinder pc pl1 100 50
- const gp_Ax3 anAx3(gp_Pnt(100, 100, 100), gp_Dir(0, 0, 1), gp_Dir(0, -1, 0));
+ const gp_Ax3 anAx3(gp_Pnt(100, 100, 100), gp_Dir(gp_Dir::D::Z), gp_Dir(gp_Dir::D::NY));
const gp_Pln aPlane(anAx3);
const TopoDS_Shape aCylinder = BOPTest_Utilities::CreateCylinderOnPlane(aPlane, 100.0, 50.0);
const TopoDS_Shape aBlendedBox = BOPTest_Utilities::CreateBlend(aBox, 1, 100.0);
// Create plane and cylinder: plane pl1 100 100 0 0 0 -1 1 0 0, pcylinder pc pl1 100 50
- const gp_Ax3 anAx3(gp_Pnt(100, 100, 0), gp_Dir(0, 0, -1), gp_Dir(1, 0, 0));
+ const gp_Ax3 anAx3(gp_Pnt(100, 100, 0), gp_Dir(gp_Dir::D::NZ), gp_Dir(gp_Dir::D::X));
const gp_Pln aPlane(anAx3);
const TopoDS_Shape aCylinder = BOPTest_Utilities::CreateCylinderOnPlane(aPlane, 100.0, 50.0);
const TopoDS_Shape aBlendedBox = BOPTest_Utilities::CreateBlend(aBox, 1, 100.0);
// Create plane and cylinder: plane pl1 100 100 0 0 0 -1 -1 0 0, pcylinder pc pl1 100 50
- const gp_Ax3 anAx3(gp_Pnt(100, 100, 0), gp_Dir(0, 0, -1), gp_Dir(-1, 0, 0));
+ const gp_Ax3 anAx3(gp_Pnt(100, 100, 0), gp_Dir(gp_Dir::D::NZ), gp_Dir(gp_Dir::D::NX));
const gp_Pln aPlane(anAx3);
const TopoDS_Shape aCylinder = BOPTest_Utilities::CreateCylinderOnPlane(aPlane, 100.0, 50.0);
const TopoDS_Shape aBlendedBox = BOPTest_Utilities::CreateBlend(aBox, 1, 100.0);
// Create plane and cylinder: plane pl1 100 100 0 0 0 -1 0 1 0, pcylinder pc pl1 100 50
- const gp_Ax3 anAx3(gp_Pnt(100, 100, 0), gp_Dir(0, 0, -1), gp_Dir(0, 1, 0));
+ const gp_Ax3 anAx3(gp_Pnt(100, 100, 0), gp_Dir(gp_Dir::D::NZ), gp_Dir(gp_Dir::D::Y));
const gp_Pln aPlane(anAx3);
const TopoDS_Shape aCylinder = BOPTest_Utilities::CreateCylinderOnPlane(aPlane, 100.0, 50.0);
const TopoDS_Shape aBlendedBox = BOPTest_Utilities::CreateBlend(aBox, 1, 100.0);
// Create plane and cylinder: plane pl1 100 100 0 0 0 -1 0 -1 0, pcylinder pc pl1 100 50
- const gp_Ax3 anAx3(gp_Pnt(100, 100, 0), gp_Dir(0, 0, -1), gp_Dir(0, -1, 0));
+ const gp_Ax3 anAx3(gp_Pnt(100, 100, 0), gp_Dir(gp_Dir::D::NZ), gp_Dir(gp_Dir::D::NY));
const gp_Pln aPlane(anAx3);
const TopoDS_Shape aCylinder = BOPTest_Utilities::CreateCylinderOnPlane(aPlane, 100.0, 50.0);
correct = Standard_False;
break;
}
- gp_Dir2d anUDir(1., 0.);
- gp_Dir2d aVDir(0., 1.);
+ gp_Dir2d anUDir(gp_Dir2d::D::X);
+ gp_Dir2d aVDir(gp_Dir2d::D::Y);
Standard_Real anAngularTolerance = Precision::Angular();
correctU =
if (Edge1.Orientation() == TopAbs_REVERSED)
{
- B.UpdateEdge(Edge1, new Geom2d_Line(gp_Pnt2d(0, f2), gp_Dir2d(-1, 0)), Face, T);
+ B.UpdateEdge(Edge1, new Geom2d_Line(gp_Pnt2d(0, f2), gp_Dir2d(gp_Dir2d::D::NX)), Face, T);
B.Range(Edge1, Face, -l1, -f1);
}
else
{
- B.UpdateEdge(Edge1, new Geom2d_Line(gp_Pnt2d(0, f2), gp_Dir2d(1, 0)), Face, T);
+ B.UpdateEdge(Edge1, new Geom2d_Line(gp_Pnt2d(0, f2), gp_Dir2d(gp_Dir2d::D::X)), Face, T);
B.Range(Edge1, Face, f1, l1);
}
if (Edge2.Orientation() == TopAbs_REVERSED)
{
- B.UpdateEdge(Edge2, new Geom2d_Line(gp_Pnt2d(0, l2), gp_Dir2d(-1, 0)), Face, T);
+ B.UpdateEdge(Edge2, new Geom2d_Line(gp_Pnt2d(0, l2), gp_Dir2d(gp_Dir2d::D::NX)), Face, T);
B.Range(Edge2, Face, -l1, -f1);
}
else
{
- B.UpdateEdge(Edge2, new Geom2d_Line(gp_Pnt2d(0, l2), gp_Dir2d(1, 0)), Face, T);
+ B.UpdateEdge(Edge2, new Geom2d_Line(gp_Pnt2d(0, l2), gp_Dir2d(gp_Dir2d::D::X)), Face, T);
B.Range(Edge2, Face, f1, l1);
}
if (Closed)
{
B.UpdateEdge(Edge3,
- new Geom2d_Line(gp_Pnt2d(l1, 0), gp_Dir2d(0, 1)),
- new Geom2d_Line(gp_Pnt2d(f1, 0), gp_Dir2d(0, 1)),
+ new Geom2d_Line(gp_Pnt2d(l1, 0), gp_Dir2d(gp_Dir2d::D::Y)),
+ new Geom2d_Line(gp_Pnt2d(f1, 0), gp_Dir2d(gp_Dir2d::D::Y)),
Face,
T);
}
else
{
- B.UpdateEdge(Edge3, new Geom2d_Line(gp_Pnt2d(f1, 0), gp_Dir2d(0, 1)), Face, T);
- B.UpdateEdge(Edge4, new Geom2d_Line(gp_Pnt2d(l1, 0), gp_Dir2d(0, 1)), Face, T);
+ B.UpdateEdge(Edge3, new Geom2d_Line(gp_Pnt2d(f1, 0), gp_Dir2d(gp_Dir2d::D::Y)), Face, T);
+ B.UpdateEdge(Edge4, new Geom2d_Line(gp_Pnt2d(l1, 0), gp_Dir2d(gp_Dir2d::D::Y)), Face, T);
}
// Set the non parameter flag;
if (Edge1.Orientation() == TopAbs_REVERSED)
{
- B.UpdateEdge(Edge1, new Geom2d_Line(gp_Pnt2d(0, f2), gp_Dir2d(-1, 0)), Face, T);
+ B.UpdateEdge(Edge1, new Geom2d_Line(gp_Pnt2d(0, f2), gp_Dir2d(gp_Dir2d::D::NX)), Face, T);
B.Range(Edge1, Face, -l1, -f1);
}
else
{
- B.UpdateEdge(Edge1, new Geom2d_Line(gp_Pnt2d(0, f2), gp_Dir2d(1, 0)), Face, T);
+ B.UpdateEdge(Edge1, new Geom2d_Line(gp_Pnt2d(0, f2), gp_Dir2d(gp_Dir2d::D::X)), Face, T);
B.Range(Edge1, Face, f1, l1);
}
if (Edge2.Orientation() == TopAbs_REVERSED)
{
- B.UpdateEdge(Edge2, new Geom2d_Line(gp_Pnt2d(0, l2), gp_Dir2d(-1, 0)), Face, T);
+ B.UpdateEdge(Edge2, new Geom2d_Line(gp_Pnt2d(0, l2), gp_Dir2d(gp_Dir2d::D::NX)), Face, T);
B.Range(Edge2, Face, -l1, -f1);
}
else
{
- B.UpdateEdge(Edge2, new Geom2d_Line(gp_Pnt2d(0, l2), gp_Dir2d(1, 0)), Face, T);
+ B.UpdateEdge(Edge2, new Geom2d_Line(gp_Pnt2d(0, l2), gp_Dir2d(gp_Dir2d::D::X)), Face, T);
B.Range(Edge2, Face, f1, l1);
}
if (Periodic)
{
B.UpdateEdge(Edge3,
- new Geom2d_Line(gp_Pnt2d(l1, 0), gp_Dir2d(0, 1)),
- new Geom2d_Line(gp_Pnt2d(f1, 0), gp_Dir2d(0, 1)),
+ new Geom2d_Line(gp_Pnt2d(l1, 0), gp_Dir2d(gp_Dir2d::D::Y)),
+ new Geom2d_Line(gp_Pnt2d(f1, 0), gp_Dir2d(gp_Dir2d::D::Y)),
Face,
T);
}
else
{
- B.UpdateEdge(Edge3, new Geom2d_Line(gp_Pnt2d(f1, 0), gp_Dir2d(0, 1)), Face, T);
- B.UpdateEdge(Edge4, new Geom2d_Line(gp_Pnt2d(l1, 0), gp_Dir2d(0, 1)), Face, T);
+ B.UpdateEdge(Edge3, new Geom2d_Line(gp_Pnt2d(f1, 0), gp_Dir2d(gp_Dir2d::D::Y)), Face, T);
+ B.UpdateEdge(Edge4, new Geom2d_Line(gp_Pnt2d(l1, 0), gp_Dir2d(gp_Dir2d::D::Y)), Face, T);
}
// Set the non parameter flag;
TColStd_SequenceOfReal EmptySeqOfReal;
// mark of the profile.
- gp_Ax3 AxeRef(gp_Pnt(0., 0., 0.), gp_Dir(0., 0., 1.), gp_Dir(1., 0., 0.));
+ gp_Ax3 AxeRef(gp_Pnt(0., 0., 0.), gp_Dir(gp_Dir::D::Z), gp_Dir(gp_Dir::D::X));
//---------------------------------------------------------------
// Construction of revolutions and tubes.
gp_Ax3 Axis = P->Position();
gp_Trsf T;
- gp_Ax3 AxeRef(gp_Pnt(0., 0., 0.), gp_Dir(0., 0., 1.), gp_Dir(1., 0., 0.));
+ gp_Ax3 AxeRef(gp_Pnt(0., 0., 0.), gp_Dir(gp_Dir::D::Z), gp_Dir(gp_Dir::D::X));
T.SetTransformation(AxeRef, Axis);
return TopLoc_Location(T);
{
if (Edge1.Orientation() == TopAbs_REVERSED)
{
- B.UpdateEdge(Edge1, new Geom2d_Line(gp_Pnt2d(0, f2), gp_Dir2d(-1, 0)), Face, T);
+ B.UpdateEdge(Edge1, new Geom2d_Line(gp_Pnt2d(0, f2), gp_Dir2d(gp_Dir2d::D::NX)), Face, T);
B.Range(Edge1, Face, -l1, -f1);
}
else
{
- B.UpdateEdge(Edge1, new Geom2d_Line(gp_Pnt2d(0, f2), gp_Dir2d(1, 0)), Face, T);
+ B.UpdateEdge(Edge1, new Geom2d_Line(gp_Pnt2d(0, f2), gp_Dir2d(gp_Dir2d::D::X)), Face, T);
B.Range(Edge1, Face, f1, l1);
}
if (Edge2.Orientation() == TopAbs_REVERSED)
{
- B.UpdateEdge(Edge2, new Geom2d_Line(gp_Pnt2d(0, l2), gp_Dir2d(-1, 0)), Face, T);
+ B.UpdateEdge(Edge2, new Geom2d_Line(gp_Pnt2d(0, l2), gp_Dir2d(gp_Dir2d::D::NX)), Face, T);
B.Range(Edge2, Face, -l1, -f1);
}
else
{
- B.UpdateEdge(Edge2, new Geom2d_Line(gp_Pnt2d(0, l2), gp_Dir2d(1, 0)), Face, T);
+ B.UpdateEdge(Edge2, new Geom2d_Line(gp_Pnt2d(0, l2), gp_Dir2d(gp_Dir2d::D::X)), Face, T);
B.Range(Edge2, Face, f1, l1);
}
}
if (Periodic)
{
B.UpdateEdge(Edge3,
- new Geom2d_Line(gp_Pnt2d(l1, 0), gp_Dir2d(0, 1)),
- new Geom2d_Line(gp_Pnt2d(f1, 0), gp_Dir2d(0, 1)),
+ new Geom2d_Line(gp_Pnt2d(l1, 0), gp_Dir2d(gp_Dir2d::D::Y)),
+ new Geom2d_Line(gp_Pnt2d(f1, 0), gp_Dir2d(gp_Dir2d::D::Y)),
Face,
T);
}
else
{
- B.UpdateEdge(Edge3, new Geom2d_Line(gp_Pnt2d(f1, 0), gp_Dir2d(0, 1)), Face, T);
- B.UpdateEdge(Edge4, new Geom2d_Line(gp_Pnt2d(l1, 0), gp_Dir2d(0, 1)), Face, T);
+ B.UpdateEdge(Edge3, new Geom2d_Line(gp_Pnt2d(f1, 0), gp_Dir2d(gp_Dir2d::D::Y)), Face, T);
+ B.UpdateEdge(Edge4, new Geom2d_Line(gp_Pnt2d(l1, 0), gp_Dir2d(gp_Dir2d::D::Y)), Face, T);
}
}
else
{
myLaws = new (GeomFill_HArray1OfSectionLaw)(1, 1);
// gp_Pnt Origine;
- gp_Dir D(1, 0, 0); // Following the normal
+ gp_Dir D(gp_Dir::D::X); // Following the normal
Handle(Geom_Line) L = new (Geom_Line)(BRep_Tool::Pnt(V), D);
Standard_Real Last = 2 * BRep_Tool::Tolerance(V) + Precision::PConfusion();
Handle(Geom_TrimmedCurve) TC = new (Geom_TrimmedCurve)(L, 0, Last);
Vl.Orientation(oriVsup); BB.Add(Esup2pi,Vl); BT.Parameter(Esup2pi,Vl,pl);
gp_Pnt2d tmp = PC->Value(pf); Standard_Real v = tmp.Y();
Handle(Geom2d_Line) L2d =
- new Geom2d_Line(gp_Pnt2d(-paronE,v),gp_Dir2d(1.,0.));
+ new Geom2d_Line(gp_Pnt2d(-paronE,v),gp_Dir2d(gp_Dir2d::D::X));
Handle(Geom2d_TrimmedCurve) PCsup2pi = new Geom2d_TrimmedCurve(L2d,paronE,pl);
TopOpeBRepDS_SetThePCurve(BB,Esup2pi,F,oriE,PCsup2pi);
const gp_Dir2d& D = HL->Direction();
Standard_Real tol = Precision::Angular();
- if (D.IsParallel(gp_Dir2d(0., 1.), tol))
+ if (D.IsParallel(gp_Dir2d(gp_Dir2d::D::Y), tol))
uiso = Standard_True;
- else if (D.IsParallel(gp_Dir2d(1., 0.), tol))
+ else if (D.IsParallel(gp_Dir2d(gp_Dir2d::D::X), tol))
viso = Standard_True;
}
}
Standard_Boolean isvgrowing = (vsup - vinf > -tol);
gp_Dir2d vdir;
if (isvgrowing)
- vdir = gp_Dir2d(0, 1);
+ vdir = gp_Dir2d(gp_Dir2d::D::Y);
else
- vdir = gp_Dir2d(0, -1);
+ vdir = gp_Dir2d(gp_Dir2d::D::NY);
gp_Pnt2d origin(uinf, vinf);
origin.Translate(gp_Vec2d(vdir).Scaled(p3df - par3dinf));
Standard_Real x = D1.X(), y = D1.Y(), z = D1.Z(), tol = Precision::Confusion();
Standard_Boolean nullx = (Abs(x) < tol), nully = (Abs(y) < tol), nullz = (Abs(z) < tol);
if (nullx && nully)
- D2 = gp_Dir(1, 0, 0);
+ D2 = gp_Dir(gp_Dir::D::X);
else if (nullx && nullz)
- D2 = gp_Dir(1, 0, 0);
+ D2 = gp_Dir(gp_Dir::D::X);
else if (nully && nullz)
- D2 = gp_Dir(0, 1, 0);
+ D2 = gp_Dir(gp_Dir::D::Y);
else
D2 = gp_Dir(y * z, x * z, -2. * x * y);
}
gp_Pnt2d po(0, -M_PI / 2);
if (maxcond)
po.SetY(M_PI / 2);
- aTrsf.SetMirror(gp_Ax2d(po, gp_Dir2d(1, 0)));
+ aTrsf.SetMirror(gp_Ax2d(po, gp_Dir2d(gp_Dir2d::D::X)));
PCT->Transform(aTrsf);
// add translation along U direction on PI
gp_Vec2d vec(M_PI, 0);
#ifdef OCCT_DEBUG
std::cout << "FUN_tool_nggeomF NYI" << std::endl;
#endif
- return gp_Dir(0, 0, 1);
+ return gp_Dir(gp_Dir::D::Z);
}
gp_Dir udir(d1u);
Standard_Real tol = Precision::Angular();
Standard_Boolean isoU = Standard_False, isoV = Standard_False;
- if (D.IsParallel(gp_Dir2d(0., 1.), tol))
+ if (D.IsParallel(gp_Dir2d(gp_Dir2d::D::Y), tol))
isoU = Standard_True;
- else if (D.IsParallel(gp_Dir2d(1., 0.), tol))
+ else if (D.IsParallel(gp_Dir2d(gp_Dir2d::D::X), tol))
isoV = Standard_True;
if (isoU)
{
// X = (tgC2d,0),Y = (xx,0),Z =(0,0,1)
// ------------------------------------------------------------
gp_Dir X, Y, Z;
- Z = gp_Dir(0., 0., 1.);
+ Z = gp_Dir(gp_Dir::D::Z);
X = gp_Dir(tgC2d.X(), tgC2d.Y(), 0.);
Y = Z ^ X;
gp_Dir2d xx(Y.X(), Y.Y());
break;
default: {
- return gp_Dir(1., 0., 0.);
+ return gp_Dir(gp_Dir::D::X);
}
}
break;
case BlendFunc_Rational:
case BlendFunc_QuasiAngular: {
- gp_Ax2 popAx2(gp_Pnt(0, 0, 0), gp_Dir(0, 0, 1));
+ gp_Ax2 popAx2(gp_Pnt(0, 0, 0), gp_Dir(gp_Dir::D::Z));
gp_Circ C(popAx2, 1);
Handle(Geom_TrimmedCurve) Sect1 = new Geom_TrimmedCurve(new Geom_Circle(C), 0., MaxAng);
Handle(Geom_BSplineCurve) CtoBspl = GeomConvert::CurveToBSplineCurve(Sect1, TConv);
gp_Circ2d C2 = Qualified2.Qualified();
Standard_Real R1 = C1.Radius();
Standard_Real R2 = C2.Radius();
- gp_Dir2d dirx(1., 0.);
+ gp_Dir2d dirx(gp_Dir2d::D::X);
gp_Pnt2d center1(C1.Location());
gp_Pnt2d center2(C2.Location());
TColStd_Array1OfReal Radius(1, 2);
Standard_Real Tol = Abs(Tolerance);
Standard_Real Radius = 0;
Standard_Boolean ok = Standard_False;
- gp_Dir2d dirx(1., 0.);
+ gp_Dir2d dirx(gp_Dir2d::D::X);
gp_Circ2d C1 = Qualified1.Qualified();
gp_Lin2d L2 = Qualified2.Qualified();
Standard_Real R1 = C1.Radius();
return;
}
Standard_Real Tol = Abs(Tolerance);
- gp_Dir2d dirx(1., 0.);
+ gp_Dir2d dirx(gp_Dir2d::D::X);
gp_Lin2d L1 = Qualified1.Qualified();
gp_Pnt2d originL1(L1.Location());
gp_Dir2d dirL1(L1.Direction());
TheSame2.Init(0);
WellDone = Standard_False;
NbrSol = 0;
- gp_Dir2d dirx(1., 0.);
+ gp_Dir2d dirx(gp_Dir2d::D::X);
Standard_Real Tol = Abs(Tolerance);
Standard_Real dist = Point1.Distance(Point2);
Standard_Real dp1cen = Point1.Distance(OnCirc.Location());
return;
}
- gp_Dir2d dirx(1., 0.);
+ gp_Dir2d dirx(gp_Dir2d::D::X);
Standard_Real Tol = Abs(Tolerance);
// calculation of bisectrices of L1 and L2
return;
}
TColStd_Array1OfReal Radius(1, 2);
- gp_Dir2d dirx(1., 0.);
+ gp_Dir2d dirx(gp_Dir2d::D::X);
gp_Circ2d C1 = Qualified1.Qualified();
Standard_Real R1 = C1.Radius();
gp_Pnt2d center1(C1.Location());
return;
}
Standard_Real Tol = Abs(Tolerance);
- gp_Dir2d dirx(1., 0.);
+ gp_Dir2d dirx(gp_Dir2d::D::X);
gp_Lin2d L1 = Qualified1.Qualified();
gp_Pnt2d originL1(L1.Location());
gp_Dir2d dirL1(L1.Direction());
WellDone = Standard_False;
NbrSol = 0;
- gp_Dir2d dirx(1., 0.);
+ gp_Dir2d dirx(gp_Dir2d::D::X);
Standard_Real dist = Point1.Distance(Point2);
if (dist < Abs(Tolerance))
{
Standard_Real Tol = Abs(Tolerance);
gp_Circ2d C1 = Qualified1.Qualified();
gp_Circ2d C2 = Qualified2.Qualified();
- gp_Dir2d dirx(1., 0.);
+ gp_Dir2d dirx(gp_Dir2d::D::X);
TColStd_Array1OfReal Radius(1, 2);
TColStd_Array1OfReal Rradius(1, 2);
gp_Pnt2d center1(C1.Location());
return;
}
Standard_Real Radius = 0;
- gp_Dir2d dirx(1., 0.);
+ gp_Dir2d dirx(gp_Dir2d::D::X);
gp_Circ2d C1 = Qualified1.Qualified();
gp_Lin2d L2 = Qualified2.Qualified();
Standard_Real R1 = C1.Radius();
}
Standard_Real Tol = Abs(Tolerance);
TColStd_Array1OfReal Radius(1, 2);
- gp_Dir2d dirx(1., 0.);
+ gp_Dir2d dirx(gp_Dir2d::D::X);
gp_Circ2d C1 = Qualified1.Qualified();
Standard_Real R1 = C1.Radius();
gp_Pnt2d center1(C1.Location());
WellDone = Standard_False;
NbrSol = 0;
- gp_Dir2d dirx(1., 0.);
+ gp_Dir2d dirx(gp_Dir2d::D::X);
if (!(Qualified1.IsEnclosed() || Qualified1.IsOutside() || Qualified1.IsUnqualified())
|| !(Qualified2.IsEnclosed() || Qualified2.IsOutside() || Qualified2.IsUnqualified()))
{
{
Standard_Real Tol = Abs(Tolerance);
- gp_Dir2d dirx(1., 0.);
+ gp_Dir2d dirx(gp_Dir2d::D::X);
WellDone = Standard_False;
NbrSol = 0;
if (!(Qualified1.IsEnclosed() || Qualified1.IsEnclosing() || Qualified1.IsOutside()
{
Standard_Real Tol = Abs(Tolerance);
- gp_Dir2d dirx(1., 0.);
+ gp_Dir2d dirx(gp_Dir2d::D::X);
NbrSol = 0;
WellDone = Standard_False;
if (!(Qualified1.IsEnclosed() || Qualified1.IsEnclosing() || Qualified1.IsOutside()
pararg2(1, 4)
{
- gp_Dir2d dirx(1.0, 0.0);
+ gp_Dir2d dirx(gp_Dir2d::D::X);
Standard_Real Tol = Abs(Tolerance);
NbrSol = 0;
WellDone = Standard_False;
pararg2(1, 2)
{
- gp_Dir2d dirx(1.0, 0.0);
+ gp_Dir2d dirx(gp_Dir2d::D::X);
Standard_Real Tol = Abs(Tolerance);
NbrSol = 0;
WellDone = Standard_False;
pararg2(1, 4)
{
- gp_Dir2d dirx(1.0, 0.0);
+ gp_Dir2d dirx(gp_Dir2d::D::X);
TColStd_Array1OfReal cote1(1, 2);
TColStd_Array1OfReal cote2(1, 2);
Standard_Integer nbrcote1 = 0;
pararg2(1, 2)
{
- gp_Dir2d dirx(1.0, 0.0);
+ gp_Dir2d dirx(gp_Dir2d::D::X);
Standard_Real Tol = Abs(Tolerance);
NbrSol = 0;
WellDone = Standard_False;
pararg3(1, 16)
{
- gp_Dir2d dirx(1.0, 0.0);
+ gp_Dir2d dirx(gp_Dir2d::D::X);
Standard_Real Tol = Abs(Tolerance);
WellDone = Standard_False;
NbrSol = 0;
pararg3(1, 16)
{
- gp_Dir2d dirx(1.0, 0.0);
+ gp_Dir2d dirx(gp_Dir2d::D::X);
Standard_Real Tol = Abs(Tolerance);
WellDone = Standard_False;
NbrSol = 0;
TheSame1.Init(0);
- gp_Dir2d dirx(1.0, 0.0);
+ gp_Dir2d dirx(gp_Dir2d::D::X);
Standard_Real Tol = Abs(Tolerance);
WellDone = Standard_False;
NbrSol = 0;
TheSame1.Init(0);
TheSame2.Init(0);
TheSame3.Init(0);
- gp_Dir2d dirx(1.0, 0.0);
+ gp_Dir2d dirx(gp_Dir2d::D::X);
WellDone = Standard_False;
NbrSol = 0;
if (!(Qualified1.IsEnclosed() || Qualified1.IsOutside() || Qualified1.IsUnqualified())
pararg3(1, MaxSol)
{
- gp_Dir2d dirx(1.0, 0.0);
+ gp_Dir2d dirx(gp_Dir2d::D::X);
Standard_Real Tol = Abs(Tolerance);
WellDone = Standard_False;
NbrSol = 0;
pararg3(1, 4)
{
- gp_Dir2d dirx(1.0, 0.0);
+ gp_Dir2d dirx(gp_Dir2d::D::X);
Standard_Real Tol = Abs(Tolerance);
Standard_Real MaxRad = 1e10, MinRad = 1e-6;
WellDone = Standard_False;
pararg3(1, 2)
{
- gp_Dir2d dirx(1.0, 0.0);
+ gp_Dir2d dirx(gp_Dir2d::D::X);
WellDone = Standard_False;
Standard_Real Tol = Abs(Tolerance);
NbrSol = 0;
pararg3(1, 2)
{
- gp_Dir2d dirx(1.0, 0.0);
+ gp_Dir2d dirx(gp_Dir2d::D::X);
Standard_Real Tol = Abs(Tolerance);
WellDone = Standard_False;
NbrSol = 0;
WellDone = Standard_False;
Standard_Real Tol = Abs(Tolerance);
- gp_Dir2d dirx(1.0, 0.0);
+ gp_Dir2d dirx(gp_Dir2d::D::X);
NbrSol = 0;
if (!(Qualified1.IsEnclosed() || Qualified1.IsOutside() || Qualified1.IsUnqualified()))
{
pararg3(1, 1)
{
- gp_Dir2d dirx(1.0, 0.0);
+ gp_Dir2d dirx(gp_Dir2d::D::X);
WellDone = Standard_False;
NbrSol = 0;
dircen.SetCoord(xcencir2 - xcencir1, ycencir2 - ycencir1);
medcen.SetCoord(ycencir2 - ycencir1, xcencir1 - xcencir2);
}
- gp_Dir2d dirx(1.0, 0.0);
+ gp_Dir2d dirx(gp_Dir2d::D::X);
gp_Ax2d acenx(pcen, dirx);
gp_Ax2d acencen(pcen, dircen);
throw GccEnt_BadQualifier();
return;
}
- gp_Dir2d dirx(1.0, 0.0);
+ gp_Dir2d dirx(gp_Dir2d::D::X);
Standard_Real Tol = Abs(Tolerance);
gp_Circ2d C1 = Qualified1.Qualified();
Standard_Real R1 = C1.Radius();
pararg1(1, 1)
{
- gp_Dir2d dirx(1.0, 0.0);
+ gp_Dir2d dirx(gp_Dir2d::D::X);
Standard_Real rayon = Linetan.Distance(Pcenter);
cirsol(1) = gp_Circ2d(gp_Ax2d(Pcenter, dirx), rayon);
// ==================================================
pararg1(1, 1)
{
- gp_Dir2d dirx(1.0, 0.0);
+ gp_Dir2d dirx(gp_Dir2d::D::X);
Standard_Real rayon = Point1.Distance(Pcenter);
cirsol(1) = gp_Circ2d(gp_Ax2d(Pcenter, dirx), rayon);
// =================================================
{
TheSame1.Init(0);
- gp_Dir2d dirx(1.0, 0.0);
+ gp_Dir2d dirx(gp_Dir2d::D::X);
Standard_Real Tol = Abs(Tolerance);
WellDone = Standard_False;
NbrSol = 0;
{
Standard_Real Tol = Abs(Tolerance);
- gp_Dir2d dirx(1.0, 0.0);
+ gp_Dir2d dirx(gp_Dir2d::D::X);
WellDone = Standard_False;
NbrSol = 0;
if (!(Qualified1.IsEnclosed() || Qualified1.IsOutside() || Qualified1.IsUnqualified()))
parcen3(1, 2)
{
- gp_Dir2d dirx(1.0, 0.0);
+ gp_Dir2d dirx(gp_Dir2d::D::X);
Standard_Real Tol = Abs(Tolerance);
WellDone = Standard_False;
NbrSol = 0;
{
TheSame1.Init(0);
- gp_Dir2d dirx(1.0, 0.0);
+ gp_Dir2d dirx(gp_Dir2d::D::X);
Standard_Real Tol = Abs(Tolerance);
Standard_Integer signe[5];
signe[0] = 0;
{
TheSame1.Init(0);
- gp_Dir2d dirx(1.0, 0.0);
+ gp_Dir2d dirx(gp_Dir2d::D::X);
Standard_Real Tol = Abs(Tolerance);
WellDone = Standard_False;
NbrSol = 0;
parcen3(1, 2)
{
- gp_Dir2d dirx(1.0, 0.0);
+ gp_Dir2d dirx(gp_Dir2d::D::X);
Standard_Real Tol = Abs(Tolerance);
WellDone = Standard_False;
NbrSol = 0;
if (dist < myTolerance)
{
- gp_Circ2d biscirpnt1(gp_Ax2d(point, gp_Dir2d(1.0, 0.0)), R1 / 2.);
+ gp_Circ2d biscirpnt1(gp_Ax2d(point, gp_Dir2d(gp_Dir2d::D::X)), R1 / 2.);
bissol = new GccInt_BCirc(biscirpnt1);
// ==========================================================
}
gp_Circ2d C2 = Qualified2.Qualified();
Standard_Real R1 = C1.Radius();
Standard_Real R2 = C2.Radius();
- gp_Dir2d dirx(1., 0.);
+ gp_Dir2d dirx(gp_Dir2d::D::X);
gp_Pnt2d center1(C1.Location());
gp_Pnt2d center2(C2.Location());
GccAna_Circ2dBisec Bis(C1, C2);
throw GccEnt_BadQualifier();
return;
}
- gp_Dir2d dirx(1., 0.);
+ gp_Dir2d dirx(gp_Dir2d::D::X);
gp_Circ2d C1 = Qualified1.Qualified();
gp_Lin2d L2 = Qualified2.Qualified();
Standard_Real R1 = C1.Radius();
}
Standard_Real Tol = Abs(Tolerance);
Standard_Real Radius = 0;
- gp_Dir2d dirx(1., 0.);
+ gp_Dir2d dirx(gp_Dir2d::D::X);
gp_Lin2d L1 = Qualified1.Qualified();
gp_Lin2d L2 = Qualified2.Qualified();
gp_Dir2d dir1(L1.Direction());
}
Standard_Real Tol = Abs(Tolerance);
Standard_Real Radius;
- gp_Dir2d dirx(1., 0.);
+ gp_Dir2d dirx(gp_Dir2d::D::X);
gp_Circ2d C1 = Qualified1.Qualified();
Standard_Real R1 = C1.Radius();
gp_Pnt2d center1(C1.Location());
throw GccEnt_BadQualifier();
return;
}
- gp_Dir2d dirx(1., 0.);
+ gp_Dir2d dirx(gp_Dir2d::D::X);
gp_Lin2d L1 = Qualified1.Qualified();
gp_Pnt2d origin1(L1.Location());
gp_Dir2d dir1(L1.Direction());
Standard_Real lastparam;
Standard_Real Tol = Abs(Tolerance);
NbrSol = 0;
- gp_Dir2d dirx(1., 0.);
+ gp_Dir2d dirx(gp_Dir2d::D::X);
GccAna_Pnt2dBisec Bis(Point1, Point2);
if (Bis.IsDone())
{
throw GccEnt_BadQualifier();
return;
}
- gp_Dir2d dirx(1., 0.);
+ gp_Dir2d dirx(gp_Dir2d::D::X);
gp_Lin2d L1 = Qualified1.Qualified();
Geom2dAdaptor_Curve Cu2 = Qualified2.Qualified();
math_Vector Umin(1, 4);
return;
}
Standard_Real Tol = Abs(Tolerance);
- gp_Dir2d dirx(1., 0.);
+ gp_Dir2d dirx(gp_Dir2d::D::X);
Geom2dAdaptor_Curve Cu1 = Qualified1.Qualified();
Geom2dAdaptor_Curve Cu2 = Qualified2.Qualified();
math_Vector Umin(1, 4);
return;
}
Standard_Real Tol = Abs(Tolerance);
- gp_Dir2d dirx(1., 0.);
+ gp_Dir2d dirx(gp_Dir2d::D::X);
Geom2dAdaptor_Curve Cu1 = Qualified1.Qualified();
math_Vector Umin(1, 3);
math_Vector Umax(1, 3);
return;
}
Standard_Real Tol = Abs(Tolerance);
- gp_Dir2d dirx(1., 0.);
+ gp_Dir2d dirx(gp_Dir2d::D::X);
gp_Circ2d C1 = Qualified1.Qualified();
Standard_Real R1 = C1.Radius();
Geom2dAdaptor_Curve Cu2 = Qualified2.Qualified();
return;
}
Standard_Real Tol = Abs(Tolerance);
- gp_Dir2d dirx(1., 0.);
+ gp_Dir2d dirx(gp_Dir2d::D::X);
gp_Circ2d C1 = Qualified1.Qualified();
Standard_Real R1 = C1.Radius();
Geom2dAdaptor_Curve Cu2 = Qualified2.Qualified();
return;
}
Standard_Real Tol = Abs(Tolerance);
- gp_Dir2d dirx(1., 0.);
+ gp_Dir2d dirx(gp_Dir2d::D::X);
gp_Lin2d L1 = Qualified1.Qualified();
Geom2dAdaptor_Curve Cu2 = Qualified2.Qualified();
math_Vector Umin(1, 4);
return;
}
Standard_Real Tol = Abs(Tolerance);
- gp_Dir2d dirx(1., 0.);
+ gp_Dir2d dirx(gp_Dir2d::D::X);
Geom2dAdaptor_Curve Cu1 = Qualified1.Qualified();
Geom2dAdaptor_Curve Cu2 = Qualified2.Qualified();
math_Vector Umin(1, 4);
return;
}
Standard_Real Tol = Abs(Tolerance);
- gp_Dir2d dirx(1., 0.);
+ gp_Dir2d dirx(gp_Dir2d::D::X);
Geom2dAdaptor_Curve Cu1 = Qualified1.Qualified();
math_Vector Umin(1, 3);
math_Vector Umax(1, 3);
throw GccEnt_BadQualifier();
return;
}
- gp_Dir2d dirx(1., 0.);
+ gp_Dir2d dirx(gp_Dir2d::D::X);
Geom2dAdaptor_Curve Cu1 = Qualified1.Qualified();
Geom2dAdaptor_Curve Cu2 = Qualified2.Qualified();
math_Vector Umin(1, 4);
Standard_Real dist2 = point3.Distance(point2);
if (Abs(dist1 - dist2) / 2. <= Tol)
{
- gp_Dir2d dirx(1., 0.);
+ gp_Dir2d dirx(gp_Dir2d::D::X);
cirsol = gp_Circ2d(gp_Ax2d(point3, dirx), (dist1 + dist2) / 2.);
Standard_Real normetan2 = Tan2.Magnitude();
gp_Vec2d Vec1(point1.XY(), point3.XY());
return;
}
Standard_Real Tol = Abs(Tolerance);
- gp_Dir2d dirx(1., 0.);
+ gp_Dir2d dirx(gp_Dir2d::D::X);
gp_Lin2d L1 = Qualified1.Qualified();
Geom2dAdaptor_Curve Cu2 = Qualified2.Qualified();
math_Vector Umin(1, 4);
return;
}
Standard_Real Tol = Abs(Tolerance);
- gp_Dir2d dirx(1., 0.);
+ gp_Dir2d dirx(gp_Dir2d::D::X);
Geom2dAdaptor_Curve Cu1 = Qualified1.Qualified();
math_Vector Umin(1, 3);
math_Vector Umax(1, 3);
Standard_Real thelast = 100000.;
Standard_Real firstparam;
Standard_Real lastparam;
- gp_Dir2d dirx(1., 0.);
+ gp_Dir2d dirx(gp_Dir2d::D::X);
TColStd_Array1OfReal cote1(1, 2);
TColStd_Array1OfReal cote2(1, 2);
Standard_Integer nbrcote1 = 0;
Standard_Real thelast = 100000.;
Standard_Real firstparam;
Standard_Real lastparam;
- gp_Dir2d dirx(1., 0.);
+ gp_Dir2d dirx(gp_Dir2d::D::X);
TColStd_Array1OfReal cote1(1, 2);
TColStd_Array1OfReal cote2(1, 2);
Standard_Integer nbrcote1 = 0;
Standard_Real thelast = 100000.;
Standard_Real firstparam;
Standard_Real lastparam;
- gp_Dir2d dirx(1., 0.);
+ gp_Dir2d dirx(gp_Dir2d::D::X);
TColStd_Array1OfReal cote1(1, 2);
Standard_Integer nbrcote1 = 0;
WellDone = Standard_False;
cote1(1) = Radius;
cote1(2) = -Radius;
}
- gp_Circ2d Circ(gp_Ax2d(Point2, gp_Dir2d(1., 0.)), Radius);
+ gp_Circ2d Circ(gp_Ax2d(Point2, gp_Dir2d(gp_Dir2d::D::X)), Radius);
IntRes2d_Domain D1(ElCLib::Value(0., Circ),
0.,
Tol,
const Standard_Real thefirst = -100000.;
const Standard_Real thelast = 100000.;
#endif
- gp_Dir2d dirx(1., 0.);
+ gp_Dir2d dirx(gp_Dir2d::D::X);
TColStd_Array1OfReal cote1(1, 2);
TColStd_Array1OfReal cote2(1, 2);
Standard_Integer nbrcote1 = 0;
throw GccEnt_BadQualifier();
return;
}
- gp_Circ2d C1(gp_Ax2d(Point3, gp_Dir2d(1., 0.)), 0.);
+ gp_Circ2d C1(gp_Ax2d(Point3, gp_Dir2d(gp_Dir2d::D::X)), 0.);
Geom2dAdaptor_Curve Cu1 = Qualified1.Qualified();
Geom2dAdaptor_Curve Cu2 = Qualified2.Qualified();
Geom2dGcc_FunctionTanCuCuCu Func(C1, Cu1, Cu2);
throw GccEnt_BadQualifier();
return;
}
- gp_Dir2d dirx(1., 0.);
- gp_Circ2d C1(gp_Ax2d(Point2, dirx), 0.);
- gp_Circ2d C2(gp_Ax2d(Point3, dirx), 0.);
+ gp_Circ2d C1(gp_Ax2d(Point2, gp_Dir2d(gp_Dir2d::D::X)), 0.);
+ gp_Circ2d C2(gp_Ax2d(Point3, gp_Dir2d(gp_Dir2d::D::X)), 0.);
Geom2dAdaptor_Curve Cu1 = Qualified1.Qualified();
Geom2dGcc_FunctionTanCuCuCu Func(C1, C2, Cu1);
math_Vector Umin(1, 3);
throw GccEnt_BadQualifier();
return;
}
- gp_Dir2d dirx(1., 0.);
gp_Lin2d L1 = Qualified1.Qualified();
Geom2dAdaptor_Curve Cu2 = Qualified2.Qualified();
- gp_Circ2d C3(gp_Ax2d(Point3, dirx), 0.);
+ gp_Circ2d C3(gp_Ax2d(Point3, gp_Dir2d(gp_Dir2d::D::X)), 0.);
Geom2dGcc_FunctionTanCuCuCu Func(C3, L1, Cu2);
math_Vector Umin(1, 3);
math_Vector Umax(1, 3);
}
gp_Circ2d C1 = Qualified1.Qualified();
Geom2dAdaptor_Curve Cu2 = Qualified2.Qualified();
- gp_Dir2d dirx(1., 0.);
- gp_Circ2d C3(gp_Ax2d(Point3, dirx), 0.);
+ gp_Circ2d C3(gp_Ax2d(Point3, gp_Dir2d(gp_Dir2d::D::X)), 0.);
Geom2dGcc_FunctionTanCuCuCu Func(C1, C3, Cu2);
math_Vector Umin(1, 3);
math_Vector Umax(1, 3);
theDist2(2) = 0.;
Standard_Integer i = 1;
Standard_Integer nbsol = 0;
- gp_Dir2d dirx(1.0, 0.0);
+ gp_Dir2d dirx(gp_Dir2d::D::X);
Standard_Real thePar;
Geom2dAdaptor_Curve curve = Qualified1.Qualified();
Extrema_ExtPC2d distmin(Pcenter,
// Traitement. +
//=========================================================================
- gp_Dir2d dirx(1.0, 0.0);
+ gp_Dir2d dirx(gp_Dir2d::D::X);
Standard_Real Tol = Abs(Tolerance);
Standard_Real thefirst = -100000.;
Standard_Real thelast = 100000.;
// Traitement. +
//=========================================================================
- gp_Dir2d dirx(1.0, 0.0);
+ gp_Dir2d dirx(gp_Dir2d::D::X);
Standard_Real thefirst = -100000.;
Standard_Real thelast = 100000.;
Standard_Real firstparam;
// Traitement. +
//=========================================================================
- gp_Dir2d dirx(1.0, 0.0);
+ gp_Dir2d dirx(gp_Dir2d::D::X);
Standard_Real thefirst = -100000.;
Standard_Real thelast = 100000.;
Standard_Real firstparam;
// Traitement. +
//=========================================================================
- gp_Dir2d dirx(1.0, 0.0);
+ gp_Dir2d dirx(gp_Dir2d::D::X);
Standard_Real thefirst = -100000.;
Standard_Real thelast = 100000.;
Standard_Real firstparam;
// Traitement. +
//=========================================================================
- gp_Dir2d dirx(1.0, 0.0);
+ gp_Dir2d dirx(gp_Dir2d::D::X);
Standard_Real thefirst = -100000.;
Standard_Real thelast = 100000.;
Standard_Real firstparam;
// Traitement. +
//=========================================================================
- gp_Dir2d dirx(1.0, 0.0);
+ gp_Dir2d dirx(gp_Dir2d::D::X);
Standard_Real thefirst = -100000.;
Standard_Real thelast = 100000.;
Standard_Real firstparam;
else
{
// gp_Dir2d Dir(-y1dir,x1dir);
- gp_Circ2d Circ(gp_Ax2d(Point1, gp_Dir2d(1., 0.)), Radius);
+ gp_Circ2d Circ(gp_Ax2d(Point1, gp_Dir2d(gp_Dir2d::D::X)), Radius);
IntRes2d_Domain D1(ElCLib::Value(0., Circ),
0.,
Tol,
}
Par = RealLast();
- L = gp_Lin2d(P, gp_Dir2d(1, 0));
+ L = gp_Lin2d(P, gp_Dir2d(gp_Dir2d::D::X));
return Standard_False;
}
Weights.Init(1);
else
{
- gp_Ax2 popAx2(gp_Pnt(0, 0, 0), gp_Dir(0, 0, 1));
+ gp_Ax2 popAx2(gp_Pnt(0, 0, 0), gp_Dir(gp_Dir::D::Z));
gp_Circ C(popAx2, 1);
Handle(Geom_TrimmedCurve) Sect1 = new Geom_TrimmedCurve(new Geom_Circle(C), 0., MaxAng);
Handle(Geom_BSplineCurve) CtoBspl = GeomConvert::CurveToBSplineCurve(Sect1, TConv);
const Standard_Real AngularTol,
const Standard_Real SpatialTol)
{
- gp_Ax2 popAx2(gp_Pnt(0, 0, 0), gp_Dir(0, 0, 1));
+ gp_Ax2 popAx2(gp_Pnt(0, 0, 0), gp_Dir(gp_Dir::D::Z));
gp_Circ C(popAx2, Radius);
Handle(Geom_Circle) popCircle = new Geom_Circle(C);
Handle(Geom_TrimmedCurve) Sect = new Geom_TrimmedCurve(popCircle, 0., Max(AngleMin, 0.02));
Handle(Geom_BSplineSurface) BSplSurf(Handle(Geom_BSplineSurface)::DownCast(mySurface));
- gp_Dir2d D(0., 1.);
+ gp_Dir2d D(gp_Dir2d::D::Y);
gp_Pnt2d P(BSplSurf->UKnot(1), 0);
Handle(Geom2d_Line) LC1 = new (Geom2d_Line)(P, D);
Handle(Geom2d_TrimmedCurve) TC1 =
// les iso Bords.
if (!myLoc->HasFirstRestriction())
{
- gp_Dir2d D(0., 1.);
+ gp_Dir2d D(gp_Dir2d::D::Y);
gp_Pnt2d P(UKnots(UKnots.Lower()), 0);
Handle(Geom2d_Line) LC = new (Geom2d_Line)(P, D);
Handle(Geom2d_TrimmedCurve) TC = new (Geom2d_TrimmedCurve)(LC, First, Last);
if (!myLoc->HasLastRestriction())
{
- gp_Dir2d D(0., 1.);
+ gp_Dir2d D(gp_Dir2d::D::Y);
gp_Pnt2d P(UKnots(UKnots.Upper()), 0);
Handle(Geom2d_Line) LC = new (Geom2d_Line)(P, D);
Handle(Geom2d_TrimmedCurve) TC = new (Geom2d_TrimmedCurve)(LC, First, Last);
{
if (!Precision::IsInfinite(aU1f))
{
- aCurS1Bounds[0] = new Geom2d_Line(gp_Pnt2d(aU1f, aV1f), gp_Dir2d(0.0, 1.0));
+ aCurS1Bounds[0] = new Geom2d_Line(gp_Pnt2d(aU1f, aV1f), gp_Dir2d(gp_Dir2d::D::Y));
if (!Precision::IsInfinite(aDelta))
aCurS1Bounds[0] = new Geom2d_TrimmedCurve(aCurS1Bounds[0], 0, aDelta);
if (!Precision::IsInfinite(aU1l))
{
- aCurS1Bounds[1] = new Geom2d_Line(gp_Pnt2d(aU1l, aV1f), gp_Dir2d(0.0, 1.0));
+ aCurS1Bounds[1] = new Geom2d_Line(gp_Pnt2d(aU1l, aV1f), gp_Dir2d(gp_Dir2d::D::Y));
if (!Precision::IsInfinite(aDelta))
aCurS1Bounds[1] = new Geom2d_TrimmedCurve(aCurS1Bounds[1], 0, aDelta);
}
{
if (!Precision::IsInfinite(aV1f))
{
- aCurS1Bounds[2] = new Geom2d_Line(gp_Pnt2d(aU1f, aV1f), gp_Dir2d(1.0, 0.0));
+ aCurS1Bounds[2] = new Geom2d_Line(gp_Pnt2d(aU1f, aV1f), gp_Dir2d(gp_Dir2d::D::X));
if (!Precision::IsInfinite(aDelta))
aCurS1Bounds[2] = new Geom2d_TrimmedCurve(aCurS1Bounds[2], 0, aDelta);
}
if (!Precision::IsInfinite(aV1l))
{
- aCurS1Bounds[3] = new Geom2d_Line(gp_Pnt2d(aU1l, aV1l), gp_Dir2d(1.0, 0.0));
+ aCurS1Bounds[3] = new Geom2d_Line(gp_Pnt2d(aU1f, aV1l), gp_Dir2d(gp_Dir2d::D::X));
if (!Precision::IsInfinite(aDelta))
aCurS1Bounds[3] = new Geom2d_TrimmedCurve(aCurS1Bounds[3], 0, aDelta);
}
{
if (!Precision::IsInfinite(aU2f))
{
- aCurS2Bounds[0] = new Geom2d_Line(gp_Pnt2d(aU2f, aV2f), gp_Dir2d(0.0, 1.0));
+ aCurS2Bounds[0] = new Geom2d_Line(gp_Pnt2d(aU2f, aV2f), gp_Dir2d(gp_Dir2d::D::Y));
if (!Precision::IsInfinite(aDelta))
aCurS2Bounds[0] = new Geom2d_TrimmedCurve(aCurS2Bounds[0], 0, aDelta);
}
if (!Precision::IsInfinite(aU2l))
{
- aCurS2Bounds[1] = new Geom2d_Line(gp_Pnt2d(aU2l, aV2f), gp_Dir2d(0.0, 1.0));
+ aCurS2Bounds[1] = new Geom2d_Line(gp_Pnt2d(aU2l, aV2f), gp_Dir2d(gp_Dir2d::D::Y));
if (!Precision::IsInfinite(aDelta))
aCurS2Bounds[1] = new Geom2d_TrimmedCurve(aCurS2Bounds[1], 0, aDelta);
}
{
if (!Precision::IsInfinite(aV2f))
{
- aCurS2Bounds[2] = new Geom2d_Line(gp_Pnt2d(aU2f, aV2f), gp_Dir2d(1.0, 0.0));
+ aCurS2Bounds[2] = new Geom2d_Line(gp_Pnt2d(aU2f, aV2f), gp_Dir2d(gp_Dir2d::D::X));
if (!Precision::IsInfinite(aDelta))
aCurS2Bounds[2] = new Geom2d_TrimmedCurve(aCurS2Bounds[2], 0, aDelta);
}
if (!Precision::IsInfinite(aV2l))
{
- aCurS2Bounds[3] = new Geom2d_Line(gp_Pnt2d(aU2l, aV2l), gp_Dir2d(1.0, 0.0));
+ aCurS2Bounds[3] = new Geom2d_Line(gp_Pnt2d(aU2f, aV2l), gp_Dir2d(gp_Dir2d::D::X));
if (!Precision::IsInfinite(aDelta))
aCurS2Bounds[3] = new Geom2d_TrimmedCurve(aCurS2Bounds[3], 0, aDelta);
}
void Hatch_Hatcher::AddXLine(const Standard_Real X)
{
gp_Pnt2d O(X, 0);
- gp_Dir2d D(0, 1);
+ gp_Dir2d D(gp_Dir2d::D::Y);
gp_Lin2d L(O, D);
AddLine(L, Hatch_XLINE);
}
void Hatch_Hatcher::AddYLine(const Standard_Real Y)
{
gp_Pnt2d O(0, Y);
- gp_Dir2d D(1, 0);
+ gp_Dir2d D(gp_Dir2d::D::X);
gp_Lin2d L(O, D);
AddLine(L, Hatch_YLINE);
}
gp_Pnt2d(FirstParams.Value(afirstindex), FirstParams.Value(afirstindex + 1)),
gp_Pnt2d(LastParams.Value(afirstindex), LastParams.Value(afirstindex + 1)));
- gp_Dir2d anIsoDir(0, 1);
+ gp_Dir2d anIsoDir(gp_Dir2d::D::Y);
if ((indexofiso == 1) || (indexofiso == 3))
- anIsoDir = gp_Dir2d(1, 0);
+ anIsoDir = gp_Dir2d(gp_Dir2d::D::X);
if (aTangentZoneDir.SquareMagnitude() > gp::Resolution())
{
if (!Domain.IsOpenYmax())
{
- gp_Lin2d L1(gp_Pnt2d(0., ymax), gp_Dir2d(-1., 0.));
+ gp_Lin2d L1(gp_Pnt2d(0., ymax), gp_Dir2d(gp_Dir2d::D::NX));
IntAna2d_AnaIntersection Inters1(theCurv, IntAna2d_Conic(L1));
if (Inters1.IsDone())
{
if (!Domain.IsOpenXmin())
{
- gp_Lin2d L2(gp_Pnt2d(xmin, 0.), gp_Dir2d(0., -1.));
+ gp_Lin2d L2(gp_Pnt2d(xmin, 0.), gp_Dir2d(gp_Dir2d::D::NY));
IntAna2d_AnaIntersection Inters2(theCurv, IntAna2d_Conic(L2));
if (Inters2.IsDone())
{
if (!Domain.IsOpenYmin())
{
- gp_Lin2d L3(gp_Pnt2d(0., ymin), gp_Dir2d(1., 0.));
+ gp_Lin2d L3(gp_Pnt2d(0., ymin), gp_Dir2d(gp_Dir2d::D::X));
IntAna2d_AnaIntersection Inters3(theCurv, IntAna2d_Conic(L3));
if (Inters3.IsDone())
{
if (!Domain.IsOpenXmax())
{
- gp_Lin2d L4(gp_Pnt2d(xmax, 0.), gp_Dir2d(0., 1.));
+ gp_Lin2d L4(gp_Pnt2d(xmax, 0.), gp_Dir2d(gp_Dir2d::D::Y));
IntAna2d_AnaIntersection Inters4(theCurv, IntAna2d_Conic(L4));
if (Inters4.IsDone())
{
if (!Domain.IsOpenYmax())
{
- gp_Lin2d L1(gp_Pnt2d(0., ymax), gp_Dir2d(-1., 0.));
+ gp_Lin2d L1(gp_Pnt2d(0., ymax), gp_Dir2d(gp_Dir2d::D::NX));
IntAna2d_AnaIntersection Inters1(theCurv, IntAna2d_Conic(L1));
if (Inters1.IsDone())
{
if (!Domain.IsOpenXmin())
{
- gp_Lin2d L2(gp_Pnt2d(xmin, 0.), gp_Dir2d(0., -1.));
+ gp_Lin2d L2(gp_Pnt2d(xmin, 0.), gp_Dir2d(gp_Dir2d::D::NY));
IntAna2d_AnaIntersection Inters2(theCurv, IntAna2d_Conic(L2));
if (Inters2.IsDone())
{
if (!Domain.IsOpenYmin())
{
- gp_Lin2d L3(gp_Pnt2d(0., ymin), gp_Dir2d(1., 0.));
+ gp_Lin2d L3(gp_Pnt2d(0., ymin), gp_Dir2d(gp_Dir2d::D::X));
IntAna2d_AnaIntersection Inters3(theCurv, IntAna2d_Conic(L3));
if (Inters3.IsDone())
{
if (!Domain.IsOpenXmax())
{
- gp_Lin2d L4(gp_Pnt2d(xmax, 0.), gp_Dir2d(0., 1.));
+ gp_Lin2d L4(gp_Pnt2d(xmax, 0.), gp_Dir2d(gp_Dir2d::D::Y));
IntAna2d_AnaIntersection Inters4(theCurv, IntAna2d_Conic(L4));
if (Inters4.IsDone())
{
Contap_ArcFunction::Contap_ArcFunction()
: myMean(1.),
myType(Contap_ContourStd),
- myDir(0., 0., 1.),
+ myDir(gp_Dir::D::Z),
myCosAng(0.0)
{
}
Contap_SurfFunction::Contap_SurfFunction()
: myMean(1.),
myType(Contap_ContourStd),
- myDir(0., 0., 1.),
+ myDir(gp_Dir::D::Z),
myAng(0.0),
myCosAng(0.), // PI/2 - Angle de depouille
tol(1.e-6),
}
else
{
- L = gp_Lin(gp_Pnt(X, Y, 0), gp_Dir(0, 0, -1));
+ L = gp_Lin(gp_Pnt(X, Y, 0), gp_Dir(gp_Dir::D::NZ));
}
L.Transform(myInvTrsf);
return L;
}
else
{
- V = gp_Dir(0, 0, -1);
+ V = gp_Dir(gp_Dir::D::NZ);
}
V.Transform(TI);
if (NrmFace.Dot(V) > 0.)
}
else
{
- V = gp_Dir(0, 0, -1);
+ V = gp_Dir(gp_Dir::D::NZ);
}
V.Transform(TI);
if (mySLProps.IsNormalDefined())
if (StepU > Confusion)
{
Standard_Real UPrm = UMin + StepU / 2.;
- gp_Dir2d Dir(0., 1.);
+ gp_Dir2d Dir(gp_Dir2d::D::Y);
for (IIso = 1; IIso <= nbIsos; IIso++)
{
if (StepV > Confusion)
{
Standard_Real VPrm = VMin + StepV / 2.;
- gp_Dir2d Dir(1., 0.);
+ gp_Dir2d Dir(gp_Dir2d::D::X);
for (IIso = 1; IIso <= nbIsos; IIso++)
{
void SetUp() override
{
// Standard axis aligned with Z
- myAxis = gp_Ax3(gp_Pnt(0., 0., 0.), gp_Dir(0., 0., 1.), gp_Dir(1., 0., 0.));
+ myAxis = gp_Ax3(gp_Pnt(0., 0., 0.), gp_Dir(gp_Dir::D::Z), gp_Dir(gp_Dir::D::X));
myTolerance = 1.e-4;
}
void SetUp() override
{
// Default axis setup
- myAxis = gp_Ax3(gp_Pnt(0., 0., 0.), gp_Dir(0., 0., 1.), gp_Dir(1., 0., 0.));
+ myAxis = gp_Ax3(gp_Pnt(0., 0., 0.), gp_Dir(gp_Dir::D::Z), gp_Dir(gp_Dir::D::X));
myTolerance = 1.e-4;
}
{
HelixGeom_BuilderHelix aBuilder;
- gp_Ax2 aPosition(gp_Pnt(0., 0., 0.), gp_Dir(0., 0., 1.), gp_Dir(1., 0., 0.));
+ gp_Ax2 aPosition(gp_Pnt(0., 0., 0.), gp_Dir(gp_Dir::D::Z), gp_Dir(gp_Dir::D::X));
aBuilder.SetPosition(aPosition);
aBuilder.SetTolerance(myTolerance);
aBuilder.SetCurveParameters(0.0, 2.0 * M_PI, 10.0, 5.0, 0.0, Standard_True);
{
HelixGeom_BuilderHelix aBuilder;
- gp_Ax2 aPosition(gp_Pnt(0., 0., 0.), gp_Dir(0., 0., 1.), gp_Dir(1., 0., 0.));
+ gp_Ax2 aPosition(gp_Pnt(0., 0., 0.), gp_Dir(gp_Dir::D::Z), gp_Dir(gp_Dir::D::X));
aBuilder.SetPosition(aPosition);
aBuilder.SetTolerance(myTolerance);
{
HelixGeom_BuilderHelix aBuilder;
- gp_Ax2 aPosition(gp_Pnt(0., 0., 0.), gp_Dir(0., 0., 1.), gp_Dir(1., 0., 0.));
+ gp_Ax2 aPosition(gp_Pnt(0., 0., 0.), gp_Dir(gp_Dir::D::Z), gp_Dir(gp_Dir::D::X));
aBuilder.SetPosition(aPosition);
aBuilder.SetTolerance(myTolerance);
aBuilder.SetCurveParameters(0.0, 2.0 * M_PI, 10.0, 5.0, 0.0, Standard_True);
{
HelixGeom_BuilderHelix aBuilder;
- gp_Ax2 aPosition(gp_Pnt(0., 0., 0.), gp_Dir(0., 0., 1.), gp_Dir(1., 0., 0.));
+ gp_Ax2 aPosition(gp_Pnt(0., 0., 0.), gp_Dir(gp_Dir::D::Z), gp_Dir(gp_Dir::D::X));
aBuilder.SetPosition(aPosition);
aBuilder.SetTolerance(myTolerance);
{
HelixGeom_BuilderHelix aBuilder;
- gp_Ax2 aTestPosition(gp_Pnt(10., 20., 30.), gp_Dir(1., 0., 0.), gp_Dir(0., 1., 0.));
+ gp_Ax2 aTestPosition(gp_Pnt(10., 20., 30.), gp_Dir(gp_Dir::D::X), gp_Dir(gp_Dir::D::Y));
aBuilder.SetPosition(aTestPosition);
const gp_Ax2& aRetrievedPosition = aBuilder.Position();
TColGeom2d_SequenceOfCurve BoundLines;
if (!Precision::IsInfinite(Vmin))
{
- Handle(Geom2d_Line) aLine = new Geom2d_Line(gp_Pnt2d(0., Vmin), gp_Dir2d(1., 0.));
+ Handle(Geom2d_Line) aLine = new Geom2d_Line(gp_Pnt2d(0., Vmin), gp_Dir2d(gp_Dir2d::D::X));
BoundLines.Append(aLine);
}
if (!Precision::IsInfinite(Umin))
{
- Handle(Geom2d_Line) aLine = new Geom2d_Line(gp_Pnt2d(Umin, 0.), gp_Dir2d(0., 1.));
+ Handle(Geom2d_Line) aLine = new Geom2d_Line(gp_Pnt2d(Umin, 0.), gp_Dir2d(gp_Dir2d::D::Y));
BoundLines.Append(aLine);
}
if (!Precision::IsInfinite(Vmax))
{
- Handle(Geom2d_Line) aLine = new Geom2d_Line(gp_Pnt2d(0., Vmax), gp_Dir2d(1., 0.));
+ Handle(Geom2d_Line) aLine = new Geom2d_Line(gp_Pnt2d(0., Vmax), gp_Dir2d(gp_Dir2d::D::X));
BoundLines.Append(aLine);
}
if (!Precision::IsInfinite(Umax))
{
- Handle(Geom2d_Line) aLine = new Geom2d_Line(gp_Pnt2d(Umax, 0.), gp_Dir2d(0., 1.));
+ Handle(Geom2d_Line) aLine = new Geom2d_Line(gp_Pnt2d(Umax, 0.), gp_Dir2d(gp_Dir2d::D::Y));
BoundLines.Append(aLine);
}
if (!IsPlanar)
{
TopLoc_Location Loc;
- EdgeLine2d = new Geom2d_Line(gp_Pnt2d(0., 0.), gp_Dir2d(1., 0.));
+ EdgeLine2d = new Geom2d_Line(gp_Pnt2d(0., 0.), gp_Dir2d(gp_Dir2d::D::X));
BB.UpdateEdge(anEdge, EdgeLine2d, theSurf, Loc, Precision::Confusion());
Standard_Real Coeff = (OffsetDir * CircAxisDir > 0.) ? 1. : -1.;
- OELine2d = new Geom2d_Line(gp_Pnt2d(0., OffsetVal * Coeff), gp_Dir2d(1., 0.));
+ OELine2d = new Geom2d_Line(gp_Pnt2d(0., OffsetVal * Coeff), gp_Dir2d(gp_Dir2d::D::X));
BB.UpdateEdge(OE, OELine2d, theSurf, Loc, Precision::Confusion());
aLine2d = new Geom2d_Line(gp_Pnt2d(ParV2, 0.), gp_Dir2d(0., Coeff));
aLine2d2 = new Geom2d_Line(gp_Pnt2d(ParV1, 0.), gp_Dir2d(0., Coeff));
Standard_Real Uf, Ul, Vf, Vl;
theSurf->Bounds(Uf, Ul, Vf, Vl);
TopLoc_Location Loc;
- EdgeLine2d = new Geom2d_Line(gp_Pnt2d(0., Vf), gp_Dir2d(1., 0.));
+ EdgeLine2d = new Geom2d_Line(gp_Pnt2d(0., Vf), gp_Dir2d(gp_Dir2d::D::X));
BB.UpdateEdge(anEdge, EdgeLine2d, theSurf, Loc, Precision::Confusion());
- OELine2d = new Geom2d_Line(gp_Pnt2d(0., Vl), gp_Dir2d(1., 0.));
+ OELine2d = new Geom2d_Line(gp_Pnt2d(0., Vl), gp_Dir2d(gp_Dir2d::D::X));
BB.UpdateEdge(OE, OELine2d, theSurf, Loc, Precision::Confusion());
Standard_Real UonV1 = (ToReverse) ? Ul : Uf;
Standard_Real UonV2 = (ToReverse) ? Uf : Ul;
- aLine2d = new Geom2d_Line(gp_Pnt2d(UonV2, 0.), gp_Dir2d(0., 1.));
- aLine2d2 = new Geom2d_Line(gp_Pnt2d(UonV1, 0.), gp_Dir2d(0., 1.));
+ aLine2d = new Geom2d_Line(gp_Pnt2d(UonV2, 0.), gp_Dir2d(gp_Dir2d::D::Y));
+ aLine2d2 = new Geom2d_Line(gp_Pnt2d(UonV1, 0.), gp_Dir2d(gp_Dir2d::D::Y));
if (E3.IsSame(E4))
{
BB.UpdateEdge(E3, aLine2d, aLine2d2, theSurf, Loc, Precision::Confusion());
theSurf->Bounds(Uf, Ul, Vf, Vl);
TopLoc_Location Loc;
Handle(Geom2d_Line) EdgeLine2d, OELine2d, aLine2d, aLine2d2;
- EdgeLine2d = new Geom2d_Line(gp_Pnt2d(0., Vf), gp_Dir2d(1., 0.));
+ EdgeLine2d = new Geom2d_Line(gp_Pnt2d(0., Vf), gp_Dir2d(gp_Dir2d::D::X));
aBB.UpdateEdge(theOrigEdge, EdgeLine2d, theSurf, Loc, Precision::Confusion());
- OELine2d = new Geom2d_Line(gp_Pnt2d(0., Vl), gp_Dir2d(1., 0.));
+ OELine2d = new Geom2d_Line(gp_Pnt2d(0., Vl), gp_Dir2d(gp_Dir2d::D::X));
aBB.UpdateEdge(aNewEdge, OELine2d, theSurf, Loc, Precision::Confusion());
Standard_Real UonV1 = (ToReverse) ? Ul : Uf;
Standard_Real UonV2 = (ToReverse) ? Uf : Ul;
- aLine2d = new Geom2d_Line(gp_Pnt2d(UonV2, 0.), gp_Dir2d(0., 1.));
- aLine2d2 = new Geom2d_Line(gp_Pnt2d(UonV1, 0.), gp_Dir2d(0., 1.));
+ aLine2d = new Geom2d_Line(gp_Pnt2d(UonV2, 0.), gp_Dir2d(gp_Dir2d::D::Y));
+ aLine2d2 = new Geom2d_Line(gp_Pnt2d(UonV1, 0.), gp_Dir2d(gp_Dir2d::D::Y));
if (aWall1.IsSame(aWall2))
{
aBB.UpdateEdge(aWall1, aLine2d, aLine2d2, theSurf, Loc, Precision::Confusion());
Handle(Geom2d_Curve) PC;
if (ExchUV)
{
- PC = new Geom2d_Line(gp_Pnt2d(0, f2), gp_Dir2d(1, 0));
+ PC = new Geom2d_Line(gp_Pnt2d(0, f2), gp_Dir2d(gp_Dir2d::D::X));
U1 = f1;
U2 = l1;
if (!C1is3D)
}
else
{
- PC = new Geom2d_Line(gp_Pnt2d(f1, 0), gp_Dir2d(0, 1));
+ PC = new Geom2d_Line(gp_Pnt2d(f1, 0), gp_Dir2d(gp_Dir2d::D::Y));
U1 = f2;
U2 = l2;
if (!C1is3D)
// Update de edge2. (Rem : has already a 3d curve)
if (ExchUV)
{
- PC = new Geom2d_Line(gp_Pnt2d(0, l2), gp_Dir2d(1, 0));
+ PC = new Geom2d_Line(gp_Pnt2d(0, l2), gp_Dir2d(gp_Dir2d::D::X));
U1 = f1;
U2 = l1;
if (!C2is3D)
}
else
{
- PC = new Geom2d_Line(gp_Pnt2d(l1, 0), gp_Dir2d(0, 1));
+ PC = new Geom2d_Line(gp_Pnt2d(l1, 0), gp_Dir2d(gp_Dir2d::D::Y));
U1 = f2;
U2 = l2;
if (!C2is3D)
{
// rem : si ExchUv, il faut reverser le Wire.
// donc l'edge Forward dans la face sera E4 : d'ou L1 et L2
- L2 = new Geom2d_Line(gp_Pnt2d(f1, 0), gp_Dir2d(0, 1));
- L1 = new Geom2d_Line(gp_Pnt2d(l1, 0), gp_Dir2d(0, 1));
+ L2 = new Geom2d_Line(gp_Pnt2d(f1, 0), gp_Dir2d(gp_Dir2d::D::Y));
+ L1 = new Geom2d_Line(gp_Pnt2d(l1, 0), gp_Dir2d(gp_Dir2d::D::Y));
U1 = f2;
U2 = l2;
}
else
{
- L1 = new Geom2d_Line(gp_Pnt2d(0, f2), gp_Dir2d(1, 0));
- L2 = new Geom2d_Line(gp_Pnt2d(0, l2), gp_Dir2d(1, 0));
+ L1 = new Geom2d_Line(gp_Pnt2d(0, f2), gp_Dir2d(gp_Dir2d::D::X));
+ L2 = new Geom2d_Line(gp_Pnt2d(0, l2), gp_Dir2d(gp_Dir2d::D::X));
U1 = f1;
U2 = l1;
}
if (ExchUV)
{
- L1 = new Geom2d_Line(gp_Pnt2d(f1, 0), gp_Dir2d(0, 1));
+ L1 = new Geom2d_Line(gp_Pnt2d(f1, 0), gp_Dir2d(gp_Dir2d::D::Y));
U1 = f2;
U2 = l2;
}
else
{
- L1 = new Geom2d_Line(gp_Pnt2d(0, f2), gp_Dir2d(1, 0));
+ L1 = new Geom2d_Line(gp_Pnt2d(0, f2), gp_Dir2d(gp_Dir2d::D::X));
U1 = f1;
U2 = l1;
}
if (ExchUV)
{
- L2 = new Geom2d_Line(gp_Pnt2d(l1, 0), gp_Dir2d(0, 1));
+ L2 = new Geom2d_Line(gp_Pnt2d(l1, 0), gp_Dir2d(gp_Dir2d::D::Y));
U1 = f2;
U2 = l2;
}
else
{
- L2 = new Geom2d_Line(gp_Pnt2d(0, l2), gp_Dir2d(1, 0));
+ L2 = new Geom2d_Line(gp_Pnt2d(0, l2), gp_Dir2d(gp_Dir2d::D::X));
U1 = f1;
U2 = l1;
}
// make the lines
Handle(Geom2d_Line) Lumin, Lumax, Lvmin, Lvmax;
if (!umininf)
- Lumin = new Geom2d_Line(gp_Pnt2d(UMin, 0), gp_Dir2d(0, 1));
+ Lumin = new Geom2d_Line(gp_Pnt2d(UMin, 0), gp_Dir2d(gp_Dir2d::D::Y));
if (!umaxinf)
- Lumax = new Geom2d_Line(gp_Pnt2d(UMax, 0), gp_Dir2d(0, 1));
+ Lumax = new Geom2d_Line(gp_Pnt2d(UMax, 0), gp_Dir2d(gp_Dir2d::D::Y));
if (!vmininf)
- Lvmin = new Geom2d_Line(gp_Pnt2d(0, VMin), gp_Dir2d(1, 0));
+ Lvmin = new Geom2d_Line(gp_Pnt2d(0, VMin), gp_Dir2d(gp_Dir2d::D::X));
if (!vmaxinf)
- Lvmax = new Geom2d_Line(gp_Pnt2d(0, VMax), gp_Dir2d(1, 0));
+ Lvmax = new Geom2d_Line(gp_Pnt2d(0, VMax), gp_Dir2d(gp_Dir2d::D::X));
Handle(Geom_Curve) Cumin, Cumax, Cvmin, Cvmax;
Standard_Real TolApex = 1.e-5;
if (vClosed)
{
B.UpdateEdge(edge1,
- new Geom2d_Line(gp_Pnt2d(0, f2), gp_Dir2d(1, 0)),
- new Geom2d_Line(gp_Pnt2d(0, l2), gp_Dir2d(1, 0)),
+ new Geom2d_Line(gp_Pnt2d(0, f2), gp_Dir2d(gp_Dir2d::D::X)),
+ new Geom2d_Line(gp_Pnt2d(0, l2), gp_Dir2d(gp_Dir2d::D::X)),
face,
Precision::Confusion());
B.Range(edge1, face, f1, l1);
else
{
B.UpdateEdge(edge1,
- new Geom2d_Line(gp_Pnt2d(0, f2), gp_Dir2d(1, 0)),
+ new Geom2d_Line(gp_Pnt2d(0, f2), gp_Dir2d(gp_Dir2d::D::X)),
face,
Precision::Confusion());
B.Range(edge1, face, f1, l1);
B.UpdateEdge(edge2,
- new Geom2d_Line(gp_Pnt2d(0, l2), gp_Dir2d(1, 0)),
+ new Geom2d_Line(gp_Pnt2d(0, l2), gp_Dir2d(gp_Dir2d::D::X)),
face,
Precision::Confusion());
B.Range(edge2, face, f1, l1);
if (uClosed && nbEdges == 1)
{
B.UpdateEdge(edge3,
- new Geom2d_Line(gp_Pnt2d(l1, 0), gp_Dir2d(0, 1)),
- new Geom2d_Line(gp_Pnt2d(f1, 0), gp_Dir2d(0, 1)),
+ new Geom2d_Line(gp_Pnt2d(l1, 0), gp_Dir2d(gp_Dir2d::D::Y)),
+ new Geom2d_Line(gp_Pnt2d(f1, 0), gp_Dir2d(gp_Dir2d::D::Y)),
face,
Precision::Confusion());
B.Range(edge3, face, f2, l2);
else
{
B.UpdateEdge(edge3,
- new Geom2d_Line(gp_Pnt2d(f1, 0), gp_Dir2d(0, 1)),
+ new Geom2d_Line(gp_Pnt2d(f1, 0), gp_Dir2d(gp_Dir2d::D::Y)),
face,
Precision::Confusion());
B.Range(edge3, face, f2, l2);
B.UpdateEdge(edge4,
- new Geom2d_Line(gp_Pnt2d(l1, 0), gp_Dir2d(0, 1)),
+ new Geom2d_Line(gp_Pnt2d(l1, 0), gp_Dir2d(gp_Dir2d::D::Y)),
face,
Precision::Confusion());
B.Range(edge4, face, f2, l2);
//=================================================================================================
BRepPrim_Cone::BRepPrim_Cone(const Standard_Real Angle, const gp_Pnt& Apex)
- : BRepPrim_Revolution(gp_Ax2(Apex, gp_Dir(0, 0, 1), gp_Dir(1, 0, 0)), 0, RealLast()),
+ : BRepPrim_Revolution(gp_Ax2(Apex, gp_Dir(gp_Dir::D::Z), gp_Dir(gp_Dir::D::X)), 0, RealLast()),
myHalfAngle(Angle),
myRadius(0.)
{
const Standard_Real R1,
const Standard_Real R2,
const Standard_Real H)
- : BRepPrim_Revolution(gp_Ax2(Center, gp_Dir(0, 0, 1), gp_Dir(1, 0, 0)), 0, 0)
+ : BRepPrim_Revolution(gp_Ax2(Center, gp_Dir(gp_Dir::D::Z), gp_Dir(gp_Dir::D::X)), 0, 0)
{
SetParameters(R1, R2, H);
SetMeridian();
//=================================================================================================
BRepPrim_Cylinder::BRepPrim_Cylinder(const gp_Pnt& Center, const Standard_Real Radius)
- : BRepPrim_Revolution(gp_Ax2(Center, gp_Dir(0, 0, 1), gp_Dir(1, 0, 0)),
+ : BRepPrim_Revolution(gp_Ax2(Center, gp_Dir(gp_Dir::D::Z), gp_Dir(gp_Dir::D::X)),
RealFirst(),
RealLast()),
myRadius(Radius)
BRepPrim_Cylinder::BRepPrim_Cylinder(const gp_Pnt& Center,
const Standard_Real R,
const Standard_Real H)
- : BRepPrim_Revolution(gp_Ax2(Center, gp_Dir(0, 0, 1), gp_Dir(1, 0, 0)), 0, H),
+ : BRepPrim_Revolution(gp_Ax2(Center, gp_Dir(gp_Dir::D::Z), gp_Dir(gp_Dir::D::X)), 0, H),
myRadius(R)
{
SetMeridian();
gp_Ax1 A = Axes().Axis();
A.Translate(V);
Handle(Geom_Line) L = new Geom_Line(A);
- Handle(Geom2d_Line) L2d = new Geom2d_Line(gp_Pnt2d(myRadius, 0), gp_Dir2d(0, 1));
+ Handle(Geom2d_Line) L2d = new Geom2d_Line(gp_Pnt2d(myRadius, 0), gp_Dir2d(gp_Dir2d::D::Y));
Meridian(L, L2d);
}
// set the pcurves
Handle(Geom2d_Line) L;
- L = new Geom2d_Line(gp_Pnt2d(UMin, VMin), gp_Dir2d(1, 0));
+ L = new Geom2d_Line(gp_Pnt2d(UMin, VMin), gp_Dir2d(gp_Dir2d::D::X));
B.UpdateEdge(myEdges[0], L, myFace, Precision::Confusion());
- L = new Geom2d_Line(gp_Pnt2d(UMax, VMin), gp_Dir2d(0, 1));
+ L = new Geom2d_Line(gp_Pnt2d(UMax, VMin), gp_Dir2d(gp_Dir2d::D::Y));
B.UpdateEdge(myEdges[1], L, myFace, Precision::Confusion());
- L = new Geom2d_Line(gp_Pnt2d(UMax, VMax), gp_Dir2d(-1, 0));
+ L = new Geom2d_Line(gp_Pnt2d(UMax, VMax), gp_Dir2d(gp_Dir2d::D::NX));
B.UpdateEdge(myEdges[2], L, myFace, Precision::Confusion());
- L = new Geom2d_Line(gp_Pnt2d(UMin, VMax), gp_Dir2d(0, -1));
+ L = new Geom2d_Line(gp_Pnt2d(UMin, VMax), gp_Dir2d(gp_Dir2d::D::NY));
B.UpdateEdge(myEdges[3], L, myFace, Precision::Confusion());
// set the parameters
// closed edge
myBuilder.SetPCurve(myEdges[ETOP],
myFaces[FLATERAL],
- gp_Lin2d(gp_Pnt2d(0, myVMin), gp_Dir2d(1, 0)),
- gp_Lin2d(gp_Pnt2d(0, myVMax), gp_Dir2d(1, 0)));
+ gp_Lin2d(gp_Pnt2d(0, myVMin), gp_Dir2d(gp_Dir2d::D::X)),
+ gp_Lin2d(gp_Pnt2d(0, myVMax), gp_Dir2d(gp_Dir2d::D::X)));
}
else
{
{
myBuilder.SetPCurve(myEdges[ETOP],
myFaces[FLATERAL],
- gp_Lin2d(gp_Pnt2d(0, myVMax), gp_Dir2d(1, 0)));
+ gp_Lin2d(gp_Pnt2d(0, myVMax), gp_Dir2d(gp_Dir2d::D::X)));
if (!HasSides() || MeridianOnAxis(myVMax))
{
// closed edge set parameters
{
myBuilder.SetPCurve(myEdges[EBOTTOM],
myFaces[FLATERAL],
- gp_Lin2d(gp_Pnt2d(0, myVMin), gp_Dir2d(1, 0)));
+ gp_Lin2d(gp_Pnt2d(0, myVMin), gp_Dir2d(gp_Dir2d::D::X)));
if (!HasSides() || MeridianOnAxis(myVMin))
{
// closed edge set parameters
{
myBuilder.SetPCurve(myEdges[ESTART],
myFaces[FLATERAL],
- gp_Lin2d(gp_Pnt2d(0, -myMeridianOffset), gp_Dir2d(0, 1)));
+ gp_Lin2d(gp_Pnt2d(0, -myMeridianOffset), gp_Dir2d(gp_Dir2d::D::Y)));
myBuilder.SetPCurve(myEdges[EEND],
myFaces[FLATERAL],
- gp_Lin2d(gp_Pnt2d(myAngle, -myMeridianOffset), gp_Dir2d(0, 1)));
+ gp_Lin2d(gp_Pnt2d(myAngle, -myMeridianOffset), gp_Dir2d(gp_Dir2d::D::Y)));
}
else
{
// closed edge
myBuilder.SetPCurve(myEdges[ESTART],
myFaces[FLATERAL],
- gp_Lin2d(gp_Pnt2d(myAngle, -myMeridianOffset), gp_Dir2d(0, 1)),
- gp_Lin2d(gp_Pnt2d(0, -myMeridianOffset), gp_Dir2d(0, 1)));
+ gp_Lin2d(gp_Pnt2d(myAngle, -myMeridianOffset), gp_Dir2d(gp_Dir2d::D::Y)),
+ gp_Lin2d(gp_Pnt2d(0, -myMeridianOffset), gp_Dir2d(gp_Dir2d::D::Y)));
}
myBuilder.CompleteFace(myFaces[FLATERAL]);
FacesBuilt[FLATERAL] = Standard_True;
myBuilder.SetPCurve(
myEdges[ETOP],
myFaces[FTOP],
- gp_Circ2d(gp_Ax2d(gp_Pnt2d(0, 0), gp_Dir2d(1, 0)), MeridianValue(myVMax).X()));
+ gp_Circ2d(gp_Ax2d(gp_Pnt2d(0, 0), gp_Dir2d(gp_Dir2d::D::X)), MeridianValue(myVMax).X()));
if (HasSides())
{
myBuilder.SetPCurve(myEdges[ETOPSTART],
myFaces[FTOP],
- gp_Lin2d(gp_Pnt2d(0, 0), gp_Dir2d(1, 0)));
+ gp_Lin2d(gp_Pnt2d(0, 0), gp_Dir2d(gp_Dir2d::D::X)));
myBuilder.SetPCurve(myEdges[ETOPEND],
myFaces[FTOP],
gp_Lin2d(gp_Pnt2d(0, 0), gp_Dir2d(Cos(myAngle), Sin(myAngle))));
myBuilder.SetPCurve(
myEdges[EBOTTOM],
myFaces[FBOTTOM],
- gp_Circ2d(gp_Ax2d(gp_Pnt2d(0, 0), gp_Dir2d(1, 0)), MeridianValue(myVMin).X()));
+ gp_Circ2d(gp_Ax2d(gp_Pnt2d(0, 0), gp_Dir2d(gp_Dir2d::D::X)), MeridianValue(myVMin).X()));
if (HasSides())
{
myBuilder.SetPCurve(myEdges[EBOTSTART],
myFaces[FBOTTOM],
- gp_Lin2d(gp_Pnt2d(0, 0), gp_Dir2d(1, 0)));
+ gp_Lin2d(gp_Pnt2d(0, 0), gp_Dir2d(gp_Dir2d::D::X)));
myBuilder.SetPCurve(myEdges[EBOTEND],
myFaces[FBOTTOM],
gp_Lin2d(gp_Pnt2d(0, 0), gp_Dir2d(Cos(myAngle), Sin(myAngle))));
if (EdgesBuilt[EAXIS])
myBuilder.SetPCurve(myEdges[EAXIS],
myFaces[FSTART],
- gp_Lin2d(gp_Pnt2d(0, 0), gp_Dir2d(0, 1)));
+ gp_Lin2d(gp_Pnt2d(0, 0), gp_Dir2d(gp_Dir2d::D::Y)));
if (EdgesBuilt[ETOPSTART])
- myBuilder.SetPCurve(myEdges[ETOPSTART],
- myFaces[FSTART],
- gp_Lin2d(gp_Pnt2d(0, MeridianValue(myVMax).Y()), gp_Dir2d(1, 0)));
+ myBuilder.SetPCurve(
+ myEdges[ETOPSTART],
+ myFaces[FSTART],
+ gp_Lin2d(gp_Pnt2d(0, MeridianValue(myVMax).Y()), gp_Dir2d(gp_Dir2d::D::X)));
if (EdgesBuilt[EBOTSTART])
- myBuilder.SetPCurve(myEdges[EBOTSTART],
- myFaces[FSTART],
- gp_Lin2d(gp_Pnt2d(0, MeridianValue(myVMin).Y()), gp_Dir2d(1, 0)));
+ myBuilder.SetPCurve(
+ myEdges[EBOTSTART],
+ myFaces[FSTART],
+ gp_Lin2d(gp_Pnt2d(0, MeridianValue(myVMin).Y()), gp_Dir2d(gp_Dir2d::D::X)));
myBuilder.CompleteFace(myFaces[FSTART]);
FacesBuilt[FSTART] = Standard_True;
// parametric curves
SetMeridianPCurve(myEdges[EEND], myFaces[FEND]);
if (EdgesBuilt[EAXIS])
- myBuilder.SetPCurve(myEdges[EAXIS], myFaces[FEND], gp_Lin2d(gp_Pnt2d(0, 0), gp_Dir2d(0, 1)));
- if (EdgesBuilt[ETOPEND])
- myBuilder.SetPCurve(myEdges[ETOPEND],
+ myBuilder.SetPCurve(myEdges[EAXIS],
myFaces[FEND],
- gp_Lin2d(gp_Pnt2d(0, MeridianValue(myVMax).Y()), gp_Dir2d(1, 0)));
+ gp_Lin2d(gp_Pnt2d(0, 0), gp_Dir2d(gp_Dir2d::D::Y)));
+ if (EdgesBuilt[ETOPEND])
+ myBuilder.SetPCurve(
+ myEdges[ETOPEND],
+ myFaces[FEND],
+ gp_Lin2d(gp_Pnt2d(0, MeridianValue(myVMax).Y()), gp_Dir2d(gp_Dir2d::D::X)));
if (EdgesBuilt[EBOTEND])
- myBuilder.SetPCurve(myEdges[EBOTEND],
- myFaces[FEND],
- gp_Lin2d(gp_Pnt2d(0, MeridianValue(myVMin).Y()), gp_Dir2d(1, 0)));
+ myBuilder.SetPCurve(
+ myEdges[EBOTEND],
+ myFaces[FEND],
+ gp_Lin2d(gp_Pnt2d(0, MeridianValue(myVMin).Y()), gp_Dir2d(gp_Dir2d::D::X)));
myBuilder.CompleteFace(myFaces[FEND]);
FacesBuilt[FEND] = Standard_True;
//=================================================================================================
BRepPrim_Sphere::BRepPrim_Sphere(const gp_Pnt& Center, const Standard_Real Radius)
- : BRepPrim_Revolution(gp_Ax2(Center, gp_Dir(0, 0, 1), gp_Dir(1, 0, 0)), PMIN, PMAX),
+ : BRepPrim_Revolution(gp_Ax2(Center, gp_Dir(gp_Dir::D::Z), gp_Dir(gp_Dir::D::X)), PMIN, PMAX),
myRadius(Radius)
{
SetMeridian();
gp_Dir D = Axes().YDirection();
D.Reverse();
gp_Ax2 A(Axes().Location(), D, Axes().XDirection());
- Handle(Geom_Circle) C = new Geom_Circle(A, myRadius);
- Handle(Geom2d_Circle) C2d = new Geom2d_Circle(gp_Ax2d(gp_Pnt2d(0, 0), gp_Dir2d(1, 0)), myRadius);
+ Handle(Geom_Circle) C = new Geom_Circle(A, myRadius);
+ Handle(Geom2d_Circle) C2d =
+ new Geom2d_Circle(gp_Ax2d(gp_Pnt2d(0, 0), gp_Dir2d(gp_Dir2d::D::X)), myRadius);
Meridian(C, C2d);
}
BRepPrim_Torus::BRepPrim_Torus(const gp_Pnt& Center,
const Standard_Real Major,
const Standard_Real Minor)
- : BRepPrim_Revolution(gp_Ax2(Center, gp_Dir(0, 0, 1), gp_Dir(1, 0, 0)), 0, 2 * M_PI),
+ : BRepPrim_Revolution(gp_Ax2(Center, gp_Dir(gp_Dir::D::Z), gp_Dir(gp_Dir::D::X)), 0, 2 * M_PI),
myMajor(Major),
myMinor(Minor)
{
A.Translate(V);
Handle(Geom_Circle) C = new Geom_Circle(A, myMinor);
Handle(Geom2d_Circle) C2d =
- new Geom2d_Circle(gp_Ax2d(gp_Pnt2d(myMajor, 0), gp_Dir2d(1, 0)), myMinor);
+ new Geom2d_Circle(gp_Ax2d(gp_Pnt2d(myMajor, 0), gp_Dir2d(gp_Dir2d::D::X)), myMinor);
Meridian(C, C2d);
}
BRepPrimAPI_MakeBox::BRepPrimAPI_MakeBox(const Standard_Real dx,
const Standard_Real dy,
const Standard_Real dz)
- : myWedge(gp_Ax2(pmin(gp_Pnt(0, 0, 0), dx, dy, dz), gp_Dir(0, 0, 1), gp_Dir(1, 0, 0)),
+ : myWedge(gp_Ax2(pmin(gp_Pnt(0, 0, 0), dx, dy, dz), gp_Dir(gp_Dir::D::Z), gp_Dir(gp_Dir::D::X)),
Abs(dx),
Abs(dy),
Abs(dz))
const Standard_Real dx,
const Standard_Real dy,
const Standard_Real dz)
- : myWedge(gp_Ax2(pmin(P, dx, dy, dz), gp_Dir(0, 0, 1), gp_Dir(1, 0, 0)),
+ : myWedge(gp_Ax2(pmin(P, dx, dy, dz), gp_Dir(gp_Dir::D::Z), gp_Dir(gp_Dir::D::X)),
Abs(dx),
Abs(dy),
Abs(dz))
}
BRepPrimAPI_MakeBox::BRepPrimAPI_MakeBox(const gp_Pnt& P1, const gp_Pnt& P2)
- : myWedge(gp_Ax2(pmin(P1, P2), gp_Dir(0, 0, 1), gp_Dir(1, 0, 0)),
+ : myWedge(gp_Ax2(pmin(P1, P2), gp_Dir(gp_Dir::D::Z), gp_Dir(gp_Dir::D::X)),
Abs(P2.X() - P1.X()),
Abs(P2.Y() - P1.Y()),
Abs(P2.Z() - P1.Z()))
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)),
+ gp_Ax2(pmin(gp_Pnt(0, 0, 0), theDX, theDY, theDZ), gp_Dir(gp_Dir::D::Z), gp_Dir(gp_Dir::D::X)),
Abs(theDX),
Abs(theDY),
Abs(theDZ));
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));
+ myWedge = BRepPrim_Wedge(
+ gp_Ax2(pmin(thePnt, theDX, theDY, theDZ), gp_Dir(gp_Dir::D::Z), gp_Dir(gp_Dir::D::X)),
+ Abs(theDX),
+ Abs(theDY),
+ Abs(theDZ));
}
//=================================================================================================
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()));
+ myWedge =
+ BRepPrim_Wedge(gp_Ax2(pmin(thePnt1, thePnt2), gp_Dir(gp_Dir::D::Z), gp_Dir(gp_Dir::D::X)),
+ Abs(thePnt2.X() - thePnt1.X()),
+ Abs(thePnt2.Y() - thePnt1.Y()),
+ Abs(thePnt2.Z() - thePnt1.Z()));
}
//=================================================================================================
BRepPrimAPI_MakeRevolution::BRepPrimAPI_MakeRevolution(const Handle(Geom_Curve)& Meridian,
const Standard_Real angle)
- : myRevolution(gp_Ax2(gp_Pnt(0, 0, 0), gp_Dir(0, 0, 1), gp_Dir(1, 0, 0)),
+ : myRevolution(gp_Ax2(gp_Pnt(0, 0, 0), gp_Dir(gp_Dir::D::Z), gp_Dir(gp_Dir::D::X)),
Meridian->FirstParameter(),
Meridian->LastParameter(),
Meridian,
BRepPrimAPI_MakeRevolution::BRepPrimAPI_MakeRevolution(const Handle(Geom_Curve)& Meridian,
const Standard_Real VMin,
const Standard_Real VMax)
- : myRevolution(gp_Ax2(gp_Pnt(0, 0, 0), gp_Dir(0, 0, 1), gp_Dir(1, 0, 0)),
+ : myRevolution(gp_Ax2(gp_Pnt(0, 0, 0), gp_Dir(gp_Dir::D::Z), gp_Dir(gp_Dir::D::X)),
VMin,
VMax,
Meridian,
const Standard_Real VMin,
const Standard_Real VMax,
const Standard_Real angle)
- : myRevolution(gp_Ax2(gp_Pnt(0, 0, 0), gp_Dir(0, 0, 1), gp_Dir(1, 0, 0)),
+ : myRevolution(gp_Ax2(gp_Pnt(0, 0, 0), gp_Dir(gp_Dir::D::Z), gp_Dir(gp_Dir::D::X)),
VMin,
VMax,
Meridian,
//=================================================================================================
BRepPrimAPI_MakeSphere::BRepPrimAPI_MakeSphere(const gp_Pnt& Center, const Standard_Real R)
- : mySphere(gp_Ax2(Center, gp_Dir(0, 0, 1), gp_Dir(1, 0, 0)), R)
+ : mySphere(gp_Ax2(Center, gp_Dir(gp_Dir::D::Z), gp_Dir(gp_Dir::D::X)), R)
{
}
BRepPrimAPI_MakeSphere::BRepPrimAPI_MakeSphere(const gp_Pnt& Center,
const Standard_Real R,
const Standard_Real angle)
- : mySphere(gp_Ax2(Center, gp_Dir(0, 0, 1), gp_Dir(1, 0, 0)), R)
+ : mySphere(gp_Ax2(Center, gp_Dir(gp_Dir::D::Z), gp_Dir(gp_Dir::D::X)), R)
{
mySphere.Angle(angle);
}
const Standard_Real R,
const Standard_Real angle1,
const Standard_Real angle2)
- : mySphere(gp_Ax2(Center, gp_Dir(0, 0, 1), gp_Dir(1, 0, 0)), R)
+ : mySphere(gp_Ax2(Center, gp_Dir(gp_Dir::D::Z), gp_Dir(gp_Dir::D::X)), R)
{
mySphere.VMin(angle1);
mySphere.VMax(angle2);
const Standard_Real angle1,
const Standard_Real angle2,
const Standard_Real angle3)
- : mySphere(gp_Ax2(Center, gp_Dir(0, 0, 1), gp_Dir(1, 0, 0)), R)
+ : mySphere(gp_Ax2(Center, gp_Dir(gp_Dir::D::Z), gp_Dir(gp_Dir::D::X)), R)
{
mySphere.VMin(angle1);
mySphere.VMax(angle2);
const Standard_Real dy,
const Standard_Real dz,
const Standard_Real ltx)
- : myWedge(gp_Ax2(gp_Pnt(0, 0, 0), gp_Dir(0, 0, 1), gp_Dir(1, 0, 0)), dx, dy, dz, ltx)
+ : myWedge(gp_Ax2(gp_Pnt(0, 0, 0), gp_Dir(gp_Dir::D::Z), gp_Dir(gp_Dir::D::X)), dx, dy, dz, ltx)
{
}
const Standard_Real zmin,
const Standard_Real xmax,
const Standard_Real zmax)
- : myWedge(gp_Ax2(gp_Pnt(0, 0, 0), gp_Dir(0, 0, 1), gp_Dir(1, 0, 0)),
+ : myWedge(gp_Ax2(gp_Pnt(0, 0, 0), gp_Dir(gp_Dir::D::Z), gp_Dir(gp_Dir::D::X)),
0,
0,
0,
if (aDirV.Index() == 2)
v = -myVec.Magnitude();
L.SetLocation(gp_Pnt2d(0, v));
- L.SetDirection(gp_Dir2d(1, 0));
+ L.SetDirection(gp_Dir2d(gp_Dir2d::D::X));
// }
Handle(Geom2d_Line) GL = new Geom2d_Line(L);
SetThePCurve(myBuilder.Builder(), TopoDS::Edge(aNewEdge), TopoDS::Face(aNewFace), orien, GL);
if (AS.GetType() != GeomAbs_Plane)
{
L.SetLocation(gp_Pnt2d(BRep_Tool::Parameter(TopoDS::Vertex(aGenV), TopoDS::Edge(aGenE)), 0));
- L.SetDirection(gp_Dir2d(0, -1));
+ L.SetDirection(gp_Dir2d(gp_Dir2d::D::NY));
/* JAG
}
else{
{
// Create conical face: cone with half angle 30 degrees
const Standard_Real aHalfAngle = M_PI / 6.0; // 30 degrees
- gp_Ax2 aAxis(gp_Pnt(0, 0, 0), gp_Dir(0, 0, 1));
+ gp_Ax2 aAxis(gp_Pnt(0, 0, 0), gp_Dir(gp_Dir::D::Z));
Handle(Geom_ConicalSurface) aConeSurf = new Geom_ConicalSurface(aAxis, aHalfAngle, 2.0);
BRepBuilderAPI_MakeFace aFaceMaker(aConeSurf, 0, 2 * M_PI, 0, 3, Precision::Confusion());
TEST_F(CanonicalRecognitionApproxTest, SphericalSurfaceRecognition_A4)
{
// Create spherical face
- gp_Ax2 aAxis(gp_Pnt(0, 0, 0), gp_Dir(0, 0, 1));
+ gp_Ax2 aAxis(gp_Pnt(0, 0, 0), gp_Dir(gp_Dir::D::Z));
Handle(Geom_SphericalSurface) aSphereSurf = new Geom_SphericalSurface(aAxis, 1.0);
BRepBuilderAPI_MakeFace aFaceMaker(aSphereSurf, 0, 2 * M_PI, 0, M_PI / 2, Precision::Confusion());
TEST_F(CanonicalRecognitionBaseCurveTest, EllipseToEllipseRecognition_A3)
{
// Create ellipse with major radius 1, minor radius 0.5
- gp_Ax2 aAxis(gp_Pnt(0, 0, 0), gp_Dir(0, 0, 1), gp_Dir(1, 0, 0));
+ gp_Ax2 aAxis(gp_Pnt(0, 0, 0), gp_Dir(gp_Dir::D::Z), gp_Dir(gp_Dir::D::X));
Handle(Geom_Ellipse) aEllipse = new Geom_Ellipse(aAxis, 1.0, 0.5);
// Convert to B-spline curve
TEST_F(CanonicalRecognitionBaseCurveTest, MultiSegmentCircleWireRecognition_A5)
{
// Create circle and convert to B-spline
- gp_Ax2 aAxis(gp_Pnt(0, 0, 0), gp_Dir(0, 0, 1));
+ gp_Ax2 aAxis(gp_Pnt(0, 0, 0), gp_Dir(gp_Dir::D::Z));
Handle(Geom_Circle) aCircle = new Geom_Circle(aAxis, 1.0);
// Convert to B-spline curve
TEST_F(CanonicalRecognitionBaseCurveTest, MultiSegmentEllipseWireRecognition_A6)
{
// Create ellipse and convert to B-spline
- gp_Ax2 aAxis(gp_Pnt(0, 0, 0), gp_Dir(0, 0, 1), gp_Dir(1, 0, 0));
+ gp_Ax2 aAxis(gp_Pnt(0, 0, 0), gp_Dir(gp_Dir::D::Z), gp_Dir(gp_Dir::D::X));
Handle(Geom_Ellipse) aEllipse = new Geom_Ellipse(aAxis, 1.0, 0.5);
// Convert to B-spline curve
TEST_F(CanonicalRecognitionBaseSurfaceTest, TrimmedCylinderRecognition_B2)
{
// Create cylindrical surface
- gp_Ax2 aAxis(gp_Pnt(0, 0, 0), gp_Dir(0, 0, 1));
+ gp_Ax2 aAxis(gp_Pnt(0, 0, 0), gp_Dir(gp_Dir::D::Z));
Handle(Geom_CylindricalSurface) aCylSurf = new Geom_CylindricalSurface(aAxis, 1.0);
// Create face from cylinder
{
// Create conical surface (30 degree half-angle)
const Standard_Real aSemiAngle = M_PI / 6.0; // 30 degrees
- gp_Ax2 aAxis(gp_Pnt(0, 0, 0), gp_Dir(0, 0, 1));
+ gp_Ax2 aAxis(gp_Pnt(0, 0, 0), gp_Dir(gp_Dir::D::Z));
Handle(Geom_ConicalSurface) aConeSurf = new Geom_ConicalSurface(aAxis, aSemiAngle, 0);
// Create face from cone
TEST_F(CanonicalRecognitionBaseSurfaceTest, ConvertedSphereRecognition_B4)
{
// Create spherical surface and convert to B-spline
- gp_Ax2 aAxis(gp_Pnt(0, 0, 0), gp_Dir(0, 0, 1));
+ gp_Ax2 aAxis(gp_Pnt(0, 0, 0), gp_Dir(gp_Dir::D::Z));
Handle(Geom_SphericalSurface) aSphereSurf = new Geom_SphericalSurface(aAxis, 1.0);
// Convert to B-spline surface
TEST_F(CanonicalRecognitionBaseSurfaceTest, SewnCylindricalSurfaceRecognition_B6)
{
// Create 4 cylindrical face segments to be sewn together
- gp_Ax2 aAxis(gp_Pnt(0, 0, 0), gp_Dir(0, 0, 1));
+ gp_Ax2 aAxis(gp_Pnt(0, 0, 0), gp_Dir(gp_Dir::D::Z));
Handle(Geom_CylindricalSurface) aCylSurf = new Geom_CylindricalSurface(aAxis, 1.0);
BRepBuilderAPI_MakeFace aFaceMaker1(aCylSurf, 0, 3, -1, 0, Precision::Confusion());
{
// Create 4 conical face segments to be sewn together
const Standard_Real aSemiAngle = M_PI / 6.0; // 30 degrees
- gp_Ax2 aAxis(gp_Pnt(0, 0, 0), gp_Dir(0, 0, 1));
+ gp_Ax2 aAxis(gp_Pnt(0, 0, 0), gp_Dir(gp_Dir::D::Z));
Handle(Geom_ConicalSurface) aConeSurf = new Geom_ConicalSurface(aAxis, aSemiAngle, 0);
BRepBuilderAPI_MakeFace aFaceMaker1(aConeSurf, 0, 3, 0, 1, Precision::Confusion());
TEST_F(CanonicalRecognitionBaseSurfaceTest, SewnSphericalSurfaceRecognition_B8)
{
// Create 4 spherical face segments to be sewn together, converted to B-spline
- gp_Ax2 aAxis(gp_Pnt(0, 0, 0), gp_Dir(0, 0, 1));
+ gp_Ax2 aAxis(gp_Pnt(0, 0, 0), gp_Dir(gp_Dir::D::Z));
Handle(Geom_SphericalSurface) aSphereSurf = new Geom_SphericalSurface(aAxis, 1.0);
// Convert to B-spline surface
TEST_F(CanonicalRecognitionBaseSurfaceTest, ComplexCylindricalRecognitionWithSection_B9)
{
// Create 4 cylindrical face segments and sew them together
- gp_Ax2 aAxis(gp_Pnt(0, 0, 0), gp_Dir(0, 0, 1));
+ gp_Ax2 aAxis(gp_Pnt(0, 0, 0), gp_Dir(gp_Dir::D::Z));
Handle(Geom_CylindricalSurface) aCylSurf = new Geom_CylindricalSurface(aAxis, 1.0);
// Create 4 face segments with parameter ranges matching the original test
TEST_F(CanonicalRecognitionBaseSurfaceTest, ExtrudedCylindricalSurfaceRecognition_B10)
{
// Create cylindrical surface (radius 1)
- gp_Ax2 aAxis(gp_Pnt(0, 0, 0), gp_Dir(0, 0, 1));
+ gp_Ax2 aAxis(gp_Pnt(0, 0, 0), gp_Dir(gp_Dir::D::Z));
Handle(Geom_CylindricalSurface) aCylSurf = new Geom_CylindricalSurface(aAxis, 1.0);
// Create plane for intersection: plane at origin with normal (1, 0, 1) normalized
ASSERT_FALSE(anIntCurve.IsNull()) << "Intersection curve is null";
// Create a surface of linear extrusion from the intersection curve
- gp_Dir anExtrusionDir(0, 0, 1);
+ gp_Dir anExtrusionDir(gp_Dir::D::Z);
Handle(Geom_SurfaceOfLinearExtrusion) anExtSurf =
new Geom_SurfaceOfLinearExtrusion(anIntCurve, anExtrusionDir);
Handle(Geom2d_BSplineCurve) aBSpline2d;
if (result->IsKind(STANDARD_TYPE(Geom2d_Conic)))
{
- // gp_Pln pln(gp_Pnt(0,0,0),gp_Dir(0,0,1));
+ // gp_Pln pln(gp_Pnt(0,0,0),gp_Dir(gp_Dir::D::Z));
// Handle(Geom_Curve) curve = GeomAPI::To3d(result,pln);
// clang-format off
Handle(Geom2d_Curve) tcurve = new Geom2d_TrimmedCurve(result,aFirst,aLast); //protection against parabols ets
// clang-format off
gp_Pnt2d pos ( myGrid->UJointValue(i), 0. ); // 0. - for infinite ranges: myGrid->VJointValue(1) ;
// clang-format on
- gp_Lin2d line(pos, gp_Dir2d(0., 1.));
+ gp_Lin2d line(pos, gp_Dir2d(gp_Dir2d::D::Y));
if (!myClosedMode && myUClosed)
{
Standard_Real period = Umax - Umin;
for (i = (myVClosed ? 1 : 2); i <= myGrid->NbVPatches(); i++)
{
gp_Pnt2d pos(0., myGrid->VJointValue(i));
- gp_Lin2d line(pos, gp_Dir2d(1., 0.));
+ gp_Lin2d line(pos, gp_Dir2d(gp_Dir2d::D::X));
if (!myClosedMode && myVClosed)
{
Standard_Real period = Vmax - Vmin;
Handle(Geom2d_Line) theLine2d = Handle(Geom2d_Line)::DownCast(theCurve2d);
gp_Dir2d theDir2d = theLine2d->Direction();
- gp_Dir2d dir1(0.,1.);
- gp_Dir2d dir2(0.,-1.);
+ gp_Dir2d dir1(gp_Dir2d::D::Y);
+ gp_Dir2d dir2(gp_Dir2d::D::NY);
return (theDir2d.IsEqual(dir1,Precision::Angular()) ||
theDir2d.IsEqual(dir2,Precision::Angular()) ||
// Apex curve below the wire
if (anApexV < aMinLoopV)
{
- anApexCurve2d = new Geom2d_Line(gp_Pnt2d(aMinLoopU, anApexV), gp_Dir2d(1, 0));
+ anApexCurve2d = new Geom2d_Line(gp_Pnt2d(aMinLoopU, anApexV), gp_Dir2d(gp_Dir2d::D::X));
if (!isUDecrease)
aSoleWire.Reverse();
}
// Apex curve above the wire
if (anApexV > aMaxLoopV)
{
- anApexCurve2d = new Geom2d_Line(gp_Pnt2d(aMaxLoopU, anApexV), gp_Dir2d(-1, 0));
+ anApexCurve2d = new Geom2d_Line(gp_Pnt2d(aMaxLoopU, anApexV), gp_Dir2d(gp_Dir2d::D::NX));
if (isUDecrease)
aSoleWire.Reverse();
}
// direct construction causes error on osf system.
gp_Pnt p(0, 0, 0);
- gp_Dir d(0, 0, 1);
+ gp_Dir d(gp_Dir::D::Z);
gp_Ax3 ax(p, d);
gp_Pln Pln(ax);
switch (theIndex)
{
case 0:
- a2dCurv =
- new Geom2d_TrimmedCurve(new Geom2d_Line(gp_Pnt2d(0.0, theVfirst), gp_Dir2d(1.0, 0.0)),
- theUfirst,
- theUlast);
+ a2dCurv = new Geom2d_TrimmedCurve(
+ new Geom2d_Line(gp_Pnt2d(0.0, theVfirst), gp_Dir2d(gp_Dir2d::D::X)),
+ theUfirst,
+ theUlast);
break;
case 1:
- a2dCurv =
- new Geom2d_TrimmedCurve(new Geom2d_Line(gp_Pnt2d(theUlast, 0.0), gp_Dir2d(0.0, 1.0)),
- theVfirst,
- theVlast);
+ a2dCurv = new Geom2d_TrimmedCurve(
+ new Geom2d_Line(gp_Pnt2d(theUlast, 0.0), gp_Dir2d(gp_Dir2d::D::Y)),
+ theVfirst,
+ theVlast);
break;
case 2:
- a2dCurv =
- new Geom2d_TrimmedCurve(new Geom2d_Line(gp_Pnt2d(0.0, theVlast), gp_Dir2d(1.0, 0.0)),
- theUfirst,
- theUlast);
+ a2dCurv = new Geom2d_TrimmedCurve(
+ new Geom2d_Line(gp_Pnt2d(0.0, theVlast), gp_Dir2d(gp_Dir2d::D::X)),
+ theUfirst,
+ theUlast);
break;
case 3:
- a2dCurv =
- new Geom2d_TrimmedCurve(new Geom2d_Line(gp_Pnt2d(theUfirst, 0.0), gp_Dir2d(0.0, 1.0)),
- theVfirst,
- theVlast);
+ a2dCurv = new Geom2d_TrimmedCurve(
+ new Geom2d_Line(gp_Pnt2d(theUfirst, 0.0), gp_Dir2d(gp_Dir2d::D::Y)),
+ theVfirst,
+ theVlast);
break;
default:
break;
{
case 0:
a2dCurv = new Geom2d_TrimmedCurve(
- new Geom2d_Line(gp_Pnt2d(theUfirst + theUlast, theVfirst), gp_Dir2d(-1.0, 0.0)),
+ new Geom2d_Line(gp_Pnt2d(theUfirst + theUlast, theVfirst), gp_Dir2d(gp_Dir2d::D::NX)),
theUfirst,
theUlast);
break;
case 1:
a2dCurv = new Geom2d_TrimmedCurve(
- new Geom2d_Line(gp_Pnt2d(theUlast, theVfirst + theVlast), gp_Dir2d(0.0, -1.0)),
+ new Geom2d_Line(gp_Pnt2d(theUlast, theVfirst + theVlast), gp_Dir2d(gp_Dir2d::D::NY)),
theVfirst,
theVlast);
break;
case 2:
a2dCurv = new Geom2d_TrimmedCurve(
- new Geom2d_Line(gp_Pnt2d(theUfirst + theUlast, theVlast), gp_Dir2d(-1.0, 0.0)),
+ new Geom2d_Line(gp_Pnt2d(theUfirst + theUlast, theVlast), gp_Dir2d(gp_Dir2d::D::NX)),
theUfirst,
theUlast);
break;
case 3:
a2dCurv = new Geom2d_TrimmedCurve(
- new Geom2d_Line(gp_Pnt2d(theUfirst, theVfirst + theVlast), gp_Dir2d(0.0, -1.0)),
+ new Geom2d_Line(gp_Pnt2d(theUfirst, theVfirst + theVlast), gp_Dir2d(gp_Dir2d::D::NY)),
theVfirst,
theVlast);
break;
// nothing found, return an horizontal line
Par = RealLast();
- L = gp_Lin2d(P, gp_Dir2d(1, 0));
+ L = gp_Lin2d(P, gp_Dir2d(gp_Dir2d::D::X));
return Standard_False;
}
// make the lines
Handle(Geom2d_Line) Lumin, Lumax, Lvmin, Lvmax;
if (!umininf)
- Lumin = new Geom2d_Line(gp_Pnt2d(UMin, 0), gp_Dir2d(0, 1));
+ Lumin = new Geom2d_Line(gp_Pnt2d(UMin, 0), gp_Dir2d(gp_Dir2d::D::Y));
if (!umaxinf)
- Lumax = new Geom2d_Line(gp_Pnt2d(UMax, 0), gp_Dir2d(0, 1));
+ Lumax = new Geom2d_Line(gp_Pnt2d(UMax, 0), gp_Dir2d(gp_Dir2d::D::Y));
if (!vmininf)
- Lvmin = new Geom2d_Line(gp_Pnt2d(0, VMin), gp_Dir2d(1, 0));
+ Lvmin = new Geom2d_Line(gp_Pnt2d(0, VMin), gp_Dir2d(gp_Dir2d::D::X));
if (!vmaxinf)
- Lvmax = new Geom2d_Line(gp_Pnt2d(0, VMax), gp_Dir2d(1, 0));
+ Lvmax = new Geom2d_Line(gp_Pnt2d(0, VMax), gp_Dir2d(gp_Dir2d::D::X));
// make the face
TopoDS_Face& F = TopoDS::Face(myShape);
Standard_Integer iu, iv;
GS.UIntervals(upars, GeomAbs_C2);
- gp_Dir2d dv(0, 1);
+ gp_Dir2d dv(gp_Dir2d::D::Y);
for (iu = 1; iu <= nu + 1; iu++)
{
Standard_Real u = upars(iu);
}
GS.VIntervals(vpars, GeomAbs_C2);
- gp_Dir2d du(1, 0);
+ gp_Dir2d du(gp_Dir2d::D::X);
for (iv = 1; iv <= nv + 1; iv++)
{
Standard_Real v = vpars(iv);
else
{
// radius is equal to 0. No matter what direction to chose.
- line = gp_Lin2d(circle1.Location(), gp_Dir2d(1., 0.));
+ line = gp_Lin2d(circle1.Location(), gp_Dir2d(gp_Dir2d::D::X));
}
// Modified by skv - Fri Jul 1 16:23:32 2005 IDEM(Airbus) End
Handle(GccInt_Bisec) solution = new GccInt_BLine(line);
static Standard_IStream& operator>>(Standard_IStream& IS, Handle(Geom2d_Line)& L)
{
gp_Pnt2d P(0., 0.);
- gp_Dir2d AX(1., 0.);
+ gp_Dir2d AX(gp_Dir2d::D::X);
IS >> P >> AX;
L = new Geom2d_Line(P, AX);
return IS;
static Standard_IStream& operator>>(Standard_IStream& IS, Handle(Geom2d_Circle)& C)
{
gp_Pnt2d P(0., 0.);
- gp_Dir2d AX(1., 0.), AY(1., 0.);
+ gp_Dir2d AX(gp_Dir2d::D::X), AY(gp_Dir2d::D::X);
Standard_Real R = 0.;
IS >> P >> AX >> AY;
BinTools::GetReal(IS, R);
static Standard_IStream& operator>>(Standard_IStream& IS, Handle(Geom2d_Ellipse)& E)
{
gp_Pnt2d P(0., 0.);
- gp_Dir2d AX(1., 0.), AY(1., 0.);
+ gp_Dir2d AX(gp_Dir2d::D::X), AY(gp_Dir2d::D::X);
Standard_Real R1 = 0., R2 = 0.;
IS >> P >> AX >> AY;
BinTools::GetReal(IS, R1);
static Standard_IStream& operator>>(Standard_IStream& IS, Handle(Geom2d_Parabola)& C)
{
gp_Pnt2d P(0., 0.);
- gp_Dir2d AX(1., 0.), AY(1., 0.);
+ gp_Dir2d AX(gp_Dir2d::D::X), AY(gp_Dir2d::D::X);
Standard_Real R1 = 0.;
IS >> P >> AX >> AY;
BinTools::GetReal(IS, R1);
static Standard_IStream& operator>>(Standard_IStream& IS, Handle(Geom2d_Hyperbola)& H)
{
gp_Pnt2d P(0., 0.);
- gp_Dir2d AX(1., 0.), AY(1., 0.);
+ gp_Dir2d AX(gp_Dir2d::D::X), AY(gp_Dir2d::D::X);
Standard_Real R1 = 0., R2 = 0.;
IS >> P >> AX >> AY;
BinTools::GetReal(IS, R1);
static Standard_IStream& operator>>(Standard_IStream& IS, Handle(Geom_Line)& L)
{
gp_Pnt P(0., 0., 0.);
- gp_Dir AX(1., 0., 0.);
+ gp_Dir AX(gp_Dir::D::X);
IS >> P >> AX;
L = new Geom_Line(P, AX);
return IS;
static Standard_IStream& operator>>(Standard_IStream& IS, Handle(Geom_Circle)& C)
{
gp_Pnt P(0., 0., 0.);
- gp_Dir A(1., 0., 0.), AX(1., 0., 0.), AY(1., 0., 0.);
+ gp_Dir A(gp_Dir::D::X), AX(gp_Dir::D::X), AY(gp_Dir::D::X);
Standard_Real R = 0.;
IS >> P >> A >> AX >> AY;
BinTools::GetReal(IS, R);
static Standard_IStream& operator>>(Standard_IStream& IS, Handle(Geom_Ellipse)& E)
{
gp_Pnt P(0., 0., 0.);
- gp_Dir A(1., 0., 0.), AX(1., 0., 0.), AY(1., 0., 0.);
+ gp_Dir A(gp_Dir::D::X), AX(gp_Dir::D::X), AY(gp_Dir::D::X);
Standard_Real R1 = 0., R2 = 0.;
IS >> P >> A >> AX >> AY;
BinTools::GetReal(IS, R1);
static Standard_IStream& operator>>(Standard_IStream& IS, Handle(Geom_Parabola)& C)
{
gp_Pnt P(0., 0., 0.);
- gp_Dir A(1., 0., 0.), AX(1., 0., 0.), AY(1., 0., 0.);
+ gp_Dir A(gp_Dir::D::X), AX(gp_Dir::D::X), AY(gp_Dir::D::X);
Standard_Real R1 = 0.;
IS >> P >> A >> AX >> AY;
BinTools::GetReal(IS, R1);
static Standard_IStream& operator>>(Standard_IStream& IS, Handle(Geom_Hyperbola)& H)
{
gp_Pnt P(0., 0., 0.);
- gp_Dir A(1., 0., 0.), AX(1., 0., 0.), AY(1., 0., 0);
+ gp_Dir A(gp_Dir::D::X), AX(gp_Dir::D::X), AY(gp_Dir::D::X);
Standard_Real R1 = 0., R2 = 0.;
IS >> P >> A >> AX >> AY;
BinTools::GetReal(IS, R1);
{
Standard_Real p = 0.;
BinTools::GetReal(IS, p); // Offset
- gp_Dir D(1., 0., 0.);
+ gp_Dir D(gp_Dir::D::X);
IS >> D;
Handle(Geom_Curve) BC;
BinTools_CurveSet::ReadCurve(IS, BC);
static Standard_IStream& operator>>(Standard_IStream& IS, gp_Ax3& A3)
{
gp_Pnt P(0., 0., 0.);
- gp_Dir A(1., 0., 0.), AX(1., 0., 0.), AY(1., 0., 0.);
+ gp_Dir A(gp_Dir::D::X), AX(gp_Dir::D::X), AY(gp_Dir::D::X);
IS >> P >> A >> AX >> AY;
gp_Ax3 ax3(P, A, AX);
if (AY.DotCross(A, AX) < 0)
static Standard_IStream& operator>>(Standard_IStream& IS, Handle(Geom_SurfaceOfLinearExtrusion)& S)
{
- gp_Dir D(1., 0., 0.);
+ gp_Dir D(gp_Dir::D::X);
Handle(Geom_Curve) C;
IS >> D;
BinTools_CurveSet::ReadCurve(IS, C);
static Standard_IStream& operator>>(Standard_IStream& IS, Handle(Geom_SurfaceOfRevolution)& S)
{
gp_Pnt P(0., 0., 0.);
- gp_Dir D(1., 0., 0.);
+ gp_Dir D(gp_Dir::D::X);
Handle(Geom_Curve) C;
IS >> P >> D;
BinTools_CurveSet::ReadCurve(IS, C);
void SetUp() override
{
// Create a circle as basis curve
- gp_Circ2d aCircle(gp_Ax2d(gp_Pnt2d(0, 0), gp_Dir2d(1, 0)), 5.0);
+ gp_Circ2d aCircle(gp_Ax2d(gp_Pnt2d(0, 0), gp_Dir2d(gp_Dir2d::D::X)), 5.0);
Handle(Geom2d_Circle) aBasisCurve = new Geom2d_Circle(aCircle);
// Create offset curve
psup = myInfinite;
}
- // Line2dPtr = new Adaptor2d_Line2d(gp_Pnt2d(0.,Vinf),gp_Dir2d(1.,0.),pinf,psup);
+ // Line2dPtr = new Adaptor2d_Line2d(gp_Pnt2d(0.,Vinf),gp_Dir2d(gp_Dir2d::D::X),pinf,psup);
// myRestr[nbRestr] = new Adaptor2d_Line2d(*Line2dPtr);
- myRestr[nbRestr] =
- new Adaptor2d_Line2d(Adaptor2d_Line2d(gp_Pnt2d(0., Vinf), gp_Dir2d(1., 0.), pinf, psup));
+ myRestr[nbRestr] = new Adaptor2d_Line2d(
+ Adaptor2d_Line2d(gp_Pnt2d(0., Vinf), gp_Dir2d(gp_Dir2d::D::X), pinf, psup));
nbRestr++;
}
psup = myInfinite;
}
- // Line2dPtr = new Adaptor2d_Line2d(gp_Pnt2d(Usup,0.),gp_Dir2d(0.,1.),pinf,psup);
+ // Line2dPtr = new Adaptor2d_Line2d(gp_Pnt2d(Usup,0.),gp_Dir2d(gp_Dir2d::D::Y),pinf,psup);
// myRestr[nbRestr] = new Adaptor2d_Line2d(*Line2dPtr);
- myRestr[nbRestr] =
- new Adaptor2d_Line2d(Adaptor2d_Line2d(gp_Pnt2d(Usup, 0.), gp_Dir2d(0., 1.), pinf, psup));
+ myRestr[nbRestr] = new Adaptor2d_Line2d(
+ Adaptor2d_Line2d(gp_Pnt2d(Usup, 0.), gp_Dir2d(gp_Dir2d::D::Y), pinf, psup));
nbRestr++;
}
psup = myInfinite;
}
- // Line2dPtr = new Adaptor2d_Line2d(gp_Pnt2d(0.,Vsup),gp_Dir2d(-1.,0.),pinf,psup);
+ // Line2dPtr = new Adaptor2d_Line2d(gp_Pnt2d(0.,Vsup),gp_Dir2d(gp_Dir2d::D::NX),pinf,psup);
// myRestr[nbRestr] = new Adaptor2d_Line2d(*Line2dPtr);
- myRestr[nbRestr] =
- new Adaptor2d_Line2d(Adaptor2d_Line2d(gp_Pnt2d(0., Vsup), gp_Dir2d(-1., 0.), pinf, psup));
+ myRestr[nbRestr] = new Adaptor2d_Line2d(
+ Adaptor2d_Line2d(gp_Pnt2d(0., Vsup), gp_Dir2d(gp_Dir2d::D::NX), pinf, psup));
nbRestr++;
}
psup = myInfinite;
}
- // Line2dPtr = new Adaptor2d_Line2d(gp_Pnt2d(Uinf,0.),gp_Dir2d(0.,-1),pinf,psup);
+ // Line2dPtr = new Adaptor2d_Line2d(gp_Pnt2d(Uinf,0.),gp_Dir2d(gp_Dir2d::D::NY),pinf,psup);
// myRestr[nbRestr] = new Adaptor2d_Line2d(*Line2dPtr);
- myRestr[nbRestr] =
- new Adaptor2d_Line2d(Adaptor2d_Line2d(gp_Pnt2d(Uinf, 0.), gp_Dir2d(0., -1), pinf, psup));
+ myRestr[nbRestr] = new Adaptor2d_Line2d(
+ Adaptor2d_Line2d(gp_Pnt2d(Uinf, 0.), gp_Dir2d(gp_Dir2d::D::NY), pinf, psup));
nbRestr++;
}
psup = myInfinite;
}
- // Line2dPtr = new Adaptor2d_Line2d(gp_Pnt2d(U,V),gp_Dir2d(1.,0.),pinf,psup);
+ // Line2dPtr = new Adaptor2d_Line2d(gp_Pnt2d(U,V),gp_Dir2d(gp_Dir2d::D::X),pinf,psup);
// myRestr[nbRestr] = new Adaptor2d_Line2d(*Line2dPtr);
myRestr[nbRestr] =
- new Adaptor2d_Line2d(Adaptor2d_Line2d(gp_Pnt2d(U, V), gp_Dir2d(1., 0.), pinf, psup));
+ new Adaptor2d_Line2d(Adaptor2d_Line2d(gp_Pnt2d(U, V), gp_Dir2d(gp_Dir2d::D::X), pinf, psup));
nbRestr++;
}
}
void SetUp() override
{
// Create a circle as basis curve
- gp_Circ aCircle(gp_Ax2(gp_Pnt(0, 0, 0), gp_Dir(0, 0, 1)), 5.0);
+ gp_Circ aCircle(gp_Ax2(gp_Pnt(0, 0, 0), gp_Dir(gp_Dir::D::Z)), 5.0);
Handle(Geom_Circle) aBasisCurve = new Geom_Circle(aCircle);
// Create offset curve
- gp_Dir anOffsetDir(0, 0, 1);
+ gp_Dir anOffsetDir(gp_Dir::D::Z);
Standard_Real anOffsetValue = 2.0;
myOriginalCurve = new Geom_OffsetCurve(aBasisCurve, anOffsetValue, anOffsetDir);
void SetUp() override
{
// Create a plane as basis surface
- gp_Pln aPlane(gp_Ax3(gp_Pnt(0, 0, 0), gp_Dir(0, 0, 1)));
+ gp_Pln aPlane(gp_Ax3(gp_Pnt(0, 0, 0), gp_Dir(gp_Dir::D::Z)));
Handle(Geom_Plane) aBasisSurface = new Geom_Plane(aPlane);
// Create offset surface
static void OpenMin(const gp_Dir& V, Bnd_Box& B)
{
- gp_Dir OX(1., 0., 0.);
- gp_Dir OY(0., 1., 0.);
- gp_Dir OZ(0., 0., 1.);
+ gp_Dir OX(gp_Dir::D::X);
+ gp_Dir OY(gp_Dir::D::Y);
+ gp_Dir OZ(gp_Dir::D::Z);
if (V.IsParallel(OX, Precision::Angular()))
B.OpenXmin();
else if (V.IsParallel(OY, Precision::Angular()))
static void OpenMax(const gp_Dir& V, Bnd_Box& B)
{
- gp_Dir OX(1., 0., 0.);
- gp_Dir OY(0., 1., 0.);
- gp_Dir OZ(0., 0., 1.);
+ gp_Dir OX(gp_Dir::D::X);
+ gp_Dir OY(gp_Dir::D::Y);
+ gp_Dir OZ(gp_Dir::D::Z);
if (V.IsParallel(OX, Precision::Angular()))
B.OpenXmax();
else if (V.IsParallel(OY, Precision::Angular()))
static void OpenMinMax(const gp_Dir& V, Bnd_Box& B)
{
- gp_Dir OX(1., 0., 0.);
- gp_Dir OY(0., 1., 0.);
- gp_Dir OZ(0., 0., 1.);
+ gp_Dir OX(gp_Dir::D::X);
+ gp_Dir OY(gp_Dir::D::Y);
+ gp_Dir OZ(gp_Dir::D::Z);
if (V.IsParallel(OX, Precision::Angular()))
{
B.OpenXmax();
static void OpenMin(const gp_Dir2d& V, Bnd_Box2d& B)
{
- gp_Dir2d OX(1., 0.);
- gp_Dir2d OY(0., 1.);
+ gp_Dir2d OX(gp_Dir2d::D::X);
+ gp_Dir2d OY(gp_Dir2d::D::Y);
if (V.IsParallel(OX, Precision::Angular()))
B.OpenXmin();
else if (V.IsParallel(OY, Precision::Angular()))
static void OpenMax(const gp_Dir2d& V, Bnd_Box2d& B)
{
- gp_Dir2d OX(1., 0.);
- gp_Dir2d OY(0., 1.);
+ gp_Dir2d OX(gp_Dir2d::D::X);
+ gp_Dir2d OY(gp_Dir2d::D::Y);
if (V.IsParallel(OX, Precision::Angular()))
B.OpenXmax();
else if (V.IsParallel(OY, Precision::Angular()))
static void OpenMinMax(const gp_Dir2d& V, Bnd_Box2d& B)
{
- gp_Dir2d OX(1., 0.);
- gp_Dir2d OY(0., 1.);
+ gp_Dir2d OX(gp_Dir2d::D::X);
+ gp_Dir2d OY(gp_Dir2d::D::Y);
if (V.IsParallel(OX, Precision::Angular()))
{
B.OpenXmax();
// Center of 2D-circle
const gp_Pnt2d aPC(0.0, 0.0);
- gp_Ax22d aCircAxis(aPC, gp_Dir2d(1.0, 0.0), gp_Dir2d(0.0, 1.0));
+ gp_Ax22d aCircAxis(aPC, gp_Dir2d(gp_Dir2d::D::X), gp_Dir2d(gp_Dir2d::D::Y));
gp_Circ2d aCirc2d(aCircAxis, theCirc.Radius());
gp_Pnt2d aPL(aVecCL.Dot(aDCx), aVecCL.Dot(aDCy));
{
// Set up common geometric objects for tests
gp_Pnt anOrigin(0, 0, 0);
- gp_Dir aZDir(0, 0, 1);
- gp_Dir anXDir(1, 0, 0);
+ gp_Dir aZDir(gp_Dir::D::Z);
+ gp_Dir anXDir(gp_Dir::D::X);
gp_Ax3 anAxis(anOrigin, aZDir, anXDir);
// Create sphere at origin with radius 5
// Create two spheres that intersect in a circle
gp_Pnt aCenter1(0, 0, 0);
gp_Pnt aCenter2(3, 0, 0); // Overlapping spheres
- gp_Dir aZDir(0, 0, 1);
- gp_Dir anXDir(1, 0, 0);
+ gp_Dir aZDir(gp_Dir::D::Z);
+ gp_Dir anXDir(gp_Dir::D::X);
gp_Ax3 anAxis1(aCenter1, aZDir, anXDir);
gp_Ax3 anAxis2(aCenter2, aZDir, anXDir);
const gp_Pnt2d aCenter((prodP1V * aDelta.Y() - prodDeM * aVec.Y()) / vprodVD,
(prodDeM * aVec.X() - prodP1V * aDelta.X()) / vprodVD);
const Standard_Real aRad = (aCenter.Distance(aP1) + aCenter.Distance(aP2)) * 0.5;
- const gp_Ax22d ax22d(aCenter, gp_Dir2d(1., 0.), gp_Dir2d(0., 1.));
+ const gp_Ax22d ax22d(aCenter, gp_Dir2d(gp_Dir2d::D::X), gp_Dir2d(gp_Dir2d::D::Y));
const gp_Circ2d aCir(ax22d, aRad);
const Handle(Geom2d_Circle) Circ = new Geom2d_Circle(aCir);
Handle(Geom2d_Curve) theMirrored = Handle(Geom2d_Curve)::DownCast(theCurve->Copy());
gp_Trsf2d T;
gp_Pnt2d Loc(0., 0.);
- gp_Dir2d Dir(1., 0.);
+ gp_Dir2d Dir(gp_Dir2d::D::X);
gp_Ax2d ax2(Loc, Dir);
T.SetMirror(ax2);
theMirrored->Transform(T);
static Standard_IStream& operator>>(Standard_IStream& IS, Handle(Geom2d_Line)& L)
{
gp_Pnt2d P(0., 0.);
- gp_Dir2d AX(1., 0.);
+ gp_Dir2d AX(gp_Dir2d::D::X);
IS >> P >> AX;
L = new Geom2d_Line(P, AX);
return IS;
static Standard_IStream& operator>>(Standard_IStream& IS, Handle(Geom2d_Circle)& C)
{
gp_Pnt2d P(0., 0.);
- gp_Dir2d AX(1., 0.), AY(1., 0.);
+ gp_Dir2d AX(gp_Dir2d::D::X), AY(gp_Dir2d::D::X);
Standard_Real R = 0.;
IS >> P >> AX >> AY;
GeomTools::GetReal(IS, R);
static Standard_IStream& operator>>(Standard_IStream& IS, Handle(Geom2d_Ellipse)& E)
{
gp_Pnt2d P(0., 0.);
- gp_Dir2d AX(1., 0.), AY(1., 0.);
+ gp_Dir2d AX(gp_Dir2d::D::X), AY(gp_Dir2d::D::X);
Standard_Real R1 = 0., R2 = 0.;
IS >> P >> AX >> AY;
GeomTools::GetReal(IS, R1);
static Standard_IStream& operator>>(Standard_IStream& IS, Handle(Geom2d_Parabola)& C)
{
gp_Pnt2d P(0., 0.);
- gp_Dir2d AX(1., 0.), AY(1., 0.);
+ gp_Dir2d AX(gp_Dir2d::D::X), AY(gp_Dir2d::D::X);
Standard_Real R1 = 0.;
IS >> P >> AX >> AY;
GeomTools::GetReal(IS, R1);
static Standard_IStream& operator>>(Standard_IStream& IS, Handle(Geom2d_Hyperbola)& H)
{
gp_Pnt2d P(0., 0.);
- gp_Dir2d AX(1., 0.), AY(1., 0.);
+ gp_Dir2d AX(gp_Dir2d::D::X), AY(gp_Dir2d::D::X);
Standard_Real R1 = 0., R2 = 0.;
IS >> P >> AX >> AY;
GeomTools::GetReal(IS, R1);
static Standard_IStream& operator>>(Standard_IStream& IS, Handle(Geom_Line)& L)
{
gp_Pnt P(0., 0., 0.);
- gp_Dir AX(1., 0., 0.);
+ gp_Dir AX(gp_Dir::D::X);
IS >> P >> AX;
L = new Geom_Line(P, AX);
return IS;
static Standard_IStream& operator>>(Standard_IStream& IS, Handle(Geom_Circle)& C)
{
gp_Pnt P(0., 0., 0.);
- gp_Dir A(1., 0., 0.), AX(1., 0., 0.), AY(1., 0., 0.);
+ gp_Dir A(gp_Dir::D::X), AX(gp_Dir::D::X), AY(gp_Dir::D::X);
Standard_Real R = 0.;
IS >> P >> A >> AX >> AY;
GeomTools::GetReal(IS, R);
static Standard_IStream& operator>>(Standard_IStream& IS, Handle(Geom_Ellipse)& E)
{
gp_Pnt P(0., 0., 0.);
- gp_Dir A(1., 0., 0.), AX(1., 0., 0.), AY(1., 0., 0.);
+ gp_Dir A(gp_Dir::D::X), AX(gp_Dir::D::X), AY(gp_Dir::D::X);
Standard_Real R1 = 0., R2 = 0.;
IS >> P >> A >> AX >> AY;
GeomTools::GetReal(IS, R1);
static Standard_IStream& operator>>(Standard_IStream& IS, Handle(Geom_Parabola)& C)
{
gp_Pnt P(0., 0., 0.);
- gp_Dir A(1., 0., 0.), AX(1., 0., 0.), AY(1., 0., 0.);
+ gp_Dir A(gp_Dir::D::X), AX(gp_Dir::D::X), AY(gp_Dir::D::X);
Standard_Real R1 = 0.;
IS >> P >> A >> AX >> AY;
GeomTools::GetReal(IS, R1);
static Standard_IStream& operator>>(Standard_IStream& IS, Handle(Geom_Hyperbola)& H)
{
gp_Pnt P(0., 0., 0.);
- gp_Dir A(1., 0., 0.), AX(1., 0., 0.), AY(1., 0., 0.);
+ gp_Dir A(gp_Dir::D::X), AX(gp_Dir::D::X), AY(gp_Dir::D::X);
Standard_Real R1 = 0., R2 = 0.;
IS >> P >> A >> AX >> AY;
GeomTools::GetReal(IS, R1);
{
Standard_Real p = 0.;
GeomTools::GetReal(IS, p);
- gp_Dir D(1., 0., 0.);
+ gp_Dir D(gp_Dir::D::X);
IS >> D;
Handle(Geom_Curve) BC = GeomTools_CurveSet::ReadCurve(IS);
C = new Geom_OffsetCurve(BC, p, D);
static Standard_IStream& operator>>(Standard_IStream& IS, gp_Ax3& A3)
{
gp_Pnt P(0., 0., 0.);
- gp_Dir A(1., 0., 0.), AX(1., 0., 0.), AY(1., 0., 0.);
+ gp_Dir A(gp_Dir::D::X), AX(gp_Dir::D::X), AY(gp_Dir::D::X);
IS >> P >> A >> AX >> AY;
gp_Ax3 ax3(P, A, AX);
if (AY.DotCross(A, AX) < 0)
static Standard_IStream& operator>>(Standard_IStream& IS, Handle(Geom_SurfaceOfLinearExtrusion)& S)
{
- gp_Dir D(1., 0., 0.);
+ gp_Dir D(gp_Dir::D::X);
IS >> D;
Handle(Geom_Curve) C = GeomTools_CurveSet::ReadCurve(IS);
S = new Geom_SurfaceOfLinearExtrusion(C, D);
static Standard_IStream& operator>>(Standard_IStream& IS, Handle(Geom_SurfaceOfRevolution)& S)
{
gp_Pnt P(0., 0., 0.);
- gp_Dir D(1., 0., 0.);
+ gp_Dir D(gp_Dir::D::X);
IS >> P >> D;
Handle(Geom_Curve) C = GeomTools_CurveSet::ReadCurve(IS);
S = new Geom_SurfaceOfRevolution(C, gp_Ax1(P, D));
gp_Lin2d Ligs(Orig, Dire);
gp_Pnt2d Pnt2dBid(0.0, 0.0);
- gp_Dir2d Dir2dBid(1.0, 0.0);
+ gp_Dir2d Dir2dBid(gp_Dir2d::D::X);
gp_Ax2d Ax2dBid(Pnt2dBid, Dir2dBid);
gp_Circ2d Cir(Ax2dBid, C.Radius());
Ufin = Pfin.Y();
if (Udeb > Ufin)
{
- Dir = gp_Dir2d(0, -1);
+ Dir = gp_Dir2d(gp_Dir2d::D::NY);
Udeb = -Udeb;
Ufin = -Ufin;
}
else
- Dir = gp_Dir2d(0, 1);
+ Dir = gp_Dir2d(gp_Dir2d::D::Y);
PCur2d = new Geom2d_TrimmedCurve(new Geom2d_Line(gp_Pnt2d(UIso, 0), Dir), Udeb, Ufin);
HPCur = new Geom2dAdaptor_Curve(PCur2d);
}
Ufin = Pfin.X();
if (Udeb > Ufin)
{
- Dir = gp_Dir2d(-1, 0);
+ Dir = gp_Dir2d(gp_Dir2d::D::NX);
Udeb = -Udeb;
Ufin = -Ufin;
}
else
- Dir = gp_Dir2d(1, 0);
+ Dir = gp_Dir2d(gp_Dir2d::D::X);
PCur2d = new Geom2d_TrimmedCurve(new Geom2d_Line(gp_Pnt2d(0, VIso), Dir), Udeb, Ufin);
HPCur = new Geom2dAdaptor_Curve(PCur2d);
}
myBSpline->Translate(gp_Vec2d(du, dv));
if (ToMirror)
{
- gp_Ax2d Axe(gp_Pnt2d(0., 0.), gp_Dir2d(1., 0.));
+ gp_Ax2d Axe(gp_Pnt2d(0., 0.), gp_Dir2d(gp_Dir2d::D::X));
myBSpline->Mirror(Axe);
}
}
//
if ((dist1 < aResolution) && (dist2 < aResolution) && (dist3 < aResolution))
{
- gp_Dir Dirx(1., 0., 0.);
- gp_Dir Dirz(0., 0., 1.);
+ gp_Dir Dirx(gp_Dir::D::X);
+ gp_Dir Dirz(gp_Dir::D::Z);
TheCirc = gp_Circ(gp_Ax2(P1, Dirx, Dirz), 0.);
return;
}
pInt.Coord(x3, y3, z3);
if (dist1 < aResolution)
{
- gp_Dir Dirx(1., 0., 0.);
- gp_Dir Dirz(0., 0., 1.);
+ gp_Dir Dirx(gp_Dir::D::X);
+ gp_Dir Dirz(gp_Dir::D::Z);
TheCirc = gp_Circ(gp_Ax2(pInt, Dirx, Dirz), 0.);
return;
}
//=========================================================================
gce_MakeCirc2d::gce_MakeCirc2d(const gp_Pnt2d& P1, const gp_Pnt2d& P2, const gp_Pnt2d& P3)
{
- gp_Dir2d dirx(1.0, 0.0);
+ gp_Dir2d dirx(gp_Dir2d::D::X);
//=========================================================================
// Traitement. +
{
if (Radius >= 0.)
{
- TheCirc2d = gp_Circ2d(gp_Ax2d(Center, gp_Dir2d(1.0, 0.0)), Radius, Sense);
+ TheCirc2d = gp_Circ2d(gp_Ax2d(Center, gp_Dir2d(gp_Dir2d::D::X)), Radius, Sense);
TheError = gce_Done;
}
else
const gp_Pnt2d& Point,
const Standard_Boolean Sense)
{
- TheCirc2d = gp_Circ2d(gp_Ax2d(Center, gp_Dir2d(1.0, 0.0)), Point.Distance(Center), Sense);
+ TheCirc2d = gp_Circ2d(gp_Ax2d(Center, gp_Dir2d(gp_Dir2d::D::X)), Point.Distance(Center), Sense);
TheError = gce_Done;
}
new Graphic3d_ArrayOfSegments(aNbEdgePrimitives * 2);
Standard_Real aMin = gp::Resolution() * gp::Resolution();
- gp_Dir aDefNorm(0., 0., 1.);
+ gp_Dir aDefNorm(gp_Dir::D::Z);
// Prepare for scaling the incoming colors
const Standard_Real anColorRatio = 1.0;
continue;
}
- aTrsf.SetDisplacement(gp_Ax3(gp_Pnt(0, 0, 0), gp_Dir(0, 0, 1)),
+ aTrsf.SetDisplacement(gp_Ax3(gp_Pnt(0, 0, 0), gp_Dir(gp_Dir::D::Z)),
gp_Ax3(gp_Pnt(X, Y, Z), aVec));
DrawVector(aTrsf,
Graphic3d_BndBox3d aBox; // Invalid box
gp_Trsf aRotation;
- aRotation.SetRotation(gp_Ax1(gp_Pnt(0, 0, 0), gp_Dir(0, 0, 1)), M_PI / 4);
+ aRotation.SetRotation(gp_Ax1(gp_Pnt(0, 0, 0), gp_Dir(gp_Dir::D::Z)), M_PI / 4);
Graphic3d_Mat4d aMat;
aRotation.GetMat4(aMat);
Graphic3d_Camera::Graphic3d_Camera()
: myUp(0.0, 1.0, 0.0),
- myDirection(0.0, 0.0, 1.0),
+ myDirection(gp_Dir::D::Z),
myEye(0.0, 0.0, -1500.0),
myDistance(1500.0),
myAxialScale(1.0, 1.0, 1.0),
Graphic3d_Camera::Graphic3d_Camera(const Handle(Graphic3d_Camera)& theOther)
: myUp(0.0, 1.0, 0.0),
- myDirection(0.0, 0.0, 1.0),
+ myDirection(gp_Dir::D::Z),
myEye(0.0, 0.0, -1500.0),
myDistance(1500.0),
myAxialScale(1.0, 1.0, 1.0),
void Graphic3d_Camera::SetIdentityOrientation()
{
SetEyeAndCenter(gp_Pnt(0.0, 0.0, 0.0), gp_Pnt(0.0, 0.0, -1.0));
- SetUp(gp_Dir(0.0, 1.0, 0.0));
+ SetUp(gp_Dir(gp_Dir::D::Y));
}
//=================================================================================================
gp_Pnt aV2 = gp_Pnt(anIndent, anIndent * 2.0, 0.0).Transformed(aTrsf);
gp_Pnt aV3 = gp_Pnt(anIndent * 2.0, anIndent * 2.0, 0.0).Transformed(aTrsf);
gp_Pnt aV4 = gp_Pnt(anIndent * 2.0, anIndent, 0.0).Transformed(aTrsf);
- gp_Dir aNormal = gp_Dir(0.0, 0.0, -1.0).Transformed(aTrsf);
+ gp_Dir aNormal = gp_Dir(gp_Dir::D::NZ).Transformed(aTrsf);
myArray->AddVertex(aV1, aNormal);
myArray->AddVertex(aV2, aNormal);
gp_Trsf aTrsf;
aTrsf.SetTransformation(aSystem, gp_Ax3());
- gp_Dir aNormal = gp_Dir(1.0, 0.0, 0.0).Transformed(aTrsf);
+ gp_Dir aNormal = gp_Dir(gp_Dir::D::X).Transformed(aTrsf);
Standard_Real aLength = myLength + myIndent * 4.0f;
const Standard_Real aStepV = 1.0f / aStripsNb;
gp_Trsf AIS_TextLabel::calculateLabelTrsf(const gp_Pnt& thePosition, gp_Pnt& theCenterOfLabel) const
{
const Standard_Real anAngle = myDrawer->TextAspect()->Aspect()->TextAngle() * M_PI / 180.0;
- const gp_Ax1 aRotAxis(thePosition, gp_Dir(0.0, 0.0, 1.0));
+ const gp_Ax1 aRotAxis(thePosition, gp_Dir(gp_Dir::D::Z));
gp_Ax2 anOrientation = myOrientation3D;
anOrientation.Rotate(aRotAxis, anAngle);
aPresentation->CurrentGroup()->AddPrimitiveArray(aPrims);
// Add presentation of arrows (points)
- gp_Dir aDir(0, 0, 1);
+ gp_Dir aDir(gp_Dir::D::Z);
DsgPrs::ComputeSymbol(aPresentation, LA, Middle12, Middle34, aDir, aDir, DsgPrs_AS_BOTHPT);
// ota -- begin --
// Two small lines in the middle of this line
//! Computes normal at given parameter location of the surface.
virtual gp_Dir Normal(const Standard_Real, const Standard_Real) const Standard_OVERRIDE
{
- return gp_Dir(0.0, 0.0, -1.0);
+ return gp_Dir(gp_Dir::D::NZ);
}
protected:
//! Computes normal at given parameter location of the surface.
virtual gp_Dir Normal(const Standard_Real, const Standard_Real) const Standard_OVERRIDE
{
- return gp_Dir(0.0, 0.0, -1.0);
+ return gp_Dir(gp_Dir::D::NZ);
}
protected:
anAxis.Transform(theTrsf);
Handle(Geom_Circle) aCirc = new Geom_Circle(anAxis, theRadius);
- gp_Dir aCircNorm = gp_Dir(0, 0, 1).Transformed(theTrsf);
+ gp_Dir aCircNorm = gp_Dir(gp_Dir::D::Z).Transformed(theTrsf);
Handle(Geom_Surface) aCircPlane = new Geom_Plane(aCircCenter, aCircNorm);
for (Standard_Integer anIdx = myBoundaryPoints.Lower();
myDefaultTypeOfView(V3d_ORTHOGRAPHIC),
myComputedMode(Standard_True),
myDefaultComputedMode(Standard_False),
- myPrivilegedPlane(gp_Ax3(gp_Pnt(0., 0., 0), gp_Dir(0., 0., 1.), gp_Dir(1., 0., 0.))),
+ myPrivilegedPlane(gp_Ax3(gp_Pnt(0., 0., 0), gp_Dir(gp_Dir::D::Z), gp_Dir(gp_Dir::D::X))),
myDisplayPlane(Standard_False),
myDisplayPlaneLength(1000.0),
myGridType(Aspect_GT_Rectangular),
for {set i 1} { $i <= 6} {incr i} {
restore [locate_data_file bug24676_b1_${i}.brep] b1_$i
- if {![regexp "no 3d curves\n has no 3d points" [ bopcurves b1_$i b2 ]]} {
- puts "Error: Non-empty intersection result between b1_$i and b2, while empty is expected"
+ set log [bopcurves b1_$i b2]
+ regexp {Tolerance Reached=+([-0-9.+eE]+)\n+([-0-9.+eE]+)} $log full Toler NbCurv
+ if {$NbCurv != 1} {
+ puts "Error: Number of curves is wrong"
}
}