From 378ad878f34aa8623eaec3f0bc5f836163b9ce38 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Tue, 14 May 2013 00:32:52 +0200 Subject: [PATCH] SceneGraph: removed superfluous instantiation sources. Moved almost everything into one file, instead of compiling ~50k LOC seven times it is now compiling 56k LOC only once. This saves another ~5 seconds of compilation time (before ~4:11, now ~4:06). Also explicitly saying that we are instantiating Float version of all classes. In the future we might have compile switch for building also Double one, this helps with consistency. --- src/SceneGraph/Animable.cpp | 8 ++-- src/SceneGraph/CMakeLists.txt | 11 +---- src/SceneGraph/DualComplexTransformation.cpp | 35 ---------------- .../DualQuaternionTransformation.cpp | 35 ---------------- src/SceneGraph/MatrixTransformation2D.cpp | 35 ---------------- src/SceneGraph/MatrixTransformation3D.cpp | 35 ---------------- src/SceneGraph/Object.cpp | 41 ------------------- .../RigidMatrixTransformation2D.cpp | 35 ---------------- .../RigidMatrixTransformation3D.cpp | 35 ---------------- .../{Camera.cpp => instantiation.cpp} | 30 +++++++++++++- 10 files changed, 34 insertions(+), 266 deletions(-) delete mode 100644 src/SceneGraph/DualComplexTransformation.cpp delete mode 100644 src/SceneGraph/DualQuaternionTransformation.cpp delete mode 100644 src/SceneGraph/MatrixTransformation2D.cpp delete mode 100644 src/SceneGraph/MatrixTransformation3D.cpp delete mode 100644 src/SceneGraph/Object.cpp delete mode 100644 src/SceneGraph/RigidMatrixTransformation2D.cpp delete mode 100644 src/SceneGraph/RigidMatrixTransformation3D.cpp rename src/SceneGraph/{Camera.cpp => instantiation.cpp} (50%) diff --git a/src/SceneGraph/Animable.cpp b/src/SceneGraph/Animable.cpp index a424ef9bd..1087f8371 100644 --- a/src/SceneGraph/Animable.cpp +++ b/src/SceneGraph/Animable.cpp @@ -27,10 +27,10 @@ namespace Magnum { namespace SceneGraph { #ifndef DOXYGEN_GENERATING_OUTPUT -template class MAGNUM_SCENEGRAPH_EXPORT Animable<2>; -template class MAGNUM_SCENEGRAPH_EXPORT Animable<3>; -template class MAGNUM_SCENEGRAPH_EXPORT AnimableGroup<2>; -template class MAGNUM_SCENEGRAPH_EXPORT AnimableGroup<3>; +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) { diff --git a/src/SceneGraph/CMakeLists.txt b/src/SceneGraph/CMakeLists.txt index 42e0e095b..e4f7d6145 100644 --- a/src/SceneGraph/CMakeLists.txt +++ b/src/SceneGraph/CMakeLists.txt @@ -24,18 +24,11 @@ # Files shared between main library and unit test library set(MagnumSceneGraph_SRCS - Animable.cpp - Camera.cpp - DualComplexTransformation.cpp - DualQuaternionTransformation.cpp - RigidMatrixTransformation2D.cpp - RigidMatrixTransformation3D.cpp - Object.cpp) + Animable.cpp) # Files compiled with different flags for main library and unit test library set(MagnumSceneGraph_GracefulAssert_SRCS - MatrixTransformation2D.cpp - MatrixTransformation3D.cpp) + instantiation.cpp) set(MagnumSceneGraph_HEADERS AbstractCamera.h diff --git a/src/SceneGraph/DualComplexTransformation.cpp b/src/SceneGraph/DualComplexTransformation.cpp deleted file mode 100644 index 56a1f0af5..000000000 --- a/src/SceneGraph/DualComplexTransformation.cpp +++ /dev/null @@ -1,35 +0,0 @@ -/* - This file is part of Magnum. - - Copyright © 2010, 2011, 2012, 2013 Vladimír Vondruš - - Permission is hereby granted, free of charge, to any person obtaining a - copy of this software and associated documentation files (the "Software"), - to deal in the Software without restriction, including without limitation - the rights to use, copy, modify, merge, publish, distribute, sublicense, - and/or sell copies of the Software, and to permit persons to whom the - Software is furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included - in all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - DEALINGS IN THE SOFTWARE. -*/ - -#include "DualComplexTransformation.h" - -#include "Object.hpp" - -namespace Magnum { namespace SceneGraph { - -#ifndef DOXYGEN_GENERATING_OUTPUT -template class MAGNUM_SCENEGRAPH_EXPORT Object>; -#endif - -}} diff --git a/src/SceneGraph/DualQuaternionTransformation.cpp b/src/SceneGraph/DualQuaternionTransformation.cpp deleted file mode 100644 index bedf48480..000000000 --- a/src/SceneGraph/DualQuaternionTransformation.cpp +++ /dev/null @@ -1,35 +0,0 @@ -/* - This file is part of Magnum. - - Copyright © 2010, 2011, 2012, 2013 Vladimír Vondruš - - Permission is hereby granted, free of charge, to any person obtaining a - copy of this software and associated documentation files (the "Software"), - to deal in the Software without restriction, including without limitation - the rights to use, copy, modify, merge, publish, distribute, sublicense, - and/or sell copies of the Software, and to permit persons to whom the - Software is furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included - in all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - DEALINGS IN THE SOFTWARE. -*/ - -#include "DualQuaternionTransformation.h" - -#include "Object.hpp" - -namespace Magnum { namespace SceneGraph { - -#ifndef DOXYGEN_GENERATING_OUTPUT -template class MAGNUM_SCENEGRAPH_EXPORT Object>; -#endif - -}} diff --git a/src/SceneGraph/MatrixTransformation2D.cpp b/src/SceneGraph/MatrixTransformation2D.cpp deleted file mode 100644 index c546bd302..000000000 --- a/src/SceneGraph/MatrixTransformation2D.cpp +++ /dev/null @@ -1,35 +0,0 @@ -/* - This file is part of Magnum. - - Copyright © 2010, 2011, 2012, 2013 Vladimír Vondruš - - Permission is hereby granted, free of charge, to any person obtaining a - copy of this software and associated documentation files (the "Software"), - to deal in the Software without restriction, including without limitation - the rights to use, copy, modify, merge, publish, distribute, sublicense, - and/or sell copies of the Software, and to permit persons to whom the - Software is furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included - in all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - DEALINGS IN THE SOFTWARE. -*/ - -#include "MatrixTransformation2D.h" - -#include "Object.hpp" - -namespace Magnum { namespace SceneGraph { - -#ifndef DOXYGEN_GENERATING_OUTPUT -template class MAGNUM_SCENEGRAPH_EXPORT Object>; -#endif - -}} diff --git a/src/SceneGraph/MatrixTransformation3D.cpp b/src/SceneGraph/MatrixTransformation3D.cpp deleted file mode 100644 index d2e7e82b3..000000000 --- a/src/SceneGraph/MatrixTransformation3D.cpp +++ /dev/null @@ -1,35 +0,0 @@ -/* - This file is part of Magnum. - - Copyright © 2010, 2011, 2012, 2013 Vladimír Vondruš - - Permission is hereby granted, free of charge, to any person obtaining a - copy of this software and associated documentation files (the "Software"), - to deal in the Software without restriction, including without limitation - the rights to use, copy, modify, merge, publish, distribute, sublicense, - and/or sell copies of the Software, and to permit persons to whom the - Software is furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included - in all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - DEALINGS IN THE SOFTWARE. -*/ - -#include "MatrixTransformation3D.h" - -#include "Object.hpp" - -namespace Magnum { namespace SceneGraph { - -#ifndef DOXYGEN_GENERATING_OUTPUT -template class MAGNUM_SCENEGRAPH_EXPORT Object>; -#endif - -}} diff --git a/src/SceneGraph/Object.cpp b/src/SceneGraph/Object.cpp deleted file mode 100644 index c3071accf..000000000 --- a/src/SceneGraph/Object.cpp +++ /dev/null @@ -1,41 +0,0 @@ -/* - This file is part of Magnum. - - Copyright © 2010, 2011, 2012, 2013 Vladimír Vondruš - - Permission is hereby granted, free of charge, to any person obtaining a - copy of this software and associated documentation files (the "Software"), - to deal in the Software without restriction, including without limitation - the rights to use, copy, modify, merge, publish, distribute, sublicense, - and/or sell copies of the Software, and to permit persons to whom the - Software is furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included - in all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - DEALINGS IN THE SOFTWARE. -*/ - -#include "Object.hpp" -#include "AbstractFeature.hpp" -#include "FeatureGroup.hpp" - -namespace Magnum { namespace SceneGraph { - -template class AbstractObject<2>; -template class AbstractObject<3>; -template class AbstractTransformation<2>; -template class AbstractTransformation<3>; - -template class AbstractFeature<2>; -template class AbstractFeature<3>; -template class AbstractFeatureGroup<2>; -template class AbstractFeatureGroup<3>; - -}} diff --git a/src/SceneGraph/RigidMatrixTransformation2D.cpp b/src/SceneGraph/RigidMatrixTransformation2D.cpp deleted file mode 100644 index a6e7506e9..000000000 --- a/src/SceneGraph/RigidMatrixTransformation2D.cpp +++ /dev/null @@ -1,35 +0,0 @@ -/* - This file is part of Magnum. - - Copyright © 2010, 2011, 2012, 2013 Vladimír Vondruš - - Permission is hereby granted, free of charge, to any person obtaining a - copy of this software and associated documentation files (the "Software"), - to deal in the Software without restriction, including without limitation - the rights to use, copy, modify, merge, publish, distribute, sublicense, - and/or sell copies of the Software, and to permit persons to whom the - Software is furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included - in all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - DEALINGS IN THE SOFTWARE. -*/ - -#include "RigidMatrixTransformation2D.h" - -#include "Object.hpp" - -namespace Magnum { namespace SceneGraph { - -#ifndef DOXYGEN_GENERATING_OUTPUT -template class MAGNUM_SCENEGRAPH_EXPORT Object>; -#endif - -}} diff --git a/src/SceneGraph/RigidMatrixTransformation3D.cpp b/src/SceneGraph/RigidMatrixTransformation3D.cpp deleted file mode 100644 index 008f5fb5d..000000000 --- a/src/SceneGraph/RigidMatrixTransformation3D.cpp +++ /dev/null @@ -1,35 +0,0 @@ -/* - This file is part of Magnum. - - Copyright © 2010, 2011, 2012, 2013 Vladimír Vondruš - - Permission is hereby granted, free of charge, to any person obtaining a - copy of this software and associated documentation files (the "Software"), - to deal in the Software without restriction, including without limitation - the rights to use, copy, modify, merge, publish, distribute, sublicense, - and/or sell copies of the Software, and to permit persons to whom the - Software is furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included - in all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - DEALINGS IN THE SOFTWARE. -*/ - -#include "RigidMatrixTransformation3D.h" - -#include "Object.hpp" - -namespace Magnum { namespace SceneGraph { - -#ifndef DOXYGEN_GENERATING_OUTPUT -template class MAGNUM_SCENEGRAPH_EXPORT Object>; -#endif - -}} diff --git a/src/SceneGraph/Camera.cpp b/src/SceneGraph/instantiation.cpp similarity index 50% rename from src/SceneGraph/Camera.cpp rename to src/SceneGraph/instantiation.cpp index 530397487..d9dee0f08 100644 --- a/src/SceneGraph/Camera.cpp +++ b/src/SceneGraph/instantiation.cpp @@ -22,14 +22,40 @@ DEALINGS IN THE SOFTWARE. */ -#include "Camera2D.hpp" -#include "Camera3D.hpp" +#include "SceneGraph/AbstractFeature.hpp" +#include "SceneGraph/Camera2D.hpp" +#include "SceneGraph/Camera3D.hpp" +#include "SceneGraph/DualComplexTransformation.h" +#include "SceneGraph/DualQuaternionTransformation.h" +#include "SceneGraph/FeatureGroup.hpp" +#include "SceneGraph/MatrixTransformation2D.h" +#include "SceneGraph/MatrixTransformation3D.h" +#include "SceneGraph/Object.hpp" +#include "SceneGraph/RigidMatrixTransformation2D.h" +#include "SceneGraph/RigidMatrixTransformation3D.h" namespace Magnum { namespace SceneGraph { +template class AbstractObject<2, Float>; +template class AbstractObject<3, Float>; +template class AbstractTransformation<2, Float>; +template class AbstractTransformation<3, Float>; + +template class MAGNUM_SCENEGRAPH_EXPORT AbstractFeature<2, Float>; +template class MAGNUM_SCENEGRAPH_EXPORT AbstractFeature<3, Float>; +template class AbstractFeatureGroup<2, Float>; +template class AbstractFeatureGroup<3, Float>; + template class AbstractCamera<2, Float>; template class AbstractCamera<3, Float>; template class Camera2D; template class Camera3D; +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>; + }}