diff --git a/src/Physics/AbstractShape.cpp b/src/Physics/AbstractShape.cpp index 5ce4474bd..c6d2511d9 100644 --- a/src/Physics/AbstractShape.cpp +++ b/src/Physics/AbstractShape.cpp @@ -31,7 +31,9 @@ template class AbstractShape<2>; template class AbstractShape<3>; #ifndef DOXYGEN_GENERATING_OUTPUT -Debug operator<<(Debug debug, AbstractShape2D::Type value) { +namespace Implementation { + +Debug operator<<(Debug debug, ShapeDimensionTraits<2>::Type value) { switch(value) { #define _val(value) case AbstractShape2D::Type::value: return debug << "AbstractShape2D::Type::" #value; _val(Point) @@ -48,7 +50,7 @@ Debug operator<<(Debug debug, AbstractShape2D::Type value) { return debug << "AbstractShape2D::Type::(unknown)"; } -Debug operator<<(Debug debug, AbstractShape3D::Type value) { +Debug operator<<(Debug debug, ShapeDimensionTraits<3>::Type value) { switch(value) { #define _val(value) case AbstractShape3D::Type::value: return debug << "AbstractShape3D::Type::" #value; _val(Point) @@ -65,6 +67,8 @@ Debug operator<<(Debug debug, AbstractShape3D::Type value) { return debug << "AbstractShape2D::Type::(unknown)"; } + +} #endif }} diff --git a/src/Physics/AbstractShape.h b/src/Physics/AbstractShape.h index 84fc07a25..85aee4ad3 100644 --- a/src/Physics/AbstractShape.h +++ b/src/Physics/AbstractShape.h @@ -56,6 +56,9 @@ namespace Implementation { Plane }; }; + + Debug MAGNUM_PHYSICS_EXPORT operator<<(Debug debug, ShapeDimensionTraits<2>::Type value); + Debug MAGNUM_PHYSICS_EXPORT operator<<(Debug debug, ShapeDimensionTraits<3>::Type value); } #endif @@ -118,17 +121,15 @@ template class MAGNUM_PHYSICS_EXPORT AbstractShape { virtual bool collides(const AbstractShape* other) const; }; + /** @brief Abstract two-dimensional shape */ typedef AbstractShape<2> AbstractShape2D; /** @brief Abstract three-dimensional shape */ typedef AbstractShape<3> AbstractShape3D; +#ifdef DOXYGEN_GENERATING_OUTPUT /** @debugoperator{Magnum::Physics::AbstractShape} */ -#ifndef DOXYGEN_GENERATING_OUTPUT -Debug MAGNUM_PHYSICS_EXPORT operator<<(Debug debug, AbstractShape2D::Type value); -Debug MAGNUM_PHYSICS_EXPORT operator<<(Debug debug, AbstractShape3D::Type value); -#else template Debug operator<<(Debug debug, typename AbstractShape::Type value); #endif