Standard_Integer n1, n2, n3;
Standard_Integer nbNodes(0), nbTriangles(0);
Standard_Boolean hasUV(Standard_False);
- gp_Pnt p;
theSource >> nbNodes;
theSource >> nbTriangles;
Standard_Real X_p2 = Draw::Atof(argv[7]);
Standard_Real Y_p2 = Draw::Atof(argv[8]);
- gp_Trsf2d identityTransformation;
-
gp_Pnt2d mirrorFirstPoint(X_mirrorFirstPoint, Y_mirrorFirstPoint);
gp_Pnt2d mirrorSecondPoint(X_mirrorSecondPoint, Y_mirrorSecondPoint);
gp_Ax2d mirrorAxis(mirrorFirstPoint, gp_Vec2d(mirrorFirstPoint, mirrorSecondPoint));
gp_Ax2 Cone_Ax;
double R1 = 8, R2 = 16;
- gp_Pnt P0(0, 0, 0), P1(0, 0, 20), P2(0, 0, 45);
+ gp_Pnt P1(0, 0, 20), P2(0, 0, 45);
Handle(Geom_RectangularTrimmedSurface) S = GC_MakeTrimmedCone(P1, P2, R1, R2).Value();
TopoDS_Shape myshape = BRepBuilderAPI_MakeFace(S, Precision::Confusion()).Shape();
Handle(AIS_Shape) ais1 = new AIS_Shape(myshape);
{
gp_Ax2 Cone_Ax;
double R1 = 8, R2 = 16;
- gp_Pnt P0(0, 0, 0), P1(0, 0, 20), P2(0, 0, 45);
+ gp_Pnt P1(0, 0, 20), P2(0, 0, 45);
Handle(AIS_InteractiveContext) aContext = ViewerTest::GetAISContext();
if (aContext.IsNull())
//! example, to avoid division by zero in geometric
//! computations. In the documentation, tolerance criterion is
//! always referred to as gp::Resolution().
- static Standard_Real Resolution() { return RealSmall(); }
+ 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();
}
//! P is the location point and V is the direction of <me>.
- gp_Ax1(const gp_Pnt& theP, const gp_Dir& theV)
+ constexpr gp_Ax1(const gp_Pnt& theP, const gp_Dir& theV) noexcept
: loc(theP),
vdir(theV)
{
}
//! Assigns V as the "Direction" of this axis.
- void SetDirection(const gp_Dir& theV) { vdir = theV; }
+ constexpr void SetDirection(const gp_Dir& theV) noexcept { vdir = theV; }
//! Assigns P as the origin of this axis.
- void SetLocation(const gp_Pnt& theP) { loc = theP; }
+ constexpr void SetLocation(const gp_Pnt& theP) noexcept { loc = theP; }
//! Returns the direction of <me>.
- const gp_Dir& Direction() const { return vdir; }
+ constexpr const gp_Dir& Direction() const noexcept { return vdir; }
//! Returns the location point of <me>.
- const gp_Pnt& Location() const { return loc; }
+ constexpr const gp_Pnt& Location() const noexcept { return loc; }
//! Returns True if :
//! . the angle between <me> and <Other> is lower or equal
Standard_Real Angle(const gp_Ax1& theOther) const { return vdir.Angle(theOther.vdir); }
//! Reverses the unit vector of this axis and assigns the result to this axis.
- void Reverse() { vdir.Reverse(); }
+ constexpr void Reverse() noexcept { vdir.Reverse(); }
//! Reverses the unit vector of this axis and creates a new one.
Standard_NODISCARD gp_Ax1 Reversed() const
//! Applies a scaling transformation to this axis with:
//! - scale factor theS, and
//! - center theP and assigns the result to this axis.
- void Scale(const gp_Pnt& theP, const Standard_Real theS)
+ constexpr void Scale(const gp_Pnt& theP, const Standard_Real theS) noexcept
{
loc.Scale(theP, theS);
if (theS < 0.0)
}
//! Translates this axis by the vector theV, and assigns the result to this axis.
- void Translate(const gp_Vec& theV) { loc.Translate(theV); }
+ constexpr void Translate(const gp_Vec& theV) noexcept { loc.Translate(theV); }
//! Translates this axis by the vector theV,
//! and creates a new one.
//! Translates this axis by:
//! the vector (theP1, theP2) defined from point theP1 to point theP2.
//! and assigns the result to this axis.
- void Translate(const gp_Pnt& theP1, const gp_Pnt& theP2) { loc.Translate(theP1, theP2); }
+ constexpr void Translate(const gp_Pnt& theP1, const gp_Pnt& theP2) noexcept
+ {
+ loc.Translate(theP1, theP2);
+ }
//! Translates this axis by:
//! the vector (theP1, theP2) defined from point theP1 to point theP2.
void SetDirection(const gp_Dir& V);
//! Changes the "Location" point (origin) of <me>.
- void SetLocation(const gp_Pnt& theP) { axis.SetLocation(theP); }
+ constexpr void SetLocation(const gp_Pnt& theP) noexcept { axis.SetLocation(theP); }
//! Changes the "Xdirection" of <me>. The main direction
//! "Direction" is not modified, the "Ydirection" is modified.
//! Returns the main axis of <me>. It is the "Location" point
//! and the main "Direction".
- const gp_Ax1& Axis() const { return axis; }
+ constexpr const gp_Ax1& Axis() const noexcept { return axis; }
//! Returns the main direction of <me>.
- const gp_Dir& Direction() const { return axis.Direction(); }
+ constexpr const gp_Dir& Direction() const noexcept { return axis.Direction(); }
//! Returns the "Location" point (origin) of <me>.
- const gp_Pnt& Location() const { return axis.Location(); }
+ constexpr const gp_Pnt& Location() const noexcept { return axis.Location(); }
//! Returns the "XDirection" of <me>.
- const gp_Dir& XDirection() const { return vxdir; }
+ constexpr const gp_Dir& XDirection() const noexcept { return vxdir; }
//! Returns the "YDirection" of <me>.
- const gp_Dir& YDirection() const { return vydir; }
+ constexpr const gp_Dir& YDirection() const noexcept { return vydir; }
Standard_Boolean IsCoplanar(const gp_Ax2& Other,
const Standard_Real LinearTolerance,
return aTemp;
}
- void Translate(const gp_Vec& theV) { axis.Translate(theV); }
+ constexpr void Translate(const gp_Vec& theV) noexcept { axis.Translate(theV); }
//! Translates an axis plaxement in the direction of the vector <theV>.
//! The magnitude of the translation is the vector's magnitude.
return aTemp;
}
- void Translate(const gp_Pnt& theP1, const gp_Pnt& theP2) { axis.Translate(theP1, theP2); }
+ constexpr void Translate(const gp_Pnt& theP1, const gp_Pnt& theP2) noexcept
+ {
+ axis.Translate(theP1, theP2);
+ }
//! Translates an axis placement from the point <theP1> to the point <theP2>.
Standard_NODISCARD gp_Ax2 Translated(const gp_Pnt& theP1, const gp_Pnt& theP2) const
//! Assigns the origin and the two unit vectors of the
//! coordinate system theA1 to this coordinate system.
- void SetAxis(const gp_Ax22d& theA1)
+ constexpr void SetAxis(const gp_Ax22d& theA1) noexcept
{
point = theA1.Location();
vxdir = theA1.XDirection();
void SetYAxis(const gp_Ax2d& theA1);
//! Changes the "Location" point (origin) of <me>.
- void SetLocation(const gp_Pnt2d& theP) { point = theP; }
+ constexpr void SetLocation(const gp_Pnt2d& theP) noexcept { point = theP; }
//! Assigns theVx to the "X Direction" of
//! this coordinate system. The other unit vector of this
gp_Ax2d YAxis() const { return gp_Ax2d(point, vydir); }
//! Returns the "Location" point (origin) of <me>.
- const gp_Pnt2d& Location() const { return point; }
+ constexpr const gp_Pnt2d& Location() const noexcept { return point; }
//! Returns the "XDirection" of <me>.
- const gp_Dir2d& XDirection() const { return vxdir; }
+ constexpr const gp_Dir2d& XDirection() const noexcept { return vxdir; }
//! Returns the "YDirection" of <me>.
- const gp_Dir2d& YDirection() const { return vydir; }
+ constexpr const gp_Dir2d& YDirection() const noexcept { return vydir; }
Standard_EXPORT void Mirror(const gp_Pnt2d& theP);
return aTemp;
}
- void Translate(const gp_Vec2d& theV) { point.Translate(theV); }
+ constexpr void Translate(const gp_Vec2d& theV) noexcept { point.Translate(theV); }
//! Translates an axis plaxement in the direction of the vector
//! <theV>. The magnitude of the translation is the vector's magnitude.
return aTemp;
}
- void Translate(const gp_Pnt2d& theP1, const gp_Pnt2d& theP2) { point.Translate(theP1, theP2); }
+ constexpr void Translate(const gp_Pnt2d& theP1, const gp_Pnt2d& theP2) noexcept
+ {
+ point.Translate(theP1, theP2);
+ }
//! Translates an axis placement from the point <theP1> to the
//! point <theP2>.
DEFINE_STANDARD_ALLOC
//! Creates an axis object representing X axis of the reference co-ordinate system.
- gp_Ax2d()
+ constexpr gp_Ax2d() noexcept
: loc(0., 0.)
// vdir(1.,0.) use default ctor of gp_Dir2d, as it creates the same dir (1,0)
{
//! Creates an Ax2d.
//! <theP> is the "Location" point of the axis placement
//! and theV is the "Direction" of the axis placement.
- gp_Ax2d(const gp_Pnt2d& theP, const gp_Dir2d& theV)
+ constexpr gp_Ax2d(const gp_Pnt2d& theP, const gp_Dir2d& theV) noexcept
: loc(theP),
vdir(theV)
{
}
//! Changes the "Location" point (origin) of <me>.
- void SetLocation(const gp_Pnt2d& theP) { loc = theP; }
+ constexpr void SetLocation(const gp_Pnt2d& theP) noexcept { loc = theP; }
//! Changes the direction of <me>.
- void SetDirection(const gp_Dir2d& theV) { vdir = theV; }
+ constexpr void SetDirection(const gp_Dir2d& theV) noexcept { vdir = theV; }
//! Returns the origin of <me>.
- const gp_Pnt2d& Location() const { return loc; }
+ constexpr const gp_Pnt2d& Location() const noexcept { return loc; }
//! Returns the direction of <me>.
- const gp_Dir2d& Direction() const { return vdir; }
+ constexpr const gp_Dir2d& Direction() const noexcept { return vdir; }
//! Returns True if :
//! . the angle between <me> and <Other> is lower or equal
Standard_Real Angle(const gp_Ax2d& theOther) const { return vdir.Angle(theOther.vdir); }
//! Reverses the direction of <me> and assigns the result to this axis.
- void Reverse() { vdir.Reverse(); }
+ constexpr void Reverse() noexcept { vdir.Reverse(); }
//! Computes a new axis placement with a direction opposite to the direction of <me>.
- Standard_NODISCARD gp_Ax2d Reversed() const
+ Standard_NODISCARD constexpr gp_Ax2d Reversed() const noexcept
{
gp_Ax2d aTemp = *this;
aTemp.Reverse();
return anA;
}
- void Translate(const gp_Vec2d& theV) { loc.Translate(theV); }
+ constexpr void Translate(const gp_Vec2d& theV) noexcept { loc.Translate(theV); }
//! Translates an axis placement in the direction of the vector theV.
//! The magnitude of the translation is the vector's magnitude.
- Standard_NODISCARD gp_Ax2d Translated(const gp_Vec2d& theV) const
+ Standard_NODISCARD constexpr gp_Ax2d Translated(const gp_Vec2d& theV) const noexcept
{
gp_Ax2d anA = *this;
(anA.loc).Translate(theV);
return anA;
}
- void Translate(const gp_Pnt2d& theP1, const gp_Pnt2d& theP2) { loc.Translate(theP1, theP2); }
+ constexpr void Translate(const gp_Pnt2d& theP1, const gp_Pnt2d& theP2) noexcept
+ {
+ loc.Translate(theP1, theP2);
+ }
//! Translates an axis placement from the point theP1 to the point theP2.
Standard_NODISCARD gp_Ax2d Translated(const gp_Pnt2d& theP1, const gp_Pnt2d& theP2) const
Standard_EXPORT gp_Ax3(const gp_Pnt& theP, const gp_Dir& theV);
//! Reverses the X direction of <me>.
- void XReverse() { vxdir.Reverse(); }
+ constexpr void XReverse() noexcept { vxdir.Reverse(); }
//! Reverses the Y direction of <me>.
- void YReverse() { vydir.Reverse(); }
+ constexpr void YReverse() noexcept { vydir.Reverse(); }
//! Reverses the Z direction of <me>.
- void ZReverse() { axis.Reverse(); }
+ constexpr void ZReverse() noexcept { axis.Reverse(); }
//! Assigns the origin and "main Direction" of the axis theA1 to
//! this coordinate system, then recomputes its "X Direction" and "Y Direction".
void SetDirection(const gp_Dir& theV);
//! Changes the "Location" point (origin) of <me>.
- void SetLocation(const gp_Pnt& theP) { axis.SetLocation(theP); }
+ constexpr void SetLocation(const gp_Pnt& theP) noexcept { axis.SetLocation(theP); }
//! Changes the "Xdirection" of <me>. The main direction
//! "Direction" is not modified, the "Ydirection" is modified.
//! Returns the main axis of <me>. It is the "Location" point
//! and the main "Direction".
- const gp_Ax1& Axis() const { return axis; }
+ constexpr const gp_Ax1& Axis() const noexcept { return axis; }
//! Computes a right-handed coordinate system with the
//! same "X Direction" and "Y Direction" as those of this
gp_Ax2 Ax2() const;
//! Returns the main direction of <me>.
- const gp_Dir& Direction() const { return axis.Direction(); }
+ constexpr const gp_Dir& Direction() const noexcept { return axis.Direction(); }
//! Returns the "Location" point (origin) of <me>.
- const gp_Pnt& Location() const { return axis.Location(); }
+ constexpr const gp_Pnt& Location() const noexcept { return axis.Location(); }
//! Returns the "XDirection" of <me>.
- const gp_Dir& XDirection() const { return vxdir; }
+ constexpr const gp_Dir& XDirection() const noexcept { return vxdir; }
//! Returns the "YDirection" of <me>.
- const gp_Dir& YDirection() const { return vydir; }
+ constexpr const gp_Dir& YDirection() const noexcept { return vydir; }
//! Returns True if the coordinate system is right-handed. i.e.
//! XDirection().Crossed(YDirection()).Dot(Direction()) > 0
return aTemp;
}
- void Translate(const gp_Vec& theV) { axis.Translate(theV); }
+ constexpr void Translate(const gp_Vec& theV) noexcept { axis.Translate(theV); }
//! Translates an axis plaxement in the direction of the vector
//! <theV>. The magnitude of the translation is the vector's magnitude.
DEFINE_STANDARD_ALLOC
//! Creates a direction corresponding to X axis.
- gp_Dir()
+ constexpr gp_Dir() noexcept
: coord(1., 0., 0.)
{
}
Standard_Real Coord(const Standard_Integer theIndex) const { return coord.Coord(theIndex); }
//! Returns for the unit vector its three coordinates theXv, theYv, and theZv.
- void Coord(Standard_Real& theXv, Standard_Real& theYv, Standard_Real& theZv) const
+ constexpr void Coord(Standard_Real& theXv,
+ Standard_Real& theYv,
+ Standard_Real& theZv) const noexcept
{
coord.Coord(theXv, theYv, theZv);
}
//! Returns the X coordinate for a unit vector.
- Standard_Real X() const { return coord.X(); }
+ constexpr Standard_Real X() const noexcept { return coord.X(); }
//! Returns the Y coordinate for a unit vector.
- Standard_Real Y() const { return coord.Y(); }
+ constexpr Standard_Real Y() const noexcept { return coord.Y(); }
//! Returns the Z coordinate for a unit vector.
- Standard_Real Z() const { return coord.Z(); }
+ constexpr Standard_Real Z() const noexcept { return coord.Z(); }
//! for this unit vector, returns its three coordinates as a number triplea.
- const gp_XYZ& XYZ() const { return coord; }
+ constexpr const gp_XYZ& XYZ() const noexcept { return coord; }
//! Returns True if the angle between the two directions is
//! lower or equal to theAngularTolerance.
Standard_NODISCARD gp_Dir CrossCrossed(const gp_Dir& theV1, const gp_Dir& theV2) const;
//! Computes the scalar product
- Standard_Real Dot(const gp_Dir& theOther) const { return coord.Dot(theOther.coord); }
+ constexpr Standard_Real Dot(const gp_Dir& theOther) const noexcept
+ {
+ return coord.Dot(theOther.coord);
+ }
- Standard_Real operator*(const gp_Dir& theOther) const { return Dot(theOther); }
+ constexpr Standard_Real operator*(const gp_Dir& theOther) const noexcept { return Dot(theOther); }
//! Computes the triple scalar product <me> * (theV1 ^ theV2).
//! Warnings :
//! The computed vector theV1' = theV1 ^ theV2 is not normalized
//! to create a unitary vector. So this method never
//! raises an exception even if theV1 and theV2 are parallel.
- Standard_Real DotCross(const gp_Dir& theV1, const gp_Dir& theV2) const
+ constexpr Standard_Real DotCross(const gp_Dir& theV1, const gp_Dir& theV2) const noexcept
{
return coord.Dot(theV1.coord.Crossed(theV2.coord));
}
- void Reverse() { coord.Reverse(); }
+ constexpr void Reverse() noexcept { coord.Reverse(); }
//! Reverses the orientation of a direction
//! geometric transformations
//! Performs the symmetrical transformation of a direction
//! with respect to the direction V which is the center of
//! the symmetry.]
- Standard_NODISCARD gp_Dir Reversed() const
+ Standard_NODISCARD constexpr gp_Dir Reversed() const noexcept
{
gp_Dir aV = *this;
aV.coord.Reverse();
return aV;
}
- Standard_NODISCARD gp_Dir operator-() const { return Reversed(); }
+ Standard_NODISCARD constexpr gp_Dir operator-() const noexcept { return Reversed(); }
Standard_EXPORT void Mirror(const gp_Dir& theV);
DEFINE_STANDARD_ALLOC
//! Creates a direction corresponding to X axis.
- gp_Dir2d()
+ constexpr gp_Dir2d() noexcept
: coord(1., 0.)
{
}
//! For this unit vector returns its two coordinates theXv and theYv.
//! Raises OutOfRange if theIndex != {1, 2}.
- void Coord(Standard_Real& theXv, Standard_Real& theYv) const { coord.Coord(theXv, theYv); }
+ constexpr void Coord(Standard_Real& theXv, Standard_Real& theYv) const noexcept
+ {
+ coord.Coord(theXv, theYv);
+ }
//! For this unit vector, returns its X coordinate.
- Standard_Real X() const { return coord.X(); }
+ constexpr Standard_Real X() const noexcept { return coord.X(); }
//! For this unit vector, returns its Y coordinate.
- Standard_Real Y() const { return coord.Y(); }
+ constexpr Standard_Real Y() const noexcept { return coord.Y(); }
//! For this unit vector, returns its two coordinates as a number pair.
//! Comparison between Directions
//! The precision value is an input data.
- const gp_XY& XY() const { return coord; }
+ constexpr const gp_XY& XY() const noexcept { return coord; }
//! Returns True if the two vectors have the same direction
//! i.e. the angle between this unit vector and the
Standard_EXPORT Standard_Real Angle(const gp_Dir2d& theOther) const;
//! Computes the cross product between two directions.
- Standard_NODISCARD Standard_Real Crossed(const gp_Dir2d& theRight) const
+ Standard_NODISCARD constexpr Standard_Real Crossed(const gp_Dir2d& theRight) const noexcept
{
return coord.Crossed(theRight.coord);
}
- Standard_NODISCARD Standard_Real operator^(const gp_Dir2d& theRight) const
+ Standard_NODISCARD constexpr Standard_Real operator^(const gp_Dir2d& theRight) const noexcept
{
return Crossed(theRight);
}
//! Computes the scalar product
- Standard_Real Dot(const gp_Dir2d& theOther) const { return coord.Dot(theOther.coord); }
+ constexpr Standard_Real Dot(const gp_Dir2d& theOther) const noexcept
+ {
+ return coord.Dot(theOther.coord);
+ }
- Standard_Real operator*(const gp_Dir2d& theOther) const { return Dot(theOther); }
+ constexpr Standard_Real operator*(const gp_Dir2d& theOther) const noexcept
+ {
+ return Dot(theOther);
+ }
- void Reverse() { coord.Reverse(); }
+ constexpr void Reverse() noexcept { coord.Reverse(); }
//! Reverses the orientation of a direction
- Standard_NODISCARD gp_Dir2d Reversed() const
+ Standard_NODISCARD constexpr gp_Dir2d Reversed() const noexcept
{
gp_Dir2d aV = *this;
aV.coord.Reverse();
return aV;
}
- Standard_NODISCARD gp_Dir2d operator-() const { return Reversed(); }
+ Standard_NODISCARD constexpr gp_Dir2d operator-() const noexcept { return Reversed(); }
Standard_EXPORT void Mirror(const gp_Dir2d& theV);
DEFINE_STANDARD_ALLOC
//! Returns the Identity transformation.
- gp_GTrsf()
+ constexpr gp_GTrsf() noexcept
+ : matrix(),
+ loc(0.0, 0.0, 0.0),
+ shape(gp_Identity),
+ scale(1.0)
{
- shape = gp_Identity;
matrix.SetScale(1.0);
- loc.SetCoord(0.0, 0.0, 0.0);
- scale = 1.0;
}
//! Converts the gp_Trsf transformation theT into a
//! Creates a transformation based on the matrix theM and the
//! vector theV where theM defines the vectorial part of
//! the transformation, and V the translation part, or
- gp_GTrsf(const gp_Mat& theM, const gp_XYZ& theV)
+ constexpr gp_GTrsf(const gp_Mat& theM, const gp_XYZ& theV) noexcept
: matrix(theM),
- loc(theV)
+ loc(theV),
+ shape(gp_Other),
+ scale(0.0)
{
- shape = gp_Other;
- scale = 0.0;
}
//! Changes this transformation into an affinity of ratio theRatio
const Standard_Real theValue);
//! Replaces the vectorial part of this transformation by theMatrix.
- void SetVectorialPart(const gp_Mat& theMatrix)
+ constexpr void SetVectorialPart(const gp_Mat& theMatrix) noexcept
{
matrix = theMatrix;
shape = gp_Other;
//! transformation (relative to a point, an axis or a plane), a
//! scaling transformation, a compound transformation or
//! some other type of transformation.
- gp_TrsfForm Form() const { return shape; }
+ constexpr gp_TrsfForm Form() const noexcept { return shape; }
//! verify and set the shape of the GTrsf Other or CompoundTrsf
//! Ex :
Standard_EXPORT void SetForm();
//! Returns the translation part of the GTrsf.
- const gp_XYZ& TranslationPart() const { return loc; }
+ constexpr const gp_XYZ& TranslationPart() const noexcept { return loc; }
//! Computes the vectorial part of the GTrsf. The returned Matrix
//! is a 3*3 matrix.
- const gp_Mat& VectorialPart() const { return matrix; }
+ constexpr const gp_Mat& VectorialPart() const noexcept { return matrix; }
//! Returns the coefficients of the global matrix of transformation.
//! Raises OutOfRange if theRow < 1 or theRow > 3 or theCol < 1 or theCol > 4
DEFINE_STANDARD_ALLOC
//! returns identity transformation.
- gp_GTrsf2d()
+ constexpr gp_GTrsf2d() noexcept
+ : matrix(),
+ loc(0.0, 0.0),
+ shape(gp_Identity),
+ scale(1.0)
{
- shape = gp_Identity;
matrix.SetScale(1.0);
- loc.SetCoord(0.0, 0.0);
- scale = 1.0;
}
//! Converts the gp_Trsf2d transformation theT into a
//! Creates a transformation based on the matrix theM and the
//! vector theV where theM defines the vectorial part of the
//! transformation, and theV the translation part.
- gp_GTrsf2d(const gp_Mat2d& theM, const gp_XY& theV)
+ constexpr gp_GTrsf2d(const gp_Mat2d& theM, const gp_XY& theV) noexcept
: matrix(theM),
- loc(theV)
+ loc(theV),
+ shape(gp_Other),
+ scale(0.0)
{
- shape = gp_Other;
- scale = 0.0;
}
//! Changes this transformation into an affinity of ratio theRatio
void SetTrsf2d(const gp_Trsf2d& theT);
//! Replaces the vectorial part of this transformation by theMatrix.
- void SetVectorialPart(const gp_Mat2d& theMatrix)
+ constexpr void SetVectorialPart(const gp_Mat2d& theMatrix) noexcept
{
matrix = theMatrix;
shape = gp_Other;
//! transformation (relative to a point or axis), a scaling
//! transformation, a compound transformation or some
//! other type of transformation.
- gp_TrsfForm Form() const { return shape; }
+ constexpr gp_TrsfForm Form() const noexcept { return shape; }
//! Returns the translation part of the GTrsf2d.
- const gp_XY& TranslationPart() const { return loc; }
+ constexpr const gp_XY& TranslationPart() const noexcept { return loc; }
//! Computes the vectorial part of the GTrsf2d. The returned
//! Matrix is a 2*2 matrix.
- const gp_Mat2d& VectorialPart() const { return matrix; }
+ constexpr const gp_Mat2d& VectorialPart() const noexcept { return matrix; }
//! Returns the coefficients of the global matrix of transformation.
//! Raised OutOfRange if theRow < 1 or theRow > 2 or theCol < 1 or theCol > 3
DEFINE_STANDARD_ALLOC
//! creates a matrix with null coefficients.
- gp_Mat()
+ constexpr gp_Mat() noexcept
+ : myMat{{0.0, 0.0, 0.0}, {0.0, 0.0, 0.0}, {0.0, 0.0, 0.0}}
{
- myMat[0][0] = myMat[0][1] = myMat[0][2] = myMat[1][0] = myMat[1][1] = myMat[1][2] =
- myMat[2][0] = myMat[2][1] = myMat[2][2] = 0.0;
}
- gp_Mat(const Standard_Real theA11,
- const Standard_Real theA12,
- const Standard_Real theA13,
- const Standard_Real theA21,
- const Standard_Real theA22,
- const Standard_Real theA23,
- const Standard_Real theA31,
- const Standard_Real theA32,
- const Standard_Real theA33);
+ constexpr gp_Mat(const Standard_Real theA11,
+ const Standard_Real theA12,
+ const Standard_Real theA13,
+ const Standard_Real theA21,
+ const Standard_Real theA22,
+ const Standard_Real theA23,
+ const Standard_Real theA31,
+ const Standard_Real theA32,
+ const Standard_Real theA33) noexcept;
//! Creates a matrix.
//! theCol1, theCol2, theCol3 are the 3 columns of the matrix.
//! <me>.Value (3, 3) = theX3
//! @endcode
//! The other coefficients of the matrix are not modified.
- void SetDiagonal(const Standard_Real theX1, const Standard_Real theX2, const Standard_Real theX3)
+ constexpr void SetDiagonal(const Standard_Real theX1,
+ const Standard_Real theX2,
+ const Standard_Real theX3) noexcept
{
myMat[0][0] = theX1;
myMat[1][1] = theX2;
Standard_EXPORT void SetDot(const gp_XYZ& theRef);
//! Modifies this matrix so that it represents the Identity matrix.
- void SetIdentity()
+ constexpr void SetIdentity() noexcept
{
myMat[0][0] = myMat[1][1] = myMat[2][2] = 1.0;
myMat[0][1] = myMat[0][2] = myMat[1][0] = myMat[1][2] = myMat[2][0] = myMat[2][1] = 0.0;
//! <me> = | 0.0 theS 0.0 |
//! | 0.0 0.0 theS |
//! @endcode
- void SetScale(const Standard_Real theS)
+ constexpr void SetScale(const Standard_Real theS) noexcept
{
myMat[0][0] = myMat[1][1] = myMat[2][2] = theS;
myMat[0][1] = myMat[0][2] = myMat[1][0] = myMat[1][2] = myMat[2][0] = myMat[2][1] = 0.0;
Standard_EXPORT gp_XYZ Column(const Standard_Integer theCol) const;
//! Computes the determinant of the matrix.
- Standard_Real Determinant() const
+ constexpr Standard_Real Determinant() const noexcept
{
const Standard_Real a00 = myMat[0][0], a01 = myMat[0][1], a02 = myMat[0][2];
const Standard_Real a10 = myMat[1][0], a11 = myMat[1][1], a12 = myMat[1][2];
//! The Gauss LU decomposition is used to invert the matrix
//! (see Math package) so the matrix is considered as singular if
//! the largest pivot found is lower or equal to Resolution from gp.
- Standard_Boolean IsSingular() const
+ constexpr Standard_Boolean IsSingular() const noexcept
{
// Pour etre sur que Gauss va fonctionner, il faut faire Gauss ...
Standard_Real aVal = Determinant();
return aVal <= gp::Resolution();
}
- void Add(const gp_Mat& theOther);
+ constexpr void Add(const gp_Mat& theOther) noexcept;
- void operator+=(const gp_Mat& theOther) { Add(theOther); }
+ constexpr void operator+=(const gp_Mat& theOther) noexcept { Add(theOther); }
//! Computes the sum of this matrix and
//! the matrix theOther for each coefficient of the matrix :
//! <me>.Coef(i,j) + <theOther>.Coef(i,j)
- Standard_NODISCARD gp_Mat Added(const gp_Mat& theOther) const;
+ Standard_NODISCARD constexpr gp_Mat Added(const gp_Mat& theOther) const noexcept;
- Standard_NODISCARD gp_Mat operator+(const gp_Mat& theOther) const { return Added(theOther); }
+ Standard_NODISCARD constexpr gp_Mat operator+(const gp_Mat& theOther) const noexcept
+ {
+ return Added(theOther);
+ }
- void Divide(const Standard_Real theScalar);
+ constexpr void Divide(const Standard_Real theScalar);
- void operator/=(const Standard_Real theScalar) { Divide(theScalar); }
+ constexpr void operator/=(const Standard_Real theScalar) { Divide(theScalar); }
//! Divides all the coefficients of the matrix by Scalar
- Standard_NODISCARD gp_Mat Divided(const Standard_Real theScalar) const;
+ Standard_NODISCARD constexpr gp_Mat Divided(const Standard_Real theScalar) const;
- Standard_NODISCARD gp_Mat operator/(const Standard_Real theScalar) const
+ Standard_NODISCARD constexpr gp_Mat operator/(const Standard_Real theScalar) const
{
return Divided(theScalar);
}
Standard_NODISCARD Standard_EXPORT gp_Mat Inverted() const;
//! Computes the product of two matrices <me> * <Other>
- Standard_NODISCARD gp_Mat Multiplied(const gp_Mat& theOther) const
+ Standard_NODISCARD constexpr gp_Mat Multiplied(const gp_Mat& theOther) const noexcept
{
gp_Mat aNewMat = *this;
aNewMat.Multiply(theOther);
return aNewMat;
}
- Standard_NODISCARD gp_Mat operator*(const gp_Mat& theOther) const { return Multiplied(theOther); }
+ Standard_NODISCARD constexpr gp_Mat operator*(const gp_Mat& theOther) const noexcept
+ {
+ return Multiplied(theOther);
+ }
//! Computes the product of two matrices <me> = <Other> * <me>.
- void Multiply(const gp_Mat& theOther);
+ constexpr void Multiply(const gp_Mat& theOther) noexcept;
- void operator*=(const gp_Mat& theOther) { Multiply(theOther); }
+ constexpr void operator*=(const gp_Mat& theOther) noexcept { Multiply(theOther); }
- void PreMultiply(const gp_Mat& theOther);
+ constexpr void PreMultiply(const gp_Mat& theOther) noexcept;
- Standard_NODISCARD gp_Mat Multiplied(const Standard_Real theScalar) const;
+ Standard_NODISCARD constexpr gp_Mat Multiplied(const Standard_Real theScalar) const noexcept;
- Standard_NODISCARD gp_Mat operator*(const Standard_Real theScalar) const
+ Standard_NODISCARD constexpr gp_Mat operator*(const Standard_Real theScalar) const noexcept
{
return Multiplied(theScalar);
}
//! Multiplies all the coefficients of the matrix by Scalar
- void Multiply(const Standard_Real theScalar);
+ constexpr void Multiply(const Standard_Real theScalar) noexcept;
- void operator*=(const Standard_Real theScalar) { Multiply(theScalar); }
+ constexpr void operator*=(const Standard_Real theScalar) noexcept { Multiply(theScalar); }
Standard_EXPORT void Power(const Standard_Integer N);
return aMatN;
}
- void Subtract(const gp_Mat& theOther);
+ constexpr void Subtract(const gp_Mat& theOther) noexcept;
- void operator-=(const gp_Mat& theOther) { Subtract(theOther); }
+ constexpr void operator-=(const gp_Mat& theOther) noexcept { Subtract(theOther); }
//! cOmputes for each coefficient of the matrix :
//! <me>.Coef(i,j) - <theOther>.Coef(i,j)
- Standard_NODISCARD gp_Mat Subtracted(const gp_Mat& theOther) const;
+ Standard_NODISCARD constexpr gp_Mat Subtracted(const gp_Mat& theOther) const noexcept;
- Standard_NODISCARD gp_Mat operator-(const gp_Mat& theOther) const { return Subtracted(theOther); }
+ Standard_NODISCARD constexpr gp_Mat operator-(const gp_Mat& theOther) const noexcept
+ {
+ return Subtracted(theOther);
+ }
void Transpose();
//=================================================================================================
-inline gp_Mat::gp_Mat(const Standard_Real theA11,
- const Standard_Real theA12,
- const Standard_Real theA13,
- const Standard_Real theA21,
- const Standard_Real theA22,
- const Standard_Real theA23,
- const Standard_Real theA31,
- const Standard_Real theA32,
- const Standard_Real theA33)
+inline constexpr gp_Mat::gp_Mat(const Standard_Real theA11,
+ const Standard_Real theA12,
+ const Standard_Real theA13,
+ const Standard_Real theA21,
+ const Standard_Real theA22,
+ const Standard_Real theA23,
+ const Standard_Real theA31,
+ const Standard_Real theA32,
+ const Standard_Real theA33) noexcept
+ : myMat{{theA11, theA12, theA13}, {theA21, theA22, theA23}, {theA31, theA32, theA33}}
{
- myMat[0][0] = theA11;
- myMat[0][1] = theA12;
- myMat[0][2] = theA13;
- myMat[1][0] = theA21;
- myMat[1][1] = theA22;
- myMat[1][2] = theA23;
- myMat[2][0] = theA31;
- myMat[2][1] = theA32;
- myMat[2][2] = theA33;
}
//=================================================================================================
-inline void gp_Mat::Add(const gp_Mat& theOther)
+inline constexpr void gp_Mat::Add(const gp_Mat& theOther) noexcept
{
myMat[0][0] += theOther.myMat[0][0];
myMat[0][1] += theOther.myMat[0][1];
//=================================================================================================
-inline gp_Mat gp_Mat::Added(const gp_Mat& theOther) const
+inline constexpr gp_Mat gp_Mat::Added(const gp_Mat& theOther) const noexcept
{
gp_Mat aNewMat(*this);
aNewMat.Add(theOther);
//=================================================================================================
-inline void gp_Mat::Divide(const Standard_Real theScalar)
+inline constexpr void gp_Mat::Divide(const Standard_Real theScalar)
{
Standard_Real aVal = theScalar;
if (aVal < 0)
//=================================================================================================
-inline gp_Mat gp_Mat::Divided(const Standard_Real theScalar) const
+inline constexpr gp_Mat gp_Mat::Divided(const Standard_Real theScalar) const
{
gp_Mat aNewMat(*this);
aNewMat.Divide(theScalar);
//=================================================================================================
-inline void gp_Mat::Multiply(const gp_Mat& theOther)
+inline constexpr void gp_Mat::Multiply(const gp_Mat& theOther) noexcept
{
const Standard_Real aT00 = myMat[0][0] * theOther.myMat[0][0] + myMat[0][1] * theOther.myMat[1][0]
+ myMat[0][2] * theOther.myMat[2][0];
//=================================================================================================
-inline void gp_Mat::PreMultiply(const gp_Mat& theOther)
+inline constexpr void gp_Mat::PreMultiply(const gp_Mat& theOther) noexcept
{
const Standard_Real aT00 = theOther.myMat[0][0] * myMat[0][0] + theOther.myMat[0][1] * myMat[1][0]
+ theOther.myMat[0][2] * myMat[2][0];
//=================================================================================================
-inline gp_Mat gp_Mat::Multiplied(const Standard_Real theScalar) const
+inline constexpr gp_Mat gp_Mat::Multiplied(const Standard_Real theScalar) const noexcept
{
gp_Mat aNewMat(*this);
aNewMat.Multiply(theScalar);
//=================================================================================================
-inline void gp_Mat::Multiply(const Standard_Real theScalar)
+inline constexpr void gp_Mat::Multiply(const Standard_Real theScalar) noexcept
{
myMat[0][0] *= theScalar;
myMat[0][1] *= theScalar;
//=================================================================================================
-inline void gp_Mat::Subtract(const gp_Mat& theOther)
+inline constexpr void gp_Mat::Subtract(const gp_Mat& theOther) noexcept
{
myMat[0][0] -= theOther.myMat[0][0];
myMat[0][1] -= theOther.myMat[0][1];
//=================================================================================================
-inline gp_Mat gp_Mat::Subtracted(const gp_Mat& theOther) const
+inline constexpr gp_Mat gp_Mat::Subtracted(const gp_Mat& theOther) const noexcept
{
gp_Mat aNewMat(*this);
aNewMat.Subtract(theOther);
// function : operator*
// purpose :
//=======================================================================
-inline gp_Mat operator*(const Standard_Real theScalar, const gp_Mat& theMat3D)
+inline constexpr gp_Mat operator*(const Standard_Real theScalar, const gp_Mat& theMat3D) noexcept
{
return theMat3D.Multiplied(theScalar);
}
DEFINE_STANDARD_ALLOC
//! Creates a matrix with null coefficients.
- gp_Mat2d() { myMat[0][0] = myMat[0][1] = myMat[1][0] = myMat[1][1] = 0.0; }
+ constexpr gp_Mat2d() noexcept
+ : myMat{{0.0, 0.0}, {0.0, 0.0}}
+ {
+ }
//! theCol1, theCol2 are the 2 columns of the matrix.
Standard_EXPORT gp_Mat2d(const gp_XY& theCol1, const gp_XY& theCol2);
//! <me>.Value (2, 2) = theX2
//! @endcode
//! The other coefficients of the matrix are not modified.
- void SetDiagonal(const Standard_Real theX1, const Standard_Real theX2)
+ constexpr void SetDiagonal(const Standard_Real theX1, const Standard_Real theX2) noexcept
{
myMat[0][0] = theX1;
myMat[1][1] = theX2;
}
//! Modifies this matrix, so that it represents the Identity matrix.
- void SetIdentity()
+ constexpr void SetIdentity() noexcept
{
myMat[0][0] = myMat[1][1] = 1.0;
myMat[0][1] = myMat[1][0] = 0.0;
//! | theS 0.0 |
//! <me> = | 0.0 theS |
//! @endcode
- void SetScale(const Standard_Real theS)
+ constexpr void SetScale(const Standard_Real theS) noexcept
{
myMat[0][0] = myMat[1][1] = theS;
myMat[0][1] = myMat[1][0] = 0.0;
Standard_EXPORT gp_XY Column(const Standard_Integer theCol) const;
//! Computes the determinant of the matrix.
- Standard_Real Determinant() const
+ constexpr Standard_Real Determinant() const noexcept
{
return myMat[0][0] * myMat[1][1] - myMat[1][0] * myMat[0][1];
}
//! The Gauss LU decomposition is used to invert the matrix
//! so the matrix is considered as singular if the largest
//! pivot found is lower or equal to Resolution from gp.
- Standard_Boolean IsSingular() const
+ constexpr Standard_Boolean IsSingular() const noexcept
{
Standard_Real aDet = Determinant();
if (aDet < 0)
return aDet <= gp::Resolution();
}
- void Add(const gp_Mat2d& Other);
+ constexpr void Add(const gp_Mat2d& Other) noexcept;
- void operator+=(const gp_Mat2d& theOther) { Add(theOther); }
+ constexpr void operator+=(const gp_Mat2d& theOther) noexcept { Add(theOther); }
//! Computes the sum of this matrix and the matrix
//! theOther.for each coefficient of the matrix :
//! Note:
//! - operator += assigns the result to this matrix, while
//! - operator + creates a new one.
- Standard_NODISCARD gp_Mat2d Added(const gp_Mat2d& theOther) const;
+ Standard_NODISCARD constexpr gp_Mat2d Added(const gp_Mat2d& theOther) const noexcept;
- Standard_NODISCARD gp_Mat2d operator+(const gp_Mat2d& theOther) const { return Added(theOther); }
+ Standard_NODISCARD constexpr gp_Mat2d operator+(const gp_Mat2d& theOther) const noexcept
+ {
+ return Added(theOther);
+ }
- void Divide(const Standard_Real theScalar);
+ constexpr void Divide(const Standard_Real theScalar);
- void operator/=(const Standard_Real theScalar) { Divide(theScalar); }
+ constexpr void operator/=(const Standard_Real theScalar) { Divide(theScalar); }
//! Divides all the coefficients of the matrix by a scalar.
- Standard_NODISCARD gp_Mat2d Divided(const Standard_Real theScalar) const;
+ Standard_NODISCARD constexpr gp_Mat2d Divided(const Standard_Real theScalar) const;
- Standard_NODISCARD gp_Mat2d operator/(const Standard_Real theScalar) const
+ Standard_NODISCARD constexpr gp_Mat2d operator/(const Standard_Real theScalar) const
{
return Divided(theScalar);
}
return aNewMat;
}
- Standard_NODISCARD gp_Mat2d Multiplied(const gp_Mat2d& theOther) const
+ Standard_NODISCARD constexpr gp_Mat2d Multiplied(const gp_Mat2d& theOther) const noexcept
{
gp_Mat2d aNewMat2d = *this;
aNewMat2d.Multiply(theOther);
return aNewMat2d;
}
- Standard_NODISCARD gp_Mat2d operator*(const gp_Mat2d& theOther) const
+ Standard_NODISCARD constexpr gp_Mat2d operator*(const gp_Mat2d& theOther) const noexcept
{
return Multiplied(theOther);
}
//! Computes the product of two matrices <me> * <theOther>
- void Multiply(const gp_Mat2d& theOther);
+ constexpr void Multiply(const gp_Mat2d& theOther) noexcept;
//! Modifies this matrix by premultiplying it by the matrix Other
//! <me> = theOther * <me>.
- void PreMultiply(const gp_Mat2d& theOther);
+ constexpr void PreMultiply(const gp_Mat2d& theOther) noexcept;
- Standard_NODISCARD gp_Mat2d Multiplied(const Standard_Real theScalar) const;
+ Standard_NODISCARD constexpr gp_Mat2d Multiplied(const Standard_Real theScalar) const noexcept;
- Standard_NODISCARD gp_Mat2d operator*(const Standard_Real theScalar) const
+ Standard_NODISCARD constexpr gp_Mat2d operator*(const Standard_Real theScalar) const noexcept
{
return Multiplied(theScalar);
}
//! Multiplies all the coefficients of the matrix by a scalar.
- void Multiply(const Standard_Real theScalar);
+ constexpr void Multiply(const Standard_Real theScalar) noexcept;
- void operator*=(const Standard_Real theScalar) { Multiply(theScalar); }
+ constexpr void operator*=(const Standard_Real theScalar) noexcept { Multiply(theScalar); }
Standard_EXPORT void Power(const Standard_Integer theN);
return aMat2dN;
}
- void Subtract(const gp_Mat2d& theOther);
+ constexpr void Subtract(const gp_Mat2d& theOther) noexcept;
- void operator-=(const gp_Mat2d& theOther) { Subtract(theOther); }
+ constexpr void operator-=(const gp_Mat2d& theOther) noexcept { Subtract(theOther); }
//! Computes for each coefficient of the matrix :
//! @code
//! <me>.Coef(i,j) - <theOther>.Coef(i,j)
//! @endcode
- Standard_NODISCARD gp_Mat2d Subtracted(const gp_Mat2d& theOther) const;
+ Standard_NODISCARD constexpr gp_Mat2d Subtracted(const gp_Mat2d& theOther) const noexcept;
- Standard_NODISCARD gp_Mat2d operator-(const gp_Mat2d& theOther) const
+ Standard_NODISCARD constexpr gp_Mat2d operator-(const gp_Mat2d& theOther) const noexcept
{
return Subtracted(theOther);
}
- void Transpose();
+ constexpr void Transpose() noexcept;
//! Transposes the matrix. A(j, i) -> A (i, j)
- Standard_NODISCARD gp_Mat2d Transposed() const;
+ Standard_NODISCARD constexpr gp_Mat2d Transposed() const noexcept;
friend class gp_Trsf2d;
friend class gp_GTrsf2d;
//=================================================================================================
-inline void gp_Mat2d::Add(const gp_Mat2d& theOther)
+inline constexpr void gp_Mat2d::Add(const gp_Mat2d& theOther) noexcept
{
myMat[0][0] += theOther.myMat[0][0];
myMat[0][1] += theOther.myMat[0][1];
//=================================================================================================
-inline gp_Mat2d gp_Mat2d::Added(const gp_Mat2d& theOther) const
+inline constexpr gp_Mat2d gp_Mat2d::Added(const gp_Mat2d& theOther) const noexcept
{
gp_Mat2d aNewMat2d;
aNewMat2d.myMat[0][0] = myMat[0][0] + theOther.myMat[0][0];
//=================================================================================================
-inline void gp_Mat2d::Divide(const Standard_Real theScalar)
+inline constexpr void gp_Mat2d::Divide(const Standard_Real theScalar)
{
myMat[0][0] /= theScalar;
myMat[0][1] /= theScalar;
//=================================================================================================
-inline gp_Mat2d gp_Mat2d::Divided(const Standard_Real theScalar) const
+inline constexpr gp_Mat2d gp_Mat2d::Divided(const Standard_Real theScalar) const
{
gp_Mat2d aNewMat2d;
aNewMat2d.myMat[0][0] = myMat[0][0] / theScalar;
//=================================================================================================
-inline void gp_Mat2d::Multiply(const gp_Mat2d& theOther)
+inline constexpr void gp_Mat2d::Multiply(const gp_Mat2d& theOther) noexcept
{
const Standard_Real aT00 =
myMat[0][0] * theOther.myMat[0][0] + myMat[0][1] * theOther.myMat[1][0];
//=================================================================================================
-inline void gp_Mat2d::PreMultiply(const gp_Mat2d& theOther)
+inline constexpr void gp_Mat2d::PreMultiply(const gp_Mat2d& theOther) noexcept
{
const Standard_Real aT00 =
theOther.myMat[0][0] * myMat[0][0] + theOther.myMat[0][1] * myMat[1][0];
//=================================================================================================
-inline gp_Mat2d gp_Mat2d::Multiplied(const Standard_Real theScalar) const
+inline constexpr gp_Mat2d gp_Mat2d::Multiplied(const Standard_Real theScalar) const noexcept
{
gp_Mat2d aNewMat2d;
aNewMat2d.myMat[0][0] = myMat[0][0] * theScalar;
//=================================================================================================
-inline void gp_Mat2d::Multiply(const Standard_Real theScalar)
+inline constexpr void gp_Mat2d::Multiply(const Standard_Real theScalar) noexcept
{
myMat[0][0] *= theScalar;
myMat[0][1] *= theScalar;
//=================================================================================================
-inline void gp_Mat2d::Subtract(const gp_Mat2d& theOther)
+inline constexpr void gp_Mat2d::Subtract(const gp_Mat2d& theOther) noexcept
{
myMat[0][0] -= theOther.myMat[0][0];
myMat[0][1] -= theOther.myMat[0][1];
//=================================================================================================
-inline gp_Mat2d gp_Mat2d::Subtracted(const gp_Mat2d& theOther) const
+inline constexpr gp_Mat2d gp_Mat2d::Subtracted(const gp_Mat2d& theOther) const noexcept
{
gp_Mat2d aNewMat2d;
aNewMat2d.myMat[0][0] = myMat[0][0] - theOther.myMat[0][0];
//=================================================================================================
-inline void gp_Mat2d::Transpose()
+inline constexpr void gp_Mat2d::Transpose() noexcept
{
const Standard_Real aTemp = myMat[0][1];
myMat[0][1] = myMat[1][0];
//=================================================================================================
-inline gp_Mat2d gp_Mat2d::Transposed() const
+inline constexpr gp_Mat2d gp_Mat2d::Transposed() const noexcept
{
gp_Mat2d aNewMat2d;
aNewMat2d.myMat[1][0] = myMat[0][1];
// function : operator*
// purpose :
//=======================================================================
-inline gp_Mat2d operator*(const Standard_Real theScalar, const gp_Mat2d& theMat2D)
+inline constexpr gp_Mat2d operator*(const Standard_Real theScalar,
+ const gp_Mat2d& theMat2D) noexcept
{
return theMat2D.Multiplied(theScalar);
}
DEFINE_STANDARD_ALLOC
//! Creates a point with zero coordinates.
- gp_Pnt() {}
+ constexpr gp_Pnt() noexcept
+ : coord()
+ {
+ }
//! Creates a point from a XYZ object.
- gp_Pnt(const gp_XYZ& theCoord)
+ constexpr gp_Pnt(const gp_XYZ& theCoord) noexcept
: coord(theCoord)
{
}
//! Creates a point with its 3 cartesian's coordinates : theXp, theYp, theZp.
- gp_Pnt(const Standard_Real theXp, const Standard_Real theYp, const Standard_Real theZp)
+ constexpr gp_Pnt(const Standard_Real theXp,
+ const Standard_Real theYp,
+ const Standard_Real theZp) noexcept
: coord(theXp, theYp, theZp)
{
}
}
//! For this point, assigns the values theXp, theYp and theZp to its three coordinates.
- void SetCoord(const Standard_Real theXp, const Standard_Real theYp, const Standard_Real theZp)
+ constexpr void SetCoord(const Standard_Real theXp,
+ const Standard_Real theYp,
+ const Standard_Real theZp) noexcept
{
coord.SetCoord(theXp, theYp, theZp);
}
//! Assigns the given value to the X coordinate of this point.
- void SetX(const Standard_Real theX) { coord.SetX(theX); }
+ constexpr void SetX(const Standard_Real theX) noexcept { coord.SetX(theX); }
//! Assigns the given value to the Y coordinate of this point.
- void SetY(const Standard_Real theY) { coord.SetY(theY); }
+ constexpr void SetY(const Standard_Real theY) noexcept { coord.SetY(theY); }
//! Assigns the given value to the Z coordinate of this point.
- void SetZ(const Standard_Real theZ) { coord.SetZ(theZ); }
+ constexpr void SetZ(const Standard_Real theZ) noexcept { coord.SetZ(theZ); }
//! Assigns the three coordinates of theCoord to this point.
- void SetXYZ(const gp_XYZ& theCoord) { coord = theCoord; }
+ constexpr void SetXYZ(const gp_XYZ& theCoord) noexcept { coord = theCoord; }
//! Returns the coordinate of corresponding to the value of theIndex :
//! theIndex = 1 => X is returned
Standard_Real Coord(const Standard_Integer theIndex) const { return coord.Coord(theIndex); }
//! For this point gives its three coordinates theXp, theYp and theZp.
- void Coord(Standard_Real& theXp, Standard_Real& theYp, Standard_Real& theZp) const
+ constexpr void Coord(Standard_Real& theXp,
+ Standard_Real& theYp,
+ Standard_Real& theZp) const noexcept
{
coord.Coord(theXp, theYp, theZp);
}
//! For this point, returns its X coordinate.
- Standard_Real X() const { return coord.X(); }
+ constexpr Standard_Real X() const noexcept { return coord.X(); }
//! For this point, returns its Y coordinate.
- Standard_Real Y() const { return coord.Y(); }
+ constexpr Standard_Real Y() const noexcept { return coord.Y(); }
//! For this point, returns its Z coordinate.
- Standard_Real Z() const { return coord.Z(); }
+ constexpr Standard_Real Z() const noexcept { return coord.Z(); }
//! For this point, returns its three coordinates as a XYZ object.
- const gp_XYZ& XYZ() const { return coord; }
+ constexpr const gp_XYZ& XYZ() const noexcept { return coord; }
//! For this point, returns its three coordinates as a XYZ object.
- const gp_XYZ& Coord() const { return coord; }
+ constexpr const gp_XYZ& Coord() const noexcept { return coord; }
//! Returns the coordinates of this point.
//! Note: This syntax allows direct modification of the returned value.
- gp_XYZ& ChangeCoord() { return coord; }
+ constexpr gp_XYZ& ChangeCoord() noexcept { return coord; }
//! Assigns the result of the following expression to this point
//! (theAlpha*this + theBeta*theP) / (theAlpha + theBeta)
- void BaryCenter(const Standard_Real theAlpha, const gp_Pnt& theP, const Standard_Real theBeta)
+ constexpr void BaryCenter(const Standard_Real theAlpha,
+ const gp_Pnt& theP,
+ const Standard_Real theBeta)
{
coord.SetLinearForm(theAlpha, coord, theBeta, theP.coord);
coord.Divide(theAlpha + theBeta);
Standard_Real Distance(const gp_Pnt& theOther) const;
//! Computes the square distance between two points.
- Standard_Real SquareDistance(const gp_Pnt& theOther) const;
+ constexpr Standard_Real SquareDistance(const gp_Pnt& theOther) const noexcept;
//! Performs the symmetrical transformation of a point
//! with respect to the point theP which is the center of
}
//! Scales a point. theS is the scaling value.
- void Scale(const gp_Pnt& theP, const Standard_Real theS);
+ constexpr void Scale(const gp_Pnt& theP, const Standard_Real theS) noexcept;
- Standard_NODISCARD gp_Pnt Scaled(const gp_Pnt& theP, const Standard_Real theS) const
+ Standard_NODISCARD constexpr gp_Pnt Scaled(const gp_Pnt& theP,
+ const Standard_Real theS) const noexcept
{
gp_Pnt aPres = *this;
aPres.Scale(theP, theS);
//! Translates a point in the direction of the vector theV.
//! The magnitude of the translation is the vector's magnitude.
- void Translate(const gp_Vec& theV);
+ constexpr void Translate(const gp_Vec& theV) noexcept;
- Standard_NODISCARD gp_Pnt Translated(const gp_Vec& theV) const;
+ Standard_NODISCARD constexpr gp_Pnt Translated(const gp_Vec& theV) const noexcept;
//! Translates a point from the point theP1 to the point theP2.
- void Translate(const gp_Pnt& theP1, const gp_Pnt& theP2)
+ constexpr void Translate(const gp_Pnt& theP1, const gp_Pnt& theP2) noexcept
{
coord.Add(theP2.coord);
coord.Subtract(theP1.coord);
}
- Standard_NODISCARD gp_Pnt Translated(const gp_Pnt& theP1, const gp_Pnt& theP2) const
+ Standard_NODISCARD constexpr gp_Pnt Translated(const gp_Pnt& theP1,
+ const gp_Pnt& theP2) const noexcept
{
gp_Pnt aP = *this;
aP.Translate(theP1, theP2);
//=================================================================================================
-inline Standard_Real gp_Pnt::SquareDistance(const gp_Pnt& theOther) const
+inline constexpr Standard_Real gp_Pnt::SquareDistance(const gp_Pnt& theOther) const noexcept
{
const gp_XYZ& aXYZ = theOther.coord;
const Standard_Real aDx = coord.X() - aXYZ.X();
//=================================================================================================
-inline void gp_Pnt::Scale(const gp_Pnt& theP, const Standard_Real theS)
+inline constexpr void gp_Pnt::Scale(const gp_Pnt& theP, const Standard_Real theS) noexcept
{
gp_XYZ aXYZ = theP.coord;
aXYZ.Multiply(1.0 - theS);
//=================================================================================================
-inline void gp_Pnt::Translate(const gp_Vec& theV)
+inline constexpr void gp_Pnt::Translate(const gp_Vec& theV) noexcept
{
coord.Add(theV.XYZ());
}
//=================================================================================================
-inline gp_Pnt gp_Pnt::Translated(const gp_Vec& theV) const
+inline constexpr gp_Pnt gp_Pnt::Translated(const gp_Vec& theV) const noexcept
{
gp_Pnt aP = *this;
aP.coord.Add(theV.XYZ());
DEFINE_STANDARD_ALLOC
//! Creates a point with zero coordinates.
- gp_Pnt2d() {}
+ constexpr gp_Pnt2d() noexcept
+ : coord()
+ {
+ }
//! Creates a point with a doublet of coordinates.
- gp_Pnt2d(const gp_XY& theCoord)
+ constexpr gp_Pnt2d(const gp_XY& theCoord) noexcept
: coord(theCoord)
{
}
//! Creates a point with its 2 cartesian's coordinates : theXp, theYp.
- gp_Pnt2d(const Standard_Real theXp, const Standard_Real theYp)
+ constexpr gp_Pnt2d(const Standard_Real theXp, const Standard_Real theYp) noexcept
: coord(theXp, theYp)
{
}
}
//! For this point, assigns the values theXp and theYp to its two coordinates
- void SetCoord(const Standard_Real theXp, const Standard_Real theYp)
+ constexpr void SetCoord(const Standard_Real theXp, const Standard_Real theYp) noexcept
{
coord.SetCoord(theXp, theYp);
}
//! Assigns the given value to the X coordinate of this point.
- void SetX(const Standard_Real theX) { coord.SetX(theX); }
+ constexpr void SetX(const Standard_Real theX) noexcept { coord.SetX(theX); }
//! Assigns the given value to the Y coordinate of this point.
- void SetY(const Standard_Real theY) { coord.SetY(theY); }
+ constexpr void SetY(const Standard_Real theY) noexcept { coord.SetY(theY); }
//! Assigns the two coordinates of Coord to this point.
- void SetXY(const gp_XY& theCoord) { coord = theCoord; }
+ constexpr void SetXY(const gp_XY& theCoord) noexcept { coord = theCoord; }
//! Returns the coordinate of range theIndex :
//! theIndex = 1 => X is returned
Standard_Real Coord(const Standard_Integer theIndex) const { return coord.Coord(theIndex); }
//! For this point returns its two coordinates as a number pair.
- void Coord(Standard_Real& theXp, Standard_Real& theYp) const { coord.Coord(theXp, theYp); }
+ constexpr void Coord(Standard_Real& theXp, Standard_Real& theYp) const noexcept
+ {
+ coord.Coord(theXp, theYp);
+ }
//! For this point, returns its X coordinate.
- Standard_Real X() const { return coord.X(); }
+ constexpr Standard_Real X() const noexcept { return coord.X(); }
//! For this point, returns its Y coordinate.
- Standard_Real Y() const { return coord.Y(); }
+ constexpr Standard_Real Y() const noexcept { return coord.Y(); }
//! For this point, returns its two coordinates as a number pair.
- const gp_XY& XY() const { return coord; }
+ constexpr const gp_XY& XY() const noexcept { return coord; }
//! For this point, returns its two coordinates as a number pair.
- const gp_XY& Coord() const { return coord; }
+ constexpr const gp_XY& Coord() const noexcept { return coord; }
//! Returns the coordinates of this point.
//! Note: This syntax allows direct modification of the returned value.
- gp_XY& ChangeCoord() { return coord; }
+ constexpr gp_XY& ChangeCoord() noexcept { return coord; }
//! Comparison
//! Returns True if the distance between the two
Standard_Real Distance(const gp_Pnt2d& theOther) const;
//! Computes the square distance between two points.
- Standard_Real SquareDistance(const gp_Pnt2d& theOther) const;
+ constexpr Standard_Real SquareDistance(const gp_Pnt2d& theOther) const noexcept;
//! Performs the symmetrical transformation of a point
//! with respect to the point theP which is the center of
}
//! Scales a point. theS is the scaling value.
- void Scale(const gp_Pnt2d& theP, const Standard_Real theS);
+ constexpr void Scale(const gp_Pnt2d& theP, const Standard_Real theS) noexcept;
- Standard_NODISCARD gp_Pnt2d Scaled(const gp_Pnt2d& theP, const Standard_Real theS) const
+ Standard_NODISCARD constexpr gp_Pnt2d Scaled(const gp_Pnt2d& theP,
+ const Standard_Real theS) const noexcept
{
gp_Pnt2d aPres = *this;
aPres.Scale(theP, theS);
//! Translates a point in the direction of the vector theV.
//! The magnitude of the translation is the vector's magnitude.
- void Translate(const gp_Vec2d& theV);
+ constexpr void Translate(const gp_Vec2d& theV) noexcept;
- Standard_NODISCARD gp_Pnt2d Translated(const gp_Vec2d& theV) const;
+ Standard_NODISCARD constexpr gp_Pnt2d Translated(const gp_Vec2d& theV) const noexcept;
//! Translates a point from the point theP1 to the point theP2.
- void Translate(const gp_Pnt2d& theP1, const gp_Pnt2d& theP2)
+ constexpr void Translate(const gp_Pnt2d& theP1, const gp_Pnt2d& theP2) noexcept
{
coord.Add(theP2.coord);
coord.Subtract(theP1.coord);
}
- Standard_NODISCARD gp_Pnt2d Translated(const gp_Pnt2d& theP1, const gp_Pnt2d& theP2) const
+ Standard_NODISCARD constexpr gp_Pnt2d Translated(const gp_Pnt2d& theP1,
+ const gp_Pnt2d& theP2) const noexcept
{
gp_Pnt2d aP = *this;
aP.Translate(theP1, theP2);
//=================================================================================================
-inline Standard_Real gp_Pnt2d::SquareDistance(const gp_Pnt2d& theOther) const
+inline constexpr Standard_Real gp_Pnt2d::SquareDistance(const gp_Pnt2d& theOther) const noexcept
{
const gp_XY& aXY = theOther.coord;
Standard_Real aX = coord.X() - aXY.X();
//=================================================================================================
-inline void gp_Pnt2d::Scale(const gp_Pnt2d& theP, const Standard_Real theS)
+inline constexpr void gp_Pnt2d::Scale(const gp_Pnt2d& theP, const Standard_Real theS) noexcept
{
gp_XY aXY = theP.coord;
aXY.Multiply(1.0 - theS);
//=================================================================================================
-inline void gp_Pnt2d::Translate(const gp_Vec2d& theV)
+inline constexpr void gp_Pnt2d::Translate(const gp_Vec2d& theV) noexcept
{
coord.Add(theV.XY());
}
//=================================================================================================
-inline gp_Pnt2d gp_Pnt2d::Translated(const gp_Vec2d& theV) const
+inline constexpr gp_Pnt2d gp_Pnt2d::Translated(const gp_Vec2d& theV) const noexcept
{
gp_Pnt2d aP = *this;
aP.coord.Add(theV.XY());
DEFINE_STANDARD_ALLOC
//! Creates an identity quaternion
- gp_Quaternion()
+ constexpr gp_Quaternion() noexcept
: x(0.0),
y(0.0),
z(0.0),
}
//! Creates quaternion directly from component values
- gp_Quaternion(const Standard_Real theX,
- const Standard_Real theY,
- const Standard_Real theZ,
- const Standard_Real theW)
+ constexpr gp_Quaternion(const Standard_Real theX,
+ const Standard_Real theY,
+ const Standard_Real theZ,
+ const Standard_Real theW) noexcept
: x(theX),
y(theY),
z(theZ),
Standard_Real& theBeta,
Standard_Real& theGamma) const;
- void Set(const Standard_Real theX,
- const Standard_Real theY,
- const Standard_Real theZ,
- const Standard_Real theW);
+ constexpr void Set(const Standard_Real theX,
+ const Standard_Real theY,
+ const Standard_Real theZ,
+ const Standard_Real theW) noexcept;
- void Set(const gp_Quaternion& theQuaternion);
+ constexpr void Set(const gp_Quaternion& theQuaternion) noexcept;
- Standard_Real X() const { return x; }
+ constexpr Standard_Real X() const noexcept { return x; }
- Standard_Real Y() const { return y; }
+ constexpr Standard_Real Y() const noexcept { return y; }
- Standard_Real Z() const { return z; }
+ constexpr Standard_Real Z() const noexcept { return z; }
- Standard_Real W() const { return w; }
+ constexpr Standard_Real W() const noexcept { return w; }
//! Make identity quaternion (zero-rotation)
- void SetIdent()
+ constexpr void SetIdent() noexcept
{
x = y = z = 0.0;
w = 1.0;
}
//! Reverse direction of rotation (conjugate quaternion)
- void Reverse()
+ constexpr void Reverse() noexcept
{
x = -x;
y = -y;
}
//! Return rotation with reversed direction (conjugated quaternion)
- Standard_NODISCARD gp_Quaternion Reversed() const { return gp_Quaternion(-x, -y, -z, w); }
+ Standard_NODISCARD constexpr gp_Quaternion Reversed() const noexcept
+ {
+ return gp_Quaternion(-x, -y, -z, w);
+ }
//! Inverts quaternion (both rotation direction and norm)
- void Invert()
+ constexpr void Invert()
{
Standard_Real anIn = 1.0 / SquareNorm();
Set(-x * anIn, -y * anIn, -z * anIn, w * anIn);
}
//! Return inversed quaternion q^-1
- Standard_NODISCARD gp_Quaternion Inverted() const
+ Standard_NODISCARD constexpr gp_Quaternion Inverted() const
{
Standard_Real anIn = 1.0 / SquareNorm();
return gp_Quaternion(-x * anIn, -y * anIn, -z * anIn, w * anIn);
}
//! Returns square norm of quaternion
- Standard_Real SquareNorm() const { return x * x + y * y + z * z + w * w; }
+ constexpr Standard_Real SquareNorm() const noexcept { return x * x + y * y + z * z + w * w; }
//! Returns norm of quaternion
Standard_Real Norm() const { return Sqrt(SquareNorm()); }
//! Scale all components by quaternion by theScale; note that
//! rotation is not changed by this operation (except 0-scaling)
- void Scale(const Standard_Real theScale);
+ constexpr void Scale(const Standard_Real theScale) noexcept;
void operator*=(const Standard_Real theScale) { Scale(theScale); }
//! Returns scaled quaternion
- Standard_NODISCARD gp_Quaternion Scaled(const Standard_Real theScale) const
+ Standard_NODISCARD constexpr gp_Quaternion Scaled(const Standard_Real theScale) const noexcept
{
return gp_Quaternion(x * theScale, y * theScale, z * theScale, w * theScale);
}
- Standard_NODISCARD gp_Quaternion operator*(const Standard_Real theScale) const
+ Standard_NODISCARD constexpr gp_Quaternion operator*(const Standard_Real theScale) const noexcept
{
return Scaled(theScale);
}
//! Returns quaternion with all components negated.
//! Note that this operation does not affect neither
//! rotation operator defined by quaternion nor its norm.
- Standard_NODISCARD gp_Quaternion Negated() const { return gp_Quaternion(-x, -y, -z, -w); }
+ Standard_NODISCARD constexpr gp_Quaternion Negated() const noexcept
+ {
+ return gp_Quaternion(-x, -y, -z, -w);
+ }
- Standard_NODISCARD gp_Quaternion operator-() const { return Negated(); }
+ Standard_NODISCARD constexpr gp_Quaternion operator-() const noexcept { return Negated(); }
//! Makes sum of quaternion components; result is "rotations mix"
- Standard_NODISCARD gp_Quaternion Added(const gp_Quaternion& theOther) const
+ Standard_NODISCARD constexpr gp_Quaternion Added(const gp_Quaternion& theOther) const noexcept
{
return gp_Quaternion(x + theOther.x, y + theOther.y, z + theOther.z, w + theOther.w);
}
- Standard_NODISCARD gp_Quaternion operator+(const gp_Quaternion& theOther) const
+ Standard_NODISCARD constexpr gp_Quaternion operator+(const gp_Quaternion& theOther) const noexcept
{
return Added(theOther);
}
//! Makes difference of quaternion components; result is "rotations mix"
- Standard_NODISCARD gp_Quaternion Subtracted(const gp_Quaternion& theOther) const
+ Standard_NODISCARD constexpr gp_Quaternion Subtracted(
+ const gp_Quaternion& theOther) const noexcept
{
return gp_Quaternion(x - theOther.x, y - theOther.y, z - theOther.z, w - theOther.w);
}
- Standard_NODISCARD gp_Quaternion operator-(const gp_Quaternion& theOther) const
+ Standard_NODISCARD constexpr gp_Quaternion operator-(const gp_Quaternion& theOther) const noexcept
{
return Subtracted(theOther);
}
//! qq' != q'q;
//! qq^-1 = q;
//! @endcode
- Standard_NODISCARD gp_Quaternion Multiplied(const gp_Quaternion& theOther) const;
+ Standard_NODISCARD constexpr gp_Quaternion Multiplied(
+ const gp_Quaternion& theOther) const noexcept;
- Standard_NODISCARD gp_Quaternion operator*(const gp_Quaternion& theOther) const
+ Standard_NODISCARD constexpr gp_Quaternion operator*(const gp_Quaternion& theOther) const noexcept
{
return Multiplied(theOther);
}
//! Adds components of other quaternion; result is "rotations mix"
- void Add(const gp_Quaternion& theOther);
+ constexpr void Add(const gp_Quaternion& theOther) noexcept;
void operator+=(const gp_Quaternion& theOther) { Add(theOther); }
//! Subtracts components of other quaternion; result is "rotations mix"
- void Subtract(const gp_Quaternion& theOther);
+ constexpr void Subtract(const gp_Quaternion& theOther) noexcept;
void operator-=(const gp_Quaternion& theOther) { Subtract(theOther); }
void operator*=(const gp_Quaternion& theOther) { Multiply(theOther); }
//! Computes inner product / scalar product / Dot
- Standard_Real Dot(const gp_Quaternion& theOther) const
+ constexpr Standard_Real Dot(const gp_Quaternion& theOther) const noexcept
{
return x * theOther.x + y * theOther.y + z * theOther.z + w * theOther.w;
}
//=================================================================================================
-inline void gp_Quaternion::Set(Standard_Real theX,
- Standard_Real theY,
- Standard_Real theZ,
- Standard_Real theW)
+inline constexpr void gp_Quaternion::Set(Standard_Real theX,
+ Standard_Real theY,
+ Standard_Real theZ,
+ Standard_Real theW) noexcept
{
this->x = theX;
this->y = theY;
//=================================================================================================
-inline void gp_Quaternion::Set(const gp_Quaternion& theQuaternion)
+inline constexpr void gp_Quaternion::Set(const gp_Quaternion& theQuaternion) noexcept
{
x = theQuaternion.x;
y = theQuaternion.y;
//=================================================================================================
-inline void gp_Quaternion::Scale(const Standard_Real theScale)
+inline constexpr void gp_Quaternion::Scale(const Standard_Real theScale) noexcept
{
x *= theScale;
y *= theScale;
//=================================================================================================
-inline gp_Quaternion gp_Quaternion::Multiplied(const gp_Quaternion& theQ) const
+inline constexpr gp_Quaternion gp_Quaternion::Multiplied(const gp_Quaternion& theQ) const noexcept
{
return gp_Quaternion(w * theQ.x + x * theQ.w + y * theQ.z - z * theQ.y,
w * theQ.y + y * theQ.w + z * theQ.x - x * theQ.z,
//=================================================================================================
-inline void gp_Quaternion::Add(const gp_Quaternion& theQ)
+inline constexpr void gp_Quaternion::Add(const gp_Quaternion& theQ) noexcept
{
x += theQ.x;
y += theQ.y;
//=================================================================================================
-inline void gp_Quaternion::Subtract(const gp_Quaternion& theQ)
+inline constexpr void gp_Quaternion::Subtract(const gp_Quaternion& theQ) noexcept
{
x -= theQ.x;
y -= theQ.y;
DEFINE_STANDARD_ALLOC
//! Returns the identity transformation.
- gp_Trsf();
+ constexpr gp_Trsf() noexcept;
//! Creates a 3D transformation from the 2D transformation theT.
//! The resulting transformation has a homogeneous
//! Raises ConstructionError If theS is null.
Standard_EXPORT void SetScaleFactor(const Standard_Real theS);
- void SetForm(const gp_TrsfForm theP) { shape = theP; }
+ constexpr void SetForm(const gp_TrsfForm theP) noexcept { shape = theP; }
//! Sets the coefficients of the transformation. The
//! transformation of the point x,y,z is the point
//! Returns true if the determinant of the vectorial part of
//! this transformation is negative.
- Standard_Boolean IsNegative() const { return (scale < 0.0); }
+ constexpr Standard_Boolean IsNegative() const noexcept { return (scale < 0.0); }
//! Returns the nature of the transformation. It can be: an
//! identity transformation, a rotation, a translation, a mirror
//! transformation (relative to a point, an axis or a plane), a
//! scaling transformation, or a compound transformation.
- gp_TrsfForm Form() const { return shape; }
+ constexpr gp_TrsfForm Form() const noexcept { return shape; }
//! Returns the scale factor.
- Standard_Real ScaleFactor() const { return scale; }
+ constexpr Standard_Real ScaleFactor() const noexcept { return scale; }
//! Returns the translation part of the transformation's matrix
- const gp_XYZ& TranslationPart() const { return loc; }
+ constexpr const gp_XYZ& TranslationPart() const noexcept { return loc; }
//! Returns the boolean True if there is non-zero rotation.
//! In the presence of rotation, the output parameters store the axis
//! to its homogeneous vectorial part, multiplied by the scale factor.
//! The coefficients of this matrix must be multiplied by the
//! scale factor to obtain the coefficients of the transformation.
- const gp_Mat& HVectorialPart() const { return matrix; }
+ constexpr const gp_Mat& HVectorialPart() const noexcept { return matrix; }
//! Returns the coefficients of the transformation's matrix.
//! It is a 3 rows * 4 columns matrix.
return aT;
}
- void Transforms(Standard_Real& theX, Standard_Real& theY, Standard_Real& theZ) const;
+ void Transforms(Standard_Real& theX, Standard_Real& theY, Standard_Real& theZ) const noexcept;
//! Transformation of a triplet XYZ with a Trsf
- void Transforms(gp_XYZ& theCoord) const;
+ void Transforms(gp_XYZ& theCoord) const noexcept;
//! Convert transformation to 4x4 matrix.
template <class T>
//=================================================================================================
-inline gp_Trsf::gp_Trsf()
+inline constexpr gp_Trsf::gp_Trsf() noexcept
: scale(1.0),
shape(gp_Identity),
matrix(1, 0, 0, 0, 1, 0, 0, 0, 1),
//=================================================================================================
-inline void gp_Trsf::Transforms(Standard_Real& theX, Standard_Real& theY, Standard_Real& theZ) const
+inline void gp_Trsf::Transforms(Standard_Real& theX,
+ Standard_Real& theY,
+ Standard_Real& theZ) const noexcept
{
gp_XYZ aTriplet(theX, theY, theZ);
aTriplet.Multiply(matrix);
//=================================================================================================
-inline void gp_Trsf::Transforms(gp_XYZ& theCoord) const
+inline void gp_Trsf::Transforms(gp_XYZ& theCoord) const noexcept
{
theCoord.Multiply(matrix);
if (scale != 1.0)
DEFINE_STANDARD_ALLOC
//! Returns identity transformation.
- gp_Trsf2d();
+ constexpr gp_Trsf2d() noexcept;
//! Creates a 2d transformation in the XY plane from a
//! 3d transformation .
//! Returns true if the determinant of the vectorial part of
//! this transformation is negative..
- Standard_Boolean IsNegative() const { return (matrix.Determinant() < 0.0); }
+ constexpr Standard_Boolean IsNegative() const noexcept { return (matrix.Determinant() < 0.0); }
//! Returns the nature of the transformation. It can be an
//! identity transformation, a rotation, a translation, a mirror
//! (relative to a point or an axis), a scaling transformation,
//! or a compound transformation.
- gp_TrsfForm Form() const { return shape; }
+ constexpr gp_TrsfForm Form() const noexcept { return shape; }
//! Returns the scale factor.
- Standard_Real ScaleFactor() const { return scale; }
+ constexpr Standard_Real ScaleFactor() const noexcept { return scale; }
//! Returns the translation part of the transformation's matrix
- const gp_XY& TranslationPart() const { return loc; }
+ constexpr const gp_XY& TranslationPart() const noexcept { return loc; }
//! Returns the vectorial part of the transformation. It is a
//! 2*2 matrix which includes the scale factor.
//! It is a 2*2 matrix which doesn't include the scale factor.
//! The coefficients of this matrix must be multiplied by the
//! scale factor to obtain the coefficients of the transformation.
- const gp_Mat2d& HVectorialPart() const { return matrix; }
+ constexpr const gp_Mat2d& HVectorialPart() const noexcept { return matrix; }
//! Returns the angle corresponding to the rotational component
//! of the transformation matrix (operation opposite to SetRotation()).
return aT;
}
- void Transforms(Standard_Real& theX, Standard_Real& theY) const;
+ void Transforms(Standard_Real& theX, Standard_Real& theY) const noexcept;
//! Transforms a doublet XY with a Trsf2d
- void Transforms(gp_XY& theCoord) const;
+ void Transforms(gp_XY& theCoord) const noexcept;
//! Sets the coefficients of the transformation. The
//! transformation of the point x,y is the point
//=================================================================================================
-inline gp_Trsf2d::gp_Trsf2d()
+inline constexpr gp_Trsf2d::gp_Trsf2d() noexcept
+ : scale(1.0),
+ shape(gp_Identity),
+ matrix(),
+ loc(0.0, 0.0)
{
- shape = gp_Identity;
- scale = 1.0;
matrix.SetIdentity();
- loc.SetCoord(0.0, 0.0);
}
//=================================================================================================
//=================================================================================================
-inline void gp_Trsf2d::Transforms(Standard_Real& theX, Standard_Real& theY) const
+inline void gp_Trsf2d::Transforms(Standard_Real& theX, Standard_Real& theY) const noexcept
{
gp_XY aDoublet(theX, theY);
aDoublet.Multiply(matrix);
//=================================================================================================
-inline void gp_Trsf2d::Transforms(gp_XY& theCoord) const
+inline void gp_Trsf2d::Transforms(gp_XY& theCoord) const noexcept
{
theCoord.Multiply(matrix);
if (scale != 1.0)
DEFINE_STANDARD_ALLOC
//! Creates a zero vector.
- gp_Vec() {}
+ constexpr gp_Vec() noexcept {}
//! Creates a unitary vector from a direction theV.
gp_Vec(const gp_Dir& theV);
//! Creates a vector with a triplet of coordinates.
- gp_Vec(const gp_XYZ& theCoord)
+ constexpr gp_Vec(const gp_XYZ& theCoord) noexcept
: coord(theCoord)
{
}
//! Creates a point with its three cartesian coordinates.
- gp_Vec(const Standard_Real theXv, const Standard_Real theYv, const Standard_Real theZv)
+ constexpr gp_Vec(const Standard_Real theXv,
+ const Standard_Real theYv,
+ const Standard_Real theZv) noexcept
: coord(theXv, theYv, theZv)
{
}
//! For this vector, assigns
//! - the values theXv, theYv and theZv to its three coordinates.
- void SetCoord(const Standard_Real theXv, const Standard_Real theYv, const Standard_Real theZv)
+ constexpr void SetCoord(const Standard_Real theXv,
+ const Standard_Real theYv,
+ const Standard_Real theZv) noexcept
{
coord.SetX(theXv);
coord.SetY(theYv);
}
//! Assigns the given value to the X coordinate of this vector.
- void SetX(const Standard_Real theX) { coord.SetX(theX); }
+ constexpr void SetX(const Standard_Real theX) noexcept { coord.SetX(theX); }
//! Assigns the given value to the X coordinate of this vector.
- void SetY(const Standard_Real theY) { coord.SetY(theY); }
+ constexpr void SetY(const Standard_Real theY) noexcept { coord.SetY(theY); }
//! Assigns the given value to the X coordinate of this vector.
- void SetZ(const Standard_Real theZ) { coord.SetZ(theZ); }
+ constexpr void SetZ(const Standard_Real theZ) noexcept { coord.SetZ(theZ); }
//! Assigns the three coordinates of theCoord to this vector.
- void SetXYZ(const gp_XYZ& theCoord) { coord = theCoord; }
+ constexpr void SetXYZ(const gp_XYZ& theCoord) noexcept { coord = theCoord; }
//! Returns the coordinate of range theIndex :
//! theIndex = 1 => X is returned
Standard_Real Coord(const Standard_Integer theIndex) const { return coord.Coord(theIndex); }
//! For this vector returns its three coordinates theXv, theYv, and theZv inline
- void Coord(Standard_Real& theXv, Standard_Real& theYv, Standard_Real& theZv) const
+ constexpr void Coord(Standard_Real& theXv,
+ Standard_Real& theYv,
+ Standard_Real& theZv) const noexcept
{
theXv = coord.X();
theYv = coord.Y();
}
//! For this vector, returns its X coordinate.
- Standard_Real X() const { return coord.X(); }
+ constexpr Standard_Real X() const noexcept { return coord.X(); }
//! For this vector, returns its Y coordinate.
- Standard_Real Y() const { return coord.Y(); }
+ constexpr Standard_Real Y() const noexcept { return coord.Y(); }
//! For this vector, returns its Z coordinate.
- Standard_Real Z() const { return coord.Z(); }
+ constexpr Standard_Real Z() const noexcept { return coord.Z(); }
//! For this vector, returns
//! - its three coordinates as a number triple
- const gp_XYZ& XYZ() const { return coord; }
+ constexpr const gp_XYZ& XYZ() const noexcept { return coord; }
//! Returns True if the two vectors have the same magnitude value
//! and the same direction. The precision values are theLinearTolerance
Standard_Real Magnitude() const { return coord.Modulus(); }
//! Computes the square magnitude of this vector.
- Standard_Real SquareMagnitude() const { return coord.SquareModulus(); }
+ constexpr Standard_Real SquareMagnitude() const noexcept { return coord.SquareModulus(); }
//! Adds two vectors
- void Add(const gp_Vec& theOther) { coord.Add(theOther.coord); }
+ constexpr void Add(const gp_Vec& theOther) noexcept { coord.Add(theOther.coord); }
- void operator+=(const gp_Vec& theOther) { Add(theOther); }
+ constexpr void operator+=(const gp_Vec& theOther) noexcept { Add(theOther); }
//! Adds two vectors
- Standard_NODISCARD gp_Vec Added(const gp_Vec& theOther) const
+ Standard_NODISCARD constexpr gp_Vec Added(const gp_Vec& theOther) const noexcept
{
gp_Vec aV = *this;
aV.coord.Add(theOther.coord);
return aV;
}
- Standard_NODISCARD gp_Vec operator+(const gp_Vec& theOther) const { return Added(theOther); }
+ Standard_NODISCARD constexpr gp_Vec operator+(const gp_Vec& theOther) const noexcept
+ {
+ return Added(theOther);
+ }
//! Subtracts two vectors
- void Subtract(const gp_Vec& theRight) { coord.Subtract(theRight.coord); }
+ constexpr void Subtract(const gp_Vec& theRight) noexcept { coord.Subtract(theRight.coord); }
- void operator-=(const gp_Vec& theRight) { Subtract(theRight); }
+ constexpr void operator-=(const gp_Vec& theRight) noexcept { Subtract(theRight); }
//! Subtracts two vectors
- Standard_NODISCARD gp_Vec Subtracted(const gp_Vec& theRight) const
+ Standard_NODISCARD constexpr gp_Vec Subtracted(const gp_Vec& theRight) const noexcept
{
gp_Vec aV = *this;
aV.coord.Subtract(theRight.coord);
return aV;
}
- Standard_NODISCARD gp_Vec operator-(const gp_Vec& theRight) const { return Subtracted(theRight); }
+ Standard_NODISCARD constexpr gp_Vec operator-(const gp_Vec& theRight) const noexcept
+ {
+ return Subtracted(theRight);
+ }
//! Multiplies a vector by a scalar
- void Multiply(const Standard_Real theScalar) { coord.Multiply(theScalar); }
+ constexpr void Multiply(const Standard_Real theScalar) noexcept { coord.Multiply(theScalar); }
- void operator*=(const Standard_Real theScalar) { Multiply(theScalar); }
+ constexpr void operator*=(const Standard_Real theScalar) noexcept { Multiply(theScalar); }
//! Multiplies a vector by a scalar
- Standard_NODISCARD gp_Vec Multiplied(const Standard_Real theScalar) const
+ Standard_NODISCARD constexpr gp_Vec Multiplied(const Standard_Real theScalar) const noexcept
{
gp_Vec aV = *this;
aV.coord.Multiply(theScalar);
return aV;
}
- Standard_NODISCARD gp_Vec operator*(const Standard_Real theScalar) const
+ Standard_NODISCARD constexpr gp_Vec operator*(const Standard_Real theScalar) const noexcept
{
return Multiplied(theScalar);
}
//! Divides a vector by a scalar
- void Divide(const Standard_Real theScalar) { coord.Divide(theScalar); }
+ constexpr void Divide(const Standard_Real theScalar) { coord.Divide(theScalar); }
- void operator/=(const Standard_Real theScalar) { Divide(theScalar); }
+ constexpr void operator/=(const Standard_Real theScalar) { Divide(theScalar); }
//! Divides a vector by a scalar
- Standard_NODISCARD gp_Vec Divided(const Standard_Real theScalar) const
+ Standard_NODISCARD constexpr gp_Vec Divided(const Standard_Real theScalar) const
{
gp_Vec aV = *this;
aV.coord.Divide(theScalar);
return aV;
}
- Standard_NODISCARD gp_Vec operator/(const Standard_Real theScalar) const
+ Standard_NODISCARD constexpr gp_Vec operator/(const Standard_Real theScalar) const
{
return Divided(theScalar);
}
//! computes the cross product between two vectors
- void Cross(const gp_Vec& theRight) { coord.Cross(theRight.coord); }
+ constexpr void Cross(const gp_Vec& theRight) noexcept { coord.Cross(theRight.coord); }
- void operator^=(const gp_Vec& theRight) { Cross(theRight); }
+ constexpr void operator^=(const gp_Vec& theRight) noexcept { Cross(theRight); }
//! computes the cross product between two vectors
- Standard_NODISCARD gp_Vec Crossed(const gp_Vec& theRight) const
+ Standard_NODISCARD constexpr gp_Vec Crossed(const gp_Vec& theRight) const noexcept
{
gp_Vec aV = *this;
aV.coord.Cross(theRight.coord);
return aV;
}
- Standard_NODISCARD gp_Vec operator^(const gp_Vec& theRight) const { return Crossed(theRight); }
+ Standard_NODISCARD constexpr gp_Vec operator^(const gp_Vec& theRight) const noexcept
+ {
+ return Crossed(theRight);
+ }
//! Computes the magnitude of the cross
//! product between <me> and theRight.
//! Computes the square magnitude of
//! the cross product between <me> and theRight.
//! Returns || <me> ^ theRight ||**2
- Standard_Real CrossSquareMagnitude(const gp_Vec& theRight) const
+ constexpr Standard_Real CrossSquareMagnitude(const gp_Vec& theRight) const noexcept
{
return coord.CrossSquareMagnitude(theRight.coord);
}
//! Computes the triple vector product.
//! <me> ^= (theV1 ^ theV2)
- void CrossCross(const gp_Vec& theV1, const gp_Vec& theV2)
+ constexpr void CrossCross(const gp_Vec& theV1, const gp_Vec& theV2) noexcept
{
coord.CrossCross(theV1.coord, theV2.coord);
}
//! Computes the triple vector product.
//! <me> ^ (theV1 ^ theV2)
- Standard_NODISCARD gp_Vec CrossCrossed(const gp_Vec& theV1, const gp_Vec& theV2) const
+ Standard_NODISCARD constexpr gp_Vec CrossCrossed(const gp_Vec& theV1,
+ const gp_Vec& theV2) const noexcept
{
gp_Vec aV = *this;
aV.coord.CrossCross(theV1.coord, theV2.coord);
}
//! computes the scalar product
- Standard_Real Dot(const gp_Vec& theOther) const { return coord.Dot(theOther.coord); }
+ constexpr Standard_Real Dot(const gp_Vec& theOther) const noexcept
+ {
+ return coord.Dot(theOther.coord);
+ }
- Standard_Real operator*(const gp_Vec& theOther) const { return Dot(theOther); }
+ constexpr Standard_Real operator*(const gp_Vec& theOther) const noexcept { return Dot(theOther); }
//! Computes the triple scalar product <me> * (theV1 ^ theV2).
- Standard_Real DotCross(const gp_Vec& theV1, const gp_Vec& theV2) const
+ constexpr Standard_Real DotCross(const gp_Vec& theV1, const gp_Vec& theV2) const noexcept
{
return coord.DotCross(theV1.coord, theV2.coord);
}
Standard_NODISCARD gp_Vec Normalized() const;
//! Reverses the direction of a vector
- void Reverse() { coord.Reverse(); }
+ constexpr void Reverse() noexcept { coord.Reverse(); }
//! Reverses the direction of a vector
- Standard_NODISCARD gp_Vec Reversed() const
+ Standard_NODISCARD constexpr gp_Vec Reversed() const noexcept
{
gp_Vec aV = *this;
aV.coord.Reverse();
return aV;
}
- Standard_NODISCARD gp_Vec operator-() const { return Reversed(); }
+ Standard_NODISCARD constexpr gp_Vec operator-() const noexcept { return Reversed(); }
//! <me> is set to the following linear form :
//! theA1 * theV1 + theA2 * theV2 + theA3 * theV3 + theV4
- void SetLinearForm(const Standard_Real theA1,
- const gp_Vec& theV1,
- const Standard_Real theA2,
- const gp_Vec& theV2,
- const Standard_Real theA3,
- const gp_Vec& theV3,
- const gp_Vec& theV4)
+ constexpr void SetLinearForm(const Standard_Real theA1,
+ const gp_Vec& theV1,
+ const Standard_Real theA2,
+ const gp_Vec& theV2,
+ const Standard_Real theA3,
+ const gp_Vec& theV3,
+ const gp_Vec& theV4) noexcept
{
coord.SetLinearForm(theA1, theV1.coord, theA2, theV2.coord, theA3, theV3.coord, theV4.coord);
}
//! <me> is set to the following linear form :
//! theA1 * theV1 + theA2 * theV2 + theA3 * theV3
- void SetLinearForm(const Standard_Real theA1,
- const gp_Vec& theV1,
- const Standard_Real theA2,
- const gp_Vec& theV2,
- const Standard_Real theA3,
- const gp_Vec& theV3)
+ constexpr void SetLinearForm(const Standard_Real theA1,
+ const gp_Vec& theV1,
+ const Standard_Real theA2,
+ const gp_Vec& theV2,
+ const Standard_Real theA3,
+ const gp_Vec& theV3) noexcept
{
coord.SetLinearForm(theA1, theV1.coord, theA2, theV2.coord, theA3, theV3.coord);
}
//! <me> is set to the following linear form :
//! theA1 * theV1 + theA2 * theV2 + theV3
- void SetLinearForm(const Standard_Real theA1,
- const gp_Vec& theV1,
- const Standard_Real theA2,
- const gp_Vec& theV2,
- const gp_Vec& theV3)
+ constexpr void SetLinearForm(const Standard_Real theA1,
+ const gp_Vec& theV1,
+ const Standard_Real theA2,
+ const gp_Vec& theV2,
+ const gp_Vec& theV3) noexcept
{
coord.SetLinearForm(theA1, theV1.coord, theA2, theV2.coord, theV3.coord);
}
//! <me> is set to the following linear form :
//! theA1 * theV1 + theA2 * theV2
- void SetLinearForm(const Standard_Real theA1,
- const gp_Vec& theV1,
- const Standard_Real theA2,
- const gp_Vec& theV2)
+ constexpr void SetLinearForm(const Standard_Real theA1,
+ const gp_Vec& theV1,
+ const Standard_Real theA2,
+ const gp_Vec& theV2) noexcept
{
coord.SetLinearForm(theA1, theV1.coord, theA2, theV2.coord);
}
//! <me> is set to the following linear form : theA1 * theV1 + theV2
- void SetLinearForm(const Standard_Real theA1, const gp_Vec& theV1, const gp_Vec& theV2)
+ constexpr void SetLinearForm(const Standard_Real theA1,
+ const gp_Vec& theV1,
+ const gp_Vec& theV2) noexcept
{
coord.SetLinearForm(theA1, theV1.coord, theV2.coord);
}
//! <me> is set to the following linear form : theV1 + theV2
- void SetLinearForm(const gp_Vec& theV1, const gp_Vec& theV2)
+ constexpr void SetLinearForm(const gp_Vec& theV1, const gp_Vec& theV2) noexcept
{
coord.SetLinearForm(theV1.coord, theV2.coord);
}
return aVres;
}
- void Scale(const Standard_Real theS) { coord.Multiply(theS); }
+ constexpr void Scale(const Standard_Real theS) noexcept { coord.Multiply(theS); }
//! Scales a vector. theS is the scaling value.
- Standard_NODISCARD gp_Vec Scaled(const Standard_Real theS) const
+ Standard_NODISCARD constexpr gp_Vec Scaled(const Standard_Real theS) const noexcept
{
gp_Vec aV = *this;
aV.coord.Multiply(theS);
// function : operator*
// purpose :
//=======================================================================
-inline gp_Vec operator*(const Standard_Real theScalar, const gp_Vec& theV)
+inline constexpr gp_Vec operator*(const Standard_Real theScalar, const gp_Vec& theV) noexcept
{
return theV.Multiplied(theScalar);
}
void Coord(Standard_Real& theXv, Standard_Real& theYv) const { coord.Coord(theXv, theYv); }
//! For this vector, returns its X coordinate.
- Standard_Real X() const { return coord.X(); }
+ constexpr Standard_Real X() const noexcept { return coord.X(); }
//! For this vector, returns its Y coordinate.
- Standard_Real Y() const { return coord.Y(); }
+ constexpr Standard_Real Y() const noexcept { return coord.Y(); }
//! For this vector, returns its two coordinates as a number pair
- const gp_XY& XY() const { return coord; }
+ constexpr const gp_XY& XY() const noexcept { return coord; }
//! Returns True if the two vectors have the same magnitude value
//! and the same direction. The precision values are theLinearTolerance
DEFINE_STANDARD_ALLOC
//! Creates XY object with zero coordinates (0,0).
- gp_XY()
+ constexpr gp_XY() noexcept
: x(0.),
y(0.)
{
}
//! a number pair defined by the XY coordinates
- gp_XY(const Standard_Real theX, const Standard_Real theY)
+ constexpr gp_XY(const Standard_Real theX, const Standard_Real theY) noexcept
: x(theX),
y(theY)
{
//! For this number pair, assigns
//! the values theX and theY to its coordinates
- inline void SetCoord(const Standard_Real theX, const Standard_Real theY)
+ constexpr void SetCoord(const Standard_Real theX, const Standard_Real theY) noexcept
{
x = theX;
y = theY;
}
//! Assigns the given value to the X coordinate of this number pair.
- void SetX(const Standard_Real theX) { x = theX; }
+ constexpr void SetX(const Standard_Real theX) noexcept { x = theX; }
//! Assigns the given value to the Y coordinate of this number pair.
- void SetY(const Standard_Real theY) { y = theY; }
+ constexpr void SetY(const Standard_Real theY) noexcept { y = theY; }
//! returns the coordinate of range theIndex :
//! theIndex = 1 => X is returned
}
//! For this number pair, returns its coordinates X and Y.
- inline void Coord(Standard_Real& theX, Standard_Real& theY) const
+ constexpr void Coord(Standard_Real& theX, Standard_Real& theY) const noexcept
{
theX = x;
theY = y;
}
//! Returns the X coordinate of this number pair.
- Standard_Real X() const { return x; }
+ constexpr Standard_Real X() const noexcept { return x; }
//! Returns the Y coordinate of this number pair.
- Standard_Real Y() const { return y; }
+ constexpr Standard_Real Y() const noexcept { return y; }
//! Computes Sqrt (X*X + Y*Y) where X and Y are the two coordinates of this number pair.
Standard_Real Modulus() const { return sqrt(SquareModulus()); }
//! Computes X*X + Y*Y where X and Y are the two coordinates of this number pair.
- Standard_Real SquareModulus() const { return x * x + y * y; }
+ constexpr Standard_Real SquareModulus() const noexcept { return x * x + y * y; }
//! Returns true if the coordinates of this number pair are
//! equal to the respective coordinates of the number pair
//! <me>.X() = <me>.X() + theOther.X()
//! <me>.Y() = <me>.Y() + theOther.Y()
//! @endcode
- inline void Add(const gp_XY& theOther)
+ constexpr void Add(const gp_XY& theOther) noexcept
{
x += theOther.x;
y += theOther.y;
}
- void operator+=(const gp_XY& theOther) { Add(theOther); }
+ constexpr void operator+=(const gp_XY& theOther) noexcept { Add(theOther); }
//! Computes the sum of this number pair and number pair theOther
//! @code
//! new.X() = <me>.X() + theOther.X()
//! new.Y() = <me>.Y() + theOther.Y()
//! @endcode
- Standard_NODISCARD gp_XY Added(const gp_XY& theOther) const
+ Standard_NODISCARD constexpr gp_XY Added(const gp_XY& theOther) const noexcept
{
return gp_XY(x + theOther.X(), y + theOther.Y());
}
- Standard_NODISCARD gp_XY operator+(const gp_XY& theOther) const { return Added(theOther); }
+ Standard_NODISCARD constexpr gp_XY operator+(const gp_XY& theOther) const noexcept
+ {
+ return Added(theOther);
+ }
//! @code
//! double D = <me>.X() * theOther.Y() - <me>.Y() * theOther.X()
//! @endcode
- Standard_NODISCARD Standard_Real Crossed(const gp_XY& theOther) const
+ Standard_NODISCARD constexpr Standard_Real Crossed(const gp_XY& theOther) const noexcept
{
return x * theOther.y - y * theOther.x;
}
- Standard_NODISCARD Standard_Real operator^(const gp_XY& theOther) const
+ Standard_NODISCARD constexpr Standard_Real operator^(const gp_XY& theOther) const noexcept
{
return Crossed(theOther);
}
//! computes the magnitude of the cross product between <me> and
//! theRight. Returns || <me> ^ theRight ||
- inline Standard_Real CrossMagnitude(const gp_XY& theRight) const
+ Standard_Real CrossMagnitude(const gp_XY& theRight) const
{
return Abs(x * theRight.y - y * theRight.x);
}
//! computes the square magnitude of the cross product between <me> and
//! theRight. Returns || <me> ^ theRight ||**2
- inline Standard_Real CrossSquareMagnitude(const gp_XY& theRight) const
+ constexpr Standard_Real CrossSquareMagnitude(const gp_XY& theRight) const noexcept
{
const Standard_Real aZresult = x * theRight.y - y * theRight.x;
return aZresult * aZresult;
}
//! divides <me> by a real.
- void Divide(const Standard_Real theScalar)
+ constexpr void Divide(const Standard_Real theScalar)
{
x /= theScalar;
y /= theScalar;
}
- void operator/=(const Standard_Real theScalar) { Divide(theScalar); }
+ constexpr void operator/=(const Standard_Real theScalar) { Divide(theScalar); }
//! Divides <me> by a real.
- Standard_NODISCARD gp_XY Divided(const Standard_Real theScalar) const
+ Standard_NODISCARD constexpr gp_XY Divided(const Standard_Real theScalar) const
{
return gp_XY(x / theScalar, y / theScalar);
}
- Standard_NODISCARD gp_XY operator/(const Standard_Real theScalar) const
+ Standard_NODISCARD constexpr gp_XY operator/(const Standard_Real theScalar) const
{
return Divided(theScalar);
}
//! Computes the scalar product between <me> and theOther
- Standard_Real Dot(const gp_XY& theOther) const { return x * theOther.x + y * theOther.y; }
+ constexpr Standard_Real Dot(const gp_XY& theOther) const noexcept
+ {
+ return x * theOther.x + y * theOther.y;
+ }
- Standard_Real operator*(const gp_XY& theOther) const { return Dot(theOther); }
+ constexpr Standard_Real operator*(const gp_XY& theOther) const noexcept { return Dot(theOther); }
//! @code
//! <me>.X() = <me>.X() * theScalar;
//! <me>.Y() = <me>.Y() * theScalar;
//! @endcode
- void Multiply(const Standard_Real theScalar)
+ constexpr void Multiply(const Standard_Real theScalar) noexcept
{
x *= theScalar;
y *= theScalar;
}
- void operator*=(const Standard_Real theScalar) { Multiply(theScalar); }
+ constexpr void operator*=(const Standard_Real theScalar) noexcept { Multiply(theScalar); }
//! @code
//! <me>.X() = <me>.X() * theOther.X();
//! <me>.Y() = <me>.Y() * theOther.Y();
//! @endcode
- void Multiply(const gp_XY& theOther)
+ constexpr void Multiply(const gp_XY& theOther) noexcept
{
x *= theOther.x;
y *= theOther.y;
}
- void operator*=(const gp_XY& theOther) { Multiply(theOther); }
+ constexpr void operator*=(const gp_XY& theOther) noexcept { Multiply(theOther); }
//! <me> = theMatrix * <me>
- void Multiply(const gp_Mat2d& theMatrix);
+ void Multiply(const gp_Mat2d& theMatrix) noexcept;
- void operator*=(const gp_Mat2d& theMatrix) { Multiply(theMatrix); }
+ void operator*=(const gp_Mat2d& theMatrix) noexcept { Multiply(theMatrix); }
//! @code
//! New.X() = <me>.X() * theScalar;
//! New.Y() = <me>.Y() * theScalar;
//! @endcode
- Standard_NODISCARD gp_XY Multiplied(const Standard_Real theScalar) const
+ Standard_NODISCARD constexpr gp_XY Multiplied(const Standard_Real theScalar) const noexcept
{
return gp_XY(x * theScalar, y * theScalar);
}
- Standard_NODISCARD gp_XY operator*(const Standard_Real theScalar) const
+ Standard_NODISCARD constexpr gp_XY operator*(const Standard_Real theScalar) const noexcept
{
return Multiplied(theScalar);
}
//! new.X() = <me>.X() * theOther.X();
//! new.Y() = <me>.Y() * theOther.Y();
//! @endcode
- Standard_NODISCARD gp_XY Multiplied(const gp_XY& theOther) const
+ Standard_NODISCARD constexpr gp_XY Multiplied(const gp_XY& theOther) const noexcept
{
return gp_XY(x * theOther.X(), y * theOther.Y());
}
//! New = theMatrix * <me>
- Standard_NODISCARD gp_XY Multiplied(const gp_Mat2d& theMatrix) const
+ Standard_NODISCARD gp_XY Multiplied(const gp_Mat2d& theMatrix) const noexcept
{
return gp_XY(theMatrix.myMat[0][0] * x + theMatrix.myMat[0][1] * y,
theMatrix.myMat[1][0] * x + theMatrix.myMat[1][1] * y);
}
- Standard_NODISCARD gp_XY operator*(const gp_Mat2d& theMatrix) const
+ Standard_NODISCARD gp_XY operator*(const gp_Mat2d& theMatrix) const noexcept
{
return Multiplied(theMatrix);
}
//! @code
//! <me>.X() = -<me>.X()
//! <me>.Y() = -<me>.Y()
- inline void Reverse()
+ constexpr void Reverse() noexcept
{
x = -x;
y = -y;
//! New.X() = -<me>.X()
//! New.Y() = -<me>.Y()
//! @endcode
- Standard_NODISCARD gp_XY Reversed() const
- {
- gp_XY aCoord2D = *this;
- aCoord2D.Reverse();
- return aCoord2D;
- }
+ Standard_NODISCARD constexpr gp_XY Reversed() const noexcept { return gp_XY(-x, -y); }
- Standard_NODISCARD gp_XY operator-() const { return Reversed(); }
+ Standard_NODISCARD constexpr gp_XY operator-() const noexcept { return Reversed(); }
//! Computes the following linear combination and
//! assigns the result to this number pair:
//! @code
//! theA1 * theXY1 + theA2 * theXY2
//! @endcode
- inline void SetLinearForm(const Standard_Real theA1,
- const gp_XY& theXY1,
- const Standard_Real theA2,
- const gp_XY& theXY2)
+ constexpr void SetLinearForm(const Standard_Real theA1,
+ const gp_XY& theXY1,
+ const Standard_Real theA2,
+ const gp_XY& theXY2) noexcept
{
x = theA1 * theXY1.x + theA2 * theXY2.x;
y = theA1 * theXY1.y + theA2 * theXY2.y;
//! @code
//! theA1 * theXY1 + theA2 * theXY2 + theXY3
//! @endcode
- inline void SetLinearForm(const Standard_Real theA1,
- const gp_XY& theXY1,
- const Standard_Real theA2,
- const gp_XY& theXY2,
- const gp_XY& theXY3)
+ constexpr void SetLinearForm(const Standard_Real theA1,
+ const gp_XY& theXY1,
+ const Standard_Real theA2,
+ const gp_XY& theXY2,
+ const gp_XY& theXY3) noexcept
{
x = theA1 * theXY1.x + theA2 * theXY2.x + theXY3.x;
y = theA1 * theXY1.y + theA2 * theXY2.y + theXY3.y;
//! @code
//! theA1 * theXY1 + theXY2
//! @endcode
- inline void SetLinearForm(const Standard_Real theA1, const gp_XY& theXY1, const gp_XY& theXY2)
+ constexpr void SetLinearForm(const Standard_Real theA1,
+ const gp_XY& theXY1,
+ const gp_XY& theXY2) noexcept
{
x = theA1 * theXY1.x + theXY2.x;
y = theA1 * theXY1.y + theXY2.y;
//! @code
//! theXY1 + theXY2
//! @endcode
- inline void SetLinearForm(const gp_XY& theXY1, const gp_XY& theXY2)
+ constexpr void SetLinearForm(const gp_XY& theXY1, const gp_XY& theXY2) noexcept
{
x = theXY1.x + theXY2.x;
y = theXY1.y + theXY2.y;
//! <me>.X() = <me>.X() - theOther.X()
//! <me>.Y() = <me>.Y() - theOther.Y()
//! @endcode
- inline void Subtract(const gp_XY& theOther)
+ constexpr void Subtract(const gp_XY& theOther) noexcept
{
x -= theOther.x;
y -= theOther.y;
}
- void operator-=(const gp_XY& theOther) { Subtract(theOther); }
+ constexpr void operator-=(const gp_XY& theOther) noexcept { Subtract(theOther); }
//! @code
//! new.X() = <me>.X() - theOther.X()
//! new.Y() = <me>.Y() - theOther.Y()
//! @endcode
- Standard_NODISCARD gp_XY Subtracted(const gp_XY& theOther) const
+ Standard_NODISCARD constexpr gp_XY Subtracted(const gp_XY& theOther) const noexcept
{
- gp_XY aCoord2D = *this;
- aCoord2D.Subtract(theOther);
- return aCoord2D;
+ return gp_XY(x - theOther.x, y - theOther.y);
}
- Standard_NODISCARD gp_XY operator-(const gp_XY& theOther) const { return Subtracted(theOther); }
+ Standard_NODISCARD constexpr gp_XY operator-(const gp_XY& theOther) const noexcept
+ {
+ return Subtracted(theOther);
+ }
private:
Standard_Real x;
//=================================================================================================
-inline void gp_XY::Multiply(const gp_Mat2d& theMatrix)
+inline void gp_XY::Multiply(const gp_Mat2d& theMatrix) noexcept
{
const Standard_Real aXresult = theMatrix.myMat[0][0] * x + theMatrix.myMat[0][1] * y;
y = theMatrix.myMat[1][0] * x + theMatrix.myMat[1][1] * y;
// function : operator*
// purpose :
//=======================================================================
-inline gp_XY operator*(const gp_Mat2d& theMatrix, const gp_XY& theCoord1)
+inline gp_XY operator*(const gp_Mat2d& theMatrix, const gp_XY& theCoord1) noexcept
{
return theCoord1.Multiplied(theMatrix);
}
// function : operator*
// purpose :
//=======================================================================
-inline gp_XY operator*(const Standard_Real theScalar, const gp_XY& theCoord1)
+inline constexpr gp_XY operator*(const Standard_Real theScalar, const gp_XY& theCoord1) noexcept
{
return theCoord1.Multiplied(theScalar);
}
DEFINE_STANDARD_ALLOC
//! Creates an XYZ object with zero coordinates (0,0,0)
- gp_XYZ()
+ constexpr gp_XYZ() noexcept
: x(0.),
y(0.),
z(0.)
}
//! creates an XYZ with given coordinates
- gp_XYZ(const Standard_Real theX, const Standard_Real theY, const Standard_Real theZ)
+ constexpr gp_XYZ(const Standard_Real theX,
+ const Standard_Real theY,
+ const Standard_Real theZ) noexcept
: x(theX),
y(theY),
z(theZ)
//! For this XYZ object, assigns
//! the values theX, theY and theZ to its three coordinates
- void SetCoord(const Standard_Real theX, const Standard_Real theY, const Standard_Real theZ)
+ constexpr void SetCoord(const Standard_Real theX,
+ const Standard_Real theY,
+ const Standard_Real theZ) noexcept
{
x = theX;
y = theY;
}
//! Assigns the given value to the X coordinate
- void SetX(const Standard_Real theX) { x = theX; }
+ constexpr void SetX(const Standard_Real theX) noexcept { x = theX; }
//! Assigns the given value to the Y coordinate
- void SetY(const Standard_Real theY) { y = theY; }
+ constexpr void SetY(const Standard_Real theY) noexcept { y = theY; }
//! Assigns the given value to the Z coordinate
- void SetZ(const Standard_Real theZ) { z = theZ; }
+ constexpr void SetZ(const Standard_Real theZ) noexcept { z = theZ; }
//! returns the coordinate of range theIndex :
//! theIndex = 1 => X is returned
return (&x)[theIndex - 1];
}
- void Coord(Standard_Real& theX, Standard_Real& theY, Standard_Real& theZ) const
+ constexpr void Coord(Standard_Real& theX, Standard_Real& theY, Standard_Real& theZ) const noexcept
{
theX = x;
theY = y;
//! Returns a const ptr to coordinates location.
//! Is useful for algorithms, but DOES NOT PERFORM
//! ANY CHECKS!
- const Standard_Real* GetData() const { return (&x); }
+ constexpr const Standard_Real* GetData() const noexcept { return (&x); }
//! Returns a ptr to coordinates location.
//! Is useful for algorithms, but DOES NOT PERFORM
//! ANY CHECKS!
- Standard_Real* ChangeData() { return (&x); }
+ Standard_Real* ChangeData() noexcept { return (&x); }
//! Returns the X coordinate
- Standard_Real X() const { return x; }
+ constexpr Standard_Real X() const noexcept { return x; }
//! Returns the Y coordinate
- Standard_Real Y() const { return y; }
+ constexpr Standard_Real Y() const noexcept { return y; }
//! Returns the Z coordinate
- Standard_Real Z() const { return z; }
+ constexpr Standard_Real Z() const noexcept { return z; }
//! computes Sqrt (X*X + Y*Y + Z*Z) where X, Y and Z are the three coordinates of this XYZ object.
Standard_Real Modulus() const { return sqrt(x * x + y * y + z * z); }
//! Computes X*X + Y*Y + Z*Z where X, Y and Z are the three coordinates of this XYZ object.
- Standard_Real SquareModulus() const { return (x * x + y * y + z * z); }
+ constexpr Standard_Real SquareModulus() const noexcept { return (x * x + y * y + z * z); }
//! Returns True if he coordinates of this XYZ object are
//! equal to the respective coordinates Other,
//! <me>.Y() = <me>.Y() + theOther.Y()
//! <me>.Z() = <me>.Z() + theOther.Z()
//! @endcode
- void Add(const gp_XYZ& theOther)
+ constexpr void Add(const gp_XYZ& theOther) noexcept
{
x += theOther.x;
y += theOther.y;
z += theOther.z;
}
- void operator+=(const gp_XYZ& theOther) { Add(theOther); }
+ constexpr void operator+=(const gp_XYZ& theOther) noexcept { Add(theOther); }
//! @code
//! new.X() = <me>.X() + theOther.X()
//! new.Y() = <me>.Y() + theOther.Y()
//! new.Z() = <me>.Z() + theOther.Z()
//! @endcode
- Standard_NODISCARD gp_XYZ Added(const gp_XYZ& theOther) const
+ Standard_NODISCARD constexpr gp_XYZ Added(const gp_XYZ& theOther) const noexcept
{
return gp_XYZ(x + theOther.x, y + theOther.y, z + theOther.z);
}
- Standard_NODISCARD gp_XYZ operator+(const gp_XYZ& theOther) const { return Added(theOther); }
+ Standard_NODISCARD constexpr gp_XYZ operator+(const gp_XYZ& theOther) const noexcept
+ {
+ return Added(theOther);
+ }
//! @code
//! <me>.X() = <me>.Y() * theOther.Z() - <me>.Z() * theOther.Y()
//! <me>.Y() = <me>.Z() * theOther.X() - <me>.X() * theOther.Z()
//! <me>.Z() = <me>.X() * theOther.Y() - <me>.Y() * theOther.X()
//! @endcode
- void Cross(const gp_XYZ& theOther);
+ constexpr void Cross(const gp_XYZ& theOther) noexcept;
- void operator^=(const gp_XYZ& theOther) { Cross(theOther); }
+ constexpr void operator^=(const gp_XYZ& theOther) noexcept { Cross(theOther); }
//! @code
//! new.X() = <me>.Y() * theOther.Z() - <me>.Z() * theOther.Y()
//! new.Y() = <me>.Z() * theOther.X() - <me>.X() * theOther.Z()
//! new.Z() = <me>.X() * theOther.Y() - <me>.Y() * theOther.X()
//! @endcode
- Standard_NODISCARD gp_XYZ Crossed(const gp_XYZ& theOther) const
+ Standard_NODISCARD constexpr gp_XYZ Crossed(const gp_XYZ& theOther) const noexcept
{
return gp_XYZ(y * theOther.z - z * theOther.y,
z * theOther.x - x * theOther.z,
x * theOther.y - y * theOther.x);
}
- Standard_NODISCARD gp_XYZ operator^(const gp_XYZ& theOther) const { return Crossed(theOther); }
+ Standard_NODISCARD constexpr gp_XYZ operator^(const gp_XYZ& theOther) const noexcept
+ {
+ return Crossed(theOther);
+ }
//! Computes the magnitude of the cross product between <me> and
//! theRight. Returns || <me> ^ theRight ||
//! Computes the square magnitude of the cross product between <me> and
//! theRight. Returns || <me> ^ theRight ||**2
- Standard_Real CrossSquareMagnitude(const gp_XYZ& theRight) const;
+ constexpr Standard_Real CrossSquareMagnitude(const gp_XYZ& theRight) const noexcept;
//! Triple vector product
//! Computes <me> = <me>.Cross(theCoord1.Cross(theCoord2))
- void CrossCross(const gp_XYZ& theCoord1, const gp_XYZ& theCoord2);
+ constexpr void CrossCross(const gp_XYZ& theCoord1, const gp_XYZ& theCoord2) noexcept;
//! Triple vector product
//! computes New = <me>.Cross(theCoord1.Cross(theCoord2))
- Standard_NODISCARD gp_XYZ CrossCrossed(const gp_XYZ& theCoord1, const gp_XYZ& theCoord2) const
+ Standard_NODISCARD constexpr gp_XYZ CrossCrossed(const gp_XYZ& theCoord1,
+ const gp_XYZ& theCoord2) const noexcept
{
gp_XYZ aCoord0 = *this;
aCoord0.CrossCross(theCoord1, theCoord2);
}
//! divides <me> by a real.
- void Divide(const Standard_Real theScalar)
+ constexpr void Divide(const Standard_Real theScalar)
{
x /= theScalar;
y /= theScalar;
z /= theScalar;
}
- void operator/=(const Standard_Real theScalar) { Divide(theScalar); }
+ constexpr void operator/=(const Standard_Real theScalar) { Divide(theScalar); }
//! divides <me> by a real.
- Standard_NODISCARD gp_XYZ Divided(const Standard_Real theScalar) const
+ Standard_NODISCARD constexpr gp_XYZ Divided(const Standard_Real theScalar) const
{
return gp_XYZ(x / theScalar, y / theScalar, z / theScalar);
}
- Standard_NODISCARD gp_XYZ operator/(const Standard_Real theScalar) const
+ Standard_NODISCARD constexpr gp_XYZ operator/(const Standard_Real theScalar) const
{
return Divided(theScalar);
}
//! computes the scalar product between <me> and theOther
- Standard_Real Dot(const gp_XYZ& theOther) const
+ constexpr Standard_Real Dot(const gp_XYZ& theOther) const noexcept
{
return (x * theOther.x + y * theOther.y + z * theOther.z);
}
- Standard_Real operator*(const gp_XYZ& theOther) const { return Dot(theOther); }
+ constexpr Standard_Real operator*(const gp_XYZ& theOther) const noexcept { return Dot(theOther); }
//! computes the triple scalar product
- Standard_Real DotCross(const gp_XYZ& theCoord1, const gp_XYZ& theCoord2) const;
+ constexpr Standard_Real DotCross(const gp_XYZ& theCoord1, const gp_XYZ& theCoord2) const noexcept;
//! @code
//! <me>.X() = <me>.X() * theScalar;
//! <me>.Y() = <me>.Y() * theScalar;
//! <me>.Z() = <me>.Z() * theScalar;
//! @endcode
- void Multiply(const Standard_Real theScalar)
+ constexpr void Multiply(const Standard_Real theScalar) noexcept
{
x *= theScalar;
y *= theScalar;
z *= theScalar;
}
- void operator*=(const Standard_Real theScalar) { Multiply(theScalar); }
+ constexpr void operator*=(const Standard_Real theScalar) noexcept { Multiply(theScalar); }
//! @code
//! <me>.X() = <me>.X() * theOther.X();
//! <me>.Y() = <me>.Y() * theOther.Y();
//! <me>.Z() = <me>.Z() * theOther.Z();
//! @endcode
- void Multiply(const gp_XYZ& theOther)
+ constexpr void Multiply(const gp_XYZ& theOther) noexcept
{
x *= theOther.x;
y *= theOther.y;
z *= theOther.z;
}
- void operator*=(const gp_XYZ& theOther) { Multiply(theOther); }
+ constexpr void operator*=(const gp_XYZ& theOther) noexcept { Multiply(theOther); }
//! <me> = theMatrix * <me>
- void Multiply(const gp_Mat& theMatrix);
+ void Multiply(const gp_Mat& theMatrix) noexcept;
- void operator*=(const gp_Mat& theMatrix) { Multiply(theMatrix); }
+ void operator*=(const gp_Mat& theMatrix) noexcept { Multiply(theMatrix); }
//! @code
//! New.X() = <me>.X() * theScalar;
//! New.Y() = <me>.Y() * theScalar;
//! New.Z() = <me>.Z() * theScalar;
//! @endcode
- Standard_NODISCARD gp_XYZ Multiplied(const Standard_Real theScalar) const
+ Standard_NODISCARD constexpr gp_XYZ Multiplied(const Standard_Real theScalar) const noexcept
{
return gp_XYZ(x * theScalar, y * theScalar, z * theScalar);
}
- Standard_NODISCARD gp_XYZ operator*(const Standard_Real theScalar) const
+ Standard_NODISCARD constexpr gp_XYZ operator*(const Standard_Real theScalar) const noexcept
{
return Multiplied(theScalar);
}
//! new.Y() = <me>.Y() * theOther.Y();
//! new.Z() = <me>.Z() * theOther.Z();
//! @endcode
- Standard_NODISCARD gp_XYZ Multiplied(const gp_XYZ& theOther) const
+ Standard_NODISCARD constexpr gp_XYZ Multiplied(const gp_XYZ& theOther) const noexcept
{
return gp_XYZ(x * theOther.x, y * theOther.y, z * theOther.z);
}
//! New = theMatrix * <me>
- Standard_NODISCARD gp_XYZ Multiplied(const gp_Mat& theMatrix) const
+ Standard_NODISCARD gp_XYZ Multiplied(const gp_Mat& theMatrix) const noexcept
{
// Direct access to matrix data for optimal performance (gp_XYZ is friend of gp_Mat)
return gp_XYZ(theMatrix.myMat[0][0] * x + theMatrix.myMat[0][1] * y + theMatrix.myMat[0][2] * z,
+ theMatrix.myMat[2][2] * z);
}
- Standard_NODISCARD gp_XYZ operator*(const gp_Mat& theMatrix) const
+ Standard_NODISCARD gp_XYZ operator*(const gp_Mat& theMatrix) const noexcept
{
return Multiplied(theMatrix);
}
//! <me>.Y() = -<me>.Y()
//! <me>.Z() = -<me>.Z()
//! @endcode
- void Reverse()
+ constexpr void Reverse() noexcept
{
x = -x;
y = -y;
//! New.Y() = -<me>.Y()
//! New.Z() = -<me>.Z()
//! @endcode
- Standard_NODISCARD gp_XYZ Reversed() const { return gp_XYZ(-x, -y, -z); }
+ Standard_NODISCARD constexpr gp_XYZ Reversed() const noexcept { return gp_XYZ(-x, -y, -z); }
//! @code
//! <me>.X() = <me>.X() - theOther.X()
//! <me>.Y() = <me>.Y() - theOther.Y()
//! <me>.Z() = <me>.Z() - theOther.Z()
//! @endcode
- void Subtract(const gp_XYZ& theOther)
+ constexpr void Subtract(const gp_XYZ& theOther) noexcept
{
x -= theOther.x;
y -= theOther.y;
z -= theOther.z;
}
- void operator-=(const gp_XYZ& theOther) { Subtract(theOther); }
+ constexpr void operator-=(const gp_XYZ& theOther) noexcept { Subtract(theOther); }
//! @code
//! new.X() = <me>.X() - theOther.X()
//! new.Y() = <me>.Y() - theOther.Y()
//! new.Z() = <me>.Z() - theOther.Z()
//! @endcode
- Standard_NODISCARD gp_XYZ Subtracted(const gp_XYZ& theOther) const
+ Standard_NODISCARD constexpr gp_XYZ Subtracted(const gp_XYZ& theOther) const noexcept
{
return gp_XYZ(x - theOther.x, y - theOther.y, z - theOther.z);
}
- Standard_NODISCARD gp_XYZ operator-(const gp_XYZ& theOther) const { return Subtracted(theOther); }
+ Standard_NODISCARD constexpr gp_XYZ operator-(const gp_XYZ& theOther) const noexcept
+ {
+ return Subtracted(theOther);
+ }
//! <me> is set to the following linear form :
//! @code
//! theA1 * theXYZ1 + theA2 * theXYZ2 + theA3 * theXYZ3 + theXYZ4
//! @endcode
- void SetLinearForm(const Standard_Real theA1,
- const gp_XYZ& theXYZ1,
- const Standard_Real theA2,
- const gp_XYZ& theXYZ2,
- const Standard_Real theA3,
- const gp_XYZ& theXYZ3,
- const gp_XYZ& theXYZ4)
+ constexpr void SetLinearForm(const Standard_Real theA1,
+ const gp_XYZ& theXYZ1,
+ const Standard_Real theA2,
+ const gp_XYZ& theXYZ2,
+ const Standard_Real theA3,
+ const gp_XYZ& theXYZ3,
+ const gp_XYZ& theXYZ4) noexcept
{
x = theA1 * theXYZ1.x + theA2 * theXYZ2.x + theA3 * theXYZ3.x + theXYZ4.x;
y = theA1 * theXYZ1.y + theA2 * theXYZ2.y + theA3 * theXYZ3.y + theXYZ4.y;
//! @code
//! theA1 * theXYZ1 + theA2 * theXYZ2 + theA3 * theXYZ3
//! @endcode
- void SetLinearForm(const Standard_Real theA1,
- const gp_XYZ& theXYZ1,
- const Standard_Real theA2,
- const gp_XYZ& theXYZ2,
- const Standard_Real theA3,
- const gp_XYZ& theXYZ3)
+ constexpr void SetLinearForm(const Standard_Real theA1,
+ const gp_XYZ& theXYZ1,
+ const Standard_Real theA2,
+ const gp_XYZ& theXYZ2,
+ const Standard_Real theA3,
+ const gp_XYZ& theXYZ3) noexcept
{
x = theA1 * theXYZ1.x + theA2 * theXYZ2.x + theA3 * theXYZ3.x;
y = theA1 * theXYZ1.y + theA2 * theXYZ2.y + theA3 * theXYZ3.y;
//! @code
//! theA1 * theXYZ1 + theA2 * theXYZ2 + theXYZ3
//! @endcode
- void SetLinearForm(const Standard_Real theA1,
- const gp_XYZ& theXYZ1,
- const Standard_Real theA2,
- const gp_XYZ& theXYZ2,
- const gp_XYZ& theXYZ3)
+ constexpr void SetLinearForm(const Standard_Real theA1,
+ const gp_XYZ& theXYZ1,
+ const Standard_Real theA2,
+ const gp_XYZ& theXYZ2,
+ const gp_XYZ& theXYZ3) noexcept
{
x = theA1 * theXYZ1.x + theA2 * theXYZ2.x + theXYZ3.x;
y = theA1 * theXYZ1.y + theA2 * theXYZ2.y + theXYZ3.y;
//! @code
//! theA1 * theXYZ1 + theA2 * theXYZ2
//! @endcode
- void SetLinearForm(const Standard_Real theA1,
- const gp_XYZ& theXYZ1,
- const Standard_Real theA2,
- const gp_XYZ& theXYZ2)
+ constexpr void SetLinearForm(const Standard_Real theA1,
+ const gp_XYZ& theXYZ1,
+ const Standard_Real theA2,
+ const gp_XYZ& theXYZ2) noexcept
{
x = theA1 * theXYZ1.x + theA2 * theXYZ2.x;
y = theA1 * theXYZ1.y + theA2 * theXYZ2.y;
//! @code
//! theA1 * theXYZ1 + theXYZ2
//! @endcode
- void SetLinearForm(const Standard_Real theA1, const gp_XYZ& theXYZ1, const gp_XYZ& theXYZ2)
+ constexpr void SetLinearForm(const Standard_Real theA1,
+ const gp_XYZ& theXYZ1,
+ const gp_XYZ& theXYZ2) noexcept
{
x = theA1 * theXYZ1.x + theXYZ2.x;
y = theA1 * theXYZ1.y + theXYZ2.y;
//! @code
//! theXYZ1 + theXYZ2
//! @endcode
- void SetLinearForm(const gp_XYZ& theXYZ1, const gp_XYZ& theXYZ2)
+ constexpr void SetLinearForm(const gp_XYZ& theXYZ1, const gp_XYZ& theXYZ2) noexcept
{
x = theXYZ1.x + theXYZ2.x;
y = theXYZ1.y + theXYZ2.y;
//=================================================================================================
-inline void gp_XYZ::Cross(const gp_XYZ& theRight)
+inline constexpr void gp_XYZ::Cross(const gp_XYZ& theRight) noexcept
{
const Standard_Real aXresult = y * theRight.z - z * theRight.y;
const Standard_Real aYresult = z * theRight.x - x * theRight.z;
//=================================================================================================
-inline Standard_Real gp_XYZ::CrossSquareMagnitude(const gp_XYZ& theRight) const
+inline constexpr Standard_Real gp_XYZ::CrossSquareMagnitude(const gp_XYZ& theRight) const noexcept
{
const Standard_Real aXresult = y * theRight.z - z * theRight.y;
const Standard_Real aYresult = z * theRight.x - x * theRight.z;
//=================================================================================================
-inline void gp_XYZ::CrossCross(const gp_XYZ& theCoord1, const gp_XYZ& theCoord2)
+inline constexpr void gp_XYZ::CrossCross(const gp_XYZ& theCoord1, const gp_XYZ& theCoord2) noexcept
{
// First compute theCoord1 * theCoord2
const Standard_Real aCrossX = theCoord1.y * theCoord2.z - theCoord1.z * theCoord2.y;
//=================================================================================================
-inline Standard_Real gp_XYZ::DotCross(const gp_XYZ& theCoord1, const gp_XYZ& theCoord2) const
+inline constexpr Standard_Real gp_XYZ::DotCross(const gp_XYZ& theCoord1,
+ const gp_XYZ& theCoord2) const noexcept
{
const Standard_Real aXresult = theCoord1.y * theCoord2.z - theCoord1.z * theCoord2.y;
const Standard_Real anYresult = theCoord1.z * theCoord2.x - theCoord1.x * theCoord2.z;
//=================================================================================================
-inline void gp_XYZ::Multiply(const gp_Mat& theMatrix)
+inline void gp_XYZ::Multiply(const gp_Mat& theMatrix) noexcept
{
// Cache original coordinates to avoid aliasing issues
const Standard_Real aOrigX = x;
// function : operator*
// purpose :
//=======================================================================
-inline gp_XYZ operator*(const gp_Mat& theMatrix, const gp_XYZ& theCoord1)
+inline gp_XYZ operator*(const gp_Mat& theMatrix, const gp_XYZ& theCoord1) noexcept
{
return theCoord1.Multiplied(theMatrix);
}
// function : operator*
// purpose :
//=======================================================================
-inline gp_XYZ operator*(const Standard_Real theScalar, const gp_XYZ& theCoord1)
+inline constexpr gp_XYZ operator*(const Standard_Real theScalar, const gp_XYZ& theCoord1) noexcept
{
return theCoord1.Multiplied(theScalar);
}
Standard_Boolean bRet;
Standard_Integer nV, iFlag;
Standard_Real aTolCheck;
- gp_Pnt aPV;
Bnd_Box aBoxP;
TColStd_MapIteratorOfMapOfInteger aIt;
//
Standard_Boolean bRet, bIsComputed;
Standard_Real aT, aT1, aT2, aAngle, aTwoPI, aAngleMin, aDt3D;
Standard_Real aUmin, aUsup, aVmin, aVsup;
- gp_Pnt aPn1, aPn2, aPx;
+ gp_Pnt aPx;
gp_Dir aDN1, aDN2, aDBF, aDBF2, aDTF;
gp_Vec aVTgt;
TopAbs_Orientation aOr;
// reorganize the wires respecting orientation and origin
TopoDS_Vertex Vdeb, Vfin;
- gp_Pnt Pdeb, Psuiv, PPs;
BRepTools_WireExplorer anExp;
}
#ifdef OCCT_DEBUG_EFV
+ gp_Pnt PPs;
+ gp_Pnt Pdeb, Psuiv;
+
for (i = ideb; i <= myWork.Length(); i++)
{
((anOr == TopAbs_FORWARD && isFirstEnd) || (anOr == TopAbs_REVERSED && !isFirstEnd));
Standard_Real dpar = (aLast - aFirst) * 0.01;
- gp_Pnt2d aP2d;
if (takeFirst)
{
aC2d->D0(aFirst, thePnt);
const Standard_Real v2,
IntSurf_PntOn2S& Point)
{
- gp_Pnt aP;
- gp_Vec aT;
- gp_Vec2d aTS1, aTS2;
const IntSurf_Quadric& aQSurf = MyZerImpFunc.ISurface();
const ThePSurface& aPSurf = MyZerImpFunc.PSurface();
{
gp_Vec V;
gp_Mat M;
- gp_Dir DT, DN, D;
+ gp_Dir DN, D;
// modified by NIZHNY-MKK Fri Oct 17 15:27:07 2003
gp_Pnt P(0., 0., 0.), PSection(0., 0., 0.);
// evaluate the Ax3 of the Sphere
// find 3 different vertices in LEdge
TopTools_ListIteratorOfListOfShape it;
- gp_Pnt P, P1, P2, P3;
TopoDS_Vertex V1, V2, V3, V4;
#ifdef OCCT_DEBUG
{
Standard_Boolean bTranslate;
Standard_Real aD2, aT1, aT2;
- gp_Pnt2d PF, NewPF, aP2DT;
+ gp_Pnt2d PF, NewPF;
gp_Vec2d aV2DT, vectra(2. * M_PI, 0.);
Handle(Geom2d_Curve) aC2DE;
//
> Vperiod / 2)) // end of parametric space
{
//<edges> do not contain seams => we must reconstruct the seam up to <NextEdge>
- gp_Pnt2d StartOfNextEdge;
- TopoDS_Vertex LastVertexOfSeam;
ReconstructMissedSeam(RemovedEdges,
F_RefFace,
CurEdge,
Standard_Real Udeb, Ufin;
BRep_Tool::Range(Eother, Udeb, Ufin);
- gp_Pnt P1, Pt;
+ gp_Pnt Pt;
Standard_Integer i, ii;
BRepClass_FaceClassifier classifier;
for (i = 1; i <= arrInter.Length(); i++)
TColStd_Array1OfReal arrInter(1, 1 + nbIntervals);
aAdaptorCurve.Intervals(arrInter, GeomAbs_C1);
- gp_Pnt Pt;
Standard_Real U, V;
const Standard_Real tol = BRep_Tool::Tolerance(theS2);
Handle(Graphic3d_ArrayOfSegments) anEdgeSegments =
new Graphic3d_ArrayOfSegments(aNbEdgePrimitives * 2);
- gp_Pnt P, Start;
Standard_Real aMin = gp::Resolution() * gp::Resolution();
gp_Dir aDefNorm(0., 0., 1.);
Handle(Prs3d_DimensionAspect) LA = aDrawer->DimensionAspect();
- gp_Pnt Ptmp, ptcur;
-
gp_Ax2 ax = aCircle.Position();
ax.SetLocation(MidPoint);
gp_Circ aCircleM(ax, rad);
aPrims = new Graphic3d_ArrayOfPolylines(nbp);
aPrims->AddVertex(AttachmentPoint1);
alphaIter = Dalpha;
- gp_Pnt PntIter;
Standard_Integer i;
for (i = 2; i <= nbp; i++, alphaIter += Dalpha)
aPrims->AddVertex(ElCLib::Value(ParamPAttach1 + alphaIter, aCircle1));
TopoDS_Face aFirstFace = TopoDS::Face(myFirstShape);
TopoDS_Face aSecondFace = TopoDS::Face(mySecondShape);
- gp_Dir aFirstDir, aSecondDir;
gp_Pln aFirstPln, aSecondPln;
Handle(Geom_Surface) aFirstBasisSurf, aSecondBasisSurf;
PrsDim_KindOfSurface aFirstSurfType, aSecondSurfType;
TopoDS_Face aFirstFace = TopoDS::Face(myFirstShape);
TopoDS_Face aSecondFace = TopoDS::Face(mySecondShape);
- gp_Dir aFirstDir, aSecondDir;
gp_Pln aFirstPln, aSecondPln;
Handle(Geom_Surface) aFirstBasisSurf, aSecondBasisSurf;
PrsDim_KindOfSurface aFirstSurfType, aSecondSurfType;