Browse Source

Merge branch 'master' into compatibility

Conflicts:
	src/Math/Vector.h
Vladimír Vondruš 13 years ago
parent
commit
90d85a43db
  1. 2
      src/Math/Vector.h
  2. 10
      src/Plugins/MagnumFont/CMakeLists.txt
  3. 10
      src/Plugins/MagnumFontConverter/CMakeLists.txt
  4. 10
      src/Plugins/TgaImageConverter/CMakeLists.txt
  5. 10
      src/Plugins/TgaImporter/CMakeLists.txt
  6. 10
      src/Plugins/WavAudioImporter/CMakeLists.txt
  7. 7
      src/SceneGraph/AbstractCamera.h
  8. 7
      src/SceneGraph/AbstractFeature.h
  9. 7
      src/SceneGraph/AbstractObject.h
  10. 7
      src/SceneGraph/AbstractTransformation.h
  11. 2
      src/SceneGraph/AbstractTranslation.h
  12. 9
      src/SceneGraph/Animable.cpp
  13. 7
      src/SceneGraph/Animable.h
  14. 7
      src/SceneGraph/AnimableGroup.h
  15. 6
      src/SceneGraph/Camera2D.h
  16. 6
      src/SceneGraph/Camera3D.h
  17. 15
      src/SceneGraph/DualComplexTransformation.h
  18. 4
      src/SceneGraph/DualQuaternionTransformation.h
  19. 7
      src/SceneGraph/FeatureGroup.h
  20. 15
      src/SceneGraph/MatrixTransformation2D.h
  21. 4
      src/SceneGraph/MatrixTransformation3D.h
  22. 5
      src/SceneGraph/Object.h
  23. 15
      src/SceneGraph/RigidMatrixTransformation2D.h
  24. 4
      src/SceneGraph/RigidMatrixTransformation3D.h
  25. 8
      src/SceneGraph/Test/CMakeLists.txt
  26. 5
      src/SceneGraph/Test/TranslationTransformationTest.cpp
  27. 5
      src/SceneGraph/TranslationTransformation.h
  28. 55
      src/SceneGraph/instantiation.cpp
  29. 4
      src/Test/MeshTest.cpp

2
src/Math/Vector.h

@ -550,7 +550,7 @@ template<std::size_t size, class T> class Vector {
private:
/* Implementation for Vector<size, T>::Vector(const Vector<size, U>&) */
template<class U, std::size_t ...sequence> constexpr explicit Vector(Implementation::Sequence<sequence...>, const Vector<sizeof...(sequence), U>& vector):
template<class U, std::size_t ...sequence> constexpr explicit Vector(Implementation::Sequence<sequence...>, const Vector<size, U>& vector):
#ifndef CORRADE_MSVC2013_COMPATIBILITY
_data{T(vector._data[sequence])...} {}
#else

10
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_OBJECTS:MagnumFontObjects>)
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()

10
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_OBJECTS:MagnumFontConverterObjects>)
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()

10
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_OBJECTS:TgaImageConverterObjects>)
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()

10
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_OBJECTS:TgaImporterObjects>)
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()

10
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_OBJECTS:WavAudioImporterObjects>)
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()

