From 4aec678539750d18fa63f402e900ec9c452e318f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Mon, 1 Oct 2012 19:21:36 +0200 Subject: [PATCH] Have first letter of static constants uppercase, like previously. Lowecase didn't prove to be better, because Doxygen cannot implicitly link to it and it collides with non-type template parameters and private variables. --- src/Math/Matrix.h | 8 ++++---- src/Math/RectangularMatrix.h | 20 ++++++++++---------- src/Math/Vector.h | 12 ++++++------ src/MeshTools/Clean.h | 8 ++++---- src/MeshTools/Test/CleanTest.h | 2 +- src/MeshTools/Test/SubdivideTest.h | 2 +- src/SceneGraph/Camera.cpp | 2 +- src/Swizzle.h | 2 +- 8 files changed, 28 insertions(+), 28 deletions(-) diff --git a/src/Math/Matrix.h b/src/Math/Matrix.h index 58ac344ae..07d21527b 100644 --- a/src/Math/Matrix.h +++ b/src/Math/Matrix.h @@ -31,16 +31,16 @@ namespace Implementation { /** @brief Square matrix -@tparam s %Matrix size -@tparam T Data type +@tparam size %Matrix size +@tparam T Data type See @ref matrix-vector for brief introduction. @configurationvalueref{Magnum::Math::Matrix} */ -template class Matrix: public RectangularMatrix { +template class Matrix: public RectangularMatrix { public: - const static size_t size = s; /**< @brief %Matrix size */ + const static size_t Size = size; /**< @brief %Matrix size */ /** @brief Pass to constructor to create zero-filled matrix */ enum ZeroType { Zero }; diff --git a/src/Math/RectangularMatrix.h b/src/Math/RectangularMatrix.h index 329cccabd..7c023931f 100644 --- a/src/Math/RectangularMatrix.h +++ b/src/Math/RectangularMatrix.h @@ -53,20 +53,20 @@ template class Vector; /** @brief Rectangular matrix -@tparam c Column count -@tparam r Row count -@tparam T Data type +@tparam cols Column count +@tparam rows Row count +@tparam T Data type See @ref matrix-vector for brief introduction. See also Matrix (square) and Vector. */ -template class RectangularMatrix { - static_assert(c != 0 && r != 0, "Matrix cannot have zero elements"); +template class RectangularMatrix { + static_assert(cols != 0 && rows != 0, "Matrix cannot have zero elements"); public: - typedef T Type; /**< @brief Data type */ - const static size_t cols = c; /**< @brief %Matrix column count */ - const static size_t rows = r; /**< @brief %Matrix row count */ + typedef T Type; /**< @brief Data type */ + const static size_t Cols = cols; /**< @brief %Matrix column count */ + const static size_t Rows = rows; /**< @brief %Matrix row count */ /** * @brief %Matrix from array @@ -129,10 +129,10 @@ template class RectangularMatrix { #endif /** @brief Copy constructor */ - inline constexpr RectangularMatrix(const RectangularMatrix&) = default; + inline constexpr RectangularMatrix(const RectangularMatrix&) = default; /** @brief Assignment operator */ - inline RectangularMatrix& operator=(const RectangularMatrix&) = default; + inline RectangularMatrix& operator=(const RectangularMatrix&) = default; /** * @brief Raw data diff --git a/src/Math/Vector.h b/src/Math/Vector.h index 621b1f778..e0d5ab5e0 100644 --- a/src/Math/Vector.h +++ b/src/Math/Vector.h @@ -25,15 +25,15 @@ namespace Magnum { namespace Math { /** @brief %Vector -@tparam s %Vector size -@tparam T Data type +@tparam size %Vector size +@tparam T Data type See @ref matrix-vector for brief introduction. @configurationvalueref{Magnum::Math::Vector} */ -template class Vector: public RectangularMatrix<1, s, T> { +template class Vector: public RectangularMatrix<1, size, T> { public: - const static size_t size = s; /**< @brief %Vector size */ + const static size_t Size = size; /**< @brief %Vector size */ /** * @brief Dot product @@ -224,8 +224,8 @@ template class Vector: public RectangularMatrix<1, s, T> { private: /* Hiding unused things from RectangularMatrix */ - using RectangularMatrix<1, size, T>::cols; - using RectangularMatrix<1, size, T>::rows; + using RectangularMatrix<1, size, T>::Cols; + using RectangularMatrix<1, size, T>::Rows; using RectangularMatrix<1, size, T>::operator[]; using RectangularMatrix<1, size, T>::operator(); }; diff --git a/src/MeshTools/Clean.h b/src/MeshTools/Clean.h index 9a4a0d6b8..8c4389062 100644 --- a/src/MeshTools/Clean.h +++ b/src/MeshTools/Clean.h @@ -40,7 +40,7 @@ template class Clean { /* Get mesh bounds */ Vertex min, max; - for(size_t i = 0; i != Vertex::size; ++i) { + for(size_t i = 0; i != Vertex::Size; ++i) { min[i] = std::numeric_limits::max(); max[i] = std::numeric_limits::min(); } @@ -54,7 +54,7 @@ template class Clean { /* Make epsilon so large that size_t can index all vertices inside mesh bounds. */ Vertex size = max-min; - for(size_t i = 0; i != Vertex::size; ++i) + for(size_t i = 0; i != Vertex::Size; ++i) if(static_cast(size[i]/std::numeric_limits::max()) > epsilon) epsilon = static_cast(size[i]/std::numeric_limits::max()); @@ -92,7 +92,7 @@ template class Clean { std::swap(newVertices, vertices); /* Move vertex coordinates by epsilon/2 in next direction */ - if(moving != Vertex::size) { + if(moving != Vertex::Size) { moved = Vertex(); moved[moving] = epsilon/2; } @@ -137,7 +137,7 @@ Removes duplicate vertices from the mesh. @todo Interpolate vertices, not collapse them to first in the cell @todo Ability to specify other attributes for interpolation */ -template inline void clean(std::vector& indices, std::vector& vertices, typename Vertex::Type epsilon = TypeTraits::epsilon()) { +template inline void clean(std::vector& indices, std::vector& vertices, typename Vertex::Type epsilon = TypeTraits::epsilon()) { Implementation::Clean(indices, vertices)(epsilon); } diff --git a/src/MeshTools/Test/CleanTest.h b/src/MeshTools/Test/CleanTest.h index 5663733d6..f24e4730e 100644 --- a/src/MeshTools/Test/CleanTest.h +++ b/src/MeshTools/Test/CleanTest.h @@ -28,7 +28,7 @@ class CleanTest: public Corrade::TestSuite::Tester { private: class Vector1 { public: - static const size_t size = 1; + static const size_t Size = 1; typedef int Type; Vector1(): data(0) {} diff --git a/src/MeshTools/Test/SubdivideTest.h b/src/MeshTools/Test/SubdivideTest.h index af7c43484..bc7569cb5 100644 --- a/src/MeshTools/Test/SubdivideTest.h +++ b/src/MeshTools/Test/SubdivideTest.h @@ -29,7 +29,7 @@ class SubdivideTest: public Corrade::TestSuite::Tester { private: class Vector1 { public: - static const size_t size = 1; + static const size_t Size = 1; typedef int Type; Vector1(): data(0) {} diff --git a/src/SceneGraph/Camera.cpp b/src/SceneGraph/Camera.cpp index 4b9cba14b..892a0a419 100644 --- a/src/SceneGraph/Camera.cpp +++ b/src/SceneGraph/Camera.cpp @@ -32,7 +32,7 @@ template MatrixType aspectRatioFix(AspectRatioPolicy aspectRat /* Extend on larger side = scale larger side down Clip on smaller side = scale smaller side up */ - return Camera::aspectRatioScale( + return Camera::aspectRatioScale( (relativeAspectRatio.x() > relativeAspectRatio.y()) == (aspectRatioPolicy == AspectRatioPolicy::Extend) ? Vector2(relativeAspectRatio.y()/relativeAspectRatio.x(), 1.0f) : Vector2(1.0f, relativeAspectRatio.x()/relativeAspectRatio.y())); diff --git a/src/Swizzle.h b/src/Swizzle.h index cc57ca072..308eee93a 100644 --- a/src/Swizzle.h +++ b/src/Swizzle.h @@ -110,7 +110,7 @@ instead of at runtime. Vector4::xy(), Vector3::xy() */ template inline constexpr typename Implementation::TypeForSize::Type swizzle(const T& vector) { - return {Implementation::Component::value(vector)...}; + return {Implementation::Component::value(vector)...}; } /**