From fe0b470d734d63901e36a7f71a5b1321ff04e9cd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Wed, 20 Mar 2024 21:45:17 +0100 Subject: [PATCH] Math: doc++ --- src/Magnum/Math/Bezier.h | 10 +++++----- src/Magnum/Math/BitVector.h | 10 +++++----- src/Magnum/Math/Color.h | 4 ++-- src/Magnum/Math/Complex.h | 4 ++-- src/Magnum/Math/CubicHermite.h | 8 ++++---- src/Magnum/Math/Dual.h | 4 ++-- src/Magnum/Math/DualComplex.h | 16 ++++++++-------- src/Magnum/Math/DualQuaternion.h | 18 +++++++++--------- src/Magnum/Math/Frustum.h | 8 ++++---- src/Magnum/Math/Matrix.h | 2 +- src/Magnum/Math/Matrix3.h | 2 +- src/Magnum/Math/Quaternion.h | 4 ++-- src/Magnum/Math/Range.h | 18 +++++++----------- src/Magnum/Math/RectangularMatrix.h | 2 +- src/Magnum/Math/Vector.h | 2 +- 15 files changed, 54 insertions(+), 58 deletions(-) diff --git a/src/Magnum/Math/Bezier.h b/src/Magnum/Math/Bezier.h index 9edeac5cf..f51743226 100644 --- a/src/Magnum/Math/Bezier.h +++ b/src/Magnum/Math/Bezier.h @@ -120,26 +120,26 @@ template class Bezier { */ constexpr explicit Bezier(ZeroInitT) noexcept: Bezier{typename Containers::Implementation::GenerateSequence::Type{}, ZeroInit} {} - /** @brief Construct Bézier without initializing the contents */ + /** @brief Construct a Bézier without initializing the contents */ explicit Bezier(Magnum::NoInitT) noexcept: Bezier{typename Containers::Implementation::GenerateSequence::Type{}, Magnum::NoInit} {} - /** @brief Construct Bézier curve with given array of control points */ + /** @brief Construct a Bézier curve with given array of control points */ template constexpr /*implicit*/ Bezier(const Vector& first, U... next) noexcept: _data{first, next...} { static_assert(sizeof...(U) + 1 == order + 1, "Wrong number of arguments"); } /** - * @brief Construct Bézier curve from another of different type + * @brief Construct a Bézier curve from another of different type * * Performs only default casting on the values, no rounding or * anything else. */ template constexpr explicit Bezier(const Bezier& other) noexcept: Bezier{typename Containers::Implementation::GenerateSequence::Type{}, other} {} - /** @brief Construct Bézier curve from external representation */ + /** @brief Construct a Bézier curve from external representation */ template::from(std::declval()))> constexpr explicit Bezier(const U& other) noexcept: Bezier{Implementation::BezierConverter::from(other)} {} - /** @brief Convert Bézier curve to external representation */ + /** @brief Convert the Bézier curve to external representation */ template::to(std::declval>()))> constexpr explicit operator U() const { return Implementation::BezierConverter::to(*this); } diff --git a/src/Magnum/Math/BitVector.h b/src/Magnum/Math/BitVector.h index dd8447282..f40334c45 100644 --- a/src/Magnum/Math/BitVector.h +++ b/src/Magnum/Math/BitVector.h @@ -100,14 +100,14 @@ template class BitVector { */ constexpr /*implicit*/ BitVector() noexcept: _data{} {} - /** @brief Construct a zero-filled boolean vector */ + /** @brief Construct a zero-filled bit vector */ constexpr explicit BitVector(ZeroInitT) noexcept: _data{} {} /** @brief Construct without initializing the contents */ explicit BitVector(Magnum::NoInitT) noexcept {} /** - * @brief Construct a boolean vector from segment values + * @brief Construct a bit vector from segment values * @param first Value for first 8bit segment * @param next Values for next Bbit segments */ @@ -117,17 +117,17 @@ template class BitVector { template::type> constexpr /*implicit*/ BitVector(UnsignedByte first, T... next) noexcept: _data{first, UnsignedByte(next)...} {} #endif - /** @brief Construct a boolean vector with one value for all fields */ + /** @brief Construct a bit vector with one value for all fields */ #ifdef DOXYGEN_GENERATING_OUTPUT explicit BitVector(T value) noexcept; #else template::value && size != 1, bool>::type> constexpr explicit BitVector(T value) noexcept: BitVector(typename Containers::Implementation::GenerateSequence::Type{}, value ? FullSegmentMask : 0) {} #endif - /** @brief Construct a boolean vector from external representation */ + /** @brief Construct a bit vector from external representation */ template::from(std::declval()))> constexpr explicit BitVector(const U& other) noexcept: BitVector{Implementation::BitVectorConverter::from(other)} {} - /** @brief Convert a boolean vector to external representation */ + /** @brief Convert the bit vector to external representation */ template::to(std::declval>()))> constexpr explicit operator U() const { return Implementation::BitVectorConverter::to(*this); } diff --git a/src/Magnum/Math/Color.h b/src/Magnum/Math/Color.h index 47b8dcb56..99f4b8f1d 100644 --- a/src/Magnum/Math/Color.h +++ b/src/Magnum/Math/Color.h @@ -574,7 +574,7 @@ template class Color3: public Vector3 { /** @copydoc Vector::Vector(const BitVector&) */ constexpr explicit Color3(const BitVector3& other) noexcept: Vector3{other} {} - /** @brief Construct color from external representation */ + /** @brief Construct a color from external representation */ template::from(std::declval())) @@ -1062,7 +1062,7 @@ class Color4: public Vector4 { /** @copydoc Vector::Vector(const BitVector&) */ constexpr explicit Color4(const BitVector4& other) noexcept: Vector4{other} {} - /** @brief Construct color from external representation */ + /** @brief Construct a color from external representation */ template::from(std::declval())) diff --git a/src/Magnum/Math/Complex.h b/src/Magnum/Math/Complex.h index eac7cbb73..d62d96582 100644 --- a/src/Magnum/Math/Complex.h +++ b/src/Magnum/Math/Complex.h @@ -116,7 +116,7 @@ template class Complex { } /** - * @brief Create complex number from rotation matrix + * @brief Create a complex number from a rotation matrix * * Expects that the matrix is a pure rotation, i.e. orthogonal and * without any reflection. See @ref Matrix3::rotation() const for an @@ -179,7 +179,7 @@ template class Complex { /** @brief Construct a complex number from external representation */ template::from(std::declval()))> constexpr explicit Complex(const U& other): Complex{Implementation::ComplexConverter::from(other)} {} - /** @brief Convert a complex number to external representation */ + /** @brief Convert the complex number to external representation */ template::to(std::declval>()))> constexpr explicit operator U() const { return Implementation::ComplexConverter::to(*this); } diff --git a/src/Magnum/Math/CubicHermite.h b/src/Magnum/Math/CubicHermite.h index ac5bf5b27..f9bd0585f 100644 --- a/src/Magnum/Math/CubicHermite.h +++ b/src/Magnum/Math/CubicHermite.h @@ -60,7 +60,7 @@ template class CubicHermite { typedef T Type; /**< @brief Underlying data type */ /** - * @brief Create cubic Hermite spline point from adjacent Bézier curve segments + * @brief Create a cubic Hermite spline point from adjacent Bézier curve segments * * Given two adjacent cubic Bézier curve segments defined by points * @f$ \boldsymbol{a}_i @f$ and @f$ \boldsymbol{b}_i @f$, @@ -125,11 +125,11 @@ template class CubicHermite { */ template::value>::type> constexpr explicit CubicHermite(IdentityInitT) noexcept: _inTangent{ZeroInit}, _point{IdentityInit}, _outTangent{ZeroInit} {} - /** @brief Construct cubic Hermite spline point without initializing its contents */ + /** @brief Construct a cubic Hermite spline point without initializing its contents */ explicit CubicHermite(Magnum::NoInitT) noexcept: CubicHermite{Magnum::NoInit, typename std::conditional::value, Magnum::NoInitT*, void*>::type{}} {} /** - * @brief Construct cubic Hermite spline point with given control points + * @brief Construct a cubic Hermite spline point with given control points * @param inTangent In-tangent @f$ \boldsymbol{m} @f$ * @param point Point @f$ \boldsymbol{p} @f$ * @param outTangent Out-tangent @f$ \boldsymbol{n} @f$ @@ -137,7 +137,7 @@ template class CubicHermite { constexpr /*implicit*/ CubicHermite(const T& inTangent, const T& point, const T& outTangent) noexcept: _inTangent{inTangent}, _point{point}, _outTangent{outTangent} {} /** - * @brief Construct cubic Hermite spline point from another of different type + * @brief Construct a cubic Hermite spline point from another of different type * * Performs only default casting on the values, no rounding or * anything else. diff --git a/src/Magnum/Math/Dual.h b/src/Magnum/Math/Dual.h index cdfaf06f3..5067416c6 100644 --- a/src/Magnum/Math/Dual.h +++ b/src/Magnum/Math/Dual.h @@ -95,7 +95,7 @@ template class Dual { #endif /** - * @brief Construct dual number from real and dual part + * @brief Construct a dual number from real and dual part * * @f[ * \hat a = a_0 + \epsilon a_\epsilon @@ -111,7 +111,7 @@ template class Dual { #endif /** - * @brief Construct dual number from another of different type + * @brief Construct a dual number from another of different type * * Performs only default casting on the values, no rounding or anything * else. Example usage: diff --git a/src/Magnum/Math/DualComplex.h b/src/Magnum/Math/DualComplex.h index 7478a4536..d786f3a3e 100644 --- a/src/Magnum/Math/DualComplex.h +++ b/src/Magnum/Math/DualComplex.h @@ -99,7 +99,7 @@ template class DualComplex: public Dual> { } /** - * @brief Create dual complex number from rotation matrix + * @brief Create a dual complex number from rotation matrix * * Expects that the matrix represents rigid transformation. * @see @ref toMatrix(), @ref Complex::fromMatrix(), @@ -112,7 +112,7 @@ template class DualComplex: public Dual> { } /** - * @brief Create dual complex from rotation complex and translation vector + * @brief Create a dual complex from rotation complex and translation vector * @m_since_latest * * @f[ @@ -144,14 +144,14 @@ template class DualComplex: public Dual> { */ constexpr explicit DualComplex(IdentityInitT) noexcept: Dual>({}, {T(0), T(0)}) {} - /** @brief Construct zero-initialized dual complex number */ + /** @brief Construct a zero-initialized dual complex number */ constexpr explicit DualComplex(ZeroInitT) noexcept: Dual>{Complex{ZeroInit}, Complex{ZeroInit}} {} /** @brief Construct without initializing the contents */ explicit DualComplex(Magnum::NoInitT) noexcept: Dual>{Magnum::NoInit} {} /** - * @brief Construct dual complex number from real and dual part + * @brief Construct a dual complex number from real and dual part * * @f[ * \hat c = c_0 + \epsilon c_\epsilon @@ -166,7 +166,7 @@ template class DualComplex: public Dual> { ambiguous with the above */ /** - * @brief Construct dual complex number from vector + * @brief Construct a dual complex number from vector * * To be used in transformations later. @f[ * \hat c = (0 + i1) + \epsilon(v_x + iv_y) @@ -175,20 +175,20 @@ template class DualComplex: public Dual> { constexpr explicit DualComplex(const Vector2& vector) noexcept: Dual>({}, Complex(vector)) {} /** - * @brief Construct dual complex number from another of different type + * @brief Construct a dual complex number from another of different type * * Performs only default casting on the values, no rounding or anything * else. */ template constexpr explicit DualComplex(const DualComplex& other) noexcept: Dual>{other} {} - /** @brief Construct dual complex number from external representation */ + /** @brief Construct a dual complex number from external representation */ template::from(std::declval()))> constexpr explicit DualComplex(const U& other): DualComplex{Implementation::DualComplexConverter::from(other)} {} /** @brief Copy constructor */ constexpr /*implicit*/ DualComplex(const Dual>& other) noexcept: Dual>(other) {} - /** @brief Convert dual complex number to external representation */ + /** @brief Convert the dual complex number to external representation */ template::to(std::declval>()))> constexpr explicit operator U() const { return Implementation::DualComplexConverter::to(*this); } diff --git a/src/Magnum/Math/DualQuaternion.h b/src/Magnum/Math/DualQuaternion.h index 7d61ca0af..87aa4b532 100644 --- a/src/Magnum/Math/DualQuaternion.h +++ b/src/Magnum/Math/DualQuaternion.h @@ -236,7 +236,7 @@ template class DualQuaternion: public Dual> { } /** - * @brief Create dual quaternion from transformation matrix + * @brief Create a dual quaternion from a transformation matrix * * Expects that the matrix represents rigid transformation. * @see @ref toMatrix(), @ref Quaternion::fromMatrix(), @@ -251,7 +251,7 @@ template class DualQuaternion: public Dual> { } /** - * @brief Create dual quaternion from rotation quaternion and translation vector + * @brief Create a dual quaternion from a rotation quaternion and a translation vector * @m_since_latest * * @f[ @@ -283,14 +283,14 @@ template class DualQuaternion: public Dual> { */ constexpr explicit DualQuaternion(IdentityInitT) noexcept: Dual>{{}, {{}, T(0)}} {} - /** @brief Construct zero-initialized dual quaternion */ + /** @brief Construct a zero-initialized dual quaternion */ constexpr explicit DualQuaternion(ZeroInitT) noexcept: Dual>{Quaternion{ZeroInit}, Quaternion{ZeroInit}} {} /** @brief Construct without initializing the contents */ explicit DualQuaternion(Magnum::NoInitT) noexcept: Dual>{Magnum::NoInit} {} /** - * @brief Construct dual quaternion from real and dual part + * @brief Construct a dual quaternion from a real and a dual part * * @f[ * \hat q = q_0 + \epsilon q_\epsilon @@ -302,7 +302,7 @@ template class DualQuaternion: public Dual> { constexpr /*implicit*/ DualQuaternion(const Quaternion& real, const Quaternion& dual = Quaternion({}, T(0))) noexcept: Dual>(real, dual) {} /** - * @brief Construct dual quaternion from dual vector and scalar parts + * @brief Construct a dual quaternion from dual vector and scalar parts * * @f[ * \hat q = [\hat{\boldsymbol v}, \hat s] = [\boldsymbol v_0, s_0] + \epsilon [\boldsymbol v_\epsilon, s_\epsilon] @@ -311,7 +311,7 @@ template class DualQuaternion: public Dual> { constexpr /*implicit*/ DualQuaternion(const Dual>& vector, const Dual& scalar) noexcept: Dual>{{vector.real(), scalar.real()}, {vector.dual(), scalar.dual()}} {} /** - * @brief Construct dual quaternion from vector + * @brief Construct a dual quaternion from a vector * * To be used in transformations later. @f[ * \hat q = [\boldsymbol 0, 1] + \epsilon [\boldsymbol v, 0] @@ -321,20 +321,20 @@ template class DualQuaternion: public Dual> { constexpr explicit DualQuaternion(const Vector3& vector) noexcept: Dual>({}, {vector, T(0)}) {} /** - * @brief Construct dual quaternion from another of different type + * @brief Construct a dual quaternion from another of different type * * Performs only default casting on the values, no rounding or anything * else. */ template constexpr explicit DualQuaternion(const DualQuaternion& other) noexcept: Dual>(other) {} - /** @brief Construct dual quaternion from external representation */ + /** @brief Construct a dual quaternion from external representation */ template::from(std::declval()))> constexpr explicit DualQuaternion(const U& other): DualQuaternion{Implementation::DualQuaternionConverter::from(other)} {} /** @brief Copy constructor */ constexpr /*implicit*/ DualQuaternion(const Dual>& other) noexcept: Dual>(other) {} - /** @brief Convert dual quaternion to external representation */ + /** @brief Convert the dual quaternion to external representation */ template::to(std::declval>()))> constexpr explicit operator U() const { return Implementation::DualQuaternionConverter::to(*this); } diff --git a/src/Magnum/Math/Frustum.h b/src/Magnum/Math/Frustum.h index 96449d631..6f454ddac 100644 --- a/src/Magnum/Math/Frustum.h +++ b/src/Magnum/Math/Frustum.h @@ -67,7 +67,7 @@ bottom (index `2`), top (index `3`), near (index `4`) and far (index `5`). */ template class Frustum { public: - /** @brief Create a frustum from projection matrix */ + /** @brief Create a frustum from a projection matrix */ static Frustum fromMatrix(const Matrix4& m) { return {m.row(3) + m.row(0), m.row(3) - m.row(0), @@ -105,17 +105,17 @@ template class Frustum { constexpr /*implicit*/ Frustum(const Vector4& left, const Vector4& right, const Vector4& bottom, const Vector4& top, const Vector4& near, const Vector4& far) noexcept: _data{left, right, bottom, top, near, far} {} /** - * @brief Construct frustum from another of different type + * @brief Construct a frustum from another of different type * * Performs only default casting on the values, no rounding or * anything else. */ template constexpr explicit Frustum(const Frustum& other) noexcept; - /** @brief Construct frustum from external representation */ + /** @brief Construct a frustum from external representation */ template::from(std::declval()))> constexpr explicit Frustum(const U& other) noexcept: Frustum{Implementation::FrustumConverter::from(other)} {} - /** @brief Convert frustum to external representation */ + /** @brief Convert the frustum to external representation */ template::to(std::declval>()))> constexpr explicit operator U() const { return Implementation::FrustumConverter::to(*this); } diff --git a/src/Magnum/Math/Matrix.h b/src/Magnum/Math/Matrix.h index 704f67d4a..cffdcb865 100644 --- a/src/Magnum/Math/Matrix.h +++ b/src/Magnum/Math/Matrix.h @@ -99,7 +99,7 @@ template class Matrix: public RectangularMatrix constexpr explicit Matrix(const RectangularMatrix& other) noexcept: RectangularMatrix(other) {} - /** @brief Construct matrix from external representation */ + /** @brief Construct a matrix from external representation */ template::from(std::declval()))> constexpr explicit Matrix(const U& other): RectangularMatrix(Implementation::RectangularMatrixConverter::from(other)) {} /** @copydoc RectangularMatrix::RectangularMatrix(IdentityInitT, const RectangularMatrix&, T) */ diff --git a/src/Magnum/Math/Matrix3.h b/src/Magnum/Math/Matrix3.h index 060ff7d65..5e0f0ee47 100644 --- a/src/Magnum/Math/Matrix3.h +++ b/src/Magnum/Math/Matrix3.h @@ -258,7 +258,7 @@ template class Matrix3: public Matrix3x3 { static Matrix3 projection(const Vector2& bottomLeft, const Vector2& topRight); /** - * @brief Create matrix from rotation/scaling part and translation part + * @brief Create a matrix from a rotation/scaling part and a translation part * @param rotationScaling Rotation/scaling part (upper-left 2x2 * matrix) * @param translation Translation part (first two elements of diff --git a/src/Magnum/Math/Quaternion.h b/src/Magnum/Math/Quaternion.h index f776953cd..d13a72732 100644 --- a/src/Magnum/Math/Quaternion.h +++ b/src/Magnum/Math/Quaternion.h @@ -407,10 +407,10 @@ template class Quaternion { */ template constexpr explicit Quaternion(const Quaternion& other) noexcept: _vector{other._vector}, _scalar{T(other._scalar)} {} - /** @brief Construct quaternion from external representation */ + /** @brief Construct a quaternion from external representation */ template::from(std::declval()))> constexpr explicit Quaternion(const U& other): Quaternion{Implementation::QuaternionConverter::from(other)} {} - /** @brief Convert quaternion to external representation */ + /** @brief Convert the quaternion to external representation */ template::to(std::declval>()))> constexpr explicit operator U() const { return Implementation::QuaternionConverter::to(*this); } diff --git a/src/Magnum/Math/Range.h b/src/Magnum/Math/Range.h index 47e85b33c..abe421e9b 100644 --- a/src/Magnum/Math/Range.h +++ b/src/Magnum/Math/Range.h @@ -100,7 +100,7 @@ template class Range { typedef typename Implementation::RangeTraits::Type VectorType; /** - * @brief Create a range from minimal coordinates and size + * @brief Create a range from minimal coordinates and a size * @param min Minimal coordinates * @param size Range size */ @@ -109,7 +109,7 @@ template class Range { } /** - * @brief Create a range from center and half size + * @brief Create a range from a center and a half size * @param center Range center * @param halfSize Half size * @@ -165,7 +165,7 @@ template class Range { constexpr /*implicit*/ Range(const Containers::Pair, Vector>& minmax) noexcept: _min{minmax.first()}, _max{minmax.second()} {} /** - * @brief Construct range from another of different type + * @brief Construct a range from another of different type * * Performs only default casting on the values, no rounding or * anything else. Example usage: @@ -174,10 +174,10 @@ template class Range { */ template constexpr explicit Range(const Range& other) noexcept: _min(other._min), _max(other._max) {} - /** @brief Construct range from external representation */ + /** @brief Construct a range from external representation */ template::from(std::declval()))> constexpr explicit Range(const U& other): Range{Implementation::RangeConverter::from(other)} {} - /** @brief Convert range to external representation */ + /** @brief Convert the range to external representation */ template::to(std::declval>()))> constexpr explicit operator U() const { return Implementation::RangeConverter::to(*this); } @@ -467,9 +467,7 @@ template class Range2D: public Range<2, T> { /** @copydoc Range(const Range&) */ template constexpr explicit Range2D(const Range2D& other) noexcept: Range<2, T>(other) {} - /** - * @brief Construct range from external representation - */ + /** @brief Construct a range from external representation */ template::from(std::declval())) @@ -618,9 +616,7 @@ template class Range3D: public Range<3, T> { /** @copydoc Range(const Range&) */ template constexpr explicit Range3D(const Range3D& other) noexcept: Range<3, T>(other) {} - /** - * @brief Construct range from external representation - */ + /** @brief Construct a range from external representation */ template::from(std::declval()))> constexpr explicit Range3D(const U& other) noexcept: Range<3, T>{Implementation::RangeConverter<3, T, U>::from(other)} {} /** @brief Copy constructor */ diff --git a/src/Magnum/Math/RectangularMatrix.h b/src/Magnum/Math/RectangularMatrix.h index 3f8701dc9..b64b39556 100644 --- a/src/Magnum/Math/RectangularMatrix.h +++ b/src/Magnum/Math/RectangularMatrix.h @@ -215,7 +215,7 @@ template class RectangularMatrix { /** @brief Construct a matrix from external representation */ template::from(std::declval()))> constexpr explicit RectangularMatrix(const U& other): RectangularMatrix(Implementation::RectangularMatrixConverter::from(other)) {} - /** @brief Convert a matrix to external representation */ + /** @brief Convert the matrix to external representation */ template::to(std::declval>()))> constexpr explicit operator U() const { return Implementation::RectangularMatrixConverter::to(*this); } diff --git a/src/Magnum/Math/Vector.h b/src/Magnum/Math/Vector.h index 8dc945992..97c625943 100644 --- a/src/Magnum/Math/Vector.h +++ b/src/Magnum/Math/Vector.h @@ -252,7 +252,7 @@ template class Vector { /** @brief Construct a vector from external representation */ template::from(std::declval()))> constexpr explicit Vector(const U& other) noexcept: Vector(Implementation::VectorConverter::from(other)) {} - /** @brief Convert a vector to external representation */ + /** @brief Convert the vector to external representation */ template::to(std::declval>()))> constexpr explicit operator U() const { return Implementation::VectorConverter::to(*this); }