diff --git a/CMakeLists.txt b/CMakeLists.txt index efa5b8982f..ffe1005913 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -146,6 +146,8 @@ endif () add_subdirectory(src) add_subdirectory(modules/base) +add_subdirectory(modules/newhorizons) +add_subdirectory(modules/volume) option(BUILD_GUI_APPLICATIONS "Build GUI Applications" OFF) if (BUILD_GUI_APPLICATIONS) diff --git a/modules/base/basemodule.cpp b/modules/base/basemodule.cpp index bcf820d7b9..19e58329ef 100644 --- a/modules/base/basemodule.cpp +++ b/modules/base/basemodule.cpp @@ -45,10 +45,6 @@ #include #include -namespace { - const std::string _loggerCat = "BaseModule"; -} - namespace openspace { bool BaseModule::initialize() { @@ -81,8 +77,4 @@ bool BaseModule::initialize() { return true; } -bool BaseModule::deinitialize() { - return false; -} - } // namespace openspace diff --git a/modules/base/basemodule.h b/modules/base/basemodule.h index 3a2fe48c0b..6561a5cace 100644 --- a/modules/base/basemodule.h +++ b/modules/base/basemodule.h @@ -32,7 +32,6 @@ namespace openspace { class BaseModule : public OpenSpaceModule { public: bool initialize() override; - bool deinitialize() override; }; } // namespace openspace diff --git a/modules/newhorizons/CMakeLists.txt b/modules/newhorizons/CMakeLists.txt new file mode 100644 index 0000000000..fd86c73f88 --- /dev/null +++ b/modules/newhorizons/CMakeLists.txt @@ -0,0 +1,27 @@ +set(HEADER_FILES + ${CMAKE_CURRENT_SOURCE_DIR}/rendering/planetgeometryprojection.h + ${CMAKE_CURRENT_SOURCE_DIR}/rendering/renderablefov.h + ${CMAKE_CURRENT_SOURCE_DIR}/rendering/renderableplaneprojection.h + ${CMAKE_CURRENT_SOURCE_DIR}/rendering/renderableplanetprojection.h + ${CMAKE_CURRENT_SOURCE_DIR}/rendering/simplespheregeometryprojection.h + ${CMAKE_CURRENT_SOURCE_DIR}/rendering/writeToTexture.h +) +source_group("Header Files" FILES ${HEADER_FILES}) + +set(SOURCE_FILES + ${CMAKE_CURRENT_SOURCE_DIR}/rendering/planetgeometryprojection.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/rendering/renderablefov.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/rendering/renderableplaneprojection.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/rendering/renderableplanetprojection.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/rendering/simplespheregeometryprojection.cpp +) +source_group("Source Files" FILES ${SOURCE_FILES}) + +set(MODULE_CLASS_FILES + ${CMAKE_CURRENT_SOURCE_DIR}/newhorizonsmodule.h + ${CMAKE_CURRENT_SOURCE_DIR}/newhorizonsmodule.cpp +) + +include_directories(${OPENSPACE_BASE_DIR}/include ${OPENSPACE_BASE_DIR}) + +add_library(openspace-module-newhorizons ${HEADER_FILES} ${SOURCE_FILES} ${MODULE_CLASS_FILES}) diff --git a/modules/newhorizons/newhorizonsmodule.cpp b/modules/newhorizons/newhorizonsmodule.cpp new file mode 100644 index 0000000000..e48556cf44 --- /dev/null +++ b/modules/newhorizons/newhorizonsmodule.cpp @@ -0,0 +1,56 @@ +/***************************************************************************************** + * * + * OpenSpace * + * * + * Copyright (c) 2014-2015 * + * * + * 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 + +#include +#include + +#include + +#include +#include +#include +#include +#include + +namespace openspace { + +bool NewHorizonsModule::initialize() { + FactoryManager::ref().addFactory(new ghoul::TemplateFactory); + + auto fRenderable = FactoryManager::ref().factory(); + ghoul_assert(fRenderable, "No renderable factory existed"); + + fRenderable->registerClass("RenderableFov"); + fRenderable->registerClass("RenderablePlaneProjection"); + fRenderable->registerClass("RenderablePlanetProjection"); + + auto fPlanetGeometryProjection = FactoryManager::ref().factory(); + fPlanetGeometryProjection->registerClass("SimpleSphereProjection"); + + return true; +} + +} // namespace openspace diff --git a/modules/newhorizons/newhorizonsmodule.h b/modules/newhorizons/newhorizonsmodule.h new file mode 100644 index 0000000000..c5d89d8cbd --- /dev/null +++ b/modules/newhorizons/newhorizonsmodule.h @@ -0,0 +1,39 @@ +/***************************************************************************************** + * * + * OpenSpace * + * * + * Copyright (c) 2014-2015 * + * * + * 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. * + ****************************************************************************************/ + +#ifndef __NEWHORIZONSMODULE_H__ +#define __NEWHORIZONSMODULE_H__ + +#include + +namespace openspace { + +class NewHorizonsModule : public OpenSpaceModule { +public: + bool initialize() override; +}; + +} // namespace openspace + +#endif // __NEWHORIZONSMODULE_H__ diff --git a/modules/projection/rendering/planetgeometryprojection.cpp b/modules/newhorizons/rendering/planetgeometryprojection.cpp similarity index 98% rename from modules/projection/rendering/planetgeometryprojection.cpp rename to modules/newhorizons/rendering/planetgeometryprojection.cpp index a1507a831c..5df2e2c862 100644 --- a/modules/projection/rendering/planetgeometryprojection.cpp +++ b/modules/newhorizons/rendering/planetgeometryprojection.cpp @@ -22,7 +22,7 @@ * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * ****************************************************************************************/ -#include +#include #include #include diff --git a/modules/projection/rendering/planetgeometryprojection.h b/modules/newhorizons/rendering/planetgeometryprojection.h similarity index 97% rename from modules/projection/rendering/planetgeometryprojection.h rename to modules/newhorizons/rendering/planetgeometryprojection.h index b843524539..d4fd56e89d 100644 --- a/modules/projection/rendering/planetgeometryprojection.h +++ b/modules/newhorizons/rendering/planetgeometryprojection.h @@ -26,7 +26,7 @@ #define __PlanetGeometryProjection_H__ #include -#include +#include #include namespace openspace { diff --git a/modules/projection/rendering/renderablefov.cpp b/modules/newhorizons/rendering/renderablefov.cpp similarity index 99% rename from modules/projection/rendering/renderablefov.cpp rename to modules/newhorizons/rendering/renderablefov.cpp index fa2d13d451..f1211e5da5 100644 --- a/modules/projection/rendering/renderablefov.cpp +++ b/modules/newhorizons/rendering/renderablefov.cpp @@ -22,7 +22,7 @@ * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * ****************************************************************************************/ -#include +#include #include #include diff --git a/modules/projection/rendering/renderablefov.h b/modules/newhorizons/rendering/renderablefov.h similarity index 100% rename from modules/projection/rendering/renderablefov.h rename to modules/newhorizons/rendering/renderablefov.h diff --git a/modules/projection/rendering/renderableplaneprojection.cpp b/modules/newhorizons/rendering/renderableplaneprojection.cpp similarity index 99% rename from modules/projection/rendering/renderableplaneprojection.cpp rename to modules/newhorizons/rendering/renderableplaneprojection.cpp index b8d290f156..82f6fc81e2 100644 --- a/modules/projection/rendering/renderableplaneprojection.cpp +++ b/modules/newhorizons/rendering/renderableplaneprojection.cpp @@ -22,7 +22,7 @@ * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * ****************************************************************************************/ -#include +#include #include #include #include diff --git a/modules/projection/rendering/renderableplaneprojection.h b/modules/newhorizons/rendering/renderableplaneprojection.h similarity index 100% rename from modules/projection/rendering/renderableplaneprojection.h rename to modules/newhorizons/rendering/renderableplaneprojection.h diff --git a/modules/projection/rendering/renderableplanetprojection.cpp b/modules/newhorizons/rendering/renderableplanetprojection.cpp similarity index 99% rename from modules/projection/rendering/renderableplanetprojection.cpp rename to modules/newhorizons/rendering/renderableplanetprojection.cpp index b8506d047e..1a13599eab 100644 --- a/modules/projection/rendering/renderableplanetprojection.cpp +++ b/modules/newhorizons/rendering/renderableplanetprojection.cpp @@ -23,9 +23,9 @@ ****************************************************************************************/ // open space includes -#include +#include #include -#include +#include #include diff --git a/modules/projection/rendering/renderableplanetprojection.h b/modules/newhorizons/rendering/renderableplanetprojection.h similarity index 100% rename from modules/projection/rendering/renderableplanetprojection.h rename to modules/newhorizons/rendering/renderableplanetprojection.h diff --git a/modules/projection/rendering/simplespheregeometryprojection.cpp b/modules/newhorizons/rendering/simplespheregeometryprojection.cpp similarity index 98% rename from modules/projection/rendering/simplespheregeometryprojection.cpp rename to modules/newhorizons/rendering/simplespheregeometryprojection.cpp index a6ef51a9d8..8d840a70a0 100644 --- a/modules/projection/rendering/simplespheregeometryprojection.cpp +++ b/modules/newhorizons/rendering/simplespheregeometryprojection.cpp @@ -22,7 +22,7 @@ * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * ****************************************************************************************/ -#include +#include #include namespace { diff --git a/modules/projection/rendering/simplespheregeometryprojection.h b/modules/newhorizons/rendering/simplespheregeometryprojection.h similarity index 97% rename from modules/projection/rendering/simplespheregeometryprojection.h rename to modules/newhorizons/rendering/simplespheregeometryprojection.h index b64634b9ce..7f6bca6680 100644 --- a/modules/projection/rendering/simplespheregeometryprojection.h +++ b/modules/newhorizons/rendering/simplespheregeometryprojection.h @@ -25,7 +25,7 @@ #ifndef __SIMPLESPHEREGEOMETRYPROJECTION_H__ #define __SIMPLESPHEREGEOMETRYPROJECTION_H__ -#include +#include #include #include #include diff --git a/modules/projection/rendering/writeToTexture.h b/modules/newhorizons/rendering/writeToTexture.h similarity index 100% rename from modules/projection/rendering/writeToTexture.h rename to modules/newhorizons/rendering/writeToTexture.h diff --git a/modules/volume/CMakeLists.txt b/modules/volume/CMakeLists.txt new file mode 100644 index 0000000000..87bea70f10 --- /dev/null +++ b/modules/volume/CMakeLists.txt @@ -0,0 +1,20 @@ +set(HEADER_FILES + ${CMAKE_CURRENT_SOURCE_DIR}/rendering/renderablevolume.h + ${CMAKE_CURRENT_SOURCE_DIR}/rendering/renderablevolumegl.h +) +source_group("Header Files" FILES ${HEADER_FILES}) + +set(SOURCE_FILES + ${CMAKE_CURRENT_SOURCE_DIR}/rendering/renderablevolume.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/rendering/renderablevolumegl.cpp +) +source_group("Source Files" FILES ${SOURCE_FILES}) + +set(MODULE_CLASS_FILES + ${CMAKE_CURRENT_SOURCE_DIR}/volumemodule.h + ${CMAKE_CURRENT_SOURCE_DIR}/volumemodule.cpp +) + +include_directories(${OPENSPACE_BASE_DIR}/include ${OPENSPACE_BASE_DIR}) + +add_library(openspace-module-volume ${HEADER_FILES} ${SOURCE_FILES} ${MODULE_CLASS_FILES}) diff --git a/modules/volume/rendering/renderablevolume.cpp b/modules/volume/rendering/renderablevolume.cpp index 314c7255e2..4afdd65974 100644 --- a/modules/volume/rendering/renderablevolume.cpp +++ b/modules/volume/rendering/renderablevolume.cpp @@ -23,7 +23,7 @@ ****************************************************************************************/ // open space includes -#include +#include #include #include #include diff --git a/modules/volume/rendering/renderablevolumegl.cpp b/modules/volume/rendering/renderablevolumegl.cpp index 26452d692a..a3fddd75fa 100644 --- a/modules/volume/rendering/renderablevolumegl.cpp +++ b/modules/volume/rendering/renderablevolumegl.cpp @@ -22,7 +22,7 @@ * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * ****************************************************************************************/ -#include +#include #include #include diff --git a/modules/volume/rendering/renderablevolumegl.h b/modules/volume/rendering/renderablevolumegl.h index 55acc763f4..166bb26d4d 100644 --- a/modules/volume/rendering/renderablevolumegl.h +++ b/modules/volume/rendering/renderablevolumegl.h @@ -25,7 +25,7 @@ #ifndef __RENDERABLEVOLUMEGL_H__ #define __RENDERABLEVOLUMEGL_H__ -#include +#include #include // Forward declare to minimize dependencies diff --git a/modules/volume/volumemodule.cpp b/modules/volume/volumemodule.cpp new file mode 100644 index 0000000000..6811bbb55f --- /dev/null +++ b/modules/volume/volumemodule.cpp @@ -0,0 +1,46 @@ +/***************************************************************************************** + * * + * OpenSpace * + * * + * Copyright (c) 2014-2015 * + * * + * 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 + +#include +#include + +#include + +#include + +namespace openspace { + +bool VolumeModule::initialize() { + + auto fRenderable = FactoryManager::ref().factory(); + ghoul_assert(fRenderable, "No renderable factory existed"); + + fRenderable->registerClass("RenderableVolumeGL"); + + return true; +} + +} // namespace openspace diff --git a/modules/volume/volumemodule.h b/modules/volume/volumemodule.h new file mode 100644 index 0000000000..5377c1940b --- /dev/null +++ b/modules/volume/volumemodule.h @@ -0,0 +1,39 @@ +/***************************************************************************************** + * * + * OpenSpace * + * * + * Copyright (c) 2014-2015 * + * * + * 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. * + ****************************************************************************************/ + +#ifndef __VOLUMEMODULE_H__ +#define __VOLUMEMODULE_H__ + +#include + +namespace openspace { + +class VolumeModule : public OpenSpaceModule { +public: + bool initialize() override; +}; + +} // namespace openspace + +#endif // __VOLUMEMODULE_H__ diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 014d3dfe24..f4d9f59798 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -151,8 +151,7 @@ if (UNIX AND NOT APPLE) endif (UNIX AND NOT APPLE) -set(DEPENDENT_LIBS ${DEPENDENT_LIBS} openspace-module-base) -message(${DEPENDENT_LIBS}) +set(DEPENDENT_LIBS ${DEPENDENT_LIBS} openspace-module-base openspace-module-newhorizons openspace-module-volume) include_directories("${HEADER_ROOT_DIR}") include_directories("${OPENSPACE_BASE_DIR}") diff --git a/src/engine/moduleengine.cpp b/src/engine/moduleengine.cpp index 821b7abe68..476f0efd84 100644 --- a/src/engine/moduleengine.cpp +++ b/src/engine/moduleengine.cpp @@ -28,6 +28,10 @@ #include +#include +#include +#include + namespace { const std::string _loggerCat = "ModuleEngine"; } @@ -36,6 +40,11 @@ namespace openspace { bool ModuleEngine::initialize() { LDEBUG("Initializing modules"); + + registerModule(new BaseModule); + registerModule(new NewHorizonsModule); + registerModule(new VolumeModule); + for (OpenSpaceModule* m : _modules) { bool success = m->initialize(); if (!success) { diff --git a/src/engine/openspaceengine.cpp b/src/engine/openspaceengine.cpp index 02f5ab38e5..f5a46c5090 100644 --- a/src/engine/openspaceengine.cpp +++ b/src/engine/openspaceengine.cpp @@ -89,8 +89,6 @@ namespace { } commandlineArgumentPlaceholders; } -#include - namespace openspace { OpenSpaceEngine* OpenSpaceEngine::_engine = nullptr; @@ -114,7 +112,6 @@ OpenSpaceEngine::OpenSpaceEngine(std::string programName) ghoul::systemcapabilities::SystemCapabilities::initialize(); // Register modules - _moduleEngine->registerModule(new BaseModule); _moduleEngine->initialize(); }