mirror of
https://github.com/Open-Cascade-SAS/OCCT.git
synced 2026-06-07 05:37:56 +08:00
Foundation Classes, gp - Add constexpr/noexcept constructors and standard direction enums (#803)
- 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
This commit is contained in:
@@ -345,7 +345,7 @@ static Standard_IStream& operator>>(Standard_IStream& IS, gp_Dir2d& D)
|
||||
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;
|
||||
@@ -356,7 +356,7 @@ static Standard_IStream& operator>>(Standard_IStream& IS, Handle(Geom2d_Line)& L
|
||||
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);
|
||||
@@ -369,7 +369,7 @@ static Standard_IStream& operator>>(Standard_IStream& IS, Handle(Geom2d_Circle)&
|
||||
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);
|
||||
@@ -383,7 +383,7 @@ static Standard_IStream& operator>>(Standard_IStream& IS, Handle(Geom2d_Ellipse)
|
||||
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);
|
||||
@@ -396,7 +396,7 @@ static Standard_IStream& operator>>(Standard_IStream& IS, Handle(Geom2d_Parabola
|
||||
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);
|
||||
|
||||
@@ -355,7 +355,7 @@ static Standard_IStream& operator>>(Standard_IStream& IS, gp_Dir& D)
|
||||
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;
|
||||
@@ -366,7 +366,7 @@ static Standard_IStream& operator>>(Standard_IStream& IS, Handle(Geom_Line)& L)
|
||||
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);
|
||||
@@ -379,7 +379,7 @@ static Standard_IStream& operator>>(Standard_IStream& IS, Handle(Geom_Circle)& C
|
||||
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);
|
||||
@@ -393,7 +393,7 @@ static Standard_IStream& operator>>(Standard_IStream& IS, Handle(Geom_Ellipse)&
|
||||
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);
|
||||
@@ -406,7 +406,7 @@ static Standard_IStream& operator>>(Standard_IStream& IS, Handle(Geom_Parabola)&
|
||||
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);
|
||||
@@ -513,7 +513,7 @@ static Standard_IStream& operator>>(Standard_IStream& IS, Handle(Geom_OffsetCurv
|
||||
{
|
||||
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);
|
||||
|
||||
@@ -425,7 +425,7 @@ static Standard_IStream& operator>>(Standard_IStream& IS, gp_Dir& 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)
|
||||
@@ -516,7 +516,7 @@ static Standard_IStream& operator>>(Standard_IStream& IS, Handle(Geom_ToroidalSu
|
||||
|
||||
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);
|
||||
@@ -532,7 +532,7 @@ static Standard_IStream& operator>>(Standard_IStream& IS, Handle(Geom_SurfaceOfL
|
||||
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);
|
||||
|
||||
Reference in New Issue
Block a user