- Added `noexcept` to transformation and mirroring methods across all 2D geometry classes
- Added `constexpr` to trivial getters, setters, and simple computational methods where applicable
- Removed an unused variable declaration in GeomInt_IntSS_1.cxx
#include <gp_Vec2d.hxx>
#include <Standard_Dump.hxx>
-void gp_Ax22d::Mirror(const gp_Pnt2d& P)
+void gp_Ax22d::Mirror(const gp_Pnt2d& P) noexcept
{
gp_Pnt2d Temp = point;
Temp.Mirror(P);
vydir.Reverse();
}
-gp_Ax22d gp_Ax22d::Mirrored(const gp_Pnt2d& P) const
+gp_Ax22d gp_Ax22d::Mirrored(const gp_Pnt2d& P) const noexcept
{
gp_Ax22d Temp = *this;
Temp.Mirror(P);
return Temp;
}
-void gp_Ax22d::Mirror(const gp_Ax2d& A1)
+void gp_Ax22d::Mirror(const gp_Ax2d& A1) noexcept
{
vydir.Mirror(A1);
vxdir.Mirror(A1);
point = Temp;
}
-gp_Ax22d gp_Ax22d::Mirrored(const gp_Ax2d& A1) const
+gp_Ax22d gp_Ax22d::Mirrored(const gp_Ax2d& A1) const noexcept
{
gp_Ax22d Temp = *this;
Temp.Mirror(A1);
//! Returns the "YDirection" of <me>.
constexpr const gp_Dir2d& YDirection() const noexcept { return vydir; }
- Standard_EXPORT void Mirror(const gp_Pnt2d& theP);
+ Standard_EXPORT void Mirror(const gp_Pnt2d& theP) noexcept;
//! Performs the symmetrical transformation of an axis
//! placement with respect to the point theP which is the
//! The main direction of the axis placement is not changed.
//! The "XDirection" and the "YDirection" are reversed.
//! So the axis placement stay right handed.
- Standard_NODISCARD Standard_EXPORT gp_Ax22d Mirrored(const gp_Pnt2d& theP) const;
+ Standard_NODISCARD Standard_EXPORT gp_Ax22d Mirrored(const gp_Pnt2d& theP) const noexcept;
- Standard_EXPORT void Mirror(const gp_Ax2d& theA);
+ Standard_EXPORT void Mirror(const gp_Ax2d& theA) noexcept;
//! Performs the symmetrical transformation of an axis
//! placement with respect to an axis placement which
//! point, on the "XDirection" and "YDirection".
//! The resulting main "Direction" is the cross product between
//! the "XDirection" and the "YDirection" after transformation.
- Standard_NODISCARD Standard_EXPORT gp_Ax22d Mirrored(const gp_Ax2d& theA) const;
+ Standard_NODISCARD Standard_EXPORT gp_Ax22d Mirrored(const gp_Ax2d& theA) const noexcept;
void Rotate(const gp_Pnt2d& theP, const Standard_Real theAng);
return aTemp;
}
- void Transform(const gp_Trsf2d& theT);
+ void Transform(const gp_Trsf2d& theT) noexcept;
//! Transforms an axis placement with a Trsf.
//! The "Location" point, the "XDirection" and the
//=================================================================================================
-inline void gp_Ax22d::Transform(const gp_Trsf2d& theT)
+inline void gp_Ax22d::Transform(const gp_Trsf2d& theT) noexcept
{
gp_Pnt2d aTemp = point;
aTemp.Transform(theT);
vdir.Reverse();
}
-void gp_Ax2d::Mirror(const gp_Pnt2d& P)
+void gp_Ax2d::Mirror(const gp_Pnt2d& P) noexcept
{
loc.Mirror(P);
vdir.Reverse();
}
-gp_Ax2d gp_Ax2d::Mirrored(const gp_Pnt2d& P) const
+gp_Ax2d gp_Ax2d::Mirrored(const gp_Pnt2d& P) const noexcept
{
gp_Ax2d A = *this;
A.Mirror(P);
return A;
}
-void gp_Ax2d::Mirror(const gp_Ax2d& A)
+void gp_Ax2d::Mirror(const gp_Ax2d& A) noexcept
{
loc.Mirror(A);
vdir.Mirror(A.vdir);
}
-gp_Ax2d gp_Ax2d::Mirrored(const gp_Ax2d& A) const
+gp_Ax2d gp_Ax2d::Mirrored(const gp_Ax2d& A) const noexcept
{
gp_Ax2d AA = *this;
AA.Mirror(A);
return aTemp;
}
- Standard_EXPORT void Mirror(const gp_Pnt2d& P);
+ Standard_EXPORT void Mirror(const gp_Pnt2d& P) noexcept;
//! Performs the symmetrical transformation of an axis
//! placement with respect to the point P which is the
//! center of the symmetry.
- Standard_NODISCARD Standard_EXPORT gp_Ax2d Mirrored(const gp_Pnt2d& P) const;
+ Standard_NODISCARD Standard_EXPORT gp_Ax2d Mirrored(const gp_Pnt2d& P) const noexcept;
- Standard_EXPORT void Mirror(const gp_Ax2d& A);
+ Standard_EXPORT void Mirror(const gp_Ax2d& A) noexcept;
//! Performs the symmetrical transformation of an axis
//! placement with respect to an axis placement which
//! is the axis of the symmetry.
- Standard_NODISCARD Standard_EXPORT gp_Ax2d Mirrored(const gp_Ax2d& A) const;
+ Standard_NODISCARD Standard_EXPORT gp_Ax2d Mirrored(const gp_Ax2d& A) const noexcept;
void Rotate(const gp_Pnt2d& theP, const Standard_Real theAng)
{
#include <gp_Ax22d.hxx>
#include <gp_Pnt2d.hxx>
-void gp_Circ2d::Mirror(const gp_Pnt2d& P)
+void gp_Circ2d::Mirror(const gp_Pnt2d& P) noexcept
{
pos.Mirror(P);
}
-gp_Circ2d gp_Circ2d::Mirrored(const gp_Pnt2d& P) const
+gp_Circ2d gp_Circ2d::Mirrored(const gp_Pnt2d& P) const noexcept
{
gp_Circ2d C = *this;
C.pos.Mirror(P);
return C;
}
-void gp_Circ2d::Mirror(const gp_Ax2d& A)
+void gp_Circ2d::Mirror(const gp_Ax2d& A) noexcept
{
pos.Mirror(A);
}
-gp_Circ2d gp_Circ2d::Mirrored(const gp_Ax2d& A) const
+gp_Circ2d gp_Circ2d::Mirrored(const gp_Ax2d& A) const noexcept
{
gp_Circ2d C = *this;
C.pos.Mirror(A);
DEFINE_STANDARD_ALLOC
//! creates an indefinite circle.
- gp_Circ2d()
+ gp_Circ2d() noexcept
: radius(RealLast())
{
}
}
//! Changes the location point (center) of the circle.
- void SetLocation(const gp_Pnt2d& theP) { pos.SetLocation(theP); }
+ constexpr void SetLocation(const gp_Pnt2d& theP) noexcept { pos.SetLocation(theP); }
//! Changes the X axis of the circle.
void SetXAxis(const gp_Ax2d& theA) { pos.SetXAxis(theA); }
//! Changes the X axis of the circle.
- void SetAxis(const gp_Ax22d& theA) { pos.SetAxis(theA); }
+ constexpr void SetAxis(const gp_Ax22d& theA) noexcept { pos.SetAxis(theA); }
//! Changes the Y axis of the circle.
void SetYAxis(const gp_Ax2d& theA) { pos.SetYAxis(theA); }
}
//! Computes the area of the circle.
- Standard_Real Area() const { return M_PI * radius * radius; }
+ constexpr Standard_Real Area() const noexcept { return M_PI * radius * radius; }
//! Returns the normalized coefficients from the implicit equation
//! of the circle :
//! theA * (X**2) + theB * (Y**2) + 2*theC*(X*Y) + 2*theD*X + 2*theE*Y + theF = 0.0
- void Coefficients(Standard_Real& theA,
- Standard_Real& theB,
- Standard_Real& theC,
- Standard_Real& theD,
- Standard_Real& theE,
- Standard_Real& theF) const;
+ constexpr void Coefficients(Standard_Real& theA,
+ Standard_Real& theB,
+ Standard_Real& theC,
+ Standard_Real& theD,
+ Standard_Real& theE,
+ Standard_Real& theF) const noexcept;
//! Does <me> contain theP ?
//! Returns True if the distance between theP and any point on
//! the circumference of the circle is lower of equal to
//! <theLinearTolerance>.
- Standard_Boolean Contains(const gp_Pnt2d& theP, const Standard_Real theLinearTolerance) const
+ Standard_Boolean Contains(const gp_Pnt2d& theP,
+ const Standard_Real theLinearTolerance) const noexcept
{
return Distance(theP) <= theLinearTolerance;
}
//! Computes the minimum of distance between the point theP and any
//! point on the circumference of the circle.
- Standard_Real Distance(const gp_Pnt2d& theP) const;
+ Standard_Real Distance(const gp_Pnt2d& theP) const noexcept;
//! Computes the square distance between <me> and the point theP.
- Standard_Real SquareDistance(const gp_Pnt2d& theP) const;
+ Standard_Real SquareDistance(const gp_Pnt2d& theP) const noexcept;
//! computes the circumference of the circle.
- Standard_Real Length() const { return 2. * M_PI * radius; }
+ constexpr Standard_Real Length() const noexcept { return 2. * M_PI * radius; }
//! Returns the location point (center) of the circle.
- const gp_Pnt2d& Location() const { return pos.Location(); }
+ constexpr const gp_Pnt2d& Location() const noexcept { return pos.Location(); }
//! Returns the radius value of the circle.
- Standard_Real Radius() const { return radius; }
+ constexpr Standard_Real Radius() const noexcept { return radius; }
//! returns the position of the circle.
- const gp_Ax22d& Axis() const { return pos; }
+ constexpr const gp_Ax22d& Axis() const noexcept { return pos; }
//! returns the position of the circle. Idem Axis(me).
- const gp_Ax22d& Position() const { return pos; }
+ constexpr const gp_Ax22d& Position() const noexcept { return pos; }
//! returns the X axis of the circle.
- gp_Ax2d XAxis() const { return gp_Ax2d(pos.XAxis()); }
+ gp_Ax2d XAxis() const noexcept { return gp_Ax2d(pos.XAxis()); }
//! Returns the Y axis of the circle.
//! Reverses the direction of the circle.
- gp_Ax2d YAxis() const { return gp_Ax2d(pos.YAxis()); }
+ gp_Ax2d YAxis() const noexcept { return gp_Ax2d(pos.YAxis()); }
//! Reverses the orientation of the local coordinate system
//! of this circle (the "Y Direction" is reversed) and therefore
//! changes the implicit orientation of this circle.
//! Reverse assigns the result to this circle,
- void Reverse()
+ void Reverse() noexcept
{
gp_Dir2d aTemp = pos.YDirection();
aTemp.Reverse();
//! of this circle (the "Y Direction" is reversed) and therefore
//! changes the implicit orientation of this circle.
//! Reversed creates a new circle.
- Standard_NODISCARD gp_Circ2d Reversed() const;
+ Standard_NODISCARD gp_Circ2d Reversed() const noexcept;
//! Returns true if the local coordinate system is direct
//! and false in the other case.
- Standard_Boolean IsDirect() const { return (pos.XDirection().Crossed(pos.YDirection())) >= 0.0; }
+ constexpr Standard_Boolean IsDirect() const noexcept
+ {
+ return (pos.XDirection().Crossed(pos.YDirection())) >= 0.0;
+ }
- Standard_EXPORT void Mirror(const gp_Pnt2d& theP);
+ Standard_EXPORT void Mirror(const gp_Pnt2d& theP) noexcept;
//! Performs the symmetrical transformation of a circle with respect
//! to the point theP which is the center of the symmetry
- Standard_NODISCARD Standard_EXPORT gp_Circ2d Mirrored(const gp_Pnt2d& theP) const;
+ Standard_NODISCARD Standard_EXPORT gp_Circ2d Mirrored(const gp_Pnt2d& theP) const noexcept;
- Standard_EXPORT void Mirror(const gp_Ax2d& theA);
+ Standard_EXPORT void Mirror(const gp_Ax2d& theA) noexcept;
//! Performs the symmetrical transformation of a circle with respect
//! to an axis placement which is the axis of the symmetry.
- Standard_NODISCARD Standard_EXPORT gp_Circ2d Mirrored(const gp_Ax2d& theA) const;
+ Standard_NODISCARD Standard_EXPORT gp_Circ2d Mirrored(const gp_Ax2d& theA) const noexcept;
void Rotate(const gp_Pnt2d& theP, const Standard_Real theAng) { pos.Rotate(theP, theAng); }
//! Transforms a circle with the transformation theT from class Trsf2d.
Standard_NODISCARD gp_Circ2d Transformed(const gp_Trsf2d& theT) const;
- void Translate(const gp_Vec2d& theV) { pos.Translate(theV); }
+ constexpr void Translate(const gp_Vec2d& theV) noexcept { pos.Translate(theV); }
//! Translates a circle in the direction of the vector theV.
//! The magnitude of the translation is the vector's magnitude.
- Standard_NODISCARD gp_Circ2d Translated(const gp_Vec2d& theV) const
+ Standard_NODISCARD gp_Circ2d Translated(const gp_Vec2d& theV) const noexcept
{
gp_Circ2d aCirc = *this;
aCirc.pos.Translate(theV);
return aCirc;
}
- void Translate(const gp_Pnt2d& theP1, const gp_Pnt2d& theP2) { pos.Translate(theP1, theP2); }
+ constexpr void Translate(const gp_Pnt2d& theP1, const gp_Pnt2d& theP2) noexcept
+ {
+ pos.Translate(theP1, theP2);
+ }
//! Translates a circle from the point theP1 to the point theP2.
- Standard_NODISCARD gp_Circ2d Translated(const gp_Pnt2d& theP1, const gp_Pnt2d& theP2) const
+ Standard_NODISCARD gp_Circ2d Translated(const gp_Pnt2d& theP1,
+ const gp_Pnt2d& theP2) const noexcept
{
gp_Circ2d aCirc = *this;
aCirc.pos.Translate(theP1, theP2);
//=================================================================================================
-inline void gp_Circ2d::Coefficients(Standard_Real& theA,
- Standard_Real& theB,
- Standard_Real& theC,
- Standard_Real& theD,
- Standard_Real& theE,
- Standard_Real& theF) const
+constexpr inline void gp_Circ2d::Coefficients(Standard_Real& theA,
+ Standard_Real& theB,
+ Standard_Real& theC,
+ Standard_Real& theD,
+ Standard_Real& theE,
+ Standard_Real& theF) const noexcept
{
Standard_Real aXc = pos.Location().X();
Standard_Real anYc = pos.Location().Y();
//=================================================================================================
-inline Standard_Real gp_Circ2d::Distance(const gp_Pnt2d& theP) const
+inline Standard_Real gp_Circ2d::Distance(const gp_Pnt2d& theP) const noexcept
{
gp_XY aCoord = theP.XY();
aCoord.Subtract(pos.Location().XY());
//=================================================================================================
-inline gp_Circ2d gp_Circ2d::Reversed() const
+inline gp_Circ2d gp_Circ2d::Reversed() const noexcept
{
gp_Circ2d aCirc = *this;
gp_Dir2d aTemp = pos.YDirection();
//=================================================================================================
-inline Standard_Real gp_Circ2d::SquareDistance(const gp_Pnt2d& theP) const
+inline Standard_Real gp_Circ2d::SquareDistance(const gp_Pnt2d& theP) const noexcept
{
gp_XY aCoord = theP.XY();
aCoord.Subtract(pos.Location().XY());
}
}
-void gp_Dir2d::Mirror(const gp_Ax2d& A2)
+void gp_Dir2d::Mirror(const gp_Ax2d& A2) noexcept
{
const gp_XY& XY = A2.Direction().XY();
Standard_Real A = XY.X();
coord.SetCoord(XX, YY);
}
-void gp_Dir2d::Transform(const gp_Trsf2d& T)
+void gp_Dir2d::Transform(const gp_Trsf2d& T) noexcept
{
if (T.Form() == gp_Identity || T.Form() == gp_Translation)
{
}
}
-void gp_Dir2d::Mirror(const gp_Dir2d& V)
+void gp_Dir2d::Mirror(const gp_Dir2d& V) noexcept
{
const gp_XY& XY = V.coord;
Standard_Real A = XY.X();
coord.SetCoord(XX, YY);
}
-gp_Dir2d gp_Dir2d::Mirrored(const gp_Dir2d& V) const
+gp_Dir2d gp_Dir2d::Mirrored(const gp_Dir2d& V) const noexcept
{
gp_Dir2d Vres = *this;
Vres.Mirror(V);
return Vres;
}
-gp_Dir2d gp_Dir2d::Mirrored(const gp_Ax2d& A) const
+gp_Dir2d gp_Dir2d::Mirrored(const gp_Ax2d& A) const noexcept
{
gp_Dir2d V = *this;
V.Mirror(A);
Standard_NODISCARD constexpr gp_Dir2d operator-() const noexcept { return Reversed(); }
- Standard_EXPORT void Mirror(const gp_Dir2d& theV);
+ Standard_EXPORT void Mirror(const gp_Dir2d& theV) noexcept;
//! Performs the symmetrical transformation of a direction
//! with respect to the direction theV which is the center of
//! the symmetry.
- Standard_NODISCARD Standard_EXPORT gp_Dir2d Mirrored(const gp_Dir2d& theV) const;
+ Standard_NODISCARD Standard_EXPORT gp_Dir2d Mirrored(const gp_Dir2d& theV) const noexcept;
- Standard_EXPORT void Mirror(const gp_Ax2d& theA);
+ Standard_EXPORT void Mirror(const gp_Ax2d& theA) noexcept;
//! Performs the symmetrical transformation of a direction
//! with respect to an axis placement which is the axis
//! of the symmetry.
- Standard_NODISCARD Standard_EXPORT gp_Dir2d Mirrored(const gp_Ax2d& theA) const;
+ Standard_NODISCARD Standard_EXPORT gp_Dir2d Mirrored(const gp_Ax2d& theA) const noexcept;
void Rotate(const Standard_Real Ang);
return aV;
}
- Standard_EXPORT void Transform(const gp_Trsf2d& theT);
+ Standard_EXPORT void Transform(const gp_Trsf2d& theT) noexcept;
//! Transforms a direction with the "Trsf" theT.
//! Warnings :
}
}
-void gp_Elips2d::Mirror(const gp_Pnt2d& P)
+void gp_Elips2d::Mirror(const gp_Pnt2d& P) noexcept
{
pos.Mirror(P);
}
-gp_Elips2d gp_Elips2d::Mirrored(const gp_Pnt2d& P) const
+gp_Elips2d gp_Elips2d::Mirrored(const gp_Pnt2d& P) const noexcept
{
gp_Elips2d E = *this;
E.pos.Mirror(P);
return E;
}
-void gp_Elips2d::Mirror(const gp_Ax2d& A)
+void gp_Elips2d::Mirror(const gp_Ax2d& A) noexcept
{
pos.Mirror(A);
}
-gp_Elips2d gp_Elips2d::Mirrored(const gp_Ax2d& A) const
+gp_Elips2d gp_Elips2d::Mirrored(const gp_Ax2d& A) const noexcept
{
gp_Elips2d E = *this;
E.pos.Mirror(A);
DEFINE_STANDARD_ALLOC
//! Creates an indefinite ellipse.
- gp_Elips2d()
+ gp_Elips2d() noexcept
: majorRadius(RealLast()),
minorRadius(RealSmall())
{
//! Modifies this ellipse, by redefining its local coordinate system so that
//! - its origin becomes theP.
- void SetLocation(const gp_Pnt2d& theP) { pos.SetLocation(theP); }
+ constexpr void SetLocation(const gp_Pnt2d& theP) noexcept { pos.SetLocation(theP); }
//! Changes the value of the major radius.
//! Raises ConstructionError if theMajorRadius < MinorRadius.
//! Modifies this ellipse, by redefining its local coordinate system so that
//! it becomes theA.
- void SetAxis(const gp_Ax22d& theA) { pos.SetAxis(theA); }
+ constexpr void SetAxis(const gp_Ax22d& theA) noexcept { pos.SetAxis(theA); }
//! Modifies this ellipse, by redefining its local coordinate system so that
//! its origin and its "X Direction" become those
void SetYAxis(const gp_Ax2d& theA) { pos.SetYAxis(theA); }
//! Computes the area of the ellipse.
- Standard_Real Area() const { return M_PI * majorRadius * minorRadius; }
+ constexpr Standard_Real Area() const noexcept { return M_PI * majorRadius * minorRadius; }
//! Returns the coefficients of the implicit equation of the ellipse.
//! theA * (X**2) + theB * (Y**2) + 2*theC*(X*Y) + 2*theD*X + 2*theE*Y + theF = 0.
gp_Pnt2d Focus2() const;
//! Returns the center of the ellipse.
- const gp_Pnt2d& Location() const { return pos.Location(); }
+ constexpr const gp_Pnt2d& Location() const noexcept { return pos.Location(); }
//! Returns the major radius of the Ellipse.
- Standard_Real MajorRadius() const { return majorRadius; }
+ constexpr Standard_Real MajorRadius() const noexcept { return majorRadius; }
//! Returns the minor radius of the Ellipse.
- Standard_Real MinorRadius() const { return minorRadius; }
+ constexpr Standard_Real MinorRadius() const noexcept { return minorRadius; }
//! Returns p = (1 - e * e) * MajorRadius where e is the eccentricity
//! of the ellipse.
//! Returns 0 if MajorRadius = 0
- Standard_Real Parameter() const;
+ constexpr Standard_Real Parameter() const noexcept;
//! Returns the major axis of the ellipse.
- const gp_Ax22d& Axis() const { return pos; }
+ constexpr const gp_Ax22d& Axis() const noexcept { return pos; }
//! Returns the major axis of the ellipse.
- gp_Ax2d XAxis() const { return pos.XAxis(); }
+ gp_Ax2d XAxis() const noexcept { return pos.XAxis(); }
//! Returns the minor axis of the ellipse.
//! Reverses the direction of the circle.
- gp_Ax2d YAxis() const { return pos.YAxis(); }
+ gp_Ax2d YAxis() const noexcept { return pos.YAxis(); }
- void Reverse()
+ void Reverse() noexcept
{
gp_Dir2d aTemp = pos.YDirection();
aTemp.Reverse();
pos.SetAxis(gp_Ax22d(pos.Location(), pos.XDirection(), aTemp));
}
- Standard_NODISCARD gp_Elips2d Reversed() const;
+ Standard_NODISCARD gp_Elips2d Reversed() const noexcept;
//! Returns true if the local coordinate system is direct
//! and false in the other case.
- Standard_Boolean IsDirect() const { return (pos.XDirection().Crossed(pos.YDirection())) >= 0.0; }
+ constexpr Standard_Boolean IsDirect() const noexcept
+ {
+ return (pos.XDirection().Crossed(pos.YDirection())) >= 0.0;
+ }
- Standard_EXPORT void Mirror(const gp_Pnt2d& theP);
+ Standard_EXPORT void Mirror(const gp_Pnt2d& theP) noexcept;
//! Performs the symmetrical transformation of a ellipse with respect
//! to the point theP which is the center of the symmetry
- Standard_NODISCARD Standard_EXPORT gp_Elips2d Mirrored(const gp_Pnt2d& theP) const;
+ Standard_NODISCARD Standard_EXPORT gp_Elips2d Mirrored(const gp_Pnt2d& theP) const noexcept;
- Standard_EXPORT void Mirror(const gp_Ax2d& theA);
+ Standard_EXPORT void Mirror(const gp_Ax2d& theA) noexcept;
//! Performs the symmetrical transformation of a ellipse with respect
//! to an axis placement which is the axis of the symmetry.
- Standard_NODISCARD Standard_EXPORT gp_Elips2d Mirrored(const gp_Ax2d& theA) const;
+ Standard_NODISCARD Standard_EXPORT gp_Elips2d Mirrored(const gp_Ax2d& theA) const noexcept;
void Rotate(const gp_Pnt2d& theP, const Standard_Real theAng) { pos.Rotate(theP, theAng); }
//! Transforms an ellipse with the transformation theT from class Trsf2d.
Standard_NODISCARD gp_Elips2d Transformed(const gp_Trsf2d& theT) const;
- void Translate(const gp_Vec2d& theV) { pos.Translate(theV); }
+ constexpr void Translate(const gp_Vec2d& theV) noexcept { pos.Translate(theV); }
//! Translates a ellipse in the direction of the vector theV.
//! The magnitude of the translation is the vector's magnitude.
- Standard_NODISCARD gp_Elips2d Translated(const gp_Vec2d& theV) const
+ Standard_NODISCARD gp_Elips2d Translated(const gp_Vec2d& theV) const noexcept
{
gp_Elips2d anE = *this;
anE.pos.Translate(theV);
return anE;
}
- void Translate(const gp_Pnt2d& theP1, const gp_Pnt2d& theP2) { pos.Translate(theP1, theP2); }
+ constexpr void Translate(const gp_Pnt2d& theP1, const gp_Pnt2d& theP2) noexcept
+ {
+ pos.Translate(theP1, theP2);
+ }
//! Translates a ellipse from the point theP1 to the point theP2.
- Standard_NODISCARD gp_Elips2d Translated(const gp_Pnt2d& theP1, const gp_Pnt2d& theP2) const
+ Standard_NODISCARD gp_Elips2d Translated(const gp_Pnt2d& theP1,
+ const gp_Pnt2d& theP2) const noexcept
{
gp_Elips2d anE = *this;
anE.pos.Translate(theP1, theP2);
//=================================================================================================
-inline Standard_Real gp_Elips2d::Parameter() const
+inline constexpr Standard_Real gp_Elips2d::Parameter() const noexcept
{
if (majorRadius == 0.0)
{
//=================================================================================================
-inline gp_Elips2d gp_Elips2d::Reversed() const
+inline gp_Elips2d gp_Elips2d::Reversed() const noexcept
{
gp_Elips2d anE = *this;
gp_Dir2d aTemp = pos.YDirection();
}
}
-void gp_Hypr2d::Mirror(const gp_Pnt2d& P)
+void gp_Hypr2d::Mirror(const gp_Pnt2d& P) noexcept
{
pos.Mirror(P);
}
-gp_Hypr2d gp_Hypr2d::Mirrored(const gp_Pnt2d& P) const
+gp_Hypr2d gp_Hypr2d::Mirrored(const gp_Pnt2d& P) const noexcept
{
gp_Hypr2d H = *this;
H.pos.Mirror(P);
return H;
}
-void gp_Hypr2d::Mirror(const gp_Ax2d& A)
+void gp_Hypr2d::Mirror(const gp_Ax2d& A) noexcept
{
pos.Mirror(A);
}
-gp_Hypr2d gp_Hypr2d::Mirrored(const gp_Ax2d& A) const
+gp_Hypr2d gp_Hypr2d::Mirrored(const gp_Ax2d& A) const noexcept
{
gp_Hypr2d H = *this;
H.pos.Mirror(A);
DEFINE_STANDARD_ALLOC
//! Creates of an indefinite hyperbola.
- gp_Hypr2d()
+ gp_Hypr2d() noexcept
: majorRadius(RealLast()),
minorRadius(RealLast())
{
//! Modifies this hyperbola, by redefining its local
//! coordinate system so that its origin becomes theP.
- void SetLocation(const gp_Pnt2d& theP) { pos.SetLocation(theP); }
+ constexpr void SetLocation(const gp_Pnt2d& theP) noexcept { pos.SetLocation(theP); }
//! Modifies the major or minor radius of this hyperbola.
//! Exceptions
//! Modifies this hyperbola, by redefining its local
//! coordinate system so that it becomes theA.
- void SetAxis(const gp_Ax22d& theA) { pos.SetAxis(theA); }
+ constexpr void SetAxis(const gp_Ax22d& theA) noexcept { pos.SetAxis(theA); }
//! Changes the major axis of the hyperbola. The minor axis is
//! recomputed and the location of the hyperbola too.
//! Computes the branch of hyperbola which is on the positive side of the
//! "YAxis" of <me>.
- gp_Hypr2d ConjugateBranch1() const
+ gp_Hypr2d ConjugateBranch1() const noexcept
{
gp_Dir2d aV(pos.YDirection());
Standard_Boolean isSign = (pos.XDirection().Crossed(pos.YDirection())) >= 0.0;
//! Computes the branch of hyperbola which is on the negative side of the
//! "YAxis" of <me>.
- gp_Hypr2d ConjugateBranch2() const
+ gp_Hypr2d ConjugateBranch2() const noexcept
{
gp_Dir2d aV(pos.YDirection().Reversed());
Standard_Boolean isSign = (pos.XDirection().Crossed(pos.YDirection())) >= 0.0;
//! Computes the focal distance. It is the distance between the
//! "Location" of the hyperbola and "Focus1" or "Focus2".
- Standard_Real Focal() const
+ Standard_Real Focal() const noexcept
{
return 2.0 * sqrt(majorRadius * majorRadius + minorRadius * minorRadius);
}
//! Returns the first focus of the hyperbola. This focus is on the
//! positive side of the "XAxis" of the hyperbola.
- gp_Pnt2d Focus1() const
+ gp_Pnt2d Focus1() const noexcept
{
Standard_Real aC = sqrt(majorRadius * majorRadius + minorRadius * minorRadius);
return gp_Pnt2d(pos.Location().X() + aC * pos.XDirection().X(),
//! Returns the second focus of the hyperbola. This focus is on the
//! negative side of the "XAxis" of the hyperbola.
- gp_Pnt2d Focus2() const
+ gp_Pnt2d Focus2() const noexcept
{
Standard_Real aC = sqrt(majorRadius * majorRadius + minorRadius * minorRadius);
return gp_Pnt2d(pos.Location().X() - aC * pos.XDirection().X(),
//! Returns the location point of the hyperbola.
//! It is the intersection point between the "XAxis" and
//! the "YAxis".
- const gp_Pnt2d& Location() const { return pos.Location(); }
+ constexpr const gp_Pnt2d& Location() const noexcept { return pos.Location(); }
//! Returns the major radius of the hyperbola (it is the radius
//! corresponding to the "XAxis" of the hyperbola).
- Standard_Real MajorRadius() const { return majorRadius; }
+ constexpr Standard_Real MajorRadius() const noexcept { return majorRadius; }
//! Returns the minor radius of the hyperbola (it is the radius
//! corresponding to the "YAxis" of the hyperbola).
- Standard_Real MinorRadius() const { return minorRadius; }
+ constexpr Standard_Real MinorRadius() const noexcept { return minorRadius; }
//! Returns the branch of hyperbola obtained by doing the
//! symmetrical transformation of <me> with respect to the
//! "YAxis" of <me>.
- gp_Hypr2d OtherBranch() const
+ gp_Hypr2d OtherBranch() const noexcept
{
Standard_Boolean isSign = (pos.XDirection().Crossed(pos.YDirection())) >= 0.0;
return gp_Hypr2d(gp_Ax2d(pos.Location(), pos.XDirection().Reversed()),
}
//! Returns the axisplacement of the hyperbola.
- const gp_Ax22d& Axis() const { return pos; }
+ constexpr const gp_Ax22d& Axis() const noexcept { return pos; }
//! Computes an axis whose
//! - the origin is the center of this hyperbola, and
//! - the unit vector is the "X Direction" or "Y Direction"
//! respectively of the local coordinate system of this hyperbola
//! Returns the major axis of the hyperbola.
- gp_Ax2d XAxis() const { return pos.XAxis(); }
+ gp_Ax2d XAxis() const noexcept { return pos.XAxis(); }
//! Computes an axis whose
//! - the origin is the center of this hyperbola, and
//! - the unit vector is the "X Direction" or "Y Direction"
//! respectively of the local coordinate system of this hyperbola
//! Returns the minor axis of the hyperbola.
- gp_Ax2d YAxis() const { return pos.YAxis(); }
+ gp_Ax2d YAxis() const noexcept { return pos.YAxis(); }
- void Reverse()
+ void Reverse() noexcept
{
gp_Dir2d aTemp = pos.YDirection();
aTemp.Reverse();
//! Note:
//! - Reverse assigns the result to this hyperbola, while
//! - Reversed creates a new one.
- Standard_NODISCARD gp_Hypr2d Reversed() const;
+ Standard_NODISCARD gp_Hypr2d Reversed() const noexcept;
//! Returns true if the local coordinate system is direct
//! and false in the other case.
- Standard_Boolean IsDirect() const { return (pos.XDirection().Crossed(pos.YDirection())) >= 0.0; }
+ constexpr Standard_Boolean IsDirect() const noexcept
+ {
+ return (pos.XDirection().Crossed(pos.YDirection())) >= 0.0;
+ }
- Standard_EXPORT void Mirror(const gp_Pnt2d& theP);
+ Standard_EXPORT void Mirror(const gp_Pnt2d& theP) noexcept;
//! Performs the symmetrical transformation of an hyperbola with
//! respect to the point theP which is the center of the symmetry.
- Standard_NODISCARD Standard_EXPORT gp_Hypr2d Mirrored(const gp_Pnt2d& theP) const;
+ Standard_NODISCARD Standard_EXPORT gp_Hypr2d Mirrored(const gp_Pnt2d& theP) const noexcept;
- Standard_EXPORT void Mirror(const gp_Ax2d& theA);
+ Standard_EXPORT void Mirror(const gp_Ax2d& theA) noexcept;
//! Performs the symmetrical transformation of an hyperbola with
//! respect to an axis placement which is the axis of the symmetry.
- Standard_NODISCARD Standard_EXPORT gp_Hypr2d Mirrored(const gp_Ax2d& theA) const;
+ Standard_NODISCARD Standard_EXPORT gp_Hypr2d Mirrored(const gp_Ax2d& theA) const noexcept;
void Rotate(const gp_Pnt2d& theP, const Standard_Real theAng) { pos.Rotate(theP, theAng); }
//! class Trsf2d.
Standard_NODISCARD gp_Hypr2d Transformed(const gp_Trsf2d& theT) const;
- void Translate(const gp_Vec2d& theV) { pos.Translate(theV); }
+ constexpr void Translate(const gp_Vec2d& theV) noexcept { pos.Translate(theV); }
//! Translates an hyperbola in the direction of the vector theV.
//! The magnitude of the translation is the vector's magnitude.
- Standard_NODISCARD gp_Hypr2d Translated(const gp_Vec2d& theV) const
+ Standard_NODISCARD gp_Hypr2d Translated(const gp_Vec2d& theV) const noexcept
{
gp_Hypr2d aH = *this;
aH.pos.Translate(theV);
return aH;
}
- void Translate(const gp_Pnt2d& theP1, const gp_Pnt2d& theP2) { pos.Translate(theP1, theP2); }
+ constexpr void Translate(const gp_Pnt2d& theP1, const gp_Pnt2d& theP2) noexcept
+ {
+ pos.Translate(theP1, theP2);
+ }
//! Translates an hyperbola from the point theP1 to the point theP2.
- Standard_NODISCARD gp_Hypr2d Translated(const gp_Pnt2d& theP1, const gp_Pnt2d& theP2) const
+ Standard_NODISCARD gp_Hypr2d Translated(const gp_Pnt2d& theP1,
+ const gp_Pnt2d& theP2) const noexcept
{
gp_Hypr2d aH = *this;
aH.pos.Translate(theP1, theP2);
//=================================================================================================
-inline gp_Hypr2d gp_Hypr2d::Reversed() const
+inline gp_Hypr2d gp_Hypr2d::Reversed() const noexcept
{
gp_Hypr2d aH = *this;
gp_Dir2d aTemp = pos.YDirection();
//=================================================================================================
-void gp_Lin2d::Mirror(const gp_Pnt2d& P)
+void gp_Lin2d::Mirror(const gp_Pnt2d& P) noexcept
{
pos.Mirror(P);
}
//=================================================================================================
-gp_Lin2d gp_Lin2d::Mirrored(const gp_Pnt2d& P) const
+gp_Lin2d gp_Lin2d::Mirrored(const gp_Pnt2d& P) const noexcept
{
gp_Lin2d L = *this;
L.pos.Mirror(P);
//=================================================================================================
-void gp_Lin2d::Mirror(const gp_Ax2d& A)
+void gp_Lin2d::Mirror(const gp_Ax2d& A) noexcept
{
pos.Mirror(A);
}
//=================================================================================================
-gp_Lin2d gp_Lin2d::Mirrored(const gp_Ax2d& A) const
+gp_Lin2d gp_Lin2d::Mirrored(const gp_Ax2d& A) const noexcept
{
gp_Lin2d L = *this;
L.pos.Mirror(A);
//! Creates a Line corresponding to X axis of the
//! reference coordinate system.
- gp_Lin2d() {}
+ constexpr gp_Lin2d() noexcept {}
//! Creates a line located with theA.
- gp_Lin2d(const gp_Ax2d& theA)
+ constexpr gp_Lin2d(const gp_Ax2d& theA) noexcept
: pos(theA)
{
}
//! <theP> is the location point (origin) of the line and
//! <theV> is the direction of the line.
- gp_Lin2d(const gp_Pnt2d& theP, const gp_Dir2d& theV)
+ constexpr gp_Lin2d(const gp_Pnt2d& theP, const gp_Dir2d& theV) noexcept
: pos(theP, theV)
{
}
const Standard_Real theB,
const Standard_Real theC);
- void Reverse() { pos.Reverse(); }
+ constexpr void Reverse() noexcept { pos.Reverse(); }
//! Reverses the positioning axis of this line.
//! Note:
//! - Reverse assigns the result to this line, while
//! - Reversed creates a new one.
- Standard_NODISCARD gp_Lin2d Reversed() const
+ Standard_NODISCARD constexpr gp_Lin2d Reversed() const noexcept
{
gp_Lin2d aL = *this;
aL.pos.Reverse();
}
//! Changes the direction of the line.
- void SetDirection(const gp_Dir2d& theV) { pos.SetDirection(theV); }
+ constexpr void SetDirection(const gp_Dir2d& theV) noexcept { pos.SetDirection(theV); }
//! Changes the origin of the line.
- void SetLocation(const gp_Pnt2d& theP) { pos.SetLocation(theP); }
+ constexpr void SetLocation(const gp_Pnt2d& theP) noexcept { pos.SetLocation(theP); }
//! Complete redefinition of the line.
//! The "Location" point of <theA> is the origin of the line.
//! The "Direction" of <theA> is the direction of the line.
- void SetPosition(const gp_Ax2d& theA) { pos = theA; }
+ constexpr void SetPosition(const gp_Ax2d& theA) noexcept { pos = theA; }
//! Returns the normalized coefficients of the line :
//! theA * X + theB * Y + theC = 0.
- void Coefficients(Standard_Real& theA, Standard_Real& theB, Standard_Real& theC) const
+ constexpr void Coefficients(Standard_Real& theA,
+ Standard_Real& theB,
+ Standard_Real& theC) const noexcept
{
theA = pos.Direction().Y();
theB = -pos.Direction().X();
}
//! Returns the direction of the line.
- const gp_Dir2d& Direction() const { return pos.Direction(); }
+ constexpr const gp_Dir2d& Direction() const noexcept { return pos.Direction(); }
//! Returns the location point (origin) of the line.
- const gp_Pnt2d& Location() const { return pos.Location(); }
+ constexpr const gp_Pnt2d& Location() const noexcept { return pos.Location(); }
//! Returns the axis placement one axis with the same
//! location and direction as <me>.
- const gp_Ax2d& Position() const { return pos; }
+ constexpr const gp_Ax2d& Position() const noexcept { return pos; }
//! Computes the angle between two lines in radians.
Standard_Real Angle(const gp_Lin2d& theOther) const
//! Returns true if this line contains the point theP, that is, if the
//! distance between point theP and this line is less than or
//! equal to theLinearTolerance.
- Standard_Boolean Contains(const gp_Pnt2d& theP, const Standard_Real theLinearTolerance) const
+ Standard_Boolean Contains(const gp_Pnt2d& theP,
+ const Standard_Real theLinearTolerance) const noexcept
{
return Distance(theP) <= theLinearTolerance;
}
//! Computes the distance between <me> and the point <theP>.
- Standard_Real Distance(const gp_Pnt2d& theP) const;
+ Standard_Real Distance(const gp_Pnt2d& theP) const noexcept;
//! Computes the distance between two lines.
- Standard_Real Distance(const gp_Lin2d& theOther) const;
+ Standard_Real Distance(const gp_Lin2d& theOther) const noexcept;
//! Computes the square distance between <me> and the point
//! <theP>.
- Standard_Real SquareDistance(const gp_Pnt2d& theP) const;
+ constexpr Standard_Real SquareDistance(const gp_Pnt2d& theP) const noexcept;
//! Computes the square distance between two lines.
- Standard_Real SquareDistance(const gp_Lin2d& theOther) const;
+ Standard_Real SquareDistance(const gp_Lin2d& theOther) const noexcept;
//! Computes the line normal to the direction of <me>,
//! passing through the point <theP>.
- gp_Lin2d Normal(const gp_Pnt2d& theP) const
+ gp_Lin2d Normal(const gp_Pnt2d& theP) const noexcept
{
return gp_Lin2d(gp_Ax2d(theP, gp_Dir2d(-(pos.Direction().Y()), pos.Direction().X())));
}
- Standard_EXPORT void Mirror(const gp_Pnt2d& theP);
+ Standard_EXPORT void Mirror(const gp_Pnt2d& theP) noexcept;
//! Performs the symmetrical transformation of a line
//! with respect to the point <theP> which is the center
//! of the symmetry
- Standard_NODISCARD Standard_EXPORT gp_Lin2d Mirrored(const gp_Pnt2d& theP) const;
+ Standard_NODISCARD Standard_EXPORT gp_Lin2d Mirrored(const gp_Pnt2d& theP) const noexcept;
- Standard_EXPORT void Mirror(const gp_Ax2d& theA);
+ Standard_EXPORT void Mirror(const gp_Ax2d& theA) noexcept;
//! Performs the symmetrical transformation of a line
//! with respect to an axis placement which is the axis
//! of the symmetry.
- Standard_NODISCARD Standard_EXPORT gp_Lin2d Mirrored(const gp_Ax2d& theA) const;
+ Standard_NODISCARD Standard_EXPORT gp_Lin2d Mirrored(const gp_Ax2d& theA) const noexcept;
void Rotate(const gp_Pnt2d& theP, const Standard_Real theAng) { pos.Rotate(theP, theAng); }
return aL;
}
- void Transform(const gp_Trsf2d& theT) { pos.Transform(theT); }
+ void Transform(const gp_Trsf2d& theT) noexcept { pos.Transform(theT); }
//! Transforms a line with the transformation theT from class Trsf2d.
- Standard_NODISCARD gp_Lin2d Transformed(const gp_Trsf2d& theT) const
+ Standard_NODISCARD gp_Lin2d Transformed(const gp_Trsf2d& theT) const noexcept
{
gp_Lin2d aL = *this;
aL.pos.Transform(theT);
return aL;
}
- void Translate(const gp_Vec2d& theV) { pos.Translate(theV); }
+ constexpr void Translate(const gp_Vec2d& theV) noexcept { pos.Translate(theV); }
//! Translates a line in the direction of the vector theV.
//! The magnitude of the translation is the vector's magnitude.
- Standard_NODISCARD gp_Lin2d Translated(const gp_Vec2d& theV) const
+ Standard_NODISCARD gp_Lin2d Translated(const gp_Vec2d& theV) const noexcept
{
gp_Lin2d aL = *this;
aL.pos.Translate(theV);
return aL;
}
- void Translate(const gp_Pnt2d& theP1, const gp_Pnt2d& theP2) { pos.Translate(theP1, theP2); }
+ constexpr void Translate(const gp_Pnt2d& theP1, const gp_Pnt2d& theP2) noexcept
+ {
+ pos.Translate(theP1, theP2);
+ }
//! Translates a line from the point theP1 to the point theP2.
- Standard_NODISCARD gp_Lin2d Translated(const gp_Pnt2d& theP1, const gp_Pnt2d& theP2) const
+ Standard_NODISCARD gp_Lin2d Translated(const gp_Pnt2d& theP1,
+ const gp_Pnt2d& theP2) const noexcept
{
gp_Lin2d aL = *this;
aL.pos.Translate(gp_Vec2d(theP1, theP2));
//=================================================================================================
-inline Standard_Real gp_Lin2d::Distance(const gp_Pnt2d& theP) const
+inline Standard_Real gp_Lin2d::Distance(const gp_Pnt2d& theP) const noexcept
{
gp_XY aCoord = theP.XY();
aCoord.Subtract((pos.Location()).XY());
//=================================================================================================
-inline Standard_Real gp_Lin2d::Distance(const gp_Lin2d& theOther) const
+inline Standard_Real gp_Lin2d::Distance(const gp_Lin2d& theOther) const noexcept
{
Standard_Real aD = 0.0;
if (pos.IsParallel(theOther.pos, gp::Resolution()))
//=================================================================================================
-inline Standard_Real gp_Lin2d::SquareDistance(const gp_Pnt2d& theP) const
+inline constexpr Standard_Real gp_Lin2d::SquareDistance(const gp_Pnt2d& theP) const noexcept
{
gp_XY aCoord = theP.XY();
aCoord.Subtract((pos.Location()).XY());
//=================================================================================================
-inline Standard_Real gp_Lin2d::SquareDistance(const gp_Lin2d& theOther) const
+inline Standard_Real gp_Lin2d::SquareDistance(const gp_Lin2d& theOther) const noexcept
{
Standard_Real aD = 0.0;
if (pos.IsParallel(theOther.pos, gp::Resolution()))
F = (T23 * T23) - (2.0 * P * T13);
}
-void gp_Parab2d::Mirror(const gp_Pnt2d& P)
+void gp_Parab2d::Mirror(const gp_Pnt2d& P) noexcept
{
pos.Mirror(P);
}
-gp_Parab2d gp_Parab2d::Mirrored(const gp_Pnt2d& P) const
+gp_Parab2d gp_Parab2d::Mirrored(const gp_Pnt2d& P) const noexcept
{
gp_Parab2d Prb = *this;
Prb.pos.Mirror(P);
return Prb;
}
-void gp_Parab2d::Mirror(const gp_Ax2d& A)
+void gp_Parab2d::Mirror(const gp_Ax2d& A) noexcept
{
pos.Mirror(A);
}
-gp_Parab2d gp_Parab2d::Mirrored(const gp_Ax2d& A) const
+gp_Parab2d gp_Parab2d::Mirrored(const gp_Ax2d& A) const noexcept
{
gp_Parab2d Prb = *this;
Prb.pos.Mirror(A);
DEFINE_STANDARD_ALLOC
//! Creates an indefinite parabola.
- gp_Parab2d()
+ gp_Parab2d() noexcept
: focalLength(RealLast())
{
}
//! Changes the "Location" point of the parabola. It is the
//! vertex of the parabola.
- void SetLocation(const gp_Pnt2d& theP) { pos.SetLocation(theP); }
+ constexpr void SetLocation(const gp_Pnt2d& theP) noexcept { pos.SetLocation(theP); }
//! Modifies this parabola, by redefining its local coordinate system so that
//! its origin and "X Direction" become those of the axis
//! Changes the local coordinate system of the parabola.
//! The "Location" point of A becomes the vertex of the parabola.
- void SetAxis(const gp_Ax22d& theA) { pos.SetAxis(theA); }
+ constexpr void SetAxis(const gp_Ax22d& theA) noexcept { pos.SetAxis(theA); }
//! Computes the coefficients of the implicit equation of the parabola
//! (in WCS - World Coordinate System).
//! at a distance from the apex which is equal to the focal length of this parabola.
//! The directrix is returned as an axis (a gp_Ax2d object),
//! the origin of which is situated on the "X Axis" of this parabola.
- gp_Ax2d Directrix() const;
+ gp_Ax2d Directrix() const noexcept;
//! Returns the distance between the vertex and the focus
//! of the parabola.
- Standard_Real Focal() const { return focalLength; }
+ constexpr Standard_Real Focal() const noexcept { return focalLength; }
//! Returns the focus of the parabola.
- gp_Pnt2d Focus() const
+ gp_Pnt2d Focus() const noexcept
{
return gp_Pnt2d(pos.Location().X() + focalLength * pos.XDirection().X(),
pos.Location().Y() + focalLength * pos.XDirection().Y());
}
//! Returns the vertex of the parabola.
- gp_Pnt2d Location() const { return pos.Location(); }
+ constexpr const gp_Pnt2d& Location() const noexcept { return pos.Location(); }
//! Returns the symmetry axis of the parabola.
//! The "Location" point of this axis is the vertex of the parabola.
- gp_Ax2d MirrorAxis() const { return pos.XAxis(); }
+ gp_Ax2d MirrorAxis() const noexcept { return pos.XAxis(); }
//! Returns the local coordinate system of the parabola.
//! The "Location" point of this axis is the vertex of the parabola.
- gp_Ax22d Axis() const { return pos; }
+ constexpr const gp_Ax22d& Axis() const noexcept { return pos; }
//! Returns the distance between the focus and the
//! directrix of the parabola.
- Standard_Real Parameter() const { return 2.0 * focalLength; }
+ constexpr Standard_Real Parameter() const noexcept { return 2.0 * focalLength; }
- void Reverse()
+ void Reverse() noexcept
{
gp_Dir2d aTemp = pos.YDirection();
aTemp.Reverse();
//! Note:
//! - Reverse assigns the result to this parabola, while
//! - Reversed creates a new one.
- Standard_NODISCARD gp_Parab2d Reversed() const;
+ Standard_NODISCARD gp_Parab2d Reversed() const noexcept;
//! Returns true if the local coordinate system is direct
//! and false in the other case.
- Standard_Boolean IsDirect() const { return (pos.XDirection().Crossed(pos.YDirection())) >= 0.0; }
+ constexpr Standard_Boolean IsDirect() const noexcept
+ {
+ return (pos.XDirection().Crossed(pos.YDirection())) >= 0.0;
+ }
- Standard_EXPORT void Mirror(const gp_Pnt2d& theP);
+ Standard_EXPORT void Mirror(const gp_Pnt2d& theP) noexcept;
//! Performs the symmetrical transformation of a parabola with respect
//! to the point theP which is the center of the symmetry
- Standard_NODISCARD Standard_EXPORT gp_Parab2d Mirrored(const gp_Pnt2d& theP) const;
+ Standard_NODISCARD Standard_EXPORT gp_Parab2d Mirrored(const gp_Pnt2d& theP) const noexcept;
- Standard_EXPORT void Mirror(const gp_Ax2d& theA);
+ Standard_EXPORT void Mirror(const gp_Ax2d& theA) noexcept;
//! Performs the symmetrical transformation of a parabola with respect
//! to an axis placement which is the axis of the symmetry.
- Standard_NODISCARD Standard_EXPORT gp_Parab2d Mirrored(const gp_Ax2d& theA) const;
+ Standard_NODISCARD Standard_EXPORT gp_Parab2d Mirrored(const gp_Ax2d& theA) const noexcept;
void Rotate(const gp_Pnt2d& theP, const Standard_Real theAng) { pos.Rotate(theP, theAng); }
//! Transforms an parabola with the transformation theT from class Trsf2d.
Standard_NODISCARD gp_Parab2d Transformed(const gp_Trsf2d& theT) const;
- void Translate(const gp_Vec2d& theV) { pos.Translate(theV); }
+ constexpr void Translate(const gp_Vec2d& theV) noexcept { pos.Translate(theV); }
//! Translates a parabola in the direction of the vectorthe theV.
//! The magnitude of the translation is the vector's magnitude.
- Standard_NODISCARD gp_Parab2d Translated(const gp_Vec2d& theV) const
+ Standard_NODISCARD gp_Parab2d Translated(const gp_Vec2d& theV) const noexcept
{
gp_Parab2d aPrb = *this;
aPrb.pos.Translate(theV);
return aPrb;
}
- void Translate(const gp_Pnt2d& theP1, const gp_Pnt2d& theP2) { pos.Translate(theP1, theP2); }
+ constexpr void Translate(const gp_Pnt2d& theP1, const gp_Pnt2d& theP2) noexcept
+ {
+ pos.Translate(theP1, theP2);
+ }
//! Translates a parabola from the point theP1 to the point theP2.
- Standard_NODISCARD gp_Parab2d Translated(const gp_Pnt2d& theP1, const gp_Pnt2d& theP2) const
+ Standard_NODISCARD gp_Parab2d Translated(const gp_Pnt2d& theP1,
+ const gp_Pnt2d& theP2) const noexcept
{
gp_Parab2d aPrb = *this;
aPrb.pos.Translate(theP1, theP2);
//=================================================================================================
-inline gp_Ax2d gp_Parab2d::Directrix() const
+inline gp_Ax2d gp_Parab2d::Directrix() const noexcept
{
gp_Pnt2d aP(pos.Location().X() - focalLength * pos.XDirection().X(),
pos.Location().Y() - focalLength * pos.XDirection().Y());
//=================================================================================================
-inline gp_Parab2d gp_Parab2d::Reversed() const
+inline gp_Parab2d gp_Parab2d::Reversed() const noexcept
{
gp_Parab2d aP = *this;
gp_Dir2d aTemp = pos.YDirection();
#include <Standard_Dump.hxx>
#include <Standard_OutOfRange.hxx>
-void gp_Pnt2d::Transform(const gp_Trsf2d& T)
+void gp_Pnt2d::Transform(const gp_Trsf2d& T) noexcept
{
if (T.Form() == gp_Identity)
{
}
}
-void gp_Pnt2d::Mirror(const gp_Pnt2d& P)
+void gp_Pnt2d::Mirror(const gp_Pnt2d& P) noexcept
{
coord.Reverse();
gp_XY XY = P.coord;
coord.Add(XY);
}
-gp_Pnt2d gp_Pnt2d::Mirrored(const gp_Pnt2d& P) const
+gp_Pnt2d gp_Pnt2d::Mirrored(const gp_Pnt2d& P) const noexcept
{
gp_Pnt2d Pres = *this;
Pres.Mirror(P);
return Pres;
}
-void gp_Pnt2d::Mirror(const gp_Ax2d& A)
+void gp_Pnt2d::Mirror(const gp_Ax2d& A) noexcept
{
gp_Trsf2d T;
T.SetMirror(A);
T.Transforms(coord);
}
-gp_Pnt2d gp_Pnt2d::Mirrored(const gp_Ax2d& A) const
+gp_Pnt2d gp_Pnt2d::Mirrored(const gp_Ax2d& A) const noexcept
{
gp_Pnt2d P = *this;
P.Mirror(A);
//! Performs the symmetrical transformation of a point
//! with respect to the point theP which is the center of
//! the symmetry.
- Standard_EXPORT void Mirror(const gp_Pnt2d& theP);
+ Standard_EXPORT void Mirror(const gp_Pnt2d& theP) noexcept;
//! Performs the symmetrical transformation of a point
//! with respect to an axis placement which is the axis
- Standard_NODISCARD Standard_EXPORT gp_Pnt2d Mirrored(const gp_Pnt2d& theP) const;
+ Standard_NODISCARD Standard_EXPORT gp_Pnt2d Mirrored(const gp_Pnt2d& theP) const noexcept;
- Standard_EXPORT void Mirror(const gp_Ax2d& theA);
+ Standard_EXPORT void Mirror(const gp_Ax2d& theA) noexcept;
- Standard_NODISCARD Standard_EXPORT gp_Pnt2d Mirrored(const gp_Ax2d& theA) const;
+ Standard_NODISCARD Standard_EXPORT gp_Pnt2d Mirrored(const gp_Ax2d& theA) const noexcept;
//! Rotates a point. theA1 is the axis of the rotation.
//! Ang is the angular value of the rotation in radians.
}
//! Transforms a point with the transformation theT.
- Standard_EXPORT void Transform(const gp_Trsf2d& theT);
+ Standard_EXPORT void Transform(const gp_Trsf2d& theT) noexcept;
Standard_NODISCARD gp_Pnt2d Transformed(const gp_Trsf2d& theT) const
{
#include <gp_XY.hxx>
#include <Standard_ConstructionError.hxx>
-void gp_Trsf2d::SetMirror(const gp_Ax2d& A)
+void gp_Trsf2d::SetMirror(const gp_Ax2d& A) noexcept
{
shape = gp_Ax1Mirror;
scale = -1.0;
//! Changes the transformation into a symmetrical transformation.
//! theP is the center of the symmetry.
- void SetMirror(const gp_Pnt2d& theP);
+ void SetMirror(const gp_Pnt2d& theP) noexcept;
//! Changes the transformation into a symmetrical transformation.
//! theA is the center of the axial symmetry.
- Standard_EXPORT void SetMirror(const gp_Ax2d& theA);
+ Standard_EXPORT void SetMirror(const gp_Ax2d& theA) noexcept;
//! Changes the transformation into a rotation.
//! theP is the rotation's center and theAng is the angular value of the
//=================================================================================================
-inline void gp_Trsf2d::SetMirror(const gp_Pnt2d& theP)
+inline void gp_Trsf2d::SetMirror(const gp_Pnt2d& theP) noexcept
{
shape = gp_PntMirror;
scale = -1.0;
return Vres;
}
-void gp_Vec2d::Transform(const gp_Trsf2d& theT)
+void gp_Vec2d::Transform(const gp_Trsf2d& theT) noexcept
{
switch (theT.Form())
{
return aV;
}
- Standard_EXPORT void Transform(const gp_Trsf2d& theT);
+ Standard_EXPORT void Transform(const gp_Trsf2d& theT) noexcept;
//! Transforms a vector with a Trsf from gp.
Standard_NODISCARD gp_Vec2d Transformed(const gp_Trsf2d& theT) const
Handle(GeomAdaptor_Surface) aGAHS;
Handle(Adaptor2d_Curve2d) anAHC2d;
Standard_Real tf, tl;
- gp_Lin2d aL;
// It is assumed that 2d curve is 2d line (rectangular surface domain)
if (theRL->IsArcOnS1())
{