7
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<UnsignedInt dimensions, class T> class MAGNUM_SCENEGRAPH_EXPORT AbstractCamera: public AbstractFeature<dimensions, T> {
template<UnsignedInt dimensions, class T> class AbstractCamera: public AbstractFeature<dimensions, T> {
public:
/** @brief Aspect ratio policy */
AspectRatioPolicy aspectRatioPolicy() const { return _aspectRatioPolicy; }
@ -215,6 +215,11 @@ typedef AbstractBasicCamera3D<Float> 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

7
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<UnsignedInt dimensions, class T> class MAGNUM_SCENEGRAPH_EXPORT AbstractFeature
template<UnsignedInt dimensions, class T> class AbstractFeature
#ifndef DOXYGEN_GENERATING_OUTPUT
: private Containers::LinkedListItem<AbstractFeature<dimensions, T>, AbstractObject<dimensions, T>>
#endif
@ -349,6 +349,11 @@ typedef AbstractBasicFeature3D<Float> 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

7
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<UnsignedInt dimensions, class T> class MAGNUM_SCENEGRAPH_EXPORT AbstractObject
template<UnsignedInt dimensions, class T> class AbstractObject
#ifndef DOXYGEN_GENERATING_OUTPUT
: private Containers::LinkedList<AbstractFeature<dimensions, T>>
#endif
@ -285,6 +285,11 @@ typedef AbstractBasicObject3D<Float> 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

7
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<UnsignedInt dimensions, class T> class MAGNUM_SCENEGRAPH_EXPORT AbstractTransformation {
template<UnsignedInt dimensions, class T> class AbstractTransformation {
public:
/** @brief Underlying floating-point type */
typedef T Type;
@ -150,6 +150,11 @@ typedef AbstractBasicTransformation3D<Float> 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

2
src/SceneGraph/AbstractTranslation.h

@ -62,7 +62,7 @@ class AbstractTranslation: public AbstractTransformation<dimensions, T> {
* @see @ref Vector2::xAxis(), @ref Vector2::yAxis(), @ref Vector3::xAxis(),
* @ref Vector3::yAxis(), @ref Vector3::zAxis()
*/
AbstractTranslation<dimensions, T>& translate(const typename DimensionTraits<dimensions, TranslationType>::VectorType& vector, TransformationType type = TransformationType::Global) {
AbstractTranslation<dimensions, T, TranslationType>& translate(const typename DimensionTraits<dimensions, TranslationType>::VectorType& vector, TransformationType type = TransformationType::Global) {
doTranslate(vector, type);
return *this;
}

9
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;

7
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<UnsignedInt dimensions, class T> class MAGNUM_SCENEGRAPH_EXPORT Animable: public AbstractGroupedFeature<dimensions, Animable<dimensions, T>, T> {
template<UnsignedInt dimensions, class T> class Animable: public AbstractGroupedFeature<dimensions, Animable<dimensions, T>, T> {
friend class AnimableGroup<dimensions, T>;
public:
@ -388,6 +388,11 @@ typedef BasicAnimable3D<Float> 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

7
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<UnsignedInt dimensions, class T> class MAGNUM_SCENEGRAPH_EXPORT AnimableGroup: public FeatureGroup<dimensions, Animable<dimensions, T>, T> {
template<UnsignedInt dimensions, class T> class AnimableGroup: public FeatureGroup<dimensions, Animable<dimensions, T>, T> {
friend class Animable<dimensions, T>;
public:
@ -126,6 +126,11 @@ typedef BasicAnimableGroup3D<Float> 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

6
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 T> class MAGNUM_SCENEGRAPH_EXPORT BasicCamera2D: public AbstractCamera<2, T> {
template<class T> class BasicCamera2D: public AbstractCamera<2, T> {
public:
/**
* @brief Constructor
@ -105,6 +105,10 @@ template<class T> class MAGNUM_SCENEGRAPH_EXPORT BasicCamera2D: public AbstractC
*/
typedef BasicCamera2D<Float> Camera2D;
#ifdef _WIN32
extern template class MAGNUM_SCENEGRAPH_EXPORT BasicCamera2D<Float>;
#endif
}}
#endif

6
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 T> class MAGNUM_SCENEGRAPH_EXPORT BasicCamera3D: public AbstractCamera<3, T> {
template<class T> class BasicCamera3D: public AbstractCamera<3, T> {
public:
/**
* @brief Constructor
@ -141,6 +141,10 @@ template<class T> class MAGNUM_SCENEGRAPH_EXPORT BasicCamera3D: public AbstractC
*/
typedef BasicCamera3D<Float> Camera3D;
#ifdef _WIN32
extern template class MAGNUM_SCENEGRAPH_EXPORT BasicCamera3D<Float>;
#endif
}}
#endif

15
src/SceneGraph/DualComplexTransformation.h

@ -117,17 +117,6 @@ template<class T> class BasicDualComplexTransformation: public AbstractBasicTran
return transformInternal(Math::DualComplex<T>::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<BasicDualComplexTransformation<T>>& move(Object<BasicDualComplexTransformation<T>>* under) {
static_cast<Object<BasicDualComplexTransformation>*>(this)->Containers::template LinkedList<Object<BasicDualComplexTransformation<T>>>::move(this, under);
return static_cast<Object<BasicDualComplexTransformation<T>>&>(*this);
}
protected:
/* Allow construction only from Object */
explicit BasicDualComplexTransformation();
@ -196,6 +185,10 @@ template<class T> struct Transformation<BasicDualComplexTransformation<T>> {
}
#ifdef _WIN32
extern template class MAGNUM_SCENEGRAPH_EXPORT Object<BasicDualComplexTransformation<Float>>;
#endif
}}
#endif

4
src/SceneGraph/DualQuaternionTransformation.h

@ -202,6 +202,10 @@ template<class T> struct Transformation<BasicDualQuaternionTransformation<T>> {
}
#ifdef _WIN32
extern template class MAGNUM_SCENEGRAPH_EXPORT Object<BasicDualQuaternionTransformation<Float>>;
#endif
}}
#endif

7
src/SceneGraph/FeatureGroup.h

@ -41,7 +41,7 @@ namespace Magnum { namespace SceneGraph {
See @ref FeatureGroup.
*/
template<UnsignedInt dimensions, class T> class MAGNUM_SCENEGRAPH_EXPORT AbstractFeatureGroup {
template<UnsignedInt dimensions, class T> class AbstractFeatureGroup {
template<UnsignedInt, class, class> friend class FeatureGroup;
explicit AbstractFeatureGroup();
@ -193,6 +193,11 @@ template<UnsignedInt dimensions, class Feature, class T> FeatureGroup<dimensions
return *this;
}
#ifdef _WIN32
extern template class MAGNUM_SCENEGRAPH_EXPORT AbstractFeatureGroup<2, Float>;
extern template class MAGNUM_SCENEGRAPH_EXPORT AbstractFeatureGroup<3, Float>;
#endif
}}
#endif

15
src/SceneGraph/MatrixTransformation2D.h

@ -117,17 +117,6 @@ template<class T> class BasicMatrixTransformation2D: public AbstractBasicTransla
return transform(Math::Matrix3<T>::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<BasicMatrixTransformation2D<T>>& move(Object<BasicMatrixTransformation2D<T>>* under) {
static_cast<Object<BasicMatrixTransformation2D>*>(this)->Containers::template LinkedList<Object<BasicMatrixTransformation2D<T>>>::move(this, under);
return static_cast<Object<BasicMatrixTransformation2D<T>>&>(*this);
}
protected:
/* Allow construction only from Object */
explicit BasicMatrixTransformation2D();
@ -181,6 +170,10 @@ template<class T> struct Transformation<BasicMatrixTransformation2D<T>> {
}
#ifdef _WIN32
extern template class MAGNUM_SCENEGRAPH_EXPORT Object<BasicMatrixTransformation2D<Float>>;
#endif
}}
#endif

4
src/SceneGraph/MatrixTransformation3D.h

@ -218,6 +218,10 @@ template<class T> struct Transformation<BasicMatrixTransformation3D<T>> {
}
#ifdef _WIN32
extern template class MAGNUM_SCENEGRAPH_EXPORT Object<BasicMatrixTransformation3D<Float>>;
#endif
}}
#endif

5
src/SceneGraph/Object.h

@ -90,14 +90,11 @@ class documentation or @ref compilation-speedup-hpp for more information.
- @ref RigidMatrixTransformation3D "Object<RigidMatrixTransformation3D>"
- @ref TranslationTransformation2D "Object<TranslationTransformation2D>"
- @ref TranslationTransformation3D "Object<TranslationTransformation3D>"
- @ref BasicTranslationTransformation2D "Object<BasicTranslationTransformation2D<Float, Int>>"
- @ref BasicTranslationTransformation3D "Object<BasicTranslationTransformation3D<Float, Int>>"
@see @ref Scene, @ref AbstractFeature, @ref AbstractTransformation,
@ref DebugTools::ObjectRenderer
@todo Test (and fix) that hpp works also on Windows
*/
template<class Transformation> class MAGNUM_SCENEGRAPH_EXPORT Object: public AbstractObject<Transformation::Dimensions, typename Transformation::Type>, public Transformation
template<class Transformation> class Object: public AbstractObject<Transformation::Dimensions, typename Transformation::Type>, public Transformation
#ifndef DOXYGEN_GENERATING_OUTPUT
, private Containers::LinkedList<Object<Transformation>>, private Containers::LinkedListItem<Object<Transformation>, Object<Transformation>>
#endif

15
src/SceneGraph/RigidMatrixTransformation2D.h

@ -134,17 +134,6 @@ template<class T> class BasicRigidMatrixTransformation2D: public AbstractBasicTr
return transformInternal(Math::Matrix3<T>::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<BasicRigidMatrixTransformation2D<T>>& move(Object<BasicRigidMatrixTransformation2D<T>>* under) {
static_cast<Object<BasicRigidMatrixTransformation2D>*>(this)->Containers::template LinkedList<Object<BasicRigidMatrixTransformation2D<T>>>::move(this, under);
return static_cast<Object<BasicRigidMatrixTransformation2D<T>>&>(*this);
}
protected:
/* Allow construction only from Object */
explicit BasicRigidMatrixTransformation2D();
@ -215,6 +204,10 @@ template<class T> struct Transformation<BasicRigidMatrixTransformation2D<T>> {
}
#ifdef _WIN32
extern template class MAGNUM_SCENEGRAPH_EXPORT Object<BasicRigidMatrixTransformation2D<Float>>;
#endif
}}
#endif

4
src/SceneGraph/RigidMatrixTransformation3D.h

@ -257,6 +257,10 @@ template<class T> struct Transformation<BasicRigidMatrixTransformation3D<T>> {
}
#ifdef _WIN32
extern template class MAGNUM_SCENEGRAPH_EXPORT Object<BasicRigidMatrixTransformation3D<Float>>;
#endif
}}
#endif

8
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)

5
src/SceneGraph/Test/TranslationTransformationTest.cpp

@ -25,6 +25,7 @@
#include <sstream>
#include <TestSuite/Tester.h>
#include "SceneGraph/Object.hpp"
#include "SceneGraph/TranslationTransformation.h"
#include "SceneGraph/Scene.h"
@ -131,11 +132,11 @@ void TranslationTransformationTest::translate() {
}
void TranslationTransformationTest::integral() {
typedef Object<TranslationTransformation<2, Float, Int>> Object2Di;
typedef Object<TranslationTransformation<2, Float, Short>> Object2Di;
Object2Di o;
o.translate({3, -7});
CORRADE_COMPARE(o.transformationMatrix(), Matrix3::translation({3, -7}));
CORRADE_COMPARE(o.transformationMatrix(), Matrix3::translation({3.0f, -7.0f}));
}
}}}

