mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-14 13:30:48 +03:00
0030448: Coding - add typo detection to derivation creation methods using Standard_NODISCARD attribute
Added macro Standard_NODISCARD equivalent to C++17 attribute [[nodiscard]] for compilers that support this. Using Standard_NODISCARD macro for methods that create new object in gp, math, Geom, Bnd packages. Marked equivalent operators with Standard_NODISCARD, if they are defined close to relevant methods. Corrected code where warnings on unused result of calls to methods creating new objects are generated. In most cases it looks like spelling errors (e.g. Normalised() instead of Normalise())
This commit is contained in:
@@ -65,7 +65,7 @@ public:
|
||||
Standard_EXPORT void Reverse();
|
||||
|
||||
//! Returns a copy of <me> reversed.
|
||||
Standard_EXPORT Handle(Geom_Axis1Placement) Reversed() const;
|
||||
Standard_EXPORT Standard_NODISCARD Handle(Geom_Axis1Placement) Reversed() const;
|
||||
|
||||
//! Assigns V to the unit vector of this axis.
|
||||
Standard_EXPORT void SetDirection (const gp_Dir& V) Standard_OVERRIDE;
|
||||
|
@@ -117,7 +117,7 @@ public:
|
||||
Standard_EXPORT virtual Standard_Real ParametricTransformation (const gp_Trsf& T) const;
|
||||
|
||||
//! Returns a copy of <me> reversed.
|
||||
Standard_EXPORT Handle(Geom_Curve) Reversed() const;
|
||||
Standard_EXPORT Standard_NODISCARD Handle(Geom_Curve) Reversed() const;
|
||||
|
||||
//! Returns the value of the first parameter.
|
||||
//! Warnings :
|
||||
|
@@ -99,21 +99,21 @@ public:
|
||||
//! (see class Transformation of the package Geom).
|
||||
Standard_EXPORT virtual void Transform (const gp_Trsf& T) = 0;
|
||||
|
||||
Standard_EXPORT Handle(Geom_Geometry) Mirrored (const gp_Pnt& P) const;
|
||||
Standard_EXPORT Standard_NODISCARD Handle(Geom_Geometry) Mirrored (const gp_Pnt& P) const;
|
||||
|
||||
Standard_EXPORT Handle(Geom_Geometry) Mirrored (const gp_Ax1& A1) const;
|
||||
Standard_EXPORT Standard_NODISCARD Handle(Geom_Geometry) Mirrored (const gp_Ax1& A1) const;
|
||||
|
||||
Standard_EXPORT Handle(Geom_Geometry) Mirrored (const gp_Ax2& A2) const;
|
||||
Standard_EXPORT Standard_NODISCARD Handle(Geom_Geometry) Mirrored (const gp_Ax2& A2) const;
|
||||
|
||||
Standard_EXPORT Handle(Geom_Geometry) Rotated (const gp_Ax1& A1, const Standard_Real Ang) const;
|
||||
Standard_EXPORT Standard_NODISCARD Handle(Geom_Geometry) Rotated (const gp_Ax1& A1, const Standard_Real Ang) const;
|
||||
|
||||
Standard_EXPORT Handle(Geom_Geometry) Scaled (const gp_Pnt& P, const Standard_Real S) const;
|
||||
Standard_EXPORT Standard_NODISCARD Handle(Geom_Geometry) Scaled (const gp_Pnt& P, const Standard_Real S) const;
|
||||
|
||||
Standard_EXPORT Handle(Geom_Geometry) Transformed (const gp_Trsf& T) const;
|
||||
Standard_EXPORT Standard_NODISCARD Handle(Geom_Geometry) Transformed (const gp_Trsf& T) const;
|
||||
|
||||
Standard_EXPORT Handle(Geom_Geometry) Translated (const gp_Vec& V) const;
|
||||
Standard_EXPORT Standard_NODISCARD Handle(Geom_Geometry) Translated (const gp_Vec& V) const;
|
||||
|
||||
Standard_EXPORT Handle(Geom_Geometry) Translated (const gp_Pnt& P1, const gp_Pnt& P2) const;
|
||||
Standard_EXPORT Standard_NODISCARD Handle(Geom_Geometry) Translated (const gp_Pnt& P1, const gp_Pnt& P2) const;
|
||||
|
||||
//! Creates a new object which is a copy of this geometric object.
|
||||
Standard_EXPORT virtual Handle(Geom_Geometry) Copy() const = 0;
|
||||
|
@@ -79,7 +79,7 @@ public:
|
||||
//! Reverses the U direction of parametrization of <me>.
|
||||
//! The bounds of the surface are not modified.
|
||||
//! A copy of <me> is returned.
|
||||
Standard_EXPORT Handle(Geom_Surface) UReversed() const;
|
||||
Standard_EXPORT Standard_NODISCARD Handle(Geom_Surface) UReversed() const;
|
||||
|
||||
//! Returns the parameter on the Ureversed surface for
|
||||
//! the point of parameter U on <me>.
|
||||
@@ -100,7 +100,7 @@ public:
|
||||
//! Reverses the V direction of parametrization of <me>.
|
||||
//! The bounds of the surface are not modified.
|
||||
//! A copy of <me> is returned.
|
||||
Standard_EXPORT Handle(Geom_Surface) VReversed() const;
|
||||
Standard_EXPORT Standard_NODISCARD Handle(Geom_Surface) VReversed() const;
|
||||
|
||||
//! Returns the parameter on the Vreversed surface for
|
||||
//! the point of parameter V on <me>.
|
||||
|
@@ -160,12 +160,12 @@ public:
|
||||
//! Raised if the the transformation is singular. This means that
|
||||
//! the ScaleFactor is lower or equal to Resolution from
|
||||
//! package gp.
|
||||
Standard_EXPORT Handle(Geom_Transformation) Inverted() const;
|
||||
Standard_EXPORT Standard_NODISCARD Handle(Geom_Transformation) Inverted() const;
|
||||
|
||||
//! Computes the transformation composed with Other and <me>.
|
||||
//! <me> * Other.
|
||||
//! Returns a new transformation
|
||||
Standard_EXPORT Handle(Geom_Transformation) Multiplied (const Handle(Geom_Transformation)& Other) const;
|
||||
Standard_EXPORT Standard_NODISCARD Handle(Geom_Transformation) Multiplied (const Handle(Geom_Transformation)& Other) const;
|
||||
|
||||
//! Computes the transformation composed with Other and <me> .
|
||||
//! <me> = <me> * Other.
|
||||
|
@@ -47,7 +47,7 @@ public:
|
||||
|
||||
|
||||
//! Returns a copy of <me> reversed.
|
||||
Standard_EXPORT Handle(Geom_Vector) Reversed() const;
|
||||
Standard_EXPORT Standard_NODISCARD Handle(Geom_Vector) Reversed() const;
|
||||
|
||||
//! Computes the angular value, in radians, between this
|
||||
//! vector and vector Other. The result is a value between 0 and Pi.
|
||||
|
@@ -80,7 +80,7 @@ public:
|
||||
|
||||
|
||||
//! Adds the vector Other to <me>.
|
||||
Standard_EXPORT Handle(Geom_VectorWithMagnitude) Added (const Handle(Geom_Vector)& Other) const;
|
||||
Standard_EXPORT Standard_NODISCARD Handle(Geom_VectorWithMagnitude) Added (const Handle(Geom_Vector)& Other) const;
|
||||
|
||||
|
||||
//! Computes the cross product between <me> and Other
|
||||
@@ -106,12 +106,12 @@ public:
|
||||
|
||||
|
||||
//! Divides <me> by a scalar. A new vector is returned.
|
||||
Standard_EXPORT Handle(Geom_VectorWithMagnitude) Divided (const Standard_Real Scalar) const;
|
||||
Standard_EXPORT Standard_NODISCARD Handle(Geom_VectorWithMagnitude) Divided (const Standard_Real Scalar) const;
|
||||
|
||||
|
||||
//! Computes the product of the vector <me> by a scalar.
|
||||
//! A new vector is returned.
|
||||
Standard_EXPORT Handle(Geom_VectorWithMagnitude) Multiplied (const Standard_Real Scalar) const;
|
||||
Standard_EXPORT Standard_NODISCARD Handle(Geom_VectorWithMagnitude) Multiplied (const Standard_Real Scalar) const;
|
||||
|
||||
|
||||
//! Computes the product of the vector <me> by a scalar.
|
||||
@@ -127,14 +127,15 @@ public:
|
||||
//!
|
||||
//! Raised if the magnitude of the vector is lower or equal to
|
||||
//! Resolution from package gp.
|
||||
Standard_EXPORT Handle(Geom_VectorWithMagnitude) Normalized() const;
|
||||
Standard_EXPORT Standard_NODISCARD Handle(Geom_VectorWithMagnitude) Normalized() const;
|
||||
|
||||
//! Subtracts the Vector Other to <me>.
|
||||
Standard_EXPORT void Subtract (const Handle(Geom_Vector)& Other);
|
||||
|
||||
|
||||
//! Subtracts the vector Other to <me>. A new vector is returned.
|
||||
Standard_EXPORT Handle(Geom_VectorWithMagnitude) Subtracted (const Handle(Geom_Vector)& Other) const;
|
||||
Standard_EXPORT Standard_NODISCARD
|
||||
Handle(Geom_VectorWithMagnitude) Subtracted (const Handle(Geom_Vector)& Other) const;
|
||||
|
||||
//! Applies the transformation T to this vector.
|
||||
Standard_EXPORT void Transform (const gp_Trsf& T) Standard_OVERRIDE;
|
||||
|
Reference in New Issue
Block a user