From 13e16886a3cfa9fb989dfe4cd996cb24091044ba Mon Sep 17 00:00:00 2001 From: Christophe Riccio Date: Fri, 14 Oct 2011 17:43:06 +0100 Subject: [PATCH] Improve template paramter documentation --- glm/core/func_integer.hpp | 6 +- glm/core/func_matrix.hpp | 56 +++++++++----- glm/core/func_noise.hpp | 8 ++ glm/core/func_trigonometric.hpp | 116 +++++++++++++++++----------- glm/core/func_vector_relational.hpp | 64 +++++++++------ 5 files changed, 163 insertions(+), 87 deletions(-) diff --git a/glm/core/func_integer.hpp b/glm/core/func_integer.hpp index 33613aa2..5e438dee 100644 --- a/glm/core/func_integer.hpp +++ b/glm/core/func_integer.hpp @@ -161,7 +161,7 @@ namespace glm /// @see - GLSL bitCount man page /// @see - GLSL 4.20.8 specification, section 8.8 /// - /// @todo Clarify the declaration to specify that scalars are suported + /// @todo Clarify the declaration to specify that scalars are suported. template class genIUType> typename genIUType::signed_type bitCount(genIUType const & Value); @@ -174,7 +174,7 @@ namespace glm /// @see - GLSL findLSB man page /// @see - GLSL 4.20.8 specification, section 8.8 /// - /// @todo Clarify the declaration to specify that scalars are suported + /// @todo Clarify the declaration to specify that scalars are suported. template class genIUType> typename genIUType::signed_type findLSB(genIUType const & Value); @@ -188,7 +188,7 @@ namespace glm /// @see - GLSL findMSB man page /// @see - GLSL 4.20.8 specification, section 8.8 /// - /// @todo Clarify the declaration to specify that scalars are suported + /// @todo Clarify the declaration to specify that scalars are suported. template class genIUType> typename genIUType::signed_type findMSB(genIUType const & Value); diff --git a/glm/core/func_matrix.hpp b/glm/core/func_matrix.hpp index d50bbc13..5755020c 100644 --- a/glm/core/func_matrix.hpp +++ b/glm/core/func_matrix.hpp @@ -47,6 +47,8 @@ namespace glm /// Multiply matrix x by matrix y component-wise, i.e., /// result[i][j] is the scalar product of x[i][j] and y[i][j]. + /// + /// @tparam matType Floating-point matrix types. /// /// @see - GLSL matrixCompMult man page /// @see - GLSL 4.20.8 specification, section 8.6 @@ -58,15 +60,21 @@ namespace glm /// Treats the first parameter c as a column vector /// and the second parameter r as a row vector /// and does a linear algebraic matrix multiply c * r. + /// + /// @tparam matType Floating-point matrix types. /// /// @see - GLSL outerProduct man page /// @see - GLSL 4.20.8 specification, section 8.6 + /// + /// @todo Clarify the declaration to specify that matType doesn't have to be provided when used. template matType outerProduct( vecType const & c, vecType const & r); /// Returns the transposed matrix of x + /// + /// @tparam matType Floating-point matrix types. /// /// @see - GLSL transpose man page /// @see - GLSL 4.20.8 specification, section 8.6 @@ -75,52 +83,64 @@ namespace glm matType const & x); /// Return the determinant of a mat2 matrix. + /// + /// @tparam valType Floating-point scalar types. /// /// @see - GLSL determinant man page /// @see - GLSL 4.20.8 specification, section 8.6 - template - typename detail::tmat2x2::value_type determinant( - detail::tmat2x2 const & m); + template + typename detail::tmat2x2::value_type determinant( + detail::tmat2x2 const & m); /// Return the determinant of a mat3 matrix. + /// + /// @tparam valType Floating-point scalar types. /// /// @see - GLSL determinant man page /// @see - GLSL 4.20.8 specification, section 8.6 - template - typename detail::tmat3x3::value_type determinant( - detail::tmat3x3 const & m); + template + typename detail::tmat3x3::value_type determinant( + detail::tmat3x3 const & m); /// Return the determinant of a mat4 matrix. + /// + /// @tparam valType Floating-point scalar types. /// /// @see - GLSL determinant man page /// @see - GLSL 4.20.8 specification, section 8.6 - template - typename detail::tmat4x4::value_type determinant( - detail::tmat4x4 const & m); + template + typename detail::tmat4x4::value_type determinant( + detail::tmat4x4 const & m); /// Return the inverse of a mat2 matrix. + /// + /// @tparam valType Floating-point scalar types. /// /// @see - GLSL inverse man page /// @see - GLSL 4.20.8 specification, section 8.6 - template - detail::tmat2x2 inverse( - detail::tmat2x2 const & m); + template + detail::tmat2x2 inverse( + detail::tmat2x2 const & m); /// Return the inverse of a mat3 matrix. + /// + /// @tparam valType Floating-point scalar types. /// /// @see - GLSL inverse man page /// @see - GLSL 4.20.8 specification, section 8.6 - template - detail::tmat3x3 inverse( - detail::tmat3x3 const & m); + template + detail::tmat3x3 inverse( + detail::tmat3x3 const & m); /// Return the inverse of a mat4 matrix. + /// + /// @tparam valType Floating-point scalar types. /// /// @see - GLSL inverse man page /// @see - GLSL 4.20.8 specification, section 8.6 - template - detail::tmat4x4 inverse( - detail::tmat4x4 const & m); + template + detail::tmat4x4 inverse( + detail::tmat4x4 const & m); /// @} }//namespace glm diff --git a/glm/core/func_noise.hpp b/glm/core/func_noise.hpp index 5e095af2..27971729 100644 --- a/glm/core/func_noise.hpp +++ b/glm/core/func_noise.hpp @@ -44,6 +44,8 @@ namespace glm /// @{ /// Returns a 1D noise value based on the input value x. + /// + /// @tparam genType Floating-point scalar or vector types. /// /// @see - GLSL noise1 man page /// @see - GLSL 4.20.8 specification, section 8.13 @@ -51,6 +53,8 @@ namespace glm typename genType::value_type noise1(genType const & x); /// Returns a 2D noise value based on the input value x. + /// + /// @tparam genType Floating-point scalar or vector types. /// /// @see - GLSL noise2 man page /// @see - GLSL 4.20.8 specification, section 8.13 @@ -58,6 +62,8 @@ namespace glm detail::tvec2 noise2(genType const & x); /// Returns a 3D noise value based on the input value x. + /// + /// @tparam genType Floating-point scalar or vector types. /// /// @see - GLSL noise3 man page /// @see - GLSL 4.20.8 specification, section 8.13 @@ -65,6 +71,8 @@ namespace glm detail::tvec3 noise3(genType const & x); /// Returns a 4D noise value based on the input value x. + /// + /// @tparam genType Floating-point scalar or vector types. /// /// @see - GLSL noise4 man page /// @see - GLSL 4.20.8 specification, section 8.13 diff --git a/glm/core/func_trigonometric.hpp b/glm/core/func_trigonometric.hpp index f6e7c98d..f048d43b 100644 --- a/glm/core/func_trigonometric.hpp +++ b/glm/core/func_trigonometric.hpp @@ -45,119 +45,149 @@ namespace glm /// @addtogroup core_func_trigonometric /// @{ - //! Converts degrees to radians and returns the result. - //! + /// Converts degrees to radians and returns the result. + /// + /// @tparam genType Floating-point scalar or vector types. + /// /// @see - GLSL radians man page /// @see - GLSL 4.20.8 specification, section 8.1 template genType radians(genType const & degrees); - //! Converts radians to degrees and returns the result. - //! + /// Converts radians to degrees and returns the result. + /// + /// @tparam genType Floating-point scalar or vector types. + /// /// @see - GLSL degrees man page /// @see - GLSL 4.20.8 specification, section 8.1 template genType degrees(genType const & radians); - //! The standard trigonometric sine function. - //! The values returned by this function will range from [-1, 1]. - //! + /// The standard trigonometric sine function. + /// The values returned by this function will range from [-1, 1]. + /// + /// @tparam genType Floating-point scalar or vector types. + /// /// @see - GLSL sin man page /// @see - GLSL 4.20.8 specification, section 8.1 template genType sin(genType const & angle); - //! The standard trigonometric cosine function. - //! The values returned by this function will range from [-1, 1]. - //! + /// The standard trigonometric cosine function. + /// The values returned by this function will range from [-1, 1]. + /// + /// @tparam genType Floating-point scalar or vector types. + /// /// @see - GLSL cos man page /// @see - GLSL 4.20.8 specification, section 8.1 template genType cos(genType const & angle); - //! The standard trigonometric tangent function. - //! + /// The standard trigonometric tangent function. + /// + /// @tparam genType Floating-point scalar or vector types. + /// /// @see - GLSL tan man page /// @see - GLSL 4.20.8 specification, section 8.1 template genType tan(genType const & angle); - //! Arc sine. Returns an angle whose sine is x. - //! The range of values returned by this function is [-PI/2, PI/2]. - //! Results are undefined if |x| > 1. - //! + /// Arc sine. Returns an angle whose sine is x. + /// The range of values returned by this function is [-PI/2, PI/2]. + /// Results are undefined if |x| > 1. + /// + /// @tparam genType Floating-point scalar or vector types. + /// /// @see - GLSL asin man page /// @see - GLSL 4.20.8 specification, section 8.1 template genType asin(genType const & x); - //! Arc cosine. Returns an angle whose sine is x. - //! The range of values returned by this function is [0, PI]. - //! Results are undefined if |x| > 1. - //! + /// Arc cosine. Returns an angle whose sine is x. + /// The range of values returned by this function is [0, PI]. + /// Results are undefined if |x| > 1. + /// + /// @tparam genType Floating-point scalar or vector types. + /// /// @see - GLSL acos man page /// @see - GLSL 4.20.8 specification, section 8.1 template genType acos(genType const & x); - //! Arc tangent. Returns an angle whose tangent is y/x. - //! The signs of x and y are used to determine what - //! quadrant the angle is in. The range of values returned - //! by this function is [-PI, PI]. Results are undefined - //! if x and y are both 0. - //! + /// Arc tangent. Returns an angle whose tangent is y/x. + /// The signs of x and y are used to determine what + /// quadrant the angle is in. The range of values returned + /// by this function is [-PI, PI]. Results are undefined + /// if x and y are both 0. + /// + /// @tparam genType Floating-point scalar or vector types. + /// /// @see - GLSL atan man page /// @see - GLSL 4.20.8 specification, section 8.1 template genType atan(genType const & y, genType const & x); - //! Arc tangent. Returns an angle whose tangent is y_over_x. - //! The range of values returned by this function is [-PI/2, PI/2]. - //! + /// Arc tangent. Returns an angle whose tangent is y_over_x. + /// The range of values returned by this function is [-PI/2, PI/2]. + /// + /// @tparam genType Floating-point scalar or vector types. + /// /// @see - GLSL atan man page /// @see - GLSL 4.20.8 specification, section 8.1 template genType atan(genType const & y_over_x); - //! Returns the hyperbolic sine function, (exp(x) - exp(-x)) / 2 - //! + /// Returns the hyperbolic sine function, (exp(x) - exp(-x)) / 2 + /// + /// @tparam genType Floating-point scalar or vector types. + /// /// @see - GLSL sinh man page /// @see - GLSL 4.20.8 specification, section 8.1 template genType sinh(genType const & angle); - //! Returns the hyperbolic cosine function, (exp(x) + exp(-x)) / 2 - //! + /// Returns the hyperbolic cosine function, (exp(x) + exp(-x)) / 2 + /// + /// @tparam genType Floating-point scalar or vector types. + /// /// @see - GLSL cosh man page /// @see - GLSL 4.20.8 specification, section 8.1 template genType cosh(genType const & angle); - //! Returns the hyperbolic tangent function, sinh(angle) / cosh(angle) - //! + /// Returns the hyperbolic tangent function, sinh(angle) / cosh(angle) + /// + /// @tparam genType Floating-point scalar or vector types. + /// /// @see - GLSL tanh man page /// @see - GLSL 4.20.8 specification, section 8.1 template genType tanh(genType const & angle); - //! Arc hyperbolic sine; returns the inverse of sinh. - //! + /// Arc hyperbolic sine; returns the inverse of sinh. + /// + /// @tparam genType Floating-point scalar or vector types. + /// /// @see - GLSL asinh man page /// @see - GLSL 4.20.8 specification, section 8.1 template genType asinh(genType const & x); - //! Arc hyperbolic cosine; returns the non-negative inverse - //! of cosh. Results are undefined if x < 1. - //! + /// Arc hyperbolic cosine; returns the non-negative inverse + /// of cosh. Results are undefined if x < 1. + /// + /// @tparam genType Floating-point scalar or vector types. + /// /// @see - GLSL acosh man page /// @see - GLSL 4.20.8 specification, section 8.1 template genType acosh(genType const & x); - //! Arc hyperbolic tangent; returns the inverse of tanh. - //! Results are undefined if abs(x) >= 1. - //! + /// Arc hyperbolic tangent; returns the inverse of tanh. + /// Results are undefined if abs(x) >= 1. + /// + /// @tparam genType Floating-point scalar or vector types. + /// /// @see - GLSL atanh man page /// @see - GLSL 4.20.8 specification, section 8.1 template diff --git a/glm/core/func_vector_relational.hpp b/glm/core/func_vector_relational.hpp index a3cce581..1da814b8 100644 --- a/glm/core/func_vector_relational.hpp +++ b/glm/core/func_vector_relational.hpp @@ -48,65 +48,83 @@ namespace glm /// @addtogroup core_func_vector_relational /// @{ - //! Returns the component-wise comparison result of x < y. - //! + /// Returns the component-wise comparison result of x < y. + /// + /// @tparam vecType Floating-point or integer vector types. + /// /// @see - GLSL lessThan man page /// @see - GLSL 4.20.8 specification, section 8.7 - //template class vecType> - //GLM_FUNC_QUALIFIER typename vecType::bool_type lessThan(vecType const & x, vecType const & y); + template + GLM_FUNC_QUALIFIER typename vecType::bool_type lessThan(vecType const & x, vecType const & y); - //! Returns the component-wise comparison of result x <= y. - //! + /// Returns the component-wise comparison of result x <= y. + /// + /// @tparam vecType Floating-point or integer vector types. + /// /// @see - GLSL lessThanEqual man page /// @see - GLSL 4.20.8 specification, section 8.7 template class vecType> GLM_FUNC_QUALIFIER typename vecType::bool_type lessThanEqual(vecType const & x, vecType const & y); - //! Returns the component-wise comparison of result x > y. - //! + /// Returns the component-wise comparison of result x > y. + /// + /// @tparam vecType Floating-point or integer vector types. + /// /// @see - GLSL greaterThan man page /// @see - GLSL 4.20.8 specification, section 8.7 template class vecType> GLM_FUNC_QUALIFIER typename vecType::bool_type greaterThan(vecType const & x, vecType const & y); - //! Returns the component-wise comparison of result x >= y. - //! + /// Returns the component-wise comparison of result x >= y. + /// + /// @tparam vecType Floating-point or integer vector types. + /// /// @see - GLSL greaterThanEqual man page /// @see - GLSL 4.20.8 specification, section 8.7 template class vecType> typename vecType::bool_type greaterThanEqual(vecType const & x, vecType const & y); - //! Returns the component-wise comparison of result x == y. - //! + /// Returns the component-wise comparison of result x == y. + /// + /// @tparam vecType Floating-point, integer or boolean vector types. + /// /// @see - GLSL equal man page /// @see - GLSL 4.20.8 specification, section 8.7 - //template class vecType> - //GLM_FUNC_QUALIFIER typename vecType::bool_type equal(vecType const & x, vecType const & y); + template class vecType> + GLM_FUNC_QUALIFIER typename vecType::bool_type equal(vecType const & x, vecType const & y); - //! Returns the component-wise comparison of result x != y. - //! + /// Returns the component-wise comparison of result x != y. + /// + /// @tparam vecType Floating-point, integer or boolean vector types. + /// /// @see - GLSL notEqual man page /// @see - GLSL 4.20.8 specification, section 8.7 template class vecType> typename vecType::bool_type notEqual(vecType const & x, vecType const & y); - //! Returns true if any component of x is true. - //! + /// Returns true if any component of x is true. + /// + /// @tparam vecType Boolean vector types. + /// /// @see - GLSL any man page /// @see - GLSL 4.20.8 specification, section 8.7 template