5
src/SceneGraph/TranslationTransformation.h

@ -212,6 +212,11 @@ template<UnsignedInt dimensions, class T, class TranslationType> struct Transfor
}
#ifdef _WIN32
extern template class MAGNUM_SCENEGRAPH_EXPORT Object<TranslationTransformation<2, Float>>;
extern template class MAGNUM_SCENEGRAPH_EXPORT Object<TranslationTransformation<3, Float>>;
#endif
}}
#endif

55
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"
@ -37,32 +38,42 @@
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_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 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 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<Float>;
template class MAGNUM_SCENEGRAPH_EXPORT BasicCamera3D<Float>;
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<Float>;
template class MAGNUM_SCENEGRAPH_EXPORT_HPP BasicCamera3D<Float>;
template class MAGNUM_SCENEGRAPH_EXPORT Object<BasicDualComplexTransformation<Float>>;
template class MAGNUM_SCENEGRAPH_EXPORT Object<BasicDualQuaternionTransformation<Float>>;
template class MAGNUM_SCENEGRAPH_EXPORT Object<BasicMatrixTransformation2D<Float>>;
template class MAGNUM_SCENEGRAPH_EXPORT Object<BasicMatrixTransformation3D<Float>>;
template class MAGNUM_SCENEGRAPH_EXPORT Object<BasicRigidMatrixTransformation2D<Float>>;
template class MAGNUM_SCENEGRAPH_EXPORT Object<BasicRigidMatrixTransformation3D<Float>>;
template class MAGNUM_SCENEGRAPH_EXPORT Object<TranslationTransformation<2, Float>>;
template class MAGNUM_SCENEGRAPH_EXPORT Object<TranslationTransformation<3, Float>>;
template class MAGNUM_SCENEGRAPH_EXPORT Object<TranslationTransformation<2, Float, Int>>;
template class MAGNUM_SCENEGRAPH_EXPORT Object<TranslationTransformation<3, Float, Int>>;
template class MAGNUM_SCENEGRAPH_EXPORT_HPP Object<BasicDualComplexTransformation<Float>>;
template class MAGNUM_SCENEGRAPH_EXPORT_HPP Object<BasicDualQuaternionTransformation<Float>>;
template class MAGNUM_SCENEGRAPH_EXPORT_HPP Object<BasicMatrixTransformation2D<Float>>;
template class MAGNUM_SCENEGRAPH_EXPORT_HPP Object<BasicMatrixTransformation3D<Float>>;
template class MAGNUM_SCENEGRAPH_EXPORT_HPP Object<BasicRigidMatrixTransformation2D<Float>>;
template class MAGNUM_SCENEGRAPH_EXPORT_HPP Object<BasicRigidMatrixTransformation3D<Float>>;
template class MAGNUM_SCENEGRAPH_EXPORT_HPP Object<TranslationTransformation<2, Float>>;
template class MAGNUM_SCENEGRAPH_EXPORT_HPP Object<TranslationTransformation<3, Float>>;
#endif
}}

4
src/Test/MeshTest.cpp

@ -63,7 +63,7 @@ void MeshTest::configurationPrimitive() {
Utility::Configuration c;
c.setValue("primitive", Mesh::Primitive::LineStrip);
CORRADE_COMPARE(c.value<std::string>("primitive"), "LineStrip");
CORRADE_COMPARE(c.value("primitive"), "LineStrip");
CORRADE_COMPARE(c.value<Mesh::Primitive>("primitive"), Mesh::Primitive::LineStrip);
}
@ -71,7 +71,7 @@ void MeshTest::configurationIndexType() {
Utility::Configuration c;
c.setValue("type", Mesh::IndexType::UnsignedByte);
CORRADE_COMPARE(c.value<std::string>("type"), "UnsignedByte");
CORRADE_COMPARE(c.value("type"), "UnsignedByte");
CORRADE_COMPARE(c.value<Mesh::IndexType>("type"), Mesh::IndexType::UnsignedByte);
}

Loading…
Cancel
Save