From 5e758b16d16efd1df082af9cdb00cfd85c4b211b Mon Sep 17 00:00:00 2001 From: Alexander Bock Date: Mon, 5 May 2014 12:41:41 +0200 Subject: [PATCH] Misc work Added ext/kameleon to .gitignore moved renderableplanet to a subfolder --- .gitignore | 1 + config/sgct/VRArenaSimCenter.xml | 82 +++++++++++++++++++ config/sgct/single_stereo.xml | 25 ++++++ .../{ => planets}/renderableplanet.h | 0 include/openspace/util/factorymanager.inl | 39 +++++++++ src/CMakeLists.txt | 6 ++ .../{ => planets}/renderableplanet.cpp | 2 +- src/scenegraph/scenegraph.cpp | 2 +- src/util/factorymanager.cpp | 4 +- 9 files changed, 158 insertions(+), 3 deletions(-) create mode 100644 config/sgct/VRArenaSimCenter.xml create mode 100644 config/sgct/single_stereo.xml rename include/openspace/rendering/{ => planets}/renderableplanet.h (100%) create mode 100644 include/openspace/util/factorymanager.inl rename src/rendering/{ => planets}/renderableplanet.cpp (99%) diff --git a/.gitignore b/.gitignore index dc6c035a1a..36408d75ca 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,7 @@ bin/ build/ ext/SGCT +ext/kameleon .DS_Store *.swp diff --git a/config/sgct/VRArenaSimCenter.xml b/config/sgct/VRArenaSimCenter.xml new file mode 100644 index 0000000000..3ce0236e5f --- /dev/null +++ b/config/sgct/VRArenaSimCenter.xml @@ -0,0 +1,82 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/config/sgct/single_stereo.xml b/config/sgct/single_stereo.xml new file mode 100644 index 0000000000..30188156b0 --- /dev/null +++ b/config/sgct/single_stereo.xml @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/include/openspace/rendering/renderableplanet.h b/include/openspace/rendering/planets/renderableplanet.h similarity index 100% rename from include/openspace/rendering/renderableplanet.h rename to include/openspace/rendering/planets/renderableplanet.h diff --git a/include/openspace/util/factorymanager.inl b/include/openspace/util/factorymanager.inl new file mode 100644 index 0000000000..d8da706d1d --- /dev/null +++ b/include/openspace/util/factorymanager.inl @@ -0,0 +1,39 @@ +/***************************************************************************************** + * * + * OpenSpace * + * * + * Copyright (c) 2014 * + * * + * 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. * + ****************************************************************************************/ + +namespace openspace { + +template +ghoul::TemplateFactory* FactoryManager::factory() +{ + for (ghoul::TemplateFactoryBase* factory : _factories) { + if (factory->baseClassType() == typeid(T)) + return dynamic_cast*>(factory); + } + LERRORC("FactoryManager", "Could not find factory for type '" << typeid(T).name() + << "'"); + return nullptr; +} + +} // namespace openspace diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index f323b62565..d6d620ebf6 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -72,6 +72,12 @@ file(GLOB RENDERING_HEADER ${HEADER_ROOT_DIR}/openspace/rendering/*.h) set(OPENSPACE_HEADER ${OPENSPACE_HEADER} ${RENDERING_HEADER}) source_group(Rendering FILES ${RENDERING_SOURCE} ${RENDERING_HEADER}) +file(GLOB RENDERING_PLANETS_SOURCE ${SOURCE_ROOT_DIR}/rendering/planets/*.cpp) +set(OPENSPACE_SOURCE ${OPENSPACE_SOURCE} ${RENDERING_PLANETS_SOURCE}) +file(GLOB RENDERING_PLANETS_HEADER ${HEADER_ROOT_DIR}/openspace/rendering/planets/*.h) +set(OPENSPACE_HEADER ${OPENSPACE_HEADER} ${RENDERING_PLANETS_HEADER}) +source_group(Rendering\\Planets FILES ${RENDERING_PLANETS_SOURCE} ${RENDERING_PLANETS_HEADER}) + file(GLOB SCENEGRAPH_SOURCE ${SOURCE_ROOT_DIR}/scenegraph/*.cpp) set(OPENSPACE_SOURCE ${OPENSPACE_SOURCE} ${SCENEGRAPH_SOURCE}) file(GLOB SCENEGRAPH_HEADER ${HEADER_ROOT_DIR}/openspace/scenegraph/*.h ${HEADER_ROOT_DIR}/openspace/scenegraph/*.inl) diff --git a/src/rendering/renderableplanet.cpp b/src/rendering/planets/renderableplanet.cpp similarity index 99% rename from src/rendering/renderableplanet.cpp rename to src/rendering/planets/renderableplanet.cpp index 69ece0e8c1..7770190b83 100644 --- a/src/rendering/renderableplanet.cpp +++ b/src/rendering/planets/renderableplanet.cpp @@ -23,7 +23,7 @@ ****************************************************************************************/ // open space includes -#include +#include #include #include diff --git a/src/scenegraph/scenegraph.cpp b/src/scenegraph/scenegraph.cpp index a7e6fa2574..245b126845 100644 --- a/src/scenegraph/scenegraph.cpp +++ b/src/scenegraph/scenegraph.cpp @@ -24,7 +24,7 @@ // open space includes #include -#include +#include #include #include #include diff --git a/src/util/factorymanager.cpp b/src/util/factorymanager.cpp index 300396a5f3..bb89ecbde2 100644 --- a/src/util/factorymanager.cpp +++ b/src/util/factorymanager.cpp @@ -27,7 +27,7 @@ #include // renderables -#include +#include #include #include #include @@ -65,6 +65,8 @@ void FactoryManager::initialize() _manager->addFactory(new ghoul::TemplateFactory); _manager->factory()->registerClass("Static"); _manager->factory()->registerClass("Spice"); + + } void FactoryManager::deinitialize()