Browse Source

Overloaded operators also for Point2D and Point3D.

vectorfields
Vladimír Vondruš 14 years ago
parent
commit
9feb8d32a5
  1. 5
      src/Math/Point2D.h
  2. 5
      src/Math/Point3D.h

5
src/Math/Point2D.h

@ -57,8 +57,13 @@ template<class T> class Point2D: public Vector3<T> {
* @param z Z component
*/
inline constexpr Point2D(const Vector<2, T>& xy, T z = T(1)): Vector3<T>(xy, z) {}
MAGNUM_VECTOR_SUBCLASS_IMPLEMENTATION(Point2D, 3)
MAGNUM_RECTANGULARMATRIX_SUBCLASS_OPERATOR_IMPLEMENTATION(1, 3, Point2D<T>)
};
MAGNUM_VECTOR_SUBCLASS_OPERATOR_IMPLEMENTATION(Point2D, 3)
/** @debugoperator{Magnum::Math::Point2D} */
template<class T> Corrade::Utility::Debug operator<<(Corrade::Utility::Debug debug, const Magnum::Math::Point2D<T>& value) {
return debug << static_cast<const Magnum::Math::Vector<3, T>&>(value);

5
src/Math/Point3D.h

@ -58,8 +58,13 @@ template<class T> class Point3D: public Vector4<T> {
* @param w W component
*/
inline constexpr Point3D(const Vector<3, T>& xyz, T w = T(1)): Vector4<T>(xyz, w) {}
MAGNUM_VECTOR_SUBCLASS_IMPLEMENTATION(Point3D, 4)
MAGNUM_RECTANGULARMATRIX_SUBCLASS_OPERATOR_IMPLEMENTATION(1, 4, Point3D<T>)
};
MAGNUM_VECTOR_SUBCLASS_OPERATOR_IMPLEMENTATION(Point3D, 4)
/** @debugoperator{Magnum::Math::Point3D} */
template<class T> Corrade::Utility::Debug operator<<(Corrade::Utility::Debug debug, const Magnum::Math::Point3D<T>& value) {
return debug << static_cast<const Magnum::Math::Vector<4, T>&>(value);

Loading…
Cancel
Save