From 9d733eb613fbeec51c758d53edc6d3f274d9ddc1 Mon Sep 17 00:00:00 2001 From: Alexander Bock Date: Tue, 26 May 2015 23:51:15 +0200 Subject: [PATCH] Moving Kameleon into its own module Moving fieldline rendering into its own module --- .gitmodules | 4 +- ext/ghoul | 2 +- modules/base/CMakeLists.txt | 105 +++++++++--------- modules/base/basemodule.cpp | 2 - modules/fieldlines/CMakeLists.txt | 48 ++++++++ modules/fieldlines/fieldlinesmodule.cpp | 53 +++++++++ modules/fieldlines/fieldlinesmodule.h | 40 +++++++ modules/fieldlines/include.cmake | 3 + .../rendering/renderablefieldlines.cpp | 4 +- .../rendering/renderablefieldlines.h | 0 .../shaders/fieldline_fs.glsl | 0 .../shaders/fieldline_gs.glsl | 0 .../shaders/fieldline_vs.glsl | 0 modules/kameleon/CMakeLists.txt | 77 +++++++++++++ {ext => modules/kameleon/ext}/kameleon | 0 .../kameleon/include}/kameleonwrapper.h | 0 modules/kameleon/kameleonmodule.cpp | 41 +++++++ modules/kameleon/kameleonmodule.h | 40 +++++++ .../kameleon/src}/kameleonwrapper.cpp | 2 +- modules/volume/include.cmake | 4 +- modules/volume/rendering/renderablevolume.cpp | 2 +- .../volume/rendering/renderablevolumegl.cpp | 2 +- src/CMakeLists.txt | 2 - src/rendering/renderengine.cpp | 2 +- support/cmake/support_macros.cmake | 36 +----- 25 files changed, 366 insertions(+), 103 deletions(-) create mode 100644 modules/fieldlines/CMakeLists.txt create mode 100644 modules/fieldlines/fieldlinesmodule.cpp create mode 100644 modules/fieldlines/fieldlinesmodule.h create mode 100644 modules/fieldlines/include.cmake rename modules/{base => fieldlines}/rendering/renderablefieldlines.cpp (99%) rename modules/{base => fieldlines}/rendering/renderablefieldlines.h (100%) rename modules/{base => fieldlines}/shaders/fieldline_fs.glsl (100%) rename modules/{base => fieldlines}/shaders/fieldline_gs.glsl (100%) rename modules/{base => fieldlines}/shaders/fieldline_vs.glsl (100%) create mode 100644 modules/kameleon/CMakeLists.txt rename {ext => modules/kameleon/ext}/kameleon (100%) rename {include/openspace/util => modules/kameleon/include}/kameleonwrapper.h (100%) create mode 100644 modules/kameleon/kameleonmodule.cpp create mode 100644 modules/kameleon/kameleonmodule.h rename {src/util => modules/kameleon/src}/kameleonwrapper.cpp (99%) diff --git a/.gitmodules b/.gitmodules index b4d9520ac1..e78869f917 100644 --- a/.gitmodules +++ b/.gitmodules @@ -4,6 +4,6 @@ [submodule "openspace-data"] path = openspace-data url = git@openspace.itn.liu.se:/openspace-data -[submodule "ext/kameleon"] - path = ext/kameleon +[submodule "modules/kameleon/ext/kameleon"] + path = modules/kameleon/ext/kameleon url = git@openspace.itn.liu.se:/kameleon diff --git a/ext/ghoul b/ext/ghoul index 544fadd8d3..c660e8dd75 160000 --- a/ext/ghoul +++ b/ext/ghoul @@ -1 +1 @@ -Subproject commit 544fadd8d3f04e8120f810be81afbfefb08d55ba +Subproject commit c660e8dd75beae2a827cbc04d19987e45b23f4fb diff --git a/modules/base/CMakeLists.txt b/modules/base/CMakeLists.txt index cd2491b6af..8cd92a6bc8 100644 --- a/modules/base/CMakeLists.txt +++ b/modules/base/CMakeLists.txt @@ -25,69 +25,64 @@ include(${OPENSPACE_CMAKE_EXT_DIR}/module_definition.cmake) set(HEADER_FILES - ${CMAKE_CURRENT_SOURCE_DIR}/rendering/modelgeometry.h - ${CMAKE_CURRENT_SOURCE_DIR}/rendering/planetgeometry.h - ${CMAKE_CURRENT_SOURCE_DIR}/rendering/renderableconstellationbounds.h - ${CMAKE_CURRENT_SOURCE_DIR}/rendering/renderablefieldlines.h - ${CMAKE_CURRENT_SOURCE_DIR}/rendering/renderablemodel.h - ${CMAKE_CURRENT_SOURCE_DIR}/rendering/renderablepath.h - ${CMAKE_CURRENT_SOURCE_DIR}/rendering/renderableplane.h - ${CMAKE_CURRENT_SOURCE_DIR}/rendering/renderableplanet.h - ${CMAKE_CURRENT_SOURCE_DIR}/rendering/renderablesphere.h - ${CMAKE_CURRENT_SOURCE_DIR}/rendering/renderablesphericalgrid.h - ${CMAKE_CURRENT_SOURCE_DIR}/rendering/renderablestars.h - ${CMAKE_CURRENT_SOURCE_DIR}/rendering/renderabletrail.h - ${CMAKE_CURRENT_SOURCE_DIR}/rendering/simplespheregeometry.h - ${CMAKE_CURRENT_SOURCE_DIR}/rendering/wavefrontgeometry.h - ${CMAKE_CURRENT_SOURCE_DIR}/ephemeris/dynamicephemeris.h - ${CMAKE_CURRENT_SOURCE_DIR}/ephemeris/spiceephemeris.h - ${CMAKE_CURRENT_SOURCE_DIR}/ephemeris/staticephemeris.h + ${CMAKE_CURRENT_SOURCE_DIR}/rendering/modelgeometry.h + ${CMAKE_CURRENT_SOURCE_DIR}/rendering/planetgeometry.h + ${CMAKE_CURRENT_SOURCE_DIR}/rendering/renderableconstellationbounds.h + ${CMAKE_CURRENT_SOURCE_DIR}/rendering/renderablemodel.h + ${CMAKE_CURRENT_SOURCE_DIR}/rendering/renderablepath.h + ${CMAKE_CURRENT_SOURCE_DIR}/rendering/renderableplane.h + ${CMAKE_CURRENT_SOURCE_DIR}/rendering/renderableplanet.h + ${CMAKE_CURRENT_SOURCE_DIR}/rendering/renderablesphere.h + ${CMAKE_CURRENT_SOURCE_DIR}/rendering/renderablesphericalgrid.h + ${CMAKE_CURRENT_SOURCE_DIR}/rendering/renderablestars.h + ${CMAKE_CURRENT_SOURCE_DIR}/rendering/renderabletrail.h + ${CMAKE_CURRENT_SOURCE_DIR}/rendering/simplespheregeometry.h + ${CMAKE_CURRENT_SOURCE_DIR}/rendering/wavefrontgeometry.h + ${CMAKE_CURRENT_SOURCE_DIR}/ephemeris/dynamicephemeris.h + ${CMAKE_CURRENT_SOURCE_DIR}/ephemeris/spiceephemeris.h + ${CMAKE_CURRENT_SOURCE_DIR}/ephemeris/staticephemeris.h ) source_group("Header Files" FILES ${HEADER_FILES}) set(SOURCE_FILES - ${CMAKE_CURRENT_SOURCE_DIR}/rendering/modelgeometry.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/rendering/planetgeometry.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/rendering/renderableconstellationbounds.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/rendering/renderablefieldlines.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/rendering/renderablemodel.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/rendering/renderablepath.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/rendering/renderableplane.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/rendering/renderableplanet.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/rendering/renderablesphere.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/rendering/renderablesphericalgrid.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/rendering/renderablestars.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/rendering/renderabletrail.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/rendering/simplespheregeometry.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/rendering/wavefrontgeometry.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/ephemeris/dynamicephemeris.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/ephemeris/spiceephemeris.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/ephemeris/staticephemeris.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/rendering/modelgeometry.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/rendering/planetgeometry.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/rendering/renderableconstellationbounds.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/rendering/renderablemodel.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/rendering/renderablepath.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/rendering/renderableplane.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/rendering/renderableplanet.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/rendering/renderablesphere.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/rendering/renderablesphericalgrid.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/rendering/renderablestars.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/rendering/renderabletrail.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/rendering/simplespheregeometry.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/rendering/wavefrontgeometry.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/ephemeris/dynamicephemeris.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/ephemeris/spiceephemeris.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/ephemeris/staticephemeris.cpp ) source_group("Source Files" FILES ${SOURCE_FILES}) set(SHADER_FILES - ${CMAKE_CURRENT_SOURCE_DIR}/shaders/constellationbounds_fs.glsl - ${CMAKE_CURRENT_SOURCE_DIR}/shaders/constellationbounds_vs.glsl - ${CMAKE_CURRENT_SOURCE_DIR}/shaders/ephemeris_fs.glsl - ${CMAKE_CURRENT_SOURCE_DIR}/shaders/ephemeris_vs.glsl - ${CMAKE_CURRENT_SOURCE_DIR}/shaders/fieldline_fs.glsl - ${CMAKE_CURRENT_SOURCE_DIR}/shaders/fieldline_gs.glsl - ${CMAKE_CURRENT_SOURCE_DIR}/shaders/fieldline_vs.glsl - ${CMAKE_CURRENT_SOURCE_DIR}/shaders/imageplane_fs.glsl - ${CMAKE_CURRENT_SOURCE_DIR}/shaders/imageplane_vs.glsl - ${CMAKE_CURRENT_SOURCE_DIR}/shaders/model_fs.glsl - ${CMAKE_CURRENT_SOURCE_DIR}/shaders/model_vs.glsl - ${CMAKE_CURRENT_SOURCE_DIR}/shaders/path_fs.glsl - ${CMAKE_CURRENT_SOURCE_DIR}/shaders/path_gs.glsl - ${CMAKE_CURRENT_SOURCE_DIR}/shaders/path_vs.glsl - ${CMAKE_CURRENT_SOURCE_DIR}/shaders/plane_fs.glsl - ${CMAKE_CURRENT_SOURCE_DIR}/shaders/plane_vs.glsl - ${CMAKE_CURRENT_SOURCE_DIR}/shaders/sphere_fs.glsl - ${CMAKE_CURRENT_SOURCE_DIR}/shaders/sphere_vs.glsl - ${CMAKE_CURRENT_SOURCE_DIR}/shaders/star_fs.glsl - ${CMAKE_CURRENT_SOURCE_DIR}/shaders/star_ge.glsl - ${CMAKE_CURRENT_SOURCE_DIR}/shaders/star_vs.glsl + ${CMAKE_CURRENT_SOURCE_DIR}/shaders/constellationbounds_fs.glsl + ${CMAKE_CURRENT_SOURCE_DIR}/shaders/constellationbounds_vs.glsl + ${CMAKE_CURRENT_SOURCE_DIR}/shaders/ephemeris_fs.glsl + ${CMAKE_CURRENT_SOURCE_DIR}/shaders/ephemeris_vs.glsl + ${CMAKE_CURRENT_SOURCE_DIR}/shaders/imageplane_fs.glsl + ${CMAKE_CURRENT_SOURCE_DIR}/shaders/imageplane_vs.glsl + ${CMAKE_CURRENT_SOURCE_DIR}/shaders/model_fs.glsl + ${CMAKE_CURRENT_SOURCE_DIR}/shaders/model_vs.glsl + ${CMAKE_CURRENT_SOURCE_DIR}/shaders/path_fs.glsl + ${CMAKE_CURRENT_SOURCE_DIR}/shaders/path_gs.glsl + ${CMAKE_CURRENT_SOURCE_DIR}/shaders/path_vs.glsl + ${CMAKE_CURRENT_SOURCE_DIR}/shaders/plane_fs.glsl + ${CMAKE_CURRENT_SOURCE_DIR}/shaders/plane_vs.glsl + ${CMAKE_CURRENT_SOURCE_DIR}/shaders/sphere_fs.glsl + ${CMAKE_CURRENT_SOURCE_DIR}/shaders/sphere_vs.glsl + ${CMAKE_CURRENT_SOURCE_DIR}/shaders/star_fs.glsl + ${CMAKE_CURRENT_SOURCE_DIR}/shaders/star_ge.glsl + ${CMAKE_CURRENT_SOURCE_DIR}/shaders/star_vs.glsl ) source_group("Shader Files" FILES ${SHADER_FILES}) diff --git a/modules/base/basemodule.cpp b/modules/base/basemodule.cpp index f2edeb85a2..e03cc14326 100644 --- a/modules/base/basemodule.cpp +++ b/modules/base/basemodule.cpp @@ -36,7 +36,6 @@ #include #include #include -#include #include #include #include @@ -76,7 +75,6 @@ bool BaseModule::initialize() { fRenderable->registerClass("RenderableSphericalGrid"); fRenderable->registerClass("RenderableModel"); fRenderable->registerClass("RenderablePlane"); - fRenderable->registerClass("RenderableFieldlines"); auto fEphemeris = FactoryManager::ref().factory(); ghoul_assert(fEphemeris, "Ephemeris factory was not created"); diff --git a/modules/fieldlines/CMakeLists.txt b/modules/fieldlines/CMakeLists.txt new file mode 100644 index 0000000000..e8c847c274 --- /dev/null +++ b/modules/fieldlines/CMakeLists.txt @@ -0,0 +1,48 @@ +######################################################################################### +# # +# 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(${OPENSPACE_CMAKE_EXT_DIR}/module_definition.cmake) + +set(HEADER_FILES + ${CMAKE_CURRENT_SOURCE_DIR}/rendering/renderablefieldlines.h +) +source_group("Header Files" FILES ${HEADER_FILES}) + +set(SOURCE_FILES + ${CMAKE_CURRENT_SOURCE_DIR}/rendering/renderablefieldlines.cpp +) +source_group("Source Files" FILES ${SOURCE_FILES}) + +set(SHADER_FILES + ${CMAKE_CURRENT_SOURCE_DIR}/shaders/fieldline_fs.glsl + ${CMAKE_CURRENT_SOURCE_DIR}/shaders/fieldline_gs.glsl + ${CMAKE_CURRENT_SOURCE_DIR}/shaders/fieldline_vs.glsl +) +source_group("Shader Files" FILES ${SHADER_FILES}) + +create_new_module( + "Fieldlines" + fieldlines_module + ${HEADER_FILES} ${SOURCE_FILES} ${SHADER_FILES} +) diff --git a/modules/fieldlines/fieldlinesmodule.cpp b/modules/fieldlines/fieldlinesmodule.cpp new file mode 100644 index 0000000000..1c72f6d264 --- /dev/null +++ b/modules/fieldlines/fieldlinesmodule.cpp @@ -0,0 +1,53 @@ +/***************************************************************************************** + * * + * 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 { + +FieldlinesModule::FieldlinesModule() { + setName("Fieldlines"); +} + +bool FieldlinesModule::initialize() { + bool success = OpenSpaceModule::initialize(); + if (!success) + return false; + + auto fRenderable = FactoryManager::ref().factory(); + ghoul_assert(fRenderable, "No renderable factory existed"); + + fRenderable->registerClass("RenderableFieldlines"); + + return true; +} + +} // namespace openspace diff --git a/modules/fieldlines/fieldlinesmodule.h b/modules/fieldlines/fieldlinesmodule.h new file mode 100644 index 0000000000..2acd5d2164 --- /dev/null +++ b/modules/fieldlines/fieldlinesmodule.h @@ -0,0 +1,40 @@ +/***************************************************************************************** + * * + * 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 __FIELDLINESMODULE_H__ +#define __FIELDLINESMODULE_H__ + +#include + +namespace openspace { + +class FieldlinesModule : public OpenSpaceModule { +public: + FieldlinesModule(); + bool initialize() override; +}; + +} // namespace openspace + +#endif // __FIELDLINESMODULE_H__ diff --git a/modules/fieldlines/include.cmake b/modules/fieldlines/include.cmake new file mode 100644 index 0000000000..3751826997 --- /dev/null +++ b/modules/fieldlines/include.cmake @@ -0,0 +1,3 @@ +set (OPENSPACE_DEPENDENCIES + kameleon +) \ No newline at end of file diff --git a/modules/base/rendering/renderablefieldlines.cpp b/modules/fieldlines/rendering/renderablefieldlines.cpp similarity index 99% rename from modules/base/rendering/renderablefieldlines.cpp rename to modules/fieldlines/rendering/renderablefieldlines.cpp index 62a6503c67..69ca17ca64 100644 --- a/modules/base/rendering/renderablefieldlines.cpp +++ b/modules/fieldlines/rendering/renderablefieldlines.cpp @@ -22,10 +22,10 @@ * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * ****************************************************************************************/ -#include +#include #include #include -#include +#include #include #include diff --git a/modules/base/rendering/renderablefieldlines.h b/modules/fieldlines/rendering/renderablefieldlines.h similarity index 100% rename from modules/base/rendering/renderablefieldlines.h rename to modules/fieldlines/rendering/renderablefieldlines.h diff --git a/modules/base/shaders/fieldline_fs.glsl b/modules/fieldlines/shaders/fieldline_fs.glsl similarity index 100% rename from modules/base/shaders/fieldline_fs.glsl rename to modules/fieldlines/shaders/fieldline_fs.glsl diff --git a/modules/base/shaders/fieldline_gs.glsl b/modules/fieldlines/shaders/fieldline_gs.glsl similarity index 100% rename from modules/base/shaders/fieldline_gs.glsl rename to modules/fieldlines/shaders/fieldline_gs.glsl diff --git a/modules/base/shaders/fieldline_vs.glsl b/modules/fieldlines/shaders/fieldline_vs.glsl similarity index 100% rename from modules/base/shaders/fieldline_vs.glsl rename to modules/fieldlines/shaders/fieldline_vs.glsl diff --git a/modules/kameleon/CMakeLists.txt b/modules/kameleon/CMakeLists.txt new file mode 100644 index 0000000000..724e7a40a9 --- /dev/null +++ b/modules/kameleon/CMakeLists.txt @@ -0,0 +1,77 @@ +######################################################################################### +# # +# 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(${OPENSPACE_CMAKE_EXT_DIR}/module_definition.cmake) + +set(HEADER_FILES + ${CMAKE_CURRENT_SOURCE_DIR}/include/kameleonwrapper.h +) +source_group("Header Files" FILES ${HEADER_FILES}) + +set(SOURCE_FILES + ${CMAKE_CURRENT_SOURCE_DIR}/src/kameleonwrapper.cpp +) +source_group("Source Files" FILES ${SOURCE_FILES}) + +create_new_module( + "Kameleon" + kameleon_module + ${HEADER_FILES} ${SOURCE_FILES} +) + + option(KAMELEON_LIBRARY_ONLY "Build with Kameleon as library only" ON) + if (WIN32) + option(BUILD_SHARED_LIBS "Build Shared Libraries" OFF) + else () + option(BUILD_SHARED_LIBS "Build Shared Libraries" ON) + endif () + mark_as_advanced(BUILD_SHARED_LIBS) # Change to set instead of option + option(KAMELEON_USE_HDF5 "Kameleon use HDF5" OFF) + set(KAMELEON_ROOT_DIR ${CMAKE_CURRENT_SOURCE_DIR}/ext/kameleon) + set(KAMELEON_INCLUDES ${KAMELEON_ROOT_DIR}/src) + set(BOOST_ROOT "${OPENSPACE_EXT_DIR}/ghoul/ext/boost") + add_subdirectory(${KAMELEON_ROOT_DIR}) + target_include_directories(${kameleon_module} SYSTEM PUBLIC ${KAMELEON_INCLUDES}) + target_link_libraries(${kameleon_module} ccmc) + if (OPENSPACE_DISABLE_EXTERNAL_WARNINGS) + if (MSVC) + target_compile_options(ccmc PUBLIC "/W0" "/MP") + else () + target_compile_options(ccmc PUBLIC "-w") + endif () + target_compile_definitions(ccmc PUBLIC "_SCL_SECURE_NO_WARNINGS") + endif () + set_property(TARGET ccmc PROPERTY FOLDER "External") + if (TARGET cdf) + if (OPENSPACE_DISABLE_EXTERNAL_WARNINGS) + if (MSVC) + target_compile_options(cdf PUBLIC "/W0" "/MP") + else () + target_compile_options(cdf PUBLIC "-w") + endif () + endif () + set_property(TARGET cdf PROPERTY FOLDER "External") + endif () + +#include_external_library(${onscreengui_module} Imgui ${CMAKE_CURRENT_SOURCE_DIR}/ext/kameleon) diff --git a/ext/kameleon b/modules/kameleon/ext/kameleon similarity index 100% rename from ext/kameleon rename to modules/kameleon/ext/kameleon diff --git a/include/openspace/util/kameleonwrapper.h b/modules/kameleon/include/kameleonwrapper.h similarity index 100% rename from include/openspace/util/kameleonwrapper.h rename to modules/kameleon/include/kameleonwrapper.h diff --git a/modules/kameleon/kameleonmodule.cpp b/modules/kameleon/kameleonmodule.cpp new file mode 100644 index 0000000000..bde173db2b --- /dev/null +++ b/modules/kameleon/kameleonmodule.cpp @@ -0,0 +1,41 @@ +/***************************************************************************************** + * * + * 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 + +namespace openspace { + +KameleonModule::KameleonModule() { + setName("Kameleon"); +} + +bool KameleonModule::initialize() { + bool success = OpenSpaceModule::initialize(); + if (!success) + return false; + + return true; +} + +} // namespace openspace diff --git a/modules/kameleon/kameleonmodule.h b/modules/kameleon/kameleonmodule.h new file mode 100644 index 0000000000..19e2b51712 --- /dev/null +++ b/modules/kameleon/kameleonmodule.h @@ -0,0 +1,40 @@ +/***************************************************************************************** + * * + * 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 __KAMELEONMODULE_H__ +#define __KAMELEONMODULE_H__ + +#include + +namespace openspace { + +class KameleonModule : public OpenSpaceModule { +public: + KameleonModule(); + bool initialize() override; +}; + +} // namespace openspace + +#endif // __KAMELEONMODULE_H__ diff --git a/src/util/kameleonwrapper.cpp b/modules/kameleon/src/kameleonwrapper.cpp similarity index 99% rename from src/util/kameleonwrapper.cpp rename to modules/kameleon/src/kameleonwrapper.cpp index 3c2c5e3a8f..1ebdf0c3a2 100644 --- a/src/util/kameleonwrapper.cpp +++ b/modules/kameleon/src/kameleonwrapper.cpp @@ -22,7 +22,7 @@ * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * ****************************************************************************************/ -#include +#include #include #include diff --git a/modules/volume/include.cmake b/modules/volume/include.cmake index ffea0ac430..3751826997 100644 --- a/modules/volume/include.cmake +++ b/modules/volume/include.cmake @@ -1 +1,3 @@ -set(DEFAULT_MODULE ON) +set (OPENSPACE_DEPENDENCIES + kameleon +) \ No newline at end of file diff --git a/modules/volume/rendering/renderablevolume.cpp b/modules/volume/rendering/renderablevolume.cpp index 4afdd65974..e9f1d2e60a 100644 --- a/modules/volume/rendering/renderablevolume.cpp +++ b/modules/volume/rendering/renderablevolume.cpp @@ -25,7 +25,7 @@ // open space includes #include #include -#include +#include #include #include diff --git a/modules/volume/rendering/renderablevolumegl.cpp b/modules/volume/rendering/renderablevolumegl.cpp index a3fddd75fa..7c45905eb5 100644 --- a/modules/volume/rendering/renderablevolumegl.cpp +++ b/modules/volume/rendering/renderablevolumegl.cpp @@ -28,7 +28,7 @@ #include #include #include -#include +#include #include #include diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index bddf3e7753..2c1f8518cb 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -71,7 +71,6 @@ set(OPENSPACE_SOURCE ${OPENSPACE_BASE_DIR}/src/scripting/scriptengine_lua.inl ${OPENSPACE_BASE_DIR}/src/util/camera.cpp ${OPENSPACE_BASE_DIR}/src/util/factorymanager.cpp - ${OPENSPACE_BASE_DIR}/src/util/kameleonwrapper.cpp ${OPENSPACE_BASE_DIR}/src/util/openspacemodule.cpp ${OPENSPACE_BASE_DIR}/src/util/powerscaledcoordinate.cpp ${OPENSPACE_BASE_DIR}/src/util/powerscaledscalar.cpp @@ -142,7 +141,6 @@ set(OPENSPACE_HEADER ${OPENSPACE_BASE_DIR}/include/openspace/util/constants.h ${OPENSPACE_BASE_DIR}/include/openspace/util/factorymanager.h ${OPENSPACE_BASE_DIR}/include/openspace/util/factorymanager.inl - ${OPENSPACE_BASE_DIR}/include/openspace/util/kameleonwrapper.h ${OPENSPACE_BASE_DIR}/include/openspace/util/keys.h ${OPENSPACE_BASE_DIR}/include/openspace/util/openspacemodule.h ${OPENSPACE_BASE_DIR}/include/openspace/util/powerscaledcoordinate.h diff --git a/src/rendering/renderengine.cpp b/src/rendering/renderengine.cpp index 764dee30f4..60bcc157c4 100644 --- a/src/rendering/renderengine.cpp +++ b/src/rendering/renderengine.cpp @@ -419,7 +419,6 @@ void RenderEngine::render(const glm::mat4 &projectionMatrix, const glm::mat4 &vi //const PowerScaledScalar& pssl = (position - origin).length(); // Next 2 lines neccesary for instrument switching to work. - //double currentTime = Time::ref().currentTime(); // GUI PRINT // Using a macro to shorten line length and increase readability @@ -441,6 +440,7 @@ void RenderEngine::render(const glm::mat4 &projectionMatrix, const glm::mat4 &vi //PrintText(i++, "Scaling: (% .5f, % .5f)", scaling[0], scaling[1]); #ifdef OPENSPACE_MODULE_NEWHORIZONS_ENABLED + double currentTime = Time::ref().currentTime(); if (openspace::ImageSequencer2::ref().isReady()) { double remaining = openspace::ImageSequencer2::ref().getNextCaptureTime() - currentTime; double t = 1.0 - remaining / openspace::ImageSequencer2::ref().getIntervalLength(); diff --git a/support/cmake/support_macros.cmake b/support/cmake/support_macros.cmake index 6a26c38801..73219f13da 100644 --- a/support/cmake/support_macros.cmake +++ b/support/cmake/support_macros.cmake @@ -172,40 +172,6 @@ function (add_external_dependencies) target_include_directories(libOpenSpace SYSTEM PUBLIC ${SPICE_INCLUDE_DIRS}) target_link_libraries(libOpenSpace ${SPICE_LIBRARIES}) - # # Kameleon - option(KAMELEON_LIBRARY_ONLY "Build with Kameleon as library only" ON) - if (WIN32) - option(BUILD_SHARED_LIBS "Build Shared Libraries" OFF) - else () - option(BUILD_SHARED_LIBS "Build Shared Libraries" ON) - endif () - mark_as_advanced(BUILD_SHARED_LIBS) # Change to set instead of option - option(KAMELEON_USE_HDF5 "Kameleon use HDF5" OFF) - set(KAMELEON_ROOT_DIR ${OPENSPACE_EXT_DIR}/kameleon) - set(KAMELEON_INCLUDES ${KAMELEON_ROOT_DIR}/src) - set(BOOST_ROOT "${OPENSPACE_EXT_DIR}/ghoul/ext/boost") - add_subdirectory(${KAMELEON_ROOT_DIR}) - target_include_directories(libOpenSpace SYSTEM PUBLIC ${KAMELEON_INCLUDES}) - target_link_libraries(libOpenSpace ccmc) - if (OPENSPACE_DISABLE_EXTERNAL_WARNINGS) - if (MSVC) - target_compile_options(ccmc PUBLIC "/W0" "/MP") - else () - target_compile_options(ccmc PUBLIC "-w") - endif () - target_compile_definitions(ccmc PUBLIC "_SCL_SECURE_NO_WARNINGS") - endif () - set_property(TARGET ccmc PROPERTY FOLDER "External") - if (TARGET cdf) - if (OPENSPACE_DISABLE_EXTERNAL_WARNINGS) - if (MSVC) - target_compile_options(cdf PUBLIC "/W0" "/MP") - else () - target_compile_options(cdf PUBLIC "-w") - endif () - endif () - set_property(TARGET cdf PROPERTY FOLDER "External") - endif () endfunction () @@ -331,6 +297,8 @@ function (handle_internal_modules) set(MODULE_HEADERS "") set(MODULE_CLASSES "") + message(STATUS ${sortedModules}) + # Add subdirectories in the correct order foreach (module ${sortedModules}) create_option_name(${module} optionName)