Browse Source

Doc++

Fixed Doxygen warnings, improved some workarounds. Everything now uses
explicit references (except where it doesn't work).
pull/77/head
Vladimír Vondruš 12 years ago
parent
commit
664e765fd9
  1. 3
      src/Magnum/AbstractTexture.cpp
  2. 6
      src/Magnum/Attribute.h
  3. 6
      src/Magnum/Buffer.cpp
  4. 28
      src/Magnum/Buffer.h
  5. 16
      src/Magnum/Context.h
  6. 28
      src/Magnum/Math/Angle.h
  7. 12
      src/Magnum/Math/Complex.h
  8. 4
      src/Magnum/Math/DualComplex.h
  9. 8
      src/Magnum/Math/DualQuaternion.h
  10. 36
      src/Magnum/Math/Matrix3.h
  11. 47
      src/Magnum/Math/Matrix4.h
  12. 10
      src/Magnum/Math/Quaternion.h
  13. 8
      src/Magnum/Math/Vector.h
  14. 4
      src/Magnum/Resource.h
  15. 4
      src/Magnum/Shapes/Collision.h

3
src/Magnum/AbstractTexture.cpp

@ -168,7 +168,8 @@ void AbstractTexture::bindImplementationFallback(const GLint firstTextureUnit, c
} }
#ifndef MAGNUM_TARGET_GLES #ifndef MAGNUM_TARGET_GLES
void AbstractTexture::bindImplementationMulti(const GLint firstTextureUnit, const Containers::ArrayReference<AbstractTexture* const> textures) { /** @todoc const Containers::ArrayReference makes Doxygen grumpy */
void AbstractTexture::bindImplementationMulti(const GLint firstTextureUnit, Containers::ArrayReference<AbstractTexture* const> textures) {
Implementation::TextureState* const textureState = Context::current()->state().texture; Implementation::TextureState* const textureState = Context::current()->state().texture;
/* Create array of IDs and also update bindings in state tracker */ /* Create array of IDs and also update bindings in state tracker */

6
src/Magnum/Attribute.h

@ -43,9 +43,9 @@ namespace Implementation { template<class> struct Attribute; }
@brief Base class for attribute location and type @brief Base class for attribute location and type
For use in @ref AbstractShaderProgram subclasses. Template parameter @p location For use in @ref AbstractShaderProgram subclasses. Template parameter @p location
is vertex attribute location, number between `0` and @ref maxVertexAttributes(). is vertex attribute location, number between `0` and
To ensure compatibility, you should always have vertex attribute with location @ref AbstractShaderProgram::maxVertexAttributes(). To ensure compatibility, you
`0`. should always have vertex attribute with location `0`.
Template parameter @p T is the type which is used for shader attribute, e.g. Template parameter @p T is the type which is used for shader attribute, e.g.
@ref Vector4i for `ivec4`. DataType is type of passed data when adding vertex @ref Vector4i for `ivec4`. DataType is type of passed data when adding vertex

6
src/Magnum/Buffer.cpp

@ -378,7 +378,8 @@ void Buffer::bindImplementationMulti(const Target target, const GLuint firstInde
} }
#endif #endif
void Buffer::bindImplementationFallback(const Target target, const GLuint firstIndex, const Containers::ArrayReference<const std::tuple<Buffer*, GLintptr, GLsizeiptr>> buffers) { /** @todoc const Containers::ArrayReference makes Doxygen grumpy */
void Buffer::bindImplementationFallback(const Target target, const GLuint firstIndex, Containers::ArrayReference<const std::tuple<Buffer*, GLintptr, GLsizeiptr>> buffers) {
for(std::size_t i = 0; i != buffers.size(); ++i) { for(std::size_t i = 0; i != buffers.size(); ++i) {
if(buffers && std::get<0>(buffers[i])) if(buffers && std::get<0>(buffers[i]))
std::get<0>(buffers[i])->bind(target, firstIndex + i, std::get<1>(buffers[i]), std::get<2>(buffers[i])); std::get<0>(buffers[i])->bind(target, firstIndex + i, std::get<1>(buffers[i]), std::get<2>(buffers[i]));
@ -387,7 +388,8 @@ void Buffer::bindImplementationFallback(const Target target, const GLuint firstI
} }
#ifndef MAGNUM_TARGET_GLES #ifndef MAGNUM_TARGET_GLES
void Buffer::bindImplementationMulti(const Target target, const GLuint firstIndex, const Containers::ArrayReference<const std::tuple<Buffer*, GLintptr, GLsizeiptr>> buffers) { /** @todoc const Containers::ArrayReference makes Doxygen grumpy */
void Buffer::bindImplementationMulti(const Target target, const GLuint firstIndex, Containers::ArrayReference<const std::tuple<Buffer*, GLintptr, GLsizeiptr>> buffers) {
/** @todo use ArrayTuple */ /** @todo use ArrayTuple */
Containers::Array<GLuint> ids{buffers ? buffers.size() : 0}; Containers::Array<GLuint> ids{buffers ? buffers.size() : 0};
Containers::Array<GLintptr> offsetsSizes{buffers ? buffers.size()*2 : 0}; Containers::Array<GLintptr> offsetsSizes{buffers ? buffers.size()*2 : 0};

28
src/Magnum/Buffer.h

@ -690,9 +690,10 @@ class MAGNUM_EXPORT Buffer: public AbstractObject {
* any buffer is `nullptr`, given indexed target is unbound. The range * any buffer is `nullptr`, given indexed target is unbound. The range
* of indices must respect limits for given @p target. The offsets must * of indices must respect limits for given @p target. The offsets must
* respect alignment, which is 4 bytes for @ref Target::AtomicCounter * respect alignment, which is 4 bytes for @ref Target::AtomicCounter
* and implementation-defined for other targets. If @extension{ARB,multi_bind} * and implementation-defined for other targets. All the buffers must
* (part of OpenGL 4.4) is not available, the feature is emulated with * have allocated data store. If @extension{ARB,multi_bind} (part of
* sequence of @ref bind(Target, UnsignedInt, GLintptr, GLsizeiptr) / * OpenGL 4.4) is not available, the feature is emulated with sequence
* of @ref bind(Target, UnsignedInt, GLintptr, GLsizeiptr) /
* @ref unbind(Target, UnsignedInt) calls. * @ref unbind(Target, UnsignedInt) calls.
* @note This function is meant to be used only internally from * @note This function is meant to be used only internally from
* @ref AbstractShaderProgram subclasses. See its documentation * @ref AbstractShaderProgram subclasses. See its documentation
@ -717,10 +718,10 @@ class MAGNUM_EXPORT Buffer: public AbstractObject {
* Binds first buffer in the list to @p firstIndex, second to * Binds first buffer in the list to @p firstIndex, second to
* `firstIndex + 1` etc. If any buffer is `nullptr`, given indexed * `firstIndex + 1` etc. If any buffer is `nullptr`, given indexed
* target is unbound. The range of indices must respect limits for * target is unbound. The range of indices must respect limits for
* given @p target. If @extension{ARB,multi_bind} (part of OpenGL 4.4) * given @p target. All the buffers must have allocated data store. If
* is not available, the feature is emulated with sequence of * @extension{ARB,multi_bind} (part of OpenGL 4.4) is not available,
* @ref bind(Target, UnsignedInt) / @ref unbind(Target, UnsignedInt) * the feature is emulated with sequence of @ref bind(Target, UnsignedInt)
* calls. * / @ref unbind(Target, UnsignedInt) calls.
* @note This function is meant to be used only internally from * @note This function is meant to be used only internally from
* @ref AbstractShaderProgram subclasses. See its documentation * @ref AbstractShaderProgram subclasses. See its documentation
* for more information. * for more information.
@ -874,7 +875,7 @@ class MAGNUM_EXPORT Buffer: public AbstractObject {
* The @p index parameter must respect limits for given @p target. The * The @p index parameter must respect limits for given @p target. The
* @p offset parameter must respect alignment, which is 4 bytes for * @p offset parameter must respect alignment, which is 4 bytes for
* @ref Target::AtomicCounter and implementation-defined for other * @ref Target::AtomicCounter and implementation-defined for other
* targets. * targets. The buffer must have allocated data store.
* @note This function is meant to be used only internally from * @note This function is meant to be used only internally from
* @ref AbstractShaderProgram subclasses. See its documentation * @ref AbstractShaderProgram subclasses. See its documentation
* for more information. * for more information.
@ -895,7 +896,8 @@ class MAGNUM_EXPORT Buffer: public AbstractObject {
/** /**
* @brief Bind buffer to given binding index * @brief Bind buffer to given binding index
* *
* The @p index parameter must respect limits for given @p target. * The @p index parameter must respect limits for given @p target. The
* buffer must have allocated data store.
* @note This function is meant to be used only internally from * @note This function is meant to be used only internally from
* @ref AbstractShaderProgram subclasses. See its documentation * @ref AbstractShaderProgram subclasses. See its documentation
* for more information. * for more information.
@ -1161,14 +1163,14 @@ class MAGNUM_EXPORT Buffer: public AbstractObject {
TargetHint MAGNUM_LOCAL bindSomewhereInternal(TargetHint hint); TargetHint MAGNUM_LOCAL bindSomewhereInternal(TargetHint hint);
#ifndef MAGNUM_TARGET_GLES2 #ifndef MAGNUM_TARGET_GLES2
static void MAGNUM_LOCAL bindImplementationFallback(Target target, GLuint first, Containers::ArrayReference<Buffer* const> buffers); static void MAGNUM_LOCAL bindImplementationFallback(Target target, GLuint firstIndex, Containers::ArrayReference<Buffer* const> buffers);
#ifndef MAGNUM_TARGET_GLES #ifndef MAGNUM_TARGET_GLES
static void MAGNUM_LOCAL bindImplementationMulti(Target target, GLuint first, Containers::ArrayReference<Buffer* const> buffers); static void MAGNUM_LOCAL bindImplementationMulti(Target target, GLuint firstIndex, Containers::ArrayReference<Buffer* const> buffers);
#endif #endif
static void MAGNUM_LOCAL bindImplementationFallback(Target target, GLuint first, Containers::ArrayReference<const std::tuple<Buffer*, GLintptr, GLsizeiptr>> buffers); static void MAGNUM_LOCAL bindImplementationFallback(Target target, GLuint firstIndex, Containers::ArrayReference<const std::tuple<Buffer*, GLintptr, GLsizeiptr>> buffers);
#ifndef MAGNUM_TARGET_GLES #ifndef MAGNUM_TARGET_GLES
static void MAGNUM_LOCAL bindImplementationMulti(Target target, GLuint first, Containers::ArrayReference<const std::tuple<Buffer*, GLintptr, GLsizeiptr>> buffers); static void MAGNUM_LOCAL bindImplementationMulti(Target target, GLuint firstIndex, Containers::ArrayReference<const std::tuple<Buffer*, GLintptr, GLsizeiptr>> buffers);
#endif #endif
static void MAGNUM_LOCAL copyImplementationDefault(Buffer& read, Buffer& write, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size); static void MAGNUM_LOCAL copyImplementationDefault(Buffer& read, Buffer& write, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size);

16
src/Magnum/Context.h

@ -352,8 +352,8 @@ class MAGNUM_EXPORT Context {
* If no version from the list is supported, returns lowest available * If no version from the list is supported, returns lowest available
* OpenGL version (@ref Version::GL210 for desktop OpenGL, * OpenGL version (@ref Version::GL210 for desktop OpenGL,
* @ref Version::GLES200 for OpenGL ES). * @ref Version::GLES200 for OpenGL ES).
* @see isExtensionSupported(Version) const * @see @link isExtensionSupported(Version) const @endlink
* @todoc Explicit reference when Doxygen can handle const * @todoc Remove workaround when Doxygen can handle const
*/ */
Version supportedVersion(std::initializer_list<Version> versions) const; Version supportedVersion(std::initializer_list<Version> versions) const;
@ -370,10 +370,10 @@ class MAGNUM_EXPORT Context {
* } * }
* @endcode * @endcode
* *
* @see isExtensionSupported(const Extension&) const, * @see @link isExtensionSupported(const Extension&) const @endlink,
* @ref MAGNUM_ASSERT_EXTENSION_SUPPORTED(), * @ref MAGNUM_ASSERT_EXTENSION_SUPPORTED(),
* @ref isExtensionDisabled() * @ref isExtensionDisabled()
* @todoc Explicit reference when Doxygen can handle const * @todoc Remove workaround when Doxygen can handle const
*/ */
template<class T> bool isExtensionSupported() const { template<class T> bool isExtensionSupported() const {
return isExtensionSupported<T>(version()); return isExtensionSupported<T>(version());
@ -402,11 +402,11 @@ class MAGNUM_EXPORT Context {
* @brief Whether given extension is supported * @brief Whether given extension is supported
* *
* Can be used e.g. for listing extensions available on current * Can be used e.g. for listing extensions available on current
* hardware, but for general usage prefer isExtensionSupported() const, * hardware, but for general usage prefer @link isExtensionSupported() const @endlink,
* as it does most operations in compile time. * as it does most operations in compile time.
* @see @ref supportedExtensions(), @ref Extension::extensions(), * @see @ref supportedExtensions(), @ref Extension::extensions(),
* @ref MAGNUM_ASSERT_EXTENSION_SUPPORTED() * @ref MAGNUM_ASSERT_EXTENSION_SUPPORTED()
* @todoc Explicit reference when Doxygen can handle const * @todoc Remove workaround when Doxygen can handle const
*/ */
bool isExtensionSupported(const Extension& extension) const { bool isExtensionSupported(const Extension& extension) const {
return isVersionSupported(_extensionRequiredVersion[extension._index]) && extensionStatus[extension._index]; return isVersionSupported(_extensionRequiredVersion[extension._index]) && extensionStatus[extension._index];
@ -438,9 +438,9 @@ class MAGNUM_EXPORT Context {
* @brief Whether given extension is disabled * @brief Whether given extension is disabled
* *
* Can be used e.g. for listing extensions available on current * Can be used e.g. for listing extensions available on current
* hardware, but for general usage prefer isExtensionDisabled() const, * hardware, but for general usage prefer @link isExtensionDisabled() const @endlink,
* as it does most operations in compile time. * as it does most operations in compile time.
* @todoc Explicit reference when Doxygen can handle const * @todoc Remove workaround when Doxygen can handle const
*/ */
bool isExtensionDisabled(const Extension& extension) const { bool isExtensionDisabled(const Extension& extension) const {
return isVersionSupported(extension._requiredVersion) && !isVersionSupported(_extensionRequiredVersion[extension._index]); return isVersionSupported(extension._requiredVersion) && !isVersionSupported(_extensionRequiredVersion[extension._index]);

28
src/Magnum/Math/Angle.h

@ -147,7 +147,7 @@ template<class T> class Deg: public Unit<Deg, T> {
}; };
#ifndef MAGNUM_TARGET_GLES #ifndef MAGNUM_TARGET_GLES
/** @relates Deg /** @relatesalso Deg
@brief Double-precision degree value literal @brief Double-precision degree value literal
Example usage: Example usage:
@ -155,14 +155,14 @@ Example usage:
Double cosine = Math::cos(60.0_deg); // cosine = 0.5 Double cosine = Math::cos(60.0_deg); // cosine = 0.5
Double cosine = Math::cos(1.047_rad); // cosine = 0.5 Double cosine = Math::cos(1.047_rad); // cosine = 0.5
@endcode @endcode
@see Magnum::operator""_deg(), operator""_degf(), operator""_rad() @see @link operator""_degf() @endlink, @link operator""_rad() @endlink
@requires_gl Only single-precision types are available in OpenGL ES. @requires_gl Only single-precision types are available in OpenGL ES.
@todoc Make references explicit when Doxygen can link to operator"" @todoc Remove workarounds (2) when Doxygen can handle operator""
*/ */
constexpr Deg<Double> operator "" _deg(long double value) { return Deg<Double>(value); } constexpr Deg<Double> operator "" _deg(long double value) { return Deg<Double>(value); }
#endif #endif
/** @relates Deg /** @relatesalso Deg
@brief Single-precision degree value literal @brief Single-precision degree value literal
Example usage: Example usage:
@ -170,8 +170,8 @@ Example usage:
Float tangent = Math::tan(60.0_degf); // tangent = 1.732f Float tangent = Math::tan(60.0_degf); // tangent = 1.732f
Float tangent = Math::tan(1.047_radf); // tangent = 1.732f Float tangent = Math::tan(1.047_radf); // tangent = 1.732f
@endcode @endcode
@see Magnum::operator""_degf(), operator""_deg(), operator""_radf() @see @link operator""_deg() @endlink, @link operator""_radf() @endlink
@todoc Make references explicit when Doxygen can link to operator"" @todoc Remove workarounds (2) when Doxygen can handle operator""
*/ */
constexpr Deg<Float> operator "" _degf(long double value) { return Deg<Float>(value); } constexpr Deg<Float> operator "" _degf(long double value) { return Deg<Float>(value); }
@ -207,23 +207,23 @@ template<class T> class Rad: public Unit<Rad, T> {
}; };
#ifndef MAGNUM_TARGET_GLES #ifndef MAGNUM_TARGET_GLES
/** @relates Rad /** @relatesalso Rad
@brief Double-precision radian value literal @brief Double-precision radian value literal
See operator""_rad() for more information. See @link operator""_rad() @endlink for more information.
@see Magnum::operator""_rad(), operator""_radf(), operator""_deg() @see @link operator""_radf() @endlink, @link operator""_deg() @endlink
@requires_gl Only single-precision types are available in OpenGL ES. @requires_gl Only single-precision types are available in OpenGL ES.
@todoc Make references explicit when Doxygen can link to operator"" @todoc Remove workarounds (3) when Doxygen can handle operator""
*/ */
constexpr Rad<Double> operator "" _rad(long double value) { return Rad<Double>(value); } constexpr Rad<Double> operator "" _rad(long double value) { return Rad<Double>(value); }
#endif #endif
/** @relates Rad /** @relatesalso Rad
@brief Single-precision radian value literal @brief Single-precision radian value literal
See operator""_degf() for more information. See @link operator""_degf() @endlink for more information.
@see Magnum::operator""_radf(), operator""_rad(), operator""_degf() @see @link operator""_rad() @endlink, @link operator""_degf() @endlink
@todoc Make references explicit when Doxygen can link to operator"" @todoc Remove workarounds (3) when Doxygen can handle operator""
*/ */
constexpr Rad<Float> operator "" _radf(long double value) { return Rad<Float>(value); } constexpr Rad<Float> operator "" _radf(long double value) { return Rad<Float>(value); }

12
src/Magnum/Math/Complex.h

@ -63,8 +63,8 @@ template<class T> class Complex {
* @f[ * @f[
* c_0 \cdot c_1 = a_0 a_1 + b_0 b_1 * c_0 \cdot c_1 = a_0 a_1 + b_0 b_1
* @f] * @f]
* @see dot() const * @see @link Complex::dot() const @endlink
* @todoc Explicit reference when Doxygen can handle const * @todoc Remove workaround when Doxygen can handle const
*/ */
static T dot(const Complex<T>& a, const Complex<T>& b) { static T dot(const Complex<T>& a, const Complex<T>& b) {
return a._real*b._real + a._imaginary*b._imaginary; return a._real*b._real + a._imaginary*b._imaginary;
@ -136,8 +136,8 @@ template<class T> class Complex {
* To be used in transformations later. @f[ * To be used in transformations later. @f[
* c = v_x + iv_y * c = v_x + iv_y
* @f] * @f]
* @see operator Vector2(), @ref transformVector() * @see @ref Complex::operator Vector2<T>() "operator Vector2<T>()", @ref transformVector()
* @todoc Explicit reference when Doxygen can handle conversion operators * @todoc Remove workaround when Doxygen can handle unscoped conversion operators
*/ */
constexpr explicit Complex(const Vector2<T>& vector): _real(vector.x()), _imaginary(vector.y()) {} constexpr explicit Complex(const Vector2<T>& vector): _real(vector.x()), _imaginary(vector.y()) {}
@ -407,9 +407,9 @@ template<class T> class Complex {
* @f[ * @f[
* v' = c v = c (v_x + iv_y) * v' = c v = c (v_x + iv_y)
* @f] * @f]
* @see @ref Complex(const Vector2<T>&), operator Vector2(), * @see @ref Complex(const Vector2<T>&), @ref Complex::operator Vector2<T>() "operator Vector2<T>()",
* @ref Matrix3::transformVector() * @ref Matrix3::transformVector()
* @todoc Explicit reference when Doxygen can handle conversion operators * @todoc Remove workaround when Doxygen can handle unscoped conversion operators
*/ */
Vector2<T> transformVector(const Vector2<T>& vector) const { Vector2<T> transformVector(const Vector2<T>& vector) const {
return Vector2<T>((*this)*Complex<T>(vector)); return Vector2<T>((*this)*Complex<T>(vector));

4
src/Magnum/Math/DualComplex.h

@ -71,11 +71,11 @@ template<class T> class DualComplex: public Dual<Complex<T>> {
* @f[ * @f[
* \hat c = (0 + i1) + \epsilon (v_x + iv_y) * \hat c = (0 + i1) + \epsilon (v_x + iv_y)
* @f] * @f]
* @see translation() const, * @see @link translation() const @endlink,
* @ref Matrix3::translation(const Vector2<T>&), * @ref Matrix3::translation(const Vector2<T>&),
* @ref DualQuaternion::translation(), @ref Vector2::xAxis(), * @ref DualQuaternion::translation(), @ref Vector2::xAxis(),
* @ref Vector2::yAxis() * @ref Vector2::yAxis()
* @todoc Explicit reference when Doxygen can handle const * @todoc Remove workaround when Doxygen can handle const
*/ */
static DualComplex<T> translation(const Vector2<T>& vector) { static DualComplex<T> translation(const Vector2<T>& vector) {
return {{}, {vector.x(), vector.y()}}; return {{}, {vector.x(), vector.y()}};

8
src/Magnum/Math/DualQuaternion.h

@ -56,11 +56,11 @@ template<class T> class DualQuaternion: public Dual<Quaternion<T>> {
* Expects that the rotation axis is normalized. @f[ * Expects that the rotation axis is normalized. @f[
* \hat q = [\boldsymbol a \cdot sin \frac \theta 2, cos \frac \theta 2] + \epsilon [\boldsymbol 0, 0] * \hat q = [\boldsymbol a \cdot sin \frac \theta 2, cos \frac \theta 2] + \epsilon [\boldsymbol 0, 0]
* @f] * @f]
* @see rotation() const, @ref Quaternion::rotation(), * @see @link rotation() const @endlink, @ref Quaternion::rotation(),
* @ref Matrix4::rotation(), @ref DualComplex::rotation(), * @ref Matrix4::rotation(), @ref DualComplex::rotation(),
* @ref Vector3::xAxis(), @ref Vector3::yAxis(), * @ref Vector3::xAxis(), @ref Vector3::yAxis(),
* @ref Vector3::zAxis(), @ref Vector::isNormalized() * @ref Vector3::zAxis(), @ref Vector::isNormalized()
* @todoc Explicit reference when Doxygen can handle const * @todoc Remove workaround when Doxygen can handle const
*/ */
static DualQuaternion<T> rotation(Rad<T> angle, const Vector3<T>& normalizedAxis) { static DualQuaternion<T> rotation(Rad<T> angle, const Vector3<T>& normalizedAxis) {
return {Quaternion<T>::rotation(angle, normalizedAxis), {{}, T(0)}}; return {Quaternion<T>::rotation(angle, normalizedAxis), {{}, T(0)}};
@ -75,11 +75,11 @@ template<class T> class DualQuaternion: public Dual<Quaternion<T>> {
* @f[ * @f[
* \hat q = [\boldsymbol 0, 1] + \epsilon [\frac{\boldsymbol v}{2}, 0] * \hat q = [\boldsymbol 0, 1] + \epsilon [\frac{\boldsymbol v}{2}, 0]
* @f] * @f]
* @see translation() const, * @see @link translation() const @endlink,
* @ref Matrix4::translation(const Vector3<T>&), * @ref Matrix4::translation(const Vector3<T>&),
* @ref DualComplex::translation(), @ref Vector3::xAxis(), * @ref DualComplex::translation(), @ref Vector3::xAxis(),
* @ref Vector3::yAxis(), @ref Vector3::zAxis() * @ref Vector3::yAxis(), @ref Vector3::zAxis()
* @todoc Explicit reference when Doxygen can handle const * @todoc Remove workaround when Doxygen can handle const
*/ */
static DualQuaternion<T> translation(const Vector3<T>& vector) { static DualQuaternion<T> translation(const Vector3<T>& vector) {
return {{}, {vector/T(2), T(0)}}; return {{}, {vector/T(2), T(0)}};

36
src/Magnum/Math/Matrix3.h

@ -49,10 +49,10 @@ template<class T> class Matrix3: public Matrix3x3<T> {
* @brief 2D translation matrix * @brief 2D translation matrix
* @param vector Translation vector * @param vector Translation vector
* *
* @see translation() const, @ref DualComplex::translation(), * @see @link translation() const @endlink, @ref DualComplex::translation(),
* @ref Matrix4::translation(const Vector3<T>&), * @ref Matrix4::translation(const Vector3<T>&),
* @ref Vector2::xAxis(), @ref Vector2::yAxis() * @ref Vector2::xAxis(), @ref Vector2::yAxis()
* @todoc Explicit reference when Doxygen can handle const * @todoc Remove workaround when Doxygen can handle const
*/ */
constexpr static Matrix3<T> translation(const Vector2<T>& vector) { constexpr static Matrix3<T> translation(const Vector2<T>& vector) {
return {{ T(1), T(0), T(0)}, return {{ T(1), T(0), T(0)},
@ -78,10 +78,10 @@ template<class T> class Matrix3: public Matrix3x3<T> {
* @brief 2D rotation matrix * @brief 2D rotation matrix
* @param angle Rotation angle (counterclockwise) * @param angle Rotation angle (counterclockwise)
* *
* @see rotation() const, @ref Complex::rotation(), * @see @link rotation() const @endlink, @ref Complex::rotation(),
* @ref DualComplex::rotation(), * @ref DualComplex::rotation(),
* @ref Matrix4::rotation(Rad, const Vector3<T>&) * @ref Matrix4::rotation(Rad, const Vector3<T>&)
* @todoc Explicit reference when Doxygen can handle const * @todoc Remove workaround when Doxygen can handle const
*/ */
static Matrix3<T> rotation(Rad<T> angle); static Matrix3<T> rotation(Rad<T> angle);
@ -116,8 +116,8 @@ template<class T> class Matrix3: public Matrix3x3<T> {
* @param translation Translation part (first two elements of * @param translation Translation part (first two elements of
* third column) * third column)
* *
* @see @ref rotationScaling(), translation() const * @see @ref rotationScaling(), @link translation() const @endlink
* @todoc Explicit reference when Doxygen can handle const * @todoc Remove workaround when Doxygen can handle const
*/ */
constexpr static Matrix3<T> from(const Matrix2x2<T>& rotationScaling, const Vector2<T>& translation) { constexpr static Matrix3<T> from(const Matrix2x2<T>& rotationScaling, const Vector2<T>& translation) {
return {{rotationScaling[0], T(0)}, return {{rotationScaling[0], T(0)},
@ -165,10 +165,10 @@ template<class T> class Matrix3: public Matrix3x3<T> {
* *
* Upper-left 2x2 part of the matrix. * Upper-left 2x2 part of the matrix.
* @see @ref from(const Matrix2x2<T>&, const Vector2<T>&), * @see @ref from(const Matrix2x2<T>&, const Vector2<T>&),
* rotation() const, @ref rotationNormalized(), * @link rotation() const @endlink, @ref rotationNormalized(),
* @ref uniformScaling(), @ref rotation(Rad<T>), * @ref uniformScaling(), @ref rotation(Rad<T>),
* @ref Matrix4::rotationScaling() * @ref Matrix4::rotationScaling()
* @todoc Explicit reference when Doxygen can handle const * @todoc Remove workaround when Doxygen can handle const
*/ */
constexpr Matrix2x2<T> rotationScaling() const { constexpr Matrix2x2<T> rotationScaling() const {
return {(*this)[0].xy(), return {(*this)[0].xy(),
@ -180,10 +180,10 @@ template<class T> class Matrix3: public Matrix3x3<T> {
* *
* Similar to @ref rotationScaling(), but additionally checks that the * Similar to @ref rotationScaling(), but additionally checks that the
* base vectors are normalized. * base vectors are normalized.
* @see rotation() const, @ref uniformScaling(), * @see @link rotation() const @endlink, @ref uniformScaling(),
* @ref Matrix4::rotationNormalized() * @ref Matrix4::rotationNormalized()
* @todo assert also orthogonality or this is good enough? * @todo assert also orthogonality or this is good enough?
* @todoc Explicit reference when Doxygen can handle const * @todoc Remove workaround when Doxygen can handle const
*/ */
Matrix2x2<T> rotationNormalized() const { Matrix2x2<T> rotationNormalized() const {
CORRADE_ASSERT((*this)[0].xy().isNormalized() && (*this)[1].xy().isNormalized(), CORRADE_ASSERT((*this)[0].xy().isNormalized() && (*this)[1].xy().isNormalized(),
@ -199,8 +199,8 @@ template<class T> class Matrix3: public Matrix3x3<T> {
* scaling. * scaling.
* @see @ref rotationNormalized(), @ref rotationScaling(), * @see @ref rotationNormalized(), @ref rotationScaling(),
* @ref uniformScaling(), @ref rotation(Rad<T>), * @ref uniformScaling(), @ref rotation(Rad<T>),
* Matrix4::rotation() const * @link Matrix4::rotation() const @endlink
* @todoc Explicit reference when Doxygen can handle const * @todoc Remove workaround when Doxygen can handle const
*/ */
Matrix2x2<T> rotation() const { Matrix2x2<T> rotation() const {
CORRADE_ASSERT(TypeTraits<T>::equals((*this)[0].xy().dot(), (*this)[1].xy().dot()), CORRADE_ASSERT(TypeTraits<T>::equals((*this)[0].xy().dot(), (*this)[1].xy().dot()),
@ -216,10 +216,10 @@ template<class T> class Matrix3: public Matrix3x3<T> {
* Expects that the scaling is the same in all axes. Faster alternative * Expects that the scaling is the same in all axes. Faster alternative
* to @ref uniformScaling(), because it doesn't compute the square * to @ref uniformScaling(), because it doesn't compute the square
* root. * root.
* @see @ref rotationScaling(), rotation() const, * @see @ref rotationScaling(), @link rotation() const @endlink,
* @ref rotationNormalized(), @ref scaling(const Vector2<T>&), * @ref rotationNormalized(), @ref scaling(const Vector2<T>&),
* @ref Matrix4::uniformScaling() * @ref Matrix4::uniformScaling()
* @todoc Explicit reference when Doxygen can handle const * @todoc Remove workaround when Doxygen can handle const
*/ */
T uniformScalingSquared() const { T uniformScalingSquared() const {
const T scalingSquared = (*this)[0].xy().dot(); const T scalingSquared = (*this)[0].xy().dot();
@ -234,10 +234,10 @@ template<class T> class Matrix3: public Matrix3x3<T> {
* Length of vectors in upper-left 2x2 part of the matrix. Expects that * Length of vectors in upper-left 2x2 part of the matrix. Expects that
* the scaling is the same in all axes. Use faster alternative * the scaling is the same in all axes. Use faster alternative
* @ref uniformScalingSquared() where possible. * @ref uniformScalingSquared() where possible.
* @see @ref rotationScaling(), rotation() const, * @see @ref rotationScaling(), @link rotation() const @endlink,
* @ref rotationNormalized(), @ref scaling(const Vector2<T>&), * @ref rotationNormalized(), @ref scaling(const Vector2<T>&),
* @ref Matrix4::uniformScaling() * @ref Matrix4::uniformScaling()
* @todoc Explicit reference when Doxygen can handle const * @todoc Remove workaround when Doxygen can handle const
*/ */
T uniformScaling() const { return std::sqrt(uniformScalingSquared()); } T uniformScaling() const { return std::sqrt(uniformScalingSquared()); }
@ -280,9 +280,9 @@ template<class T> class Matrix3: public Matrix3x3<T> {
* @f$ A^{i, j} @f$ is matrix without i-th row and j-th column, see * @f$ A^{i, j} @f$ is matrix without i-th row and j-th column, see
* @ref ij() * @ref ij()
* @see @ref isRigidTransformation(), @ref invertedOrthogonal(), * @see @ref isRigidTransformation(), @ref invertedOrthogonal(),
* @ref rotationScaling(), translation() const, * @ref rotationScaling(), @link translation() const @endlink,
* @ref Matrix4::invertedRigid() * @ref Matrix4::invertedRigid()
* @todoc Explicit reference when Doxygen can handle const * @todoc Remove workaround when Doxygen can handle const
*/ */
Matrix3<T> invertedRigid() const; Matrix3<T> invertedRigid() const;

47
src/Magnum/Math/Matrix4.h

@ -90,11 +90,11 @@ template<class T> class Matrix4: public Matrix4x4<T> {
* Expects that the rotation axis is normalized. If possible, use * Expects that the rotation axis is normalized. If possible, use
* faster alternatives like @ref rotationX(), @ref rotationY() and * faster alternatives like @ref rotationX(), @ref rotationY() and
* @ref rotationZ(). * @ref rotationZ().
* @see rotation() const, @ref Quaternion::rotation(), * @see @link rotation() const @endlink, @ref Quaternion::rotation(),
* @ref DualQuaternion::rotation(), @ref Matrix3::rotation(Rad), * @ref DualQuaternion::rotation(), @ref Matrix3::rotation(Rad),
* @ref Vector3::xAxis(), @ref Vector3::yAxis(), * @ref Vector3::xAxis(), @ref Vector3::yAxis(),
* @ref Vector3::zAxis(), @ref Vector::isNormalized() * @ref Vector3::zAxis(), @ref Vector::isNormalized()
* @todoc Explicit reference when Doxygen can handle const * @todoc Remove workaround when Doxygen can handle const
*/ */
static Matrix4<T> rotation(Rad<T> angle, const Vector3<T>& normalizedAxis); static Matrix4<T> rotation(Rad<T> angle, const Vector3<T>& normalizedAxis);
@ -104,9 +104,9 @@ template<class T> class Matrix4: public Matrix4x4<T> {
* *
* Faster than calling `%Matrix4::rotation(angle, %Vector3::xAxis())`. * Faster than calling `%Matrix4::rotation(angle, %Vector3::xAxis())`.
* @see @ref rotation(Rad, const Vector3<T>&), @ref rotationY(), * @see @ref rotation(Rad, const Vector3<T>&), @ref rotationY(),
* @ref rotationZ(), rotation() const, * @ref rotationZ(), @link rotation() const @endlink,
* @ref Quaternion::rotation(), @ref Matrix3::rotation(Rad) * @ref Quaternion::rotation(), @ref Matrix3::rotation(Rad)
* @todoc Explicit reference when Doxygen can handle const * @todoc Remove workaround when Doxygen can handle const
*/ */
static Matrix4<T> rotationX(Rad<T> angle); static Matrix4<T> rotationX(Rad<T> angle);
@ -116,9 +116,9 @@ template<class T> class Matrix4: public Matrix4x4<T> {
* *
* Faster than calling `%Matrix4::rotation(angle, %Vector3::yAxis())`. * Faster than calling `%Matrix4::rotation(angle, %Vector3::yAxis())`.
* @see @ref rotation(Rad, const Vector3<T>&), @ref rotationX(), * @see @ref rotation(Rad, const Vector3<T>&), @ref rotationX(),
* @ref rotationZ(), rotation() const, * @ref rotationZ(), @link rotation() const @endlink,
* @ref Quaternion::rotation(), @ref Matrix3::rotation(Rad) * @ref Quaternion::rotation(), @ref Matrix3::rotation(Rad)
* @todoc Explicit reference when Doxygen can handle const * @todoc Remove workaround when Doxygen can handle const
*/ */
static Matrix4<T> rotationY(Rad<T> angle); static Matrix4<T> rotationY(Rad<T> angle);
@ -128,9 +128,9 @@ template<class T> class Matrix4: public Matrix4x4<T> {
* *
* Faster than calling `%Matrix4::rotation(angle, %Vector3::zAxis())`. * Faster than calling `%Matrix4::rotation(angle, %Vector3::zAxis())`.
* @see @ref rotation(Rad, const Vector3<T>&), @ref rotationX(), * @see @ref rotation(Rad, const Vector3<T>&), @ref rotationX(),
* @ref rotationY(), rotation() const, * @ref rotationY(), @link rotation() const @endlink,
* @ref Quaternion::rotation(), @ref Matrix3::rotation(Rad) * @ref Quaternion::rotation(), @ref Matrix3::rotation(Rad)
* @todoc Explicit reference when Doxygen can handle const * @todoc Remove workaround when Doxygen can handle const
*/ */
static Matrix4<T> rotationZ(Rad<T> angle); static Matrix4<T> rotationZ(Rad<T> angle);
@ -184,8 +184,8 @@ template<class T> class Matrix4: public Matrix4x4<T> {
* @param translation Translation part (first three elements of * @param translation Translation part (first three elements of
* fourth column) * fourth column)
* *
* @see @ref rotationScaling(), translation() const * @see @ref rotationScaling(), @link translation() const @endlink
* @todoc Explicit reference when Doxygen can handle const * @todoc Remove workaround when Doxygen can handle const
*/ */
constexpr static Matrix4<T> from(const Matrix3x3<T>& rotationScaling, const Vector3<T>& translation) { constexpr static Matrix4<T> from(const Matrix3x3<T>& rotationScaling, const Vector3<T>& translation) {
return {{rotationScaling[0], T(0)}, return {{rotationScaling[0], T(0)},
@ -234,10 +234,11 @@ template<class T> class Matrix4: public Matrix4x4<T> {
* *
* Upper-left 3x3 part of the matrix. * Upper-left 3x3 part of the matrix.
* @see @ref from(const Matrix3x3<T>&, const Vector3<T>&), * @see @ref from(const Matrix3x3<T>&, const Vector3<T>&),
* rotation() const, @ref rotationNormalized(), * @link rotation() const @endlink, @ref rotationNormalized(),
* @ref uniformScaling(), @ref rotation(Rad, const Vector3<T>&), * @ref uniformScaling(), @ref rotation(Rad, const Vector3<T>&),
* Matrix3::rotationScaling() const * @link Matrix3::rotationScaling() const @endlink
* @todoc Explicit reference when Doxygen can handle const * @todoc Remove workaround when Doxygen can handle const
* @todoc Remove workaround when Doxygen can handle const
*/ */
constexpr Matrix3x3<T> rotationScaling() const { constexpr Matrix3x3<T> rotationScaling() const {
return {(*this)[0].xyz(), return {(*this)[0].xyz(),
@ -250,10 +251,10 @@ template<class T> class Matrix4: public Matrix4x4<T> {
* *
* Similar to @ref rotationScaling(), but additionally checks that the * Similar to @ref rotationScaling(), but additionally checks that the
* base vectors are normalized. * base vectors are normalized.
* @see rotation() const, @ref uniformScaling(), * @see @link rotation() const @endlink, @ref uniformScaling(),
* @ref Matrix3::rotationNormalized() * @ref Matrix3::rotationNormalized()
* @todo assert also orthogonality or this is good enough? * @todo assert also orthogonality or this is good enough?
* @todoc Explicit reference when Doxygen can handle const * @todoc Remove workaround when Doxygen can handle const
*/ */
Matrix3x3<T> rotationNormalized() const { Matrix3x3<T> rotationNormalized() const {
CORRADE_ASSERT((*this)[0].xyz().isNormalized() && (*this)[1].xyz().isNormalized() && (*this)[2].xyz().isNormalized(), CORRADE_ASSERT((*this)[0].xyz().isNormalized() && (*this)[1].xyz().isNormalized() && (*this)[2].xyz().isNormalized(),
@ -270,8 +271,8 @@ template<class T> class Matrix4: public Matrix4x4<T> {
* scaling. * scaling.
* @see @ref rotationNormalized(), @ref rotationScaling(), * @see @ref rotationNormalized(), @ref rotationScaling(),
* @ref uniformScaling(), @ref rotation(Rad, const Vector3<T>&), * @ref uniformScaling(), @ref rotation(Rad, const Vector3<T>&),
* Matrix3::rotation() const * @link Matrix3::rotation() const @endlink
* @todoc Explicit reference when Doxygen can handle const * @todoc Remove workaround when Doxygen can handle const
*/ */
Matrix3x3<T> rotation() const; Matrix3x3<T> rotation() const;
@ -282,10 +283,10 @@ template<class T> class Matrix4: public Matrix4x4<T> {
* Expects that the scaling is the same in all axes. Faster alternative * Expects that the scaling is the same in all axes. Faster alternative
* to @ref uniformScaling(), because it doesn't compute the square * to @ref uniformScaling(), because it doesn't compute the square
* root. * root.
* @see @ref rotationScaling(), rotation() const, * @see @ref rotationScaling(), @link rotation() const @endlink,
* @ref rotationNormalized(), @ref scaling(const Vector3<T>&), * @ref rotationNormalized(), @ref scaling(const Vector3<T>&),
* @ref Matrix3::uniformScaling() * @ref Matrix3::uniformScaling()
* @todoc Explicit reference when Doxygen can handle const * @todoc Remove workaround when Doxygen can handle const
*/ */
T uniformScalingSquared() const; T uniformScalingSquared() const;
@ -295,10 +296,10 @@ template<class T> class Matrix4: public Matrix4x4<T> {
* Length of vectors in upper-left 3x3 part of the matrix. Expects that * Length of vectors in upper-left 3x3 part of the matrix. Expects that
* the scaling is the same in all axes. Use faster alternative * the scaling is the same in all axes. Use faster alternative
* @ref uniformScalingSquared() where possible. * @ref uniformScalingSquared() where possible.
* @see @ref rotationScaling(), rotation() const, * @see @ref rotationScaling(), @link rotation() const @endlink,
* @ref rotationNormalized(), @ref scaling(const Vector3<T>&), * @ref rotationNormalized(), @ref scaling(const Vector3<T>&),
* @ref Matrix3::uniformScaling() * @ref Matrix3::uniformScaling()
* @todoc Explicit reference when Doxygen can handle const * @todoc Remove workaround when Doxygen can handle const
*/ */
T uniformScaling() const { return std::sqrt(uniformScalingSquared()); } T uniformScaling() const { return std::sqrt(uniformScalingSquared()); }
@ -352,9 +353,9 @@ template<class T> class Matrix4: public Matrix4x4<T> {
* @f$ A^{i, j} @f$ is matrix without i-th row and j-th column, see * @f$ A^{i, j} @f$ is matrix without i-th row and j-th column, see
* @ref ij() * @ref ij()
* @see @ref isRigidTransformation(), @ref invertedOrthogonal(), * @see @ref isRigidTransformation(), @ref invertedOrthogonal(),
* @ref rotationScaling(), translation() const, * @ref rotationScaling(), @link translation() const @endlink,
* @ref Matrix3::invertedRigid() * @ref Matrix3::invertedRigid()
* @todoc Explicit reference when Doxygen can handle const * @todoc Remove workaround when Doxygen can handle const
*/ */
Matrix4<T> invertedRigid() const; Matrix4<T> invertedRigid() const;

10
src/Magnum/Math/Quaternion.h

@ -57,8 +57,8 @@ template<class T> class Quaternion {
* @f[ * @f[
* p \cdot q = \boldsymbol p_V \cdot \boldsymbol q_V + p_S q_S * p \cdot q = \boldsymbol p_V \cdot \boldsymbol q_V + p_S q_S
* @f] * @f]
* @see dot() const * @see @link dot() const @endlink
* @todoc Explicit reference when Doxygen can handle const * @todoc Remove workaround when Doxygen can handle const
*/ */
static T dot(const Quaternion<T>& a, const Quaternion<T>& b) { static T dot(const Quaternion<T>& a, const Quaternion<T>& b) {
/** @todo Use four-component SIMD implementation when available */ /** @todo Use four-component SIMD implementation when available */
@ -337,12 +337,12 @@ template<class T> class Quaternion {
/** /**
* @brief %Quaternion length * @brief %Quaternion length
* *
* See also dot() const which is faster for comparing length with * See also @link dot() const @endlink which is faster for comparing
* other values. @f[ * length with other values. @f[
* |q| = \sqrt{q \cdot q} * |q| = \sqrt{q \cdot q}
* @f] * @f]
* @see @ref isNormalized() * @see @ref isNormalized()
* @todoc Explicit reference when Doxygen can handle const * @todoc Remove workaround when Doxygen can handle const
*/ */
T length() const { return std::sqrt(dot()); } T length() const { return std::sqrt(dot()); }

8
src/Magnum/Math/Vector.h

@ -87,9 +87,9 @@ template<std::size_t size, class T> class Vector {
* antiparallel. @f[ * antiparallel. @f[
* \boldsymbol a \cdot \boldsymbol b = \sum_{i=0}^{n-1} \boldsymbol a_i \boldsymbol b_i * \boldsymbol a \cdot \boldsymbol b = \sum_{i=0}^{n-1} \boldsymbol a_i \boldsymbol b_i
* @f] * @f]
* @see dot() const, @ref operator-(), * @see @link dot() const @endlink, @ref operator-(),
* @ref Vector2::perpendicular() * @ref Vector2::perpendicular()
* @todoc Explicit reference when Doxygen can handle const * @todoc Remove workaround when Doxygen can handle const
*/ */
static T dot(const Vector<size, T>& a, const Vector<size, T>& b) { static T dot(const Vector<size, T>& a, const Vector<size, T>& b) {
return (a*b).sum(); return (a*b).sum();
@ -469,8 +469,8 @@ template<std::size_t size, class T> class Vector {
* \boldsymbol a_1 = \frac{\boldsymbol a \cdot \boldsymbol b}{\boldsymbol b \cdot \boldsymbol b} \boldsymbol b = * \boldsymbol a_1 = \frac{\boldsymbol a \cdot \boldsymbol b}{\boldsymbol b \cdot \boldsymbol b} \boldsymbol b =
* (\boldsymbol a \cdot \boldsymbol b) \boldsymbol b * (\boldsymbol a \cdot \boldsymbol b) \boldsymbol b
* @f] * @f]
* @see dot() const * @see @link dot() const @endlink
* @todoc Explicit reference when Doxygen can handle const * @todoc Remove workaround when Doxygen can handle const
*/ */
Vector<size, T> projectedOntoNormalized(const Vector<size, T>& line) const; Vector<size, T> projectedOntoNormalized(const Vector<size, T>& line) const;

4
src/Magnum/Resource.h

@ -155,8 +155,8 @@ class Resource {
/** /**
* @brief %Resource state * @brief %Resource state
* *
* @see operator bool(), @ref ResourceManager::state() * @see @ref Resource::operator bool() "operator bool()", @ref ResourceManager::state()
* @todoc Explicit reference when Doxygen can handle conversion operators * @todoc Remove workaround when Doxygen can handle unscoped conversion operators
*/ */
ResourceState state() { ResourceState state() {
acquire(); acquire();

4
src/Magnum/Shapes/Collision.h

@ -97,8 +97,8 @@ template<UnsignedInt dimensions> class Collision {
/** /**
* @brief Separation distance * @brief Separation distance
* *
* @see @ref separationNormal(), operator bool() * @see @ref separationNormal(), @ref Collision::operator bool() "operator bool()"
* @todoc Explicit reference when Doxygen can handle conversion operators * @todoc Remove workaround when Doxygen can handle unscoped conversion operators
*/ */
Float separationDistance() const { Float separationDistance() const {
return _separationDistance; return _separationDistance;

Loading…
Cancel
Save