]> OCCT Git - occt.git/commitdiff
Foundation Classes, gp - Mark 2D geometry APIs noexcept/constexpr (#796)
authorPasukhin Dmitry <dpasukhi@opencascade.com>
Sun, 2 Nov 2025 21:02:53 +0000 (21:02 +0000)
committerGitHub <noreply@github.com>
Sun, 2 Nov 2025 21:02:53 +0000 (21:02 +0000)
- Added `noexcept` to transformation and mirroring methods across all 2D geometry classes
- Added `constexpr` to trivial getters, setters, and simple computational methods where applicable
- Removed an unused variable declaration in GeomInt_IntSS_1.cxx

23 files changed:
src/FoundationClasses/TKMath/gp/gp_Ax22d.cxx
src/FoundationClasses/TKMath/gp/gp_Ax22d.hxx
src/FoundationClasses/TKMath/gp/gp_Ax2d.cxx
src/FoundationClasses/TKMath/gp/gp_Ax2d.hxx
src/FoundationClasses/TKMath/gp/gp_Circ2d.cxx
src/FoundationClasses/TKMath/gp/gp_Circ2d.hxx
src/FoundationClasses/TKMath/gp/gp_Dir2d.cxx
src/FoundationClasses/TKMath/gp/gp_Dir2d.hxx
src/FoundationClasses/TKMath/gp/gp_Elips2d.cxx
src/FoundationClasses/TKMath/gp/gp_Elips2d.hxx
src/FoundationClasses/TKMath/gp/gp_Hypr2d.cxx
src/FoundationClasses/TKMath/gp/gp_Hypr2d.hxx
src/FoundationClasses/TKMath/gp/gp_Lin2d.cxx
src/FoundationClasses/TKMath/gp/gp_Lin2d.hxx
src/FoundationClasses/TKMath/gp/gp_Parab2d.cxx
src/FoundationClasses/TKMath/gp/gp_Parab2d.hxx
src/FoundationClasses/TKMath/gp/gp_Pnt2d.cxx
src/FoundationClasses/TKMath/gp/gp_Pnt2d.hxx
src/FoundationClasses/TKMath/gp/gp_Trsf2d.cxx
src/FoundationClasses/TKMath/gp/gp_Trsf2d.hxx
src/FoundationClasses/TKMath/gp/gp_Vec2d.cxx
src/FoundationClasses/TKMath/gp/gp_Vec2d.hxx
src/ModelingAlgorithms/TKGeomAlgo/GeomInt/GeomInt_IntSS_1.cxx

index 6ecf238d3168634778567486091a9713bea476a7..871471ec5a83f5f473baddda38cb962348dc33b8 100644 (file)
@@ -26,7 +26,7 @@
 #include <gp_Vec2d.hxx>
 #include <Standard_Dump.hxx>
 
-void gp_Ax22d::Mirror(const gp_Pnt2d& P)
+void gp_Ax22d::Mirror(const gp_Pnt2d& P) noexcept
 {
   gp_Pnt2d Temp = point;
   Temp.Mirror(P);
@@ -35,14 +35,14 @@ void gp_Ax22d::Mirror(const gp_Pnt2d& P)
   vydir.Reverse();
 }
 
-gp_Ax22d gp_Ax22d::Mirrored(const gp_Pnt2d& P) const
+gp_Ax22d gp_Ax22d::Mirrored(const gp_Pnt2d& P) const noexcept
 {
   gp_Ax22d Temp = *this;
   Temp.Mirror(P);
   return Temp;
 }
 
-void gp_Ax22d::Mirror(const gp_Ax2d& A1)
+void gp_Ax22d::Mirror(const gp_Ax2d& A1) noexcept
 {
   vydir.Mirror(A1);
   vxdir.Mirror(A1);
@@ -51,7 +51,7 @@ void gp_Ax22d::Mirror(const gp_Ax2d& A1)
   point = Temp;
 }
 
-gp_Ax22d gp_Ax22d::Mirrored(const gp_Ax2d& A1) const
+gp_Ax22d gp_Ax22d::Mirrored(const gp_Ax2d& A1) const noexcept
 {
   gp_Ax22d Temp = *this;
   Temp.Mirror(A1);
index aa852db6e41f694b26540eb5a0ab45951ce98bdb..1690deaf0055ea2df8d5b8c36f5692f6dac13af4 100644 (file)
@@ -167,7 +167,7 @@ public:
   //! Returns the "YDirection" of <me>.
   constexpr const gp_Dir2d& YDirection() const noexcept { return vydir; }
 
-  Standard_EXPORT void Mirror(const gp_Pnt2d& theP);
+  Standard_EXPORT void Mirror(const gp_Pnt2d& theP) noexcept;
 
   //! Performs the symmetrical transformation of an axis
   //! placement with respect to the point theP which is the
@@ -176,9 +176,9 @@ public:
   //! The main direction of the axis placement is not changed.
   //! The "XDirection" and the "YDirection" are reversed.
   //! So the axis placement stay right handed.
-  Standard_NODISCARD Standard_EXPORT gp_Ax22d Mirrored(const gp_Pnt2d& theP) const;
+  Standard_NODISCARD Standard_EXPORT gp_Ax22d Mirrored(const gp_Pnt2d& theP) const noexcept;
 
-  Standard_EXPORT void Mirror(const gp_Ax2d& theA);
+  Standard_EXPORT void Mirror(const gp_Ax2d& theA) noexcept;
 
   //! Performs the symmetrical transformation of an axis
   //! placement with respect to an axis placement which
@@ -187,7 +187,7 @@ public:
   //! point, on the "XDirection" and "YDirection".
   //! The resulting main "Direction" is the cross product between
   //! the "XDirection" and the "YDirection" after transformation.
-  Standard_NODISCARD Standard_EXPORT gp_Ax22d Mirrored(const gp_Ax2d& theA) const;
+  Standard_NODISCARD Standard_EXPORT gp_Ax22d Mirrored(const gp_Ax2d& theA) const noexcept;
 
   void Rotate(const gp_Pnt2d& theP, const Standard_Real theAng);
 
@@ -217,7 +217,7 @@ public:
     return aTemp;
   }
 
-  void Transform(const gp_Trsf2d& theT);
+  void Transform(const gp_Trsf2d& theT) noexcept;
 
   //! Transforms an axis placement with a Trsf.
   //! The "Location" point, the "XDirection" and the
@@ -358,7 +358,7 @@ inline void gp_Ax22d::Scale(const gp_Pnt2d& theP, const Standard_Real theS)
 
 //=================================================================================================
 
-inline void gp_Ax22d::Transform(const gp_Trsf2d& theT)
+inline void gp_Ax22d::Transform(const gp_Trsf2d& theT) noexcept
 {
   gp_Pnt2d aTemp = point;
   aTemp.Transform(theT);
index 2b170fca004082752a300ab1eba7f5d27cbef28a..0ec58d86150ad1853710652c13cffe074acdea2b 100644 (file)
@@ -51,26 +51,26 @@ void gp_Ax2d::Scale(const gp_Pnt2d& P, const Standard_Real S)
     vdir.Reverse();
 }
 
-void gp_Ax2d::Mirror(const gp_Pnt2d& P)
+void gp_Ax2d::Mirror(const gp_Pnt2d& P) noexcept
 {
   loc.Mirror(P);
   vdir.Reverse();
 }
 
-gp_Ax2d gp_Ax2d::Mirrored(const gp_Pnt2d& P) const
+gp_Ax2d gp_Ax2d::Mirrored(const gp_Pnt2d& P) const noexcept
 {
   gp_Ax2d A = *this;
   A.Mirror(P);
   return A;
 }
 
-void gp_Ax2d::Mirror(const gp_Ax2d& A)
+void gp_Ax2d::Mirror(const gp_Ax2d& A) noexcept
 {
   loc.Mirror(A);
   vdir.Mirror(A.vdir);
 }
 
-gp_Ax2d gp_Ax2d::Mirrored(const gp_Ax2d& A) const
+gp_Ax2d gp_Ax2d::Mirrored(const gp_Ax2d& A) const noexcept
 {
   gp_Ax2d AA = *this;
   AA.Mirror(A);
index ec8f2f106cd38e79953a4255f5bc0a10e99cf5a2..87b0c1db4755e28a9f1403c11bd1cb471efd19de 100644 (file)
@@ -125,19 +125,19 @@ public:
     return aTemp;
   }
 
-  Standard_EXPORT void Mirror(const gp_Pnt2d& P);
+  Standard_EXPORT void Mirror(const gp_Pnt2d& P) noexcept;
 
   //! Performs the symmetrical transformation of an axis
   //! placement with respect to the point P which is the
   //! center of the symmetry.
-  Standard_NODISCARD Standard_EXPORT gp_Ax2d Mirrored(const gp_Pnt2d& P) const;
+  Standard_NODISCARD Standard_EXPORT gp_Ax2d Mirrored(const gp_Pnt2d& P) const noexcept;
 
-  Standard_EXPORT void Mirror(const gp_Ax2d& A);
+  Standard_EXPORT void Mirror(const gp_Ax2d& A) noexcept;
 
   //! Performs the symmetrical transformation of an axis
   //! placement with respect to an axis placement which
   //! is the axis of the symmetry.
-  Standard_NODISCARD Standard_EXPORT gp_Ax2d Mirrored(const gp_Ax2d& A) const;
+  Standard_NODISCARD Standard_EXPORT gp_Ax2d Mirrored(const gp_Ax2d& A) const noexcept;
 
   void Rotate(const gp_Pnt2d& theP, const Standard_Real theAng)
   {
index bc5f22d4f9f76afb916f1b1c62cf59c90ea2da85..839ee20bc1f0d2db1791182554f23776a9692a89 100644 (file)
 #include <gp_Ax22d.hxx>
 #include <gp_Pnt2d.hxx>
 
-void gp_Circ2d::Mirror(const gp_Pnt2d& P)
+void gp_Circ2d::Mirror(const gp_Pnt2d& P) noexcept
 {
   pos.Mirror(P);
 }
 
-gp_Circ2d gp_Circ2d::Mirrored(const gp_Pnt2d& P) const
+gp_Circ2d gp_Circ2d::Mirrored(const gp_Pnt2d& P) const noexcept
 {
   gp_Circ2d C = *this;
   C.pos.Mirror(P);
   return C;
 }
 
-void gp_Circ2d::Mirror(const gp_Ax2d& A)
+void gp_Circ2d::Mirror(const gp_Ax2d& A) noexcept
 {
   pos.Mirror(A);
 }
 
-gp_Circ2d gp_Circ2d::Mirrored(const gp_Ax2d& A) const
+gp_Circ2d gp_Circ2d::Mirrored(const gp_Ax2d& A) const noexcept
 {
   gp_Circ2d C = *this;
   C.pos.Mirror(A);
index 63d14ca649957400332e676a3298237d283a422c..df9686bdebefcb446b7bb8971bfa0434344c3860 100644 (file)
@@ -52,7 +52,7 @@ public:
   DEFINE_STANDARD_ALLOC
 
   //! creates an indefinite circle.
-  gp_Circ2d()
+  gp_Circ2d() noexcept
       : radius(RealLast())
   {
   }
@@ -86,13 +86,13 @@ public:
   }
 
   //! Changes the location point (center) of the circle.
-  void SetLocation(const gp_Pnt2d& theP) { pos.SetLocation(theP); }
+  constexpr void SetLocation(const gp_Pnt2d& theP) noexcept { pos.SetLocation(theP); }
 
   //! Changes the X axis of the circle.
   void SetXAxis(const gp_Ax2d& theA) { pos.SetXAxis(theA); }
 
   //! Changes the X axis of the circle.
-  void SetAxis(const gp_Ax22d& theA) { pos.SetAxis(theA); }
+  constexpr void SetAxis(const gp_Ax22d& theA) noexcept { pos.SetAxis(theA); }
 
   //! Changes the Y axis of the circle.
   void SetYAxis(const gp_Ax2d& theA) { pos.SetYAxis(theA); }
@@ -111,61 +111,62 @@ public:
   }
 
   //! Computes the area of the circle.
-  Standard_Real Area() const { return M_PI * radius * radius; }
+  constexpr Standard_Real Area() const noexcept { return M_PI * radius * radius; }
 
   //! Returns the normalized coefficients from the implicit equation
   //! of the circle :
   //! theA * (X**2) + theB * (Y**2) + 2*theC*(X*Y) + 2*theD*X + 2*theE*Y + theF = 0.0
-  void Coefficients(Standard_Real& theA,
-                    Standard_Real& theB,
-                    Standard_Real& theC,
-                    Standard_Real& theD,
-                    Standard_Real& theE,
-                    Standard_Real& theF) const;
+  constexpr void Coefficients(Standard_Real& theA,
+                              Standard_Real& theB,
+                              Standard_Real& theC,
+                              Standard_Real& theD,
+                              Standard_Real& theE,
+                              Standard_Real& theF) const noexcept;
 
   //! Does <me> contain theP ?
   //! Returns True if the distance between theP and any point on
   //! the circumference of the circle is lower of equal to
   //! <theLinearTolerance>.
-  Standard_Boolean Contains(const gp_Pnt2d& theP, const Standard_Real theLinearTolerance) const
+  Standard_Boolean Contains(const gp_Pnt2d&     theP,
+                            const Standard_Real theLinearTolerance) const noexcept
   {
     return Distance(theP) <= theLinearTolerance;
   }
 
   //! Computes the minimum of distance between the point theP and any
   //! point on the circumference of the circle.
-  Standard_Real Distance(const gp_Pnt2d& theP) const;
+  Standard_Real Distance(const gp_Pnt2d& theP) const noexcept;
 
   //! Computes the square distance between <me> and the point theP.
-  Standard_Real SquareDistance(const gp_Pnt2d& theP) const;
+  Standard_Real SquareDistance(const gp_Pnt2d& theP) const noexcept;
 
   //! computes the circumference of the circle.
-  Standard_Real Length() const { return 2. * M_PI * radius; }
+  constexpr Standard_Real Length() const noexcept { return 2. * M_PI * radius; }
 
   //! Returns the location point (center) of the circle.
-  const gp_Pnt2d& Location() const { return pos.Location(); }
+  constexpr const gp_Pnt2d& Location() const noexcept { return pos.Location(); }
 
   //! Returns the radius value of the circle.
-  Standard_Real Radius() const { return radius; }
+  constexpr Standard_Real Radius() const noexcept { return radius; }
 
   //! returns the position of the circle.
-  const gp_Ax22d& Axis() const { return pos; }
+  constexpr const gp_Ax22d& Axis() const noexcept { return pos; }
 
   //! returns the position of the circle. Idem Axis(me).
-  const gp_Ax22d& Position() const { return pos; }
+  constexpr const gp_Ax22d& Position() const noexcept { return pos; }
 
   //! returns the X axis of the circle.
-  gp_Ax2d XAxis() const { return gp_Ax2d(pos.XAxis()); }
+  gp_Ax2d XAxis() const noexcept { return gp_Ax2d(pos.XAxis()); }
 
   //! Returns the Y axis of the circle.
   //! Reverses the direction of the circle.
-  gp_Ax2d YAxis() const { return gp_Ax2d(pos.YAxis()); }
+  gp_Ax2d YAxis() const noexcept { return gp_Ax2d(pos.YAxis()); }
 
   //! Reverses the orientation of the local coordinate system
   //! of this circle (the "Y Direction" is reversed) and therefore
   //! changes the implicit orientation of this circle.
   //! Reverse assigns the result to this circle,
-  void Reverse()
+  void Reverse() noexcept
   {
     gp_Dir2d aTemp = pos.YDirection();
     aTemp.Reverse();
@@ -176,23 +177,26 @@ public:
   //! of this circle (the "Y Direction" is reversed) and therefore
   //! changes the implicit orientation of this circle.
   //! Reversed creates a new circle.
-  Standard_NODISCARD gp_Circ2d Reversed() const;
+  Standard_NODISCARD gp_Circ2d Reversed() const noexcept;
 
   //! Returns true if the local coordinate system is direct
   //! and false in the other case.
-  Standard_Boolean IsDirect() const { return (pos.XDirection().Crossed(pos.YDirection())) >= 0.0; }
+  constexpr Standard_Boolean IsDirect() const noexcept
+  {
+    return (pos.XDirection().Crossed(pos.YDirection())) >= 0.0;
+  }
 
-  Standard_EXPORT void Mirror(const gp_Pnt2d& theP);
+  Standard_EXPORT void Mirror(const gp_Pnt2d& theP) noexcept;
 
   //! Performs the symmetrical transformation of a circle with respect
   //! to the point theP which is the center of the symmetry
-  Standard_NODISCARD Standard_EXPORT gp_Circ2d Mirrored(const gp_Pnt2d& theP) const;
+  Standard_NODISCARD Standard_EXPORT gp_Circ2d Mirrored(const gp_Pnt2d& theP) const noexcept;
 
-  Standard_EXPORT void Mirror(const gp_Ax2d& theA);
+  Standard_EXPORT void Mirror(const gp_Ax2d& theA) noexcept;
 
   //! Performs the symmetrical transformation of a circle with respect
   //! to an axis placement which is the axis of the symmetry.
-  Standard_NODISCARD Standard_EXPORT gp_Circ2d Mirrored(const gp_Ax2d& theA) const;
+  Standard_NODISCARD Standard_EXPORT gp_Circ2d Mirrored(const gp_Ax2d& theA) const noexcept;
 
   void Rotate(const gp_Pnt2d& theP, const Standard_Real theAng) { pos.Rotate(theP, theAng); }
 
@@ -219,21 +223,25 @@ public:
   //! Transforms a circle with the transformation theT from class Trsf2d.
   Standard_NODISCARD gp_Circ2d Transformed(const gp_Trsf2d& theT) const;
 
-  void Translate(const gp_Vec2d& theV) { pos.Translate(theV); }
+  constexpr void Translate(const gp_Vec2d& theV) noexcept { pos.Translate(theV); }
 
   //! Translates a circle in the direction of the vector theV.
   //! The magnitude of the translation is the vector's magnitude.
-  Standard_NODISCARD gp_Circ2d Translated(const gp_Vec2d& theV) const
+  Standard_NODISCARD gp_Circ2d Translated(const gp_Vec2d& theV) const noexcept
   {
     gp_Circ2d aCirc = *this;
     aCirc.pos.Translate(theV);
     return aCirc;
   }
 
-  void Translate(const gp_Pnt2d& theP1, const gp_Pnt2d& theP2) { pos.Translate(theP1, theP2); }
+  constexpr void Translate(const gp_Pnt2d& theP1, const gp_Pnt2d& theP2) noexcept
+  {
+    pos.Translate(theP1, theP2);
+  }
 
   //! Translates a circle from the point theP1 to the point theP2.
-  Standard_NODISCARD gp_Circ2d Translated(const gp_Pnt2d& theP1, const gp_Pnt2d& theP2) const
+  Standard_NODISCARD gp_Circ2d Translated(const gp_Pnt2d& theP1,
+                                          const gp_Pnt2d& theP2) const noexcept
   {
     gp_Circ2d aCirc = *this;
     aCirc.pos.Translate(theP1, theP2);
@@ -247,12 +255,12 @@ private:
 
 //=================================================================================================
 
-inline void gp_Circ2d::Coefficients(Standard_Real& theA,
-                                    Standard_Real& theB,
-                                    Standard_Real& theC,
-                                    Standard_Real& theD,
-                                    Standard_Real& theE,
-                                    Standard_Real& theF) const
+constexpr inline void gp_Circ2d::Coefficients(Standard_Real& theA,
+                                              Standard_Real& theB,
+                                              Standard_Real& theC,
+                                              Standard_Real& theD,
+                                              Standard_Real& theE,
+                                              Standard_Real& theF) const noexcept
 {
   Standard_Real aXc  = pos.Location().X();
   Standard_Real anYc = pos.Location().Y();
@@ -266,7 +274,7 @@ inline void gp_Circ2d::Coefficients(Standard_Real& theA,
 
 //=================================================================================================
 
-inline Standard_Real gp_Circ2d::Distance(const gp_Pnt2d& theP) const
+inline Standard_Real gp_Circ2d::Distance(const gp_Pnt2d& theP) const noexcept
 {
   gp_XY aCoord = theP.XY();
   aCoord.Subtract(pos.Location().XY());
@@ -280,7 +288,7 @@ inline Standard_Real gp_Circ2d::Distance(const gp_Pnt2d& theP) const
 
 //=================================================================================================
 
-inline gp_Circ2d gp_Circ2d::Reversed() const
+inline gp_Circ2d gp_Circ2d::Reversed() const noexcept
 {
   gp_Circ2d aCirc = *this;
   gp_Dir2d  aTemp = pos.YDirection();
@@ -291,7 +299,7 @@ inline gp_Circ2d gp_Circ2d::Reversed() const
 
 //=================================================================================================
 
-inline Standard_Real gp_Circ2d::SquareDistance(const gp_Pnt2d& theP) const
+inline Standard_Real gp_Circ2d::SquareDistance(const gp_Pnt2d& theP) const noexcept
 {
   gp_XY aCoord = theP.XY();
   aCoord.Subtract(pos.Location().XY());
index 1ab861bd81f40fd164ec7af944e443ac0441c984..1dd986ddb509f88afd0ab9cf498114e5e67641a0 100644 (file)
@@ -54,7 +54,7 @@ Standard_Real gp_Dir2d::Angle(const gp_Dir2d& Other) const
   }
 }
 
-void gp_Dir2d::Mirror(const gp_Ax2d& A2)
+void gp_Dir2d::Mirror(const gp_Ax2d& A2) noexcept
 {
   const gp_XY&  XY = A2.Direction().XY();
   Standard_Real A  = XY.X();
@@ -67,7 +67,7 @@ void gp_Dir2d::Mirror(const gp_Ax2d& A2)
   coord.SetCoord(XX, YY);
 }
 
-void gp_Dir2d::Transform(const gp_Trsf2d& T)
+void gp_Dir2d::Transform(const gp_Trsf2d& T) noexcept
 {
   if (T.Form() == gp_Identity || T.Form() == gp_Translation)
   {
@@ -95,7 +95,7 @@ void gp_Dir2d::Transform(const gp_Trsf2d& T)
   }
 }
 
-void gp_Dir2d::Mirror(const gp_Dir2d& V)
+void gp_Dir2d::Mirror(const gp_Dir2d& V) noexcept
 {
   const gp_XY&  XY = V.coord;
   Standard_Real A  = XY.X();
@@ -108,14 +108,14 @@ void gp_Dir2d::Mirror(const gp_Dir2d& V)
   coord.SetCoord(XX, YY);
 }
 
-gp_Dir2d gp_Dir2d::Mirrored(const gp_Dir2d& V) const
+gp_Dir2d gp_Dir2d::Mirrored(const gp_Dir2d& V) const noexcept
 {
   gp_Dir2d Vres = *this;
   Vres.Mirror(V);
   return Vres;
 }
 
-gp_Dir2d gp_Dir2d::Mirrored(const gp_Ax2d& A) const
+gp_Dir2d gp_Dir2d::Mirrored(const gp_Ax2d& A) const noexcept
 {
   gp_Dir2d V = *this;
   V.Mirror(A);
index a35b82d22bd74c29609e28195f0a93d584432a3e..86faacec32b70598c00a41850883579b20de5897 100644 (file)
@@ -218,19 +218,19 @@ public:
 
   Standard_NODISCARD constexpr gp_Dir2d operator-() const noexcept { return Reversed(); }
 
-  Standard_EXPORT void Mirror(const gp_Dir2d& theV);
+  Standard_EXPORT void Mirror(const gp_Dir2d& theV) noexcept;
 
   //! Performs the symmetrical transformation of a direction
   //! with respect to the direction theV which is the center of
   //! the  symmetry.
-  Standard_NODISCARD Standard_EXPORT gp_Dir2d Mirrored(const gp_Dir2d& theV) const;
+  Standard_NODISCARD Standard_EXPORT gp_Dir2d Mirrored(const gp_Dir2d& theV) const noexcept;
 
-  Standard_EXPORT void Mirror(const gp_Ax2d& theA);
+  Standard_EXPORT void Mirror(const gp_Ax2d& theA) noexcept;
 
   //! Performs the symmetrical transformation of a direction
   //! with respect to an axis placement which is the axis
   //! of the symmetry.
-  Standard_NODISCARD Standard_EXPORT gp_Dir2d Mirrored(const gp_Ax2d& theA) const;
+  Standard_NODISCARD Standard_EXPORT gp_Dir2d Mirrored(const gp_Ax2d& theA) const noexcept;
 
   void Rotate(const Standard_Real Ang);
 
@@ -243,7 +243,7 @@ public:
     return aV;
   }
 
-  Standard_EXPORT void Transform(const gp_Trsf2d& theT);
+  Standard_EXPORT void Transform(const gp_Trsf2d& theT) noexcept;
 
   //! Transforms a direction with the "Trsf" theT.
   //! Warnings :
index dab8d052dc93dfb2391b7332f0c86117240c14ac..99342a9820b5791861a4d464adb400c5784a5b23 100644 (file)
@@ -66,24 +66,24 @@ void gp_Elips2d::Coefficients(Standard_Real& A,
   }
 }
 
-void gp_Elips2d::Mirror(const gp_Pnt2d& P)
+void gp_Elips2d::Mirror(const gp_Pnt2d& P) noexcept
 {
   pos.Mirror(P);
 }
 
-gp_Elips2d gp_Elips2d::Mirrored(const gp_Pnt2d& P) const
+gp_Elips2d gp_Elips2d::Mirrored(const gp_Pnt2d& P) const noexcept
 {
   gp_Elips2d E = *this;
   E.pos.Mirror(P);
   return E;
 }
 
-void gp_Elips2d::Mirror(const gp_Ax2d& A)
+void gp_Elips2d::Mirror(const gp_Ax2d& A) noexcept
 {
   pos.Mirror(A);
 }
 
-gp_Elips2d gp_Elips2d::Mirrored(const gp_Ax2d& A) const
+gp_Elips2d gp_Elips2d::Mirrored(const gp_Ax2d& A) const noexcept
 {
   gp_Elips2d E = *this;
   E.pos.Mirror(A);
index d2596d17566e8e4b5f008ea700591ef42d164f9c..a15620c97d9bbb5efca3716bff87aff998d328cd 100644 (file)
@@ -47,7 +47,7 @@ public:
   DEFINE_STANDARD_ALLOC
 
   //! Creates an indefinite ellipse.
-  gp_Elips2d()
+  gp_Elips2d() noexcept
       : majorRadius(RealLast()),
         minorRadius(RealSmall())
   {
@@ -101,7 +101,7 @@ public:
 
   //! Modifies this ellipse, by redefining its local coordinate system so that
   //! -   its origin becomes theP.
-  void SetLocation(const gp_Pnt2d& theP) { pos.SetLocation(theP); }
+  constexpr void SetLocation(const gp_Pnt2d& theP) noexcept { pos.SetLocation(theP); }
 
   //! Changes the value of the major radius.
   //! Raises ConstructionError if theMajorRadius < MinorRadius.
@@ -125,7 +125,7 @@ public:
 
   //! Modifies this ellipse, by redefining its local coordinate system so that
   //! it becomes theA.
-  void SetAxis(const gp_Ax22d& theA) { pos.SetAxis(theA); }
+  constexpr void SetAxis(const gp_Ax22d& theA) noexcept { pos.SetAxis(theA); }
 
   //! Modifies this ellipse, by redefining its local coordinate system so that
   //! its origin and its "X Direction"  become those
@@ -142,7 +142,7 @@ public:
   void SetYAxis(const gp_Ax2d& theA) { pos.SetYAxis(theA); }
 
   //! Computes the area of the ellipse.
-  Standard_Real Area() const { return M_PI * majorRadius * minorRadius; }
+  constexpr Standard_Real Area() const noexcept { return M_PI * majorRadius * minorRadius; }
 
   //! Returns the coefficients of the implicit equation of the ellipse.
   //! theA * (X**2) + theB * (Y**2) + 2*theC*(X*Y) + 2*theD*X + 2*theE*Y + theF = 0.
@@ -194,53 +194,56 @@ public:
   gp_Pnt2d Focus2() const;
 
   //! Returns the center of the ellipse.
-  const gp_Pnt2d& Location() const { return pos.Location(); }
+  constexpr const gp_Pnt2d& Location() const noexcept { return pos.Location(); }
 
   //! Returns the major radius of the Ellipse.
-  Standard_Real MajorRadius() const { return majorRadius; }
+  constexpr Standard_Real MajorRadius() const noexcept { return majorRadius; }
 
   //! Returns the minor radius of the Ellipse.
-  Standard_Real MinorRadius() const { return minorRadius; }
+  constexpr Standard_Real MinorRadius() const noexcept { return minorRadius; }
 
   //! Returns p = (1 - e * e) * MajorRadius where e is the eccentricity
   //! of the ellipse.
   //! Returns 0 if MajorRadius = 0
-  Standard_Real Parameter() const;
+  constexpr Standard_Real Parameter() const noexcept;
 
   //! Returns the major axis of the ellipse.
-  const gp_Ax22d& Axis() const { return pos; }
+  constexpr const gp_Ax22d& Axis() const noexcept { return pos; }
 
   //! Returns the major axis of the ellipse.
-  gp_Ax2d XAxis() const { return pos.XAxis(); }
+  gp_Ax2d XAxis() const noexcept { return pos.XAxis(); }
 
   //! Returns the minor axis of the ellipse.
   //! Reverses the direction of the circle.
-  gp_Ax2d YAxis() const { return pos.YAxis(); }
+  gp_Ax2d YAxis() const noexcept { return pos.YAxis(); }
 
-  void Reverse()
+  void Reverse() noexcept
   {
     gp_Dir2d aTemp = pos.YDirection();
     aTemp.Reverse();
     pos.SetAxis(gp_Ax22d(pos.Location(), pos.XDirection(), aTemp));
   }
 
-  Standard_NODISCARD gp_Elips2d Reversed() const;
+  Standard_NODISCARD gp_Elips2d Reversed() const noexcept;
 
   //! Returns true if the local coordinate system is direct
   //! and false in the other case.
-  Standard_Boolean IsDirect() const { return (pos.XDirection().Crossed(pos.YDirection())) >= 0.0; }
+  constexpr Standard_Boolean IsDirect() const noexcept
+  {
+    return (pos.XDirection().Crossed(pos.YDirection())) >= 0.0;
+  }
 
-  Standard_EXPORT void Mirror(const gp_Pnt2d& theP);
+  Standard_EXPORT void Mirror(const gp_Pnt2d& theP) noexcept;
 
   //! Performs the symmetrical transformation of a ellipse with respect
   //! to the point theP which is the center of the symmetry
-  Standard_NODISCARD Standard_EXPORT gp_Elips2d Mirrored(const gp_Pnt2d& theP) const;
+  Standard_NODISCARD Standard_EXPORT gp_Elips2d Mirrored(const gp_Pnt2d& theP) const noexcept;
 
-  Standard_EXPORT void Mirror(const gp_Ax2d& theA);
+  Standard_EXPORT void Mirror(const gp_Ax2d& theA) noexcept;
 
   //! Performs the symmetrical transformation of a ellipse with respect
   //! to an axis placement which is the axis of the symmetry.
-  Standard_NODISCARD Standard_EXPORT gp_Elips2d Mirrored(const gp_Ax2d& theA) const;
+  Standard_NODISCARD Standard_EXPORT gp_Elips2d Mirrored(const gp_Ax2d& theA) const noexcept;
 
   void Rotate(const gp_Pnt2d& theP, const Standard_Real theAng) { pos.Rotate(theP, theAng); }
 
@@ -261,21 +264,25 @@ public:
   //! Transforms an ellipse with the transformation theT from class Trsf2d.
   Standard_NODISCARD gp_Elips2d Transformed(const gp_Trsf2d& theT) const;
 
-  void Translate(const gp_Vec2d& theV) { pos.Translate(theV); }
+  constexpr void Translate(const gp_Vec2d& theV) noexcept { pos.Translate(theV); }
 
   //! Translates a ellipse in the direction of the vector theV.
   //! The magnitude of the translation is the vector's magnitude.
-  Standard_NODISCARD gp_Elips2d Translated(const gp_Vec2d& theV) const
+  Standard_NODISCARD gp_Elips2d Translated(const gp_Vec2d& theV) const noexcept
   {
     gp_Elips2d anE = *this;
     anE.pos.Translate(theV);
     return anE;
   }
 
-  void Translate(const gp_Pnt2d& theP1, const gp_Pnt2d& theP2) { pos.Translate(theP1, theP2); }
+  constexpr void Translate(const gp_Pnt2d& theP1, const gp_Pnt2d& theP2) noexcept
+  {
+    pos.Translate(theP1, theP2);
+  }
 
   //! Translates a ellipse from the point theP1 to the point theP2.
-  Standard_NODISCARD gp_Elips2d Translated(const gp_Pnt2d& theP1, const gp_Pnt2d& theP2) const
+  Standard_NODISCARD gp_Elips2d Translated(const gp_Pnt2d& theP1,
+                                           const gp_Pnt2d& theP2) const noexcept
   {
     gp_Elips2d anE = *this;
     anE.pos.Translate(theP1, theP2);
@@ -386,7 +393,7 @@ inline gp_Elips2d gp_Elips2d::Scaled(const gp_Pnt2d& theP, const Standard_Real t
 
 //=================================================================================================
 
-inline Standard_Real gp_Elips2d::Parameter() const
+inline constexpr Standard_Real gp_Elips2d::Parameter() const noexcept
 {
   if (majorRadius == 0.0)
   {
@@ -400,7 +407,7 @@ inline Standard_Real gp_Elips2d::Parameter() const
 
 //=================================================================================================
 
-inline gp_Elips2d gp_Elips2d::Reversed() const
+inline gp_Elips2d gp_Elips2d::Reversed() const noexcept
 {
   gp_Elips2d anE   = *this;
   gp_Dir2d   aTemp = pos.YDirection();
index 0814b6f5d9282269a9231ab2cf17ea95cebe00d9..192b21c2af9b3b0196bc5efee4fa69656ca9cbcd 100644 (file)
@@ -66,24 +66,24 @@ void gp_Hypr2d::Coefficients(Standard_Real& A,
   }
 }
 
-void gp_Hypr2d::Mirror(const gp_Pnt2d& P)
+void gp_Hypr2d::Mirror(const gp_Pnt2d& P) noexcept
 {
   pos.Mirror(P);
 }
 
-gp_Hypr2d gp_Hypr2d::Mirrored(const gp_Pnt2d& P) const
+gp_Hypr2d gp_Hypr2d::Mirrored(const gp_Pnt2d& P) const noexcept
 {
   gp_Hypr2d H = *this;
   H.pos.Mirror(P);
   return H;
 }
 
-void gp_Hypr2d::Mirror(const gp_Ax2d& A)
+void gp_Hypr2d::Mirror(const gp_Ax2d& A) noexcept
 {
   pos.Mirror(A);
 }
 
-gp_Hypr2d gp_Hypr2d::Mirrored(const gp_Ax2d& A) const
+gp_Hypr2d gp_Hypr2d::Mirrored(const gp_Ax2d& A) const noexcept
 {
   gp_Hypr2d H = *this;
   H.pos.Mirror(A);
index 3eee4d9cfcb0bd0c179fc5e75e385836f564077b..b58de0c8bd9ec5e41b240b8842e7c262e6e15370 100644 (file)
@@ -68,7 +68,7 @@ public:
   DEFINE_STANDARD_ALLOC
 
   //! Creates of an indefinite hyperbola.
-  gp_Hypr2d()
+  gp_Hypr2d() noexcept
       : majorRadius(RealLast()),
         minorRadius(RealLast())
   {
@@ -124,7 +124,7 @@ public:
 
   //! Modifies this hyperbola, by redefining its local
   //! coordinate system so that its origin becomes theP.
-  void SetLocation(const gp_Pnt2d& theP) { pos.SetLocation(theP); }
+  constexpr void SetLocation(const gp_Pnt2d& theP) noexcept { pos.SetLocation(theP); }
 
   //! Modifies the major or minor radius of this hyperbola.
   //! Exceptions
@@ -152,7 +152,7 @@ public:
 
   //! Modifies this hyperbola, by redefining its local
   //! coordinate system so that it becomes theA.
-  void SetAxis(const gp_Ax22d& theA) { pos.SetAxis(theA); }
+  constexpr void SetAxis(const gp_Ax22d& theA) noexcept { pos.SetAxis(theA); }
 
   //! Changes the major axis of the hyperbola. The minor axis is
   //! recomputed and the location of the hyperbola too.
@@ -190,7 +190,7 @@ public:
 
   //! Computes the branch of hyperbola which is on the positive side of the
   //! "YAxis" of <me>.
-  gp_Hypr2d ConjugateBranch1() const
+  gp_Hypr2d ConjugateBranch1() const noexcept
   {
     gp_Dir2d         aV(pos.YDirection());
     Standard_Boolean isSign = (pos.XDirection().Crossed(pos.YDirection())) >= 0.0;
@@ -199,7 +199,7 @@ public:
 
   //! Computes the branch of hyperbola which is on the negative side of the
   //! "YAxis" of <me>.
-  gp_Hypr2d ConjugateBranch2() const
+  gp_Hypr2d ConjugateBranch2() const noexcept
   {
     gp_Dir2d         aV(pos.YDirection().Reversed());
     Standard_Boolean isSign = (pos.XDirection().Crossed(pos.YDirection())) >= 0.0;
@@ -233,14 +233,14 @@ public:
 
   //! Computes the focal distance. It is the distance between the
   //! "Location" of the hyperbola and "Focus1" or "Focus2".
-  Standard_Real Focal() const
+  Standard_Real Focal() const noexcept
   {
     return 2.0 * sqrt(majorRadius * majorRadius + minorRadius * minorRadius);
   }
 
   //! Returns the first focus of the hyperbola. This focus is on the
   //! positive side of the "XAxis" of the hyperbola.
-  gp_Pnt2d Focus1() const
+  gp_Pnt2d Focus1() const noexcept
   {
     Standard_Real aC = sqrt(majorRadius * majorRadius + minorRadius * minorRadius);
     return gp_Pnt2d(pos.Location().X() + aC * pos.XDirection().X(),
@@ -249,7 +249,7 @@ public:
 
   //! Returns the second focus of the hyperbola. This focus is on the
   //! negative side of the "XAxis" of the hyperbola.
-  gp_Pnt2d Focus2() const
+  gp_Pnt2d Focus2() const noexcept
   {
     Standard_Real aC = sqrt(majorRadius * majorRadius + minorRadius * minorRadius);
     return gp_Pnt2d(pos.Location().X() - aC * pos.XDirection().X(),
@@ -259,20 +259,20 @@ public:
   //! Returns  the location point of the hyperbola.
   //! It is the intersection point between the "XAxis" and
   //! the "YAxis".
-  const gp_Pnt2d& Location() const { return pos.Location(); }
+  constexpr const gp_Pnt2d& Location() const noexcept { return pos.Location(); }
 
   //! Returns the major radius of the hyperbola (it is the radius
   //! corresponding to the "XAxis" of the hyperbola).
-  Standard_Real MajorRadius() const { return majorRadius; }
+  constexpr Standard_Real MajorRadius() const noexcept { return majorRadius; }
 
   //! Returns the minor radius of the hyperbola (it is the radius
   //! corresponding to the "YAxis" of the hyperbola).
-  Standard_Real MinorRadius() const { return minorRadius; }
+  constexpr Standard_Real MinorRadius() const noexcept { return minorRadius; }
 
   //! Returns the branch of hyperbola obtained by doing the
   //! symmetrical transformation of <me> with respect to the
   //! "YAxis" of <me>.
-  gp_Hypr2d OtherBranch() const
+  gp_Hypr2d OtherBranch() const noexcept
   {
     Standard_Boolean isSign = (pos.XDirection().Crossed(pos.YDirection())) >= 0.0;
     return gp_Hypr2d(gp_Ax2d(pos.Location(), pos.XDirection().Reversed()),
@@ -292,23 +292,23 @@ public:
   }
 
   //! Returns the axisplacement of the hyperbola.
-  const gp_Ax22d& Axis() const { return pos; }
+  constexpr const gp_Ax22d& Axis() const noexcept { return pos; }
 
   //! Computes an axis whose
   //! -   the origin is the center of this hyperbola, and
   //! -   the unit vector is the "X Direction" or "Y Direction"
   //! respectively of the local coordinate system of this hyperbola
   //! Returns the major axis of the hyperbola.
-  gp_Ax2d XAxis() const { return pos.XAxis(); }
+  gp_Ax2d XAxis() const noexcept { return pos.XAxis(); }
 
   //! Computes an axis whose
   //! -   the origin is the center of this hyperbola, and
   //! -   the unit vector is the "X Direction" or "Y Direction"
   //! respectively of the local coordinate system of this hyperbola
   //! Returns the minor axis of the hyperbola.
-  gp_Ax2d YAxis() const { return pos.YAxis(); }
+  gp_Ax2d YAxis() const noexcept { return pos.YAxis(); }
 
-  void Reverse()
+  void Reverse() noexcept
   {
     gp_Dir2d aTemp = pos.YDirection();
     aTemp.Reverse();
@@ -321,23 +321,26 @@ public:
   //! Note:
   //! -   Reverse assigns the result to this hyperbola, while
   //! -   Reversed creates a new one.
-  Standard_NODISCARD gp_Hypr2d Reversed() const;
+  Standard_NODISCARD gp_Hypr2d Reversed() const noexcept;
 
   //! Returns true if the local coordinate system is direct
   //! and false in the other case.
-  Standard_Boolean IsDirect() const { return (pos.XDirection().Crossed(pos.YDirection())) >= 0.0; }
+  constexpr Standard_Boolean IsDirect() const noexcept
+  {
+    return (pos.XDirection().Crossed(pos.YDirection())) >= 0.0;
+  }
 
-  Standard_EXPORT void Mirror(const gp_Pnt2d& theP);
+  Standard_EXPORT void Mirror(const gp_Pnt2d& theP) noexcept;
 
   //! Performs the symmetrical transformation of an hyperbola with
   //! respect  to the point theP which is the center of the symmetry.
-  Standard_NODISCARD Standard_EXPORT gp_Hypr2d Mirrored(const gp_Pnt2d& theP) const;
+  Standard_NODISCARD Standard_EXPORT gp_Hypr2d Mirrored(const gp_Pnt2d& theP) const noexcept;
 
-  Standard_EXPORT void Mirror(const gp_Ax2d& theA);
+  Standard_EXPORT void Mirror(const gp_Ax2d& theA) noexcept;
 
   //! Performs the symmetrical transformation of an hyperbola with
   //! respect to an axis placement which is the axis of the symmetry.
-  Standard_NODISCARD Standard_EXPORT gp_Hypr2d Mirrored(const gp_Ax2d& theA) const;
+  Standard_NODISCARD Standard_EXPORT gp_Hypr2d Mirrored(const gp_Ax2d& theA) const noexcept;
 
   void Rotate(const gp_Pnt2d& theP, const Standard_Real theAng) { pos.Rotate(theP, theAng); }
 
@@ -364,21 +367,25 @@ public:
   //! class Trsf2d.
   Standard_NODISCARD gp_Hypr2d Transformed(const gp_Trsf2d& theT) const;
 
-  void Translate(const gp_Vec2d& theV) { pos.Translate(theV); }
+  constexpr void Translate(const gp_Vec2d& theV) noexcept { pos.Translate(theV); }
 
   //! Translates an hyperbola in the direction of the vector theV.
   //! The magnitude of the translation is the vector's magnitude.
-  Standard_NODISCARD gp_Hypr2d Translated(const gp_Vec2d& theV) const
+  Standard_NODISCARD gp_Hypr2d Translated(const gp_Vec2d& theV) const noexcept
   {
     gp_Hypr2d aH = *this;
     aH.pos.Translate(theV);
     return aH;
   }
 
-  void Translate(const gp_Pnt2d& theP1, const gp_Pnt2d& theP2) { pos.Translate(theP1, theP2); }
+  constexpr void Translate(const gp_Pnt2d& theP1, const gp_Pnt2d& theP2) noexcept
+  {
+    pos.Translate(theP1, theP2);
+  }
 
   //! Translates an hyperbola from the point theP1 to the point theP2.
-  Standard_NODISCARD gp_Hypr2d Translated(const gp_Pnt2d& theP1, const gp_Pnt2d& theP2) const
+  Standard_NODISCARD gp_Hypr2d Translated(const gp_Pnt2d& theP1,
+                                          const gp_Pnt2d& theP2) const noexcept
   {
     gp_Hypr2d aH = *this;
     aH.pos.Translate(theP1, theP2);
@@ -443,7 +450,7 @@ inline gp_Ax2d gp_Hypr2d::Directrix2() const
 
 //=================================================================================================
 
-inline gp_Hypr2d gp_Hypr2d::Reversed() const
+inline gp_Hypr2d gp_Hypr2d::Reversed() const noexcept
 {
   gp_Hypr2d aH    = *this;
   gp_Dir2d  aTemp = pos.YDirection();
index 0c53b665d8395a29ad36f72992510dd246613712..d6326dfdbdf51883cb67e1068ddebdfe8e037f7e 100644 (file)
@@ -52,14 +52,14 @@ gp_Lin2d::gp_Lin2d(const Standard_Real A, const Standard_Real B, const Standard_
 
 //=================================================================================================
 
-void gp_Lin2d::Mirror(const gp_Pnt2d& P)
+void gp_Lin2d::Mirror(const gp_Pnt2d& P) noexcept
 {
   pos.Mirror(P);
 }
 
 //=================================================================================================
 
-gp_Lin2d gp_Lin2d::Mirrored(const gp_Pnt2d& P) const
+gp_Lin2d gp_Lin2d::Mirrored(const gp_Pnt2d& P) const noexcept
 {
   gp_Lin2d L = *this;
   L.pos.Mirror(P);
@@ -68,14 +68,14 @@ gp_Lin2d gp_Lin2d::Mirrored(const gp_Pnt2d& P) const
 
 //=================================================================================================
 
-void gp_Lin2d::Mirror(const gp_Ax2d& A)
+void gp_Lin2d::Mirror(const gp_Ax2d& A) noexcept
 {
   pos.Mirror(A);
 }
 
 //=================================================================================================
 
-gp_Lin2d gp_Lin2d::Mirrored(const gp_Ax2d& A) const
+gp_Lin2d gp_Lin2d::Mirrored(const gp_Ax2d& A) const noexcept
 {
   gp_Lin2d L = *this;
   L.pos.Mirror(A);
index d254ec0ecda3580cac6af26235255b853afd45ab..f4db768c7b497352417c1b75fa80b4e402e6f5f9 100644 (file)
@@ -42,17 +42,17 @@ public:
 
   //! Creates a Line corresponding to X axis of the
   //! reference coordinate system.
-  gp_Lin2d() {}
+  constexpr gp_Lin2d() noexcept {}
 
   //! Creates a line located with theA.
-  gp_Lin2d(const gp_Ax2d& theA)
+  constexpr gp_Lin2d(const gp_Ax2d& theA) noexcept
       : pos(theA)
   {
   }
 
   //! <theP> is the location point (origin) of the line and
   //! <theV> is the direction of the line.
-  gp_Lin2d(const gp_Pnt2d& theP, const gp_Dir2d& theV)
+  constexpr gp_Lin2d(const gp_Pnt2d& theP, const gp_Dir2d& theV) noexcept
       : pos(theP, theV)
   {
   }
@@ -64,13 +64,13 @@ public:
                            const Standard_Real theB,
                            const Standard_Real theC);
 
-  void Reverse() { pos.Reverse(); }
+  constexpr void Reverse() noexcept { pos.Reverse(); }
 
   //! Reverses the positioning axis of this line.
   //! Note:
   //! -   Reverse assigns the result to this line, while
   //! -   Reversed creates a new one.
-  Standard_NODISCARD gp_Lin2d Reversed() const
+  Standard_NODISCARD constexpr gp_Lin2d Reversed() const noexcept
   {
     gp_Lin2d aL = *this;
     aL.pos.Reverse();
@@ -78,19 +78,21 @@ public:
   }
 
   //! Changes the direction of the line.
-  void SetDirection(const gp_Dir2d& theV) { pos.SetDirection(theV); }
+  constexpr void SetDirection(const gp_Dir2d& theV) noexcept { pos.SetDirection(theV); }
 
   //! Changes the origin of the line.
-  void SetLocation(const gp_Pnt2d& theP) { pos.SetLocation(theP); }
+  constexpr void SetLocation(const gp_Pnt2d& theP) noexcept { pos.SetLocation(theP); }
 
   //! Complete redefinition of the line.
   //! The "Location" point of <theA> is the origin of the line.
   //! The "Direction" of <theA> is  the direction of the line.
-  void SetPosition(const gp_Ax2d& theA) { pos = theA; }
+  constexpr void SetPosition(const gp_Ax2d& theA) noexcept { pos = theA; }
 
   //! Returns the normalized coefficients of the line :
   //! theA * X + theB * Y + theC = 0.
-  void Coefficients(Standard_Real& theA, Standard_Real& theB, Standard_Real& theC) const
+  constexpr void Coefficients(Standard_Real& theA,
+                              Standard_Real& theB,
+                              Standard_Real& theC) const noexcept
   {
     theA = pos.Direction().Y();
     theB = -pos.Direction().X();
@@ -98,14 +100,14 @@ public:
   }
 
   //! Returns the direction of the line.
-  const gp_Dir2d& Direction() const { return pos.Direction(); }
+  constexpr const gp_Dir2d& Direction() const noexcept { return pos.Direction(); }
 
   //! Returns the location point (origin) of the line.
-  const gp_Pnt2d& Location() const { return pos.Location(); }
+  constexpr const gp_Pnt2d& Location() const noexcept { return pos.Location(); }
 
   //! Returns the axis placement one axis with the same
   //! location and direction as <me>.
-  const gp_Ax2d& Position() const { return pos; }
+  constexpr const gp_Ax2d& Position() const noexcept { return pos; }
 
   //! Computes the angle between two lines in radians.
   Standard_Real Angle(const gp_Lin2d& theOther) const
@@ -116,44 +118,45 @@ public:
   //! Returns true if this line contains the point theP, that is, if the
   //! distance between point theP and this line is less than or
   //! equal to theLinearTolerance.
-  Standard_Boolean Contains(const gp_Pnt2d& theP, const Standard_Real theLinearTolerance) const
+  Standard_Boolean Contains(const gp_Pnt2d&     theP,
+                            const Standard_Real theLinearTolerance) const noexcept
   {
     return Distance(theP) <= theLinearTolerance;
   }
 
   //! Computes the distance between <me> and the point <theP>.
-  Standard_Real Distance(const gp_Pnt2d& theP) const;
+  Standard_Real Distance(const gp_Pnt2d& theP) const noexcept;
 
   //! Computes the distance between two lines.
-  Standard_Real Distance(const gp_Lin2d& theOther) const;
+  Standard_Real Distance(const gp_Lin2d& theOther) const noexcept;
 
   //! Computes the square distance between <me> and the point
   //! <theP>.
-  Standard_Real SquareDistance(const gp_Pnt2d& theP) const;
+  constexpr Standard_Real SquareDistance(const gp_Pnt2d& theP) const noexcept;
 
   //! Computes the square distance between two lines.
-  Standard_Real SquareDistance(const gp_Lin2d& theOther) const;
+  Standard_Real SquareDistance(const gp_Lin2d& theOther) const noexcept;
 
   //! Computes the line normal to the direction of <me>,
   //! passing through the point <theP>.
-  gp_Lin2d Normal(const gp_Pnt2d& theP) const
+  gp_Lin2d Normal(const gp_Pnt2d& theP) const noexcept
   {
     return gp_Lin2d(gp_Ax2d(theP, gp_Dir2d(-(pos.Direction().Y()), pos.Direction().X())));
   }
 
-  Standard_EXPORT void Mirror(const gp_Pnt2d& theP);
+  Standard_EXPORT void Mirror(const gp_Pnt2d& theP) noexcept;
 
   //! Performs the symmetrical transformation of a line
   //! with respect to the point <theP> which is the center
   //! of the symmetry
-  Standard_NODISCARD Standard_EXPORT gp_Lin2d Mirrored(const gp_Pnt2d& theP) const;
+  Standard_NODISCARD Standard_EXPORT gp_Lin2d Mirrored(const gp_Pnt2d& theP) const noexcept;
 
-  Standard_EXPORT void Mirror(const gp_Ax2d& theA);
+  Standard_EXPORT void Mirror(const gp_Ax2d& theA) noexcept;
 
   //! Performs the symmetrical transformation of a line
   //! with respect to an axis placement which is the axis
   //! of the symmetry.
-  Standard_NODISCARD Standard_EXPORT gp_Lin2d Mirrored(const gp_Ax2d& theA) const;
+  Standard_NODISCARD Standard_EXPORT gp_Lin2d Mirrored(const gp_Ax2d& theA) const noexcept;
 
   void Rotate(const gp_Pnt2d& theP, const Standard_Real theAng) { pos.Rotate(theP, theAng); }
 
@@ -177,31 +180,35 @@ public:
     return aL;
   }
 
-  void Transform(const gp_Trsf2d& theT) { pos.Transform(theT); }
+  void Transform(const gp_Trsf2d& theT) noexcept { pos.Transform(theT); }
 
   //! Transforms a line with the transformation theT from class Trsf2d.
-  Standard_NODISCARD gp_Lin2d Transformed(const gp_Trsf2d& theT) const
+  Standard_NODISCARD gp_Lin2d Transformed(const gp_Trsf2d& theT) const noexcept
   {
     gp_Lin2d aL = *this;
     aL.pos.Transform(theT);
     return aL;
   }
 
-  void Translate(const gp_Vec2d& theV) { pos.Translate(theV); }
+  constexpr void Translate(const gp_Vec2d& theV) noexcept { pos.Translate(theV); }
 
   //! Translates a line in the direction of the vector theV.
   //! The magnitude of the translation is the vector's magnitude.
-  Standard_NODISCARD gp_Lin2d Translated(const gp_Vec2d& theV) const
+  Standard_NODISCARD gp_Lin2d Translated(const gp_Vec2d& theV) const noexcept
   {
     gp_Lin2d aL = *this;
     aL.pos.Translate(theV);
     return aL;
   }
 
-  void Translate(const gp_Pnt2d& theP1, const gp_Pnt2d& theP2) { pos.Translate(theP1, theP2); }
+  constexpr void Translate(const gp_Pnt2d& theP1, const gp_Pnt2d& theP2) noexcept
+  {
+    pos.Translate(theP1, theP2);
+  }
 
   //! Translates a line from the point theP1 to the point theP2.
-  Standard_NODISCARD gp_Lin2d Translated(const gp_Pnt2d& theP1, const gp_Pnt2d& theP2) const
+  Standard_NODISCARD gp_Lin2d Translated(const gp_Pnt2d& theP1,
+                                         const gp_Pnt2d& theP2) const noexcept
   {
     gp_Lin2d aL = *this;
     aL.pos.Translate(gp_Vec2d(theP1, theP2));
@@ -214,7 +221,7 @@ private:
 
 //=================================================================================================
 
-inline Standard_Real gp_Lin2d::Distance(const gp_Pnt2d& theP) const
+inline Standard_Real gp_Lin2d::Distance(const gp_Pnt2d& theP) const noexcept
 {
   gp_XY aCoord = theP.XY();
   aCoord.Subtract((pos.Location()).XY());
@@ -228,7 +235,7 @@ inline Standard_Real gp_Lin2d::Distance(const gp_Pnt2d& theP) const
 
 //=================================================================================================
 
-inline Standard_Real gp_Lin2d::Distance(const gp_Lin2d& theOther) const
+inline Standard_Real gp_Lin2d::Distance(const gp_Lin2d& theOther) const noexcept
 {
   Standard_Real aD = 0.0;
   if (pos.IsParallel(theOther.pos, gp::Resolution()))
@@ -240,7 +247,7 @@ inline Standard_Real gp_Lin2d::Distance(const gp_Lin2d& theOther) const
 
 //=================================================================================================
 
-inline Standard_Real gp_Lin2d::SquareDistance(const gp_Pnt2d& theP) const
+inline constexpr Standard_Real gp_Lin2d::SquareDistance(const gp_Pnt2d& theP) const noexcept
 {
   gp_XY aCoord = theP.XY();
   aCoord.Subtract((pos.Location()).XY());
@@ -250,7 +257,7 @@ inline Standard_Real gp_Lin2d::SquareDistance(const gp_Pnt2d& theP) const
 
 //=================================================================================================
 
-inline Standard_Real gp_Lin2d::SquareDistance(const gp_Lin2d& theOther) const
+inline Standard_Real gp_Lin2d::SquareDistance(const gp_Lin2d& theOther) const noexcept
 {
   Standard_Real aD = 0.0;
   if (pos.IsParallel(theOther.pos, gp::Resolution()))
index 0ddb797f120781b22b837179c2b3725766ccd7c2..ff3a7af075abc321c8f0136d0e530f758d21f5e7 100644 (file)
@@ -67,24 +67,24 @@ void gp_Parab2d::Coefficients(Standard_Real& A,
   F                 = (T23 * T23) - (2.0 * P * T13);
 }
 
-void gp_Parab2d::Mirror(const gp_Pnt2d& P)
+void gp_Parab2d::Mirror(const gp_Pnt2d& P) noexcept
 {
   pos.Mirror(P);
 }
 
-gp_Parab2d gp_Parab2d::Mirrored(const gp_Pnt2d& P) const
+gp_Parab2d gp_Parab2d::Mirrored(const gp_Pnt2d& P) const noexcept
 {
   gp_Parab2d Prb = *this;
   Prb.pos.Mirror(P);
   return Prb;
 }
 
-void gp_Parab2d::Mirror(const gp_Ax2d& A)
+void gp_Parab2d::Mirror(const gp_Ax2d& A) noexcept
 {
   pos.Mirror(A);
 }
 
-gp_Parab2d gp_Parab2d::Mirrored(const gp_Ax2d& A) const
+gp_Parab2d gp_Parab2d::Mirrored(const gp_Ax2d& A) const noexcept
 {
   gp_Parab2d Prb = *this;
   Prb.pos.Mirror(A);
index 803f38b34eb3f192ae1e454698044ddbe7a3de94..b3c7eea544488745750cafc9cbba07141e1a82df 100644 (file)
@@ -50,7 +50,7 @@ public:
   DEFINE_STANDARD_ALLOC
 
   //! Creates an indefinite parabola.
-  gp_Parab2d()
+  gp_Parab2d() noexcept
       : focalLength(RealLast())
   {
   }
@@ -113,7 +113,7 @@ public:
 
   //! Changes the "Location" point of the parabola. It is the
   //! vertex of the parabola.
-  void SetLocation(const gp_Pnt2d& theP) { pos.SetLocation(theP); }
+  constexpr void SetLocation(const gp_Pnt2d& theP) noexcept { pos.SetLocation(theP); }
 
   //! Modifies this parabola, by redefining its local coordinate system so that
   //! its origin and "X Direction" become those of the axis
@@ -124,7 +124,7 @@ public:
 
   //! Changes the local coordinate system of the parabola.
   //! The "Location" point of A becomes the vertex of the parabola.
-  void SetAxis(const gp_Ax22d& theA) { pos.SetAxis(theA); }
+  constexpr void SetAxis(const gp_Ax22d& theA) noexcept { pos.SetAxis(theA); }
 
   //! Computes the coefficients of the implicit equation of the parabola
   //! (in WCS - World Coordinate System).
@@ -146,35 +146,35 @@ public:
   //! at a distance from the apex which is equal to the focal  length of this parabola.
   //! The directrix is returned as an axis (a gp_Ax2d object),
   //! the origin of which is situated on the "X Axis" of this parabola.
-  gp_Ax2d Directrix() const;
+  gp_Ax2d Directrix() const noexcept;
 
   //! Returns the distance between the vertex and the focus
   //! of the parabola.
-  Standard_Real Focal() const { return focalLength; }
+  constexpr Standard_Real Focal() const noexcept { return focalLength; }
 
   //! Returns the focus of the parabola.
-  gp_Pnt2d Focus() const
+  gp_Pnt2d Focus() const noexcept
   {
     return gp_Pnt2d(pos.Location().X() + focalLength * pos.XDirection().X(),
                     pos.Location().Y() + focalLength * pos.XDirection().Y());
   }
 
   //! Returns the vertex of the parabola.
-  gp_Pnt2d Location() const { return pos.Location(); }
+  constexpr const gp_Pnt2d& Location() const noexcept { return pos.Location(); }
 
   //! Returns the symmetry axis of the parabola.
   //! The "Location" point of this axis is the vertex of the parabola.
-  gp_Ax2d MirrorAxis() const { return pos.XAxis(); }
+  gp_Ax2d MirrorAxis() const noexcept { return pos.XAxis(); }
 
   //! Returns the local coordinate system of the parabola.
   //! The "Location" point of this axis is the vertex of the parabola.
-  gp_Ax22d Axis() const { return pos; }
+  constexpr const gp_Ax22d& Axis() const noexcept { return pos; }
 
   //! Returns the distance between the focus and the
   //! directrix of the parabola.
-  Standard_Real Parameter() const { return 2.0 * focalLength; }
+  constexpr Standard_Real Parameter() const noexcept { return 2.0 * focalLength; }
 
-  void Reverse()
+  void Reverse() noexcept
   {
     gp_Dir2d aTemp = pos.YDirection();
     aTemp.Reverse();
@@ -187,23 +187,26 @@ public:
   //! Note:
   //! -   Reverse assigns the result to this parabola, while
   //! -   Reversed creates a new one.
-  Standard_NODISCARD gp_Parab2d Reversed() const;
+  Standard_NODISCARD gp_Parab2d Reversed() const noexcept;
 
   //! Returns true if the local coordinate system is direct
   //! and false in the other case.
-  Standard_Boolean IsDirect() const { return (pos.XDirection().Crossed(pos.YDirection())) >= 0.0; }
+  constexpr Standard_Boolean IsDirect() const noexcept
+  {
+    return (pos.XDirection().Crossed(pos.YDirection())) >= 0.0;
+  }
 
-  Standard_EXPORT void Mirror(const gp_Pnt2d& theP);
+  Standard_EXPORT void Mirror(const gp_Pnt2d& theP) noexcept;
 
   //! Performs the symmetrical transformation of a parabola with respect
   //! to the point theP which is the center of the symmetry
-  Standard_NODISCARD Standard_EXPORT gp_Parab2d Mirrored(const gp_Pnt2d& theP) const;
+  Standard_NODISCARD Standard_EXPORT gp_Parab2d Mirrored(const gp_Pnt2d& theP) const noexcept;
 
-  Standard_EXPORT void Mirror(const gp_Ax2d& theA);
+  Standard_EXPORT void Mirror(const gp_Ax2d& theA) noexcept;
 
   //! Performs the symmetrical transformation of a parabola with respect
   //! to an axis placement which is the axis of the symmetry.
-  Standard_NODISCARD Standard_EXPORT gp_Parab2d Mirrored(const gp_Ax2d& theA) const;
+  Standard_NODISCARD Standard_EXPORT gp_Parab2d Mirrored(const gp_Ax2d& theA) const noexcept;
 
   void Rotate(const gp_Pnt2d& theP, const Standard_Real theAng) { pos.Rotate(theP, theAng); }
 
@@ -228,21 +231,25 @@ public:
   //! Transforms an parabola with the transformation theT from class Trsf2d.
   Standard_NODISCARD gp_Parab2d Transformed(const gp_Trsf2d& theT) const;
 
-  void Translate(const gp_Vec2d& theV) { pos.Translate(theV); }
+  constexpr void Translate(const gp_Vec2d& theV) noexcept { pos.Translate(theV); }
 
   //! Translates a parabola in the direction of the vectorthe theV.
   //! The magnitude of the translation is the vector's magnitude.
-  Standard_NODISCARD gp_Parab2d Translated(const gp_Vec2d& theV) const
+  Standard_NODISCARD gp_Parab2d Translated(const gp_Vec2d& theV) const noexcept
   {
     gp_Parab2d aPrb = *this;
     aPrb.pos.Translate(theV);
     return aPrb;
   }
 
-  void Translate(const gp_Pnt2d& theP1, const gp_Pnt2d& theP2) { pos.Translate(theP1, theP2); }
+  constexpr void Translate(const gp_Pnt2d& theP1, const gp_Pnt2d& theP2) noexcept
+  {
+    pos.Translate(theP1, theP2);
+  }
 
   //! Translates a parabola from the point theP1 to the point theP2.
-  Standard_NODISCARD gp_Parab2d Translated(const gp_Pnt2d& theP1, const gp_Pnt2d& theP2) const
+  Standard_NODISCARD gp_Parab2d Translated(const gp_Pnt2d& theP1,
+                                           const gp_Pnt2d& theP2) const noexcept
   {
     gp_Parab2d aPrb = *this;
     aPrb.pos.Translate(theP1, theP2);
@@ -256,7 +263,7 @@ private:
 
 //=================================================================================================
 
-inline gp_Ax2d gp_Parab2d::Directrix() const
+inline gp_Ax2d gp_Parab2d::Directrix() const noexcept
 {
   gp_Pnt2d aP(pos.Location().X() - focalLength * pos.XDirection().X(),
               pos.Location().Y() - focalLength * pos.XDirection().Y());
@@ -266,7 +273,7 @@ inline gp_Ax2d gp_Parab2d::Directrix() const
 
 //=================================================================================================
 
-inline gp_Parab2d gp_Parab2d::Reversed() const
+inline gp_Parab2d gp_Parab2d::Reversed() const noexcept
 {
   gp_Parab2d aP    = *this;
   gp_Dir2d   aTemp = pos.YDirection();
index d7adb89ab55a5126f2cbaaa8b65d7db4b26778a4..7fa69d586f8e98ca5d3cfab00cecaaa510e8c564 100644 (file)
@@ -24,7 +24,7 @@
 #include <Standard_Dump.hxx>
 #include <Standard_OutOfRange.hxx>
 
-void gp_Pnt2d::Transform(const gp_Trsf2d& T)
+void gp_Pnt2d::Transform(const gp_Trsf2d& T) noexcept
 {
   if (T.Form() == gp_Identity)
   {
@@ -49,7 +49,7 @@ void gp_Pnt2d::Transform(const gp_Trsf2d& T)
   }
 }
 
-void gp_Pnt2d::Mirror(const gp_Pnt2d& P)
+void gp_Pnt2d::Mirror(const gp_Pnt2d& P) noexcept
 {
   coord.Reverse();
   gp_XY XY = P.coord;
@@ -57,21 +57,21 @@ void gp_Pnt2d::Mirror(const gp_Pnt2d& P)
   coord.Add(XY);
 }
 
-gp_Pnt2d gp_Pnt2d::Mirrored(const gp_Pnt2d& P) const
+gp_Pnt2d gp_Pnt2d::Mirrored(const gp_Pnt2d& P) const noexcept
 {
   gp_Pnt2d Pres = *this;
   Pres.Mirror(P);
   return Pres;
 }
 
-void gp_Pnt2d::Mirror(const gp_Ax2d& A)
+void gp_Pnt2d::Mirror(const gp_Ax2d& A) noexcept
 {
   gp_Trsf2d T;
   T.SetMirror(A);
   T.Transforms(coord);
 }
 
-gp_Pnt2d gp_Pnt2d::Mirrored(const gp_Ax2d& A) const
+gp_Pnt2d gp_Pnt2d::Mirrored(const gp_Ax2d& A) const noexcept
 {
   gp_Pnt2d P = *this;
   P.Mirror(A);
index 8defa50dc54320cf5df5763881ee0ce7be81e30e..29887c0a01c6fd24ae5aedbc8f4c59368e762826 100644 (file)
@@ -120,15 +120,15 @@ public:
   //! Performs the symmetrical transformation of a point
   //! with respect to the point theP which is the center of
   //! the symmetry.
-  Standard_EXPORT void Mirror(const gp_Pnt2d& theP);
+  Standard_EXPORT void Mirror(const gp_Pnt2d& theP) noexcept;
 
   //! Performs the symmetrical transformation of a point
   //! with respect to an axis placement which is the axis
-  Standard_NODISCARD Standard_EXPORT gp_Pnt2d Mirrored(const gp_Pnt2d& theP) const;
+  Standard_NODISCARD Standard_EXPORT gp_Pnt2d Mirrored(const gp_Pnt2d& theP) const noexcept;
 
-  Standard_EXPORT void Mirror(const gp_Ax2d& theA);
+  Standard_EXPORT void Mirror(const gp_Ax2d& theA) noexcept;
 
-  Standard_NODISCARD Standard_EXPORT gp_Pnt2d Mirrored(const gp_Ax2d& theA) const;
+  Standard_NODISCARD Standard_EXPORT gp_Pnt2d Mirrored(const gp_Ax2d& theA) const noexcept;
 
   //! Rotates a point. theA1 is the axis of the rotation.
   //! Ang is the angular value of the rotation in radians.
@@ -153,7 +153,7 @@ public:
   }
 
   //! Transforms a point with the transformation theT.
-  Standard_EXPORT void Transform(const gp_Trsf2d& theT);
+  Standard_EXPORT void Transform(const gp_Trsf2d& theT) noexcept;
 
   Standard_NODISCARD gp_Pnt2d Transformed(const gp_Trsf2d& theT) const
   {
index c830b75fe719fe6dc033c243afb9fec9b0e78b5a..b565610e95de3162b1e38dea9a2a9cd8ce63036f 100644 (file)
@@ -28,7 +28,7 @@
 #include <gp_XY.hxx>
 #include <Standard_ConstructionError.hxx>
 
-void gp_Trsf2d::SetMirror(const gp_Ax2d& A)
+void gp_Trsf2d::SetMirror(const gp_Ax2d& A) noexcept
 {
   shape              = gp_Ax1Mirror;
   scale              = -1.0;
index 27c67ffa34e14d55aca25936fd5742feb87ab2a3..3c4e1af42bed1576cec72ee3a689b77be60871ef 100644 (file)
@@ -55,11 +55,11 @@ public:
 
   //! Changes the transformation into a symmetrical transformation.
   //! theP is the center of the symmetry.
-  void SetMirror(const gp_Pnt2d& theP);
+  void SetMirror(const gp_Pnt2d& theP) noexcept;
 
   //! Changes the transformation into a symmetrical transformation.
   //! theA is the center of the axial symmetry.
-  Standard_EXPORT void SetMirror(const gp_Ax2d& theA);
+  Standard_EXPORT void SetMirror(const gp_Ax2d& theA) noexcept;
 
   //! Changes the transformation into a rotation.
   //! theP is the rotation's center and theAng is the angular value of the
@@ -256,7 +256,7 @@ inline void gp_Trsf2d::SetRotation(const gp_Pnt2d& theP, const Standard_Real the
 
 //=================================================================================================
 
-inline void gp_Trsf2d::SetMirror(const gp_Pnt2d& theP)
+inline void gp_Trsf2d::SetMirror(const gp_Pnt2d& theP) noexcept
 {
   shape = gp_PntMirror;
   scale = -1.0;
index 1a9a99a6c645754593efa7da73472f2b37abeacf..c8027c165ff2fa499b6708809ba6777e19db3488 100644 (file)
@@ -103,7 +103,7 @@ gp_Vec2d gp_Vec2d::Mirrored(const gp_Ax2d& theA1) const
   return Vres;
 }
 
-void gp_Vec2d::Transform(const gp_Trsf2d& theT)
+void gp_Vec2d::Transform(const gp_Trsf2d& theT) noexcept
 {
   switch (theT.Form())
   {
index 8ce21202139a09f975678968abb673db961020be..0cbd249b3bf5ebb8b51ac35a8b39c4300f311057 100644 (file)
@@ -339,7 +339,7 @@ public:
     return aV;
   }
 
-  Standard_EXPORT void Transform(const gp_Trsf2d& theT);
+  Standard_EXPORT void Transform(const gp_Trsf2d& theT) noexcept;
 
   //! Transforms a vector with a Trsf from gp.
   Standard_NODISCARD gp_Vec2d Transformed(const gp_Trsf2d& theT) const
index f7f043c428e875302839771889a017a4f996f7b1..35c07aea8c4c235414f5ae5036bf1d54930a12ff 100644 (file)
@@ -1077,7 +1077,6 @@ void GeomInt_IntSS::TreatRLine(const Handle(IntPatch_RLine)&      theRL,
   Handle(GeomAdaptor_Surface) aGAHS;
   Handle(Adaptor2d_Curve2d)   anAHC2d;
   Standard_Real               tf, tl;
-  gp_Lin2d                    aL;
   // It is assumed that 2d curve is 2d line (rectangular surface domain)
   if (theRL->IsArcOnS1())
   {