From addfa65fa66cf33ff55ee32aa7f2d620dfe62798 Mon Sep 17 00:00:00 2001 From: GPayne Date: Wed, 19 Feb 2020 09:25:33 -0700 Subject: [PATCH] Merge with latest master --- CMakeLists.txt | 38 +- LICENSE.md | 2 +- apps/OpenSpace-MinVR/main.cpp | 2 +- apps/OpenSpace/CMakeLists.txt | 6 +- apps/Sync/main.cpp | 2 +- apps/TaskRunner/main.cpp | 2 +- apps/TimelineView/CMakeLists.txt | 63 --- apps/TimelineView/common.h | 37 -- apps/TimelineView/configurationwidget.cpp | 86 ---- apps/TimelineView/configurationwidget.h | 53 --- apps/TimelineView/controlwidget.cpp | 319 -------------- apps/TimelineView/controlwidget.h | 69 --- apps/TimelineView/informationwidget.cpp | 50 --- apps/TimelineView/informationwidget.h | 41 -- apps/TimelineView/main.cpp | 160 ------- apps/TimelineView/mainwindow.cpp | 398 ------------------ apps/TimelineView/mainwindow.h | 74 ---- apps/TimelineView/timelinewidget.cpp | 304 ------------- apps/TimelineView/timelinewidget.h | 72 ---- data/assets/base.asset | 7 +- .../messenger/mercurymagnetosphere.asset | 2 +- .../moon/map_service_configs/LiU/Kaguya.vrt | 28 ++ .../moon/map_service_configs/Utah/Kaguya.vrt | 28 ++ .../solarsystem/planets/earth/moon/moon.asset | 12 +- .../planets/earth/moon/trail.asset | 3 +- .../Utah/MagellanMosaic.vrt | 28 ++ .../solarsystem/planets/venus/venus.asset | 10 +- data/assets/util/webgui.asset | 2 +- ext/ghoul | 2 +- .../openspace/interaction/keybindingmanager.h | 1 - .../openspace/interaction/navigationhandler.h | 1 + .../interaction/sessionrecording.inl | 12 +- include/openspace/interaction/touchbar.h | 2 +- .../atmosphere/shaders/atmosphere_common.glsl | 6 +- .../shaders/atmosphere_deferred_fs.glsl | 27 +- .../atmosphere/shaders/deltaJ_calc_fs.glsl | 3 +- .../shaders/inScattering_calc_fs.glsl | 3 +- .../shaders/irradiance_sup_calc_fs.glsl | 3 +- .../shaders/transmittance_calc_fs.glsl | 3 +- .../rendering/renderableplaneimagelocal.cpp | 3 +- modules/base/rendering/renderablesphere.cpp | 6 +- modules/base/rotation/staticrotation.cpp | 6 +- .../shaders/renderabletrail_apple_fs.glsl | 2 +- .../shaders/renderabletrail_apple_vs.glsl | 2 +- modules/base/shaders/renderabletrail_fs.glsl | 3 +- modules/base/timeframe/timeframeinterval.cpp | 3 +- modules/cefwebgui/cefwebguimodule.cpp | 6 +- modules/cefwebgui/shaders/gui_fs.glsl | 2 +- modules/cefwebgui/shaders/gui_vs.glsl | 2 +- .../rendering/renderablebillboardscloud.cpp | 3 +- .../rendering/renderabledumeshes.cpp | 3 +- .../digitaluniverse/shaders/billboard_gs.glsl | 21 +- .../digitaluniverse/shaders/points_fs.glsl | 3 +- .../renderablefieldlinessequence.cpp | 9 +- .../shaders/fieldlinessequence_vs.glsl | 6 +- modules/fieldlinessequence/util/commons.cpp | 6 +- .../util/kameleonfieldlinehelper.cpp | 15 +- modules/gaia/shaders/gaia_billboard_ge.glsl | 6 +- modules/gaia/shaders/gaia_point_ge.glsl | 4 +- modules/gaia/shaders/gaia_ssbo_vs.glsl | 3 +- .../shaders/gaia_tonemapping_point_fs.glsl | 3 +- modules/gaia/shaders/gaia_vbo_vs.glsl | 3 +- modules/galaxy/shaders/galaxyraycast.glsl | 2 +- .../galaxy/shaders/raycasterbounds_fs.glsl | 4 +- modules/globebrowsing/shaders/blending.hglsl | 6 +- .../globebrowsing/shaders/smviewer_fs.glsl | 2 +- .../globebrowsing/shaders/smviewer_vs.glsl | 2 +- modules/globebrowsing/src/lrucache.inl | 3 +- modules/globebrowsing/src/renderableglobe.cpp | 2 +- modules/imgui/src/guiassetcomponent.cpp | 3 +- modules/imgui/src/guiiswacomponent.cpp | 16 +- modules/imgui/src/guiparallelcomponent.cpp | 3 +- modules/iswa/rendering/datacygnet.cpp | 9 +- modules/iswa/rendering/dataplane.cpp | 8 +- modules/iswa/rendering/datasphere.cpp | 6 +- modules/iswa/rendering/iswacygnet.cpp | 3 +- modules/iswa/rendering/iswadatagroup.cpp | 9 +- modules/iswa/rendering/iswakameleongroup.cpp | 3 +- modules/iswa/rendering/kameleonplane.cpp | 15 +- modules/iswa/rendering/texturecygnet.cpp | 6 +- modules/iswa/shaders/dataplane_fs.glsl | 3 +- modules/iswa/shaders/datasphere_fs.glsl | 2 +- modules/iswa/shaders/datasphere_vs.glsl | 2 +- modules/iswa/util/dataprocessor.cpp | 6 +- modules/iswa/util/iswamanager.cpp | 50 ++- modules/iswa/util/iswamanager_lua.inl | 12 +- modules/kameleon/src/kameleonhelper.cpp | 21 +- modules/kameleon/src/kameleonwrapper.cpp | 57 ++- .../kameleonvolume/kameleonvolumereader.cpp | 12 +- .../rendering/renderablekameleonvolume.cpp | 6 +- .../rendering/brickselection.cpp | 3 +- .../rendering/errorhistogrammanager.cpp | 6 +- .../rendering/histogrammanager.cpp | 6 +- .../rendering/localerrorhistogrammanager.cpp | 30 +- .../rendering/localtfbrickselector.cpp | 39 +- .../rendering/renderablemultiresvolume.cpp | 30 +- .../rendering/shenbrickselector.cpp | 21 +- .../rendering/simpletfbrickselector.cpp | 30 +- .../rendering/tfbrickselector.cpp | 36 +- modules/multiresvolume/rendering/tsp.cpp | 3 +- modules/multiresvolume/shaders/boundsFs.glsl | 2 +- modules/multiresvolume/shaders/boundsVs.glsl | 2 +- modules/multiresvolume/shaders/helper.glsl | 2 +- modules/multiresvolume/shaders/raycast.glsl | 2 +- modules/server/src/connection.cpp | 6 +- modules/server/src/serverinterface.cpp | 3 +- .../server/src/topics/authorizationtopic.cpp | 6 +- .../server/src/topics/documentationtopic.cpp | 6 +- .../server/src/topics/setpropertytopic.cpp | 15 +- modules/server/src/topics/shortcuttopic.cpp | 3 +- .../space/rendering/renderablesmallbody.cpp | 46 +- modules/space/rendering/renderablestars.cpp | 50 ++- modules/space/rendering/renderablestars.h | 16 +- modules/space/shaders/convolution_fs.glsl | 2 +- modules/space/shaders/convolution_vs.glsl | 2 +- modules/space/shaders/debrisViz_fs.glsl | 7 +- modules/space/shaders/debrisViz_vs.glsl | 2 +- modules/space/shaders/psfToTexture_fs.glsl | 2 +- modules/space/shaders/psfToTexture_vs.glsl | 2 +- modules/space/shaders/star_fs.glsl | 24 +- .../space/tasks/generatedebrisvolumetask.cpp | 2 +- .../space/tasks/generatedebrisvolumetask.h | 10 +- modules/space/translation/tletranslation.cpp | 6 +- .../rendering/renderableplanetprojection.cpp | 6 +- .../shaders/dilation_fs.glsl | 2 +- .../shaders/dilation_vs.glsl | 2 +- .../shaders/renderableModelDepth_fs.glsl | 2 +- .../shaders/renderableModelDepth_vs.glsl | 2 +- .../renderablePlanetProjection_fs.glsl | 4 +- .../shaders/terminatorshadow_vs.glsl | 3 +- .../util/instrumentdecoder.cpp | 3 +- modules/sync/syncmodule.cpp | 3 +- modules/sync/syncs/urlsynchronization.cpp | 15 +- modules/touch/ext/CMakeLists.txt | 8 +- modules/touch/src/win32_touch.cpp | 5 +- modules/toyvolume/shaders/boundsfs.glsl | 2 +- modules/toyvolume/shaders/boundsvs.glsl | 2 +- modules/toyvolume/shaders/raycast.glsl | 2 +- .../rendering/renderabletimevaryingvolume.cpp | 6 +- modules/volume/shaders/boundsfs.glsl | 2 +- modules/volume/shaders/boundsvs.glsl | 2 +- modules/volume/shaders/helper.glsl | 2 +- modules/volume/shaders/raycast.glsl | 2 +- modules/volume/volumesampler.inl | 9 +- modules/webbrowser/CMakeLists.txt | 11 +- .../cmake/patch/cmake/cef_variables.cmake | 2 +- .../webbrowser/shaders/screenspace_fs.glsl | 2 +- .../webbrowser/shaders/screenspace_vs.glsl | 2 +- modules/webbrowser/src/processhelpermac.cpp | 2 +- modules/webbrowser/src/webrenderhandler.cpp | 6 +- modules/webbrowser/webbrowsermodule.cpp | 6 +- modules/webgui/webguimodule.cpp | 3 +- shaders/PowerScaling/powerScalingMath.hglsl | 2 +- shaders/PowerScaling/powerScaling_fs.hglsl | 2 +- shaders/PowerScaling/powerScaling_vs.hglsl | 2 +- shaders/abuffer/abufferfragment.glsl | 2 +- shaders/abuffer/abufferresources.glsl | 2 +- shaders/abuffer/boundsabuffer.frag | 2 +- shaders/abuffer/raycasterdata.glsl | 2 +- shaders/abuffer/renderabuffer.frag | 2 +- shaders/abuffer/renderabuffer.vert | 2 +- shaders/abuffer/resolveabuffer.frag | 2 +- shaders/abuffer/resolveabuffer.vert | 2 +- shaders/abuffer/resolvehelpers.glsl | 2 +- shaders/blending.glsl | 2 +- shaders/floatoperations.glsl | 2 +- shaders/fragment.glsl | 2 +- shaders/framebuffer/exitframebuffer.frag | 2 +- shaders/framebuffer/fxaa.frag | 2 +- shaders/framebuffer/fxaa.vert | 2 +- shaders/framebuffer/hdrAndFiltering.frag | 2 +- shaders/framebuffer/hdrAndFiltering.vert | 2 +- shaders/framebuffer/inside.glsl | 2 +- .../framebuffer/mergeDownscaledVolume.frag | 2 +- .../framebuffer/mergeDownscaledVolume.vert | 2 +- shaders/framebuffer/nOneStripMSAA.frag | 4 +- shaders/framebuffer/nOneStripMSAA.vert | 2 +- shaders/framebuffer/outside.glsl | 2 +- shaders/framebuffer/raycastframebuffer.frag | 2 +- shaders/framebuffer/renderframebuffer.frag | 2 +- shaders/framebuffer/resolveframebuffer.vert | 2 +- shaders/hdr.glsl | 2 +- shaders/rand.glsl | 2 +- src/documentation/documentationengine.cpp | 3 +- src/engine/downloadmanager.cpp | 9 +- src/engine/openspaceengine.cpp | 9 +- src/interaction/navigationhandler.cpp | 28 +- src/interaction/sessionrecording.cpp | 15 +- src/interaction/touchbar.mm | 2 +- src/network/parallelpeer.cpp | 3 +- src/network/parallelserver.cpp | 3 +- src/openspace.cpp | 2 +- src/properties/matrix/dmat4x3property.cpp | 3 +- src/properties/matrix/mat2property.cpp | 3 +- src/properties/matrix/mat3property.cpp | 3 +- src/properties/matrix/mat3x2property.cpp | 5 +- src/properties/matrix/mat3x4property.cpp | 3 +- src/properties/matrix/mat4property.cpp | 3 +- src/properties/matrix/mat4x2property.cpp | 3 +- src/properties/matrix/mat4x3property.cpp | 3 +- src/properties/propertyowner.cpp | 12 +- src/rendering/abufferrenderer.cpp | 3 +- src/rendering/framebufferrenderer.cpp | 176 +++++++- src/rendering/luaconsole.cpp | 3 +- src/rendering/renderable.cpp | 3 +- src/rendering/screenspacerenderable.cpp | 3 +- src/rendering/transferfunction.cpp | 15 +- src/scene/assetloader.cpp | 6 +- src/scene/scene.cpp | 4 +- src/scene/scene_lua.inl | 1 - src/scene/scenegraphnode.cpp | 3 +- src/scene/scenelicensewriter.cpp | 3 +- src/scripting/scriptengine.cpp | 9 +- src/scripting/scriptengine_lua.inl | 9 +- src/util/camera.cpp | 16 +- src/util/histogram.cpp | 6 +- src/util/httprequest.cpp | 9 +- src/util/taskloader.cpp | 3 +- src/util/time_lua.inl | 18 +- src/util/timemanager.cpp | 9 +- src/util/touch.cpp | 2 +- src/util/transformationmanager.cpp | 6 +- src/util/versionchecker.cpp | 3 +- support/cmake/openspace_header.template | 2 +- .../set_openspace_compile_settings.cmake | 23 +- support/coding/check_style_guide.py | 4 +- support/coding/convert_tabs.py | 2 +- support/coding/count_includes.py | 2 +- support/coding/new_files.py | 6 +- support/coding/remove_byte_order_mark.py | 2 +- 230 files changed, 1151 insertions(+), 2270 deletions(-) delete mode 100644 apps/TimelineView/CMakeLists.txt delete mode 100644 apps/TimelineView/common.h delete mode 100644 apps/TimelineView/configurationwidget.cpp delete mode 100644 apps/TimelineView/configurationwidget.h delete mode 100644 apps/TimelineView/controlwidget.cpp delete mode 100644 apps/TimelineView/controlwidget.h delete mode 100644 apps/TimelineView/informationwidget.cpp delete mode 100644 apps/TimelineView/informationwidget.h delete mode 100644 apps/TimelineView/main.cpp delete mode 100644 apps/TimelineView/mainwindow.cpp delete mode 100644 apps/TimelineView/mainwindow.h delete mode 100644 apps/TimelineView/timelinewidget.cpp delete mode 100644 apps/TimelineView/timelinewidget.h create mode 100644 data/assets/scene/solarsystem/planets/earth/moon/map_service_configs/LiU/Kaguya.vrt create mode 100644 data/assets/scene/solarsystem/planets/earth/moon/map_service_configs/Utah/Kaguya.vrt create mode 100644 data/assets/scene/solarsystem/planets/venus/map_service_configs/Utah/MagellanMosaic.vrt diff --git a/CMakeLists.txt b/CMakeLists.txt index 215dfa5b16..ee78a175b4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -28,7 +28,7 @@ project(OpenSpace) set(OPENSPACE_VERSION_MAJOR 0) set(OPENSPACE_VERSION_MINOR 15) -set(OPENSPACE_VERSION_PATCH 0) +set(OPENSPACE_VERSION_PATCH 1) set(OPENSPACE_VERSION_STRING "Beta-5") @@ -50,7 +50,7 @@ message(STATUS "CMake version: ${CMAKE_VERSION}") # Bail out if the user tries to generate a 32 bit project. if (NOT ${CMAKE_SIZEOF_VOID_P} EQUAL 8) message(FATAL_ERROR "OpenSpace can only be generated for 64 bit architectures.") -endif() +endif () ########################################################################################## # Cleanup project # @@ -63,7 +63,7 @@ if (NOT EXISTS ${OPENSPACE_EXT_DIR}/ghoul/CMakeLists.txt) "git submodule update --init --recursive \n" "to download the missing dependencies." ) -endif() +endif () set_property(GLOBAL PROPERTY USE_FOLDERS On) set_property(GLOBAL PROPERTY PREDEFINED_TARGETS_FOLDER CMake) @@ -106,10 +106,34 @@ if (NOT OPENSPACE_GIT_STATUS_RETURN EQUAL 0) set(OPENSPACE_GIT_STATUS "uncommitted changes") else() set(OPENSPACE_GIT_STATUS "") -endif() +endif () option(OPENSPACE_WARNINGS_AS_ERRORS "Treat warnings as errors" OFF) +if (MSVC) + option(OPENSPACE_OPTIMIZATION_ENABLE_AVX "Enable AVX instruction set for compilation" OFF) + option(OPENSPACE_OPTIMIZATION_ENABLE_AVX2 "Enable AVX2 instruction set for compilation" OFF) + option(OPENSPACE_OPTIMIZATION_ENABLE_AVX512 "Enable AVX2 instruction set for compilation" OFF) + option(OPENSPACE_OPTIMIZATION_ENABLE_OTHER_OPTIMIZATIONS "Enable other optimizations, like LTCG, intrinsics, etc") + + if (OPENSPACE_OPTIMIZATION_ENABLE_AVX AND OPENSPACE_OPTIMIZATION_ENABLE_AVX2) + message(FATAL_ERROR "Cannot enable AVX and AVX2 instructions simultaneously") + endif () + + if (OPENSPACE_OPTIMIZATION_ENABLE_AVX AND OPENSPACE_OPTIMIZATION_ENABLE_AVX512) + message(FATAL_ERROR "Cannot enable AVX and AVX512 instructions simultaneously") + endif () + + if (OPENSPACE_OPTIMIZATION_ENABLE_AVX2 AND OPENSPACE_OPTIMIZATION_ENABLE_AVX512) + message(FATAL_ERROR "Cannot enable AVX2 and AVX512 instructions simultaneously") + endif () + + set(GHOUL_OPTIMIZATION_ENABLE_AVX ${OPENSPACE_OPTIMIZATION_ENABLE_AVX} CACHE BOOL "" FORCE) + set(GHOUL_OPTIMIZATION_ENABLE_AVX2 ${OPENSPACE_OPTIMIZATION_ENABLE_AVX2} CACHE BOOL "" FORCE) + set(GHOUL_OPTIMIZATION_ENABLE_AVX512 ${OPENSPACE_OPTIMIZATION_ENABLE_AVX512} CACHE BOOL "" FORCE) + set(GHOUL_OPTIMIZATION_ENABLE_OTHER_OPTIMIZATIONS ${OPENSPACE_OPTIMIZATION_ENABLE_OTHER_OPTIMIZATIONS} CACHE BOOL "" FORCE) +endif () + include(src/CMakeLists.txt) ########################################################################################## @@ -127,11 +151,12 @@ if (APPLE) target_link_libraries(openspace-core ${CARBON_LIBRARY} ${COREFOUNDATION_LIBRARY} ${COCOA_LIBRARY} ${APP_SERVICES_LIBRARY}) end_dependency() -endif() +endif () # Ghoul add_subdirectory(${OPENSPACE_EXT_DIR}/ghoul) target_link_libraries(openspace-core Ghoul) +set_openspace_compile_settings(Ghoul) set_folder_location(Lua "External") set_folder_location(lz4 "External") set_folder_location(GhoulTest "Unit Tests") @@ -158,7 +183,7 @@ else () target_link_libraries(openspace-core ${CURL_LIBRARIES}) target_compile_definitions(openspace-core PUBLIC "OPENSPACE_CURL_ENABLED") endif () -endif() +endif () end_dependency() # Qt @@ -204,7 +229,6 @@ if (MSVC) target_include_directories(openspace-core PUBLIC "${OPENSPACE_NVTOOLS_PATH}/include") end_dependency() endif () - endif () begin_header("Configuring Modules") diff --git a/LICENSE.md b/LICENSE.md index 65a49a2e5b..4e0881c01c 100644 --- a/LICENSE.md +++ b/LICENSE.md @@ -1,4 +1,4 @@ -Copyright (c) 2014-2019 +Copyright (c) 2014-2020 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 diff --git a/apps/OpenSpace-MinVR/main.cpp b/apps/OpenSpace-MinVR/main.cpp index c2d857cc7c..cd1191434b 100644 --- a/apps/OpenSpace-MinVR/main.cpp +++ b/apps/OpenSpace-MinVR/main.cpp @@ -2,7 +2,7 @@ * * * OpenSpace * * * - * Copyright (c) 2014-2019 * + * Copyright (c) 2014-2020 * * * * 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 * diff --git a/apps/OpenSpace/CMakeLists.txt b/apps/OpenSpace/CMakeLists.txt index 9eb5283c01..267eb2c182 100644 --- a/apps/OpenSpace/CMakeLists.txt +++ b/apps/OpenSpace/CMakeLists.txt @@ -61,7 +61,7 @@ if (OPENSPACE_OPENVR_SUPPORT) ) endif () end_header("Dependency: OpenVR") -endif() +endif () ##### # Spout @@ -78,9 +78,9 @@ endif () ##### if (APPLE) set(MACOSX_BUNDLE_ICON_FILE openspace.icns) - set(CMAKE_OSX_DEPLOYMENT_TARGET "10.9" CACHE STRING "Minimum OS X deployment version" FORCE) + set(CMAKE_OSX_DEPLOYMENT_TARGET "10.14" CACHE STRING "Minimum OS X deployment version" FORCE) set(CMAKE_XCODE_ATTRIBUTE_OTHER_CODE_SIGN_FLAGS "--deep" CACHE STRING "Other Code Signing Flags" FORCE) -endif() +endif () create_new_application(OpenSpace ${SGCT_OPENVR_FILES} diff --git a/apps/Sync/main.cpp b/apps/Sync/main.cpp index 8661f900af..7ea54a745a 100644 --- a/apps/Sync/main.cpp +++ b/apps/Sync/main.cpp @@ -2,7 +2,7 @@ * * * OpenSpace * * * - * Copyright (c) 2014-2019 * + * Copyright (c) 2014-2020 * * * * 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 * diff --git a/apps/TaskRunner/main.cpp b/apps/TaskRunner/main.cpp index c7b89253c5..f41d8105ab 100644 --- a/apps/TaskRunner/main.cpp +++ b/apps/TaskRunner/main.cpp @@ -2,7 +2,7 @@ * * * OpenSpace * * * - * Copyright (c) 2014-2019 * + * Copyright (c) 2014-2020 * * * * 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 * diff --git a/apps/TimelineView/CMakeLists.txt b/apps/TimelineView/CMakeLists.txt deleted file mode 100644 index 38edbf98f5..0000000000 --- a/apps/TimelineView/CMakeLists.txt +++ /dev/null @@ -1,63 +0,0 @@ -########################################################################################## -# # -# OpenSpace # -# # -# Copyright (c) 2014-2020 # -# # -# 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}/application_definition.cmake) - -set(APPLICATION_NAME TimelineView) -set(APPLICATION_LINK_TO_OPENSPACE OFF) - -set(SOURCE_FILES - ${OPENSPACE_APPS_DIR}/TimelineView/main.cpp - ${OPENSPACE_APPS_DIR}/TimelineView/mainwindow.cpp - ${OPENSPACE_APPS_DIR}/TimelineView/configurationwidget.cpp - ${OPENSPACE_APPS_DIR}/TimelineView/informationwidget.cpp - ${OPENSPACE_APPS_DIR}/TimelineView/controlwidget.cpp - ${OPENSPACE_APPS_DIR}/TimelineView/timelinewidget.cpp -) - -set(HEADER_FILES - ${OPENSPACE_APPS_DIR}/TimelineView/mainwindow.h - ${OPENSPACE_APPS_DIR}/TimelineView/configurationwidget.h - ${OPENSPACE_APPS_DIR}/TimelineView/controlwidget.h - ${OPENSPACE_APPS_DIR}/TimelineView/informationwidget.h - ${OPENSPACE_APPS_DIR}/TimelineView/mainwindow.h - ${OPENSPACE_APPS_DIR}/TimelineView/timelinewidget.h -) - -find_package(Qt5Widgets) -find_package(Qt5Network) - -set(MOC_FILES "") -qt5_wrap_cpp(MOC_FILES ${HEADER_FILES}) - -create_new_application(${APPLICATION_NAME} MACOSX_BUNDLE ${SOURCE_FILES} ${HEADER_FILES} ${MOC_FILES}) - -target_link_libraries(${APPLICATION_NAME} Qt5::Widgets Qt5::Network) - -#if (APPLE) -# INSTALL(CODE " -# include(BundleUtilities) -# fixup_bundle(\"${application_path}/bin/openspace/Debug/Launcher.app/Contents/MacOS/Launcher\" \"${application_path}/bin/openspace/Debug/TimelineView.app/Contents/plugins/platforms/libqcocoa.dylib\" \"\") -# " COMPONENT Runtime) -#endif () diff --git a/apps/TimelineView/common.h b/apps/TimelineView/common.h deleted file mode 100644 index e10eb25822..0000000000 --- a/apps/TimelineView/common.h +++ /dev/null @@ -1,37 +0,0 @@ -/***************************************************************************************** - * * - * OpenSpace * - * * - * Copyright (c) 2014-2019 * - * * - * 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 __OPENSPACE_APP_TIMELINEVIEW___COMMON___H__ -#define __OPENSPACE_APP_TIMELINEVIEW___COMMON___H__ - -struct Image { - double beginning; - double ending; - std::string beginningString; - std::string endingString; - std::string target; - std::vector instruments; -}; - -#endif // __OPENSPACE_APP_TIMELINEVIEW___COMMON___H__ diff --git a/apps/TimelineView/configurationwidget.cpp b/apps/TimelineView/configurationwidget.cpp deleted file mode 100644 index d7833c6125..0000000000 --- a/apps/TimelineView/configurationwidget.cpp +++ /dev/null @@ -1,86 +0,0 @@ -/***************************************************************************************** - * * - * OpenSpace * - * * - * Copyright (c) 2014-2019 * - * * - * 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 "configurationwidget.h" - -#include -#include -#include -#include - -ConfigurationWidget::ConfigurationWidget(QWidget* parent) - : QWidget(parent) - , _ipAddress(new QLineEdit("localhost")) - , _port(new QLineEdit("20500")) - , _connect(new QPushButton("Connect")) -{ - _connect->setObjectName("connection"); - QGroupBox* box = new QGroupBox("Connection", this); - - QGridLayout* layout = new QGridLayout; - layout->setVerticalSpacing(0); - { - QLabel* t = new QLabel("IP Address"); - t->setObjectName("label"); - layout->addWidget(t, 0, 0); - } - layout->addWidget(_ipAddress, 1, 0); - - { - QLabel* t = new QLabel("Port"); - t->setObjectName("label"); - layout->addWidget(t, 0, 1); - } - layout->addWidget(_port, 1, 1); - layout->addWidget(_connect, 1, 2, 1, 1); - - box->setLayout(layout); - - QHBoxLayout* l = new QHBoxLayout; - l->addWidget(box); - setLayout(l); - QObject::connect(_connect, SIGNAL(clicked()), this, SLOT(onConnectButton())); - - QTimer::singleShot(100, this, SLOT(onConnectButton())); -} - -void ConfigurationWidget::onConnectButton() { - emit connect(_ipAddress->text(), _port->text()); -} - -void ConfigurationWidget::socketConnected() { - _ipAddress->setEnabled(false); - _port->setEnabled(false); - _connect->setText("Disconnect"); - QObject::disconnect(_connect, SIGNAL(clicked()), this, SLOT(onConnectButton())); - QObject::connect(_connect, SIGNAL(clicked()), this, SIGNAL(disconnect())); -} - -void ConfigurationWidget::socketDisconnected() { - _ipAddress->setEnabled(true); - _port->setEnabled(true); - _connect->setText("Connect"); - QObject::disconnect(_connect, SIGNAL(clicked()), this, SIGNAL(disconnect())); - QObject::connect(_connect, SIGNAL(clicked()), this, SLOT(onConnectButton())); -} diff --git a/apps/TimelineView/configurationwidget.h b/apps/TimelineView/configurationwidget.h deleted file mode 100644 index 23e3600daa..0000000000 --- a/apps/TimelineView/configurationwidget.h +++ /dev/null @@ -1,53 +0,0 @@ -/***************************************************************************************** - * * - * OpenSpace * - * * - * Copyright (c) 2014-2019 * - * * - * 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 __OPENSPACE_APP_TIMELINEVIEW___CONFIGURATIONWIDGET___H__ -#define __OPENSPACE_APP_TIMELINEVIEW___CONFIGURATIONWIDGET___H__ - -#include -#include -#include - -class ConfigurationWidget : public QWidget { -Q_OBJECT -public: - ConfigurationWidget(QWidget* parent); - - void socketConnected(); - void socketDisconnected(); - -signals: - void connect(QString host, QString port); - void disconnect(); - -private slots: - void onConnectButton(); - -private: - QLineEdit* _ipAddress; - QLineEdit* _port; - QPushButton* _connect; -}; - -#endif // __OPENSPACE_APP_TIMELINEVIEW___CONFIGURATIONWIDGET___H__ diff --git a/apps/TimelineView/controlwidget.cpp b/apps/TimelineView/controlwidget.cpp deleted file mode 100644 index 29125e8752..0000000000 --- a/apps/TimelineView/controlwidget.cpp +++ /dev/null @@ -1,319 +0,0 @@ -/***************************************************************************************** - * * - * OpenSpace * - * * - * Copyright (c) 2014-2019 * - * * - * 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 "controlwidget.h" - -#include "mainwindow.h" - -#include -#include -#include -#include -#include -#include -#include - -#include - -namespace { - struct ImportantDate { - QString date; - QString focus; - QString coordinateSystem; - }; - - const ImportantDate ImportantDates[] = { - { "", "", "" }, - { "2007-02-27T16:40:00.00", "JupiterProjection", "Jupiter" }, - { "2015-07-14T10:10:00.00", "PlutoProjection", "Pluto" }, - { "2015-07-14T10:50:00.00", "PlutoProjection", "Pluto" }, - { "2015-07-14T11:22:00.00", "PlutoProjection", "Pluto" }, - { "2015-07-14T11:36:40.00", "PlutoProjection", "Pluto" }, - { "2015-07-14T11:48:43.00", "PlutoProjection", "Pluto" }, - { "2015-07-14T12:04:35.00", "PlutoProjection", "Pluto" }, - { "2015-07-14T15:02:46.00", "PlutoProjection", "Pluto" } - }; - - struct FocusNode { - QString guiName; - QString name; - QString coordinateSystem; - }; - const FocusNode FocusNodes[] = { - { "Earth", "Earth", "Sun" }, - { "Sun", "Sun", "Sun" }, - { "Pluto", "PlutoProjection", "Pluto" }, - { "Charon", "Charon", "Pluto" }, - { "Jupiter", "JupiterProjection", "Jupiter" }, - { "Nix", "Nix", "Pluto" }, - { "Kerberos", "Kerberos", "Pluto" }, - { "Hydra", "Hydra", "Pluto" }, - }; -} - -ControlWidget::ControlWidget(QWidget* parent) - : QWidget(parent) - , _currentTime(new QLabel("")) - , _setTime(new QComboBox) - , _currentDelta(new QLabel("")) - , _setDelta(new QSlider(Qt::Horizontal)) - , _pause(new QPushButton("Pause")) - , _play(new QPushButton("Play")) - , _focusNode(new QComboBox) - , _setFocusToNextTarget(new QPushButton("Set Focus to the next Target")) - , _setFocusToNewHorizons(new QPushButton("Set Focus to New Horizons")) -{ - _pause->setObjectName("pause"); - _play->setObjectName("play"); - - _currentTime->setObjectName("value"); - _currentDelta->setObjectName("value"); - - for (const ImportantDate& d : ImportantDates) - _setTime->addItem(d.date); - QObject::connect( - _setTime, - SIGNAL(currentIndexChanged(int)), - this, - SLOT(onDateChange()) - ); - - for (const FocusNode& f : FocusNodes) - _focusNode->addItem(f.guiName); - QObject::connect( - _focusNode, - SIGNAL(currentIndexChanged(int)), - this, - SLOT(onFocusChange()) - ); - - _setDelta->setMinimum(-100); - _setDelta->setMaximum(100); - _setDelta->setValue(0); - QObject::connect( - _setDelta, - SIGNAL(valueChanged(int)), - this, - SLOT(onValueChange()) - ); - - QObject::connect( - _pause, - SIGNAL(clicked()), - this, - SLOT(onPauseButton()) - ); - - QObject::connect( - _play, - SIGNAL(clicked()), - this, - SLOT(onPlayButton()) - ); - - QObject::connect( - _setFocusToNextTarget, - SIGNAL(clicked()), - this, - SLOT(onFocusToTargetButton()) - ); - - QObject::connect( - _setFocusToNewHorizons, - SIGNAL(clicked()), - this, - SLOT(onFocusToNewHorizonsButton()) -); - - QVBoxLayout* mainLayout = new QVBoxLayout; - - { - QGroupBox* box = new QGroupBox("Time", this); - QGridLayout* layout = new QGridLayout; - - //layout->setRowStretch(1, 5); - box->setLayout(layout); - - { - QLabel* l = new QLabel("Current Time (UTC):"); - l->setObjectName("label"); - layout->addWidget(l, 0, 0, Qt::AlignLeft); - layout->addWidget(_currentTime, 0, 1, Qt::AlignRight); - } - { - QLabel* l = new QLabel("Bookmarked Times:"); - l->setObjectName("label"); - layout->addWidget(l, 1, 0, Qt::AlignLeft); - layout->addWidget(_setTime, 1, 1, Qt::AlignRight); - } - layout->addItem(new QSpacerItem(0, 7), 2, 0, 1, 2); - { - QLabel* l = new QLabel("Current Time Increment\n(seconds per second):"); - l->setObjectName("label"); - layout->addWidget(l, 3, 0, Qt::AlignLeft); - layout->addWidget(_currentDelta, 3, 1, Qt::AlignRight); - } - - _setDelta->setObjectName("background"); - layout->addWidget(_setDelta, 4, 0, 1, 2); - - QWidget* controlContainer = new QWidget; - controlContainer->setObjectName("background"); - QHBoxLayout* controlContainerLayout = new QHBoxLayout; - controlContainerLayout->addWidget(_pause); - controlContainerLayout->addWidget(_play); - controlContainer->setLayout(controlContainerLayout); - layout->addWidget(controlContainer, 5, 0, 1, 2); - - mainLayout->addWidget(box); - } - - { - QGroupBox* box = new QGroupBox("Focus"); - QGridLayout* layout = new QGridLayout; - box->setLayout(layout); - - { - QLabel* l = new QLabel("Set Focus:"); - l->setObjectName("label"); - layout->addWidget(l, 0, 0, Qt::AlignLeft); - _focusNode->setMinimumWidth(200); - layout->addWidget(_focusNode, 0, 1, Qt::AlignRight); - } - layout->addWidget(_setFocusToNextTarget, 1, 0, 1, 2); - layout->addWidget(_setFocusToNewHorizons, 2, 0, 1, 2); - - mainLayout->addWidget(box); - } - - setLayout(mainLayout); -} - -void ControlWidget::update(QString currentTime, QString currentDelta) { - currentTime.replace("T", " "); - _currentTime->setText(currentTime); - _currentDelta->setText(currentDelta); -} - -void ControlWidget::onValueChange() { - float value = static_cast(_setDelta->value()); - - float delta; - if (value < 0.f) { - value = -value; - float d = pow(3, value / 10) - 1.f; - delta = -d; - } - else { - float d = pow(3, value / 10) - 1.f; - delta = d; - } - - QString script = "openspace.time.setDeltaTime(" + QString::number(delta) + ");"; - emit scriptActivity(script); -} - -void ControlWidget::onPauseButton() { - QString script = "openspace.time.setPause(true);"; - emit scriptActivity(script); -} - -void ControlWidget::onPlayButton() { - QString script = "openspace.time.setPause(false);"; - emit scriptActivity(script); -} - -void ControlWidget::onDateChange() { - int index = _setTime->currentIndex(); - if (index != 0) { - QString date = ImportantDates[index].date; - QString focus = ImportantDates[index].focus; - QString coordinateSystem = ImportantDates[index].coordinateSystem; - QString script = - "openspace.time.setTime('" + date + "');\ - openspace.setPropertyValue('Interaction.origin', '" + focus + "');\ - openspace.setPropertyValue('Interaction.coordinateSystem', '" + - coordinateSystem + "')"; - emit scriptActivity(script); - } - _setTime->blockSignals(true); - _setTime->setCurrentIndex(0); - _setTime->blockSignals(false); -} - -void ControlWidget::onFocusChange() { - int index = _focusNode->currentIndex(); - QString name = FocusNodes[index].name; - QString coordinateSystem = FocusNodes[index].coordinateSystem; - QString script = "openspace.setPropertyValue('Interaction.origin', '" + name + - "');openspace.setPropertyValue('Interaction.coordinateSystem', '" + - coordinateSystem + "');"; - emit scriptActivity(script); -} - -void ControlWidget::onFocusToTargetButton() { - std::string target = reinterpret_cast(parent())->nextTarget(); - if (!target.empty()) { - auto it = std::find_if( - std::begin(FocusNodes), - std::end(FocusNodes), - [target](const FocusNode& n) { - return n.guiName.toLower() == QString::fromStdString(target).toLower(); - }); - if (it != std::end(FocusNodes)) { - QString name = it->name; - QString coordinateSystem = it->coordinateSystem; - QString script = - "openspace.setPropertyValue('Interaction.origin', '" + name + - "');openspace.setPropertyValue('Interaction.coordinateSystem', '" + - coordinateSystem + "');"; - emit scriptActivity(script); - } - } -} - -void ControlWidget::onFocusToNewHorizonsButton() { - QString coordinateSystem; - int date = _currentTime->text().left(4).toInt(); - if (date < 2008) - coordinateSystem = "Jupiter"; - else if (date < 2014) - coordinateSystem = "Sun"; - else - coordinateSystem = "Pluto"; - - QString script = "openspace.setPropertyValue('Interaction.origin', 'NewHorizons');\ - openspace.setPropertyValue('Interaction.coordinateSystem', '" + coordinateSystem + - "');"; - emit scriptActivity(script); -} - -void ControlWidget::socketConnected() { - setDisabled(false); -} - -void ControlWidget::socketDisconnected() { - setDisabled(true); -} - diff --git a/apps/TimelineView/controlwidget.h b/apps/TimelineView/controlwidget.h deleted file mode 100644 index 7d0017a28b..0000000000 --- a/apps/TimelineView/controlwidget.h +++ /dev/null @@ -1,69 +0,0 @@ -/***************************************************************************************** - * * - * OpenSpace * - * * - * Copyright (c) 2014-2019 * - * * - * 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 __OPENSPACE_APP_TIMELINEVIEW___CONTROLWIDGET___H__ -#define __OPENSPACE_APP_TIMELINEVIEW___CONTROLWIDGET___H__ - -#include - -class QComboBox; -class QLabel; -class QPushButton; -class QSlider; - -class ControlWidget : public QWidget { -Q_OBJECT -public: - ControlWidget(QWidget* parent); - - void update(QString currentTime, QString currentDelta); - - void socketConnected(); - void socketDisconnected(); - -signals: - void scriptActivity(QString script); - -private slots: - void onValueChange(); - void onDateChange(); - void onFocusChange(); - void onPauseButton(); - void onPlayButton(); - void onFocusToTargetButton(); - void onFocusToNewHorizonsButton(); - -private: - QLabel* _currentTime; - QComboBox* _setTime; - QLabel* _currentDelta; - QSlider* _setDelta; - QPushButton* _pause; - QPushButton* _play; - QComboBox* _focusNode; - QPushButton* _setFocusToNextTarget; - QPushButton* _setFocusToNewHorizons; -}; - -#endif // __OPENSPACE_APP_TIMELINEVIEW___CONTROLWIDGET___H__ diff --git a/apps/TimelineView/informationwidget.cpp b/apps/TimelineView/informationwidget.cpp deleted file mode 100644 index f866ad1b28..0000000000 --- a/apps/TimelineView/informationwidget.cpp +++ /dev/null @@ -1,50 +0,0 @@ -/***************************************************************************************** - * * - * OpenSpace * - * * - * Copyright (c) 2014-2019 * - * * - * 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 "informationwidget.h" - -#include -#include - -InformationWidget::InformationWidget(QWidget* parent) - : QTextEdit(parent) -{ - setReadOnly(true); -} - -void InformationWidget::socketConnected() { - setDisabled(false); -} - -void InformationWidget::socketDisconnected() { - setDisabled(true); -} - -void InformationWidget::logInformation(QString text) { - QString currentText = toPlainText(); - - currentText += text + "\n"; - - setPlainText(currentText); -} diff --git a/apps/TimelineView/informationwidget.h b/apps/TimelineView/informationwidget.h deleted file mode 100644 index a19ee41fb8..0000000000 --- a/apps/TimelineView/informationwidget.h +++ /dev/null @@ -1,41 +0,0 @@ -/***************************************************************************************** - * * - * OpenSpace * - * * - * Copyright (c) 2014-2019 * - * * - * 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 __OPENSPACE_APP_TIMELINEVIEW___INFORMATIONWIDGET___H__ -#define __OPENSPACE_APP_TIMELINEVIEW___INFORMATIONWIDGET___H__ - -#include - -class InformationWidget : public QTextEdit { -Q_OBJECT -public: - InformationWidget(QWidget* parent); - void socketConnected(); - void socketDisconnected(); - -public slots: - void logInformation(QString text); -}; - -#endif // __OPENSPACE_APP_TIMELINEVIEW___INFORMATIONWIDGET___H__ diff --git a/apps/TimelineView/main.cpp b/apps/TimelineView/main.cpp deleted file mode 100644 index 79bd875cec..0000000000 --- a/apps/TimelineView/main.cpp +++ /dev/null @@ -1,160 +0,0 @@ -/***************************************************************************************** - * * - * OpenSpace * - * * - * Copyright (c) 2014-2019 * - * * - * 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 "mainwindow.h" - -static const QString style = R"style( -QWidget { - background-color: rgb(80, 80, 80); - font-family: Helvetica; -} - -QGroupBox { - background-color: qlineargradient( - x1: 0, y1: 0, x2: 0, y2: 1, - stop: 0 #858585, - stop: 1 #959595); - border: 2px solid gray; - border-radius: 5px; - margin-top: 4ex; - font-size: bold 12px; -} - -QGroupBox::title { - background-color: #E0E0E0; - border: 2px solid gray; - border-radius: 5px; - subcontrol-origin: margin; - subcontrol-position: top center; - padding: 0 10px; -} - -QLineEdit { - color: lightgray; -} - -QSlider::groove:horizontal { - border: 1px solid #999999; - /* the groove expands to the size of the slider by default. by giving it a height, - it has a fixed size */ - height: 8px; - background: qlineargradient( - x1:0, y1:0, x2:1, y2:0, - stop:0 #c4c4c4, - stop:0.5 #555555, - stop:1 #c4c4c4 - ); - margin: 2px 0; -} - -QSlider::handle:horizontal { - background: qlineargradient(x1:0, y1:0, x2:0, y2:1, stop:0 #b4b4b4, stop:1 #8f8f8f); - border: 1px solid #5c5c5c; - width: 18px; - /* handle is placed by default on the contents rect of the groove. - Expand outside the groove */ - margin: -2px 0; - border-radius: 3px; -} - -QPushButton { - background-color: lightgray; - border-style: outset; - border-width: 0.5px; - border-radius: 5px; - border-color: black; - font: bold 12px; - min-width: 10em; -} - -QPushButton#connection { - background-color: lightgreen; -} - -QPushButton#connection:pressed { - background-color: green; -} - - -QPushButton#pause, QPushButton#play { - padding: 5px; -} - -QPushButton#pause:pressed, QPushButton#play:pressed, QPushButton:pressed { - background-color: darkgray; - border-style: inset; -} - -QCombobox { - border: 1px solid gray; - border-radius: 3px; - padding: 1px 18px 1px 3px; - min-width: 6em; -} - -QComboBox:editable { - background: lightgrey; -} - -QComboBox QAbstractItemView { - border: 2px solid darkgray; - border-radius: 5px; - background-color: #a8a8a8; - selection-background-color: #a8a8a8; -} - -QLabel#label { - font-size: 13px; - background-color: transparent; - font-variant: small-caps; -} - -QLabel#value { - font-family: monospace; - font-weight: bold; - font-size: 14px; - background-color: transparent; -} - -QWidget#background { - background-color: transparent; -} - -QTextEdit { - font-family: monospace; -} -)style"; - -int main(int argc, char** argv) { - QApplication app(argc, argv); - - app.setStyleSheet(style); - - MainWindow window; - window.show(); - - return app.exec(); -} diff --git a/apps/TimelineView/mainwindow.cpp b/apps/TimelineView/mainwindow.cpp deleted file mode 100644 index e7241f80a2..0000000000 --- a/apps/TimelineView/mainwindow.cpp +++ /dev/null @@ -1,398 +0,0 @@ -/***************************************************************************************** - * * - * OpenSpace * - * * - * Copyright (c) 2014-2019 * - * * - * 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 "mainwindow.h" - -#include "configurationwidget.h" -#include "controlwidget.h" -#include "informationwidget.h" -#include "timelinewidget.h" - -#include -#include -#include -#include - -#include -#include - -namespace { - QByteArray continuousData; -} - -template -T readFromBuffer(char* buffer, size_t& currentReadLocation) { - union { - T value; - std::array data; - } b; - std::memmove(b.data.data(), buffer + currentReadLocation, sizeof(T)); - currentReadLocation += sizeof(T); - return b.value; -} - -template <> -std::string readFromBuffer(char* buffer, size_t& currentReadLocation) { - uint8_t size = readFromBuffer(buffer, currentReadLocation); - - std::string result(buffer + currentReadLocation, buffer + currentReadLocation + size); - currentReadLocation += size; - return result; -} - -MainWindow::MainWindow() - : QWidget(nullptr) - , _configurationWidget(nullptr) - , _timeControlWidget(nullptr) - , _informationWidget(nullptr) - , _timelineWidget(nullptr) - , _socket(nullptr) -{ - setWindowTitle("OpenSpace Timeline"); - - _configurationWidget = new ConfigurationWidget(this); - _configurationWidget->setMinimumWidth(350); - _timeControlWidget = new ControlWidget(this); - _timeControlWidget->setMinimumWidth(350); - _informationWidget = new InformationWidget(this); - _informationWidget->setMinimumWidth(350); - _timelineWidget = new TimelineWidget(this); - - QGridLayout* layout = new QGridLayout; - layout->addWidget(_configurationWidget, 0, 0); - layout->addWidget(_timeControlWidget, 1, 0); - layout->addWidget(_informationWidget, 2, 0); - layout->addWidget(_timelineWidget, 0, 1, 3, 1); - - layout->setColumnStretch(1, 5); - - - QObject::connect( - _configurationWidget, SIGNAL(connect(QString, QString)), - this, SLOT(onConnect(QString, QString)) - ); - QObject::connect( - _configurationWidget, SIGNAL(disconnect()), - this, SLOT(onDisconnect()) - ); - - QObject::connect( - _timeControlWidget, SIGNAL(scriptActivity(QString)), - this, SLOT(sendScript(QString)) - ); - - setLayout(layout); - - _configurationWidget->socketDisconnected(); - _timeControlWidget->socketDisconnected(); - _informationWidget->socketDisconnected(); - _timelineWidget->socketDisconnected(); -} - -MainWindow::~MainWindow() { - delete _socket; -} - -void MainWindow::onConnect(QString host, QString port) { - delete _socket; - - _socket = new QTcpSocket(this); - QObject::connect(_socket, SIGNAL(readyRead()), SLOT(readTcpData())); - QObject::connect(_socket, SIGNAL(connected()), SLOT(onSocketConnected())); - QObject::connect(_socket, SIGNAL(disconnected()), SLOT(onSocketDisconnected())); - - _socket->connectToHost(host, port.toUInt()); -} - -void MainWindow::onDisconnect() { - delete _socket; - _socket = nullptr; -} - -void MainWindow::readTcpData() { - static const uint16_t MessageTypeStatus = 0; - static const uint16_t MessageTypeMappingIdentifier = 1; - static const uint16_t MessageTypeInitialMessageFinished = 2; - static const uint16_t MessageTypePlayBookLabel = 3; - static const uint16_t MessageTypePlayBookHongKang = 4; - - QByteArray data = continuousData.append(_socket->readAll()); -// int d = data.size(); - - if (QString(data) == "Connected to SGCT!\r\n") { - continuousData.clear(); - return; - } - if (QString(data) == "OK\r\n") { - continuousData.clear(); - return; - } - - if (data.size() != 42) - qDebug() << QString(data); - - QByteArray messageTypeData = data.left(2); - union { - uint16_t value; - std::array data; - } messageType; - std::memcpy(messageType.data.data(), messageTypeData.data(), sizeof(uint16_t)); - - switch (messageType.value) { - case MessageTypeStatus: - break; - case MessageTypeMappingIdentifier: - qDebug() << "Mapping Identifier received"; - printMapping(data.mid(2)); - continuousData.clear(); - break; - case MessageTypeInitialMessageFinished: - qDebug() << "InitialMessageFinished received"; - break; - case MessageTypePlayBookHongKang: - qDebug() << "Hong Kang Playbook received"; - break; - case MessageTypePlayBookLabel: - qDebug() << "Label Playbook received"; - break; - default: - qDebug() << "Unknown message of type '" << messageType.value << "'"; - } - - switch (messageType.value) { - case MessageTypeStatus: - { - if (_isConnected) - handleStatusMessage(data.mid(2)); - continuousData.clear(); - break; - } - case MessageTypePlayBookHongKang: - case MessageTypePlayBookLabel: - { -// const char* payloadDebug = data.mid(2).data(); - - size_t beginning = 0; - uint32_t size = readFromBuffer(data.mid(2).data(), beginning); - - //qDebug() << "Begin reading data"; - while (_socket->waitForReadyRead() && data.size() < int(size)) { - //qDebug() << "."; - //_socket->read - //data = data.append(_socket->re) - data = data.append(_socket->readAll()); - //data = data.append(_socket->read(int(size) - data.size())); - //QThread::msleep(50); - } - //qDebug() << "Finished reading data. Handling playbook"; - - continuousData = handlePlaybook(data.mid(2)); - - - //qDebug() << "Finished handling playbook"; - - //if (messageType.value == MessageTypePlayBookHongKang) - // _hasHongKangTimeline = true; - //if (messageType.value == MessageTypePlayBookLabel) - // _hasLabelTimeline = true; - - //if (_hasHongKangTimeline && _hasLabelTimeline) { - // fullyConnected(); - //} - - break; - } - case MessageTypeInitialMessageFinished: - _isConnected = true; - fullyConnected(); - continuousData.clear(); - break; - - default: - qDebug() << QString(data); - } - -} - -void MainWindow::handleStatusMessage(QByteArray data) { - const char* buffer = data.data(); - - union { - double value; - std::array buffer; - } et; - std::memmove(et.buffer.data(), buffer, sizeof(double)); - - std::vector timeString(24); - std::memmove(timeString.data(), buffer + sizeof(double), 24); - - union { - double value; - std::array buffer; - } delta; - std::memmove(delta.buffer.data(), buffer + sizeof(double) + 24, sizeof(double)); - - _timeControlWidget->update( - QString::fromStdString(std::string(timeString.begin(), timeString.end())), - QString::number(delta.value) - ); - _timelineWidget->setCurrentTime( - std::string(timeString.begin(), timeString.end()), - et.value - ); -} - -std::vector instrumentsFromId(uint16_t instrumentId, - std::map instrumentMap) -{ - std::vector results; - for (int i = 0; i < 16; ++i) { - uint16_t testValue = 1 << i; - if ((testValue & instrumentId) != 0) { - std::string t = instrumentMap.at(testValue); - if (t.empty()) { - qDebug() << "Empty instrument"; - } - results.push_back(t); - } - } - return results; -} - -QByteArray MainWindow::handlePlaybook(QByteArray data) { - char* buffer = data.data(); - size_t currentReadLocation = 0; - - uint32_t totalData = readFromBuffer(buffer, currentReadLocation); - - uint8_t nTargets = readFromBuffer(buffer, currentReadLocation); - qDebug() << "Targets: " << nTargets; - std::map targetMap; - for (uint8_t i = 0; i < nTargets; ++i) { - uint8_t id = readFromBuffer(buffer, currentReadLocation); - std::string value = readFromBuffer(buffer, currentReadLocation); - qDebug() << QString::fromStdString(value); - targetMap[id] = value; - } - - uint8_t nInstruments = readFromBuffer(buffer, currentReadLocation); - qDebug() << "Instruments: " << nInstruments; - std::map instrumentMap; - for (uint8_t i = 0; i < nInstruments; ++i) { - uint16_t id = readFromBuffer(buffer, currentReadLocation); - std::string value = readFromBuffer(buffer, currentReadLocation); - qDebug() << QString::fromStdString(value); - instrumentMap[id] = value; - } - - uint32_t nImages = readFromBuffer(buffer, currentReadLocation); - std::vector images; - for (uint32_t i = 0; i < nImages; ++i) { - Image image; - image.beginning = readFromBuffer(buffer, currentReadLocation); - image.ending = readFromBuffer(buffer, currentReadLocation); - - image.beginningString = readFromBuffer(buffer, currentReadLocation); - image.endingString = readFromBuffer(buffer, currentReadLocation); - - uint8_t targetId = readFromBuffer(buffer, currentReadLocation); - uint16_t instrumentId = readFromBuffer(buffer, currentReadLocation); - image.target = targetMap[targetId]; - image.instruments = instrumentsFromId(instrumentId, instrumentMap); - if (image.instruments.empty()) - qDebug() << "Instruments were empty"; - images.push_back(image); - } - _timelineWidget->setData( - std::move(images), - std::move(targetMap), - std::move(instrumentMap) - ); - - auto dataSize = data.size(); - auto readSize = currentReadLocation; - auto extraBytes = dataSize - readSize; - if (extraBytes > 0) { - return data.mid(currentReadLocation); - } - else { - return QByteArray(); - } -} - -void MainWindow::sendScript(QString script) { - if (_socket) { - _socket->write(("0" + script + "\r\n").toLatin1()); - //QByteArray data = (QString("0") + script).toLocal8Bit(); - //qDebug() << data; - //_socket->write(data); - //QThread::msleep(25); - } - //_socket->write(("0" + script + "\r\n").toLatin1()); - //_socket->write(("0" + script + "\0").toLatin1()); -} - -void MainWindow::onSocketConnected() { - _socket->write(QString("1\r\n").toLatin1()); - //_socket->write(QString("1").toLatin1()); - -} - -void MainWindow::onSocketDisconnected() { - _configurationWidget->socketDisconnected(); - _timeControlWidget->socketDisconnected(); - _informationWidget->socketDisconnected(); - _timelineWidget->socketDisconnected(); - - _informationWidget->logInformation("Disconnected."); -} - -std::string MainWindow::nextTarget() const { - return _timelineWidget->nextTarget(); -} - -void MainWindow::fullyConnected() { - _informationWidget->logInformation( - "Connected to " + _socket->peerName() + " on port " + - QString::number(_socket->peerPort()) + "." - ); - - _configurationWidget->socketConnected(); - _timeControlWidget->socketConnected(); - _informationWidget->socketConnected(); - _timelineWidget->socketConnected(); -} - -void MainWindow::printMapping(QByteArray data) { - char* buffer = data.data(); - size_t currentReadPosition = 0; - - uint16_t size = readFromBuffer(buffer, currentReadPosition); - for (uint16_t i = 0; i < size; ++i) { - uint16_t identifier = readFromBuffer(buffer, currentReadPosition); - std::string mapping = readFromBuffer(buffer, currentReadPosition); - - qDebug() << identifier << ": " << QString::fromStdString(mapping); - } -} diff --git a/apps/TimelineView/mainwindow.h b/apps/TimelineView/mainwindow.h deleted file mode 100644 index 550c075bee..0000000000 --- a/apps/TimelineView/mainwindow.h +++ /dev/null @@ -1,74 +0,0 @@ -/***************************************************************************************** - * * - * OpenSpace * - * * - * Copyright (c) 2014-2019 * - * * - * 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 __OPENSPACE_APP_TIMELINEVIEW___MAINWINDOW___H__ -#define __OPENSPACE_APP_TIMELINEVIEW___MAINWINDOW___H__ - -#include -#include - -#include "common.h" - -class ConfigurationWidget; -class ControlWidget; -class InformationWidget; -class TimelineWidget; - -class MainWindow : public QWidget { -Q_OBJECT -public: - MainWindow(); - ~MainWindow(); - - std::string nextTarget() const; - -public slots: - void sendScript(QString script); - -private slots: - void onConnect(QString host, QString port); - void onDisconnect(); - - void onSocketConnected(); - void onSocketDisconnected(); - - void readTcpData(); - void handleStatusMessage(QByteArray data); - QByteArray handlePlaybook(QByteArray data); - void printMapping(QByteArray data); - - void fullyConnected(); - -private: - ConfigurationWidget* _configurationWidget; - ControlWidget* _timeControlWidget; - InformationWidget* _informationWidget; - TimelineWidget* _timelineWidget; - - QTcpSocket* _socket; - - bool _isConnected = false; -}; - -#endif // __OPENSPACE_APP_TIMELINEVIEW___MAINWINDOW___H__ diff --git a/apps/TimelineView/timelinewidget.cpp b/apps/TimelineView/timelinewidget.cpp deleted file mode 100644 index f529663eb1..0000000000 --- a/apps/TimelineView/timelinewidget.cpp +++ /dev/null @@ -1,304 +0,0 @@ -/***************************************************************************************** - * * - * OpenSpace * - * * - * Copyright (c) 2014-2019 * - * * - * 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 "timelinewidget.h" - -#include -#include -#include -#include - -#include -#include - -namespace { - static const int LegendHeight = 105; - static const int TimeWidth = 200; - - static const int TextOffset = 5; - - QMap InstrumentColors = { - { "NH_ALICE_AIRGLOW", QColor(40, 130, 200) }, - { "NH_ALICE_SOC", QColor(49, 234, 219) }, - { "NH_RALPH_LEISA", QColor(139, 86, 152) }, - { "NH_RALPH_MVIC_NIR", QColor(100, 14, 14) }, - { "NH_RALPH_MVIC_METHANE", QColor(211, 154, 31) }, - { "NH_RALPH_MVIC_RED", QColor(175, 18, 18) }, - { "NH_RALPH_MVIC_BLUE", QColor(84, 79, 149) }, - { "NH_LORRI", QColor(149, 219, 32) }, - { "NH_REX", QColor(35, 185, 125) }, - - { "NH_RALPH_MVIC_PAN1", QColor(203, 153, 200) }, - { "NH_RALPH_MVIC_FT", QColor(242, 101, 74) }, - { "NH_RALPH_MVIC_PAN2", QColor(180, 180, 140) } - }; - - //{ "NH_ALICE_AIRGLOW", QColor(82, 145, 57) }, - //{ "NH_ALICE_SOC", QColor(241, 231, 48) }, - - - QMap InstrumentConversion = { - { "NH_ALICE_AIRGLOW", "ALICE Airglow" }, - { "NH_RALPH_LEISA", "RALPH LEISA" }, - { "NH_RALPH_MVIC_NIR", "RALPH MVIC NIR" }, - { "NH_ALICE_SOC", "ALICE SOC" }, - { "NH_RALPH_MVIC_BLUE", "RALPH MVIC Blue" }, - { "NH_RALPH_MVIC_PAN1" , "RALPH MVIC Pan1" }, - { "NH_LORRI", "LORRI" }, - { "NH_RALPH_MVIC_FT", "RALPH MVIC FT" }, - { "NH_RALPH_MVIC_PAN2", "RALPH MVIC Pan2" }, - { "NH_RALPH_MVIC_METHANE", "RALPH MVIC Methane" }, - { "NH_RALPH_MVIC_RED", "RALPH MVIC Red" }, - { "NH_REX", "REX" } - }; - - const double etSpread = 100.0; -} - -TimelineWidget::TimelineWidget(QWidget* parent) - : QWidget(parent) - , _currentTime{"", 0.0} -{ - setMinimumWidth(600); - setMinimumHeight(600); -} - -void TimelineWidget::paintEvent(QPaintEvent* event) { - QPainter painter(this); - - QRectF fullRect = contentsRect(); - QRectF contentRect(0, 0, fullRect.width() - 1, fullRect.height() - LegendHeight); - QRectF legendRect( - 0, - fullRect.bottom() - LegendHeight, - fullRect.right(), - fullRect.bottom() - ); - - painter.save(); - drawContent(painter, contentRect); - painter.restore(); - - painter.save(); - painter.translate(0, fullRect.height() - LegendHeight); - drawLegend(painter, QRectF(legendRect)); - painter.restore(); -} - -void TimelineWidget::setData(std::vector images, - std::map targetMap, - std::map instrumentMap) -{ - _images.insert(_images.end(), images.begin(), images.end()); - - std::sort( - _images.begin(), - _images.end(), - [](const Image& a, const Image& b) { return a.beginning < b.beginning; } - ); - - _targetMap.insert(targetMap.begin(), targetMap.end()); - _instrumentMap.insert(instrumentMap.begin(), instrumentMap.end()); - - _instruments.clear(); - std::set instruments; - for (auto p : _instrumentMap) - instruments.insert(p.second); - std::copy(instruments.begin(), instruments.end(), std::back_inserter(_instruments)); - - _targets.clear(); - std::set targets; - for (auto p : _targetMap) - targets.insert(p.second); - std::copy(targets.begin(), targets.end(), std::back_inserter(_targets)); - - repaint(); -} - -void TimelineWidget::drawContent(QPainter& painter, QRectF rect) { - QRectF timelineRect(0, 0, rect.width() - TimeWidth, rect.height()); - QRectF dateRect(rect.width() - TimeWidth, 0, TimeWidth, rect.height()); - - // Draw background - //painter.setBrush(QBrush(Qt::lightGray)); painter.drawRect(timelineRect); - painter.setBrush(QBrush(QColor(85, 85, 85))); painter.drawRect(timelineRect); - painter.setBrush(QBrush(QColor(165, 165, 165))); painter.drawRect(dateRect); - - const double lowerTime = _currentTime.et - etSpread; - const double upperTime = _currentTime.et + etSpread; - - std::vector images; - for (Image& i : _images) { - if (i.beginning <= upperTime && i.ending >= lowerTime) - images.push_back(&i); - } - - drawImages(painter, timelineRect, images, lowerTime, upperTime); - - - // Draw current time - painter.setBrush(QBrush(Qt::black)); - painter.setPen(QPen(Qt::black, 2)); - painter.drawLine( - QPointF(0, timelineRect.height() / 2), - QPointF(timelineRect.width(), timelineRect.height() / 2) - ); - painter.drawText( - timelineRect.width(), - timelineRect.height() / 2 + TextOffset, - QString::fromStdString(_currentTime.time) - ); -} - -void TimelineWidget::drawLegend(QPainter& painter, QRectF rect) { - static const int Padding = 5; - static const int BoxSize = 20; - - int currentHorizontalPosition = Padding; - int currentVerticalPosition = Padding + BoxSize + Padding; - - // Draw Targets - // Draw Instruments - for (int i = 0; i < _instruments.size(); ++i) { - if (i == _instruments.size() / 3 || i == _instruments.size() * 2 / 3) { - currentVerticalPosition += BoxSize + Padding; - currentHorizontalPosition = Padding; - } - - const std::string& instrument = _instruments[i]; - ; - painter.setBrush(QBrush(InstrumentColors[QString::fromStdString(instrument)])); - painter.setPen(QPen(InstrumentColors[QString::fromStdString(instrument)])); - painter.drawRect( - currentHorizontalPosition, - currentVerticalPosition, - BoxSize, - BoxSize - ); - currentHorizontalPosition += BoxSize + Padding; - - painter.setPen(QPen(QColor(200, 200, 200))); - //painter.setPen(QPen(Qt::black)); - painter.drawText( - currentHorizontalPosition, - currentVerticalPosition + BoxSize / 2 + TextOffset, - InstrumentConversion[QString::fromStdString(instrument)] - ); - currentHorizontalPosition += 125; - } -} - -void TimelineWidget::setCurrentTime(std::string currentTime, double et) { - _currentTime.time = std::move(currentTime); - _currentTime.et = std::move(et); - repaint(); - -} - -void TimelineWidget::drawImages( - QPainter& painter, - QRectF timelineRect, - std::vector images, - double minimumTime, double maximumTime) -{ - std::set instrumentSet; - for (Image* i : images) { - for (std::string instrument : i->instruments) { - instrumentSet.insert(instrument); - } - } - std::map instruments; - for (auto it = instrumentSet.begin(); it != instrumentSet.end(); ++it) - instruments[*it] = std::distance(instrumentSet.begin(), it); - - for (Image* i : images) { - double tBeg = (i->beginning - minimumTime) / (maximumTime - minimumTime); - tBeg = std::max(tBeg, 0.0); - double tEnd = (i->ending - minimumTime) / (maximumTime - minimumTime); - tEnd = std::min(tEnd, 1.0); - - int loc = timelineRect.top() + timelineRect.height() * tBeg; - int height = (timelineRect.top() + timelineRect.height() * tEnd) - loc; - height = std::max(height, 5); - - if (loc + height > timelineRect.height()) { - height = timelineRect.height() - loc; - } - - std::string target = i->target; - auto it = std::find(_targets.begin(), _targets.end(), target); -// int iTarget = std::distance(_targets.begin(), it); - - for (std::string instrument : i->instruments) { - auto it = std::find(_instruments.begin(), _instruments.end(), instrument); - if (it == _instruments.end()) { - qDebug() << "Instrument not found"; - } - - painter.setBrush( - QBrush(InstrumentColors[QString::fromStdString(instrument)]) - ); - - double width = timelineRect.width() / instruments.size(); - double pos = instruments[instrument] * width; - - painter.drawRect(pos, loc, width, height); - } - - if (height >= 5) { - painter.setBrush(QBrush(Qt::black)); - painter.setPen(QPen(Qt::black)); - QString line = QString::fromStdString(i->beginningString) + QString(" (") + - QString::fromStdString(i->target) + QString(")"); - - painter.drawText(timelineRect.width(), loc + height / 2 + TextOffset, line); - } - } -} - -void TimelineWidget::socketConnected() { - setDisabled(false); -} - -void TimelineWidget::socketDisconnected() { - setDisabled(true); - _images.clear(); - _instruments.clear(); - _targets.clear(); -} - -std::string TimelineWidget::nextTarget() const { - auto it = std::lower_bound( - _images.begin(), - _images.end(), - _currentTime.et, - [](const Image& i, double et) { return i.beginning < et; } - ); - if (it != _images.end()) { - return it->target; - } - else { - return ""; - } -} diff --git a/apps/TimelineView/timelinewidget.h b/apps/TimelineView/timelinewidget.h deleted file mode 100644 index e5fcc440c0..0000000000 --- a/apps/TimelineView/timelinewidget.h +++ /dev/null @@ -1,72 +0,0 @@ -/***************************************************************************************** - * * - * OpenSpace * - * * - * Copyright (c) 2014-2019 * - * * - * 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 __OPENSPACE_APP_TIMELINEVIEW___TIMELINEWIDGET___H__ -#define __OPENSPACE_APP_TIMELINEVIEW___TIMELINEWIDGET___H__ - -#include - -#include "common.h" - -#include -#include -#include - -class QPaintEvent; - -class TimelineWidget : public QWidget { -Q_OBJECT -public: - TimelineWidget(QWidget* parent); - - void setData(std::vector images, std::map targetMap, - std::map instrumentMap); - void setCurrentTime(std::string currentTime, double et); - void socketConnected(); - void socketDisconnected(); - - std::string nextTarget() const; - -protected: - void paintEvent(QPaintEvent* event); - void drawContent(QPainter& painter, QRectF rect); - void drawLegend(QPainter& painter, QRectF rect); - void drawImages(QPainter& painter, QRectF timelineRect, std::vector images, - double minimumTime, double maximumTime); - -private: - std::vector _images; - std::map _targetMap; - std::map _instrumentMap; - - std::vector _targets; - std::vector _instruments; - - struct { - std::string time; - double et; - } _currentTime; -}; - -#endif // __OPENSPACE_APP_TIMELINEVIEW___TIMELINEWIDGET___H__ diff --git a/data/assets/base.asset b/data/assets/base.asset index 34a64b783b..3c6406cc80 100644 --- a/data/assets/base.asset +++ b/data/assets/base.asset @@ -57,9 +57,10 @@ local Keybindings = { }, { Key = "h", - Name="Toggle Planet Trails", - Command = "local list = openspace.getProperty('{planetTrail_solarSystem}.Renderable.Enabled'); for _,v in pairs(list) do openspace.setPropertyValueSingle(v, not openspace.getPropertyValue(v)) end", - Documentation = "Toggles the visibility of planet trails", + Name="Toggle Trails", + Command = "local list = openspace.getProperty('{planetTrail_solarSystem}.Renderable.Enabled'); for _,v in pairs(list) do openspace.setPropertyValueSingle(v, not openspace.getPropertyValue(v)) end\n" .. + "local moonlist = openspace.getProperty('{moonTrail_solarSystem}.Renderable.Enabled'); for _,v in pairs(moonlist) do openspace.setPropertyValueSingle(v, not openspace.getPropertyValue(v)) end", + Documentation = "Toggles the visibility of planet and moon trails", GuiPath = "/Rendering", Local = false }, diff --git a/data/assets/scene/solarsystem/missions/messenger/mercurymagnetosphere.asset b/data/assets/scene/solarsystem/missions/messenger/mercurymagnetosphere.asset index 363af34171..35dfbe7110 100644 --- a/data/assets/scene/solarsystem/missions/messenger/mercurymagnetosphere.asset +++ b/data/assets/scene/solarsystem/missions/messenger/mercurymagnetosphere.asset @@ -6,7 +6,7 @@ local localFolder = asset.syncedResource({ Name = "Mercury Magnetosphere", Type = "HttpSynchronization", Identifier = "mercury_magnetosphere", - Version = 2 + Version = 3 }) diff --git a/data/assets/scene/solarsystem/planets/earth/moon/map_service_configs/LiU/Kaguya.vrt b/data/assets/scene/solarsystem/planets/earth/moon/map_service_configs/LiU/Kaguya.vrt new file mode 100644 index 0000000000..e7ad44a020 --- /dev/null +++ b/data/assets/scene/solarsystem/planets/earth/moon/map_service_configs/LiU/Kaguya.vrt @@ -0,0 +1,28 @@ + + GEOGCS["GCS_Moon_2000",DATUM["D_Moon_2000",SPHEROID["Moon_2000_IAU_IAG",1737400.0,0.0]],PRIMEM["Reference_Meridian",0.0],UNIT["Degree",0.0174532925199433]] + -1.8000000000000000e+02, 2.4414062500000000e-04, 0.0000000000000000e+00, 9.0000000000000000e+01, 0.0000000000000000e+00, -2.4414062500000000e-04 + + Gray + + Kaguya.wms + 1 + + + + + + + Alpha + 0 + + Kaguya.wms + 1 + + + + 255 + 0 + 0 + + + diff --git a/data/assets/scene/solarsystem/planets/earth/moon/map_service_configs/Utah/Kaguya.vrt b/data/assets/scene/solarsystem/planets/earth/moon/map_service_configs/Utah/Kaguya.vrt new file mode 100644 index 0000000000..e7ad44a020 --- /dev/null +++ b/data/assets/scene/solarsystem/planets/earth/moon/map_service_configs/Utah/Kaguya.vrt @@ -0,0 +1,28 @@ + + GEOGCS["GCS_Moon_2000",DATUM["D_Moon_2000",SPHEROID["Moon_2000_IAU_IAG",1737400.0,0.0]],PRIMEM["Reference_Meridian",0.0],UNIT["Degree",0.0174532925199433]] + -1.8000000000000000e+02, 2.4414062500000000e-04, 0.0000000000000000e+00, 9.0000000000000000e+01, 0.0000000000000000e+00, -2.4414062500000000e-04 + + Gray + + Kaguya.wms + 1 + + + + + + + Alpha + 0 + + Kaguya.wms + 1 + + + + 255 + 0 + 0 + + + diff --git a/data/assets/scene/solarsystem/planets/earth/moon/moon.asset b/data/assets/scene/solarsystem/planets/earth/moon/moon.asset index e9f0f49b3a..851e8d135c 100644 --- a/data/assets/scene/solarsystem/planets/earth/moon/moon.asset +++ b/data/assets/scene/solarsystem/planets/earth/moon/moon.asset @@ -49,8 +49,8 @@ local Moon = { Name = "Clem Uvvis [Utah]", FilePath = mapServiceConfigs .. "/Utah/ClemUvvis.wms", Settings = { - Gamma = 0.81, - Multiplier = 1.1 + Gamma = 1.14, + Multiplier = 1.4 } }, { @@ -58,8 +58,8 @@ local Moon = { Name = "Clem Uvvis [Sweden]", FilePath = mapServiceConfigs .. "/LiU/Clem_Uvvis.wms", Settings = { - Gamma = 0.81, - Multiplier = 1.1 + Gamma = 1.14, + Multiplier = 1.4 } }, { @@ -83,7 +83,7 @@ local Moon = { { Identifier = "Kaguya_Utah", Name = "Kaguya [Utah]", - FilePath = mapServiceConfigs .. "/Utah/Kaguya.wms", + FilePath = mapServiceConfigs .. "/Utah/Kaguya.vrt", Settings = { Gamma = 1.0, Multiplier = 1.23 @@ -92,7 +92,7 @@ local Moon = { { Identifier = "Kaguya_Sweden", Name = "Kaguya [Sweden]", - FilePath = mapServiceConfigs .. "/LiU/Kaguya.wms", + FilePath = mapServiceConfigs .. "/LiU/Kaguya.vrt", Settings = { Gamma = 1.0, Multiplier = 1.23 diff --git a/data/assets/scene/solarsystem/planets/earth/moon/trail.asset b/data/assets/scene/solarsystem/planets/earth/moon/trail.asset index fe707fff53..bd96ce84ac 100644 --- a/data/assets/scene/solarsystem/planets/earth/moon/trail.asset +++ b/data/assets/scene/solarsystem/planets/earth/moon/trail.asset @@ -16,7 +16,8 @@ local MoonTrail = { }, Color = { 0.5, 0.3, 0.3 }, Period = 27, - Resolution = 1000 + Resolution = 1000, + Tag = { "moonTrail_solarSystem", "moonTrail_terrestrial", "moonTrail_earth" } }, GUI = { Name = "Moon Trail", diff --git a/data/assets/scene/solarsystem/planets/venus/map_service_configs/Utah/MagellanMosaic.vrt b/data/assets/scene/solarsystem/planets/venus/map_service_configs/Utah/MagellanMosaic.vrt new file mode 100644 index 0000000000..7eb41cc198 --- /dev/null +++ b/data/assets/scene/solarsystem/planets/venus/map_service_configs/Utah/MagellanMosaic.vrt @@ -0,0 +1,28 @@ + + GEOGCS["GCS_Venus",DATUM["D_Venus",SPHEROID["Venus_localRadius",6051000,0]],PRIMEM["Reference_Meridian",0],UNIT["Degree",0.0174532925199433]] + -1.8000000000000000e+02, 7.1016002272512077e-04, 0.0000000000000000e+00, 9.0000000000000000e+01, 0.0000000000000000e+00, -7.1011656303583486e-04 + + Gray + + MagellanMosaic.wms + 1 + + + + + + + Alpha + 0 + + MagellanMosaic.wms + 1 + + + + 255 + 0 + 0 + + + diff --git a/data/assets/scene/solarsystem/planets/venus/venus.asset b/data/assets/scene/solarsystem/planets/venus/venus.asset index 797ed5b949..486f2d2cab 100644 --- a/data/assets/scene/solarsystem/planets/venus/venus.asset +++ b/data/assets/scene/solarsystem/planets/venus/venus.asset @@ -26,12 +26,13 @@ local color_layers = { { Identifier = "Magellan_Mosaic_Utah", Name = "Magellan Mosaic [Utah]", - FilePath = mapServiceConfigs .. "/Utah/MagellanMosaic.wms", + FilePath = mapServiceConfigs .. "/Utah/MagellanMosaic.vrt", BlendMode = "Color", Settings = { Gamma = 2.0 - } - } + }, + Enabled = true + }, } local height_layers = { @@ -43,7 +44,8 @@ local height_layers = { Settings = { Gamma = 1.72, Multiplier = 1.1 - } + }, + Enabled = true } } diff --git a/data/assets/util/webgui.asset b/data/assets/util/webgui.asset index 94f3998ed4..13baac61cb 100644 --- a/data/assets/util/webgui.asset +++ b/data/assets/util/webgui.asset @@ -3,7 +3,7 @@ asset.require('./static_server') local guiCustomization = asset.require('customization/gui') -- Select which commit hashes to use for the frontend and backend -local frontendHash = "be37b84637a88a6961504a8648a4f509bfb07475" +local frontendHash = "c2d8ff7419b82a614b6cdc02fbe391e0862279de" local dataProvider = "data.openspaceproject.com/files/webgui" local frontend = asset.syncedResource({ diff --git a/ext/ghoul b/ext/ghoul index 42c4d7e985..0461bf1f44 160000 --- a/ext/ghoul +++ b/ext/ghoul @@ -1 +1 @@ -Subproject commit 42c4d7e9855516510249fa6520e5d62beb679115 +Subproject commit 0461bf1f44b58e04fb21d929b0f385e1120da7b4 diff --git a/include/openspace/interaction/keybindingmanager.h b/include/openspace/interaction/keybindingmanager.h index 2c652c7d40..aca56d84e6 100644 --- a/include/openspace/interaction/keybindingmanager.h +++ b/include/openspace/interaction/keybindingmanager.h @@ -75,7 +75,6 @@ public: const std::multimap& keyBindings() const; private: - std::multimap _keyLua; }; diff --git a/include/openspace/interaction/navigationhandler.h b/include/openspace/interaction/navigationhandler.h index ea29dd98ea..66b1e3942b 100644 --- a/include/openspace/interaction/navigationhandler.h +++ b/include/openspace/interaction/navigationhandler.h @@ -166,6 +166,7 @@ private: std::optional _pendingNavigationState; + properties::BoolProperty _disableInputs; properties::BoolProperty _useKeyFrameInteraction; }; diff --git a/include/openspace/interaction/sessionrecording.inl b/include/openspace/interaction/sessionrecording.inl index 5c8ce2c9ac..386357c9c5 100644 --- a/include/openspace/interaction/sessionrecording.inl +++ b/include/openspace/interaction/sessionrecording.inl @@ -33,9 +33,11 @@ T nextKeyframeObj(unsigned int index, const std::vector& keyframeContainer, finishedCallback(); } return keyframeContainer.back(); - } else if (index < keyframeContainer.size()) { + } + else if (index < keyframeContainer.size()) { return keyframeContainer[index]; - } else { + } + else { return keyframeContainer.back(); } } @@ -44,9 +46,11 @@ template T prevKeyframeObj(unsigned int index, const std::vector& keyframeContainer) { if (index >= keyframeContainer.size()) { return keyframeContainer.back(); - } else if (index > 0) { + } + else if (index > 0) { return keyframeContainer[index - 1]; - } else { + } + else { return keyframeContainer.front(); } } diff --git a/include/openspace/interaction/touchbar.h b/include/openspace/interaction/touchbar.h index beae46641d..3b769a03f9 100644 --- a/include/openspace/interaction/touchbar.h +++ b/include/openspace/interaction/touchbar.h @@ -2,7 +2,7 @@ * * * OpenSpace * * * - * Copyright (c) 2014-2019 * + * Copyright (c) 2014-2020 * * * * 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 * diff --git a/modules/atmosphere/shaders/atmosphere_common.glsl b/modules/atmosphere/shaders/atmosphere_common.glsl index 07887b12a9..c806dfab8e 100644 --- a/modules/atmosphere/shaders/atmosphere_common.glsl +++ b/modules/atmosphere/shaders/atmosphere_common.glsl @@ -125,7 +125,8 @@ vec3 analyticTransmittance(const float r, const float mu, const float d) { return exp(-betaRayleigh * opticalDepth(HR, r, mu, d) - betaOzoneExtinction * (0.0000006) * opticalDepth(HO, r, mu, d) - betaMieExtinction * opticalDepth(HM, r, mu, d)); - } else { + } + else { return exp(-betaRayleigh * opticalDepth(HR, r, mu, d) - betaMieExtinction * opticalDepth(HM, r, mu, d)); } @@ -315,7 +316,8 @@ vec3 transmittance(const float r, const float mu, const float d) { if (mu > 0.0f) { return min(transmittanceLUT(r, mu) / transmittanceLUT(ri, mui), 1.0f); - } else { + } + else { return min(transmittanceLUT(ri, -mui) / transmittanceLUT(r, -mu), 1.0f); } diff --git a/modules/atmosphere/shaders/atmosphere_deferred_fs.glsl b/modules/atmosphere/shaders/atmosphere_deferred_fs.glsl index 54a356dcc4..e9c3fdb17a 100644 --- a/modules/atmosphere/shaders/atmosphere_deferred_fs.glsl +++ b/modules/atmosphere/shaders/atmosphere_deferred_fs.glsl @@ -128,14 +128,16 @@ vec4 calcShadow(const ShadowRenderingStruct shadowInfoArray[numberOfShadows], co if (ground) { if (hardShadows) { return vec4(0.2, 0.2, 0.2, 1.0); - } else { + } + else { return butterworthFunc(length_d, r_u_pi, 4.0); } } else { if (hardShadows) { return vec4(0.5, 0.5, 0.5, 1.0); - } else { + } + else { return vec4(vec3(length_d/r_p_pi), 1.0); } } @@ -143,7 +145,8 @@ vec4 calcShadow(const ShadowRenderingStruct shadowInfoArray[numberOfShadows], co else if ( length_d < r_p_pi ) {// penumbra if (hardShadows) { return vec4(0.5, 0.5, 0.5, 1.0); - } else { + } + else { return vec4(vec3(length_d/r_p_pi), 1.0); } } @@ -212,7 +215,8 @@ bool dAtmosphereIntersection(const dvec3 planetPosition, const dRay ray, const d inside = false; offset = s - q; maxLength = s + q; - } else { + } + else { inside = true; offset = 0.0; maxLength = s + q; @@ -332,7 +336,8 @@ vec3 inscatterRadiance(inout vec3 x, inout float t, inout float irradianceFactor // We set the irradianceFactor to 1.0 so the reflected irradiance will be considered // when calculating the reflected light on the ground. irradianceFactor = 1.0; - } else { + } + else { attenuation = analyticTransmittance(r, mu, t); //attenuation = transmittance(r, mu, t); groundHit = false; @@ -412,7 +417,8 @@ vec3 inscatterRadiance(inout vec3 x, inout float t, inout float irradianceFactor if (groundHit) { return finalScatteringRadiance; - } else { + } + else { //return ((r-Rg) * invRtMinusRg)*spaceColor.rgb + finalScatteringRadiance; return spaceColor.rgb + finalScatteringRadiance; // return attenuation * spaceColor.rgb + @@ -476,7 +482,8 @@ vec3 groundColor(const vec3 x, const float t, const vec3 v, const vec3 s, const vec3 RLStar = (muSun * transmittanceL0 + irradianceReflected) * sunIntensity / M_PI; if (dotNS < 0.05f) { groundRadiance = groundReflectance.rgb * mix(30.0f, 1.0f, smoothstep(-1.0f, 0.05f, dotNS)) * RLStar; - } else { + } + else { groundRadiance = groundReflectance.rgb * RLStar; } @@ -618,7 +625,8 @@ void main() { if (pixelDepth < offset) { // ATM Occluded - Something in fron of ATM. atmosphereFinalColor += color; - } else { + } + else { // Following paper nomenclature double t = offset; vec3 attenuation; @@ -658,7 +666,8 @@ void main() { groundColorV = groundColor(x, tF, v, s, r, mu, attenuation, color, normal.xyz, irradianceFactor, normal.a, sunIntensityGround); - } else { + } + else { // In order to get better performance, we are not tracing // multiple rays per pixel when the ray doesn't intersect // the ground. diff --git a/modules/atmosphere/shaders/deltaJ_calc_fs.glsl b/modules/atmosphere/shaders/deltaJ_calc_fs.glsl index 088267c6f0..d39e6e2e15 100644 --- a/modules/atmosphere/shaders/deltaJ_calc_fs.glsl +++ b/modules/atmosphere/shaders/deltaJ_calc_fs.glsl @@ -173,7 +173,8 @@ void inscatter(float r, float mu, float muSun, float nu, inout vec3 radianceJ) { // Initial InScattering including the phase functions radianceJ1 += singleRay * phaseRaySW + singleMie * phaseMieSW; - } else { + } + else { // On line 9 of the algorithm, the texture table deltaSR is updated, so when we are not in the first // iteraction, we are getting the updated result of deltaSR (not the single inscattered light but the // accumulated (higher order) inscattered light. diff --git a/modules/atmosphere/shaders/inScattering_calc_fs.glsl b/modules/atmosphere/shaders/inScattering_calc_fs.glsl index fc8adbda28..6201fc1acb 100644 --- a/modules/atmosphere/shaders/inScattering_calc_fs.glsl +++ b/modules/atmosphere/shaders/inScattering_calc_fs.glsl @@ -68,7 +68,8 @@ void integrand(const float r, const float mu, const float muSun, const float nu, if (ozoneLayerEnabled) { S_R = (exp(-(ri - Rg) / HO) + exp( -(ri - Rg) / HR )) * transmittanceY; S_M = exp( -(ri - Rg) / HM ) * transmittanceY; - } else { + } + else { S_R = exp( -(ri - Rg) / HR ) * transmittanceY; S_M = exp( -(ri - Rg) / HM ) * transmittanceY; } diff --git a/modules/atmosphere/shaders/irradiance_sup_calc_fs.glsl b/modules/atmosphere/shaders/irradiance_sup_calc_fs.glsl index 72e2f58a04..07ba931806 100644 --- a/modules/atmosphere/shaders/irradiance_sup_calc_fs.glsl +++ b/modules/atmosphere/shaders/irradiance_sup_calc_fs.glsl @@ -78,7 +78,8 @@ void main(void) { vec3 singleMie = texture4D(deltaSMTexture, r, w.z, muSun, nu).rgb; // w.z is the cosine(theta) = mu for vec(w) and also vec(w) dot vec(n(xo)) irradianceE += (singleRay * phaseRay + singleMie * phaseMie) * w.z * dw; - } else { + } + else { // On line 10 of the algorithm, the texture table deltaE is updated, so when we are not in the first // iteraction, we are getting the updated result of deltaE (not the single irradiance light but the // accumulated (higher order) irradiance light. diff --git a/modules/atmosphere/shaders/transmittance_calc_fs.glsl b/modules/atmosphere/shaders/transmittance_calc_fs.glsl index 479a729b00..3413b91e41 100644 --- a/modules/atmosphere/shaders/transmittance_calc_fs.glsl +++ b/modules/atmosphere/shaders/transmittance_calc_fs.glsl @@ -82,7 +82,8 @@ void main(void) { opDepth = betaOzoneExtinction * (0.0000006) * opticalDepth(r, muSun, HO) + betaMieExtinction * opticalDepth(r, muSun, HM) + betaRayleigh * opticalDepth(r, muSun, HR); - } else { + } + else { opDepth = betaMieExtinction * opticalDepth(r, muSun, HM) + betaRayleigh * opticalDepth(r, muSun, HR); } diff --git a/modules/base/rendering/renderableplaneimagelocal.cpp b/modules/base/rendering/renderableplaneimagelocal.cpp index a83340ca9f..5c106c21ed 100644 --- a/modules/base/rendering/renderableplaneimagelocal.cpp +++ b/modules/base/rendering/renderableplaneimagelocal.cpp @@ -102,7 +102,8 @@ RenderablePlaneImageLocal::RenderablePlaneImageLocal(const ghoul::Dictionary& di ); if (renderType == "Background") { setRenderBin(Renderable::RenderBin::Background); - } else if (renderType == "Opaque") { + } + else if (renderType == "Opaque") { setRenderBin(Renderable::RenderBin::Opaque); } else if (renderType == "Transparent") { diff --git a/modules/base/rendering/renderablesphere.cpp b/modules/base/rendering/renderablesphere.cpp index f512eefe8e..37939db68a 100644 --- a/modules/base/rendering/renderablesphere.cpp +++ b/modules/base/rendering/renderablesphere.cpp @@ -424,7 +424,8 @@ void RenderableSphere::render(const RenderData& data, RendererTasks&) { if (orientation == Orientation::Inside) { glCullFace(GL_FRONT); - } else if (orientation == Orientation::Both) { + } + else if (orientation == Orientation::Both) { glDisable(GL_CULL_FACE); } @@ -455,7 +456,8 @@ void RenderableSphere::render(const RenderData& data, RendererTasks&) { if (orientation == Orientation::Inside) { glCullFace(GL_BACK); - } else if (orientation == Orientation::Both) { + } + else if (orientation == Orientation::Both) { glEnable(GL_CULL_FACE); } } diff --git a/modules/base/rotation/staticrotation.cpp b/modules/base/rotation/staticrotation.cpp index 26333b4902..c5ca228c74 100644 --- a/modules/base/rotation/staticrotation.cpp +++ b/modules/base/rotation/staticrotation.cpp @@ -109,13 +109,15 @@ StaticRotation::StaticRotation(const ghoul::Dictionary& dictionary) : StaticRota dictionary.value(RotationInfo.identifier) ); _matrixIsDirty = true; - } else if (dictionary.hasKeyAndValue(RotationInfo.identifier)) { + } + else if (dictionary.hasKeyAndValue(RotationInfo.identifier)) { glm::dvec4 data = dictionary.value(RotationInfo.identifier); _eulerRotation = rotationMatrixToEulerAngles( glm::mat3_cast(glm::dquat(data.w, data.x, data.y, data.z)) ); _matrixIsDirty = true; - } else if (dictionary.hasKeyAndValue(RotationInfo.identifier)) { + } + else if (dictionary.hasKeyAndValue(RotationInfo.identifier)) { _eulerRotation = rotationMatrixToEulerAngles( dictionary.value(RotationInfo.identifier) ); diff --git a/modules/base/shaders/renderabletrail_apple_fs.glsl b/modules/base/shaders/renderabletrail_apple_fs.glsl index f0f83b0285..d89b3cc720 100644 --- a/modules/base/shaders/renderabletrail_apple_fs.glsl +++ b/modules/base/shaders/renderabletrail_apple_fs.glsl @@ -2,7 +2,7 @@ * * * OpenSpace * * * - * Copyright (c) 2014-2019 * + * Copyright (c) 2014-2020 * * * * 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 * diff --git a/modules/base/shaders/renderabletrail_apple_vs.glsl b/modules/base/shaders/renderabletrail_apple_vs.glsl index 4c4db42aac..aa6224c3af 100644 --- a/modules/base/shaders/renderabletrail_apple_vs.glsl +++ b/modules/base/shaders/renderabletrail_apple_vs.glsl @@ -2,7 +2,7 @@ * * * OpenSpace * * * - * Copyright (c) 2014-2019 * + * Copyright (c) 2014-2020 * * * * 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 * diff --git a/modules/base/shaders/renderabletrail_fs.glsl b/modules/base/shaders/renderabletrail_fs.glsl index a5d9ce25d1..86aae007f2 100644 --- a/modules/base/shaders/renderabletrail_fs.glsl +++ b/modules/base/shaders/renderabletrail_fs.glsl @@ -67,7 +67,8 @@ Fragment getFragment() { if (distanceCenter > dLW) { frag.color.a = 0.0; - } else { + } + else { frag.color.a *= pow(float((dLW - distanceCenter) / dLW), blendFactor); } diff --git a/modules/base/timeframe/timeframeinterval.cpp b/modules/base/timeframe/timeframeinterval.cpp index 84d6dc28bf..53d8ebc1b9 100644 --- a/modules/base/timeframe/timeframeinterval.cpp +++ b/modules/base/timeframe/timeframeinterval.cpp @@ -133,7 +133,8 @@ TimeFrameInterval::TimeFrameInterval(const ghoul::Dictionary& dictionary) dictionary.value(StartInfo.identifier) ); _hasStart = true; - } else if (dictionary.hasValue(StartInfo.identifier)) { + } + else if (dictionary.hasValue(StartInfo.identifier)) { _start = dictionary.value(StartInfo.identifier); _hasStart = true; } diff --git a/modules/cefwebgui/cefwebguimodule.cpp b/modules/cefwebgui/cefwebguimodule.cpp index 478b5847b5..2d5b7c520d 100644 --- a/modules/cefwebgui/cefwebguimodule.cpp +++ b/modules/cefwebgui/cefwebguimodule.cpp @@ -121,7 +121,8 @@ void CefWebGuiModule::startOrStopGui() { _instance->setZoom(_guiScale); webBrowserModule->addBrowser(_instance.get()); - } else if (_instance) { + } + else if (_instance) { _instance->close(true); webBrowserModule->removeBrowser(_instance.get()); webBrowserModule->detachEventHandler(); @@ -176,7 +177,8 @@ void CefWebGuiModule::internalInitialize(const ghoul::Dictionary& configuration) if (_visible && _instance) { webBrowserModule->attachEventHandler(_instance.get()); - } else { + } + else { webBrowserModule->detachEventHandler(); } }); diff --git a/modules/cefwebgui/shaders/gui_fs.glsl b/modules/cefwebgui/shaders/gui_fs.glsl index 9dda0651ab..3b31cb9184 100644 --- a/modules/cefwebgui/shaders/gui_fs.glsl +++ b/modules/cefwebgui/shaders/gui_fs.glsl @@ -2,7 +2,7 @@ * * * OpenSpace * * * - * Copyright (c) 2014-2019 * + * Copyright (c) 2014-2020 * * * * 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 * diff --git a/modules/cefwebgui/shaders/gui_vs.glsl b/modules/cefwebgui/shaders/gui_vs.glsl index 2323d505d3..f8ee811e0a 100644 --- a/modules/cefwebgui/shaders/gui_vs.glsl +++ b/modules/cefwebgui/shaders/gui_vs.glsl @@ -2,7 +2,7 @@ * * * OpenSpace * * * - * Copyright (c) 2014-2019 * + * Copyright (c) 2014-2020 * * * * 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 * diff --git a/modules/digitaluniverse/rendering/renderablebillboardscloud.cpp b/modules/digitaluniverse/rendering/renderablebillboardscloud.cpp index e7df8224e0..688d518611 100644 --- a/modules/digitaluniverse/rendering/renderablebillboardscloud.cpp +++ b/modules/digitaluniverse/rendering/renderablebillboardscloud.cpp @@ -465,7 +465,8 @@ RenderableBillboardsCloud::RenderableBillboardsCloud(const ghoul::Dictionary& di if (o == "Camera View Direction") { _renderOption = RenderOptionViewDirection; - } else if (o == "Camera Position Normal") { + } + else if (o == "Camera Position Normal") { _renderOption = RenderOptionPositionNormal; } } diff --git a/modules/digitaluniverse/rendering/renderabledumeshes.cpp b/modules/digitaluniverse/rendering/renderabledumeshes.cpp index 8a1d259747..bdc7b80436 100644 --- a/modules/digitaluniverse/rendering/renderabledumeshes.cpp +++ b/modules/digitaluniverse/rendering/renderabledumeshes.cpp @@ -713,7 +713,8 @@ bool RenderableDUMeshes::readSpeckFile() { //file.seekg(position); //break; continue; - } else { + } + else { //if (line.substr(0, 4) == "mesh") { // mesh lines are structured as follows: diff --git a/modules/digitaluniverse/shaders/billboard_gs.glsl b/modules/digitaluniverse/shaders/billboard_gs.glsl index 23e4f88912..2ee4ea61cd 100644 --- a/modules/digitaluniverse/shaders/billboard_gs.glsl +++ b/modules/digitaluniverse/shaders/billboard_gs.glsl @@ -78,15 +78,20 @@ void main() { // Must be the same as the enum in RenderableBillboardsCloud.h if (pos.w == 1.f) { unit = 1E3; - } else if (pos.w == 2.f) { + } + else if (pos.w == 2.f) { unit = PARSEC; - } else if (pos.w == 3.f) { + } + else if (pos.w == 3.f) { unit = 1E3 * PARSEC; - } else if (pos.w == 4.f) { + } + else if (pos.w == 4.f) { unit = 1E6 * PARSEC; - } else if (pos.w == 5.f) { + } + else if (pos.w == 5.f) { unit = 1E9 * PARSEC; - } else if (pos.w == 6.f) { + } + else if (pos.w == 6.f) { // Convertion factor from Parsecs to GigalightYears unit = 306391534.73091 * PARSEC; } @@ -105,7 +110,8 @@ void main() { if (renderOption == 0) { scaledRight = scaleMultiply * right * 0.5f; scaledUp = scaleMultiply * up * 0.5f; - } else if (renderOption == 1) { + } + else if (renderOption == 1) { vec3 normal = vec3(normalize(cameraPosition - dpos.xyz)); vec3 newRight = normalize(cross(cameraLookUp, normal)); vec3 newUp = cross(normal, newRight); @@ -148,7 +154,8 @@ void main() { scaledRight *= correctionScale; scaledUp *= correctionScale; - } else { + } + else { // linear alpha decay if (sizes.x < 2.0f * minBillboardSize) { float maxVar = 2.0f * minBillboardSize; diff --git a/modules/digitaluniverse/shaders/points_fs.glsl b/modules/digitaluniverse/shaders/points_fs.glsl index 35bf38a6db..ff55cd58d8 100644 --- a/modules/digitaluniverse/shaders/points_fs.glsl +++ b/modules/digitaluniverse/shaders/points_fs.glsl @@ -41,7 +41,8 @@ Fragment getFragment() { if (hasColorMap) { frag.color = vec4(colorMap.xyz, alphaValue); - } else { + } + else { frag.color = vec4(color, alphaValue); } diff --git a/modules/fieldlinessequence/rendering/renderablefieldlinessequence.cpp b/modules/fieldlinessequence/rendering/renderablefieldlinessequence.cpp index c560fca43e..003ec69e3c 100644 --- a/modules/fieldlinessequence/rendering/renderablefieldlinessequence.cpp +++ b/modules/fieldlinessequence/rendering/renderablefieldlinessequence.cpp @@ -1157,12 +1157,14 @@ void RenderableFieldlinesSequence::update(const UpdateData& data) { if (_loadingStatesDynamically) { _mustLoadNewStateFromDisk = true; - } else { + } + else { _needsUpdate = true; _activeStateIndex = _activeTriggerTimeIndex; } } // else {we're still in same state as previous frame (no changes needed)} - } else { + } + else { // Not in interval => set everything to false _activeTriggerTimeIndex = -1; _mustLoadNewStateFromDisk = false; @@ -1221,7 +1223,8 @@ void RenderableFieldlinesSequence::updateActiveTriggerTimeIndex(double currentTi else { _activeTriggerTimeIndex = 0; } - } else { + } + else { _activeTriggerTimeIndex = static_cast(_nStates) - 1; } } diff --git a/modules/fieldlinessequence/shaders/fieldlinessequence_vs.glsl b/modules/fieldlinessequence/shaders/fieldlinessequence_vs.glsl index 6b0405fd9f..400b69a0c5 100644 --- a/modules/fieldlinessequence/shaders/fieldlinessequence_vs.glsl +++ b/modules/fieldlinessequence/shaders/fieldlinessequence_vs.glsl @@ -107,7 +107,8 @@ void main() { if (isParticle) { vs_color = flowColor; - } else { + } + else { vs_color = lineColor; } @@ -115,7 +116,8 @@ void main() { vec4 quantityColor = getTransferFunctionColor(); vs_color = vec4(quantityColor.xyz, vs_color.a * quantityColor.a); } - } else { + } + else { vs_color = vec4(0); } diff --git a/modules/fieldlinessequence/util/commons.cpp b/modules/fieldlinessequence/util/commons.cpp index b3aef7b491..9602b52b9b 100644 --- a/modules/fieldlinessequence/util/commons.cpp +++ b/modules/fieldlinessequence/util/commons.cpp @@ -29,9 +29,11 @@ namespace openspace::fls { Model stringToModel(const std::string& s) { if (s == "batsrus") { return Model::Batsrus; - } else if (s == "enlil") { + } + else if (s == "enlil") { return Model::Enlil; - } else if (s == "pfss") { + } + else if (s == "pfss") { return Model::Pfss; } return Model::Invalid; diff --git a/modules/fieldlinessequence/util/kameleonfieldlinehelper.cpp b/modules/fieldlinessequence/util/kameleonfieldlinehelper.cpp index 63b0f6f85d..76daab2b7a 100644 --- a/modules/fieldlinessequence/util/kameleonfieldlinehelper.cpp +++ b/modules/fieldlinessequence/util/kameleonfieldlinehelper.cpp @@ -236,7 +236,8 @@ void addExtraQuantities(ccmc::Kameleon* kameleon, val = interpolator->interpolate("p", p.x, p.y, p.z); val *= ToKelvin; val /= interpolator->interpolate("rho", p.x, p.y, p.z); - } else { + } + else { val = interpolator->interpolate(extraScalarVars[i], p.x, p.y, p.z); // When measuring density in ENLIL CCMC multiply by the radius^2 @@ -265,7 +266,8 @@ void addExtraQuantities(ccmc::Kameleon* kameleon, // the magnetic field vector! val = glm::dot(glm::vec3(x,y,z), normMagnetic); - } else { + } + else { val = std::sqrt(x*x + y*y + z*z); } state.appendToExtra(i + nXtraScalars, val); @@ -315,7 +317,8 @@ void prepareStateAndKameleonForExtras(ccmc::Kameleon* kameleon, )); extraScalarVars.erase(extraScalarVars.begin() + i); --i; - } else { + } + else { extraQuantityNames.push_back(str); } } @@ -359,11 +362,13 @@ void prepareStateAndKameleonForExtras(ccmc::Kameleon* kameleon, extraMagVars.begin() + i + 3 ); i -= 3; - } else { + } + else { extraQuantityNames.push_back(std::move(name)); } } - } else { + } + else { // WRONG NUMBER OF MAGNITUDE VARIABLES.. REMOVE ALL! extraMagVars.clear(); LWARNING(fmt::format( diff --git a/modules/gaia/shaders/gaia_billboard_ge.glsl b/modules/gaia/shaders/gaia_billboard_ge.glsl index 6ff847259d..3296ae1fa2 100644 --- a/modules/gaia/shaders/gaia_billboard_ge.glsl +++ b/modules/gaia/shaders/gaia_billboard_ge.glsl @@ -100,15 +100,15 @@ void main() { // Discard geometry if star has no position (but wasn't a nullArray). // Or if observed distance is above threshold set by cutOffThreshold. // By discarding in gs instead of fs we save computations for when nothing is visible. - if( length(position) < EPS || distThreshold <= 0){ + if (length(position) < EPS || distThreshold <= 0) { return; } vec4 centerWorldPos = vs_gPosition[0]; - dvec3 cameraNormal = normalize(cameraPos - dvec3(centerWorldPos.xyz)); + dvec3 cameraNormal = normalize(cameraPos - dvec3(centerWorldPos.xyz)); dvec3 newRight = normalize(cross(cameraLookUp, cameraNormal)); - dvec3 newUp = cross(cameraNormal, newRight); + dvec3 newUp = cross(cameraNormal, newRight); vec4 wCameraRight = vec4(newRight, 0.0); vec4 wCameraUp = vec4(newUp, 0.0); diff --git a/modules/gaia/shaders/gaia_point_ge.glsl b/modules/gaia/shaders/gaia_point_ge.glsl index e8eeecb2aa..b36e18f5bb 100644 --- a/modules/gaia/shaders/gaia_point_ge.glsl +++ b/modules/gaia/shaders/gaia_point_ge.glsl @@ -61,14 +61,14 @@ void main() { // Discard geometry if star has no position (but wasn't a nullArray). // Or if observed distance is above threshold set by cutOffThreshold. // By discarding in gs instead of fs we save computations for when nothing is visible. - if( length(position) < EPS || distThreshold <= 0){ + if (length(position) < EPS || distThreshold <= 0) { return; } //gl_PointSize = 1.0; gl_Position = position; gl_Position.z = 0.0; - ge_gPosition = viewPosition; + ge_gPosition = viewPosition; EmitVertex(); diff --git a/modules/gaia/shaders/gaia_ssbo_vs.glsl b/modules/gaia/shaders/gaia_ssbo_vs.glsl index 08aee91a65..ecd6f1b064 100644 --- a/modules/gaia/shaders/gaia_ssbo_vs.glsl +++ b/modules/gaia/shaders/gaia_ssbo_vs.glsl @@ -179,7 +179,8 @@ void main() { if ( length(in_position) > EPS ){ vs_gPosition = vec4(model * objectPosition); gl_Position = vec4(projection * viewPosition); - } else { + } + else { vs_gPosition = vec4(0.0); gl_Position = vec4(0.0); } diff --git a/modules/gaia/shaders/gaia_tonemapping_point_fs.glsl b/modules/gaia/shaders/gaia_tonemapping_point_fs.glsl index 6b91cc0ef0..f2da517b0b 100644 --- a/modules/gaia/shaders/gaia_tonemapping_point_fs.glsl +++ b/modules/gaia/shaders/gaia_tonemapping_point_fs.glsl @@ -82,7 +82,8 @@ Fragment getFragment() { //vec2 screenOrigo = vec2(-left, -bottom) / vec2(right - left, top - bottom); //if (abs(screenOrigo.x - uv.x) > 0.0005 && abs(screenOrigo.y - uv.y) > 0.0005) { // origoFrag.color = vec4(0.0); - //} else { + //} + //else { // origoFrag.color = vec4(1.0); //} //return origoFrag; diff --git a/modules/gaia/shaders/gaia_vbo_vs.glsl b/modules/gaia/shaders/gaia_vbo_vs.glsl index a87aacf2d1..f5a635c3d2 100644 --- a/modules/gaia/shaders/gaia_vbo_vs.glsl +++ b/modules/gaia/shaders/gaia_vbo_vs.glsl @@ -112,7 +112,8 @@ void main() { if ( length(in_position) > EPS ){ vs_gPosition = vec4(model * objectPosition); gl_Position = vec4(projection * viewPosition); - } else { + } + else { vs_gPosition = vec4(0.0); gl_Position = vec4(0.0); } diff --git a/modules/galaxy/shaders/galaxyraycast.glsl b/modules/galaxy/shaders/galaxyraycast.glsl index dab687e3ca..5bc7bcb4c6 100644 --- a/modules/galaxy/shaders/galaxyraycast.glsl +++ b/modules/galaxy/shaders/galaxyraycast.glsl @@ -2,7 +2,7 @@ * * * OpenSpace * * * -* Copyright (c) 2014-2019 * +* Copyright (c) 2014-2020 * * * * 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 * diff --git a/modules/galaxy/shaders/raycasterbounds_fs.glsl b/modules/galaxy/shaders/raycasterbounds_fs.glsl index 993bc884e1..2ff99f2c5a 100644 --- a/modules/galaxy/shaders/raycasterbounds_fs.glsl +++ b/modules/galaxy/shaders/raycasterbounds_fs.glsl @@ -32,10 +32,10 @@ Fragment getFragment() { Fragment frag; //Early ray termination on black parts of the data /*vec3 normalizedPos = (modelPosition*2.0)-1.0; - if(abs(modelPosition.x) > 0.9 || abs(modelPosition.y) > 0.9){ + if (abs(modelPosition.x) > 0.9 || abs(modelPosition.y) > 0.9) { frag.color = vec4(0.0, 0.0, 0.0, 1.0); } - else{*/ + else {*/ vec3 pos = modelPosition + 0.5; //vec3 posClamp = clamp(pos, vec3(0.0), vec3(1.0)); frag.color = vec4(pos, 1.0); diff --git a/modules/globebrowsing/shaders/blending.hglsl b/modules/globebrowsing/shaders/blending.hglsl index 2157a1314c..166ec948d1 100644 --- a/modules/globebrowsing/shaders/blending.hglsl +++ b/modules/globebrowsing/shaders/blending.hglsl @@ -78,9 +78,11 @@ vec3 rgb2hsl(in vec3 c) { float h = 0.0; if (r == cMax) { h = (g - b) / cDelta; - } else if (g == cMax) { + } + else if (g == cMax) { h = 2.0 + (b - r) / cDelta; - } else { + } + else { h = 4.0 + (r - g) / cDelta; } diff --git a/modules/globebrowsing/shaders/smviewer_fs.glsl b/modules/globebrowsing/shaders/smviewer_fs.glsl index 0d58b4e8aa..62719a89a5 100644 --- a/modules/globebrowsing/shaders/smviewer_fs.glsl +++ b/modules/globebrowsing/shaders/smviewer_fs.glsl @@ -2,7 +2,7 @@ * * * OpenSpace * * * - * Copyright (c) 2014-2019 * + * Copyright (c) 2014-2020 * * * * 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 * diff --git a/modules/globebrowsing/shaders/smviewer_vs.glsl b/modules/globebrowsing/shaders/smviewer_vs.glsl index 958527c339..c5bb033b36 100644 --- a/modules/globebrowsing/shaders/smviewer_vs.glsl +++ b/modules/globebrowsing/shaders/smviewer_vs.glsl @@ -2,7 +2,7 @@ * * * OpenSpace * * * - * Copyright (c) 2014-2019 * + * Copyright (c) 2014-2020 * * * * 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 * diff --git a/modules/globebrowsing/src/lrucache.inl b/modules/globebrowsing/src/lrucache.inl index 2d3dd0b140..2e67893a80 100644 --- a/modules/globebrowsing/src/lrucache.inl +++ b/modules/globebrowsing/src/lrucache.inl @@ -69,7 +69,8 @@ bool LRUCache::touch(const KeyType& key) { _itemMap.emplace(key, _itemList.begin()); return true; - } else { + } + else { return false; } } diff --git a/modules/globebrowsing/src/renderableglobe.cpp b/modules/globebrowsing/src/renderableglobe.cpp index 257ebd550f..d205fc4a5a 100644 --- a/modules/globebrowsing/src/renderableglobe.cpp +++ b/modules/globebrowsing/src/renderableglobe.cpp @@ -330,7 +330,7 @@ BoundingHeights boundingHeightsForChunk(const Chunk& chunk, const LayerManager& } lastHadMissingData = tileMetaData.hasMissingData[HeightChannel]; } - else if(chunkTile.tile.status == Tile::Status::Unavailable) { + else if (chunkTile.tile.status == Tile::Status::Unavailable) { boundingHeights.tileOK = false; } diff --git a/modules/imgui/src/guiassetcomponent.cpp b/modules/imgui/src/guiassetcomponent.cpp index bff854cdd3..34fb9d629a 100644 --- a/modules/imgui/src/guiassetcomponent.cpp +++ b/modules/imgui/src/guiassetcomponent.cpp @@ -112,7 +112,8 @@ void GuiAssetComponent::renderTree(const Asset& asset, const std::string& relati if (requested.empty() && required.empty() && resourceSyncs.empty()) { ImGui::Text("%s", assetText.c_str()); - } else if (ImGui::TreeNode(assetPath.c_str(), "%s", assetText.c_str())) { + } + else if (ImGui::TreeNode(assetPath.c_str(), "%s", assetText.c_str())) { for (const std::shared_ptr& child : required) { renderTree(*child, assetDirectory); } diff --git a/modules/imgui/src/guiiswacomponent.cpp b/modules/imgui/src/guiiswacomponent.cpp index 0b0824ca11..468968de69 100644 --- a/modules/imgui/src/guiiswacomponent.cpp +++ b/modules/imgui/src/guiiswacomponent.cpp @@ -87,7 +87,8 @@ void GuiIswaComponent::render() { script, scripting::ScriptEngine::RemoteScripting::Yes ); - } else { + } + else { global::scriptEngine.queueScript( "openspace.iswa.removeGroup('GMData');", scripting::ScriptEngine::RemoteScripting::Yes @@ -106,7 +107,8 @@ void GuiIswaComponent::render() { script, scripting::ScriptEngine::RemoteScripting::Yes ); - } else { + } + else { global::scriptEngine.queueScript( "openspace.iswa.removeGroup('GMImage');", scripting::ScriptEngine::RemoteScripting::Yes @@ -114,13 +116,14 @@ void GuiIswaComponent::render() { } } - if(_ionData != oldIonDataValue) { - if(_ionData) { + if (_ionData != oldIonDataValue) { + if (_ionData) { global::scriptEngine.queueScript( "openspace.iswa.addCygnet(-10, 'Data', 'Ionosphere');", scripting::ScriptEngine::RemoteScripting::Yes ); - } else { + } + else { global::scriptEngine.queueScript( "openspace.iswa.removeGroup('Ionosphere');", scripting::ScriptEngine::RemoteScripting::Yes @@ -202,7 +205,8 @@ void GuiIswaComponent::render() { "openspace.iswa.addScreenSpaceCygnet({CygnetId=" + idStr + "});", scripting::ScriptEngine::RemoteScripting::Yes ); - } else { + } + else { global::scriptEngine.queueScript( "openspace.iswa.removeScreenSpaceCygnet(" + idStr + ");", scripting::ScriptEngine::RemoteScripting::Yes diff --git a/modules/imgui/src/guiparallelcomponent.cpp b/modules/imgui/src/guiparallelcomponent.cpp index b108911774..60527364bc 100644 --- a/modules/imgui/src/guiparallelcomponent.cpp +++ b/modules/imgui/src/guiparallelcomponent.cpp @@ -146,7 +146,8 @@ void GuiParallelComponent::renderHost() { const size_t nClients = nConnections - 1; if (nClients == 1) { connectionInfo = "Hosting session with 1 client"; - } else { + } + else { connectionInfo = "Hosting session with " + std::to_string(nClients) + " clients"; } diff --git a/modules/iswa/rendering/datacygnet.cpp b/modules/iswa/rendering/datacygnet.cpp index 6b556a073a..35e17aae52 100644 --- a/modules/iswa/rendering/datacygnet.cpp +++ b/modules/iswa/rendering/datacygnet.cpp @@ -140,7 +140,8 @@ bool DataCygnet::updateTexture() { texture->setFilter(Texture::FilterMode::LinearMipMap); _textures[option] = std::move(texture); } - } else { + } + else { _textures[option]->setPixelData(values); _textures[option]->uploadTexture(); } @@ -227,7 +228,8 @@ void DataCygnet::setTextureUniforms() { tfUnits[0].activate(); _transferFunctions[0].bind(); _shader->setUniform("transferFunctions[0]", tfUnits[0]); - } else { + } + else { for (int option : selectedOptions) { if (static_cast(_transferFunctions.size()) >= option) { tfUnits[j].activate(); @@ -284,7 +286,8 @@ void DataCygnet::fillOptions(const std::string& source) { g->registerOptions(_dataOptions.options()); _dataOptions.setValue(g->dataOptionsValue()); - } else { + } + else { _dataOptions.setValue(std::vector(1, 0)); } } diff --git a/modules/iswa/rendering/dataplane.cpp b/modules/iswa/rendering/dataplane.cpp index 4e51556b0d..a4dcc8ce83 100644 --- a/modules/iswa/rendering/dataplane.cpp +++ b/modules/iswa/rendering/dataplane.cpp @@ -49,7 +49,8 @@ void DataPlane::initializeGL() { if (_group) { _dataProcessor = _group->dataProcessor(); subscribeToGroup(); - } else { + } + else { _dataProcessor = std::make_shared(); //If autofiler is on, background values property should be hidden @@ -60,7 +61,8 @@ void DataPlane::initializeGL() { _backgroundValues = _dataProcessor->filterValues(); _backgroundValues.setVisibility(properties::Property::Visibility::Hidden); // else if autofilter is turned off, register backgroundValues - } else { + } + else { _backgroundValues.setVisibility(properties::Property::Visibility::All); } }); @@ -148,7 +150,7 @@ std::vector DataPlane::textureData(){ return std::vector(); } - if(!_dataOptions.options().size()) { // load options for value selection + if (!_dataOptions.options().size()) { // load options for value selection fillOptions(_dataBuffer); _dataProcessor->addDataValues(_dataBuffer, _dataOptions); diff --git a/modules/iswa/rendering/datasphere.cpp b/modules/iswa/rendering/datasphere.cpp index 868ee0de16..318b9d8a19 100644 --- a/modules/iswa/rendering/datasphere.cpp +++ b/modules/iswa/rendering/datasphere.cpp @@ -60,7 +60,8 @@ void DataSphere::initializeGL() { if (_group) { _dataProcessor = _group->dataProcessor(); subscribeToGroup(); - } else { + } + else { _dataProcessor = std::make_shared(); //If autofiler is on, background values property should be hidden _autoFilter.onChange([this]() { @@ -71,7 +72,8 @@ void DataSphere::initializeGL() { _backgroundValues.setVisibility(properties::Property::Visibility::Hidden); //_backgroundValues.setVisible(false); // else if autofilter is turned off, register backgroundValues - } else { + } + else { _backgroundValues.setVisibility(properties::Property::Visibility::All); //_backgroundValues.setVisible(true); } diff --git a/modules/iswa/rendering/iswacygnet.cpp b/modules/iswa/rendering/iswacygnet.cpp index e4d0b91906..2482037464 100644 --- a/modules/iswa/rendering/iswacygnet.cpp +++ b/modules/iswa/rendering/iswacygnet.cpp @@ -110,7 +110,8 @@ void IswaCygnet::initializeGL() { if (!_data.groupName.empty()) { initializeGroup(); - } else { + } + else { _delete.onChange([this]() { deinitialize(); global::scriptEngine.queueScript( diff --git a/modules/iswa/rendering/iswadatagroup.cpp b/modules/iswa/rendering/iswadatagroup.cpp index 89f563871a..33a6275dab 100644 --- a/modules/iswa/rendering/iswadatagroup.cpp +++ b/modules/iswa/rendering/iswadatagroup.cpp @@ -134,7 +134,8 @@ void IswaDataGroup::registerProperties() { _backgroundValues.setVisibility(properties::Property::Visibility::Hidden); //_backgroundValues.setVisible(false); // else if autofilter is turned off, register backgroundValues - } else { + } + else { _backgroundValues.setVisibility(properties::Property::Visibility::All); //_backgroundValues.setVisible(true); } @@ -194,9 +195,11 @@ void IswaDataGroup::registerOptions( void IswaDataGroup::createDataProcessor() { if (_type == typeid(DataPlane).name()) { _dataProcessor = std::make_shared(); - }else if (_type == typeid(DataSphere).name()) { + } + else if (_type == typeid(DataSphere).name()) { _dataProcessor = std::make_shared(); - }else if (_type == typeid(KameleonPlane).name()) { + } + else if (_type == typeid(KameleonPlane).name()) { _dataProcessor = std::make_shared(); } } diff --git a/modules/iswa/rendering/iswakameleongroup.cpp b/modules/iswa/rendering/iswakameleongroup.cpp index ffff28ada9..df227ff0b5 100644 --- a/modules/iswa/rendering/iswakameleongroup.cpp +++ b/modules/iswa/rendering/iswakameleongroup.cpp @@ -155,7 +155,8 @@ void IswaKameleonGroup::updateFieldlineSeeds() { ); std::get<2>(seedPath.second) = false; // if this option was turned on - } else if (it != options.end() && !std::get<2>(seedPath.second)) { + } + else if (it != options.end() && !std::get<2>(seedPath.second)) { LDEBUG("Created fieldlines: " + std::get<0>(seedPath.second)); IswaManager::ref().createFieldline( diff --git a/modules/iswa/rendering/kameleonplane.cpp b/modules/iswa/rendering/kameleonplane.cpp index 18ee019d18..bfc889e835 100644 --- a/modules/iswa/rendering/kameleonplane.cpp +++ b/modules/iswa/rendering/kameleonplane.cpp @@ -131,7 +131,8 @@ void KameleonPlane::initializeGL() { if (_group) { _dataProcessor = _group->dataProcessor(); subscribeToGroup(); - } else { + } + else { _dataProcessor = std::make_shared(); //If autofiler is on, background values property should be hidden @@ -143,7 +144,8 @@ void KameleonPlane::initializeGL() { _backgroundValues.setVisibility(properties::Property::Visibility::Hidden); //_backgroundValues.setVisible(false); // else if autofilter is turned off, register backgroundValues - } else { + } + else { _backgroundValues.setVisibility(properties::Property::Visibility::All); //_backgroundValues.setVisible(true); } @@ -286,7 +288,8 @@ void KameleonPlane::updateFieldlineSeeds() { ); std::get<2>(seedPath.second) = false; // if this option was turned on - } else if (it != selectedOptions.end() && !std::get<2>(seedPath.second)) { + } + else if (it != selectedOptions.end() && !std::get<2>(seedPath.second)) { SceneGraphNode* n = global::renderEngine.scene()->sceneGraphNode( std::get<0>(seedPath.second) ); @@ -377,9 +380,11 @@ void KameleonPlane::setDimensions() { if (_cut == Cut::X) { _textureDimensions = glm::size3_t(_dimensions.y, _dimensions.z, 1); - } else if (_cut == Cut::Y) { + } + else if (_cut == Cut::Y) { _textureDimensions = glm::size3_t(_dimensions.x, _dimensions.z, 1); - } else { + } + else { _textureDimensions = glm::size3_t(_dimensions.x, _dimensions.y, 1); } } diff --git a/modules/iswa/rendering/texturecygnet.cpp b/modules/iswa/rendering/texturecygnet.cpp index 7d9823bcd4..7f21ffb29d 100644 --- a/modules/iswa/rendering/texturecygnet.cpp +++ b/modules/iswa/rendering/texturecygnet.cpp @@ -94,10 +94,12 @@ bool TextureCygnet::updateTextureResource() { if (imageFile.corrupted) { delete[] imageFile.buffer; return false; - } else { + } + else { _imageFile = imageFile; } - } else { + } + else { return false; } diff --git a/modules/iswa/shaders/dataplane_fs.glsl b/modules/iswa/shaders/dataplane_fs.glsl index 893fb2e313..9e53abf9cb 100644 --- a/modules/iswa/shaders/dataplane_fs.glsl +++ b/modules/iswa/shaders/dataplane_fs.glsl @@ -62,7 +62,8 @@ Fragment getFragment() { else { diffuse = texture(transferFunctions[0], vec2(v, 0.0)); } - } else { + } + else { float v = 0.0; for (int i = 0; i < numTextures; i++) { v = texture(textures[i], vs_st).r; diff --git a/modules/iswa/shaders/datasphere_fs.glsl b/modules/iswa/shaders/datasphere_fs.glsl index 58435e4ba3..a374bd57c2 100644 --- a/modules/iswa/shaders/datasphere_fs.glsl +++ b/modules/iswa/shaders/datasphere_fs.glsl @@ -2,7 +2,7 @@ * * * OpenSpace * * * - * Copyright (c) 2014-2019 * + * Copyright (c) 2014-2020 * * * * 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 * diff --git a/modules/iswa/shaders/datasphere_vs.glsl b/modules/iswa/shaders/datasphere_vs.glsl index fb4befc750..af4b217a9b 100644 --- a/modules/iswa/shaders/datasphere_vs.glsl +++ b/modules/iswa/shaders/datasphere_vs.glsl @@ -2,7 +2,7 @@ * * * OpenSpace * * * - * Copyright (c) 2014-2019 * + * Copyright (c) 2014-2020 * * * * 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 * diff --git a/modules/iswa/util/dataprocessor.cpp b/modules/iswa/util/dataprocessor.cpp index 7c8e82603b..0bda04e042 100644 --- a/modules/iswa/util/dataprocessor.cpp +++ b/modules/iswa/util/dataprocessor.cpp @@ -72,7 +72,8 @@ float DataProcessor::processDataPoint(float value, int option) { return histogram.equalize( normalizeWithStandardScore(value, mean, sd, _histNormValues) ) / 512.f; - } else { + } + else { return normalizeWithStandardScore(value, mean, sd, _normValues); } } @@ -153,7 +154,8 @@ void DataProcessor::calculateFilterValues(const std::vector& selectedOption standardDeviation, _normValues) ); - } else { + } + else { Histogram hist = _histograms[option]->equalize(); filterMid = hist.highestBinValue(true); filterWidth = 1.f / 512.f; diff --git a/modules/iswa/util/iswamanager.cpp b/modules/iswa/util/iswamanager.cpp index 0be92828ef..5046bb85a9 100644 --- a/modules/iswa/util/iswamanager.cpp +++ b/modules/iswa/util/iswamanager.cpp @@ -147,7 +147,8 @@ IswaManager& IswaManager::ref() { void IswaManager::addIswaCygnet(int id, const std::string& type, std::string group) { if (id > 0) { createScreenSpace(id); - } else if (id < 0) { + } + else if (id < 0) { // create metadata object and assign group and id MetadataFuture metaFuture; metaFuture.id = id; @@ -156,9 +157,11 @@ void IswaManager::addIswaCygnet(int id, const std::string& type, std::string gro // Assign type of cygnet Texture/Data if (type == _type[CygnetType::Texture]) { metaFuture.type = CygnetType::Texture; - } else if (type == _type[CygnetType::Data]) { + } + else if (type == _type[CygnetType::Data]) { metaFuture.type = CygnetType::Data; - } else { + } + else { LERROR("\""+ type + "\" is not a valid type"); return; } @@ -178,7 +181,8 @@ void IswaManager::addIswaCygnet(int id, const std::string& type, std::string gro if (j["Coordinate Type"].is_null()) { metaFuture.geom = CygnetGeometry::Sphere; createSphere(metaFuture); - } else if (j["Coordinate Type"] == "Cartesian") { + } + else if (j["Coordinate Type"] == "Cartesian") { metaFuture.geom = CygnetGeometry::Plane; createPlane(metaFuture); } @@ -258,7 +262,8 @@ std::string IswaManager::iswaUrl(int id, double timestamp, const std::string& ty std::string url; if (id < 0) { url = _baseUrl + type + "/" + std::to_string(-id) + "/"; - } else { + } + else { url = "http://iswa3.ccmc.gsfc.nasa.gov/IswaSystemWebApp/iSWACygnetStreamer?" "window=-1&cygnetId="+ std::to_string(id) +"×tamp="; } @@ -292,18 +297,21 @@ void IswaManager::registerGroup(std::string groupName, std::string type) { std::move(groupName), std::move(type) ); - } else if (kameleonGroup) { + } + else if (kameleonGroup) { _groups[groupName] = std::make_shared( std::move(groupName), std::move(type) ); - } else { + } + else { _groups[groupName] = std::make_shared( std::move(groupName), std::move(type) ); } - } else if (!_groups[groupName]->isType(type)) { + } + else if (!_groups[groupName]->isType(type)) { LWARNING("Can't add cygnet to groups with diffent type"); } } @@ -425,7 +433,8 @@ std::string IswaManager::parseKWToLuaTable(const CdfInfo& info, const std::strin spatialScale.w = 6; coordinateType = "Cartesian"; - } else { + } + else { spatialScale = glm::vec4(1.f); spatialScale.w = 1; //-log10(1.0f/max.x); coordinateType = "Polar"; @@ -514,7 +523,8 @@ void IswaManager::createPlane(MetadataFuture& data) { std::string type; if (data.type == CygnetType::Data) { type = typeid(DataPlane).name(); - } else { + } + else { type = typeid(TexturePlane).name(); } @@ -523,7 +533,8 @@ void IswaManager::createPlane(MetadataFuture& data) { auto it = _groups.find(data.group); if (it == _groups.end() || (*it).second->isType(type)) { name = data.group + "_" + name; - } else { + } + else { data.group = ""; } } @@ -549,14 +560,15 @@ void IswaManager::createSphere(MetadataFuture& data) { // check if this sphere already exist std::string name = _type[data.type] + _geom[data.geom] + std::to_string(data.id); - if(!data.group.empty()){ + if (!data.group.empty()){ std::string type = typeid(DataSphere).name(); registerGroup(data.group, type); auto it = _groups.find(data.group); if (it == _groups.end() || (*it).second->isType(type)) { name = data.group + "_" + name; - } else { + } + else { data.group = ""; } } @@ -589,7 +601,8 @@ void IswaManager::createKameleonPlane(CdfInfo info, std::string cut) { auto it = _groups.find(info.group); if (it == _groups.end() || (*it).second->isType(type)) { info.name = info.group + "_" + info.name; - } else { + } + else { info.group = ""; } } @@ -609,7 +622,8 @@ void IswaManager::createKameleonPlane(CdfInfo info, std::string cut) { scripting::ScriptEngine::RemoteScripting::Yes ); } - } else { + } + else { LWARNING( absPath(info.path) + " is not a cdf file or can't be found."); } } @@ -648,7 +662,8 @@ void IswaManager::createFieldline(std::string name, std::string cdfPath, scripting::ScriptEngine::RemoteScripting::Yes ); } - } else { + } + else { LWARNING( cdfPath + " is not a cdf file or can't be found."); } } @@ -728,7 +743,8 @@ void IswaManager::addCdfFiles(std::string cdfpath) { jsonFile.close(); } - } else { + } + else { LWARNING(cdfpath + " is not a cdf file or can't be found."); } } diff --git a/modules/iswa/util/iswamanager_lua.inl b/modules/iswa/util/iswamanager_lua.inl index fc93fd30db..b2f609ad3c 100644 --- a/modules/iswa/util/iswamanager_lua.inl +++ b/modules/iswa/util/iswamanager_lua.inl @@ -88,7 +88,8 @@ int iswa_addScreenSpaceCygnet(lua_State* L) { if (global::renderEngine.screenSpaceRenderable(name)) { LERROR("A cygnet with the name \"" + name +"\" already exist"); return 0; - } else { + } + else { d.setValue("Name", name); d.setValue("Type", "ScreenSpaceCygnet"); d.setValue("UpdateInterval", static_cast(updateInterval)); @@ -108,14 +109,17 @@ int iswa_addScreenSpaceCygnet(lua_State* L) { // std::string type = "x"; // std::string group = ""; -// if(nArguments > 0) +// if (nArguments > 0) { // kwPath = luaL_checkstring(L, 1); +// } -// if(nArguments > 1) +// if (nArguments > 1) { // type = luaL_checkstring(L, 2); +// } -// if(nArguments > 2) +// if (nArguments > 2) { // group = luaL_checkstring(L, 3); +// } // IswaManager::ref().createKameleonPlane(kwPath, type, group); // return 0; diff --git a/modules/kameleon/src/kameleonhelper.cpp b/modules/kameleon/src/kameleonhelper.cpp index 67d7983af2..53bbf3f08a 100644 --- a/modules/kameleon/src/kameleonhelper.cpp +++ b/modules/kameleon/src/kameleonhelper.cpp @@ -81,7 +81,8 @@ double getTime(ccmc::Kameleon* kameleon) { if (kameleon->doesAttributeExist("start_time")){ seqStartStr = kameleon->getGlobalAttribute("start_time").getAttributeString(); - } else if (kameleon->doesAttributeExist("tim_rundate_cal")) { + } + else if (kameleon->doesAttributeExist("tim_rundate_cal")) { seqStartStr = kameleon->getGlobalAttribute("tim_rundate_cal").getAttributeString(); const size_t N_CHARS = seqStartStr.length(); @@ -111,13 +112,16 @@ double getTime(ccmc::Kameleon* kameleon) { break; } } - } else if (kameleon->doesAttributeExist("tim_obsdate_cal")) { + } + else if (kameleon->doesAttributeExist("tim_obsdate_cal")) { seqStartStr = kameleon->getGlobalAttribute("tim_obsdate_cal").getAttributeString(); - } else if (kameleon->doesAttributeExist("tim_crstart_cal")) { + } + else if (kameleon->doesAttributeExist("tim_crstart_cal")) { seqStartStr = kameleon->getGlobalAttribute("tim_crstart_cal").getAttributeString(); - } else { + } + else { LWARNING( "No starting time attribute could be found in the .cdf file. Starting " "time is set to 01.JAN.2000 12:00." @@ -133,7 +137,8 @@ double getTime(ccmc::Kameleon* kameleon) { seqStartDbl = Time::convertTime( seqStartStr.substr(0, seqStartStr.length() - 2) ); - } else { + } + else { LWARNING("No starting time attribute could be found in the .cdf file." "Starting time is set to 01.JAN.2000 12:00."); seqStartDbl = 0.0; @@ -144,10 +149,12 @@ double getTime(ccmc::Kameleon* kameleon) { if (kameleon->doesAttributeExist("elapsed_time_in_seconds")) { ccmc::Attribute att = kameleon->getGlobalAttribute("elapsed_time_in_seconds"); stateStartOffset = static_cast(att.getAttributeFloat()); - } else if (kameleon->doesAttributeExist("time_physical_time")) { + } + else if (kameleon->doesAttributeExist("time_physical_time")) { ccmc::Attribute att = kameleon->getGlobalAttribute("time_physical_time"); stateStartOffset = static_cast(att.getAttributeFloat()); - } else { + } + else { stateStartOffset = 0.0; LWARNING("No time offset attribute could be found in the .cdf file." "The current state starts the same time as the sequence!"); diff --git a/modules/kameleon/src/kameleonwrapper.cpp b/modules/kameleon/src/kameleonwrapper.cpp index c3fdbbdc05..6f725b1c2b 100644 --- a/modules/kameleon/src/kameleonwrapper.cpp +++ b/modules/kameleon/src/kameleonwrapper.cpp @@ -248,7 +248,8 @@ float* KameleonWrapper::uniformSampledValues(const std::string& var, LWARNING("Warning: There might be a gap in the data"); } // Leave values at zero if outside domain - } else { // if inside + } + else { // if inside // ENLIL CDF specific hacks! // Convert from meters to AU for interpolator const double localRPh = rPh / ccmc::constants::AU_in_meters; @@ -268,8 +269,8 @@ float* KameleonWrapper::uniformSampledValues(const std::string& var, doubleData[index] = value; histogram[mapToHistogram(value)]++; - - } else { + } + else { // Assume cartesian for fallback purpose const double stepX = (_max.x - _min.x) / (static_cast(outDimensions.x)); @@ -408,7 +409,9 @@ float* KameleonWrapper::uniformSliceValues(const std::string& var, LWARNING("Warning: There might be a gap in the data"); } // Leave values at zero if outside domain - } else { // if inside + } + else { + // if inside // ENLIL CDF specific hacks! // Convert from meters to AU for interpolator const double localRPh = rPh / ccmc::constants::AU_in_meters; @@ -426,7 +429,8 @@ float* KameleonWrapper::uniformSliceValues(const std::string& var, ); } - } else { + } + else { const double xPos = _min.x + stepX * xi; const double yPos = _min.y + stepY * yi; const double zPos = _min.z + stepZ * zi; @@ -443,7 +447,8 @@ float* KameleonWrapper::uniformSliceValues(const std::string& var, if (value != missingValue) { doubleData[index] = value; data[index] = static_cast(value); - } else { + } + else { doubleData[index] = 0; } } @@ -513,7 +518,8 @@ float* KameleonWrapper::uniformSampledVectorValues(const std::string& xVar, data[index + 2] = (zVal - varZMin) / (varZMax - varZMin); // B // GL_RGB refuses to work. Workaround doing a GL_RGBA hardcoded alpha data[index + 3] = 1.f; - } else { + } + else { LERROR( "Only cartesian grid supported for " "uniformSampledVectorValues (for now)" @@ -579,7 +585,8 @@ KameleonWrapper::Fieldlines KameleonWrapper::classifiedFieldLines(const std::str fieldLines.push_back(line); } - } else { + } + else { LERROR("Fieldlines are only supported for BATSRUS model"); } @@ -637,7 +644,8 @@ KameleonWrapper::Fieldlines KameleonWrapper::fieldLines(const std::string& xVar, fieldLines.push_back(line); } - } else { + } + else { LERROR("Fieldlines are only supported for BATSRUS model"); } @@ -989,17 +997,23 @@ KameleonWrapper::Model KameleonWrapper::modelType() const { _kameleon->getGlobalAttribute("model_name").getAttributeString(); if (modelName == "open_ggcm" || modelName == "ucla_ggcm") { return Model::OpenGGCM; - } else if (modelName == "batsrus") { + } + else if (modelName == "batsrus") { return Model::BATSRUS; - } else if (modelName == "enlil") { + } + else if (modelName == "enlil") { return Model::ENLIL; - } else if (modelName == "mas") { + } + else if (modelName == "mas") { return Model::MAS; - } else if (modelName == "ADAPT3D") { + } + else if (modelName == "ADAPT3D") { return Model::Adapt3D; - } else if (modelName == "swmf") { + } + else if (modelName == "swmf") { return Model::SWMF; - } else if (modelName == "LFM") { + } + else if (modelName == "LFM") { return Model::LFM; } } @@ -1012,17 +1026,20 @@ glm::vec4 KameleonWrapper::classifyFieldline(FieldlineEnd fEnd, FieldlineEnd bEn { // closed return glm::vec4(1.f, 0.f, 0.f, 1.f); - } else if ((fEnd == FieldlineEnd::FAROUT && bEnd == FieldlineEnd::NORTH) || - (bEnd == FieldlineEnd::FAROUT && fEnd == FieldlineEnd::NORTH)) + } + else if ((fEnd == FieldlineEnd::FAROUT && bEnd == FieldlineEnd::NORTH) || + (bEnd == FieldlineEnd::FAROUT && fEnd == FieldlineEnd::NORTH)) { // north return glm::vec4(1.f, 1.f, 0.f, 1.f); - } else if ((fEnd == FieldlineEnd::FAROUT && bEnd == FieldlineEnd::SOUTH) || - (bEnd == FieldlineEnd::FAROUT && fEnd == FieldlineEnd::SOUTH)) + } + else if ((fEnd == FieldlineEnd::FAROUT && bEnd == FieldlineEnd::SOUTH) || + (bEnd == FieldlineEnd::FAROUT && fEnd == FieldlineEnd::SOUTH)) { // south return glm::vec4(0.f, 1.f, 0.f, 1.f); - } else if (fEnd == FieldlineEnd::FAROUT && bEnd == FieldlineEnd::FAROUT) { + } + else if (fEnd == FieldlineEnd::FAROUT && bEnd == FieldlineEnd::FAROUT) { // solar wind return glm::vec4(0.f, 0.f, 1.f, 1.f); } diff --git a/modules/kameleonvolume/kameleonvolumereader.cpp b/modules/kameleonvolume/kameleonvolumereader.cpp index bd692888ef..0df6caca5d 100644 --- a/modules/kameleonvolume/kameleonvolumereader.cpp +++ b/modules/kameleonvolume/kameleonvolumereader.cpp @@ -222,7 +222,8 @@ std::string KameleonVolumeReader::simulationStart() const { std::string startTime; if (_kameleon.model->doesAttributeExist("start_time")) { startTime = globalAttribute(*_kameleon.model, "start_time"); - } else if (_kameleon.model->doesAttributeExist("tim_rundate_cal")) { + } + else if (_kameleon.model->doesAttributeExist("tim_rundate_cal")) { startTime = globalAttribute(*_kameleon.model, "tim_rundate_cal"); size_t numChars = startTime.length(); if (numChars < 19) { @@ -247,9 +248,11 @@ std::string KameleonVolumeReader::simulationStart() const { break; } } - } else if (_kameleon.model->doesAttributeExist("tim_obsdate_cal")) { + } + else if (_kameleon.model->doesAttributeExist("tim_obsdate_cal")) { startTime = globalAttribute(*_kameleon.model, "tim_obsdate_cal"); - } else if (_kameleon.model->doesAttributeExist("tim_crstart_cal")) { + } + else if (_kameleon.model->doesAttributeExist("tim_crstart_cal")) { startTime = globalAttribute(*_kameleon.model, "tim_crstart_cal"); } @@ -263,7 +266,8 @@ std::string KameleonVolumeReader::simulationStart() const { float KameleonVolumeReader::elapsedTime() const { if (_kameleon.model->doesAttributeExist("elapsed_time_in_seconds")) { return globalAttribute(*_kameleon.model, "elapsed_time_in_seconds"); - } else if (_kameleon.model->doesAttributeExist("time_physical_time")) { + } + else if (_kameleon.model->doesAttributeExist("time_physical_time")) { return globalAttribute(*_kameleon.model, "time_physical_time"); } return 0.f; diff --git a/modules/kameleonvolume/rendering/renderablekameleonvolume.cpp b/modules/kameleonvolume/rendering/renderablekameleonvolume.cpp index e221255fd1..7daeed8749 100644 --- a/modules/kameleonvolume/rendering/renderablekameleonvolume.cpp +++ b/modules/kameleonvolume/rendering/renderablekameleonvolume.cpp @@ -329,7 +329,8 @@ void RenderableKameleonVolume::load() { ); if (FileSys.fileExists(cachePath)) { loadRaw(cachePath); - } else { + } + else { loadFromPath(_sourcePath); storeRaw(cachePath); } @@ -351,7 +352,8 @@ void RenderableKameleonVolume::loadFromPath(const std::string& path) { ); if (extension == "cdf") { loadCdf(path); - } else { + } + else { loadRaw(path); } } diff --git a/modules/multiresvolume/rendering/brickselection.cpp b/modules/multiresvolume/rendering/brickselection.cpp index 3a6c844635..fa37a64ec7 100644 --- a/modules/multiresvolume/rendering/brickselection.cpp +++ b/modules/multiresvolume/rendering/brickselection.cpp @@ -70,7 +70,8 @@ BrickSelection BrickSelection::splitTemporally(bool t, unsigned int childBrickIn if (t) { child.lowT = centerT(); child.highT = highT; - } else { + } + else { child.lowT = lowT; child.highT = centerT(); } diff --git a/modules/multiresvolume/rendering/errorhistogrammanager.cpp b/modules/multiresvolume/rendering/errorhistogrammanager.cpp index 7fbef2d659..726ea4b21c 100644 --- a/modules/multiresvolume/rendering/errorhistogrammanager.cpp +++ b/modules/multiresvolume/rendering/errorhistogrammanager.cpp @@ -117,7 +117,8 @@ bool ErrorHistogramManager::buildFromLeaf(unsigned int bstOffset, _histograms[innerNodeIndex] = Histogram(_minBin, _maxBin, _numBins); ancestorVoxels = readValues(ancestorBrickIndex); _voxelCache[innerNodeIndex] = ancestorVoxels; - } else { + } + else { ancestorVoxels = it->second; } @@ -289,7 +290,8 @@ const Histogram* ErrorHistogramManager::histogram(unsigned int brickIndex) const const unsigned int innerNodeIndex = brickToInnerNodeIndex(brickIndex); if (innerNodeIndex < _numInnerNodes) { return &(_histograms[innerNodeIndex]); - } else { + } + else { return nullptr; } } diff --git a/modules/multiresvolume/rendering/histogrammanager.cpp b/modules/multiresvolume/rendering/histogrammanager.cpp index 83711cafd2..d0ad4a8ed7 100644 --- a/modules/multiresvolume/rendering/histogrammanager.cpp +++ b/modules/multiresvolume/rendering/histogrammanager.cpp @@ -64,7 +64,8 @@ bool HistogramManager::buildHistogram(TSP* tsp, unsigned int brickIndex) { for (size_t v = 0; v < numVoxels; ++v) { histogram.add(voxelValues[v], 1.0); } - } else { + } + else { // Has children std::vector children; @@ -89,7 +90,8 @@ bool HistogramManager::buildHistogram(TSP* tsp, unsigned int brickIndex) { // If node has both BST and Octree children, only add BST ones histogram.add(_histograms[childIndex]); } - } else { + } + else { return false; } } diff --git a/modules/multiresvolume/rendering/localerrorhistogrammanager.cpp b/modules/multiresvolume/rendering/localerrorhistogrammanager.cpp index 5a9f7ca421..39f53d52c1 100644 --- a/modules/multiresvolume/rendering/localerrorhistogrammanager.cpp +++ b/modules/multiresvolume/rendering/localerrorhistogrammanager.cpp @@ -129,12 +129,14 @@ bool LocalErrorHistogramManager::buildFromOctreeChild(unsigned int bstOffset, if (isOctreeLeaf) { childValues = readValues(childIndex); - } else { + } + else { const unsigned int childInnerNodeIndex = brickToInnerNodeIndex(childIndex); auto it = _voxelCache.find(childInnerNodeIndex); if (it != _voxelCache.end()) { childValues = it->second; - } else { + } + else { LERROR(fmt::format( "Child {} visited without cache, {}, {}", childIndex, @@ -149,11 +151,13 @@ bool LocalErrorHistogramManager::buildFromOctreeChild(unsigned int bstOffset, if (octreeChildIndex == 0) { parentValues = readValues(parentIndex); _voxelCache[parentInnerNodeIndex] = parentValues; - } else { + } + else { auto it = _voxelCache.find(parentInnerNodeIndex); if (it != _voxelCache.end()) { parentValues = it->second; - } else { + } + else { LERROR(fmt::format("Parent {} visited without cache", parentIndex)); return false; } @@ -231,12 +235,14 @@ bool LocalErrorHistogramManager::buildFromBstChild(unsigned int bstOffset, if (isBstLeaf) { childValues = readValues(childIndex); - } else { + } + else { unsigned int childInnerNodeIndex = brickToInnerNodeIndex(childIndex); auto it = _voxelCache.find(childInnerNodeIndex); if (it != _voxelCache.end()) { childValues = it->second; - } else { + } + else { LERROR(fmt::format("Child {} visited without cache", childIndex)); return false; } @@ -246,11 +252,13 @@ bool LocalErrorHistogramManager::buildFromBstChild(unsigned int bstOffset, if (bstChildIndex == 1) { parentValues = readValues(parentIndex); _voxelCache[parentInnerNodeIndex] = parentValues; - } else { + } + else { auto it = _voxelCache.find(parentInnerNodeIndex); if (it != _voxelCache.end()) { parentValues = it->second; - } else { + } + else { LERROR(fmt::format("Parent {} visited without cache", parentIndex)); return false; } @@ -433,7 +441,8 @@ const Histogram* LocalErrorHistogramManager::spatialHistogram( const unsigned int innerNodeIndex = brickToInnerNodeIndex(brickIndex); if (innerNodeIndex < _numInnerNodes) { return &(_spatialHistograms[innerNodeIndex]); - } else { + } + else { return nullptr; } } @@ -444,7 +453,8 @@ const Histogram* LocalErrorHistogramManager::temporalHistogram( const unsigned int innerNodeIndex = brickToInnerNodeIndex(brickIndex); if (innerNodeIndex < _numInnerNodes) { return &(_temporalHistograms[innerNodeIndex]); - } else { + } + else { return nullptr; } } diff --git a/modules/multiresvolume/rendering/localtfbrickselector.cpp b/modules/multiresvolume/rendering/localtfbrickselector.cpp index 837ddf1928..37d2cd70e4 100644 --- a/modules/multiresvolume/rendering/localtfbrickselector.cpp +++ b/modules/multiresvolume/rendering/localtfbrickselector.cpp @@ -82,7 +82,8 @@ void LocalTfBrickSelector::selectBricks(int timestep, std::vector& bricks) if (splitType != BrickSelection::SplitType::None) { priorityQueue.push_back(brickSelection); - } else { + } + else { leafSelections.push_back(brickSelection); } @@ -135,10 +136,12 @@ void LocalTfBrickSelector::selectBricks(int timestep, std::vector& bricks) priorityQueue.end(), compareSplitPoints ); - } else { + } + else { leafSelections.push_back(childSelection); } - } else if (bs.splitType == BrickSelection::SplitType::Spatial) { + } + else if (bs.splitType == BrickSelection::SplitType::Spatial) { nBricksInMemory += 7; // Remove one and add eight. const unsigned int firstChild = _tsp->firstOctreeChild(brickIndex); @@ -156,7 +159,8 @@ void LocalTfBrickSelector::selectBricks(int timestep, std::vector& bricks) } if (bs.splitPoints > -1) { temporalSplitQueue.push_back(bs); - } else { + } + else { deadEnds.push_back(bs); } break; @@ -187,7 +191,8 @@ void LocalTfBrickSelector::selectBricks(int timestep, std::vector& bricks) priorityQueue.end(), compareSplitPoints ); - } else { + } + else { leafSelections.push_back(childSelection); } } @@ -210,7 +215,8 @@ void LocalTfBrickSelector::selectBricks(int timestep, std::vector& bricks) temporalSplitQueue.end(), compareSplitPoints ); - } else { + } + else { deadEnds.push_back(bs); } } @@ -241,7 +247,8 @@ void LocalTfBrickSelector::selectBricks(int timestep, std::vector& bricks) if (pickRightTimeChild) { childBrickIndex = _tsp->bstRight(brickIndex); - } else { + } + else { childBrickIndex = _tsp->bstLeft(brickIndex); } @@ -260,7 +267,8 @@ void LocalTfBrickSelector::selectBricks(int timestep, std::vector& bricks) temporalSplitQueue.end(), compareSplitPoints ); - } else { + } + else { BrickSelection childSelection = bs.splitTemporally( pickRightTimeChild, childBrickIndex, @@ -270,7 +278,8 @@ void LocalTfBrickSelector::selectBricks(int timestep, std::vector& bricks) deadEnds.push_back(childSelection); } } - } else { + } + else { // Write selected inner nodes to brickSelection vector for (const BrickSelection& bs : priorityQueue) { writeSelection(bs, bricks); @@ -316,10 +325,12 @@ float LocalTfBrickSelector::splitPoints(unsigned int brickIndex, if (spatialPoints > 0 && spatialPoints > temporalPoints) { splitPoints = spatialPoints; splitType = BrickSelection::SplitType::Spatial; - } else if (temporalPoints > 0) { + } + else if (temporalPoints > 0) { splitPoints = temporalPoints; splitType = BrickSelection::SplitType::Temporal; - } else { + } + else { splitPoints = -1; splitType = BrickSelection::SplitType::None; } @@ -354,7 +365,8 @@ bool LocalTfBrickSelector::calculateBrickErrors() { for (unsigned int brickIndex = 0; brickIndex < nHistograms; brickIndex++) { if (_tsp->isOctreeLeaf(brickIndex)) { _brickErrors[brickIndex].spatial = 0.0; - } else { + } + else { const Histogram* histogram = _histogramManager->spatialHistogram( brickIndex ); @@ -371,7 +383,8 @@ bool LocalTfBrickSelector::calculateBrickErrors() { if (_tsp->isBstLeaf(brickIndex)) { _brickErrors[brickIndex].temporal = 0.0; - } else { + } + else { const Histogram* histogram = _histogramManager->temporalHistogram( brickIndex ); diff --git a/modules/multiresvolume/rendering/renderablemultiresvolume.cpp b/modules/multiresvolume/rendering/renderablemultiresvolume.cpp index e07c447b6a..02cfcaaf74 100644 --- a/modules/multiresvolume/rendering/renderablemultiresvolume.cpp +++ b/modules/multiresvolume/rendering/renderablemultiresvolume.cpp @@ -221,7 +221,8 @@ RenderableMultiresVolume::RenderableMultiresVolume(const ghoul::Dictionary& dict _startTime = SpiceManager::ref().ephemerisTimeFromDate(startTimeString); _endTime = SpiceManager::ref().ephemerisTimeFromDate(endTimeString); _loop = false; - } else { + } + else { _loop = true; LWARNING("Node does not provide time information. Viewing one image / frame"); } @@ -268,9 +269,11 @@ RenderableMultiresVolume::RenderableMultiresVolume(const ghoul::Dictionary& dict std::string selectorName = _selectorName; if (selectorName == "simple") { _selector = Selector::SIMPLE; - } else if (selectorName == "local") { + } + else if (selectorName == "local") { _selector = Selector::LOCAL; - } else { + } + else { _selector = Selector::TF; } @@ -280,11 +283,14 @@ RenderableMultiresVolume::RenderableMultiresVolume(const ghoul::Dictionary& dict std::string newSelectorName = _selectorName; if (newSelectorName == "simple") { s = Selector::SIMPLE; - } else if (newSelectorName == "local") { + } + else if (newSelectorName == "local") { s = Selector::LOCAL; - } else if (newSelectorName == "tf") { + } + else if (newSelectorName == "tf") { s = Selector::TF; - } else { + } + else { return; } setSelectorType(s); @@ -474,13 +480,15 @@ bool RenderableMultiresVolume::initializeSelector() { fmt::format("Loading histograms from cache: {}", cacheFilename) ); success &= _errorHistogramManager->loadFromFile(cacheFilename); - } else if (_errorHistogramsPath != "") { + } + else if (_errorHistogramsPath != "") { // Read histograms from scene data. LINFO(fmt::format( "Loading histograms from scene data: {}", _errorHistogramsPath )); success &= _errorHistogramManager->loadFromFile(_errorHistogramsPath); - } else { + } + else { // Build histograms from tsp file. LWARNING(fmt::format("Failed to open {}", cacheFilename)); success &= _errorHistogramManager->buildHistograms(nHistograms); @@ -510,7 +518,8 @@ bool RenderableMultiresVolume::initializeSelector() { cacheFile.close(); LINFO(fmt::format("Loading histograms from {}", cacheFilename)); success &= _histogramManager->loadFromFile(cacheFilename); - } else { + } + else { // Build histograms from tsp file. LWARNING(fmt::format("Failed to open '{}'", cacheFilename)); success &= _histogramManager->buildHistograms( @@ -541,7 +550,8 @@ bool RenderableMultiresVolume::initializeSelector() { cacheFile.close(); LINFO(fmt::format("Loading histograms from {}", cacheFilename)); success &= _localErrorHistogramManager->loadFromFile(cacheFilename); - } else { + } + else { // Build histograms from tsp file. LWARNING(fmt::format("Failed to open {}", cacheFilename)); success &= _localErrorHistogramManager->buildHistograms(nHistograms); diff --git a/modules/multiresvolume/rendering/shenbrickselector.cpp b/modules/multiresvolume/rendering/shenbrickselector.cpp index d10de2ef22..c05553a661 100644 --- a/modules/multiresvolume/rendering/shenbrickselector.cpp +++ b/modules/multiresvolume/rendering/shenbrickselector.cpp @@ -74,7 +74,8 @@ void ShenBrickSelector::traverseBST(int timestep, unsigned int brickIndex, if (timestep <= timeSpanCenter) { bstChild = _tsp->bstLeft(brickIndex); timeSpanEnd = timeSpanCenter; - } else { + } + else { bstChild = _tsp->bstRight(brickIndex); timeSpanStart = timeSpanCenter; } @@ -97,11 +98,14 @@ void ShenBrickSelector::selectBricks(int timestep, unsigned int brickIndex, if (_tsp->temporalError(brickIndex) <= _temporalTolerance) { if (_tsp->isOctreeLeaf(bstRootBrickIndex)) { selectCover(coveredBricks, brickIndex, bricks); - } else if (_tsp->spatialError(brickIndex) <= _spatialTolerance) { + } + else if (_tsp->spatialError(brickIndex) <= _spatialTolerance) { selectCover(coveredBricks, brickIndex, bricks); - } else if (_tsp->isBstLeaf(brickIndex)) { + } + else if (_tsp->isBstLeaf(brickIndex)) { traverseOT(timestep, bstRootBrickIndex, coveredBricks, bricks); - } else { + } + else { traverseBST( timestep, brickIndex, @@ -112,13 +116,16 @@ void ShenBrickSelector::selectBricks(int timestep, unsigned int brickIndex, bricks ); } - } else if (_tsp->isBstLeaf(brickIndex)) { + } + else if (_tsp->isBstLeaf(brickIndex)) { if (_tsp->isOctreeLeaf(bstRootBrickIndex)) { selectCover(coveredBricks, brickIndex, bricks); - } else { + } + else { traverseOT(timestep, bstRootBrickIndex, coveredBricks, bricks); } - } else { + } + else { traverseBST( timestep, brickIndex, diff --git a/modules/multiresvolume/rendering/simpletfbrickselector.cpp b/modules/multiresvolume/rendering/simpletfbrickselector.cpp index d69f557a36..78d99e7796 100644 --- a/modules/multiresvolume/rendering/simpletfbrickselector.cpp +++ b/modules/multiresvolume/rendering/simpletfbrickselector.cpp @@ -83,7 +83,8 @@ void SimpleTfBrickSelector::selectBricks(int timestep, std::vector& bricks) if (splitType != BrickSelection::SplitType::None) { priorityQueue.push_back(brickSelection); - } else { + } + else { leafSelections.push_back(brickSelection); } @@ -137,10 +138,12 @@ void SimpleTfBrickSelector::selectBricks(int timestep, std::vector& bricks) priorityQueue.end(), compareSplitPoints ); - } else { + } + else { leafSelections.push_back(childSelection); } - } else if (bs.splitType == BrickSelection::SplitType::Spatial) { + } + else if (bs.splitType == BrickSelection::SplitType::Spatial) { nBricksInMemory += 7; // Remove one and add eight. unsigned int firstChild = _tsp->firstOctreeChild(brickIndex); @@ -158,7 +161,8 @@ void SimpleTfBrickSelector::selectBricks(int timestep, std::vector& bricks) } if (bs.splitPoints > -1) { temporalSplitQueue.push_back(bs); - } else { + } + else { deadEnds.push_back(bs); } break; @@ -186,7 +190,8 @@ void SimpleTfBrickSelector::selectBricks(int timestep, std::vector& bricks) priorityQueue.end(), compareSplitPoints ); - } else { + } + else { leafSelections.push_back(childSelection); } } @@ -208,7 +213,8 @@ void SimpleTfBrickSelector::selectBricks(int timestep, std::vector& bricks) temporalSplitQueue.end(), compareSplitPoints ); - } else { + } + else { deadEnds.push_back(bs); } } @@ -256,7 +262,8 @@ void SimpleTfBrickSelector::selectBricks(int timestep, std::vector& bricks) temporalSplitQueue.end(), compareSplitPoints ); - } else { + } + else { BrickSelection childSelection = bs.splitTemporally( pickRightTimeChild, childBrickIndex, @@ -265,7 +272,8 @@ void SimpleTfBrickSelector::selectBricks(int timestep, std::vector& bricks) deadEnds.push_back(childSelection); } } - } else { + } + else { // Write selected inner nodes to brickSelection vector for (const BrickSelection& bs : priorityQueue) { writeSelection(bs, bricks); @@ -309,10 +317,12 @@ float SimpleTfBrickSelector::splitPoints(unsigned int brickIndex, if (spatialPoints > 0 && spatialPoints > temporalPoints) { splitPoints = spatialPoints; splitType = BrickSelection::SplitType::Spatial; - } else if (temporalPoints > 0) { + } + else if (temporalPoints > 0) { splitPoints = temporalPoints; splitType = BrickSelection::SplitType::Temporal; - } else { + } + else { splitPoints = -1; splitType = BrickSelection::SplitType::None; } diff --git a/modules/multiresvolume/rendering/tfbrickselector.cpp b/modules/multiresvolume/rendering/tfbrickselector.cpp index 810c792b92..75036f1a09 100644 --- a/modules/multiresvolume/rendering/tfbrickselector.cpp +++ b/modules/multiresvolume/rendering/tfbrickselector.cpp @@ -84,7 +84,8 @@ void TfBrickSelector::selectBricks(int timestep, std::vector& bricks) { if (splitType != BrickSelection::SplitType::None) { priorityQueue.push_back(brickSelection); - } else { + } + else { leafSelections.push_back(brickSelection); } @@ -126,7 +127,8 @@ void TfBrickSelector::selectBricks(int timestep, std::vector& bricks) { if (pickRightTimeChild) { childBrickIndex = _tsp->bstRight(brickIndex); - } else { + } + else { childBrickIndex = _tsp->bstLeft(brickIndex); } @@ -145,10 +147,12 @@ void TfBrickSelector::selectBricks(int timestep, std::vector& bricks) { priorityQueue.end(), compareSplitPoints ); - } else { + } + else { leafSelections.push_back(childSelection); } - } else if (bs.splitType == BrickSelection::SplitType::Spatial) { + } + else if (bs.splitType == BrickSelection::SplitType::Spatial) { nBricksInMemory += 7; // Remove one and add eight. unsigned int firstChild = _tsp->firstOctreeChild(brickIndex); @@ -167,7 +171,8 @@ void TfBrickSelector::selectBricks(int timestep, std::vector& bricks) { } if (bs.splitPoints > -1) { temporalSplitQueue.push_back(bs); - } else { + } + else { deadEnds.push_back(bs); } break; @@ -196,7 +201,8 @@ void TfBrickSelector::selectBricks(int timestep, std::vector& bricks) { priorityQueue.end(), compareSplitPoints ); - } else { + } + else { leafSelections.push_back(childSelection); } } @@ -224,7 +230,8 @@ void TfBrickSelector::selectBricks(int timestep, std::vector& bricks) { temporalSplitQueue.end(), compareSplitPoints ); - } else { + } + else { deadEnds.push_back(bs); } } @@ -273,7 +280,8 @@ void TfBrickSelector::selectBricks(int timestep, std::vector& bricks) { temporalSplitQueue.end(), compareSplitPoints ); - } else { + } + else { BrickSelection childSelection = bs.splitTemporally( pickRightTimeChild, childBrickIndex, @@ -283,7 +291,8 @@ void TfBrickSelector::selectBricks(int timestep, std::vector& bricks) { deadEnds.push_back(childSelection); } } - } else { + } + else { // Write selected inner nodes to brickSelection vector //std::cout << "priority queue: " << priorityQueue.size() << std::endl; for (const BrickSelection& bs : priorityQueue) { @@ -357,10 +366,12 @@ float TfBrickSelector::splitPoints(unsigned int brickIndex, if (spatialPoints > 0 && spatialPoints > temporalPoints) { splitPoints = spatialPoints; splitType = BrickSelection::SplitType::Spatial; - } else if (temporalPoints > 0) { + } + else if (temporalPoints > 0) { splitPoints = temporalPoints; splitType = BrickSelection::SplitType::Temporal; - } else { + } + else { splitPoints = -1; splitType = BrickSelection::SplitType::None; } @@ -396,7 +407,8 @@ bool TfBrickSelector::calculateBrickErrors() { for (unsigned int brickIndex = 0; brickIndex < nHistograms; brickIndex++) { if (_tsp->isBstLeaf(brickIndex) && _tsp->isOctreeLeaf(brickIndex)) { _brickErrors[brickIndex] = 0; - } else { + } + else { const Histogram* histogram = _histogramManager->histogram(brickIndex); float error = 0; for (size_t i = 0; i < gradients.size(); i++) { diff --git a/modules/multiresvolume/rendering/tsp.cpp b/modules/multiresvolume/rendering/tsp.cpp index e18c62adc6..bcb194fcea 100644 --- a/modules/multiresvolume/rendering/tsp.cpp +++ b/modules/multiresvolume/rendering/tsp.cpp @@ -436,7 +436,8 @@ bool TSP::calculateTemporalError() { // 0.0 higher up in the tree if (coveredBricks.size() == 1) { errors[brick] = -0.1f; - } else { + } + else { // Calculate standard deviation per voxel, average over brick float avgStdDev = 0.f; for (unsigned int voxel = 0; voxelisDone()) { _topics.emplace(topicId, std::move(topic)); } - } else { + } + else { if (!isAuthorized()) { LERROR("Connection isn't authorized."); return; diff --git a/modules/server/src/serverinterface.cpp b/modules/server/src/serverinterface.cpp index 639535edd2..d5f8ca6517 100644 --- a/modules/server/src/serverinterface.cpp +++ b/modules/server/src/serverinterface.cpp @@ -155,7 +155,8 @@ ServerInterface::ServerInterface(const ghoul::Dictionary& config) const std::string type = config.value(TypeInfo.identifier); if (type == TcpSocketType) { _type = static_cast(InterfaceType::TcpSocket); - } else if (type == WebSocketType) { + } + else if (type == WebSocketType) { _type = static_cast(InterfaceType::WebSocket); } diff --git a/modules/server/src/topics/authorizationtopic.cpp b/modules/server/src/topics/authorizationtopic.cpp index e3c7394ff8..b761fa7da5 100644 --- a/modules/server/src/topics/authorizationtopic.cpp +++ b/modules/server/src/topics/authorizationtopic.cpp @@ -51,14 +51,16 @@ bool AuthorizationTopic::isDone() const { void AuthorizationTopic::handleJson(const nlohmann::json& json) { if (isDone()) { _connection->sendJson(wrappedPayload({ KeyStatus, Authorized })); - } else { + } + else { try { auto providedKey = json.at("key").get(); if (authorize(providedKey)) { _connection->setAuthorized(true); _connection->sendJson(wrappedPayload({ KeyStatus, Authorized })); LINFO("Client successfully authorized."); - } else { + } + else { _connection->sendJson(wrappedPayload({ KeyStatus, IncorrectKey })); } } catch (const std::out_of_range&) { diff --git a/modules/server/src/topics/documentationtopic.cpp b/modules/server/src/topics/documentationtopic.cpp index b3f4e2573b..24cbf84cf2 100644 --- a/modules/server/src/topics/documentationtopic.cpp +++ b/modules/server/src/topics/documentationtopic.cpp @@ -55,9 +55,11 @@ void DocumentationTopic::handleJson(const nlohmann::json& json) { // ghoul::Dictionary objects from ScriptEngine, FactoryManager, and KeybindingManager. if (requestedType == TypeLua) { response = json::parse(global::scriptEngine.generateJson()); - } else if (requestedType == TypeFactories) { + } + else if (requestedType == TypeFactories) { response = json::parse(FactoryManager::ref().generateJson()); - } else if (requestedType == TypeKeyboard) { + } + else if (requestedType == TypeKeyboard) { response = json::parse(global::keybindingManager.generateJson()); } diff --git a/modules/server/src/topics/setpropertytopic.cpp b/modules/server/src/topics/setpropertytopic.cpp index dc25536b53..76b05f1c37 100644 --- a/modules/server/src/topics/setpropertytopic.cpp +++ b/modules/server/src/topics/setpropertytopic.cpp @@ -70,11 +70,14 @@ namespace { std::string luaLiteralFromJson(nlohmann::json value) { if (value.is_string()) { return "'" + escapedLuaString(value.get()) + "'"; - } else if (value.is_boolean()) { + } + else if (value.is_boolean()) { return value.get() ? "true" : "false"; - } else if (value.is_number()) { + } + else if (value.is_number()) { return std::to_string(value.get()); - } else if (value.is_array()) { + } + else if (value.is_array()) { std::string literal = "{"; for (nlohmann::json::iterator it = value.begin(); it != value.end(); ++it) { literal += luaLiteralFromJson(it.value()) += ","; @@ -82,7 +85,8 @@ namespace { literal.pop_back(); // remove last comma literal += "}"; return literal; - } else if (value.is_object()) { + } + else if (value.is_object()) { std::string literal = "{"; for (nlohmann::json::iterator it = value.begin(); it != value.end(); ++it) { literal += it.key() + "=" + luaLiteralFromJson(it.value()) += ","; @@ -90,7 +94,8 @@ namespace { literal.pop_back(); // remove last comma literal += "}"; return literal; - }{ + } + else { return "nil"; } } diff --git a/modules/server/src/topics/shortcuttopic.cpp b/modules/server/src/topics/shortcuttopic.cpp index 396ae2c283..34376e0c69 100644 --- a/modules/server/src/topics/shortcuttopic.cpp +++ b/modules/server/src/topics/shortcuttopic.cpp @@ -102,7 +102,8 @@ void ShortcutTopic::handleJson(const nlohmann::json& input) { if (event == StartSubscription) { // TODO: Subscribe to shortcuts and keybindings // shortcutManager.subscribe(); ... - } else if (event == StopSubscription) { + } + else if (event == StopSubscription) { // TODO: Unsubscribe to shortcuts and keybindings // shortcutManager.unsubscribe(); ... return; diff --git a/modules/space/rendering/renderablesmallbody.cpp b/modules/space/rendering/renderablesmallbody.cpp index 38a0a94c86..eb486a5035 100644 --- a/modules/space/rendering/renderablesmallbody.cpp +++ b/modules/space/rendering/renderablesmallbody.cpp @@ -1,26 +1,26 @@ - /**************************************************************************************** - * * - * OpenSpace * - * * - * Copyright (c) 2014-2020 * - * * - * 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. * - ****************************************************************************************/ +/**************************************************************************************** + * * + * OpenSpace * + * * + * Copyright (c) 2014-2020 * + * * + * 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 diff --git a/modules/space/rendering/renderablestars.cpp b/modules/space/rendering/renderablestars.cpp index 6e3bf3d918..377f8c77bd 100644 --- a/modules/space/rendering/renderablestars.cpp +++ b/modules/space/rendering/renderablestars.cpp @@ -53,12 +53,12 @@ namespace { constexpr const char* KeyStaticFilterValue = "StaticFilter"; constexpr const char* KeyStaticFilterReplacement = "StaticFilterReplacement"; - constexpr const std::array UniformNames = { + constexpr const std::array UniformNames = { "modelMatrix", "cameraUp", "cameraViewProjectionMatrix", "colorOption", "magnitudeExponent", "eyePosition", "psfParamConf", "lumCent", "radiusCent", "brightnessCent", "colorTexture", "alphaValue", "psfTexture", "otherDataTexture", "otherDataRange", - "filterOutOfRange" + "filterOutOfRange", "fixedColor" }; constexpr int8_t CurrentCacheVersion = 3; @@ -126,6 +126,12 @@ namespace { "values so they can be used by the specified color map." }; + constexpr openspace::properties::Property::PropertyInfo FixedColorInfo = { + "FixedColorValue", + "Color used for fixed star colors", + "The color that should be used if the 'Fixed Color' value is used." + }; + constexpr openspace::properties::Property::PropertyInfo OtherDataColorMapInfo = { "OtherDataColorMap", "Other Data Color Map", @@ -328,7 +334,9 @@ documentation::Documentation RenderableStars::Documentation() { },*/ { ColorOptionInfo.identifier, - new StringInListVerifier({ "Color", "Velocity", "Speed", "Other Data" }), + new StringInListVerifier({ + "Color", "Velocity", "Speed", "Other Data", "Fixed Color" + }), Optional::Yes, ColorOptionInfo.description }, @@ -423,6 +431,7 @@ RenderableStars::RenderableStars(const ghoul::Dictionary& dictionary) glm::vec2(-10.f, -10.f), glm::vec2(10.f, 10.f) ) + , _fixedColor(FixedColorInfo, glm::vec4(1.f), glm::vec4(0.f), glm::vec4(1.f)) , _filterOutOfRange(FilterOutOfRangeInfo, false) , _pointSpreadFunctionTexturePath(PsfTextureInfo) , _alphaValue(TransparencyInfo, 1.f, 0.f, 1.f) @@ -489,11 +498,15 @@ RenderableStars::RenderableStars(const ghoul::Dictionary& dictionary) ); } + _fixedColor.setViewOption(properties::Property::ViewOptions::Color, true); + addProperty(_fixedColor); + _colorOption.addOptions({ { ColorOption::Color, "Color" }, { ColorOption::Velocity, "Velocity" }, { ColorOption::Speed, "Speed" }, - { ColorOption::OtherData, "Other Data" } + { ColorOption::OtherData, "Other Data" }, + { ColorOption::FixedColor, "Fixed Color" } }); if (dictionary.hasKey(ColorOptionInfo.identifier)) { const std::string colorOption = dictionary.value( @@ -508,9 +521,12 @@ RenderableStars::RenderableStars(const ghoul::Dictionary& dictionary) else if (colorOption == "Speed") { _colorOption = ColorOption::Speed; } - else { + else if (colorOption == "OtherData") { _colorOption = ColorOption::OtherData; } + else { + _colorOption = ColorOption::FixedColor; + } } _colorOption.onChange([&] { _dataIsDirty = true; }); addProperty(_colorOption); @@ -615,7 +631,8 @@ RenderableStars::RenderableStars(const ghoul::Dictionary& dictionary) if (sizeCompositionOption == "App Brightness") { _psfMultiplyOption = 0; - } else if (sizeCompositionOption == "Lum and Size") { + } + else if (sizeCompositionOption == "Lum and Size") { _psfMultiplyOption = 1; } else if (sizeCompositionOption == "Lum, Size and App Brightness") { @@ -716,7 +733,7 @@ void RenderableStars::initializeGL() { glBindVertexArray(_psfVao); glBindBuffer(GL_ARRAY_BUFFER, _psfVbo); - const GLfloat vertex_data[] = { + const GLfloat vertexData[] = { //x y s t -1.f, -1.f, 0.f, 0.f, 1.f, 1.f, 1.f, 1.f, @@ -726,7 +743,7 @@ void RenderableStars::initializeGL() { 1.f, 1.f, 1.f, 1.f }; - glBufferData(GL_ARRAY_BUFFER, sizeof(vertex_data), vertex_data, GL_STATIC_DRAW); + glBufferData(GL_ARRAY_BUFFER, sizeof(vertexData), vertexData, GL_STATIC_DRAW); glVertexAttribPointer( 0, 4, @@ -987,14 +1004,21 @@ void RenderableStars::render(const RenderData& data, RendererTasks&) { _program->setUniform(_uniformCache.radiusCent, _radiusCent); _program->setUniform(_uniformCache.brightnessCent, _brightnessCent); + if (_colorOption == ColorOption::FixedColor) { + if (_uniformCache.fixedColor == -1) { + _uniformCache.fixedColor = _program->uniformLocation("fixedColor"); + } + _program->setUniform(_uniformCache.fixedColor, _fixedColor); + } + float fadeInVariable = 1.f; if (!_disableFadeInDistance) { float distCamera = static_cast(glm::length(data.camera.positionVec3())); const glm::vec2 fadeRange = _fadeInDistance; - const float a = 1.f / ((fadeRange.y - fadeRange.x) * PARSEC); - const float b = -(fadeRange.x / (fadeRange.y - fadeRange.x)); - const float funcValue = a * distCamera + b; - fadeInVariable *= funcValue > 1.f ? 1.f : funcValue; + const double a = 1.f / ((fadeRange.y - fadeRange.x) * PARSEC); + const double b = -(fadeRange.x / (fadeRange.y - fadeRange.x)); + const double funcValue = a * distCamera + b; + fadeInVariable *= static_cast(funcValue > 1.f ? 1.f : funcValue); _program->setUniform(_uniformCache.alphaValue, _alphaValue * fadeInVariable); } @@ -1107,6 +1131,7 @@ void RenderableStars::update(const UpdateData&) { const int colorOption = _colorOption; switch (colorOption) { case ColorOption::Color: + case ColorOption::FixedColor: glVertexAttribPointer( positionAttrib, 3, @@ -1586,6 +1611,7 @@ void RenderableStars::createDataSlice(ColorOption option) { switch (option) { case ColorOption::Color: + case ColorOption::FixedColor: { union { ColorVBOLayout value; diff --git a/modules/space/rendering/renderablestars.h b/modules/space/rendering/renderablestars.h index 2645900ad6..7e36d0aafb 100644 --- a/modules/space/rendering/renderablestars.h +++ b/modules/space/rendering/renderablestars.h @@ -33,6 +33,7 @@ #include #include #include +#include #include #include #include @@ -63,15 +64,13 @@ public: static documentation::Documentation Documentation(); -//private: -// void loadShapeTexture(); - private: enum ColorOption { - Color = 0, - Velocity = 1, - Speed = 2, - OtherData = 3 + Color = 0, + Velocity = 1, + Speed = 2, + OtherData = 3, + FixedColor = 4 }; static const int _psfTextureSize = 64; @@ -99,6 +98,7 @@ private: properties::StringProperty _otherDataColorMapPath; properties::Vec2Property _otherDataRange; std::unique_ptr _otherDataColorMapTexture; + properties::Vec4Property _fixedColor; properties::BoolProperty _filterOutOfRange; properties::StringProperty _pointSpreadFunctionTexturePath; std::unique_ptr _pointSpreadFunctionTexture; @@ -132,7 +132,7 @@ private: colorOption, magnitudeExponent, eyePosition, psfParamConf, lumCent, radiusCent, brightnessCent, colorTexture, alphaValue, psfTexture, otherDataTexture, otherDataRange, - filterOutOfRange + filterOutOfRange, fixedColor ) _uniformCache; bool _speckFileIsDirty = true; diff --git a/modules/space/shaders/convolution_fs.glsl b/modules/space/shaders/convolution_fs.glsl index f10b9e0c14..9cde38881e 100644 --- a/modules/space/shaders/convolution_fs.glsl +++ b/modules/space/shaders/convolution_fs.glsl @@ -2,7 +2,7 @@ * * * OpenSpace * * * - * Copyright (c) 2014-2019 * + * Copyright (c) 2014-2020 * * * * 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 * diff --git a/modules/space/shaders/convolution_vs.glsl b/modules/space/shaders/convolution_vs.glsl index a2e5f20da8..c87dcf9fe6 100644 --- a/modules/space/shaders/convolution_vs.glsl +++ b/modules/space/shaders/convolution_vs.glsl @@ -2,7 +2,7 @@ * * * OpenSpace * * * - * Copyright (c) 2014-2019 * + * Copyright (c) 2014-2020 * * * * 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 * diff --git a/modules/space/shaders/debrisViz_fs.glsl b/modules/space/shaders/debrisViz_fs.glsl index e54886d99a..2fd1b77264 100644 --- a/modules/space/shaders/debrisViz_fs.glsl +++ b/modules/space/shaders/debrisViz_fs.glsl @@ -2,7 +2,7 @@ * * * OpenSpace * * * - * Copyright (c) 2014-2018 * + * Copyright (c) 2014-2020 * * * * 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 * @@ -86,8 +86,9 @@ Fragment getFragment() { // to debug using colors use this if-statment. // float ep = 0.01; - // if( fract(vertexID_f) < ep ){ //periodFraction < ep - // frag.color = vec4(1, 0, 0, 1); + // if (fract(vertexID_f) < ep) { + // periodFraction < ep + // frag.color = vec4(1, 0, 0, 1); // } return frag; diff --git a/modules/space/shaders/debrisViz_vs.glsl b/modules/space/shaders/debrisViz_vs.glsl index c81cd42431..57b89a2510 100644 --- a/modules/space/shaders/debrisViz_vs.glsl +++ b/modules/space/shaders/debrisViz_vs.glsl @@ -2,7 +2,7 @@ * * * OpenSpace * * * - * Copyright (c) 2014-2018 * + * Copyright (c) 2014-2020 * * * * 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 * diff --git a/modules/space/shaders/psfToTexture_fs.glsl b/modules/space/shaders/psfToTexture_fs.glsl index 3eee43d979..060b33e557 100644 --- a/modules/space/shaders/psfToTexture_fs.glsl +++ b/modules/space/shaders/psfToTexture_fs.glsl @@ -2,7 +2,7 @@ * * * OpenSpace * * * - * Copyright (c) 2014-2019 * + * Copyright (c) 2014-2020 * * * * 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 * diff --git a/modules/space/shaders/psfToTexture_vs.glsl b/modules/space/shaders/psfToTexture_vs.glsl index d24f8ac013..791adc6c4e 100644 --- a/modules/space/shaders/psfToTexture_vs.glsl +++ b/modules/space/shaders/psfToTexture_vs.glsl @@ -2,7 +2,7 @@ * * * OpenSpace * * * - * Copyright (c) 2014-2019 * + * Copyright (c) 2014-2020 * * * * 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 * diff --git a/modules/space/shaders/star_fs.glsl b/modules/space/shaders/star_fs.glsl index 8d6096e21d..329e7e513c 100644 --- a/modules/space/shaders/star_fs.glsl +++ b/modules/space/shaders/star_fs.glsl @@ -26,15 +26,18 @@ #include "floatoperations.glsl" // keep in sync with renderablestars.h:ColorOption enum -const int COLOROPTION_COLOR = 0; -const int COLOROPTION_VELOCITY = 1; -const int COLOROPTION_SPEED = 2; +const int COLOROPTION_COLOR = 0; +const int COLOROPTION_VELOCITY = 1; +const int COLOROPTION_SPEED = 2; const int COLOROPTION_OTHERDATA = 3; +const int COLOROPTION_FIXEDCOLOR = 4; uniform sampler1D colorTexture; uniform sampler2D psfTexture; uniform float alphaValue; +uniform vec4 fixedColor; + uniform int colorOption; uniform sampler1D otherDataTexture; @@ -89,21 +92,28 @@ Fragment getFragment() { color = otherDataValue(); } break; + case COLOROPTION_FIXEDCOLOR: + color = fixedColor; + break; } - vec4 textureColor = texture(psfTexture, 0.5*psfCoords + 0.5); + vec4 textureColor = texture(psfTexture, 0.5 * psfCoords + 0.5); vec4 fullColor = vec4(color.rgb, textureColor.a); fullColor.a *= alphaValue; + + if (colorOption == COLOROPTION_FIXEDCOLOR) { + fullColor.a *= fixedColor.a; + } if (fullColor.a == 0) { discard; } Fragment frag; - frag.color = fullColor; - frag.depth = gs_screenSpaceDepth; + frag.color = fullColor; + frag.depth = gs_screenSpaceDepth; frag.gPosition = vs_position; - frag.gNormal = vec4(0.0, 0.0, 0.0, 1.0); + frag.gNormal = vec4(0.0, 0.0, 0.0, 1.0); frag.disableLDR2HDR = true; return frag; diff --git a/modules/space/tasks/generatedebrisvolumetask.cpp b/modules/space/tasks/generatedebrisvolumetask.cpp index 2922de72b7..d7bf763a45 100644 --- a/modules/space/tasks/generatedebrisvolumetask.cpp +++ b/modules/space/tasks/generatedebrisvolumetask.cpp @@ -2,7 +2,7 @@ * * * OpenSpace * * * - * Copyright (c) 2014-2019 * + * Copyright (c) 2014-2020 * * * * 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 * diff --git a/modules/space/tasks/generatedebrisvolumetask.h b/modules/space/tasks/generatedebrisvolumetask.h index 005936213d..887f75be60 100644 --- a/modules/space/tasks/generatedebrisvolumetask.h +++ b/modules/space/tasks/generatedebrisvolumetask.h @@ -2,7 +2,7 @@ * * * OpenSpace * * * - * Copyright (c) 2014-2019 * + * Copyright (c) 2014-2020 * * * * 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 * @@ -21,8 +21,9 @@ * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE * * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * ****************************************************************************************/ -#ifndef __OPENSPACE_MODULE_SPACE___GENERATERDEBRISVOLUMETASK___H__ -#define __OPENSPACE_MODULE_SPACE___GENERATERDEBRISVOLUMETASK___H__ + +#ifndef __OPENSPACE_MODULE_SPACE___GENERATEDEBRISVOLUMETASK___H__ +#define __OPENSPACE_MODULE_SPACE___GENERATEDEBRISVOLUMETASK___H__ #include #include @@ -69,11 +70,8 @@ private: // not sure if it should be local function or hidden function. //std::vector readTLEFile(const std::string& filename); - }; - - } // namespace volume } // namespace openspace diff --git a/modules/space/translation/tletranslation.cpp b/modules/space/translation/tletranslation.cpp index 7d41878a33..ec5fb75137 100644 --- a/modules/space/translation/tletranslation.cpp +++ b/modules/space/translation/tletranslation.cpp @@ -319,7 +319,8 @@ void TLETranslation::readTLEFile(const std::string& filename, int lineNum) { // 13 65-68 Element set number.Incremented when a new TLE is generated // 14 69-69 Checksum (modulo 10) keplerElements.epoch = epochFromSubstring(line.substr(18, 14)); - } else { + } + else { throw ghoul::RuntimeError(fmt::format( "File {} @ line {} does not have '1' header", filename, lineNum + 1 )); @@ -371,7 +372,8 @@ void TLETranslation::readTLEFile(const std::string& filename, int lineNum) { // Get mean motion stream.str(line.substr(52, 11)); stream >> keplerElements.meanMotion; - } else { + } + else { throw ghoul::RuntimeError(fmt::format( "File {} @ line {} does not have '2' header", filename, lineNum + 2 )); diff --git a/modules/spacecraftinstruments/rendering/renderableplanetprojection.cpp b/modules/spacecraftinstruments/rendering/renderableplanetprojection.cpp index 6abdfaaff1..238ad1cd11 100644 --- a/modules/spacecraftinstruments/rendering/renderableplanetprojection.cpp +++ b/modules/spacecraftinstruments/rendering/renderableplanetprojection.cpp @@ -487,7 +487,8 @@ void RenderablePlanetProjection::imageProjectGPU( if (glm::vec3* radius = std::any_cast(&r)){ _fboProgramObject->setUniform(_fboUniformCache.radius, radius); } - } else { + } + else { LERROR("Geometry object needs to provide radius"); } if (_geometry->hasProperty("Segments")) { @@ -495,7 +496,8 @@ void RenderablePlanetProjection::imageProjectGPU( if (int* segments = std::any_cast(&s)) { _fboProgramObject->setUniform(_fboUniformCache.segments, segments[0]); } - }else{ + } + else{ LERROR("Geometry object needs to provide segment count"); } diff --git a/modules/spacecraftinstruments/shaders/dilation_fs.glsl b/modules/spacecraftinstruments/shaders/dilation_fs.glsl index 827fa02491..0b4b01e684 100644 --- a/modules/spacecraftinstruments/shaders/dilation_fs.glsl +++ b/modules/spacecraftinstruments/shaders/dilation_fs.glsl @@ -2,7 +2,7 @@ * * * OpenSpace * * * - * Copyright (c) 2014-2019 * + * Copyright (c) 2014-2020 * * * * 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 * diff --git a/modules/spacecraftinstruments/shaders/dilation_vs.glsl b/modules/spacecraftinstruments/shaders/dilation_vs.glsl index d8cc4380db..9d2a0c22d9 100644 --- a/modules/spacecraftinstruments/shaders/dilation_vs.glsl +++ b/modules/spacecraftinstruments/shaders/dilation_vs.glsl @@ -2,7 +2,7 @@ * * * OpenSpace * * * - * Copyright (c) 2014-2019 * + * Copyright (c) 2014-2020 * * * * 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 * diff --git a/modules/spacecraftinstruments/shaders/renderableModelDepth_fs.glsl b/modules/spacecraftinstruments/shaders/renderableModelDepth_fs.glsl index f0e3acc04f..c4a2b2c5c3 100644 --- a/modules/spacecraftinstruments/shaders/renderableModelDepth_fs.glsl +++ b/modules/spacecraftinstruments/shaders/renderableModelDepth_fs.glsl @@ -2,7 +2,7 @@ * * * OpenSpace * * * - * Copyright (c) 2014-2019 * + * Copyright (c) 2014-2020 * * * * 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 * diff --git a/modules/spacecraftinstruments/shaders/renderableModelDepth_vs.glsl b/modules/spacecraftinstruments/shaders/renderableModelDepth_vs.glsl index 7bf11b3be2..eec94130a1 100644 --- a/modules/spacecraftinstruments/shaders/renderableModelDepth_vs.glsl +++ b/modules/spacecraftinstruments/shaders/renderableModelDepth_vs.glsl @@ -2,7 +2,7 @@ * * * OpenSpace * * * - * Copyright (c) 2014-2019 * + * Copyright (c) 2014-2020 * * * * 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 * diff --git a/modules/spacecraftinstruments/shaders/renderablePlanetProjection_fs.glsl b/modules/spacecraftinstruments/shaders/renderablePlanetProjection_fs.glsl index a78f09d07e..3760905ab4 100644 --- a/modules/spacecraftinstruments/shaders/renderablePlanetProjection_fs.glsl +++ b/modules/spacecraftinstruments/shaders/renderablePlanetProjection_fs.glsl @@ -79,8 +79,8 @@ void main() { vec3 v_b = normalize(boresight); - if((inRange(projected.x, 0.0, 1.0) && inRange(projected.y, 0.0, 1.0)) && - dot(v_b, normal) < 0.0) + if ((inRange(projected.x, 0.0, 1.0) && inRange(projected.y, 0.0, 1.0)) && + dot(v_b, normal) < 0.0) { color = texture(projectionTexture, vec2(projected.x, projected.y)); stencil = vec4(1.0); diff --git a/modules/spacecraftinstruments/shaders/terminatorshadow_vs.glsl b/modules/spacecraftinstruments/shaders/terminatorshadow_vs.glsl index 3e5ab5cfbd..c837cac53b 100644 --- a/modules/spacecraftinstruments/shaders/terminatorshadow_vs.glsl +++ b/modules/spacecraftinstruments/shaders/terminatorshadow_vs.glsl @@ -41,7 +41,8 @@ uniform vec4 shadowColor; void main() { if (mod(gl_VertexID,2) == 0.0) { vs_color = shadowColor; - } else { + } + else { vs_color = vec4(0.0); } diff --git a/modules/spacecraftinstruments/util/instrumentdecoder.cpp b/modules/spacecraftinstruments/util/instrumentdecoder.cpp index 4ef3eeed44..a5b04f79ba 100644 --- a/modules/spacecraftinstruments/util/instrumentdecoder.cpp +++ b/modules/spacecraftinstruments/util/instrumentdecoder.cpp @@ -53,7 +53,8 @@ InstrumentDecoder::InstrumentDecoder(const ghoul::Dictionary& dictionary) { if (dictionary.hasKeyAndValue(KeyStopCommand) && _type == "SCANNER"){ dictionary.getValue(KeyStopCommand, _stopCommand); - } else { + } + else { LWARNING("Scanner must provide stop command, please check mod file."); } diff --git a/modules/sync/syncmodule.cpp b/modules/sync/syncmodule.cpp index 53a7151789..0bba0d59a0 100644 --- a/modules/sync/syncmodule.cpp +++ b/modules/sync/syncmodule.cpp @@ -62,7 +62,8 @@ void SyncModule::internalInitialize(const ghoul::Dictionary& configuration) { if (configuration.hasKey(KeySynchronizationRoot)) { _synchronizationRoot = configuration.value(KeySynchronizationRoot); - } else { + } + else { LWARNINGC( "SyncModule", "No synchronization root specified. Disabling resource synchronization" diff --git a/modules/sync/syncs/urlsynchronization.cpp b/modules/sync/syncs/urlsynchronization.cpp index 374c6c93f9..d7b3e61348 100644 --- a/modules/sync/syncs/urlsynchronization.cpp +++ b/modules/sync/syncs/urlsynchronization.cpp @@ -46,7 +46,6 @@ namespace { constexpr const char* KeyFilename = "Filename"; constexpr const char* TempSuffix = ".tmp"; - constexpr const char* FileSuffix = ".txt"; } // namespace namespace openspace { @@ -128,10 +127,6 @@ UrlSynchronization::UrlSynchronization(const ghoul::Dictionary& dict, if (dict.hasValue(KeyFilename)) { _filename = dict.value(KeyFilename); - std::size_t foundExt = _filename.find(FileSuffix); - if (foundExt == std::string::npos) { - _filename += FileSuffix; - } } bool useHash = true; @@ -204,12 +199,10 @@ void UrlSynchronization::start() { std::string lastPartOfUrl = url.substr(lastSlash + 1); // We can not create filenames with questionmarks - lastPartOfUrl.erase(std::remove(lastPartOfUrl.begin(), lastPartOfUrl.end(), '?'), lastPartOfUrl.end()); - - std::size_t foundExt = lastPartOfUrl.find(FileSuffix); - if (foundExt == std::string::npos) { - lastPartOfUrl += FileSuffix; - } + lastPartOfUrl.erase( + std::remove(lastPartOfUrl.begin(), lastPartOfUrl.end(), '?'), + lastPartOfUrl.end() + ); _filename = lastPartOfUrl; } std::string fileDestination = directory() + diff --git a/modules/touch/ext/CMakeLists.txt b/modules/touch/ext/CMakeLists.txt index 19a1dca056..9ce2824de9 100644 --- a/modules/touch/ext/CMakeLists.txt +++ b/modules/touch/ext/CMakeLists.txt @@ -44,9 +44,9 @@ set(TUIO_SOURCE ${PROJECT_SOURCE_DIR}/libTUIO11/TUIO/OscReceiver.cpp ${PROJECT_SOURCE_DIR}/libTUIO11/TUIO/OneEuroFilter.cpp ${PROJECT_SOURCE_DIR}/libTUIO11/TUIO/FlashSender.cpp - + ${PROJECT_SOURCE_DIR}/libTUIO11/oscpack/ip/IpEndpointName.cpp - + ${PROJECT_SOURCE_DIR}/libTUIO11/oscpack/osc/OscTypes.cpp ${PROJECT_SOURCE_DIR}/libTUIO11/oscpack/osc/OscReceivedElements.cpp ${PROJECT_SOURCE_DIR}/libTUIO11/oscpack/osc/OscPrintReceivedElements.cpp @@ -58,7 +58,7 @@ if (WIN32) ${TUIO_SOURCE} ${PROJECT_SOURCE_DIR}/libTUIO11/oscpack/ip/win32/NetworkingUtils.cpp ${PROJECT_SOURCE_DIR}/libTUIO11/oscpack/ip/win32/UdpSocket.cpp - ) + ) endif () if (UNIX) @@ -80,4 +80,4 @@ target_include_directories(libTUIO11 PUBLIC if (WIN32) # Tuio dependencies target_link_libraries(libTUIO11 PRIVATE winmm.lib wininet.lib ws2_32.lib) -endif() +endif () diff --git a/modules/touch/src/win32_touch.cpp b/modules/touch/src/win32_touch.cpp index 725c005c23..9507b5ef8a 100644 --- a/modules/touch/src/win32_touch.cpp +++ b/modules/touch/src/win32_touch.cpp @@ -237,13 +237,12 @@ Win32TouchHook::Win32TouchHook(void* nativeWindow) // GetModuleHandleW(NULL), // 0 //<- Global thread id (low-level mouse is global only) // ); - // if(!gMouseHook){ + // if (!gMouseHook) { // LINFO("Could not setup mousehook!"); // } // MSG msg; - // while (GetMessage(&msg, NULL, 0, 0)) - // { + // while (GetMessage(&msg, NULL, 0, 0)) { // DispatchMessage(&msg); // } // }); diff --git a/modules/toyvolume/shaders/boundsfs.glsl b/modules/toyvolume/shaders/boundsfs.glsl index 6f1123a51d..4c6fa0ed17 100644 --- a/modules/toyvolume/shaders/boundsfs.glsl +++ b/modules/toyvolume/shaders/boundsfs.glsl @@ -2,7 +2,7 @@ * * * OpenSpace * * * - * Copyright (c) 2014-2019 * + * Copyright (c) 2014-2020 * * * * 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 * diff --git a/modules/toyvolume/shaders/boundsvs.glsl b/modules/toyvolume/shaders/boundsvs.glsl index b5a22f127b..67c3aa488e 100644 --- a/modules/toyvolume/shaders/boundsvs.glsl +++ b/modules/toyvolume/shaders/boundsvs.glsl @@ -2,7 +2,7 @@ * * * OpenSpace * * * - * Copyright (c) 2014-2019 * + * Copyright (c) 2014-2020 * * * * 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 * diff --git a/modules/toyvolume/shaders/raycast.glsl b/modules/toyvolume/shaders/raycast.glsl index 7168af6ef6..b604dd050d 100644 --- a/modules/toyvolume/shaders/raycast.glsl +++ b/modules/toyvolume/shaders/raycast.glsl @@ -2,7 +2,7 @@ * * * OpenSpace * * * - * Copyright (c) 2014-2019 * + * Copyright (c) 2014-2020 * * * * 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 * diff --git a/modules/volume/rendering/renderabletimevaryingvolume.cpp b/modules/volume/rendering/renderabletimevaryingvolume.cpp index d689713104..0cad00ee51 100644 --- a/modules/volume/rendering/renderabletimevaryingvolume.cpp +++ b/modules/volume/rendering/renderabletimevaryingvolume.cpp @@ -452,7 +452,8 @@ void RenderableTimeVaryingVolume::update(const UpdateData&) { glm::dmat4 scaleMatrix = glm::scale(glm::dmat4(1.0), scale); modelTransform = modelTransform * scaleMatrix; _raycaster->setModelTransform(glm::mat4(modelTransform)); - } else { + } + else { // The diameter is two times the maximum radius. // No translation: the sphere is always centered in (0, 0, 0) _raycaster->setModelTransform( @@ -463,7 +464,8 @@ void RenderableTimeVaryingVolume::update(const UpdateData&) { ); } _raycaster->setVolumeTexture(t->texture); - } else { + } + else { _raycaster->setVolumeTexture(nullptr); } _raycaster->setStepSize(_stepSize); diff --git a/modules/volume/shaders/boundsfs.glsl b/modules/volume/shaders/boundsfs.glsl index 8fa1123413..5e589ac90b 100644 --- a/modules/volume/shaders/boundsfs.glsl +++ b/modules/volume/shaders/boundsfs.glsl @@ -2,7 +2,7 @@ * * * OpenSpace * * * - * Copyright (c) 2014-2019 * + * Copyright (c) 2014-2020 * * * * 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 * diff --git a/modules/volume/shaders/boundsvs.glsl b/modules/volume/shaders/boundsvs.glsl index 04688e177a..32c2d80aeb 100644 --- a/modules/volume/shaders/boundsvs.glsl +++ b/modules/volume/shaders/boundsvs.glsl @@ -2,7 +2,7 @@ * * * OpenSpace * * * - * Copyright (c) 2014-2019 * + * Copyright (c) 2014-2020 * * * * 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 * diff --git a/modules/volume/shaders/helper.glsl b/modules/volume/shaders/helper.glsl index 970b6cf6fa..9c51d02d41 100644 --- a/modules/volume/shaders/helper.glsl +++ b/modules/volume/shaders/helper.glsl @@ -2,7 +2,7 @@ * * * OpenSpace * * * - * Copyright (c) 2014-2019 * + * Copyright (c) 2014-2020 * * * * 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 * diff --git a/modules/volume/shaders/raycast.glsl b/modules/volume/shaders/raycast.glsl index e7e28ab456..0ecee6cf0d 100644 --- a/modules/volume/shaders/raycast.glsl +++ b/modules/volume/shaders/raycast.glsl @@ -2,7 +2,7 @@ * * * OpenSpace * * * - * Copyright (c) 2014-2019 * + * Copyright (c) 2014-2020 * * * * 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 * diff --git a/modules/volume/volumesampler.inl b/modules/volume/volumesampler.inl index 8fba419183..4c6f344607 100644 --- a/modules/volume/volumesampler.inl +++ b/modules/volume/volumesampler.inl @@ -59,17 +59,20 @@ typename VolumeType::VoxelType VolumeSampler::sample( if (x == minCoords.x) { filterCoefficient *= (1.f - t.x); - } else if (x == maxCoords.x) { + } + else if (x == maxCoords.x) { filterCoefficient *= t.x; } if (y == minCoords.y) { filterCoefficient *= (1.f - t.y); - } else if (y == maxCoords.y) { + } + else if (y == maxCoords.y) { filterCoefficient *= t.y; } if (z == minCoords.z) { filterCoefficient *= (1.f - t.z); - } else if (z == maxCoords.z) { + } + else if (z == maxCoords.z) { filterCoefficient *= t.z; } diff --git a/modules/webbrowser/CMakeLists.txt b/modules/webbrowser/CMakeLists.txt index e838953772..c914689fda 100644 --- a/modules/webbrowser/CMakeLists.txt +++ b/modules/webbrowser/CMakeLists.txt @@ -152,7 +152,7 @@ set(CEF_HELPER_TARGET "OpenSpace Helper" CACHE INTERNAL "CEF_HELPER_TARGET") # CEF platform-specific config # -if(OS_MACOSX) +if (OS_MACOSX) # Helper executable target. add_executable(${CEF_HELPER_TARGET} MACOSX_BUNDLE ${WEBBROWSER_HELPER_SOURCES}) SET_EXECUTABLE_TARGET_PROPERTIES(${CEF_HELPER_TARGET}) @@ -163,12 +163,15 @@ if(OS_MACOSX) MACOSX_BUNDLE_INFO_PLIST ${CMAKE_CURRENT_SOURCE_DIR}/mac/helper-Info.plist ) - if(USE_SANDBOX) + target_compile_options(${CEF_HELPER_TARGET} PRIVATE -Wno-deprecated-declarations) + target_compile_options(libcef_dll_wrapper PRIVATE -Wno-deprecated-declarations) + + if (USE_SANDBOX) # Logical target used to link the cef_sandbox library. ADD_LOGICAL_TARGET("cef_sandbox_lib" "${CEF_SANDBOX_LIB_DEBUG}" "${CEF_SANDBOX_LIB_RELEASE}") target_link_libraries(${CEF_HELPER_TARGET} cef_sandbox_lib) - endif() -endif() + endif () +endif () if (OS_WINDOWS) message(STATUS "Setting up WebBrowser CEF helper executable: ${CEF_HELPER_TARGET}") diff --git a/modules/webbrowser/cmake/patch/cmake/cef_variables.cmake b/modules/webbrowser/cmake/patch/cmake/cef_variables.cmake index 08acbeba7c..d534b80192 100644 --- a/modules/webbrowser/cmake/patch/cmake/cef_variables.cmake +++ b/modules/webbrowser/cmake/patch/cmake/cef_variables.cmake @@ -305,7 +305,7 @@ if(OS_MACOSX) endforeach() # Target SDK. - set(CEF_TARGET_SDK "10.9") + set(CEF_TARGET_SDK "10.14") list(APPEND CEF_COMPILER_FLAGS -mmacosx-version-min=${CEF_TARGET_SDK} ) diff --git a/modules/webbrowser/shaders/screenspace_fs.glsl b/modules/webbrowser/shaders/screenspace_fs.glsl index bef4564a75..7b0491b004 100644 --- a/modules/webbrowser/shaders/screenspace_fs.glsl +++ b/modules/webbrowser/shaders/screenspace_fs.glsl @@ -2,7 +2,7 @@ * * * OpenSpace * * * - * Copyright (c) 2014-2019 * + * Copyright (c) 2014-2020 * * * * 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 * diff --git a/modules/webbrowser/shaders/screenspace_vs.glsl b/modules/webbrowser/shaders/screenspace_vs.glsl index 780ddfcef6..b7a3b4af15 100644 --- a/modules/webbrowser/shaders/screenspace_vs.glsl +++ b/modules/webbrowser/shaders/screenspace_vs.glsl @@ -2,7 +2,7 @@ * * * OpenSpace * * * - * Copyright (c) 2014-2019 * + * Copyright (c) 2014-2020 * * * * 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 * diff --git a/modules/webbrowser/src/processhelpermac.cpp b/modules/webbrowser/src/processhelpermac.cpp index b26788b629..f39f312b8f 100644 --- a/modules/webbrowser/src/processhelpermac.cpp +++ b/modules/webbrowser/src/processhelpermac.cpp @@ -2,7 +2,7 @@ * * * OpenSpace * * * - * Copyright (c) 2014-2019 * + * Copyright (c) 2014-2020 * * * * 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 * diff --git a/modules/webbrowser/src/webrenderhandler.cpp b/modules/webbrowser/src/webrenderhandler.cpp index 9c01a4e668..d0d081c7c1 100644 --- a/modules/webbrowser/src/webrenderhandler.cpp +++ b/modules/webbrowser/src/webrenderhandler.cpp @@ -71,7 +71,8 @@ void WebRenderHandler::OnPaint(CefRefPtr, CefRenderHandler::PaintEle const glm::ivec2 rectSize = upperUpdatingRectBound - lowerUpdatingRectBound; if (rectSize.x > 0 && rectSize.y > 0) { _textureIsDirty = true; - } else { + } + else { return; } @@ -117,7 +118,8 @@ void WebRenderHandler::updateTexture() { glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); glBindTexture(GL_TEXTURE_2D, 0); - } else if (_textureIsDirty) { + } + else if (_textureIsDirty) { glBindTexture(GL_TEXTURE_2D, _texture); glPixelStorei(GL_UNPACK_ROW_LENGTH, _browserBufferSize.x); diff --git a/modules/webbrowser/webbrowsermodule.cpp b/modules/webbrowser/webbrowsermodule.cpp index 4417787c7d..32d042581e 100644 --- a/modules/webbrowser/webbrowsermodule.cpp +++ b/modules/webbrowser/webbrowsermodule.cpp @@ -129,7 +129,8 @@ void WebBrowserModule::internalInitialize(const ghoul::Dictionary& dictionary) { if (dictionary.hasKeyAndValue("WebHelperLocation")) { _webHelperLocation = absPath(dictionary.value("WebHelperLocation")); - } else { + } + else { _webHelperLocation = findHelperExecutable(); } @@ -188,7 +189,8 @@ void WebBrowserModule::removeBrowser(BrowserInstance* browser) { const auto p = std::find(_browsers.begin(), _browsers.end(), browser); if (p != _browsers.end()) { _browsers.erase(p); - } else { + } + else { LWARNING("Could not find browser in list of browsers."); } diff --git a/modules/webgui/webguimodule.cpp b/modules/webgui/webguimodule.cpp index 8f3b83ddb0..ae0d3079fd 100644 --- a/modules/webgui/webguimodule.cpp +++ b/modules/webgui/webguimodule.cpp @@ -174,7 +174,8 @@ void WebGuiModule::internalInitialize(const ghoul::Dictionary& configuration) { auto startOrStop = [this]() { if (_enabled && !_entryPoint.value().empty()) { startProcess(); - } else { + } + else { stopProcess(); } }; diff --git a/shaders/PowerScaling/powerScalingMath.hglsl b/shaders/PowerScaling/powerScalingMath.hglsl index 626a76fcc7..c07c248f4b 100644 --- a/shaders/PowerScaling/powerScalingMath.hglsl +++ b/shaders/PowerScaling/powerScalingMath.hglsl @@ -2,7 +2,7 @@ * * * OpenSpace * * * - * Copyright (c) 2014-2019 * + * Copyright (c) 2014-2020 * * * * 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 * diff --git a/shaders/PowerScaling/powerScaling_fs.hglsl b/shaders/PowerScaling/powerScaling_fs.hglsl index f31ab0a052..d30d5370fa 100644 --- a/shaders/PowerScaling/powerScaling_fs.hglsl +++ b/shaders/PowerScaling/powerScaling_fs.hglsl @@ -2,7 +2,7 @@ * * * OpenSpace * * * - * Copyright (c) 2014-2019 * + * Copyright (c) 2014-2020 * * * * 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 * diff --git a/shaders/PowerScaling/powerScaling_vs.hglsl b/shaders/PowerScaling/powerScaling_vs.hglsl index b1cbbb4c9f..85b94bd939 100644 --- a/shaders/PowerScaling/powerScaling_vs.hglsl +++ b/shaders/PowerScaling/powerScaling_vs.hglsl @@ -2,7 +2,7 @@ * * * OpenSpace * * * - * Copyright (c) 2014-2019 * + * Copyright (c) 2014-2020 * * * * 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 * diff --git a/shaders/abuffer/abufferfragment.glsl b/shaders/abuffer/abufferfragment.glsl index 108bd1726c..519c76136f 100644 --- a/shaders/abuffer/abufferfragment.glsl +++ b/shaders/abuffer/abufferfragment.glsl @@ -2,7 +2,7 @@ * * * OpenSpace * * * - * Copyright (c) 2014-2019 * + * Copyright (c) 2014-2020 * * * * 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 * diff --git a/shaders/abuffer/abufferresources.glsl b/shaders/abuffer/abufferresources.glsl index 562a761be9..2083160765 100644 --- a/shaders/abuffer/abufferresources.glsl +++ b/shaders/abuffer/abufferresources.glsl @@ -2,7 +2,7 @@ * * * OpenSpace * * * - * Copyright (c) 2014-2019 * + * Copyright (c) 2014-2020 * * * * 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 * diff --git a/shaders/abuffer/boundsabuffer.frag b/shaders/abuffer/boundsabuffer.frag index 127f1dedd7..39b3c9de74 100644 --- a/shaders/abuffer/boundsabuffer.frag +++ b/shaders/abuffer/boundsabuffer.frag @@ -2,7 +2,7 @@ * * * OpenSpace * * * - * Copyright (c) 2014-2019 * + * Copyright (c) 2014-2020 * * * * 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 * diff --git a/shaders/abuffer/raycasterdata.glsl b/shaders/abuffer/raycasterdata.glsl index 50d5ed6d76..6adc2b505d 100644 --- a/shaders/abuffer/raycasterdata.glsl +++ b/shaders/abuffer/raycasterdata.glsl @@ -2,7 +2,7 @@ * * * OpenSpace * * * - * Copyright (c) 2014-2019 * + * Copyright (c) 2014-2020 * * * * 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 * diff --git a/shaders/abuffer/renderabuffer.frag b/shaders/abuffer/renderabuffer.frag index af323f7bec..316238681b 100644 --- a/shaders/abuffer/renderabuffer.frag +++ b/shaders/abuffer/renderabuffer.frag @@ -2,7 +2,7 @@ * * * OpenSpace * * * - * Copyright (c) 2014-2019 * + * Copyright (c) 2014-2020 * * * * 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 * diff --git a/shaders/abuffer/renderabuffer.vert b/shaders/abuffer/renderabuffer.vert index a1bf057ce6..95ffd3ac7a 100644 --- a/shaders/abuffer/renderabuffer.vert +++ b/shaders/abuffer/renderabuffer.vert @@ -2,7 +2,7 @@ * * * OpenSpace * * * - * Copyright (c) 2014-2019 * + * Copyright (c) 2014-2020 * * * * 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 * diff --git a/shaders/abuffer/resolveabuffer.frag b/shaders/abuffer/resolveabuffer.frag index 8efebf2947..d3681578da 100644 --- a/shaders/abuffer/resolveabuffer.frag +++ b/shaders/abuffer/resolveabuffer.frag @@ -2,7 +2,7 @@ * * * OpenSpace * * * - * Copyright (c) 2014-2019 * + * Copyright (c) 2014-2020 * * * * 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 * diff --git a/shaders/abuffer/resolveabuffer.vert b/shaders/abuffer/resolveabuffer.vert index 956aa538ce..c33c92d84d 100644 --- a/shaders/abuffer/resolveabuffer.vert +++ b/shaders/abuffer/resolveabuffer.vert @@ -2,7 +2,7 @@ * * * OpenSpace * * * - * Copyright (c) 2014-2019 * + * Copyright (c) 2014-2020 * * * * 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 * diff --git a/shaders/abuffer/resolvehelpers.glsl b/shaders/abuffer/resolvehelpers.glsl index 411bcd9c9a..2a474879c9 100644 --- a/shaders/abuffer/resolvehelpers.glsl +++ b/shaders/abuffer/resolvehelpers.glsl @@ -2,7 +2,7 @@ * * * OpenSpace * * * - * Copyright (c) 2014-2019 * + * Copyright (c) 2014-2020 * * * * 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 * diff --git a/shaders/blending.glsl b/shaders/blending.glsl index 46091050cb..c5dce91519 100644 --- a/shaders/blending.glsl +++ b/shaders/blending.glsl @@ -2,7 +2,7 @@ * * * OpenSpace * * * - * Copyright (c) 2014-2019 * + * Copyright (c) 2014-2020 * * * * 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 * diff --git a/shaders/floatoperations.glsl b/shaders/floatoperations.glsl index 7b43a5f891..dad993dc47 100644 --- a/shaders/floatoperations.glsl +++ b/shaders/floatoperations.glsl @@ -2,7 +2,7 @@ * * * OpenSpace * * * - * Copyright (c) 2014-2019 * + * Copyright (c) 2014-2020 * * * * 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 * diff --git a/shaders/fragment.glsl b/shaders/fragment.glsl index 95efdb25ab..7607996e74 100644 --- a/shaders/fragment.glsl +++ b/shaders/fragment.glsl @@ -2,7 +2,7 @@ * * * OpenSpace * * * - * Copyright (c) 2014-2019 * + * Copyright (c) 2014-2020 * * * * 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 * diff --git a/shaders/framebuffer/exitframebuffer.frag b/shaders/framebuffer/exitframebuffer.frag index e561206773..0280f0a36c 100644 --- a/shaders/framebuffer/exitframebuffer.frag +++ b/shaders/framebuffer/exitframebuffer.frag @@ -2,7 +2,7 @@ * * * OpenSpace * * * - * Copyright (c) 2014-2019 * + * Copyright (c) 2014-2020 * * * * 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 * diff --git a/shaders/framebuffer/fxaa.frag b/shaders/framebuffer/fxaa.frag index a9d30c4279..c558b4cd04 100644 --- a/shaders/framebuffer/fxaa.frag +++ b/shaders/framebuffer/fxaa.frag @@ -2,7 +2,7 @@ * * * OpenSpace * * * - * Copyright (c) 2014-2019 * + * Copyright (c) 2014-2020 * * * * 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 * diff --git a/shaders/framebuffer/fxaa.vert b/shaders/framebuffer/fxaa.vert index f737e51882..b0a412be03 100644 --- a/shaders/framebuffer/fxaa.vert +++ b/shaders/framebuffer/fxaa.vert @@ -2,7 +2,7 @@ * * * OpenSpace * * * - * Copyright (c) 2014-2019 * + * Copyright (c) 2014-2020 * * * * 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 * diff --git a/shaders/framebuffer/hdrAndFiltering.frag b/shaders/framebuffer/hdrAndFiltering.frag index 0e2b3b2090..d4e43cbdf8 100644 --- a/shaders/framebuffer/hdrAndFiltering.frag +++ b/shaders/framebuffer/hdrAndFiltering.frag @@ -2,7 +2,7 @@ * * * OpenSpace * * * - * Copyright (c) 2014-2019 * + * Copyright (c) 2014-2020 * * * * 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 * diff --git a/shaders/framebuffer/hdrAndFiltering.vert b/shaders/framebuffer/hdrAndFiltering.vert index f737e51882..b0a412be03 100644 --- a/shaders/framebuffer/hdrAndFiltering.vert +++ b/shaders/framebuffer/hdrAndFiltering.vert @@ -2,7 +2,7 @@ * * * OpenSpace * * * - * Copyright (c) 2014-2019 * + * Copyright (c) 2014-2020 * * * * 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 * diff --git a/shaders/framebuffer/inside.glsl b/shaders/framebuffer/inside.glsl index 5801dfc587..012a221fd9 100644 --- a/shaders/framebuffer/inside.glsl +++ b/shaders/framebuffer/inside.glsl @@ -2,7 +2,7 @@ * * * OpenSpace * * * - * Copyright (c) 2014-2019 * + * Copyright (c) 2014-2020 * * * * 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 * diff --git a/shaders/framebuffer/mergeDownscaledVolume.frag b/shaders/framebuffer/mergeDownscaledVolume.frag index 14a6405735..b255d2a590 100644 --- a/shaders/framebuffer/mergeDownscaledVolume.frag +++ b/shaders/framebuffer/mergeDownscaledVolume.frag @@ -2,7 +2,7 @@ * * * OpenSpace * * * - * Copyright (c) 2014-2019 * + * Copyright (c) 2014-2020 * * * * 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 * diff --git a/shaders/framebuffer/mergeDownscaledVolume.vert b/shaders/framebuffer/mergeDownscaledVolume.vert index f737e51882..b0a412be03 100644 --- a/shaders/framebuffer/mergeDownscaledVolume.vert +++ b/shaders/framebuffer/mergeDownscaledVolume.vert @@ -2,7 +2,7 @@ * * * OpenSpace * * * - * Copyright (c) 2014-2019 * + * Copyright (c) 2014-2020 * * * * 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 * diff --git a/shaders/framebuffer/nOneStripMSAA.frag b/shaders/framebuffer/nOneStripMSAA.frag index c16d61aeba..4386ad4af5 100644 --- a/shaders/framebuffer/nOneStripMSAA.frag +++ b/shaders/framebuffer/nOneStripMSAA.frag @@ -2,7 +2,7 @@ * * * OpenSpace * * * - * Copyright (c) 2014-2019 * + * Copyright (c) 2014-2020 * * * * 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 * @@ -32,7 +32,7 @@ in vec2 vTexCoord; uniform int currentSample; uniform sampler2DMS pixelSizeTexture; -void main() { +void main() { finalColor = vec4(texelFetch(pixelSizeTexture, ivec2(vTexCoord), currentSample).rgb, 1.0); //finalColor = vec4(0.5*vPosition.xy + 0.5, 1.0, 1.0); //finalColor = vec4(vPosition.xy, 0.0, 1.0); diff --git a/shaders/framebuffer/nOneStripMSAA.vert b/shaders/framebuffer/nOneStripMSAA.vert index 6c7f2e9163..ccce241d15 100644 --- a/shaders/framebuffer/nOneStripMSAA.vert +++ b/shaders/framebuffer/nOneStripMSAA.vert @@ -2,7 +2,7 @@ * * * OpenSpace * * * - * Copyright (c) 2014-2019 * + * Copyright (c) 2014-2020 * * * * 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 * diff --git a/shaders/framebuffer/outside.glsl b/shaders/framebuffer/outside.glsl index e56198693b..847304b039 100644 --- a/shaders/framebuffer/outside.glsl +++ b/shaders/framebuffer/outside.glsl @@ -2,7 +2,7 @@ * * * OpenSpace * * * - * Copyright (c) 2014-2019 * + * Copyright (c) 2014-2020 * * * * 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 * diff --git a/shaders/framebuffer/raycastframebuffer.frag b/shaders/framebuffer/raycastframebuffer.frag index bff04b1dbe..1a9efc53c2 100644 --- a/shaders/framebuffer/raycastframebuffer.frag +++ b/shaders/framebuffer/raycastframebuffer.frag @@ -2,7 +2,7 @@ * * * OpenSpace * * * - * Copyright (c) 2014-2019 * + * Copyright (c) 2014-2020 * * * * 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 * diff --git a/shaders/framebuffer/renderframebuffer.frag b/shaders/framebuffer/renderframebuffer.frag index a20d685f4e..deb68cb122 100644 --- a/shaders/framebuffer/renderframebuffer.frag +++ b/shaders/framebuffer/renderframebuffer.frag @@ -2,7 +2,7 @@ * * * OpenSpace * * * - * Copyright (c) 2014-2019 * + * Copyright (c) 2014-2020 * * * * 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 * diff --git a/shaders/framebuffer/resolveframebuffer.vert b/shaders/framebuffer/resolveframebuffer.vert index 9167d4c640..320f8b7f15 100644 --- a/shaders/framebuffer/resolveframebuffer.vert +++ b/shaders/framebuffer/resolveframebuffer.vert @@ -2,7 +2,7 @@ * * * OpenSpace * * * - * Copyright (c) 2014-2019 * + * Copyright (c) 2014-2020 * * * * 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 * diff --git a/shaders/hdr.glsl b/shaders/hdr.glsl index 2fca4496c5..63dc9b5d2d 100644 --- a/shaders/hdr.glsl +++ b/shaders/hdr.glsl @@ -2,7 +2,7 @@ * * * OpenSpace * * * - * Copyright (c) 2014-2019 * + * Copyright (c) 2014-2020 * * * * 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 * diff --git a/shaders/rand.glsl b/shaders/rand.glsl index 3e38e95058..f2ac746245 100644 --- a/shaders/rand.glsl +++ b/shaders/rand.glsl @@ -2,7 +2,7 @@ * * * OpenSpace * * * - * Copyright (c) 2014-2019 * + * Copyright (c) 2014-2020 * * * * 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 * diff --git a/src/documentation/documentationengine.cpp b/src/documentation/documentationengine.cpp index dd65a56231..06456dca21 100644 --- a/src/documentation/documentationengine.cpp +++ b/src/documentation/documentationengine.cpp @@ -113,7 +113,8 @@ std::string generateJsonDocumentation(const Documentation& d) { if (it == documentations.end()) { result << R"("reference": { "found": false })"; - } else { + } + else { result << R"("reference": {)" << R"("found": true,)" << R"("name": ")" << it->name << "\"," diff --git a/src/engine/downloadmanager.cpp b/src/engine/downloadmanager.cpp index f8e256f768..936b7c4672 100644 --- a/src/engine/downloadmanager.cpp +++ b/src/engine/downloadmanager.cpp @@ -271,17 +271,20 @@ std::future DownloadManager::fetchFile( getline(ss, extension ,'/'); getline(ss, extension); file.format = extension; - } else { + } + else { LWARNING("Could not get extension from file downloaded from: " + url); } successCb(file); curl_easy_cleanup(curl); return file; - } else { + } + else { std::string err = curl_easy_strerror(res); if (errorCb) { errorCb(err); - } else { + } + else { LWARNING(fmt::format("Error downloading '{}': {}", url, err)); } curl_easy_cleanup(curl); diff --git a/src/engine/openspaceengine.cpp b/src/engine/openspaceengine.cpp index 3390914c42..2ed17ecb9a 100644 --- a/src/engine/openspaceengine.cpp +++ b/src/engine/openspaceengine.cpp @@ -723,7 +723,8 @@ void OpenSpaceEngine::loadSingleAsset(const std::string& assetPath) { unsigned int nAvailableThreads = std::thread::hardware_concurrency(); unsigned int nThreads = nAvailableThreads == 0 ? 2 : nAvailableThreads - 1; sceneInitializer = std::make_unique(nThreads); - } else { + } + else { sceneInitializer = std::make_unique(); } @@ -740,7 +741,8 @@ void OpenSpaceEngine::loadSingleAsset(const std::string& assetPath) { const SceneGraphNode* parent = camera->parent(); if (parent) { global::navigationHandler.orbitalNavigator().setFocusNode(parent->identifier()); - } else { + } + else { global::navigationHandler.orbitalNavigator().setFocusNode( _scene->root()->identifier() ); @@ -817,7 +819,8 @@ void OpenSpaceEngine::loadSingleAsset(const std::string& assetPath) { progressInfo ); ++it; - } else { + } + else { LoadingScreen::ProgressInfo progressInfo; progressInfo.progress = 1.f; diff --git a/src/interaction/navigationhandler.cpp b/src/interaction/navigationhandler.cpp index ed57ecea91..e8d6094b0d 100644 --- a/src/interaction/navigationhandler.cpp +++ b/src/interaction/navigationhandler.cpp @@ -53,6 +53,12 @@ namespace { constexpr const char* KeyReferenceFrame = "ReferenceFrame"; const double Epsilon = 1E-7; + constexpr const openspace::properties::Property::PropertyInfo KeyDisableInputInfo = { + "DisableInputs", + "Disable all mouse inputs", + "Disables all mouse inputs and prevents them from affecting the camera" + }; + constexpr const openspace::properties::Property::PropertyInfo KeyFrameInfo = { "UseKeyFrameInteraction", "Use keyframe interaction", @@ -142,11 +148,13 @@ NavigationHandler::NavigationState::NavigationState(std::string anchor, std::str NavigationHandler::NavigationHandler() : properties::PropertyOwner({ "NavigationHandler" }) + , _disableInputs(KeyDisableInputInfo, false) , _useKeyFrameInteraction(KeyFrameInfo, false) { - // Add the properties - addProperty(_useKeyFrameInteraction); addPropertySubOwner(_orbitalNavigator); + + addProperty(_disableInputs); + addProperty(_useKeyFrameInteraction); } NavigationHandler::~NavigationHandler() {} // NOLINT @@ -326,20 +334,28 @@ const InputState& NavigationHandler::inputState() const { } void NavigationHandler::mouseButtonCallback(MouseButton button, MouseAction action) { - _inputState.mouseButtonCallback(button, action); + if (!_disableInputs) { + _inputState.mouseButtonCallback(button, action); + } } void NavigationHandler::mousePositionCallback(double x, double y) { - _inputState.mousePositionCallback(x, y); + if (!_disableInputs) { + _inputState.mousePositionCallback(x, y); + } } void NavigationHandler::mouseScrollWheelCallback(double pos) { - _inputState.mouseScrollWheelCallback(pos); + if (!_disableInputs) { + _inputState.mouseScrollWheelCallback(pos); + } } void NavigationHandler::keyboardCallback(Key key, KeyModifier modifier, KeyAction action) { - _inputState.keyboardCallback(key, modifier, action); + if (!_disableInputs) { + _inputState.keyboardCallback(key, modifier, action); + } } NavigationHandler::NavigationState NavigationHandler::navigationState() const { diff --git a/src/interaction/sessionrecording.cpp b/src/interaction/sessionrecording.cpp index db8496e106..110eca4b43 100644 --- a/src/interaction/sessionrecording.cpp +++ b/src/interaction/sessionrecording.cpp @@ -523,7 +523,8 @@ void SessionRecording::saveTimeKeyframe() { writeToFileBuffer(kf._requiresTimeJump); saveKeyframeToFileBinary(_keyframeBuffer, _bufferIndex); - } else { + } + else { std::stringstream keyframeLine = std::stringstream(); //Add simulation timestamp, timestamp relative, simulation time to recording start keyframeLine << "time "; @@ -880,7 +881,8 @@ void SessionRecording::playbackTimeChange() { )); return; } - } else { + } + else { std::istringstream iss(_playbackLineParsing); std::string entryType; //double timeRef; @@ -943,7 +945,8 @@ void SessionRecording::playbackScript() { )); return; } - } else { + } + else { std::istringstream iss(_playbackLineParsing); std::string entryType; std::string tmpReadbackScript; @@ -958,7 +961,8 @@ void SessionRecording::playbackScript() { "Error parsing script line {} of playback file", _playbackLineNum )); return; - } else if (!iss.eof()) { + } + else if (!iss.eof()) { LERROR(fmt::format( "Did not find an EOL at line {} of playback file", _playbackLineNum )); @@ -1108,7 +1112,8 @@ bool SessionRecording::findNextFutureCameraIndex(double currTime) { _idxTimeline_cameraPtrNext = seekAheadIndex; } break; - } else { + } + else { // Force interpolation between consecutive keyframes _idxTimeline_cameraPtrPrev = seekAheadIndex; } diff --git a/src/interaction/touchbar.mm b/src/interaction/touchbar.mm index f1762ced24..644e199e29 100644 --- a/src/interaction/touchbar.mm +++ b/src/interaction/touchbar.mm @@ -2,7 +2,7 @@ * * * OpenSpace * * * - * Copyright (c) 2014-2019 * + * Copyright (c) 2014-2020 * * * * 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 * diff --git a/src/network/parallelpeer.cpp b/src/network/parallelpeer.cpp index ec68ee23cb..7a6de5c9de 100644 --- a/src/network/parallelpeer.cpp +++ b/src/network/parallelpeer.cpp @@ -547,7 +547,8 @@ void ParallelPeer::setStatus(ParallelConnection::Status status) { global::timeManager.addTimelineChangeCallback([this]() { _timeTimelineChanged = true; }); - } else { + } + else { if (_timeJumpCallback != -1) { global::timeManager.removeTimeJumpCallback(_timeJumpCallback); } diff --git a/src/network/parallelserver.cpp b/src/network/parallelserver.cpp index b4f775cf48..499aa642f8 100644 --- a/src/network/parallelserver.cpp +++ b/src/network/parallelserver.cpp @@ -382,7 +382,8 @@ void ParallelServer::setToClient(Peer& peer) { it.second->status = ParallelConnection::Status::ClientWithoutHost; sendConnectionStatus(*it.second); } - } else { + } + else { peer.status = (_hostPeerId > 0) ? ParallelConnection::Status::ClientWithHost : ParallelConnection::Status::ClientWithoutHost; diff --git a/src/openspace.cpp b/src/openspace.cpp index 48c80e5071..eda8a807f2 100644 --- a/src/openspace.cpp +++ b/src/openspace.cpp @@ -29,7 +29,7 @@ namespace openspace { std::string licenseText() { return "OpenSpace\n\ \n\ -Copyright (c) 2014-2019\n\ +Copyright (c) 2014-2020\n\ \n\ Permission is hereby granted, free of charge, to any person obtaining a copy of this\n\ software and associated documentation files (the \"Software\"), to deal in the Software\n\ diff --git a/src/properties/matrix/dmat4x3property.cpp b/src/properties/matrix/dmat4x3property.cpp index 29153cfedc..95fa2beaaf 100644 --- a/src/properties/matrix/dmat4x3property.cpp +++ b/src/properties/matrix/dmat4x3property.cpp @@ -46,7 +46,8 @@ glm::dmat4x3 fromLuaConversion(lua_State* state, bool& success) { if (lua_isnumber(state, -1) != 1) { success = false; return glm::dmat4x3(0.0); - } else { + } + else { result[i][j] = lua_tonumber(state, -1); lua_pop(state, 1); ++number; diff --git a/src/properties/matrix/mat2property.cpp b/src/properties/matrix/mat2property.cpp index e9bde9a9a9..aaa69c6cbc 100644 --- a/src/properties/matrix/mat2property.cpp +++ b/src/properties/matrix/mat2property.cpp @@ -46,7 +46,8 @@ glm::mat2x2 fromLuaConversion(lua_State* state, bool& success) { if (lua_isnumber(state, -1) != 1) { success = false; return glm::mat2x2(1.f); - } else { + } + else { result[i][j] = static_cast( lua_tonumber(state, -1) ); diff --git a/src/properties/matrix/mat3property.cpp b/src/properties/matrix/mat3property.cpp index edd2cc0438..8cb87a6418 100644 --- a/src/properties/matrix/mat3property.cpp +++ b/src/properties/matrix/mat3property.cpp @@ -46,7 +46,8 @@ glm::mat3x3 fromLuaConversion(lua_State* state, bool& success) { if (lua_isnumber(state, -1) != 1) { success = false; return glm::mat3x3(1.f); - } else { + } + else { result[i][j] = static_cast(lua_tonumber(state, -1)); lua_pop(state, 1); diff --git a/src/properties/matrix/mat3x2property.cpp b/src/properties/matrix/mat3x2property.cpp index 7177f076b2..8e9b1b2ea9 100644 --- a/src/properties/matrix/mat3x2property.cpp +++ b/src/properties/matrix/mat3x2property.cpp @@ -43,10 +43,11 @@ glm::mat3x2 fromLuaConversion(lua_State* state, bool& success) { success = false; return glm::mat3x2(0.f); } - if (lua_isnumber(state, -1) != 1) { + if (lua_isnumber(state, -1) != 1) { success = false; return glm::mat3x2(0.f); - } else { + } + else { result[i][j] = static_cast(lua_tonumber(state, -1)); lua_pop(state, 1); diff --git a/src/properties/matrix/mat3x4property.cpp b/src/properties/matrix/mat3x4property.cpp index 82b81626ec..be54c8239e 100644 --- a/src/properties/matrix/mat3x4property.cpp +++ b/src/properties/matrix/mat3x4property.cpp @@ -46,7 +46,8 @@ glm::mat3x4 fromLuaConversion(lua_State* state, bool& success) { if (lua_isnumber(state, -1) != 1) { success = false; return glm::mat3x4(1.f); - } else { + } + else { result[i][j] = static_cast(lua_tonumber(state, -1)); lua_pop(state, 1); diff --git a/src/properties/matrix/mat4property.cpp b/src/properties/matrix/mat4property.cpp index 6141c71918..b224668489 100644 --- a/src/properties/matrix/mat4property.cpp +++ b/src/properties/matrix/mat4property.cpp @@ -48,7 +48,8 @@ glm::mat4x4 fromLuaConversion(lua_State* state, bool& success) { if (lua_isnumber(state, -1) != 1) { success = false; return glm::mat4x4(1.f); - } else { + } + else { result[i][j] = static_cast(lua_tonumber(state, -1)); lua_pop(state, 1); diff --git a/src/properties/matrix/mat4x2property.cpp b/src/properties/matrix/mat4x2property.cpp index a25b68c9be..c528dd49cc 100644 --- a/src/properties/matrix/mat4x2property.cpp +++ b/src/properties/matrix/mat4x2property.cpp @@ -46,7 +46,8 @@ glm::mat4x2 fromLuaConversion(lua_State* state, bool& success) { if (lua_isnumber(state, -1) != 1) { success = false; return glm::mat4x2(1.f); - } else { + } + else { result[i][j] = static_cast(lua_tonumber(state, -1)); lua_pop(state, 1); diff --git a/src/properties/matrix/mat4x3property.cpp b/src/properties/matrix/mat4x3property.cpp index 33ac21d96d..74bd66237e 100644 --- a/src/properties/matrix/mat4x3property.cpp +++ b/src/properties/matrix/mat4x3property.cpp @@ -46,7 +46,8 @@ glm::mat4x3 fromLuaConversion(lua_State* state, bool& success) { if (lua_isnumber(state, -1) != 1) { success = false; return glm::mat4x3(1.f); - } else { + } + else { result[i][j] = static_cast(lua_tonumber(state, -1)); lua_pop(state, 1); diff --git a/src/properties/propertyowner.cpp b/src/properties/propertyowner.cpp index 0bd235c565..b1c00328c8 100644 --- a/src/properties/propertyowner.cpp +++ b/src/properties/propertyowner.cpp @@ -190,7 +190,8 @@ void PropertyOwner::addProperty(Property* prop) { identifier() )); return; - } else { + } + else { // Otherwise we still have to look if there is a PropertyOwner with the same name const bool hasOwner = hasPropertySubOwner(prop->identifier()); if (hasOwner) { @@ -235,7 +236,8 @@ void PropertyOwner::addPropertySubOwner(openspace::properties::PropertyOwner* ow identifier() )); return; - } else { + } + else { // We still need to check if the PropertyOwners name is used in a Property const bool hasProp = hasProperty(owner->identifier()); if (hasProp) { @@ -269,7 +271,8 @@ void PropertyOwner::removeProperty(Property* prop) { if (it != _properties.end() && (*it)->identifier() == prop->identifier()) { (*it)->setPropertyOwner(nullptr); _properties.erase(it); - } else { + } + else { LERROR(fmt::format( "Property with identifier '{}' not found for removal", prop->identifier() )); @@ -295,7 +298,8 @@ void PropertyOwner::removePropertySubOwner(openspace::properties::PropertyOwner* // If we found the propertyowner, we can delete it if (it != _subOwners.end() && (*it)->identifier() == owner->identifier()) { _subOwners.erase(it); - } else { + } + else { LERROR(fmt::format( "PropertyOwner with name '{}' not found for removal", owner->identifier() )); diff --git a/src/rendering/abufferrenderer.cpp b/src/rendering/abufferrenderer.cpp index fb9be4e8a7..5bc54db990 100644 --- a/src/rendering/abufferrenderer.cpp +++ b/src/rendering/abufferrenderer.cpp @@ -975,7 +975,8 @@ void ABufferRenderer::updateRaycastData() { if (helperPath.empty()) { data.namespaceName = "NAMESPACE_" + std::to_string(nextNamespaceIndex++); - } else { + } + else { auto iter = namespaceIndices.find(helperPath); if (iter == namespaceIndices.end()) { int namespaceIndex = nextNamespaceIndex++; diff --git a/src/rendering/framebufferrenderer.cpp b/src/rendering/framebufferrenderer.cpp index d260facb32..5a3ff016cd 100644 --- a/src/rendering/framebufferrenderer.cpp +++ b/src/rendering/framebufferrenderer.cpp @@ -51,6 +51,30 @@ namespace { constexpr const char* _loggerCat = "FramebufferRenderer"; + // If this is true (detected automatically), the OpenGL debug information functions + // are available and will be used to mark object names and debug groups + bool HasGLDebugInfo = false; + + struct GLDebugGroup { + explicit GLDebugGroup(std::string_view name) { + if (HasGLDebugInfo) { + glPushDebugGroup( + GL_DEBUG_SOURCE_APPLICATION, + 0, + name.length(), + name.data() + ); + } + } + + ~GLDebugGroup() { + if (HasGLDebugInfo) { + glPopDebugGroup(); + } + } + }; + + constexpr const std::array HDRUniformNames = { "hdrFeedingTexture", "blackoutFactor", "hdrExposure", "gamma", "Hue", "Saturation", "Value" @@ -141,6 +165,10 @@ namespace openspace { void FramebufferRenderer::initialize() { LDEBUG("Initializing FramebufferRenderer"); + HasGLDebugInfo = glbinding::Binding::ObjectLabel.isResolved() && + glbinding::Binding::PushDebugGroup.isResolved() && + glbinding::Binding::PopDebugGroup.isResolved(); + const GLfloat vertexData[] = { // x y -1.f, -1.f, @@ -165,35 +193,112 @@ void FramebufferRenderer::initialize() { // GBuffers glGenTextures(1, &_gBuffers.colorTexture); + if (HasGLDebugInfo) { + glObjectLabel(GL_TEXTURE, _gBuffers.colorTexture, -1, "G-Buffer Color"); + } glGenTextures(1, &_gBuffers.depthTexture); + if (HasGLDebugInfo) { + glObjectLabel(GL_TEXTURE, _gBuffers.depthTexture, -1, "G-Buffer Depth"); + } glGenTextures(1, &_gBuffers.positionTexture); + if (HasGLDebugInfo) { + glObjectLabel(GL_TEXTURE, _gBuffers.positionTexture, -1, "G-Buffer Position"); + } glGenTextures(1, &_gBuffers.normalTexture); + if (HasGLDebugInfo) { + glObjectLabel(GL_TEXTURE, _gBuffers.normalTexture, -1, "G-Buffer Normal"); + } glGenFramebuffers(1, &_gBuffers.framebuffer); + if (HasGLDebugInfo) { + glObjectLabel(GL_FRAMEBUFFER, _gBuffers.framebuffer, -1, "G-Buffer Main"); + } // PingPong Buffers // The first pingpong buffer shares the color texture with the renderbuffer: _pingPongBuffers.colorTexture[0] = _gBuffers.colorTexture; glGenTextures(1, &_pingPongBuffers.colorTexture[1]); + if (glbinding::Binding::ObjectLabel.isResolved()) { + glObjectLabel( + GL_TEXTURE, + _pingPongBuffers.colorTexture[1], + -1, + "G-Buffer Color Ping-Pong" + ); + } glGenFramebuffers(1, &_pingPongBuffers.framebuffer); - + if (glbinding::Binding::ObjectLabel.isResolved()) { + glObjectLabel( + GL_FRAMEBUFFER, + _pingPongBuffers.framebuffer, + -1, + "G-Buffer Ping-Pong" + ); + } + // Exit framebuffer glGenTextures(1, &_exitColorTexture); + if (glbinding::Binding::ObjectLabel.isResolved()) { + glObjectLabel(GL_TEXTURE, _exitColorTexture, -1, "Exit color"); + } glGenTextures(1, &_exitDepthTexture); + if (glbinding::Binding::ObjectLabel.isResolved()) { + glObjectLabel(GL_TEXTURE, _exitColorTexture, -1, "Exit depth"); + } glGenFramebuffers(1, &_exitFramebuffer); + if (glbinding::Binding::ObjectLabel.isResolved()) { + glObjectLabel(GL_FRAMEBUFFER, _exitFramebuffer, -1, "Exit"); + } // HDR / Filtering Buffers glGenFramebuffers(1, &_hdrBuffers.hdrFilteringFramebuffer); + if (glbinding::Binding::ObjectLabel.isResolved()) { + glObjectLabel(GL_FRAMEBUFFER, _exitFramebuffer, -1, "HDR filtering"); + } glGenTextures(1, &_hdrBuffers.hdrFilteringTexture); + if (glbinding::Binding::ObjectLabel.isResolved()) { + glObjectLabel(GL_TEXTURE, _hdrBuffers.hdrFilteringTexture, -1, "HDR filtering"); + } + // FXAA Buffers glGenFramebuffers(1, &_fxaaBuffers.fxaaFramebuffer); + if (glbinding::Binding::ObjectLabel.isResolved()) { + glObjectLabel(GL_FRAMEBUFFER, _fxaaBuffers.fxaaFramebuffer, -1, "FXAA"); + } glGenTextures(1, &_fxaaBuffers.fxaaTexture); + if (glbinding::Binding::ObjectLabel.isResolved()) { + glObjectLabel(GL_TEXTURE, _fxaaBuffers.fxaaTexture, -1, "FXAA"); + } // DownscaleVolumeRendering glGenFramebuffers(1, &_downscaleVolumeRendering.framebuffer); + if (glbinding::Binding::ObjectLabel.isResolved()) { + glObjectLabel( + GL_FRAMEBUFFER, + _downscaleVolumeRendering.framebuffer, + -1, + "Downscaled Volume" + ); + } glGenTextures(1, &_downscaleVolumeRendering.colorTexture); + if (glbinding::Binding::ObjectLabel.isResolved()) { + glObjectLabel( + GL_TEXTURE, + _downscaleVolumeRendering.colorTexture, + -1, + "Downscaled Volume Color" + ); + } glGenTextures(1, &_downscaleVolumeRendering.depthbuffer); - + if (glbinding::Binding::ObjectLabel.isResolved()) { + glObjectLabel( + GL_TEXTURE, + _downscaleVolumeRendering.depthbuffer, + -1, + "Downscaled Volume Depth" + ); + } + // Allocate Textures/Buffers Memory updateResolution(); @@ -424,23 +529,19 @@ void FramebufferRenderer::applyTMO(float blackoutFactor) { if (doPerformanceMeasurements) { perfInternal = std::make_unique( "FramebufferRenderer::render::TMO" - ); + ); } _hdrFilteringProgram->activate(); ghoul::opengl::TextureUnit hdrFeedingTextureUnit; hdrFeedingTextureUnit.activate(); - glBindTexture( - GL_TEXTURE_2D, - _pingPongBuffers.colorTexture[_pingPongIndex] - ); + glBindTexture(GL_TEXTURE_2D, _pingPongBuffers.colorTexture[_pingPongIndex]); _hdrFilteringProgram->setUniform( _hdrUniformCache.hdrFeedingTexture, hdrFeedingTextureUnit ); - _hdrFilteringProgram->setUniform(_hdrUniformCache.blackoutFactor, blackoutFactor); _hdrFilteringProgram->setUniform(_hdrUniformCache.hdrExposure, _hdrExposure); _hdrFilteringProgram->setUniform(_hdrUniformCache.gamma, _gamma); @@ -468,7 +569,7 @@ void FramebufferRenderer::applyFXAA() { if (doPerformanceMeasurements) { perfInternal = std::make_unique( "FramebufferRenderer::render::FXAA" - ); + ); } _fxaaProgram->activate(); @@ -1042,6 +1143,9 @@ void FramebufferRenderer::updateDownscaledVolume() { void FramebufferRenderer::render(Scene* scene, Camera* camera, float blackoutFactor) { ZoneScoped + GLint viewport[4]; + glGetIntegerv(GL_VIEWPORT, viewport); + { // Set OpenGL default rendering state ZoneScopedN("Setting OpenGL state") @@ -1076,6 +1180,8 @@ void FramebufferRenderer::render(Scene* scene, Camera* camera, float blackoutFac ZoneScopedN("Deferred G-Buffer") TracyGpuZone("Deferred G-Buffer") + glViewport(0, 0, _resolution.x, _resolution.y); + glBindFramebuffer(GL_FRAMEBUFFER, _gBuffers.framebuffer); glDrawBuffers(3, ColorAttachment012Array); glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); @@ -1091,15 +1197,28 @@ void FramebufferRenderer::render(Scene* scene, Camera* camera, float blackoutFac }; RendererTasks tasks; - data.renderBinMask = static_cast(Renderable::RenderBin::Background); - scene->render(data, tasks); - data.renderBinMask = static_cast(Renderable::RenderBin::Opaque); - scene->render(data, tasks); - data.renderBinMask = static_cast(Renderable::RenderBin::Transparent); - scene->render(data, tasks); + { + GLDebugGroup group("Background"); + data.renderBinMask = static_cast(Renderable::RenderBin::Background); + scene->render(data, tasks); + } + + { + GLDebugGroup group("Opaque"); + data.renderBinMask = static_cast(Renderable::RenderBin::Opaque); + scene->render(data, tasks); + } + + { + GLDebugGroup group("Transparent"); + data.renderBinMask = static_cast(Renderable::RenderBin::Transparent); + scene->render(data, tasks); + } // Run Volume Tasks { + GLDebugGroup group("Raycaster Tasks"); + std::unique_ptr perfInternal; if (doPerformanceMeasurements) { perfInternal = std::make_unique( @@ -1107,9 +1226,15 @@ void FramebufferRenderer::render(Scene* scene, Camera* camera, float blackoutFac ); } performRaycasterTasks(tasks.raycasterTasks); + + if (HasGLDebugInfo) { + glPopDebugGroup(); + } } if (!tasks.deferredcasterTasks.empty()) { + GLDebugGroup group("Deferred Caster Tasks"); + // We use ping pong rendering in order to be able to // render to the same final buffer, multiple // deferred tasks at same time (e.g. more than 1 ATM being seen at once) @@ -1124,22 +1249,28 @@ void FramebufferRenderer::render(Scene* scene, Camera* camera, float blackoutFac } performDeferredTasks(tasks.deferredcasterTasks); } - + glDrawBuffers(1, &ColorAttachment01Array[_pingPongIndex]); glEnablei(GL_BLEND, 0); - data.renderBinMask = static_cast(Renderable::RenderBin::Overlay); - scene->render(data, tasks); + { + GLDebugGroup group("Overlay"); + data.renderBinMask = static_cast(Renderable::RenderBin::Overlay); + scene->render(data, tasks); + } glDrawBuffer(GL_COLOR_ATTACHMENT0); // Disabling depth test for filtering and hdr glDisable(GL_DEPTH_TEST); + glViewport(viewport[0], viewport[1], viewport[2], viewport[3]); + if (_enableFXAA) { glBindFramebuffer(GL_FRAMEBUFFER, _fxaaBuffers.fxaaFramebuffer); glDrawBuffers(1, ColorAttachment0Array); glDisable(GL_BLEND); + } else { // When applying the TMO, the result is saved to the default FBO to be displayed @@ -1147,10 +1278,15 @@ void FramebufferRenderer::render(Scene* scene, Camera* camera, float blackoutFac glBindFramebuffer(GL_FRAMEBUFFER, _defaultFBO); } - // Apply the selected TMO on the results and resolve the result for the default FBO - applyTMO(blackoutFactor); + { + // Apply the selected TMO on the results and resolve the result to the default FBO + GLDebugGroup group("Apply TMO"); + + applyTMO(blackoutFactor); + } if (_enableFXAA) { + GLDebugGroup group("Apply FXAA"); glBindFramebuffer(GL_FRAMEBUFFER, _defaultFBO); applyFXAA(); } diff --git a/src/rendering/luaconsole.cpp b/src/rendering/luaconsole.cpp index 022c144dbb..84a4f3ba79 100644 --- a/src/rendering/luaconsole.cpp +++ b/src/rendering/luaconsole.cpp @@ -817,7 +817,8 @@ void LuaConsole::render() { const glm::vec2 loc = locationForRightJustifiedText(nClientsText); RenderFont(*_font, loc, nClientsText, Red); - } else if (global::parallelPeer.isHost()) { + } + else if (global::parallelPeer.isHost()) { const glm::vec4 LightBlue(0.4f, 0.4f, 1.f, 1.f); const std::string localExecutionText = "Local script execution"; diff --git a/src/rendering/renderable.cpp b/src/rendering/renderable.cpp index 908cd3d200..cc3bbbfb51 100644 --- a/src/rendering/renderable.cpp +++ b/src/rendering/renderable.cpp @@ -128,7 +128,8 @@ Renderable::Renderable(const ghoul::Dictionary& dictionary) if (!tagName.empty()) { addTag(std::move(tagName)); } - } else if (dictionary.hasKeyAndValue(KeyTag)) { + } + else if (dictionary.hasKeyAndValue(KeyTag)) { const ghoul::Dictionary& tagNames = dictionary.value(KeyTag); const std::vector& keys = tagNames.keys(); for (const std::string& key : keys) { diff --git a/src/rendering/screenspacerenderable.cpp b/src/rendering/screenspacerenderable.cpp index a153149ed1..ed9b3fbbeb 100644 --- a/src/rendering/screenspacerenderable.cpp +++ b/src/rendering/screenspacerenderable.cpp @@ -442,7 +442,8 @@ ScreenSpaceRenderable::ScreenSpaceRenderable(const ghoul::Dictionary& dictionary if (!tagName.empty()) { addTag(std::move(tagName)); } - } else if (dictionary.hasKeyAndValue(KeyTag)) { + } + else if (dictionary.hasKeyAndValue(KeyTag)) { const ghoul::Dictionary& tagNames = dictionary.value(KeyTag); const std::vector& keys = tagNames.keys(); for (const std::string& key : keys) { diff --git a/src/rendering/transferfunction.cpp b/src/rendering/transferfunction.cpp index f2abf5fc9e..f702b1d347 100644 --- a/src/rendering/transferfunction.cpp +++ b/src/rendering/transferfunction.cpp @@ -45,7 +45,8 @@ namespace { return (0 == filepath.compare( filepath.length() - ending.length(), ending.length(), ending)); - } else { + } + else { return false; } } @@ -95,7 +96,8 @@ void TransferFunction::update() { if (_needsUpdate) { if (hasExtension(_filepath, "txt")) { setTextureFromTxt(); - } else { + } + else { setTextureFromImage(); } _texture->uploadTexture(); @@ -133,13 +135,16 @@ void TransferFunction::setTextureFromTxt(std::shared_ptr if (key == "width") { iss >> width; - } else if (key == "lower") { + } + else if (key == "lower") { iss >> lower; lower = glm::clamp(lower, 0.f, 1.f); - } else if (key == "upper") { + } + else if (key == "upper") { iss >> upper; upper = glm::clamp(upper, lower, 1.f); - } else if (key == "mappingkey") { + } + else if (key == "mappingkey") { float intensity; glm::vec4 rgba = glm::vec4(0.f); iss >> intensity; diff --git a/src/scene/assetloader.cpp b/src/scene/assetloader.cpp index 15ce77bb86..6d4b7c95c0 100644 --- a/src/scene/assetloader.cpp +++ b/src/scene/assetloader.cpp @@ -323,7 +323,8 @@ std::string AssetLoader::generateAssetPath(const std::string& baseDirectory, std::string prefix; if (pathType == PathType::RelativeToAsset) { prefix = baseDirectory + ghoul::filesystem::FileSystem::PathSeparator; - } else if (pathType == PathType::RelativeToAssetRoot) { + } + else if (pathType == PathType::RelativeToAssetRoot) { prefix = _assetRootDirectory + ghoul::filesystem::FileSystem::PathSeparator; } @@ -464,7 +465,8 @@ void AssetLoader::unrequest(const std::string& identifier) { ghoul::filesystem::Directory AssetLoader::currentDirectory() const { if (_currentAsset->hasAssetFile()) { return _currentAsset->assetDirectory(); - } else { + } + else { return _assetRootDirectory; } } diff --git a/src/scene/scene.cpp b/src/scene/scene.cpp index f8c9ef6e8a..1f5574816f 100644 --- a/src/scene/scene.cpp +++ b/src/scene/scene.cpp @@ -34,6 +34,7 @@ #include #include #include +#include #include #include #include @@ -468,7 +469,8 @@ SceneGraphNode* Scene::loadNode(const ghoul::Dictionary& nodeDictionary) { if (parent) { parent->attachChild(std::move(node)); - } else { + } + else { attachNode(std::move(node)); } diff --git a/src/scene/scene_lua.inl b/src/scene/scene_lua.inl index ee8b2d6258..1e00beee8c 100644 --- a/src/scene/scene_lua.inl +++ b/src/scene/scene_lua.inl @@ -29,7 +29,6 @@ #include #include -#pragma optimize ("", off) namespace openspace { namespace { diff --git a/src/scene/scenegraphnode.cpp b/src/scene/scenegraphnode.cpp index 4fdabb91e7..5177ea9c69 100644 --- a/src/scene/scenegraphnode.cpp +++ b/src/scene/scenegraphnode.cpp @@ -252,7 +252,8 @@ std::unique_ptr SceneGraphNode::createFromDictionary( if (!tagName.empty()) { result->addTag(std::move(tagName)); } - } else if (dictionary.hasKeyAndValue(KeyTag)) { + } + else if (dictionary.hasKeyAndValue(KeyTag)) { ghoul::Dictionary tagNames = dictionary.value(KeyTag); std::vector keys = tagNames.keys(); std::string tagName; diff --git a/src/scene/scenelicensewriter.cpp b/src/scene/scenelicensewriter.cpp index 84832573ba..9dc82ea163 100644 --- a/src/scene/scenelicensewriter.cpp +++ b/src/scene/scenelicensewriter.cpp @@ -66,7 +66,8 @@ std::string SceneLicenseWriter::generateJson() const { for (const char& c : json.str()) { if (c == '\'') { jsonString += "\\'"; - } else { + } + else { jsonString += c; } } diff --git a/src/scripting/scriptengine.cpp b/src/scripting/scriptengine.cpp index 3beb182fc4..8ff0a2e935 100644 --- a/src/scripting/scriptengine.cpp +++ b/src/scripting/scriptengine.cpp @@ -182,7 +182,8 @@ bool ScriptEngine::runScript(const std::string& script, ScriptCallback callback) ghoul::Dictionary returnValue = ghoul::lua::loadArrayDictionaryFromString(script, _state); callback(returnValue); - } else { + } + else { ghoul::lua::runScript(_state, script); } } @@ -651,7 +652,8 @@ bool ScriptEngine::writeLog(const std::string& script) { return false; } - } else { + } + else { _logScripts = false; return false; } @@ -738,7 +740,8 @@ void ScriptEngine::postSync(bool isMaster) { continue; } } - } else { + } + else { std::lock_guard guard(_slaveScriptsMutex); while (!_slaveScriptQueue.empty()) { try { diff --git a/src/scripting/scriptengine_lua.inl b/src/scripting/scriptengine_lua.inl index 0b9a076ece..4ffce5c454 100644 --- a/src/scripting/scriptengine_lua.inl +++ b/src/scripting/scriptengine_lua.inl @@ -412,18 +412,18 @@ int saveLastChangeToProfile(lua_State* L) { std::string strNew = fmt::format("{}\n{}",actualLastLine, strReplace); std::ifstream filein(assetPath); std::ofstream fileout(tempAssetPath); - if(!filein) { + if (!filein) { ghoul::lua::push(L, fmt::format("Could not open profile '{}'", assetPath)); printInternal(ghoul::logging::LogLevel::Error, L); } - if(!fileout) { + if (!fileout) { ghoul::lua::push(L, fmt::format("Could not open tmp profile '{}'", tempAssetPath)); printInternal(ghoul::logging::LogLevel::Error, L); } bool found = false; while(std::getline (filein, line)) { - if(line == strReplace){ + if (line == strReplace) { line = strNew; found = true; } @@ -444,7 +444,8 @@ int saveLastChangeToProfile(lua_State* L) { } FileSys.deleteFile(tempAssetPath); return 0; - } else { + } + else { ghoul::lua::push(L, "can not save to built in profiles"); printInternal(ghoul::logging::LogLevel::Error, L); return -1; diff --git a/src/util/camera.cpp b/src/util/camera.cpp index 82d912c52c..02cd915e04 100644 --- a/src/util/camera.cpp +++ b/src/util/camera.cpp @@ -156,20 +156,20 @@ float Camera::scaling() const { } const glm::dmat4& Camera::viewRotationMatrix() const { - if (_cachedViewRotationMatrix.isDirty) { + //if (_cachedViewRotationMatrix.isDirty) { _cachedViewRotationMatrix.datum = glm::mat4_cast( glm::inverse(static_cast(_rotation)) ); _cachedViewRotationMatrix.isDirty = false; - } + //} return _cachedViewRotationMatrix.datum; } const glm::dmat4& Camera::viewScaleMatrix() const { - if (_cachedViewScaleMatrix.isDirty) { + //if (_cachedViewScaleMatrix.isDirty) { _cachedViewScaleMatrix.datum = glm::scale(glm::mat4(1.f), glm::vec3(_scaling)); _cachedViewScaleMatrix.isDirty = false; - } + //} return _cachedViewScaleMatrix.datum; } @@ -178,7 +178,7 @@ const glm::dquat& Camera::rotationQuaternion() const { } const glm::dmat4& Camera::combinedViewMatrix() const { - if (_cachedCombinedViewMatrix.isDirty) { + //if (_cachedCombinedViewMatrix.isDirty) { const glm::dmat4 cameraTranslation = glm::inverse( glm::translate(glm::dmat4(1.0), static_cast(_position)) ); @@ -188,7 +188,7 @@ const glm::dmat4& Camera::combinedViewMatrix() const { glm::dmat4(viewRotationMatrix()) * cameraTranslation; _cachedCombinedViewMatrix.isDirty = false; - } + //} return _cachedCombinedViewMatrix.datum; } @@ -256,11 +256,11 @@ const glm::mat4& Camera::SgctInternal::projectionMatrix() const { } const glm::mat4& Camera::SgctInternal::viewProjectionMatrix() const { - if (_cachedViewProjectionMatrix.isDirty) { + //if (_cachedViewProjectionMatrix.isDirty) { std::lock_guard _lock(_mutex); _cachedViewProjectionMatrix.datum = _projectionMatrix * _viewMatrix; _cachedViewProjectionMatrix.isDirty = false; - } + //} return _cachedViewProjectionMatrix.datum; } diff --git a/src/util/histogram.cpp b/src/util/histogram.cpp index 15345b873b..148b3d2a19 100644 --- a/src/util/histogram.cpp +++ b/src/util/histogram.cpp @@ -127,7 +127,8 @@ bool Histogram::add(const Histogram& histogram) { } _numValues += histogram._numValues; return true; - } else { + } + else { LERROR("Dimension mismatch"); return false; } @@ -329,7 +330,8 @@ float Histogram::highestBinValue(bool equalized, int overBins){ _numBins * (_maxValue - _minValue); float high = low + (_maxValue - _minValue) / static_cast(_numBins); return (high+low) / 2.f; - } else { + } + else { return highestBin / static_cast(_numBins); // return equalize((high+low)/2.0); } diff --git a/src/util/httprequest.cpp b/src/util/httprequest.cpp index 4d9262a505..74e1749d1d 100644 --- a/src/util/httprequest.cpp +++ b/src/util/httprequest.cpp @@ -142,10 +142,12 @@ void HttpRequest::perform(RequestOptions opt) { curl_easy_getinfo(curl, CURLINFO_RESPONSE_CODE, &responseCode); // NOLINT if (responseCode == StatusCodeOk) { setReadyState(ReadyState::Success); - } else { + } + else { setReadyState(ReadyState::Fail); } - } else { + } + else { setReadyState(ReadyState::Fail); } curl_easy_cleanup(curl); @@ -218,7 +220,8 @@ void SyncHttpDownload::download(HttpRequest::RequestOptions opt) { LTRACE(fmt::format("Finished sync download '{}'", _httpRequest.url())); deinitDownload(); markAsSuccessful(); - } else if (rs == HttpRequest::ReadyState::Fail) { + } + else if (rs == HttpRequest::ReadyState::Fail) { LERROR(fmt::format("Failed sync download '{}'", _httpRequest.url())); deinitDownload(); markAsFailed(); diff --git a/src/util/taskloader.cpp b/src/util/taskloader.cpp index 2ef22f1b3a..75778d07d3 100644 --- a/src/util/taskloader.cpp +++ b/src/util/taskloader.cpp @@ -52,7 +52,8 @@ std::vector> TaskLoader::tasksFromDictionary( const std::string path = taskName + ".task"; std::vector> subTasks = tasksFromFile(path); std::move(subTasks.begin(), subTasks.end(), std::back_inserter(tasks)); - } else if (tasksDictionary.getValue(key, subTask)) { + } + else if (tasksDictionary.getValue(key, subTask)) { const std::string& taskType = subTask.value("Type"); std::unique_ptr task = Task::createFromDictionary(subTask); if (!task) { diff --git a/src/util/time_lua.inl b/src/util/time_lua.inl index 613b942839..008f129b91 100644 --- a/src/util/time_lua.inl +++ b/src/util/time_lua.inl @@ -56,7 +56,8 @@ int time_setDeltaTime(lua_State* L) { } const double newDeltaTime = lua_tonumber(L, 1); global::timeManager.setDeltaTime(newDeltaTime); - } else { + } + else { lua_settop(L, 0); const char* msg = lua_pushfstring(L, "Bad number of arguments. Expected 1 or 2."); @@ -159,7 +160,8 @@ int time_togglePause(lua_State* L) { if (nArguments == 0) { global::timeManager.setPause(!global::timeManager.isPaused()); - } else { + } + else { lua_settop(L, 0); return luaL_error( L, @@ -210,7 +212,8 @@ int time_interpolateTogglePause(lua_State* L) { global::timeManager.defaultPauseInterpolationDuration() : global::timeManager.defaultUnpauseInterpolationDuration() ); - } else { + } + else { lua_settop(L, 0); return luaL_error( L, @@ -236,7 +239,8 @@ int time_setPause(lua_State* L) { if (nArguments == 1) { const bool pause = lua_toboolean(L, 1) == 1; global::timeManager.setPause(pause); - } else { + } + else { lua_settop(L, 0); return luaL_error( L, @@ -284,7 +288,8 @@ int time_interpolatePause(lua_State* L) { global::timeManager.defaultPauseInterpolationDuration() : global::timeManager.defaultUnpauseInterpolationDuration() ); - } else { + } + else { lua_settop(L, 0); return luaL_error( L, @@ -342,7 +347,8 @@ int time_setTime(lua_State* L) { return 0; } ghoul_assert(lua_gettop(L) == 0, "Incorrect number of items left on stack"); - } else { + } + else { return luaL_error( L, "bad number of arguments, expected 1 or 2, got %i", diff --git a/src/util/timemanager.cpp b/src/util/timemanager.cpp index cc17806280..e1ecf58d74 100644 --- a/src/util/timemanager.cpp +++ b/src/util/timemanager.cpp @@ -193,7 +193,8 @@ TimeKeyframeData TimeManager::interpolate(double applicationTime) { *firstFutureKeyframe, applicationTime ); - } else if (hasPastKeyframes) { + } + else if (hasPastKeyframes) { // Extrapolate based on last past keyframe const double deltaApplicationTime = applicationTime - lastPastKeyframe->timestamp; Time predictedTime( @@ -271,9 +272,11 @@ void TimeManager::progressTime(double dt) { _currentTime.data().setTime(interpolated.time.j2000Seconds()); _deltaTime = interpolated.delta; - } else if (!hasConsumedLastPastKeyframe) { + } + else if (!hasConsumedLastPastKeyframe) { applyKeyframeData(lastPastKeyframe->data); - } else if (!isPaused()) { + } + else if (!isPaused()) { // If there are no keyframes to consider // and time is not paused, just advance time. _deltaTime = _targetDeltaTime; diff --git a/src/util/touch.cpp b/src/util/touch.cpp index 995e871850..aa0ef75ddd 100644 --- a/src/util/touch.cpp +++ b/src/util/touch.cpp @@ -128,7 +128,7 @@ float TouchInputHolder::speedX() const { } float TouchInputHolder::speedY() const { - if(_inputs.size() <= 1) { + if (_inputs.size() <= 1) { return 0.f; } const TouchInput& currentInput = _inputs[0]; diff --git a/src/util/transformationmanager.cpp b/src/util/transformationmanager.cpp index 663f06b605..08e14675ae 100644 --- a/src/util/transformationmanager.cpp +++ b/src/util/transformationmanager.cpp @@ -134,7 +134,8 @@ glm::dmat3 TransformationManager::frameTransformationMatrix( if (fromKameleon && toKameleon) { return kameleonTransformationMatrix(from, to, ephemerisTime); - } else if (fromKameleon && !toKameleon) { + } + else if (fromKameleon && !toKameleon) { glm::dmat3 kameleonTransformation = kameleonTransformationMatrix( from, "J2000", @@ -146,7 +147,8 @@ glm::dmat3 TransformationManager::frameTransformationMatrix( ephemerisTime ); return spiceTransformation*kameleonTransformation; - } else if (!fromKameleon && toKameleon) { + } + else if (!fromKameleon && toKameleon) { glm::dmat3 spiceTransformation = SpiceManager::ref().frameTransformationMatrix( from, "J2000", diff --git a/src/util/versionchecker.cpp b/src/util/versionchecker.cpp index 7f4b077bc0..aabec2be59 100644 --- a/src/util/versionchecker.cpp +++ b/src/util/versionchecker.cpp @@ -105,7 +105,8 @@ void VersionChecker::cancel() { currentVersion.minor, currentVersion.patch )); - } else { + } + else { LINFO(fmt::format( "OpenSpace version {}.{}.{} is up to date.", currentVersion.major, diff --git a/support/cmake/openspace_header.template b/support/cmake/openspace_header.template index 5cae439242..ca8ede21eb 100644 --- a/support/cmake/openspace_header.template +++ b/support/cmake/openspace_header.template @@ -2,7 +2,7 @@ * * * OpenSpace * * * - * Copyright (c) 2014-2019 * + * Copyright (c) 2014-2020 * * * * 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 * diff --git a/support/cmake/set_openspace_compile_settings.cmake b/support/cmake/set_openspace_compile_settings.cmake index 70abc0f055..61efb29938 100644 --- a/support/cmake/set_openspace_compile_settings.cmake +++ b/support/cmake/set_openspace_compile_settings.cmake @@ -30,7 +30,6 @@ function (set_openspace_compile_settings project) target_compile_options( ${project} PRIVATE - "/ZI" # Edit and continue support "/MP" # Multi-threading support "/W4" # Highest warning level "/w44062" # enumerator 'identifier' in a switch of enum 'enumeration' is not handled @@ -81,8 +80,28 @@ function (set_openspace_compile_settings project) # Boost as of 1.64 still uses unary_function unless we define this target_compile_definitions(${project} PRIVATE "_HAS_AUTO_PTR_ETC") - target_compile_definitions(${project} PRIVATE "NOMINMAX") + + if (OPENSPACE_OPTIMIZATION_ENABLE_AVX) + target_compile_options(${project} PRIVATE "/arch:AVX") + endif () + if (OPENSPACE_OPTIMIZATION_ENABLE_AVX2) + target_compile_options(${project} PRIVATE "/arch:AVX2") + endif () + if (OPENSPACE_OPTIMIZATION_ENABLE_AVX512) + target_compile_options(${project} PRIVATE "/arch:AVX512") + endif () + + if (OPENSPACE_OPTIMIZATION_ENABLE_OTHER_OPTIMIZATIONS) + target_compile_options(${project} PRIVATE + "/Oi" # usage of intrinsic functions + "/GL" # Whole program optimization + ) + else () + target_compile_options(${project} PRIVATE + "/ZI" # Edit and continue support + ) + endif () elseif (CMAKE_CXX_COMPILER_ID MATCHES "Clang") if (OPENSPACE_WARNINGS_AS_ERRORS) target_compile_options(${project} PRIVATE "-Werror") diff --git a/support/coding/check_style_guide.py b/support/coding/check_style_guide.py index 34d03f6122..8b23b4027f 100644 --- a/support/coding/check_style_guide.py +++ b/support/coding/check_style_guide.py @@ -3,7 +3,7 @@ """ OpenSpace -Copyright (c) 2014-2018 +Copyright (c) 2014-2020 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 @@ -59,7 +59,7 @@ import os import re import sys -current_year = '2019' +current_year = '2020' is_strict_mode = False is_silent_mode = False diff --git a/support/coding/convert_tabs.py b/support/coding/convert_tabs.py index a7ae4d0b49..21425ae092 100644 --- a/support/coding/convert_tabs.py +++ b/support/coding/convert_tabs.py @@ -1,7 +1,7 @@ """ OpenSpace -Copyright (c) 2014-2018 +Copyright (c) 2014-2020 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 diff --git a/support/coding/count_includes.py b/support/coding/count_includes.py index 96cd39d9da..12088368cd 100644 --- a/support/coding/count_includes.py +++ b/support/coding/count_includes.py @@ -1,7 +1,7 @@ """ OpenSpace -Copyright (c) 2014-2018 +Copyright (c) 2014-2020 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 diff --git a/support/coding/new_files.py b/support/coding/new_files.py index ca3a3753ba..60ee3c29e2 100644 --- a/support/coding/new_files.py +++ b/support/coding/new_files.py @@ -1,7 +1,7 @@ """ OpenSpace -Copyright (c) 2014-2018 +Copyright (c) 2014-2020 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 @@ -33,8 +33,8 @@ Project = { } License = { - 'OpenSpace': '/*****************************************************************************************\n * *\n * OpenSpace *\n * *\n * Copyright (c) 2014-2018 *\n * *\n * Permission is hereby granted, free of charge, to any person obtaining a copy of this *\n * software and associated documentation files (the "Software"), to deal in the Software *\n * without restriction, including without limitation the rights to use, copy, modify, *\n * merge, publish, distribute, sublicense, and/or sell copies of the Software, and to *\n * permit persons to whom the Software is furnished to do so, subject to the following *\n * conditions: *\n * *\n * The above copyright notice and this permission notice shall be included in all copies *\n * or substantial portions of the Software. *\n * *\n * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, *\n * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A *\n * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT *\n * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF *\n * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE *\n * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. *\n ****************************************************************************************/', - 'Ghoul': '/*****************************************************************************************\n * *\n * GHOUL *\n * General Helpful Open Utility Library *\n * *\n * Copyright (c) 2012-2018 *\n * *\n * Permission is hereby granted, free of charge, to any person obtaining a copy of this *\n * software and associated documentation files (the "Software"), to deal in the Software *\n * without restriction, including without limitation the rights to use, copy, modify, *\n * merge, publish, distribute, sublicense, and/or sell copies of the Software, and to *\n * permit persons to whom the Software is furnished to do so, subject to the following *\n * conditions: *\n * *\n * The above copyright notice and this permission notice shall be included in all copies *\n * or substantial portions of the Software. *\n * *\n * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, *\n * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A *\n * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT *\n * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF *\n * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE *\n * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. *\n ****************************************************************************************/' + 'OpenSpace': '/*****************************************************************************************\n * *\n * OpenSpace *\n * *\n * Copyright (c) 2014-2020 *\n * *\n * Permission is hereby granted, free of charge, to any person obtaining a copy of this *\n * software and associated documentation files (the "Software"), to deal in the Software *\n * without restriction, including without limitation the rights to use, copy, modify, *\n * merge, publish, distribute, sublicense, and/or sell copies of the Software, and to *\n * permit persons to whom the Software is furnished to do so, subject to the following *\n * conditions: *\n * *\n * The above copyright notice and this permission notice shall be included in all copies *\n * or substantial portions of the Software. *\n * *\n * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, *\n * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A *\n * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT *\n * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF *\n * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE *\n * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. *\n ****************************************************************************************/', + 'Ghoul': '/*****************************************************************************************\n * *\n * GHOUL *\n * General Helpful Open Utility Library *\n * *\n * Copyright (c) 2012-2020 *\n * *\n * Permission is hereby granted, free of charge, to any person obtaining a copy of this *\n * software and associated documentation files (the "Software"), to deal in the Software *\n * without restriction, including without limitation the rights to use, copy, modify, *\n * merge, publish, distribute, sublicense, and/or sell copies of the Software, and to *\n * permit persons to whom the Software is furnished to do so, subject to the following *\n * conditions: *\n * *\n * The above copyright notice and this permission notice shall be included in all copies *\n * or substantial portions of the Software. *\n * *\n * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, *\n * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A *\n * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT *\n * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF *\n * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE *\n * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. *\n ****************************************************************************************/' } Namespace = { diff --git a/support/coding/remove_byte_order_mark.py b/support/coding/remove_byte_order_mark.py index b663e379d6..8095c6d835 100644 --- a/support/coding/remove_byte_order_mark.py +++ b/support/coding/remove_byte_order_mark.py @@ -1,7 +1,7 @@ """ OpenSpace -Copyright (c) 2014-2018 +Copyright (c) 2014-2020 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