Browse Source

Math: I don't see why we should have those overloads.

The compiler does that for us. Probably a brain fart from 2010. On the
other hand, the ConfigurationValue specializations need to be there,
because the type is used explicitly as template parameter.
pull/190/head
Vladimír Vondruš 10 years ago
parent
commit
28c31bfc96
  1. 20
      src/Magnum/Math/Color.h
  2. 5
      src/Magnum/Math/Matrix.h
  3. 5
      src/Magnum/Math/Matrix3.h
  4. 5
      src/Magnum/Math/Matrix4.h
  5. 5
      src/Magnum/Math/Vector2.h
  6. 5
      src/Magnum/Math/Vector3.h
  7. 5
      src/Magnum/Math/Vector4.h

20
src/Magnum/Math/Color.h

@ -610,20 +610,20 @@ inline Color4<Float> operator "" _rgbaf(unsigned long long value) {
}
/** @debugoperator{Magnum::Math::Color3} */
template<class T> inline Corrade::Utility::Debug& operator<<(Corrade::Utility::Debug& debug, const Color3<T>& value) {
return debug << static_cast<const Vector3<T>&>(value);
}
/**
@debugoperator{Magnum::Math::Color3}
/** @debugoperator{Magnum::Math::Color3} */
Prints the value as hex color (e.g. `#ff33aa`). Other underlying types are
handled by @ref operator<<(Corrade::Utility::Debug&, const Vector<size, T>&).
*/
MAGNUM_EXPORT Corrade::Utility::Debug& operator<<(Corrade::Utility::Debug& debug, const Color3<UnsignedByte>& value);
/** @debugoperator{Magnum::Math::Color4} */
template<class T> inline Corrade::Utility::Debug& operator<<(Corrade::Utility::Debug& debug, const Color4<T>& value) {
return debug << static_cast<const Vector4<T>&>(value);
}
/**
@debugoperator{Magnum::Math::Color4}
/** @debugoperator{Magnum::Math::Color4} */
Prints the value as hex color (e.g. `#9933aaff`). Other underlying types are
handled by @ref operator<<(Corrade::Utility::Debug&, const Vector<size, T>&).
*/
MAGNUM_EXPORT Corrade::Utility::Debug& operator<<(Corrade::Utility::Debug& debug, const Color4<UnsignedByte>& value);
namespace Implementation {

5
src/Magnum/Math/Matrix.h

@ -259,11 +259,6 @@ template<class T> using Matrix4x4 = Matrix<4, T>;
MAGNUM_MATRIX_OPERATOR_IMPLEMENTATION(Matrix<size, T>)
/** @debugoperator{Magnum::Math::Matrix} */
template<std::size_t size, class T> inline Corrade::Utility::Debug& operator<<(Corrade::Utility::Debug& debug, const Matrix<size, T>& value) {
return debug << static_cast<const RectangularMatrix<size, size, T>&>(value);
}
#ifndef DOXYGEN_GENERATING_OUTPUT
#define MAGNUM_MATRIX_SUBCLASS_IMPLEMENTATION(size, Type, VectorType) \
VectorType<T>& operator[](std::size_t col) { \

5
src/Magnum/Math/Matrix3.h

@ -407,11 +407,6 @@ template<class T> class Matrix3: public Matrix3x3<T> {
MAGNUM_MATRIXn_OPERATOR_IMPLEMENTATION(3, Matrix3)
#endif
/** @debugoperator{Magnum::Math::Matrix3} */
template<class T> inline Corrade::Utility::Debug& operator<<(Corrade::Utility::Debug& debug, const Matrix3<T>& value) {
return debug << static_cast<const Matrix3x3<T>&>(value);
}
template<class T> Matrix3<T> Matrix3<T>::rotation(const Rad<T> angle) {
const T sine = std::sin(T(angle));
const T cosine = std::cos(T(angle));

5
src/Magnum/Math/Matrix4.h

@ -582,11 +582,6 @@ template<class T> class Matrix4: public Matrix4x4<T> {
MAGNUM_MATRIXn_OPERATOR_IMPLEMENTATION(4, Matrix4)
#endif
/** @debugoperator{Magnum::Math::Matrix4} */
template<class T> inline Corrade::Utility::Debug& operator<<(Corrade::Utility::Debug& debug, const Matrix4<T>& value) {
return debug << static_cast<const Matrix4x4<T>&>(value);
}
template<class T> Matrix4<T> Matrix4<T>::rotation(const Rad<T> angle, const Vector3<T>& normalizedAxis) {
CORRADE_ASSERT(normalizedAxis.isNormalized(),
"Math::Matrix4::rotation(): axis must be normalized", {});

5
src/Magnum/Math/Vector2.h

@ -199,11 +199,6 @@ template<class T> class Vector2: public Vector<2, T> {
MAGNUM_VECTORn_OPERATOR_IMPLEMENTATION(2, Vector2)
#endif
/** @debugoperator{Magnum::Math::Vector2} */
template<class T> inline Corrade::Utility::Debug& operator<<(Corrade::Utility::Debug& debug, const Vector2<T>& value) {
return debug << static_cast<const Vector<2, T>&>(value);
}
namespace Implementation {
template<std::size_t, class> struct TypeForSize;
template<class T> struct TypeForSize<2, T> { typedef Math::Vector2<typename T::Type> Type; };

5
src/Magnum/Math/Vector3.h

@ -252,11 +252,6 @@ template<class T> class Vector3: public Vector<3, T> {
MAGNUM_VECTORn_OPERATOR_IMPLEMENTATION(3, Vector3)
#endif
/** @debugoperator{Magnum::Math::Vector3} */
template<class T> inline Corrade::Utility::Debug& operator<<(Corrade::Utility::Debug& debug, const Vector3<T>& value) {
return debug << static_cast<const Vector<3, T>&>(value);
}
namespace Implementation {
template<class T> struct TypeForSize<3, T> { typedef Math::Vector3<typename T::Type> Type; };
}

5
src/Magnum/Math/Vector4.h

@ -206,11 +206,6 @@ template<class T> class Vector4: public Vector<4, T> {
MAGNUM_VECTORn_OPERATOR_IMPLEMENTATION(4, Vector4)
#endif
/** @debugoperator{Magnum::Math::Vector4} */
template<class T> inline Corrade::Utility::Debug& operator<<(Corrade::Utility::Debug& debug, const Vector4<T>& value) {
return debug << static_cast<const Vector<4, T>&>(value);
}
namespace Implementation {
template<class T> struct TypeForSize<4, T> { typedef Math::Vector4<typename T::Type> Type; };
}

Loading…
Cancel
Save