From 8f12f2a8441623c7af68cbefb6ebe555c0cc5915 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Thu, 5 Dec 2013 01:02:38 +0100 Subject: [PATCH 01/11] Math: simplified internal Vector constructor. Use size we want, not size we got. --- src/Math/Vector.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Math/Vector.h b/src/Math/Vector.h index 5f13d62ba..8fd5213b3 100644 --- a/src/Math/Vector.h +++ b/src/Math/Vector.h @@ -527,7 +527,7 @@ template class Vector { private: /* Implementation for Vector::Vector(const Vector&) */ - template constexpr explicit Vector(Implementation::Sequence, const Vector& vector): _data{T(vector._data[sequence])...} {} + template constexpr explicit Vector(Implementation::Sequence, const Vector& vector): _data{T(vector._data[sequence])...} {} /* Implementation for Vector::Vector(U) */ template constexpr explicit Vector(Implementation::Sequence, T value): _data{Implementation::repeat(value, sequence)...} {} From 658839446c2e74f0be2f27081163eb8f8ac4c636 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Thu, 5 Dec 2013 01:03:31 +0100 Subject: [PATCH 02/11] No need to explicitly specify default template parameter. --- src/Test/MeshTest.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Test/MeshTest.cpp b/src/Test/MeshTest.cpp index 7b382c3e4..0f8ed4271 100644 --- a/src/Test/MeshTest.cpp +++ b/src/Test/MeshTest.cpp @@ -63,7 +63,7 @@ void MeshTest::configurationPrimitive() { Utility::Configuration c; c.setValue("primitive", Mesh::Primitive::LineStrip); - CORRADE_COMPARE(c.value("primitive"), "LineStrip"); + CORRADE_COMPARE(c.value("primitive"), "LineStrip"); CORRADE_COMPARE(c.value("primitive"), Mesh::Primitive::LineStrip); } @@ -71,7 +71,7 @@ void MeshTest::configurationIndexType() { Utility::Configuration c; c.setValue("type", Mesh::IndexType::UnsignedByte); - CORRADE_COMPARE(c.value("type"), "UnsignedByte"); + CORRADE_COMPARE(c.value("type"), "UnsignedByte"); CORRADE_COMPARE(c.value("type"), Mesh::IndexType::UnsignedByte); } From 13351f9371d22542803f3231f9690a8f6b578543 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Thu, 5 Dec 2013 01:04:02 +0100 Subject: [PATCH 03/11] Install all *TestLib libraries on Windows. They are needed when running tests. --- src/Plugins/MagnumFont/CMakeLists.txt | 10 ++++++++++ src/Plugins/MagnumFontConverter/CMakeLists.txt | 10 ++++++++++ src/Plugins/TgaImageConverter/CMakeLists.txt | 10 ++++++++++ src/Plugins/TgaImporter/CMakeLists.txt | 10 ++++++++++ src/Plugins/WavAudioImporter/CMakeLists.txt | 10 ++++++++++ 5 files changed, 50 insertions(+) diff --git a/src/Plugins/MagnumFont/CMakeLists.txt b/src/Plugins/MagnumFont/CMakeLists.txt index 9ea4bb7a8..8c6a47117 100644 --- a/src/Plugins/MagnumFont/CMakeLists.txt +++ b/src/Plugins/MagnumFont/CMakeLists.txt @@ -46,5 +46,15 @@ install(FILES ${MagnumFont_HEADERS} DESTINATION ${MAGNUM_PLUGINS_INCLUDE_INSTALL if(BUILD_GL_TESTS) add_library(MagnumFontTestLib STATIC $) target_link_libraries(MagnumFontTestLib Magnum MagnumText TgaImporterTestLib) + + # On Windows we need to install first and then run the tests to avoid "DLL + # not found" hell, thus we need to install this too + if(WIN32 AND NOT CMAKE_CROSSCOMPILING) + install(TARGETS MagnumFontTestLib + RUNTIME DESTINATION ${MAGNUM_BINARY_INSTALL_DIR} + LIBRARY DESTINATION ${MAGNUM_LIBRARY_INSTALL_DIR} + ARCHIVE DESTINATION ${MAGNUM_LIBRARY_INSTALL_DIR}) + endif() + add_subdirectory(Test) endif() diff --git a/src/Plugins/MagnumFontConverter/CMakeLists.txt b/src/Plugins/MagnumFontConverter/CMakeLists.txt index f73442afb..5f590b7e8 100644 --- a/src/Plugins/MagnumFontConverter/CMakeLists.txt +++ b/src/Plugins/MagnumFontConverter/CMakeLists.txt @@ -46,5 +46,15 @@ install(FILES ${MagnumFontConverter_HEADERS} DESTINATION ${MAGNUM_PLUGINS_INCLUD if(BUILD_GL_TESTS) add_library(MagnumFontConverterTestLib STATIC $) target_link_libraries(MagnumFontConverterTestLib Magnum MagnumText TgaImageConverterTestLib) + + # On Windows we need to install first and then run the tests to avoid "DLL + # not found" hell, thus we need to install this too + if(WIN32 AND NOT CMAKE_CROSSCOMPILING) + install(TARGETS MagnumFontConverterTestLib + RUNTIME DESTINATION ${MAGNUM_BINARY_INSTALL_DIR} + LIBRARY DESTINATION ${MAGNUM_LIBRARY_INSTALL_DIR} + ARCHIVE DESTINATION ${MAGNUM_LIBRARY_INSTALL_DIR}) + endif() + add_subdirectory(Test) endif() diff --git a/src/Plugins/TgaImageConverter/CMakeLists.txt b/src/Plugins/TgaImageConverter/CMakeLists.txt index ddbb4149a..1efdd806e 100644 --- a/src/Plugins/TgaImageConverter/CMakeLists.txt +++ b/src/Plugins/TgaImageConverter/CMakeLists.txt @@ -42,5 +42,15 @@ install(FILES ${TgaImageConverter_HEADERS} DESTINATION ${MAGNUM_PLUGINS_INCLUDE_ if(BUILD_TESTS) add_library(TgaImageConverterTestLib ${SHARED_OR_STATIC} $) target_link_libraries(TgaImageConverterTestLib Magnum) + + # On Windows we need to install first and then run the tests to avoid "DLL + # not found" hell, thus we need to install this too + if(WIN32 AND NOT CMAKE_CROSSCOMPILING) + install(TARGETS TgaImageConverterTestLib + RUNTIME DESTINATION ${MAGNUM_BINARY_INSTALL_DIR} + LIBRARY DESTINATION ${MAGNUM_LIBRARY_INSTALL_DIR} + ARCHIVE DESTINATION ${MAGNUM_LIBRARY_INSTALL_DIR}) + endif() + add_subdirectory(Test) endif() diff --git a/src/Plugins/TgaImporter/CMakeLists.txt b/src/Plugins/TgaImporter/CMakeLists.txt index 5f87fab56..2f893e5f0 100644 --- a/src/Plugins/TgaImporter/CMakeLists.txt +++ b/src/Plugins/TgaImporter/CMakeLists.txt @@ -43,5 +43,15 @@ install(FILES ${TgaImporter_HEADERS} DESTINATION ${MAGNUM_PLUGINS_INCLUDE_INSTAL if(BUILD_TESTS) add_library(TgaImporterTestLib ${SHARED_OR_STATIC} $) target_link_libraries(TgaImporterTestLib Magnum) + + # On Windows we need to install first and then run the tests to avoid "DLL + # not found" hell, thus we need to install this too + if(WIN32 AND NOT CMAKE_CROSSCOMPILING) + install(TARGETS TgaImporterTestLib + RUNTIME DESTINATION ${MAGNUM_BINARY_INSTALL_DIR} + LIBRARY DESTINATION ${MAGNUM_LIBRARY_INSTALL_DIR} + ARCHIVE DESTINATION ${MAGNUM_LIBRARY_INSTALL_DIR}) + endif() + add_subdirectory(Test) endif() diff --git a/src/Plugins/WavAudioImporter/CMakeLists.txt b/src/Plugins/WavAudioImporter/CMakeLists.txt index 477f04e53..a1a406d74 100644 --- a/src/Plugins/WavAudioImporter/CMakeLists.txt +++ b/src/Plugins/WavAudioImporter/CMakeLists.txt @@ -47,5 +47,15 @@ install(FILES ${WavAudioImporter_HEADERS} DESTINATION ${MAGNUM_PLUGINS_INCLUDE_I if(BUILD_TESTS) add_library(WavAudioImporterTestLib STATIC $) target_link_libraries(WavAudioImporterTestLib Magnum MagnumAudio) + + # On Windows we need to install first and then run the tests to avoid "DLL + # not found" hell, thus we need to install this too + if(WIN32 AND NOT CMAKE_CROSSCOMPILING) + install(TARGETS WavAudioImporterTestLib + RUNTIME DESTINATION ${MAGNUM_BINARY_INSTALL_DIR} + LIBRARY DESTINATION ${MAGNUM_LIBRARY_INSTALL_DIR} + ARCHIVE DESTINATION ${MAGNUM_LIBRARY_INSTALL_DIR}) + endif() + add_subdirectory(Test) endif() From eb877b31ba65ba36b3c539eef977a2a25b0c3627 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Thu, 5 Dec 2013 01:06:12 +0100 Subject: [PATCH 04/11] SceneGraph: removed *Transformation::move(). The original purpose was to allow modifying of drawing order, but this doesn't affect that at all (the order is preserved in DrawableGroup), thus the functions are useless. --- src/SceneGraph/DualComplexTransformation.h | 11 ----------- src/SceneGraph/MatrixTransformation2D.h | 11 ----------- src/SceneGraph/RigidMatrixTransformation2D.h | 11 ----------- 3 files changed, 33 deletions(-) diff --git a/src/SceneGraph/DualComplexTransformation.h b/src/SceneGraph/DualComplexTransformation.h index 3edf7b8ef..1ec7c031d 100644 --- a/src/SceneGraph/DualComplexTransformation.h +++ b/src/SceneGraph/DualComplexTransformation.h @@ -117,17 +117,6 @@ template class BasicDualComplexTransformation: public AbstractBasicTran return transformInternal(Math::DualComplex::rotation(angle), type); } - /** - * @brief Move object in stacking order - * @param under Sibling object under which to move or `nullptr`, - * if you want to move it above all. - * @return Reference to self (for method chaining) - */ - Object>& move(Object>* under) { - static_cast*>(this)->Containers::template LinkedList>>::move(this, under); - return static_cast>&>(*this); - } - protected: /* Allow construction only from Object */ explicit BasicDualComplexTransformation() = default; diff --git a/src/SceneGraph/MatrixTransformation2D.h b/src/SceneGraph/MatrixTransformation2D.h index a2d0656b4..f29cc0854 100644 --- a/src/SceneGraph/MatrixTransformation2D.h +++ b/src/SceneGraph/MatrixTransformation2D.h @@ -117,17 +117,6 @@ template class BasicMatrixTransformation2D: public AbstractBasicTransla return transform(Math::Matrix3::reflection(normal), type); } - /** - * @brief Move object in stacking order - * @param under Sibling object under which to move or `nullptr`, - * if you want to move it above all. - * @return Reference to self (for method chaining) - */ - Object>& move(Object>* under) { - static_cast*>(this)->Containers::template LinkedList>>::move(this, under); - return static_cast>&>(*this); - } - protected: /* Allow construction only from Object */ explicit BasicMatrixTransformation2D() = default; diff --git a/src/SceneGraph/RigidMatrixTransformation2D.h b/src/SceneGraph/RigidMatrixTransformation2D.h index 388491b00..5612a00a8 100644 --- a/src/SceneGraph/RigidMatrixTransformation2D.h +++ b/src/SceneGraph/RigidMatrixTransformation2D.h @@ -134,17 +134,6 @@ template class BasicRigidMatrixTransformation2D: public AbstractBasicTr return transformInternal(Math::Matrix3::reflection(normal), type); } - /** - * @brief Move object in stacking order - * @param under Sibling object under which to move or `nullptr`, - * if you want to move it above all. - * @return Reference to self (for method chaining) - */ - Object>& move(Object>* under) { - static_cast*>(this)->Containers::template LinkedList>>::move(this, under); - return static_cast>&>(*this); - } - protected: /* Allow construction only from Object */ explicit BasicRigidMatrixTransformation2D() = default; From ddc466a796b50522ae817d1c85bc40562af9e4ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Thu, 5 Dec 2013 01:08:17 +0100 Subject: [PATCH 05/11] SceneGraph: use proper library for tests where graceful assert is wanted. --- src/SceneGraph/Test/CMakeLists.txt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/SceneGraph/Test/CMakeLists.txt b/src/SceneGraph/Test/CMakeLists.txt index 0ba37c03a..fd6ee3519 100644 --- a/src/SceneGraph/Test/CMakeLists.txt +++ b/src/SceneGraph/Test/CMakeLists.txt @@ -24,13 +24,13 @@ corrade_add_test(SceneGraphAnimableTest AnimableTest.cpp LIBRARIES MagnumSceneGraph) corrade_add_test(SceneGraphCameraTest CameraTest.cpp LIBRARIES MagnumSceneGraph) -corrade_add_test(SceneGraphDualComplexTransfo___Test DualComplexTransformationTest.cpp LIBRARIES MagnumSceneGraph) -corrade_add_test(SceneGraphDualQuaternionTran___Test DualQuaternionTransformationTest.cpp LIBRARIES MagnumSceneGraph) +corrade_add_test(SceneGraphDualComplexTransfo___Test DualComplexTransformationTest.cpp LIBRARIES MagnumSceneGraphTestLib) +corrade_add_test(SceneGraphDualQuaternionTran___Test DualQuaternionTransformationTest.cpp LIBRARIES MagnumSceneGraphTestLib) corrade_add_test(SceneGraphMatrixTransforma___2DTest MatrixTransformation2DTest.cpp LIBRARIES MagnumSceneGraph) corrade_add_test(SceneGraphMatrixTransforma___3DTest MatrixTransformation3DTest.cpp LIBRARIES MagnumSceneGraph) corrade_add_test(SceneGraphObjectTest ObjectTest.cpp LIBRARIES MagnumSceneGraphTestLib) -corrade_add_test(SceneGraphRigidMatrixTrans___2DTest RigidMatrixTransformation2DTest.cpp LIBRARIES MagnumSceneGraph) -corrade_add_test(SceneGraphRigidMatrixTrans___3DTest RigidMatrixTransformation3DTest.cpp LIBRARIES MagnumSceneGraph) +corrade_add_test(SceneGraphRigidMatrixTrans___2DTest RigidMatrixTransformation2DTest.cpp LIBRARIES MagnumSceneGraphTestLib) +corrade_add_test(SceneGraphRigidMatrixTrans___3DTest RigidMatrixTransformation3DTest.cpp LIBRARIES MagnumSceneGraphTestLib) corrade_add_test(SceneGraphSceneTest SceneTest.cpp LIBRARIES MagnumSceneGraph) corrade_add_test(SceneGraphTranslationTransfo___Test TranslationTransformationTest.cpp LIBRARIES MagnumSceneGraph) From 9cb3d17ad92c3f6d8bd54f62e4458ca0c6806eab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Thu, 5 Dec 2013 01:09:09 +0100 Subject: [PATCH 06/11] SceneGraph: fix function signature. Fixes compilation error on MSVC. --- src/SceneGraph/AbstractTranslation.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/SceneGraph/AbstractTranslation.h b/src/SceneGraph/AbstractTranslation.h index df64b3d58..9270224e9 100644 --- a/src/SceneGraph/AbstractTranslation.h +++ b/src/SceneGraph/AbstractTranslation.h @@ -62,7 +62,7 @@ class AbstractTranslation: public AbstractTransformation { * @see @ref Vector2::xAxis(), @ref Vector2::yAxis(), @ref Vector3::xAxis(), * @ref Vector3::yAxis(), @ref Vector3::zAxis() */ - AbstractTranslation& translate(const typename DimensionTraits::VectorType& vector, TransformationType type = TransformationType::Global) { + AbstractTranslation& translate(const typename DimensionTraits::VectorType& vector, TransformationType type = TransformationType::Global) { doTranslate(vector, type); return *this; } From 3b666d85f460de3ea44c817549ef393feb30ff02 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Thu, 5 Dec 2013 01:48:29 +0100 Subject: [PATCH 07/11] SceneGraph: instantiate everything consistently on one place. --- src/SceneGraph/Animable.cpp | 9 +-------- src/SceneGraph/instantiation.cpp | 6 ++++++ 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/src/SceneGraph/Animable.cpp b/src/SceneGraph/Animable.cpp index 1087f8371..d4b41833f 100644 --- a/src/SceneGraph/Animable.cpp +++ b/src/SceneGraph/Animable.cpp @@ -22,17 +22,10 @@ DEALINGS IN THE SOFTWARE. */ -#include "Animable.hpp" +#include "Animable.h" namespace Magnum { namespace SceneGraph { -#ifndef DOXYGEN_GENERATING_OUTPUT -template class MAGNUM_SCENEGRAPH_EXPORT Animable<2, Float>; -template class MAGNUM_SCENEGRAPH_EXPORT Animable<3, Float>; -template class MAGNUM_SCENEGRAPH_EXPORT AnimableGroup<2, Float>; -template class MAGNUM_SCENEGRAPH_EXPORT AnimableGroup<3, Float>; -#endif - Debug operator<<(Debug debug, AnimationState value) { switch(value) { #define _c(value) case AnimationState::value: return debug << "SceneGraph::AnimationState::" #value; diff --git a/src/SceneGraph/instantiation.cpp b/src/SceneGraph/instantiation.cpp index f326f2c02..9c8ca8606 100644 --- a/src/SceneGraph/instantiation.cpp +++ b/src/SceneGraph/instantiation.cpp @@ -23,6 +23,7 @@ */ #include "SceneGraph/AbstractFeature.hpp" +#include "SceneGraph/Animable.hpp" #include "SceneGraph/Camera2D.hpp" #include "SceneGraph/Camera3D.hpp" #include "SceneGraph/DualComplexTransformation.h" @@ -48,6 +49,11 @@ template class MAGNUM_SCENEGRAPH_EXPORT AbstractFeature<3, Float>; template class MAGNUM_SCENEGRAPH_EXPORT AbstractFeatureGroup<2, Float>; template class MAGNUM_SCENEGRAPH_EXPORT AbstractFeatureGroup<3, Float>; +template class MAGNUM_SCENEGRAPH_EXPORT Animable<2, Float>; +template class MAGNUM_SCENEGRAPH_EXPORT Animable<3, Float>; +template class MAGNUM_SCENEGRAPH_EXPORT AnimableGroup<2, Float>; +template class MAGNUM_SCENEGRAPH_EXPORT AnimableGroup<3, Float>; + template class MAGNUM_SCENEGRAPH_EXPORT AbstractCamera<2, Float>; template class MAGNUM_SCENEGRAPH_EXPORT AbstractCamera<3, Float>; template class MAGNUM_SCENEGRAPH_EXPORT BasicCamera2D; From 6a3103e03ed5dd77892b1c2ae0a40973019dc931 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Thu, 5 Dec 2013 01:50:16 +0100 Subject: [PATCH 08/11] SceneGraph: no need to mark the templates with export macros. --- src/SceneGraph/AbstractCamera.h | 2 +- src/SceneGraph/AbstractFeature.h | 2 +- src/SceneGraph/AbstractObject.h | 2 +- src/SceneGraph/AbstractTransformation.h | 2 +- src/SceneGraph/Animable.h | 2 +- src/SceneGraph/AnimableGroup.h | 2 +- src/SceneGraph/Camera2D.h | 2 +- src/SceneGraph/Camera3D.h | 2 +- src/SceneGraph/FeatureGroup.h | 2 +- src/SceneGraph/Object.h | 2 +- 10 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/SceneGraph/AbstractCamera.h b/src/SceneGraph/AbstractCamera.h index 3a03d8603..4ee9ec64c 100644 --- a/src/SceneGraph/AbstractCamera.h +++ b/src/SceneGraph/AbstractCamera.h @@ -73,7 +73,7 @@ and @ref Camera3D-explicit-specializations "Camera3D" class documentation or @see @ref scenegraph, @ref AbstractBasicCamera2D, @ref AbstractBasicCamera3D, @ref Drawable, @ref DrawableGroup */ -template class MAGNUM_SCENEGRAPH_EXPORT AbstractCamera: public AbstractFeature { +template class AbstractCamera: public AbstractFeature { public: /** @brief Aspect ratio policy */ AspectRatioPolicy aspectRatioPolicy() const { return _aspectRatioPolicy; } diff --git a/src/SceneGraph/AbstractFeature.h b/src/SceneGraph/AbstractFeature.h index 695cedad6..6de7a17f3 100644 --- a/src/SceneGraph/AbstractFeature.h +++ b/src/SceneGraph/AbstractFeature.h @@ -160,7 +160,7 @@ also @ref compilation-speedup-hpp for more information. @see @ref AbstractBasicFeature2D, @ref AbstractBasicFeature3D, @ref AbstractFeature2D, @ref AbstractFeature3D */ -template class MAGNUM_SCENEGRAPH_EXPORT AbstractFeature +template class AbstractFeature #ifndef DOXYGEN_GENERATING_OUTPUT : private Containers::LinkedListItem, AbstractObject> #endif diff --git a/src/SceneGraph/AbstractObject.h b/src/SceneGraph/AbstractObject.h index c2b1e15fa..96733b542 100644 --- a/src/SceneGraph/AbstractObject.h +++ b/src/SceneGraph/AbstractObject.h @@ -69,7 +69,7 @@ class documentation or @ref compilation-speedup-hpp for more information. @see @ref AbstractBasicObject2D, @ref AbstractBasicObject3D, @ref AbstractObject2D, @ref AbstractObject3D */ -template class MAGNUM_SCENEGRAPH_EXPORT AbstractObject +template class AbstractObject #ifndef DOXYGEN_GENERATING_OUTPUT : private Containers::LinkedList> #endif diff --git a/src/SceneGraph/AbstractTransformation.h b/src/SceneGraph/AbstractTransformation.h index 7d4b5797b..e0b77d53f 100644 --- a/src/SceneGraph/AbstractTransformation.h +++ b/src/SceneGraph/AbstractTransformation.h @@ -52,7 +52,7 @@ use @ref Object.hpp implementation file to avoid linker errors. See @ref AbstractBasicTransformation3D, @ref AbstractTransformation2D, @ref AbstractTransformation3D */ -template class MAGNUM_SCENEGRAPH_EXPORT AbstractTransformation { +template class AbstractTransformation { public: /** @brief Underlying floating-point type */ typedef T Type; diff --git a/src/SceneGraph/Animable.h b/src/SceneGraph/Animable.h index 2f8df0020..05d8b7da8 100644 --- a/src/SceneGraph/Animable.h +++ b/src/SceneGraph/Animable.h @@ -140,7 +140,7 @@ use @ref Animable.hpp implementation file to avoid linker errors. See also @see @ref scenegraph, @ref BasicAnimable2D, @ref BasicAnimable3D, @ref Animable2D, @ref Animable3D, @ref AnimableGroup */ -template class MAGNUM_SCENEGRAPH_EXPORT Animable: public AbstractGroupedFeature, T> { +template class Animable: public AbstractGroupedFeature, T> { friend class AnimableGroup; public: diff --git a/src/SceneGraph/AnimableGroup.h b/src/SceneGraph/AnimableGroup.h index 39af7a1e6..eb2558bb6 100644 --- a/src/SceneGraph/AnimableGroup.h +++ b/src/SceneGraph/AnimableGroup.h @@ -41,7 +41,7 @@ See Animable for more information. @see @ref scenegraph, @ref BasicAnimableGroup2D, @ref BasicAnimableGroup3D, @ref AnimableGroup2D, @ref AnimableGroup3D */ -template class MAGNUM_SCENEGRAPH_EXPORT AnimableGroup: public FeatureGroup, T> { +template class AnimableGroup: public FeatureGroup, T> { friend class Animable; public: diff --git a/src/SceneGraph/Camera2D.h b/src/SceneGraph/Camera2D.h index 7d0b982b6..8dc0e564a 100644 --- a/src/SceneGraph/Camera2D.h +++ b/src/SceneGraph/Camera2D.h @@ -57,7 +57,7 @@ class documentation or @ref compilation-speedup-hpp for more information. @see @ref scenegraph, @ref Camera2D, @ref BasicCamera3D, @ref Drawable, @ref DrawableGroup */ -template class MAGNUM_SCENEGRAPH_EXPORT BasicCamera2D: public AbstractCamera<2, T> { +template class BasicCamera2D: public AbstractCamera<2, T> { public: /** * @brief Constructor diff --git a/src/SceneGraph/Camera3D.h b/src/SceneGraph/Camera3D.h index c33c843c0..6e8c40903 100644 --- a/src/SceneGraph/Camera3D.h +++ b/src/SceneGraph/Camera3D.h @@ -62,7 +62,7 @@ class documentation or @ref compilation-speedup-hpp for more information. @see @ref scenegraph, @ref Camera3D, @ref BasicCamera2D, @ref Drawable, @ref DrawableGroup */ -template class MAGNUM_SCENEGRAPH_EXPORT BasicCamera3D: public AbstractCamera<3, T> { +template class BasicCamera3D: public AbstractCamera<3, T> { public: /** * @brief Constructor diff --git a/src/SceneGraph/FeatureGroup.h b/src/SceneGraph/FeatureGroup.h index 09f617c17..01ca3da83 100644 --- a/src/SceneGraph/FeatureGroup.h +++ b/src/SceneGraph/FeatureGroup.h @@ -41,7 +41,7 @@ namespace Magnum { namespace SceneGraph { See @ref FeatureGroup. */ -template class MAGNUM_SCENEGRAPH_EXPORT AbstractFeatureGroup { +template class AbstractFeatureGroup { template friend class FeatureGroup; explicit AbstractFeatureGroup(); diff --git a/src/SceneGraph/Object.h b/src/SceneGraph/Object.h index b4b59b354..e87bb3426 100644 --- a/src/SceneGraph/Object.h +++ b/src/SceneGraph/Object.h @@ -97,7 +97,7 @@ class documentation or @ref compilation-speedup-hpp for more information. @ref DebugTools::ObjectRenderer @todo Test (and fix) that hpp works also on Windows */ -template class MAGNUM_SCENEGRAPH_EXPORT Object: public AbstractObject, public Transformation +template class Object: public AbstractObject, public Transformation #ifndef DOXYGEN_GENERATING_OUTPUT , private Containers::LinkedList>, private Containers::LinkedListItem, Object> #endif From e38be052a0a997fe7016f13236bc05ef40a3ba0c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Thu, 5 Dec 2013 01:51:19 +0100 Subject: [PATCH 09/11] SceneGraph: need to mark the instances with extern template on Windows. Otherwise they don't get properly imported from the DLL. Also the instantiations don't have to be marked, so mark them as such only on non-Windows. --- src/SceneGraph/AbstractCamera.h | 5 ++ src/SceneGraph/AbstractFeature.h | 5 ++ src/SceneGraph/AbstractObject.h | 5 ++ src/SceneGraph/AbstractTransformation.h | 5 ++ src/SceneGraph/Animable.h | 5 ++ src/SceneGraph/AnimableGroup.h | 5 ++ src/SceneGraph/Camera2D.h | 4 ++ src/SceneGraph/Camera3D.h | 4 ++ src/SceneGraph/DualComplexTransformation.h | 4 ++ src/SceneGraph/DualQuaternionTransformation.h | 4 ++ src/SceneGraph/FeatureGroup.h | 5 ++ src/SceneGraph/MatrixTransformation2D.h | 4 ++ src/SceneGraph/MatrixTransformation3D.h | 4 ++ src/SceneGraph/RigidMatrixTransformation2D.h | 4 ++ src/SceneGraph/RigidMatrixTransformation3D.h | 4 ++ src/SceneGraph/TranslationTransformation.h | 7 +++ src/SceneGraph/instantiation.cpp | 59 +++++++++++-------- 17 files changed, 107 insertions(+), 26 deletions(-) diff --git a/src/SceneGraph/AbstractCamera.h b/src/SceneGraph/AbstractCamera.h index 4ee9ec64c..981ca9ea1 100644 --- a/src/SceneGraph/AbstractCamera.h +++ b/src/SceneGraph/AbstractCamera.h @@ -209,6 +209,11 @@ typedef AbstractBasicCamera3D AbstractCamera3D; typedef AbstractCamera<3, Float> AbstractCamera3D; #endif +#ifdef _WIN32 +extern template class MAGNUM_SCENEGRAPH_EXPORT AbstractCamera<2, Float>; +extern template class MAGNUM_SCENEGRAPH_EXPORT AbstractCamera<3, Float>; +#endif + }} #endif diff --git a/src/SceneGraph/AbstractFeature.h b/src/SceneGraph/AbstractFeature.h index 6de7a17f3..4959fd631 100644 --- a/src/SceneGraph/AbstractFeature.h +++ b/src/SceneGraph/AbstractFeature.h @@ -341,6 +341,11 @@ typedef AbstractBasicFeature3D AbstractFeature3D; typedef AbstractFeature<3, Float> AbstractFeature3D; #endif +#ifdef _WIN32 +extern template class MAGNUM_SCENEGRAPH_EXPORT AbstractFeature<2, Float>; +extern template class MAGNUM_SCENEGRAPH_EXPORT AbstractFeature<3, Float>; +#endif + }} #endif diff --git a/src/SceneGraph/AbstractObject.h b/src/SceneGraph/AbstractObject.h index 96733b542..42228f852 100644 --- a/src/SceneGraph/AbstractObject.h +++ b/src/SceneGraph/AbstractObject.h @@ -277,6 +277,11 @@ typedef AbstractBasicObject3D AbstractObject3D; typedef AbstractObject<3, Float> AbstractObject3D; #endif +#ifdef _WIN32 +extern template class MAGNUM_SCENEGRAPH_EXPORT AbstractObject<2, Float>; +extern template class MAGNUM_SCENEGRAPH_EXPORT AbstractObject<3, Float>; +#endif + }} #endif diff --git a/src/SceneGraph/AbstractTransformation.h b/src/SceneGraph/AbstractTransformation.h index e0b77d53f..33e74ab09 100644 --- a/src/SceneGraph/AbstractTransformation.h +++ b/src/SceneGraph/AbstractTransformation.h @@ -144,6 +144,11 @@ typedef AbstractBasicTransformation3D AbstractTransformation3D; typedef AbstractTransformation<3, Float> AbstractTransformation3D; #endif +#ifdef _WIN32 +extern template class MAGNUM_SCENEGRAPH_EXPORT AbstractTransformation<2, Float>; +extern template class MAGNUM_SCENEGRAPH_EXPORT AbstractTransformation<3, Float>; +#endif + }} #endif diff --git a/src/SceneGraph/Animable.h b/src/SceneGraph/Animable.h index 05d8b7da8..5779636f8 100644 --- a/src/SceneGraph/Animable.h +++ b/src/SceneGraph/Animable.h @@ -380,6 +380,11 @@ typedef BasicAnimable3D Animable3D; typedef Animable<3, Float> Animable3D; #endif +#ifdef _WIN32 +extern template class MAGNUM_SCENEGRAPH_EXPORT Animable<2, Float>; +extern template class MAGNUM_SCENEGRAPH_EXPORT Animable<3, Float>; +#endif + }} #endif diff --git a/src/SceneGraph/AnimableGroup.h b/src/SceneGraph/AnimableGroup.h index eb2558bb6..da42aaa6f 100644 --- a/src/SceneGraph/AnimableGroup.h +++ b/src/SceneGraph/AnimableGroup.h @@ -118,6 +118,11 @@ typedef BasicAnimableGroup3D AnimableGroup3D; typedef AnimableGroup<3, Float> AnimableGroup3D; #endif +#ifdef _WIN32 +extern template class MAGNUM_SCENEGRAPH_EXPORT AnimableGroup<2, Float>; +extern template class MAGNUM_SCENEGRAPH_EXPORT AnimableGroup<3, Float>; +#endif + }} #endif diff --git a/src/SceneGraph/Camera2D.h b/src/SceneGraph/Camera2D.h index 8dc0e564a..09183c9ef 100644 --- a/src/SceneGraph/Camera2D.h +++ b/src/SceneGraph/Camera2D.h @@ -105,6 +105,10 @@ template class BasicCamera2D: public AbstractCamera<2, T> { */ typedef BasicCamera2D Camera2D; +#ifdef _WIN32 +extern template class MAGNUM_SCENEGRAPH_EXPORT BasicCamera2D; +#endif + }} #endif diff --git a/src/SceneGraph/Camera3D.h b/src/SceneGraph/Camera3D.h index 6e8c40903..8b126458b 100644 --- a/src/SceneGraph/Camera3D.h +++ b/src/SceneGraph/Camera3D.h @@ -141,6 +141,10 @@ template class BasicCamera3D: public AbstractCamera<3, T> { */ typedef BasicCamera3D Camera3D; +#ifdef _WIN32 +extern template class MAGNUM_SCENEGRAPH_EXPORT BasicCamera3D; +#endif + }} #endif diff --git a/src/SceneGraph/DualComplexTransformation.h b/src/SceneGraph/DualComplexTransformation.h index 1ec7c031d..539c5ed79 100644 --- a/src/SceneGraph/DualComplexTransformation.h +++ b/src/SceneGraph/DualComplexTransformation.h @@ -183,6 +183,10 @@ template struct Transformation> { } +#ifdef _WIN32 +extern template class MAGNUM_SCENEGRAPH_EXPORT Object>; +#endif + }} #endif diff --git a/src/SceneGraph/DualQuaternionTransformation.h b/src/SceneGraph/DualQuaternionTransformation.h index 6f4a4bf98..f94e29d82 100644 --- a/src/SceneGraph/DualQuaternionTransformation.h +++ b/src/SceneGraph/DualQuaternionTransformation.h @@ -200,6 +200,10 @@ template struct Transformation> { } +#ifdef _WIN32 +extern template class MAGNUM_SCENEGRAPH_EXPORT Object>; +#endif + }} #endif diff --git a/src/SceneGraph/FeatureGroup.h b/src/SceneGraph/FeatureGroup.h index 01ca3da83..039896356 100644 --- a/src/SceneGraph/FeatureGroup.h +++ b/src/SceneGraph/FeatureGroup.h @@ -182,6 +182,11 @@ template FeatureGroup; +extern template class MAGNUM_SCENEGRAPH_EXPORT AbstractFeatureGroup<3, Float>; +#endif + }} #endif diff --git a/src/SceneGraph/MatrixTransformation2D.h b/src/SceneGraph/MatrixTransformation2D.h index f29cc0854..ae282f44d 100644 --- a/src/SceneGraph/MatrixTransformation2D.h +++ b/src/SceneGraph/MatrixTransformation2D.h @@ -168,6 +168,10 @@ template struct Transformation> { } +#ifdef _WIN32 +extern template class MAGNUM_SCENEGRAPH_EXPORT Object>; +#endif + }} #endif diff --git a/src/SceneGraph/MatrixTransformation3D.h b/src/SceneGraph/MatrixTransformation3D.h index 0c711b51c..b6adc33d2 100644 --- a/src/SceneGraph/MatrixTransformation3D.h +++ b/src/SceneGraph/MatrixTransformation3D.h @@ -216,6 +216,10 @@ template struct Transformation> { } +#ifdef _WIN32 +extern template class MAGNUM_SCENEGRAPH_EXPORT Object>; +#endif + }} #endif diff --git a/src/SceneGraph/RigidMatrixTransformation2D.h b/src/SceneGraph/RigidMatrixTransformation2D.h index 5612a00a8..b369f114e 100644 --- a/src/SceneGraph/RigidMatrixTransformation2D.h +++ b/src/SceneGraph/RigidMatrixTransformation2D.h @@ -202,6 +202,10 @@ template struct Transformation> { } +#ifdef _WIN32 +extern template class MAGNUM_SCENEGRAPH_EXPORT Object>; +#endif + }} #endif diff --git a/src/SceneGraph/RigidMatrixTransformation3D.h b/src/SceneGraph/RigidMatrixTransformation3D.h index 0d0e4dc55..0ada0a0af 100644 --- a/src/SceneGraph/RigidMatrixTransformation3D.h +++ b/src/SceneGraph/RigidMatrixTransformation3D.h @@ -255,6 +255,10 @@ template struct Transformation> { } +#ifdef _WIN32 +extern template class MAGNUM_SCENEGRAPH_EXPORT Object>; +#endif + }} #endif diff --git a/src/SceneGraph/TranslationTransformation.h b/src/SceneGraph/TranslationTransformation.h index 70baedfa1..adc134120 100644 --- a/src/SceneGraph/TranslationTransformation.h +++ b/src/SceneGraph/TranslationTransformation.h @@ -206,6 +206,13 @@ template struct Transfor } +#ifdef _WIN32 +extern template class MAGNUM_SCENEGRAPH_EXPORT Object>; +extern template class MAGNUM_SCENEGRAPH_EXPORT Object>; +extern template class MAGNUM_SCENEGRAPH_EXPORT Object>; +extern template class MAGNUM_SCENEGRAPH_EXPORT Object>; +#endif + }} #endif diff --git a/src/SceneGraph/instantiation.cpp b/src/SceneGraph/instantiation.cpp index 9c8ca8606..015fa8c8b 100644 --- a/src/SceneGraph/instantiation.cpp +++ b/src/SceneGraph/instantiation.cpp @@ -38,37 +38,44 @@ namespace Magnum { namespace SceneGraph { +/* On Windows the instantiations are already marked with extern template */ +#ifndef _WIN32 +#define MAGNUM_SCENEGRAPH_EXPORT_HPP MAGNUM_SCENEGRAPH_EXPORT +#else +#define MAGNUM_SCENEGRAPH_EXPORT_HPP +#endif + #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 AbstractTransformation<2, Float>; -template class MAGNUM_SCENEGRAPH_EXPORT AbstractTransformation<3, Float>; +template class MAGNUM_SCENEGRAPH_EXPORT_HPP AbstractObject<2, Float>; +template class MAGNUM_SCENEGRAPH_EXPORT_HPP AbstractObject<3, Float>; +template class MAGNUM_SCENEGRAPH_EXPORT_HPP AbstractTransformation<2, Float>; +template class MAGNUM_SCENEGRAPH_EXPORT_HPP AbstractTransformation<3, Float>; -template class MAGNUM_SCENEGRAPH_EXPORT AbstractFeature<2, Float>; -template class MAGNUM_SCENEGRAPH_EXPORT AbstractFeature<3, Float>; -template class MAGNUM_SCENEGRAPH_EXPORT AbstractFeatureGroup<2, Float>; -template class MAGNUM_SCENEGRAPH_EXPORT AbstractFeatureGroup<3, Float>; +template class MAGNUM_SCENEGRAPH_EXPORT_HPP AbstractFeature<2, Float>; +template class MAGNUM_SCENEGRAPH_EXPORT_HPP AbstractFeature<3, Float>; +template class MAGNUM_SCENEGRAPH_EXPORT_HPP AbstractFeatureGroup<2, Float>; +template class MAGNUM_SCENEGRAPH_EXPORT_HPP AbstractFeatureGroup<3, Float>; -template class MAGNUM_SCENEGRAPH_EXPORT Animable<2, Float>; -template class MAGNUM_SCENEGRAPH_EXPORT Animable<3, Float>; -template class MAGNUM_SCENEGRAPH_EXPORT AnimableGroup<2, Float>; -template class MAGNUM_SCENEGRAPH_EXPORT AnimableGroup<3, Float>; +template class MAGNUM_SCENEGRAPH_EXPORT_HPP Animable<2, Float>; +template class MAGNUM_SCENEGRAPH_EXPORT_HPP Animable<3, Float>; +template class MAGNUM_SCENEGRAPH_EXPORT_HPP AnimableGroup<2, Float>; +template class MAGNUM_SCENEGRAPH_EXPORT_HPP AnimableGroup<3, Float>; -template class MAGNUM_SCENEGRAPH_EXPORT AbstractCamera<2, Float>; -template class MAGNUM_SCENEGRAPH_EXPORT AbstractCamera<3, Float>; -template class MAGNUM_SCENEGRAPH_EXPORT BasicCamera2D; -template class MAGNUM_SCENEGRAPH_EXPORT BasicCamera3D; +template class MAGNUM_SCENEGRAPH_EXPORT_HPP AbstractCamera<2, Float>; +template class MAGNUM_SCENEGRAPH_EXPORT_HPP AbstractCamera<3, Float>; +template class MAGNUM_SCENEGRAPH_EXPORT_HPP BasicCamera2D; +template class MAGNUM_SCENEGRAPH_EXPORT_HPP BasicCamera3D; -template class MAGNUM_SCENEGRAPH_EXPORT Object>; -template class MAGNUM_SCENEGRAPH_EXPORT Object>; -template class MAGNUM_SCENEGRAPH_EXPORT Object>; -template class MAGNUM_SCENEGRAPH_EXPORT Object>; -template class MAGNUM_SCENEGRAPH_EXPORT Object>; -template class MAGNUM_SCENEGRAPH_EXPORT Object>; -template class MAGNUM_SCENEGRAPH_EXPORT Object>; -template class MAGNUM_SCENEGRAPH_EXPORT Object>; -template class MAGNUM_SCENEGRAPH_EXPORT Object>; -template class MAGNUM_SCENEGRAPH_EXPORT Object>; +template class MAGNUM_SCENEGRAPH_EXPORT_HPP Object>; +template class MAGNUM_SCENEGRAPH_EXPORT_HPP Object>; +template class MAGNUM_SCENEGRAPH_EXPORT_HPP Object>; +template class MAGNUM_SCENEGRAPH_EXPORT_HPP Object>; +template class MAGNUM_SCENEGRAPH_EXPORT_HPP Object>; +template class MAGNUM_SCENEGRAPH_EXPORT_HPP Object>; +template class MAGNUM_SCENEGRAPH_EXPORT_HPP Object>; +template class MAGNUM_SCENEGRAPH_EXPORT_HPP Object>; +template class MAGNUM_SCENEGRAPH_EXPORT_HPP Object>; +template class MAGNUM_SCENEGRAPH_EXPORT_HPP Object>; #endif }} From 4e0f8ff097ad10e1278d2ce388e69432eafb7538 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Thu, 5 Dec 2013 01:57:22 +0100 Subject: [PATCH 10/11] SceneGraph: remove integer TranslationTransformation template instance. We can now use the *.hpp for that even on Windows. --- src/SceneGraph/Object.h | 3 --- src/SceneGraph/Test/TranslationTransformationTest.cpp | 3 ++- src/SceneGraph/TranslationTransformation.h | 2 -- src/SceneGraph/instantiation.cpp | 2 -- 4 files changed, 2 insertions(+), 8 deletions(-) diff --git a/src/SceneGraph/Object.h b/src/SceneGraph/Object.h index e87bb3426..903101e64 100644 --- a/src/SceneGraph/Object.h +++ b/src/SceneGraph/Object.h @@ -90,12 +90,9 @@ class documentation or @ref compilation-speedup-hpp for more information. - @ref RigidMatrixTransformation3D "Object" - @ref TranslationTransformation2D "Object" - @ref TranslationTransformation3D "Object" -- @ref BasicTranslationTransformation2D "Object>" -- @ref BasicTranslationTransformation3D "Object>" @see @ref Scene, @ref AbstractFeature, @ref AbstractTransformation, @ref DebugTools::ObjectRenderer -@todo Test (and fix) that hpp works also on Windows */ template class Object: public AbstractObject, public Transformation #ifndef DOXYGEN_GENERATING_OUTPUT diff --git a/src/SceneGraph/Test/TranslationTransformationTest.cpp b/src/SceneGraph/Test/TranslationTransformationTest.cpp index 801fd4b1e..84857c777 100644 --- a/src/SceneGraph/Test/TranslationTransformationTest.cpp +++ b/src/SceneGraph/Test/TranslationTransformationTest.cpp @@ -25,6 +25,7 @@ #include #include +#include "SceneGraph/Object.hpp" #include "SceneGraph/TranslationTransformation.h" #include "SceneGraph/Scene.h" @@ -131,7 +132,7 @@ void TranslationTransformationTest::translate() { } void TranslationTransformationTest::integral() { - typedef Object> Object2Di; + typedef Object> Object2Di; Object2Di o; o.translate({3, -7}); diff --git a/src/SceneGraph/TranslationTransformation.h b/src/SceneGraph/TranslationTransformation.h index adc134120..3d63d484c 100644 --- a/src/SceneGraph/TranslationTransformation.h +++ b/src/SceneGraph/TranslationTransformation.h @@ -209,8 +209,6 @@ template struct Transfor #ifdef _WIN32 extern template class MAGNUM_SCENEGRAPH_EXPORT Object>; extern template class MAGNUM_SCENEGRAPH_EXPORT Object>; -extern template class MAGNUM_SCENEGRAPH_EXPORT Object>; -extern template class MAGNUM_SCENEGRAPH_EXPORT Object>; #endif }} diff --git a/src/SceneGraph/instantiation.cpp b/src/SceneGraph/instantiation.cpp index 015fa8c8b..b04fd0964 100644 --- a/src/SceneGraph/instantiation.cpp +++ b/src/SceneGraph/instantiation.cpp @@ -74,8 +74,6 @@ template class MAGNUM_SCENEGRAPH_EXPORT_HPP Object>; template class MAGNUM_SCENEGRAPH_EXPORT_HPP Object>; template class MAGNUM_SCENEGRAPH_EXPORT_HPP Object>; -template class MAGNUM_SCENEGRAPH_EXPORT_HPP Object>; -template class MAGNUM_SCENEGRAPH_EXPORT_HPP Object>; #endif }} From 25c8c87c1f240bf77c41cf3990f1c97957f55baf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Thu, 5 Dec 2013 01:58:20 +0100 Subject: [PATCH 11/11] SceneGraph: fixed floating-point literals in test. --- src/SceneGraph/Test/TranslationTransformationTest.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/SceneGraph/Test/TranslationTransformationTest.cpp b/src/SceneGraph/Test/TranslationTransformationTest.cpp index 84857c777..de012ff81 100644 --- a/src/SceneGraph/Test/TranslationTransformationTest.cpp +++ b/src/SceneGraph/Test/TranslationTransformationTest.cpp @@ -136,7 +136,7 @@ void TranslationTransformationTest::integral() { Object2Di o; o.translate({3, -7}); - CORRADE_COMPARE(o.transformationMatrix(), Matrix3::translation({3, -7})); + CORRADE_COMPARE(o.transformationMatrix(), Matrix3::translation({3.0f, -7.0f})); } }}}