diff --git a/src/SceneGraph/AbstractTransformation.h b/src/SceneGraph/AbstractTransformation.h index f429a021e..ee96fc440 100644 --- a/src/SceneGraph/AbstractTransformation.h +++ b/src/SceneGraph/AbstractTransformation.h @@ -25,7 +25,7 @@ */ /** @file - * @brief Class Magnum::SceneGraph::AbstractBasicTransformation, enum Magnum::SceneGraph::TransformationType, typedef Magnum::SceneGraph::AbstractTransformation2D, Magnum::SceneGraph::AbstractTransformation3D + * @brief Class Magnum::SceneGraph::AbstractTransformation, alias Magnum::SceneGraph::AbstractBasicTransformation2D, Magnum::SceneGraph::AbstractBasicTransformation3D, typedef Magnum::SceneGraph::AbstractTransformation2D, Magnum::SceneGraph::AbstractTransformation3D, enum Magnum::SceneGraph::TransformationType */ #include @@ -50,10 +50,11 @@ When subclassing, you have to: - Implement all members listed in **Subclass implementation** group above - Provide implicit (parameterless) constructor -@see @ref AbstractTransformation2D, @ref AbstractTransformation3D, - @ref scenegraph +@see @ref scenegraph, @ref AbstractBasicTransformation2D, + @ref AbstractBasicTransformation3D, @ref AbstractTransformation2D, + @ref AbstractTransformation3D */ -template class MAGNUM_SCENEGRAPH_EXPORT AbstractBasicTransformation { +template class MAGNUM_SCENEGRAPH_EXPORT AbstractTransformation { public: /** @brief Underlying floating-point type */ typedef T Type; @@ -61,7 +62,7 @@ template class MAGNUM_SCENEGRAPH_EXPORT Abstrac /** @brief Dimension count */ static const UnsignedInt Dimensions = dimensions; - explicit AbstractBasicTransformation(); + explicit AbstractTransformation(); #ifdef DOXYGEN_GENERATING_OUTPUT /** @@ -137,13 +138,13 @@ template class MAGNUM_SCENEGRAPH_EXPORT Abstrac * @brief Reset object transformation * @return Pointer to self (for method chaining) */ - AbstractBasicTransformation* resetTransformation() { + AbstractTransformation* resetTransformation() { doResetTransformation(); return this; } protected: - ~AbstractBasicTransformation() = default; + ~AbstractTransformation() = default; #ifdef DOXYGEN_GENERATING_OUTPUT protected: @@ -163,19 +164,53 @@ enum class TransformationType: UnsignedByte { Local = 0x01 }; +#ifndef CORRADE_GCC46_COMPATIBILITY +/** +@brief Base transformation for two-dimensional scenes + +Convenience alternative to %AbstractTransformation<2, T>. See +AbstractTransformation for more information. +@note Not available on GCC < 4.7. Use %AbstractTransformation<2, T> + instead. +@see @ref AbstractTransformation2D, @ref AbstractBasicTransformation3D +*/ +template using AbstractBasicTransformation2D = AbstractTransformation<2, T>; +#endif + /** @brief Base transformation for two-dimensional float scenes @see @ref AbstractTransformation3D */ -typedef AbstractBasicTransformation<2, Float> AbstractTransformation2D; +#ifndef CORRADE_GCC46_COMPATIBILITY +typedef AbstractBasicTransformation2D AbstractTransformation2D; +#else +typedef AbstractTransformation<2, Float> AbstractTransformation2D; +#endif + +#ifndef CORRADE_GCC46_COMPATIBILITY +/** +@brief Base transformation for three-dimensional scenes + +Convenience alternative to %AbstractTransformation<3, T>. See +AbstractTransformation for more information. +@note Not available on GCC < 4.7. Use %AbstractTransformation<3, T> + instead. +@see @ref AbstractTransformation3D, @ref AbstractBasicTransformation3D +*/ +template using AbstractBasicTransformation3D = AbstractTransformation<3, T>; +#endif /** @brief Base transformation for three-dimensional float scenes @see @ref AbstractTransformation2D */ -typedef AbstractBasicTransformation<3, Float> AbstractTransformation3D; +#ifndef CORRADE_GCC46_COMPATIBILITY +typedef AbstractBasicTransformation3D AbstractTransformation3D; +#else +typedef AbstractTransformation<3, Float> AbstractTransformation3D; +#endif }} diff --git a/src/SceneGraph/AbstractTranslationRotation2D.h b/src/SceneGraph/AbstractTranslationRotation2D.h index 661400784..2fd787365 100644 --- a/src/SceneGraph/AbstractTranslationRotation2D.h +++ b/src/SceneGraph/AbstractTranslationRotation2D.h @@ -36,8 +36,9 @@ namespace Magnum { namespace SceneGraph { @brief Base translation for two-dimensional scenes supporting translation and rotation @see @ref AbstractTranslationRotation2D, @ref scenegraph, @ref AbstractBasicTranslationRotation3D +@todo Use AbstractBasicTransformation2D when support for GCC 4.6 is dropped */ -template class AbstractBasicTranslationRotation2D: public AbstractBasicTransformation<2, T> { +template class AbstractBasicTranslationRotation2D: public AbstractTransformation<2, T> { public: explicit AbstractBasicTranslationRotation2D() = default; @@ -68,7 +69,7 @@ template class AbstractBasicTranslationRotation2D: public AbstractBasic /* Overloads to remove WTF-factor from method chaining order */ #ifndef DOXYGEN_GENERATING_OUTPUT AbstractBasicTranslationRotation2D* resetTransformation() { - AbstractBasicTransformation<2, T>::resetTransformation(); + AbstractTransformation<2, T>::resetTransformation(); return this; } #endif diff --git a/src/SceneGraph/AbstractTranslationRotation3D.h b/src/SceneGraph/AbstractTranslationRotation3D.h index 604e3cc66..0e36b0c9b 100644 --- a/src/SceneGraph/AbstractTranslationRotation3D.h +++ b/src/SceneGraph/AbstractTranslationRotation3D.h @@ -37,8 +37,9 @@ namespace Magnum { namespace SceneGraph { @brief Base translation for three-dimensional scenes supporting translation and rotation @see @ref AbstractTranslationRotation3D @ref scenegraph, @ref AbstractBasicTranslationRotation2D +@todo Use AbstractBasicTransformation3D when support for GCC 4.6 is dropped */ -template class AbstractBasicTranslationRotation3D: public AbstractBasicTransformation<3, T> { +template class AbstractBasicTranslationRotation3D: public AbstractTransformation<3, T> { public: explicit AbstractBasicTranslationRotation3D() = default; @@ -115,7 +116,7 @@ template class AbstractBasicTranslationRotation3D: public AbstractBasic /* Overloads to remove WTF-factor from method chaining order */ #ifndef DOXYGEN_GENERATING_OUTPUT AbstractBasicTranslationRotation3D* resetTransformation() { - AbstractBasicTransformation<3, T>::resetTransformation(); + AbstractTransformation<3, T>::resetTransformation(); return this; } #endif diff --git a/src/SceneGraph/AbstractTranslationRotationScaling3D.h b/src/SceneGraph/AbstractTranslationRotationScaling3D.h index 63719fa38..11a37b7b4 100644 --- a/src/SceneGraph/AbstractTranslationRotationScaling3D.h +++ b/src/SceneGraph/AbstractTranslationRotationScaling3D.h @@ -33,7 +33,7 @@ namespace Magnum { namespace SceneGraph { /** -@brief Base for three-dimensional transformations supporting translation, rotation and scaling +@brief Base transformation for three-dimensional scenes supporting translation, rotation and scaling @see @ref AbstractTranslationRotationScaling3D, @ref scenegraph, @ref AbstractBasicTranslationRotationScaling2D */ diff --git a/src/SceneGraph/Object.hpp b/src/SceneGraph/Object.hpp index 957bfffc4..ba60a6341 100644 --- a/src/SceneGraph/Object.hpp +++ b/src/SceneGraph/Object.hpp @@ -41,7 +41,7 @@ namespace Magnum { namespace SceneGraph { template AbstractObject::AbstractObject() {} template AbstractObject::~AbstractObject() {} -template AbstractBasicTransformation::AbstractBasicTransformation() {} +template AbstractTransformation::AbstractTransformation() {} template Object::~Object() = default; diff --git a/src/SceneGraph/SceneGraph.h b/src/SceneGraph/SceneGraph.h index 7f8abc2ca..cb520efe7 100644 --- a/src/SceneGraph/SceneGraph.h +++ b/src/SceneGraph/SceneGraph.h @@ -78,9 +78,16 @@ typedef AbstractObject<3, Float> AbstractObject3D; enum class TransformationType: UnsignedByte; -template class AbstractBasicTransformation; -typedef AbstractBasicTransformation<2, Float> AbstractTransformation2D; -typedef AbstractBasicTransformation<3, Float> AbstractTransformation3D; +template class AbstractTransformation; +#ifndef CORRADE_GCC46_COMPATIBILITY +template using AbstractBasicTransformation2D = AbstractTransformation<2, T>; +template using AbstractBasicTransformation3D = AbstractTransformation<3, T>; +typedef AbstractBasicTransformation2D AbstractTransformation2D; +typedef AbstractBasicTransformation3D AbstractTransformation3D; +#else +typedef AbstractTransformation<2, Float> AbstractTransformation2D; +typedef AbstractTransformation<3, Float> AbstractTransformation3D; +#endif template class AbstractBasicTranslationRotation2D; template class AbstractBasicTranslationRotation3D; diff --git a/src/SceneGraph/instantiation.cpp b/src/SceneGraph/instantiation.cpp index d230cbe83..75ae63633 100644 --- a/src/SceneGraph/instantiation.cpp +++ b/src/SceneGraph/instantiation.cpp @@ -39,8 +39,8 @@ namespace Magnum { namespace SceneGraph { #ifndef DOXYGEN_GENERATING_OUTPUT template class MAGNUM_SCENEGRAPH_EXPORT AbstractObject<2, Float>; template class MAGNUM_SCENEGRAPH_EXPORT AbstractObject<3, Float>; -template class MAGNUM_SCENEGRAPH_EXPORT AbstractBasicTransformation<2, Float>; -template class MAGNUM_SCENEGRAPH_EXPORT AbstractBasicTransformation<3, Float>; +template class MAGNUM_SCENEGRAPH_EXPORT AbstractTransformation<2, Float>; +template class MAGNUM_SCENEGRAPH_EXPORT AbstractTransformation<3, Float>; template class MAGNUM_SCENEGRAPH_EXPORT AbstractFeature<2, Float>; template class MAGNUM_SCENEGRAPH_EXPORT AbstractFeature<3, Float>;