From d5df77fec897971f4847e2b9969ac728f282df16 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Mon, 25 May 2015 23:35:53 +0200 Subject: [PATCH] SceneGraph: removed deprecated list-argument functions taking pointers. Use functions taking list of references instead. --- src/Magnum/SceneGraph/AbstractObject.h | 34 ------ src/Magnum/SceneGraph/Object.h | 54 --------- src/Magnum/SceneGraph/Object.hpp | 130 ---------------------- src/Magnum/SceneGraph/Test/ObjectTest.cpp | 8 -- 4 files changed, 226 deletions(-) diff --git a/src/Magnum/SceneGraph/AbstractObject.h b/src/Magnum/SceneGraph/AbstractObject.h index 56b8a0a85..6f2594d48 100644 --- a/src/Magnum/SceneGraph/AbstractObject.h +++ b/src/Magnum/SceneGraph/AbstractObject.h @@ -204,23 +204,6 @@ template class AbstractObject return doTransformationMatrices(objects, initialTransformationMatrix); } - #ifdef MAGNUM_BUILD_DEPRECATED - /** - * @copybrief transformationMatrices() - * @deprecated Use @ref transformationMatrices() "transformationMatrices(const std::vector>>&, const MatrixType&)" instead. - */ - CORRADE_DEPRECATED("use transformationMatrices(const std::vector>>&, const MatrixType&) instead") std::vector transformationMatrices(const std::vector*>& objects, const MatrixType& initialTransformationMatrix = MatrixType()) const; - - #ifdef CORRADE_GCC47_COMPATIBILITY - /* Workarounds to avoid ambiguous overload errors on GCC < 4.8. And I - thought 4.7 was bug-free. */ - std::vector transformationMatrices(std::initializer_list>>& objects, const MatrixType& initialTransformationMatrix = MatrixType()) { - return transformationMatrices(std::vector>>{objects}, initialTransformationMatrix); - } - CORRADE_DEPRECATED("use transformationMatrices(const std::vector>>&, const MatrixType&) instead") std::vector transformationMatrices(std::initializer_list*> objects, const MatrixType& initialTransformationMatrix = MatrixType()) const; - #endif - #endif - /*@}*/ /** @@ -242,23 +225,6 @@ template class AbstractObject objects.front().get().doSetClean(objects); } - #ifdef MAGNUM_BUILD_DEPRECATED - /** - * @copybrief setClean(const std::vector>>&) - * @deprecated Use @ref setClean(const std::vector>>&) instead. - */ - static CORRADE_DEPRECATED("use setClean(const std::vector>>&) instead") void setClean(const std::vector*>& objects); - - #ifdef CORRADE_GCC47_COMPATIBILITY - /* Workarounds to avoid ambiguous overload errors on GCC < 4.8. And I - thought 4.7 was bug-free. */ - static void setClean(std::initializer_list>> objects) { - return setClean(std::vector>>{objects}); - } - static CORRADE_DEPRECATED("use setClean(const std::vector>>&) instead") void setClean(std::initializer_list*> objects); - #endif - #endif - /** * @brief Whether absolute transformation is dirty * diff --git a/src/Magnum/SceneGraph/Object.h b/src/Magnum/SceneGraph/Object.h index 700676745..9b7dc2c32 100644 --- a/src/Magnum/SceneGraph/Object.h +++ b/src/Magnum/SceneGraph/Object.h @@ -295,24 +295,6 @@ template class Object: public AbstractObject transformationMatrices(const std::vector>>& objects, const MatrixType& initialTransformationMatrix = MatrixType()) const; - #ifdef MAGNUM_BUILD_DEPRECATED - /** - * @copybrief transformationMatrices() - * @deprecated Use @ref transformationMatrices() "transformationMatrices(const std::vector>>&, const MatrixType&)" - * instead. - */ - CORRADE_DEPRECATED("use transformationMatrices(const std::vector>>&, const MatrixType&) instead") std::vector transformationMatrices(const std::vector*>& objects, const MatrixType& initialTransformationMatrix = MatrixType()) const; - - #ifdef CORRADE_GCC47_COMPATIBILITY - /* Workarounds to avoid ambiguous overload errors on GCC < 4.8. And I - thought 4.7 was bug-free. */ - std::vector transformationMatrices(std::initializer_list>> objects, const MatrixType& initialTransformationMatrix = MatrixType()) const { - return transformationMatrices(std::vector>>{objects}, initialTransformationMatrix); - } - CORRADE_DEPRECATED("use transformationMatrices(const std::vector>>&, const MatrixType&) instead") std::vector transformationMatrices(std::initializer_list*> objects, const MatrixType& initialTransformationMatrix = MatrixType()) const; - #endif - #endif - /** * @brief Transformations of given group of objects relative to this object * @@ -324,24 +306,6 @@ template class Object: public AbstractObject transformations(std::vector>> objects, const typename Transformation::DataType& initialTransformation = typename Transformation::DataType()) const; - #ifdef MAGNUM_BUILD_DEPRECATED - /** - * @copybrief transformations() - * @deprecated Use @ref transformations() "transformations(std::vector>>, const typename Transformation::DataType&)" - * instead. - */ - CORRADE_DEPRECATED("use transformations(std::vector>>, const typename Transformation::DataType&) instead") std::vector transformations(const std::vector*>& objects, const typename Transformation::DataType& initialTransformation = typename Transformation::DataType()) const; - - #ifdef CORRADE_GCC47_COMPATIBILITY - /* Workarounds to avoid ambiguous overload errors on GCC < 4.8. And I - thought 4.7 was bug-free. */ - std::vector transformations(std::initializer_list>> objects, const typename Transformation::DataType& initialTransformation = typename Transformation::DataType()) const { - return transformations(std::vector>>{objects}, initialTransformation); - } - CORRADE_DEPRECATED("use transformations(std::vector>>, const typename Transformation::DataType&) instead") std::vector transformations(std::initializer_list*> objects, const typename Transformation::DataType& initialTransformation = typename Transformation::DataType()) const; - #endif - #endif - /*@}*/ /** @@ -359,24 +323,6 @@ template class Object: public AbstractObject>> objects); - #ifdef MAGNUM_BUILD_DEPRECATED - /** - * @copybrief setClean(std::vector>>) - * @deprecated Use @ref setClean(std::vector>>) - * instead. - */ - CORRADE_DEPRECATED("use setClean(std::vector>>) instead") static void setClean(const std::vector*>& objects); - - #ifdef CORRADE_GCC47_COMPATIBILITY - /* Workarounds to avoid ambiguous overload errors on GCC < 4.8. And I - thought 4.7 was bug-free. */ - static void setClean(std::initializer_list>> objects) { - setClean(std::vector>>{objects}); - } - static CORRADE_DEPRECATED("use setClean(std::vector>>) instead") void setClean(std::initializer_list*> objects); - #endif - #endif - /** @copydoc AbstractObject::isDirty() */ bool isDirty() const { return !!(flags & Flag::Dirty); } diff --git a/src/Magnum/SceneGraph/Object.hpp b/src/Magnum/SceneGraph/Object.hpp index 1914059ee..9d3bcffeb 100644 --- a/src/Magnum/SceneGraph/Object.hpp +++ b/src/Magnum/SceneGraph/Object.hpp @@ -38,61 +38,9 @@ namespace Magnum { namespace SceneGraph { -#ifdef MAGNUM_BUILD_DEPRECATED -template void AbstractObject::setClean(const std::vector*>& objects) { - std::vector>> references; - references.reserve(objects.size()); - for(auto o: objects) { - CORRADE_INTERNAL_ASSERT(o != nullptr); - references.push_back(*o); - } - - setClean(references); -} - -#ifdef CORRADE_GCC47_COMPATIBILITY -template void AbstractObject::setClean(std::initializer_list*> objects) { - #ifdef __GNUC__ - #pragma GCC diagnostic push - #pragma GCC diagnostic ignored "-Wdeprecated-declarations" - #endif - return setClean(std::vector*>{objects}); - #ifdef __GNUC__ - #pragma GCC diagnostic pop - #endif -} -#endif -#endif - template AbstractObject::AbstractObject() {} template AbstractObject::~AbstractObject() {} -#ifdef MAGNUM_BUILD_DEPRECATED -template auto AbstractObject::transformationMatrices(const std::vector*>& objects, const MatrixType& initialTransformationMatrix) const -> std::vector { - std::vector>> references; - references.reserve(objects.size()); - for(auto o: objects) { - CORRADE_INTERNAL_ASSERT(o != nullptr); - references.push_back(*o); - } - - return transformationMatrices(references, initialTransformationMatrix); -} - -#ifdef CORRADE_GCC47_COMPATIBILITY -template auto AbstractObject::transformationMatrices(std::initializer_list*> objects, const MatrixType& initialTransformationMatrix) const -> std::vector { - #ifdef __GNUC__ - #pragma GCC diagnostic push - #pragma GCC diagnostic ignored "-Wdeprecated-declarations" - #endif - return transformationMatrices(std::vector*>{objects}, initialTransformationMatrix); - #ifdef __GNUC__ - #pragma GCC diagnostic pop - #endif -} -#endif -#endif - template AbstractTransformation::AbstractTransformation() {} template Object::Object(Object* parent): counter(0xFFFFu), flags(Flag::Dirty) { @@ -232,32 +180,6 @@ template auto Object::transformationMatric return transformationMatrices; } -#ifdef MAGNUM_BUILD_DEPRECATED -template auto Object::transformationMatrices(const std::vector*>& objects, const MatrixType& initialTransformationMatrix) const -> std::vector { - std::vector>> references; - references.reserve(objects.size()); - for(auto o: objects) { - CORRADE_INTERNAL_ASSERT(o != nullptr); - references.push_back(*o); - } - - return transformationMatrices(references, initialTransformationMatrix); -} - -#ifdef CORRADE_GCC47_COMPATIBILITY -template auto Object::transformationMatrices(std::initializer_list*> objects, const MatrixType& initialTransformationMatrix) const -> std::vector { - #ifdef __GNUC__ - #pragma GCC diagnostic push - #pragma GCC diagnostic ignored "-Wdeprecated-declarations" - #endif - return transformationMatrices(std::vector*>{objects}, initialTransformationMatrix); - #ifdef __GNUC__ - #pragma GCC diagnostic pop - #endif -} -#endif -#endif - /* Computing absolute transformations for given list of objects @@ -365,32 +287,6 @@ template std::vector Ob return jointTransformations; } -#ifdef MAGNUM_BUILD_DEPRECATED -template std::vector Object::transformations(const std::vector*>& objects, const typename Transformation::DataType& initialTransformation) const { - std::vector>> references; - references.reserve(objects.size()); - for(auto o: objects) { - CORRADE_INTERNAL_ASSERT(o != nullptr); - references.push_back(*o); - } - - return transformations(std::move(references), initialTransformation); -} - -#ifdef CORRADE_GCC47_COMPATIBILITY -template std::vector Object::transformations(std::initializer_list*> objects, const typename Transformation::DataType& initialTransformation) const { - #ifdef __GNUC__ - #pragma GCC diagnostic push - #pragma GCC diagnostic ignored "-Wdeprecated-declarations" - #endif - return transformations(std::vector*>{objects}, initialTransformation); - #ifdef __GNUC__ - #pragma GCC diagnostic pop - #endif -} -#endif -#endif - template typename Transformation::DataType Object::computeJointTransformation(const std::vector>>& jointObjects, std::vector& jointTransformations, const std::size_t joint, const typename Transformation::DataType& initialTransformation) const { std::reference_wrapper> o = jointObjects[joint]; @@ -476,32 +372,6 @@ template void Object::setClean(std::vector } } -#ifdef MAGNUM_BUILD_DEPRECATED -template void Object::setClean(const std::vector*>& objects) { - std::vector>> references; - references.reserve(objects.size()); - for(auto o: objects) { - CORRADE_INTERNAL_ASSERT(o != nullptr); - references.push_back(*o); - } - - setClean(std::move(references)); -} - -#ifdef CORRADE_GCC47_COMPATIBILITY -template void Object::setClean(std::initializer_list*> objects) { - #ifdef __GNUC__ - #pragma GCC diagnostic push - #pragma GCC diagnostic ignored "-Wdeprecated-declarations" - #endif - setClean(std::vector*>{objects}); - #ifdef __GNUC__ - #pragma GCC diagnostic pop - #endif -} -#endif -#endif - template void Object::setCleanInternal(const typename Transformation::DataType& absoluteTransformation) { /* "Lazy storage" for transformation matrix and inverted transformation matrix */ CachedTransformations cached; diff --git a/src/Magnum/SceneGraph/Test/ObjectTest.cpp b/src/Magnum/SceneGraph/Test/ObjectTest.cpp index 6935e30eb..ef8935fca 100644 --- a/src/Magnum/SceneGraph/Test/ObjectTest.cpp +++ b/src/Magnum/SceneGraph/Test/ObjectTest.cpp @@ -211,11 +211,7 @@ void ObjectTest::transformations() { Matrix4 initial = Matrix4::rotationX(Deg(90.0f)).inverted(); /* Empty list */ - #ifndef MAGNUM_BUILD_DEPRECATED CORRADE_COMPARE(s.transformations({}, initial), std::vector()); - #else - CORRADE_COMPARE(s.transformations(std::vector>{}, initial), std::vector()); - #endif /* Scene alone */ CORRADE_COMPARE(s.transformations({s}, initial), std::vector{initial}); @@ -459,11 +455,7 @@ void ObjectTest::setCleanListHierarchy() { void ObjectTest::setCleanListBulk() { /* Verify it doesn't crash when passed empty list */ - #ifndef MAGNUM_BUILD_DEPRECATED Object3D::setClean({}); - #else - Object3D::setClean(std::vector>{}); - #endif Scene3D scene; Object3D a(&scene);