Merge remote-tracking branch 'origin/master' into issue/2313

# Conflicts:
#	modules/skybrowser/skybrowsermodule_lua.inl
This commit is contained in:
Ylva Selling
2023-02-10 13:06:38 -05:00
1943 changed files with 11678 additions and 14338 deletions

73
CITATION.cff Normal file
View File

@@ -0,0 +1,73 @@
cff-version: 1.2.0
message: "If you use this software, please cite it as below."
authors:
- family-names: "Bock"
given-names: "Alexander"
orcid: "https://orcid.org/0000-0002-2849-6146"
- family-names: "Axelsson"
given-names: "Emil"
- family-names: "Costa"
given-names: "Jonathas"
orcid: "https://orcid.org/0000-0002-5008-5685"
- family-names: "Payne"
given-names: "Gene"
orcid: "https://orcid.org/0000-0001-8022-4781"
- family-names: "Acinapura"
given-names: "Micah"
- family-names: "Trakinski"
given-names: "Vivian"
- family-names: "Emmart"
given-names: "Carter"
- family-names: "Silva"
given-names: "Claudio"
orcid: "https://orcid.org/0000-0003-2452-2295"
- family-names: "Hansen"
given-names: "Charles"
orcid: "https://orcid.org/0000-0002-8480-2152"
- family-names: "Ynnerman"
given-names: "Anders"
orcid: "https://orcid.org/0000-0002-9466-9826"
title: "OpenSpace"
version: 0.18.2
doi: 10.1109/TVCG.2019.2934259
date-released: 2022-12-24
url: "https://github.com/OpenSpace/OpenSpace"
preferred-citation:
scope: "If you use this software, please cite it as below"
type: article
authors:
- family-names: "Bock"
given-names: "Alexander"
orcid: "https://orcid.org/0000-0002-2849-6146"
- family-names: "Axelsson"
given-names: "Emil"
- family-names: "Costa"
given-names: "Jonathas"
orcid: "https://orcid.org/0000-0002-5008-5685"
- family-names: "Payne"
given-names: "Gene"
orcid: "https://orcid.org/0000-0001-8022-4781"
- family-names: "Acinapura"
given-names: "Micah"
- family-names: "Trakinski"
given-names: "Vivian"
- family-names: "Emmart"
given-names: "Carter"
- family-names: "Silva"
given-names: "Claudio"
orcid: "https://orcid.org/0000-0003-2452-2295"
- family-names: "Hansen"
given-names: "Charles"
orcid: "https://orcid.org/0000-0002-8480-2152"
- family-names: "Ynnerman"
given-names: "Anders"
orcid: "https://orcid.org/0000-0002-9466-9826"
doi: 10.1109/TVCG.2019.2934259
journal: "IEEE Transactions on Visualization and Computer Graphics"
month: 1
start: 633
end: 642
title: "OpenSpace: A System for Astrographics"
issue: 1
volume: 26
year: 2020

View File

@@ -2,7 +2,7 @@
# #
# OpenSpace #
# #
# Copyright (c) 2014-2022 #
# Copyright (c) 2014-2023 #
# #
# 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 #
@@ -22,28 +22,22 @@
# OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #
##########################################################################################
cmake_minimum_required(VERSION 3.10 FATAL_ERROR)
cmake_policy(SET CMP0120 NEW)
cmake_minimum_required(VERSION 3.25 FATAL_ERROR)
cmake_policy(VERSION 3.25)
project(OpenSpace)
set(OPENSPACE_VERSION_MAJOR 0)
set(OPENSPACE_VERSION_MINOR 18)
set(OPENSPACE_VERSION_MINOR 19)
set(OPENSPACE_VERSION_PATCH 0)
set(OPENSPACE_VERSION_STRING "Beta-11")
set(OPENSPACE_VERSION_STRING "<dev>")
set(OPENSPACE_BASE_DIR "${PROJECT_SOURCE_DIR}")
set(OPENSPACE_CMAKE_EXT_DIR "${OPENSPACE_BASE_DIR}/support/cmake")
set(GHOUL_BASE_DIR "${OPENSPACE_BASE_DIR}/ext/ghoul")
include(${OPENSPACE_CMAKE_EXT_DIR}/module_common.cmake)
include(${GHOUL_BASE_DIR}/support/cmake/copy_shared_libraries.cmake)
include(${GHOUL_BASE_DIR}/support/cmake/handle_external_library.cmake)
include(${GHOUL_BASE_DIR}/support/cmake/message_macros.cmake)
include(${PROJECT_SOURCE_DIR}/support/cmake/module_common.cmake)
include(${PROJECT_SOURCE_DIR}/ext/ghoul/support/cmake/message_macros.cmake)
begin_header("Configuring OpenSpace project")
# Bail out if the user tries to generate a 32 bit project.
# 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 ()
@@ -51,9 +45,7 @@ endif ()
##########################################################################################
# Cleanup project #
##########################################################################################
set(OPENSPACE_APPS_DIR "${OPENSPACE_BASE_DIR}/apps")
if (NOT EXISTS "${OPENSPACE_BASE_DIR}/ext/ghoul/CMakeLists.txt")
if (NOT EXISTS "${PROJECT_SOURCE_DIR}/ext/ghoul/CMakeLists.txt")
message(FATAL_ERROR "Git submodules are missing. Please run "
"git submodule update --init --recursive to download the missing dependencies."
)
@@ -68,11 +60,13 @@ mark_as_advanced(CMAKE_BACKWARDS_COMPATIBILITY CMAKE_BUILD_TYPE CMAKE_DEBUG_POST
)
# Set build output directories
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${OPENSPACE_CMAKE_EXT_DIR})
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${OPENSPACE_BASE_DIR}/bin)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${PROJECT_SOURCE_DIR}/support/cmake)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/bin)
# "OpenSpace Helper" is not a valid CMake target name under OLD
cmake_policy(SET CMP0037 NEW)
if (MSVC)
# Force all builds to be multi-threaded and increase number of sections in obj files
add_definitions(/MP /bigobj)
endif ()
##########################################################################################
# Main #
@@ -106,8 +100,6 @@ else ()
set(OPENSPACE_GIT_STATUS "")
endif ()
option(OPENSPACE_WARNINGS_AS_ERRORS "Treat warnings as errors" OFF)
if (MSVC)
option(OPENSPACE_BREAK_ON_FLOATING_POINT_EXCEPTION "Raise exceptions when encountering Inf's or Nan's in floating point numbers" OFF)
@@ -134,31 +126,26 @@ if (MSVC)
set(GHOUL_OPTIMIZATION_ENABLE_OTHER_OPTIMIZATIONS ${OPENSPACE_OPTIMIZATION_ENABLE_OTHER_OPTIMIZATIONS} CACHE BOOL "" FORCE)
endif ()
if (UNIX)
if (CMAKE_CXX_COMPILER_ID MATCHES "Clang")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++17 -stdlib=libc++")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -stdlib=libc++ -lc++ -lc++abi")
else ()
if (NOT CMAKE_BUILD_TYPE)
#Can set to "RelWithDebInfo" or "Debug" also, but problems occur if this is blank by default
set(CMAKE_BUILD_TYPE "Release" CACHE STRING "Default build type" FORCE)
endif ()
if (NOT DEFINED CMAKE_CXX_FLAGS OR CMAKE_CXX_FLAGS MATCHES "")
set(CMAKE_CXX_FLAGS " ")
endif ()
STRING(FIND ${CMAKE_CXX_FLAGS} "GLM_ENABLE_EXPERIMENTAL" GLM_FLAG_POS)
if (${GLM_FLAG_POS} EQUAL -1)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DGLM_ENABLE_EXPERIMENTAL" CACHE STRING "" FORCE)
endif ()
set(OpenGL_GL_PREFERENCE "GLVND" CACHE STRING "OpenGL Preference setting necessary for linux" FORCE)
#Fix for gcc tolerating space in target name
if (NOT DEFINED CMAKE_C_FLAGS OR CMAKE_C_FLAGS MATCHES "")
set(CMAKE_C_FLAGS " ")
endif ()
STRING(FIND ${CMAKE_C_FLAGS} "_GNU_SOURCE" GNUSOURCE_FLAG_POS)
if (${GNUSOURCE_FLAG_POS} EQUAL -1)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -D_GNU_SOURCE" CACHE STRING "" FORCE)
endif ()
if (UNIX AND NOT CMAKE_CXX_COMPILER_ID MATCHES "Clang")
if (NOT CMAKE_BUILD_TYPE)
# Can set to "RelWithDebInfo" or "Debug" also, but problems occur if this is blank by default
set(CMAKE_BUILD_TYPE "Release" CACHE STRING "Default build type" FORCE)
endif ()
if (NOT DEFINED CMAKE_CXX_FLAGS OR CMAKE_CXX_FLAGS MATCHES "")
set(CMAKE_CXX_FLAGS " ")
endif ()
STRING(FIND ${CMAKE_CXX_FLAGS} "GLM_ENABLE_EXPERIMENTAL" GLM_FLAG_POS)
if (${GLM_FLAG_POS} EQUAL -1)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DGLM_ENABLE_EXPERIMENTAL" CACHE STRING "" FORCE)
endif ()
set(OpenGL_GL_PREFERENCE "GLVND" CACHE STRING "OpenGL Preference setting necessary for linux" FORCE)
# Fix for GCC tolerating space in target name
if (NOT DEFINED CMAKE_C_FLAGS OR CMAKE_C_FLAGS MATCHES "")
set(CMAKE_C_FLAGS " ")
endif ()
STRING(FIND ${CMAKE_C_FLAGS} "_GNU_SOURCE" GNUSOURCE_FLAG_POS)
if (${GNUSOURCE_FLAG_POS} EQUAL -1)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -D_GNU_SOURCE" CACHE STRING "" FORCE)
endif ()
endif ()
@@ -176,12 +163,12 @@ add_custom_target(
add_dependencies(run_codegen codegen)
add_custom_command(
OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/__codegen.h"
COMMAND codegen ARGS "${OPENSPACE_BASE_DIR}/modules" "${OPENSPACE_BASE_DIR}/src"
COMMAND codegen ARGS "${PROJECT_SOURCE_DIR}/modules" "${PROJECT_SOURCE_DIR}/src"
VERBATIM
)
set_folder_location(codegen-lib "support")
set_folder_location(codegen "support")
set_folder_location(run_codegen "support")
set_target_properties(codegen-lib PROPERTIES FOLDER "support")
set_target_properties(codegen PROPERTIES FOLDER "support")
set_target_properties(run_codegen PROPERTIES FOLDER "support")
# Qt
@@ -218,12 +205,12 @@ end_header("End: Configuring Modules")
add_subdirectory(support/coding/codegen/tests)
set_folder_location(run_test_codegen "Unit Tests/support")
set_folder_location(codegentest "Unit Tests")
set_target_properties(run_test_codegen PROPERTIES FOLDER "Unit Tests/support")
set_target_properties(codegentest PROPERTIES FOLDER "Unit Tests")
begin_header("Configuring Applications")
add_subdirectory("${OPENSPACE_APPS_DIR}")
add_subdirectory(apps)
end_header("End: Configuring Applications")
@@ -235,7 +222,7 @@ endif ()
option(OPENSPACE_HAVE_TESTS "Activate the OpenSpace unit tests" ON)
if (OPENSPACE_HAVE_TESTS)
begin_header("Generating OpenSpace unit test")
add_subdirectory("${CMAKE_CURRENT_SOURCE_DIR}/tests")
add_subdirectory(tests)
end_header()
endif (OPENSPACE_HAVE_TESTS)
@@ -250,7 +237,7 @@ if (OPENSPACE_MODULE_WEBBROWSER AND CEF_ROOT)
set(PROJECT_ARCH "x86_64")
if (WIN32)
set(RESOURCE_FILE ${OPENSPACE_APPS_DIR}/OpenSpace/openspace.rc)
set(RESOURCE_FILE openspace.rc)
endif ()
# Add the CEF binary distribution's cmake/ directory to the module path and
@@ -266,6 +253,6 @@ endif ()
##########################################################################################
# Manage the CPack packaging
include(${OPENSPACE_CMAKE_EXT_DIR}/packaging.cmake)
include(${PROJECT_SOURCE_DIR}/support/cmake/packaging.cmake)
end_header("End: Configuring OpenSpace project")

View File

@@ -27,7 +27,7 @@ Project maintainers have the right and responsibility to remove, edit, or reject
This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers.
## Enforcement
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at alexander.bock@me.com or vivian@amnh.org. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately.
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at alex@openspaceproject.com or vivian@amnh.org. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately.
Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership.

View File

@@ -1,4 +1,4 @@
Copyright (c) 2014-2022
Copyright (c) 2014-2023
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
@@ -15,4 +15,4 @@ 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.
OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

View File

@@ -37,7 +37,7 @@ OpenSpace requires at least support for [OpenGL](https://www.opengl.org/) versio
This repository contains the source code and example profiles for OpenSpace, but does not contain any data. To build and install the application, please check out the [GitHub Wiki](https://github.com/OpenSpace/OpenSpace/wiki). Here, you will find two pages, a [build instruction](https://github.com/OpenSpace/OpenSpace/wiki/Compiling) for all operating systems and then additional instructions for [Windows](https://github.com/OpenSpace/OpenSpace/wiki/Compiling-Windows), [Linux (Ubuntu)](https://github.com/OpenSpace/OpenSpace/wiki/Compiling-Ubuntu), and [MacOS](https://github.com/OpenSpace/OpenSpace/wiki/Compiling-MacOS). Please note that the Apple Silicon series of chips do not support OpenGL natively and Metal 2 does not support `double` precision accuracy (see [here](https://developer.apple.com/metal/Metal-Shading-Language-Specification.pdf) Section 2.1), therefore only the Intel processors for MacOS are supported and maintained.
Requirements for compiling are:
- CMake version 3.10 or above
- CMake version 3.25 or above
- C++ compiler supporting C++20 (MSVC 19.31, GCC11, Clang14, AppleClang 13.1.6)
- [Boost](http://www.boost.org/)
- [Qt](http://www.qt.io/download)
@@ -45,3 +45,6 @@ Requirements for compiling are:
Feel free to create issues for missing features, bug reports, or compile problems or contact us via [email](mailto:openspace@amnh.org?subject=OpenSpace:). Regarding any issues, you are very welcome on our [Slack support channel](https://openspacesupport.slack.com) to which you can freely [sign-up](https://join.slack.com/t/openspacesupport/shared_invite/zt-37niq6y9-T0JaCIk4UoFLI4VF5U9Vsw).
![Image](https://github.com/OpenSpace/openspace.github.io/raw/master/assets/images/himalaya-nkpg-dome.jpg)
# License
The contents of this repository is under an [MIT license](https://github.com/OpenSpace/OpenSpace/blob/master/LICENSE.md).

View File

@@ -2,7 +2,7 @@
# #
# OpenSpace #
# #
# Copyright (c) 2014-2022 #
# Copyright (c) 2014-2023 #
# #
# 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 #

View File

@@ -22,9 +22,9 @@
# OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #
##########################################################################################
include(${GHOUL_BASE_DIR}/support/cmake/copy_shared_libraries.cmake)
include(${OPENSPACE_CMAKE_EXT_DIR}/application_definition.cmake)
include(${OPENSPACE_CMAKE_EXT_DIR}/global_variables.cmake)
include(${PROJECT_SOURCE_DIR}/ext/ghoul/support/cmake/copy_shared_libraries.cmake)
include(${PROJECT_SOURCE_DIR}/support/cmake/application_definition.cmake)
include(${PROJECT_SOURCE_DIR}/support/cmake/global_variables.cmake)
set(MACOSX_BUNDLE_ICON_FILE openspace.icns)
@@ -57,7 +57,7 @@ target_link_libraries(OpenSpace-MinVR PUBLIC openspace-core MinVR)
# target as of July 2017, which is needed.
if (OPENSPACE_MODULE_WEBBROWSER AND CEF_ROOT)
if (WIN32)
set(RESOURCE_FILE ${OPENSPACE_APPS_DIR}/OpenSpace-MinVR/openspace.rc)
set(RESOURCE_FILE openspace.rc)
endif ()
# Add the CEF binary distribution's cmake/ directory to the module path and

View File

@@ -2,7 +2,7 @@
* *
* OpenSpace *
* *
* Copyright (c) 2014-2022 *
* Copyright (c) 2014-2023 *
* *
* 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 *

View File

@@ -2,7 +2,7 @@
# #
# OpenSpace #
# #
# Copyright (c) 2014-2022 #
# Copyright (c) 2014-2023 #
# #
# 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 #
@@ -22,9 +22,8 @@
# OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #
##########################################################################################
include(${GHOUL_BASE_DIR}/support/cmake/copy_shared_libraries.cmake)
include(${GHOUL_BASE_DIR}/support/cmake/message_macros.cmake)
include(${OPENSPACE_CMAKE_EXT_DIR}/application_definition.cmake)
include(${PROJECT_SOURCE_DIR}/ext/ghoul/support/cmake/message_macros.cmake)
include(${PROJECT_SOURCE_DIR}/support/cmake/application_definition.cmake)
# We are getting all_enabled_modules from the handle_applications.cmake file which gets
# it from the main CMakeLists file
@@ -43,14 +42,14 @@ if (OPENSPACE_OPENVR_SUPPORT)
if (WIN32)
find_path(SGCT_OPENVR_INCLUDE_DIRECTORY
NAMES SGCTOpenVR.h
PATHS ${OPENSPACE_BASE_DIR}/ext/sgct/additional_includes/openvr NO_DEFAULT_PATH
PATHS ${PROJECT_SOURCE_DIR}/ext/sgct/additional_includes/openvr NO_DEFAULT_PATH
REQUIRED
)
else ()
find_path(SGCT_OPENVR_INCLUDE_DIRECTORY
NAMES SGCTOpenVR.h
PATH_SUFFIXES SGCTOpenVR
PATHS ${OPENSPACE_BASE_DIR}/ext/sgct/additional_includes/openvr
PATHS ${PROJECT_SOURCE_DIR}/ext/sgct/additional_includes/openvr
REQUIRED
)
endif ()
@@ -115,19 +114,14 @@ set(SGCT_TEXT OFF CACHE BOOL "" FORCE)
set(SGCT_DEP_INCLUDE_FREETYPE OFF CACHE BOOL "" FORCE)
set(SGCT_DEP_INCLUDE_FMT OFF CACHE BOOL "" FORCE)
set(SGCT_DEP_INCLUDE_SCN OFF CACHE BOOL "" FORCE)
set(SGCT_DEP_INCLUDE_CATCH2 OFF CACHE BOOL "" FORCE)
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/ext/sgct)
target_link_libraries(OpenSpace PRIVATE sgct)
set_folder_location(sgct "External")
set_folder_location(glfw "External")
set_folder_location(miniziplibstatic "External")
set_folder_location(png16_static "External")
set_folder_location(quat "External")
set_folder_location(tinyxml2static "External")
set_folder_location(vrpn "External")
set_folder_location(zlibstatic "External")
set_folder_location(SGCTTest "Unit Tests")
set_target_properties(sgct PROPERTIES FOLDER "External")
set_target_properties(glfw PROPERTIES FOLDER "External")
set_target_properties(SGCTTest PROPERTIES FOLDER "External")
if (UNIX AND (NOT APPLE))
target_link_libraries(OpenSpace PRIVATE Xcursor Xinerama X11)
@@ -161,7 +155,7 @@ if (OPENSPACE_MODULE_WEBBROWSER AND CEF_ROOT)
set(PROJECT_ARCH "x86_64")
if (WIN32)
set(RESOURCE_FILE ${OPENSPACE_APPS_DIR}/OpenSpace/openspace.rc)
set(RESOURCE_FILE openspace.rc)
endif ()
# Add the CEF binary distribution's cmake/ directory to the module path and

View File

@@ -2,7 +2,7 @@
# #
# OpenSpace #
# #
# Copyright (c) 2014-2022 #
# Copyright (c) 2014-2023 #
# #
# 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 #
@@ -22,7 +22,7 @@
# OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #
##########################################################################################
include(${OPENSPACE_CMAKE_EXT_DIR}/set_openspace_compile_settings.cmake)
include(${PROJECT_SOURCE_DIR}/support/cmake/set_openspace_compile_settings.cmake)
set(HEADER_FILES
include/filesystemaccess.h
@@ -113,8 +113,9 @@ target_include_directories(
openspace-ui-launcher
PUBLIC
include
${OPENSPACE_APPS_DIR}/OpenSpace/ext/sgct/include
${OPENSPACE_APPS_DIR}/OpenSpace/ext/sgct/sgct/ext/glm
# @TODO: This should be handled in a better way
../sgct/include
../sgct/sgct/ext/glm
)
target_link_libraries(
openspace-ui-launcher

View File

@@ -2,7 +2,7 @@
* *
* OpenSpace *
* *
* Copyright (c) 2014-2022 *
* Copyright (c) 2014-2023 *
* *
* 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 *

View File

@@ -2,7 +2,7 @@
* *
* OpenSpace *
* *
* Copyright (c) 2014-2022 *
* Copyright (c) 2014-2023 *
* *
* 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 *

View File

@@ -2,7 +2,7 @@
* *
* OpenSpace *
* *
* Copyright (c) 2014-2022 *
* Copyright (c) 2014-2023 *
* *
* 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 *
@@ -100,6 +100,8 @@ private:
QPushButton* removeButton = nullptr;
QDialogButtonBox* saveButtons = nullptr;
} _keybindingWidgets;
QDialogButtonBox* _mainButtons = nullptr;
};
#endif // __OPENSPACE_UI_LAUNCHER___ACTIONDIALOG___H__

View File

@@ -2,7 +2,7 @@
* *
* OpenSpace *
* *
* Copyright (c) 2014-2022 *
* Copyright (c) 2014-2023 *
* *
* 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 *

View File

@@ -2,7 +2,7 @@
* *
* OpenSpace *
* *
* Copyright (c) 2014-2022 *
* Copyright (c) 2014-2023 *
* *
* 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 *

View File

@@ -2,7 +2,7 @@
* *
* OpenSpace *
* *
* Copyright (c) 2014-2022 *
* Copyright (c) 2014-2023 *
* *
* 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 *

View File

@@ -2,7 +2,7 @@
* *
* OpenSpace *
* *
* Copyright (c) 2014-2022 *
* Copyright (c) 2014-2023 *
* *
* 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 *

View File

@@ -2,7 +2,7 @@
* *
* OpenSpace *
* *
* Copyright (c) 2014-2022 *
* Copyright (c) 2014-2023 *
* *
* 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 *

View File

@@ -2,7 +2,7 @@
* *
* OpenSpace *
* *
* Copyright (c) 2014-2022 *
* Copyright (c) 2014-2023 *
* *
* 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 *

View File

@@ -2,7 +2,7 @@
* *
* OpenSpace *
* *
* Copyright (c) 2014-2022 *
* Copyright (c) 2014-2023 *
* *
* 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 *

View File

@@ -2,7 +2,7 @@
* *
* OpenSpace *
* *
* Copyright (c) 2014-2022 *
* Copyright (c) 2014-2023 *
* *
* 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 *

View File

@@ -2,7 +2,7 @@
* *
* OpenSpace *
* *
* Copyright (c) 2014-2022 *
* Copyright (c) 2014-2023 *
* *
* 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 *

View File

@@ -2,7 +2,7 @@
* *
* OpenSpace *
* *
* Copyright (c) 2014-2022 *
* Copyright (c) 2014-2023 *
* *
* 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 *

View File

@@ -2,7 +2,7 @@
* *
* OpenSpace *
* *
* Copyright (c) 2014-2022 *
* Copyright (c) 2014-2023 *
* *
* 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 *

View File

@@ -2,7 +2,7 @@
* *
* OpenSpace *
* *
* Copyright (c) 2014-2022 *
* Copyright (c) 2014-2023 *
* *
* 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 *

View File

@@ -2,7 +2,7 @@
* *
* OpenSpace *
* *
* Copyright (c) 2014-2022 *
* Copyright (c) 2014-2023 *
* *
* 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 *

View File

@@ -2,7 +2,7 @@
* *
* OpenSpace *
* *
* Copyright (c) 2014-2022 *
* Copyright (c) 2014-2023 *
* *
* 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 *

View File

@@ -2,7 +2,7 @@
* *
* OpenSpace *
* *
* Copyright (c) 2014-2022 *
* Copyright (c) 2014-2023 *
* *
* 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 *
@@ -50,6 +50,7 @@ private:
QListWidget* _scriptlogList = nullptr;
QLineEdit* _filter = nullptr;
QPushButton* _reloadFile = nullptr;
std::string _scriptLogFile;
std::vector<std::string> _scripts;
};

View File

@@ -2,7 +2,7 @@
* *
* OpenSpace *
* *
* Copyright (c) 2014-2022 *
* Copyright (c) 2014-2023 *
* *
* 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 *

View File

@@ -2,7 +2,7 @@
* *
* OpenSpace *
* *
* Copyright (c) 2014-2022 *
* Copyright (c) 2014-2023 *
* *
* 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 *

View File

@@ -2,7 +2,7 @@
* *
* OpenSpace *
* *
* Copyright (c) 2014-2022 *
* Copyright (c) 2014-2023 *
* *
* 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 *
@@ -81,10 +81,10 @@ private:
std::vector<QRectF> _monitorDimensionsScaled;
std::array<QRectF, 4> _windowRendering = {
QRectF{ 0.f, 0.f, 0.f, 0.f },
QRectF{ 0.f, 0.f, 0.f, 0.f },
QRectF{ 0.f, 0.f, 0.f, 0.f },
QRectF{ 0.f, 0.f, 0.f, 0.f }
QRectF(0.f, 0.f, 0.f, 0.f),
QRectF(0.f, 0.f, 0.f, 0.f),
QRectF(0.f, 0.f, 0.f, 0.f),
QRectF(0.f, 0.f, 0.f, 0.f)
};
int _nWindows = 1;
const std::array<QColor, 4> _colorsForWindows;

View File

@@ -2,7 +2,7 @@
* *
* OpenSpace *
* *
* Copyright (c) 2014-2022 *
* Copyright (c) 2014-2023 *
* *
* 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 *

View File

@@ -2,7 +2,7 @@
* *
* OpenSpace *
* *
* Copyright (c) 2014-2022 *
* Copyright (c) 2014-2023 *
* *
* 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 *
@@ -63,7 +63,7 @@ public:
bool showUiOnFirstWindow() const;
private:
sgct::quat _orientationValue = { 0.f, 0.f, 0.f, 0.f };
sgct::quat _orientationValue = sgct::quat(0.f, 0.f, 0.f, 0.f);
QCheckBox* _checkBoxVsync = nullptr;
QCheckBox* _showUiOnFirstWindow = nullptr;
};

View File

@@ -2,7 +2,7 @@
* *
* OpenSpace *
* *
* Copyright (c) 2014-2022 *
* Copyright (c) 2014-2023 *
* *
* 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 *

View File

@@ -2,7 +2,7 @@
* *
* OpenSpace *
* *
* Copyright (c) 2014-2022 *
* Copyright (c) 2014-2023 *
* *
* 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 *

View File

@@ -2,7 +2,7 @@
* *
* OpenSpace *
* *
* Copyright (c) 2014-2022 *
* Copyright (c) 2014-2023 *
* *
* 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 *

View File

@@ -2,7 +2,7 @@
* *
* OpenSpace *
* *
* Copyright (c) 2014-2022 *
* Copyright (c) 2014-2023 *
* *
* 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 *
@@ -158,7 +158,7 @@ namespace {
std::ofstream outFile;
try {
outFile.open(path, std::ofstream::out);
sgct::config::GeneratorVersion genEntry = {
sgct::config::GeneratorVersion genEntry = sgct::config::GeneratorVersion{
"OpenSpace",
OPENSPACE_VERSION_MAJOR,
OPENSPACE_VERSION_MINOR

View File

@@ -2,7 +2,7 @@
* *
* OpenSpace *
* *
* Copyright (c) 2014-2022 *
* Copyright (c) 2014-2023 *
* *
* 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 *
@@ -97,9 +97,9 @@ void ActionDialog::createWidgets() {
// *----------------------*---------------*----------------*
// | [+] [-] | | <Save> <Cancel>| Row 14
// *----------------------*---------------*----------------*
// |=======================================================| Row 14
// |=======================================================| Row 16
// *----------------------*---------------*----------------*
// | | <Save> <Cancel>| Row 15
// | | <Save> <Cancel>| Row 17
// *----------------------*---------------*----------------*
QGridLayout* layout = new QGridLayout(this);
@@ -113,18 +113,18 @@ void ActionDialog::createWidgets() {
clearKeybindingFields();
layout->addWidget(new Line, 16, 0, 1, 3);
QDialogButtonBox* buttonBox = new QDialogButtonBox;
buttonBox->setStandardButtons(QDialogButtonBox::Save | QDialogButtonBox::Cancel);
_mainButtons = new QDialogButtonBox;
_mainButtons->setStandardButtons(QDialogButtonBox::Save | QDialogButtonBox::Cancel);
QObject::connect(
buttonBox, &QDialogButtonBox::accepted,
_mainButtons, &QDialogButtonBox::accepted,
this, &ActionDialog::applyChanges
);
QObject::connect(
buttonBox, &QDialogButtonBox::rejected,
_mainButtons, &QDialogButtonBox::rejected,
this, &ActionDialog::reject
);
layout->addWidget(buttonBox, 17, 2, Qt::AlignRight);
layout->addWidget(_mainButtons, 17, 2, Qt::AlignRight);
}
void ActionDialog::createActionWidgets(QGridLayout* layout) {
@@ -523,12 +523,19 @@ void ActionDialog::actionSelected() {
_actionWidgets.addButton->setEnabled(false);
_actionWidgets.removeButton->setEnabled(true);
_actionWidgets.saveButtons->setEnabled(true);
if (_mainButtons) {
_mainButtons->setEnabled(false);
}
}
else {
// No action selected
_actionWidgets.addButton->setEnabled(true);
_actionWidgets.removeButton->setEnabled(false);
_actionWidgets.saveButtons->setEnabled(false);
//Keybinding panel must also be in valid state to re-enable main start button
if (_mainButtons && !_keybindingWidgets.saveButtons->isEnabled()) {
_mainButtons->setEnabled(true);
}
}
}
@@ -587,7 +594,11 @@ void ActionDialog::actionSaved() {
action->name = _actionWidgets.name->text().toStdString();
action->guiPath = _actionWidgets.guiPath->text().toStdString();
std::string guiPath = _actionWidgets.guiPath->text().toStdString();
if (!guiPath.starts_with('/')) {
guiPath = "/" + guiPath;
}
action->guiPath = guiPath;
action->documentation = _actionWidgets.documentation->text().toStdString();
action->isLocal = _actionWidgets.isLocal->isChecked();
action->script = _actionWidgets.script->toPlainText().toStdString();
@@ -705,12 +716,19 @@ void ActionDialog::keybindingSelected() {
_keybindingWidgets.saveButtons->button(QDialogButtonBox::Save)->setEnabled(
_keybindingWidgets.key->currentIndex() > 0
);
if (_mainButtons) {
_mainButtons->setEnabled(false);
}
}
else {
// No keybinding selected
_keybindingWidgets.addButton->setEnabled(true);
_keybindingWidgets.removeButton->setEnabled(false);
_keybindingWidgets.saveButtons->setEnabled(false);
//Action panel must also be in valid state to re-enable main start button
if (_mainButtons && !_actionWidgets.saveButtons->isEnabled()) {
_mainButtons->setEnabled(true);
}
}
}
@@ -719,6 +737,16 @@ void ActionDialog::keybindingActionSelected(int) {
}
void ActionDialog::keybindingSaved() {
if (_keybindingWidgets.key->currentIndex() == -1) {
QMessageBox::critical(this, "Missing key", "Key must have an assignment");
return;
}
//A selection can be made from the combo box without typing text, but selecting from
//the combo will fill the text, so using the text box as criteria covers both cases.
if (_keybindingWidgets.actionText->text().isEmpty()) {
QMessageBox::critical(this, "Missing action", "Key action must not be empty");
return;
}
Profile::Keybinding* keybinding = selectedKeybinding();
ghoul_assert(keybinding, "There must be a selected keybinding at this point");
@@ -758,5 +786,11 @@ void ActionDialog::clearKeybindingFields() {
}
void ActionDialog::keybindingRejected() {
bool isKeyEmpty = (_keybindingsData.back().key.key == Key::Unknown);
bool isActionEmpty = _keybindingsData.back().action.empty();
if (isKeyEmpty || isActionEmpty) {
delete _keybindingWidgets.list->takeItem(_keybindingWidgets.list->count() - 1);
_keybindingsData.erase(_keybindingsData.begin() + _keybindingsData.size() - 1);
}
clearKeybindingFields();
}

View File

@@ -2,7 +2,7 @@
* *
* OpenSpace *
* *
* Copyright (c) 2014-2022 *
* Copyright (c) 2014-2023 *
* *
* 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 *

View File

@@ -2,7 +2,7 @@
* *
* OpenSpace *
* *
* Copyright (c) 2014-2022 *
* Copyright (c) 2014-2023 *
* *
* 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 *

View File

@@ -2,7 +2,7 @@
* *
* OpenSpace *
* *
* Copyright (c) 2014-2022 *
* Copyright (c) 2014-2023 *
* *
* 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 *

View File

@@ -2,7 +2,7 @@
* *
* OpenSpace *
* *
* Copyright (c) 2014-2022 *
* Copyright (c) 2014-2023 *
* *
* 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 *

View File

@@ -2,7 +2,7 @@
* *
* OpenSpace *
* *
* Copyright (c) 2014-2022 *
* Copyright (c) 2014-2023 *
* *
* 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 *
@@ -156,7 +156,10 @@ void AssetTreeModel::importModelData(const std::string& assetBasePath,
std::string assetList = assets.useQtFileSystemModelToTraverseDir(assetBasePath);
assetList += assets.useQtFileSystemModelToTraverseDir(userAssetBasePath, true);
std::istringstream iss(assetList);
ImportElement rootElem = { "", 0, false };
ImportElement rootElem = {
.line = "",
.level = 0,
};
if (importGetNextLine(rootElem, iss)) {
importInsertItem(iss, _rootItem.get(), rootElem, 0);

View File

@@ -2,7 +2,7 @@
* *
* OpenSpace *
* *
* Copyright (c) 2014-2022 *
* Copyright (c) 2014-2023 *
* *
* 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 *
@@ -384,11 +384,11 @@ void CameraDialog::approved() {
!_navState.upY->text().isEmpty() &&
!_navState.upZ->text().isEmpty())
{
glm::dvec3 u = {
glm::dvec3 u = glm::dvec3(
_navState.upX->text().toDouble(),
_navState.upY->text().toDouble(),
_navState.upZ->text().toDouble()
};
);
nav.up = u;
}
else {

View File

@@ -2,7 +2,7 @@
* *
* OpenSpace *
* *
* Copyright (c) 2014-2022 *
* Copyright (c) 2014-2023 *
* *
* 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 *

View File

@@ -2,7 +2,7 @@
* *
* OpenSpace *
* *
* Copyright (c) 2014-2022 *
* Copyright (c) 2014-2023 *
* *
* 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 *
@@ -457,8 +457,8 @@ bool HorizonsDialog::isValidInput() {
// Range 1 to 2147483647 (max of 32 bit int).
// Horizons read the step size into a 32 bit int, but verifies the input on their
// website as a uint32_t. If step size over 32 bit int is sent, this error message is
// recived: Cannot read numeric value -- re-enter
if (step < 1 || step > std::numeric_limits<int32_t>::max()) {
// received: Cannot read numeric value -- re-enter
if (step < 1) {
_errorMsg->setText(QString::fromStdString(fmt::format(
"Step size is outside valid range 1 to '{}'",
std::numeric_limits<int32_t>::max()

View File

@@ -2,7 +2,7 @@
* *
* OpenSpace *
* *
* Copyright (c) 2014-2022 *
* Copyright (c) 2014-2023 *
* *
* 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 *

View File

@@ -2,7 +2,7 @@
* *
* OpenSpace *
* *
* Copyright (c) 2014-2022 *
* Copyright (c) 2014-2023 *
* *
* 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 *

View File

@@ -2,7 +2,7 @@
* *
* OpenSpace *
* *
* Copyright (c) 2014-2022 *
* Copyright (c) 2014-2023 *
* *
* 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 *

View File

@@ -2,7 +2,7 @@
* *
* OpenSpace *
* *
* Copyright (c) 2014-2022 *
* Copyright (c) 2014-2023 *
* *
* 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 *
@@ -37,7 +37,11 @@
using namespace openspace;
namespace {
const Profile::Module Blank = { "", "", "" };
const Profile::Module Blank = {
.name = "",
.loadedInstruction = std::nullopt,
.notLoadedInstruction = std::nullopt
};
} // namespace
ModulesDialog::ModulesDialog(QWidget* parent,

View File

@@ -2,7 +2,7 @@
* *
* OpenSpace *
* *
* Copyright (c) 2014-2022 *
* Copyright (c) 2014-2023 *
* *
* 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 *
@@ -184,9 +184,8 @@ void ProfileEdit::createWidgets(const std::string& profileName) {
QGridLayout* container = new QGridLayout;
container->setColumnStretch(1, 1);
_keybindingsLabel = new QLabel("Keybindings");
_keybindingsLabel = new QLabel("Actions & Keybindings");
_keybindingsLabel->setObjectName("heading");
_keybindingsLabel->setWordWrap(true);
container->addWidget(_keybindingsLabel, 0, 0);
QPushButton* keybindingsProperties = new QPushButton("Edit");
@@ -345,7 +344,9 @@ void ProfileEdit::initSummaryTextForEachCategory() {
QString::fromStdString(summarizeProperties(_profile.properties))
);
_keybindingsLabel->setText(labelText(_profile.keybindings.size(), "Keybindings"));
_keybindingsLabel->setText(
labelText(_profile.keybindings.size(), "Actions & Keybindings")
);
_keybindingsEdit->setText(QString::fromStdString(
summarizeKeybindings(_profile.keybindings, _profile.actions)
));

View File

@@ -2,7 +2,7 @@
* *
* OpenSpace *
* *
* Copyright (c) 2014-2022 *
* Copyright (c) 2014-2023 *
* *
* 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 *

View File

@@ -2,7 +2,7 @@
* *
* OpenSpace *
* *
* Copyright (c) 2014-2022 *
* Copyright (c) 2014-2023 *
* *
* 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,6 +32,7 @@
#include <ghoul/fmt.h>
#include <QGridLayout>
#include <QDialogButtonBox>
#include <QFileDialog>
#include <QLabel>
#include <QLineEdit>
#include <QListWidget>
@@ -41,6 +42,7 @@
ScriptlogDialog::ScriptlogDialog(QWidget* parent)
: QDialog(parent)
, _scriptLogFile(openspace::global::configuration->scriptLog)
{
setWindowTitle("Scriptlog");
createWidgets();
@@ -63,10 +65,31 @@ void ScriptlogDialog::createWidgets() {
QGridLayout* layout = new QGridLayout(this);
{
QLabel* heading = new QLabel(QString::fromStdString(fmt::format(
"Choose commands from \"{}\"", openspace::global::configuration->scriptLog
"Choose commands from \"{}\"", _scriptLogFile
)));
heading->setObjectName("heading");
layout->addWidget(heading, 0, 0, 1, 2);
QPushButton* open = new QPushButton;
open->setIcon(open->style()->standardIcon(QStyle::SP_FileIcon));
connect(
open, &QPushButton::clicked,
[this, heading]() {
QString file = QFileDialog::getOpenFileName(
this,
"Select log file",
"",
"*.txt"
);
_scriptLogFile = file.toStdString();
heading->setText(QString::fromStdString(fmt::format(
"Choose commands from \"{}\"", _scriptLogFile
)));
loadScriptFile();
}
);
layout->addWidget(open, 0, 1, Qt::AlignRight);
}
_filter = new QLineEdit;
@@ -100,7 +123,9 @@ void ScriptlogDialog::createWidgets() {
}
void ScriptlogDialog::loadScriptFile() {
std::string log = absPath(openspace::global::configuration->scriptLog).string();
_scripts.clear();
std::string log = absPath(_scriptLogFile).string();
QFile file(QString::fromStdString(log));
if (file.open(QIODevice::ReadOnly | QIODevice::Text)) {
QTextStream in(&file);

View File

@@ -2,7 +2,7 @@
* *
* OpenSpace *
* *
* Copyright (c) 2014-2022 *
* Copyright (c) 2014-2023 *
* *
* 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 *
@@ -52,7 +52,8 @@ TimeDialog::TimeDialog(QWidget* parent, std::optional<openspace::Profile::Time>*
if (_timeData.value.empty()) {
_timeData.value = "0d";
}
_relativeEdit->setSelection(0, _relativeEdit->text().length());
int len = static_cast<int>(_relativeEdit->text().length());
_relativeEdit->setSelection(0, len);
}
else {
_absoluteEdit->setSelectedSection(QDateTimeEdit::YearSection);

View File

@@ -2,7 +2,7 @@
* *
* OpenSpace *
* *
* Copyright (c) 2014-2022 *
* Copyright (c) 2014-2023 *
* *
* 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 *
@@ -49,7 +49,8 @@ void DisplayWindowUnion::createWidgets(int nMaxWindows,
{
// Add all window controls (some will be hidden from GUI initially)
for (int i = 0; i < nMaxWindows; ++i) {
const int monitorNumForThisWindow = (nMaxWindows > 3 && i >= 2) ? 1 : 0;
const int monitorNumForThisWindow =
(monitorResolutions.size() > 1 && i >= 2) ? 1 : 0;
WindowControl* ctrl = new WindowControl(
monitorNumForThisWindow,

View File

@@ -2,7 +2,7 @@
* *
* OpenSpace *
* *
* Copyright (c) 2014-2022 *
* Copyright (c) 2014-2023 *
* *
* 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 *
@@ -31,7 +31,7 @@ namespace {
constexpr int WindowOpacity = 170;
QRectF computeUnion(const std::vector<QRect>& monitorResolutions) {
QRectF res = { 0.f, 0.f, 0.f, 0.f };
QRectF res = QRectF(0.f, 0.f, 0.f, 0.f);
for (const QRect& m : monitorResolutions) {
res |= m;
}
@@ -145,12 +145,12 @@ void MonitorBox::paintEvent(QPaintEvent*) {
void MonitorBox::windowDimensionsChanged(unsigned int mIdx, unsigned int wIdx,
const QRectF& newDimensions)
{
_windowRendering[wIdx] = {
_windowRendering[wIdx] = QRectF(
_monitorDimensionsScaled[mIdx].x() + newDimensions.left() * _monitorScaleFactor,
_monitorDimensionsScaled[mIdx].y() + newDimensions.top() * _monitorScaleFactor,
newDimensions.width() * _monitorScaleFactor,
newDimensions.height() * _monitorScaleFactor
};
);
update();
}

View File

@@ -2,7 +2,7 @@
* *
* OpenSpace *
* *
* Copyright (c) 2014-2022 *
* Copyright (c) 2014-2023 *
* *
* 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 *

View File

@@ -2,7 +2,7 @@
* *
* OpenSpace *
* *
* Copyright (c) 2014-2022 *
* Copyright (c) 2014-2023 *
* *
* 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 *

View File

@@ -2,7 +2,7 @@
* *
* OpenSpace *
* *
* Copyright (c) 2014-2022 *
* Copyright (c) 2014-2023 *
* *
* 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 *
@@ -39,7 +39,7 @@
#include <filesystem>
namespace {
constexpr QRect MonitorWidgetSize = { 0, 0, 500, 500 };
constexpr QRect MonitorWidgetSize = QRect(0, 0, 500, 500);
constexpr int MaxNumberWindows = 4;
// Returns true if the windows are not ordered correctly. 'Correct' in this means that
@@ -48,10 +48,10 @@ namespace {
// https://github.com/OpenSpace/OpenSpace/issues/507
// is fixed
bool hasWindowIssues(const sgct::config::Cluster& cluster) {
sgct::ivec2 size = {
sgct::ivec2 size = sgct::ivec2(
std::numeric_limits<int>::max(),
std::numeric_limits<int>::max()
};
);
for (const sgct::config::Window& window : cluster.nodes.front().windows) {
if (window.size.x <= size.x && window.size.y <= size.y) {
size = window.size;
@@ -96,7 +96,7 @@ void SgctEdit::createWidgets(const std::vector<QRect>& monitorSizes) {
QBoxLayout* layout = new QVBoxLayout(this);
layout->setSizeConstraint(QLayout::SetFixedSize);
sgct::quat orientation = { 0.f, 0.f, 0.f, 0.f };
sgct::quat orientation = sgct::quat(0.f, 0.f, 0.f, 0.f);
if (_cluster.scene.has_value() && _cluster.scene->orientation.has_value()) {
orientation = *_cluster.scene->orientation;
}
@@ -283,7 +283,7 @@ sgct::config::Cluster SgctEdit::generateConfiguration() const {
sgct::config::User user;
user.eyeSeparation = 0.065f;
user.position = { 0.f, 0.f, 4.f };
user.position = sgct::vec3(0.f, 0.f, 4.f);
cluster.users = { user };
return cluster;

View File

@@ -2,7 +2,7 @@
* *
* OpenSpace *
* *
* Copyright (c) 2014-2022 *
* Copyright (c) 2014-2023 *
* *
* 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 *
@@ -52,10 +52,10 @@ namespace {
};
constexpr std::array<QRectF, 4> DefaultWindowSizes = {
QRectF{ 50.f, 50.f, 1280.f, 720.f },
QRectF{ 150.f, 150.f, 1280.f, 720.f },
QRectF{ 50.f, 50.f, 1280.f, 720.f },
QRectF{ 150.f, 150.f, 1280.f, 720.f }
QRectF(50.f, 50.f, 1280.f, 720.f),
QRectF(150.f, 150.f, 1280.f, 720.f),
QRectF(50.f, 50.f, 1280.f, 720.f),
QRectF(150.f, 150.f, 1280.f, 720.f)
};
constexpr int LineEditWidthFixedWindowSize = 50;
@@ -707,17 +707,17 @@ sgct::config::Projections WindowControl::generateProjectionInformation() const {
sgct::config::Window WindowControl::generateWindowInformation() const {
sgct::config::Window window;
window.size = { _sizeX->text().toInt(), _sizeY->text().toInt() };
window.size = sgct::ivec2(_sizeX->text().toInt(), _sizeY->text().toInt());
QRect resolution = _monitorResolutions[_monitor->currentIndex()];
window.pos = {
window.pos = sgct::ivec2(
resolution.x() + _offsetX->text().toInt(),
resolution.y() + _offsetY->text().toInt()
};
);
sgct::config::Viewport vp;
vp.isTracked = true;
vp.position = { 0.f, 0.f };
vp.size = { 1.f, 1.f };
vp.position = sgct::vec2(0.f, 0.f);
vp.size = sgct::vec2(1.f, 1.f);
vp.projection = generateProjectionInformation();
window.viewports.push_back(vp);

View File

@@ -2,7 +2,7 @@
* *
* OpenSpace *
* *
* Copyright (c) 2014-2022 *
* Copyright (c) 2014-2023 *
* *
* 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,6 +33,7 @@
#include <ghoul/fmt.h>
#include <ghoul/glm.h>
#include <ghoul/cmdparser/commandlineparser.h>
#include <ghoul/cmdparser/multiplecommand.h>
#include <ghoul/cmdparser/singlecommand.h>
#include <ghoul/filesystem/filesystem.h>
#include <ghoul/logging/visualstudiooutputlog.h>
@@ -912,7 +913,9 @@ void setSgctDelegateFunctions() {
sgctDelegate.setHorizFieldOfView = [](float hFovDeg) {
ZoneScoped
Engine::instance().windows().front()->setHorizFieldOfView(hFovDeg);
for (std::unique_ptr<sgct::Window> const& w : Engine::instance().windows()) {
w->setHorizFieldOfView(hFovDeg);
}
};
#ifdef WIN32
sgctDelegate.getNativeWindowHandle = [](size_t windowIndex) -> void* {
@@ -1106,7 +1109,7 @@ int main(int argc, char* argv[]) {
"current working directory"
));
parser.addCommand(std::make_unique<ghoul::cmdparser::SingleCommand<std::string>>(
parser.addCommand(std::make_unique<ghoul::cmdparser::MultipleCommand<std::string>>(
commandlineArguments.configurationOverride, "--config", "-c",
"Provides the ability to pass arbitrary Lua code to the application that will be "
"evaluated after the configuration file has been loaded but before the other "
@@ -1179,10 +1182,14 @@ int main(int argc, char* argv[]) {
// Loading configuration from disk
LDEBUG("Loading configuration from disk");
std::string override;
for (const std::string& arg : commandlineArguments.configurationOverride) {
override += arg + ";";
}
*global::configuration = configuration::loadConfigurationFromFile(
configurationFilePath.string(),
size,
commandlineArguments.configurationOverride
override
);
// Determining SGCT configuration file

View File

@@ -22,7 +22,7 @@
# OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #
##########################################################################################
include(${OPENSPACE_CMAKE_EXT_DIR}/application_definition.cmake)
include(${PROJECT_SOURCE_DIR}/support/cmake/application_definition.cmake)
set_source_files_properties(
${CMAKE_CURRENT_SOURCE_DIR}/openspace.icns
@@ -47,7 +47,7 @@ if (OPENSPACE_MODULE_WEBBROWSER AND CEF_ROOT)
set(CMAKE_BUILD_TYPE Debug CACHE STRING "CMAKE_BUILD_TYPE")
if (WIN32)
set(RESOURCE_FILE ${OPENSPACE_APPS_DIR}/OpenSpace/openspace.rc)
set(RESOURCE_FILE openspace.rc)
endif ()
# Add the CEF binary distribution's cmake/ directory to the module path and

View File

@@ -2,7 +2,7 @@
* *
* OpenSpace *
* *
* Copyright (c) 2014-2022 *
* Copyright (c) 2014-2023 *
* *
* 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 *

View File

@@ -22,7 +22,7 @@
# OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #
##########################################################################################
include(${OPENSPACE_CMAKE_EXT_DIR}/application_definition.cmake)
include(${PROJECT_SOURCE_DIR}/support/cmake/application_definition.cmake)
set_source_files_properties(
${CMAKE_CURRENT_SOURCE_DIR}/openspace.icns
@@ -47,7 +47,7 @@ if (OPENSPACE_MODULE_WEBBROWSER AND CEF_ROOT)
set(CMAKE_BUILD_TYPE Debug CACHE STRING "CMAKE_BUILD_TYPE")
if (WIN32)
set(RESOURCE_FILE ${OPENSPACE_APPS_DIR}/OpenSpace/openspace.rc)
set(RESOURCE_FILE openspace.rc)
endif ()
# Add the CEF binary distribution's cmake/ directory to the module path and

View File

@@ -2,7 +2,7 @@
* *
* OpenSpace *
* *
* Copyright (c) 2014-2022 *
* Copyright (c) 2014-2023 *
* *
* 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 *

View File

@@ -1,16 +1,16 @@
local function getIlluminationCommand(node, global)
local commandString = "local node = \"" .. node .. "\"\n"
if (node == "Current Focus") then
if (node == "Current Focus") then
commandString = "local node = openspace.navigation.getNavigationState().Anchor\n"
end
if (global) then
commandString = commandString .. [[
if (openspace.hasProperty("Scene."..node..".Renderable.UseAccurateNormals")) then
if (openspace.hasProperty("Scene."..node..".Renderable.UseAccurateNormals")) then
local list = openspace.getProperty("Scene." .. node .. ".Renderable.Layers.NightLayers.*.Enabled")
if (#list > 0) then
openspace.setPropertyValue("Scene." .. node .. ".Renderable.Layers.NightLayers.*.Enabled", false)
else
openspace.setPropertyValueSingle("Scene." .. node .. ".Renderable.PerformShading", false)
openspace.setPropertyValueSingle("Scene." .. node .. ".Renderable.PerformShading", false)
end
if openspace.hasSceneGraphNode(node .. "Atmosphere") then
openspace.setPropertyValueSingle("Scene." .. node .. "Atmosphere.Renderable.SunFollowingCamera", true)

View File

@@ -0,0 +1,70 @@
local minormoons_on = {
Identifier = "os_default.minormoons_on",
Name = "Turn ON minor moons and trails",
Command = [[
local trails = openspace.getProperty('{moonTrail_minor}.Renderable.Enabled');
local trails_fade = openspace.getProperty('{moonTrail_minor}.Renderable.Fade');
local moons = openspace.getProperty('{moon_minor}.Renderable.Enabled');
local moons_fade = openspace.getProperty('{moon_minor}.Renderable.Fade');
for i, v in pairs(trails_fade) do
openspace.setPropertyValueSingle(trails[i], true)
openspace.setPropertyValueSingle(v, 1, 2, 'Linear')
end
for i, v in pairs(moons_fade) do
openspace.setPropertyValueSingle(moons[i], true)
openspace.setPropertyValueSingle(v, 1, 2, 'Linear')
end
]],
Documentation = "Turn ON minor moons and their trails for all planets in the solar system",
GuiPath = "/Solar System/Minor Moons",
IsLocal = true
}
local minormoons_off = {
Identifier = "os_default.minormoons_off",
Name = "Turn OFF minor moons and trails",
Command = [[
local trails = openspace.getProperty('{moonTrail_minor}.Renderable.Enabled');
local trails_fade = openspace.getProperty('{moonTrail_minor}.Renderable.Fade');
local moons = openspace.getProperty('{moon_minor}.Renderable.Enabled');
local moons_fade = openspace.getProperty('{moon_minor}.Renderable.Fade');
for i, v in pairs(trails_fade) do
openspace.setPropertyValueSingle(v, 0, 2, 'Linear', "openspace.setPropertyValueSingle('" .. trails[i] .. "', false)" )
end
for i, v in pairs(moons_fade) do
openspace.setPropertyValueSingle(v, 0, 2, 'Linear', "openspace.setPropertyValueSingle('" .. moons[i] .. "', false)" )
end
]],
Documentation = "Turn OFF minor moons and their trails for all planets in the solar system",
GuiPath = "/Solar System/Minor Moons",
IsLocal = true
}
asset.export("minormoons_on", minormoons_on.Identifier)
asset.export("minormoons_off", minormoons_off.Identifier)
asset.onInitialize(function()
openspace.action.registerAction(minormoons_on)
openspace.action.registerAction(minormoons_off)
end)
asset.onDeinitialize(function()
openspace.action.removeAction(minormoons_off)
openspace.action.removeAction(minormoons_on)
end)
asset.meta = {
Name = "Actions - Turn ON/OFF all Minor Moons",
Version = "1.0",
Description = "Asset providing actions to turn ON/OFF all minor moons and their trails",
Author = "OpenSpace Team",
URL = "http://openspaceproject.com",
License = "MIT license"
}

View File

@@ -0,0 +1,32 @@
local toggle_minormoon_trails = {
Identifier = "os_default.toggle_minormoon_trails",
Name = "Toggle Minor Moon Trails",
Command = [[
local list = openspace.getProperty('{moonTrail_minor}.Renderable.Enabled');
for _,v in pairs(list) do
openspace.setPropertyValueSingle(v, not openspace.getPropertyValue(v))
end
]],
Documentation = "Toggle on/off minor moon trails for all planets in the solar system",
GuiPath = "/Trails",
IsLocal = true
}
asset.export("toggle_minormoon_trails", toggle_minormoon_trails.Identifier)
asset.onInitialize(function()
openspace.action.registerAction(toggle_minormoon_trails)
end)
asset.onDeinitialize(function()
openspace.action.removeAction(toggle_minormoon_trails)
end)
asset.meta = {
Name = "Actions - Toggle Minor Moon Trails",
Version = "1.0",
Description = "Asset providing actions to toggle all minor moon trails on and off",
Author = "OpenSpace Team",
URL = "http://openspaceproject.com",
License = "MIT license"
}

View File

@@ -2,8 +2,14 @@ local fade_up_trails = {
Identifier = "os.fade_up_trails",
Name = "Show All Trails",
Command = [[
openspace.setPropertyValue("Scene.*Trail.Renderable.Fade", 1, 2);
openspace.setPropertyValue("Scene.*trail.Renderable.Fade", 1, 2);
local capList = openspace.getProperty("Scene.*Trail.Renderable.Fade");
for _,v in ipairs(capList) do
openspace.setPropertyValueSingle(v, 1, 2);
end
local list = openspace.getProperty("Scene.*trail.Renderable.Fade");
for _,v in ipairs(list) do
openspace.setPropertyValueSingle(v, 1, 2);
end
]],
Documentation = "Fade up all enabled trails in the Scene",
GuiPath = "/Trails",
@@ -15,8 +21,14 @@ local fade_down_trails = {
Identifier = "os.fade_down_trails",
Name = "Hide All Trails",
Command = [[
openspace.setPropertyValue("Scene.*Trail.Renderable.Fade", 0, 2);
openspace.setPropertyValue("Scene.*trail.Renderable.Fade", 0, 2);
local capList = openspace.getProperty("Scene.*Trail.Renderable.Fade");
for _,v in ipairs(capList) do
openspace.setPropertyValueSingle(v, 0, 2);
end
local list = openspace.getProperty("Scene.*trail.Renderable.Fade");
for _,v in ipairs(list) do
openspace.setPropertyValueSingle(v, 0, 2);
end
]],
Documentation = "Fade down all enabled trails in the Scene",
GuiPath = "/Trails",

View File

@@ -4,14 +4,14 @@ local 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
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 = "/Solar System",
IsLocal = false,
}
}
asset.onInitialize(function()
openspace.action.registerAction(toggle_trails)

View File

@@ -56,7 +56,7 @@ local hide_trail = {
else
node = openspace.navigation.getNavigationState().Anchor
end
if openspace.hasSceneGraphNode(node .. "Trail") then
openspace.setPropertyValueSingle("Scene." .. node .. "Trail.Renderable.Fade", 0.0, 1.0)
elseif openspace.hasSceneGraphNode(node .. "_trail") then
@@ -81,7 +81,7 @@ local show_trail = {
else
node = openspace.navigation.getNavigationState().Anchor
end
if openspace.hasSceneGraphNode(node .. "Trail") then
openspace.setPropertyValueSingle("Scene." .. node .. "Trail.Renderable.Fade", 1.0, 1.0)
elseif openspace.hasSceneGraphNode(node .. "_trail") then

View File

@@ -4,10 +4,6 @@
asset.require("./base_blank")
-- Modules and component settings
asset.require("modules/exoplanets/exoplanets")
asset.require("modules/skybrowser/skybrowser")
-- Specifying which other assets should be loaded in this scene
asset.require("scene/solarsystem/sun/sun")
asset.require("scene/solarsystem/sun/glare")
@@ -67,7 +63,7 @@ local 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
local moonlist = openspace.getProperty("{moonTrail_solarSystem}.Renderable.Enabled");
for _,v in pairs(moonlist) do openspace.setPropertyValueSingle(v, not openspace.getPropertyValue(v)) end
]],

View File

@@ -1,7 +1,5 @@
-- This is a blank scene that that just sets up the default menus/dasboard/keys, etc.
local propertyHelper = asset.require("util/property_helper")
-- Specifying which other assets should be loaded in this scene
asset.require("spice/base")
@@ -18,6 +16,11 @@ asset.require("util/dpiscaling")
-- Load the images required for the launcher to show up
asset.require("util/launcher_images")
-- Modules and component settings
asset.require("modules/exoplanets/exoplanets")
asset.require("modules/skybrowser/skybrowser")
asset.onInitialize(function ()
webGui.setCefRoute("onscreen")
openspace.setDefaultGuiSorting()

View File

@@ -1,2 +1,2 @@
Group (optional),Name (required),Globe (optional),Lat (required if globe),Lon (required if globe),Altitude (optional if globe),x (required if not globe),y (required if not globe),z (required if not globe),Scale (optional),LineWidth (optional)
NASA,Kenedy Space Center,Earth,28.6658276,-80.70282839,,,,,,
NASA,Kennedy Space Center,Earth,28.6658276,-80.70282839,,,,,,
1 Group (optional) Name (required) Globe (optional) Lat (required if globe) Lon (required if globe) Altitude (optional if globe) x (required if not globe) y (required if not globe) z (required if not globe) Scale (optional) LineWidth (optional)
2 NASA Kenedy Space Center Kennedy Space Center Earth 28.6658276 -80.70282839

View File

@@ -65,12 +65,36 @@ local updatePositionAction = {
IsLocal = false
}
local resetPositionAction = {
Identifier = "os.reset_eiffel_tower",
Name = "Reset Eiffel Tower position",
Command = [[
-- same position as above
local lat = 48.85824
local lon = 2.29448
local globe = ']] .. earthAsset.Earth.Identifier .. [['
openspace.setParent('eiffelTower', globe)
openspace.setPropertyValueSingle('Scene.eiffelTower.Translation.Globe', globe);
openspace.setPropertyValueSingle('Scene.eiffelTower.Translation.Latitude', lat);
openspace.setPropertyValueSingle('Scene.eiffelTower.Translation.Longitude', lon);
openspace.setPropertyValueSingle('Scene.eiffelTower.Rotation.Globe', globe);
openspace.setPropertyValueSingle('Scene.eiffelTower.Rotation.Latitude', lat);
openspace.setPropertyValueSingle('Scene.eiffelTower.Rotation.Longitude', lon);
]],
Documentation = "Updates the Eiffel Tower position based on the globe location of the camera",
GuiPath = "/Scale Objects",
IsLocal = false
}
asset.onInitialize(function()
openspace.addSceneGraphNode(eiffelTower)
openspace.action.registerAction(updatePositionAction)
openspace.action.registerAction(resetPositionAction)
end)
asset.onDeinitialize(function()
openspace.action.removeAction(resetPositionAction)
openspace.action.removeAction(updatePositionAction)
openspace.removeSceneGraphNode(eiffelTower)
end)

View File

@@ -43,7 +43,7 @@ local obj = {
OnApproach = { "os.example.generic" },
OnReach = { "os.example.generic" },
OnRecede = { "os.example.generic" },
OnExit = { "os.example.generic" },
OnExit = { "os.example.generic" },
GUI = {
Name = "Example Event Model",
Path = "/Example",

View File

@@ -58,7 +58,12 @@ local elapsed_time = {
ReferenceTime = "2022-10-12 12:00:00"
}
asset.onInitialize(function()
local input_state = {
Type = "DashboardItemInputState",
Identifier = "InputState"
}
asset.onInitialize(function()
openspace.dashboard.addDashboardItem(angle)
openspace.dashboard.addDashboardItem(date)
openspace.dashboard.addDashboardItem(simulation_increment)
@@ -68,9 +73,11 @@ asset.onInitialize(function()
openspace.dashboard.addDashboardItem(mission)
openspace.dashboard.addDashboardItem(property_value)
openspace.dashboard.addDashboardItem(elapsed_time)
openspace.dashboard.addDashboardItem(input_state)
end)
asset.onDeinitialize(function()
openspace.dashboard.removeDashboardItem(input_state)
openspace.dashboard.removeDashboardItem(elapsed_time)
openspace.dashboard.removeDashboardItem(property_value)
openspace.dashboard.removeDashboardItem(mission)

View File

@@ -97,14 +97,14 @@ asset.onInitialize(function()
openspace.addSceneGraphNode(sphericalGrid)
openspace.addSceneGraphNode(boxGrid)
end)
asset.onDeinitialize(function()
openspace.removeSceneGraphNode(boxGrid)
openspace.removeSceneGraphNode(sphericalGrid)
openspace.removeSceneGraphNode(planarGrid)
openspace.removeSceneGraphNode(radialGrid)
end)
asset.export(radialGrid)
asset.export(sphericalGrid)
asset.export(planarGrid)

View File

@@ -2,7 +2,7 @@
* *
* OpenSpace *
* *
* Copyright (c) 2014-2022 *
* Copyright (c) 2014-2023 *
* *
* 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 *
@@ -68,8 +68,8 @@ Fragment getFragment() {
frag.color.rgb = normalize(vs_normalViewSpace);
}
frag.color.a = 1.0;
frag.gPosition = vs_positionCameraSpace;
frag.gNormal = vec4(vs_normalViewSpace, 0.0);
frag.gPosition = vs_positionCameraSpace;
frag.gNormal = vec4(vs_normalViewSpace, 0.0);
frag.disableLDR2HDR = true;
return frag;
}

View File

@@ -2,7 +2,7 @@
* *
* OpenSpace *
* *
* Copyright (c) 2014-2022 *
* Copyright (c) 2014-2023 *
* *
* 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 *
@@ -51,7 +51,7 @@ void main() {
gl_Position = positionScreenSpace;
vs_st = in_st;
vs_screenSpaceDepth = positionScreenSpace.w;
vs_normalViewSpace = normalize(mat3(normalTransform) * (mat3(meshNormalTransform) * in_normal));
// TBN matrix for normal mapping

View File

@@ -39,9 +39,9 @@ local model = {
asset.onInitialize(function()
openspace.addSceneGraphNode(model)
end)
asset.onDeinitialize(function()
openspace.removeSceneGraphNode(model)
end)
asset.export(model)

View File

@@ -48,11 +48,11 @@ asset.onInitialize(function()
openspace.addSceneGraphNode(circle)
openspace.addSceneGraphNode(ellipse)
end)
asset.onDeinitialize(function()
openspace.removeSceneGraphNode(ellipse)
openspace.removeSceneGraphNode(circle)
end)
asset.export(circle)
asset.export(ellipse)

View File

@@ -24,9 +24,9 @@ local RenderablePlaneImageOnline = {
asset.onInitialize(function()
openspace.addSceneGraphNode(RenderablePlaneImageOnline)
end)
asset.onDeinitialize(function()
openspace.removeSceneGraphNode(RenderablePlaneImageOnline)
end)
asset.export(RenderablePlaneImageOnline)

View File

@@ -23,9 +23,9 @@ local Spout = {
asset.onInitialize(function()
openspace.addSceneGraphNode(Spout)
end)
asset.onDeinitialize(function()
openspace.removeSceneGraphNode(Spout)
end)
asset.export(Spout)

View File

@@ -4,7 +4,7 @@ local deck = nil
asset.onInitialize(function ()
deck = helper.createDeck("example", {
UseRadiusAzimuthElevation = true,
RadiusAzimuthElevation = {1.0, 0.0, 0.0}, -- use for dome
RadiusAzimuthElevation = { 1.0, 0.0, 0.0 }, -- use for dome
UsePerspectiveProjection = true,
FaceCamera = true,
Scale = 0.7
@@ -17,7 +17,7 @@ asset.onInitialize(function ()
-- Add global functions for controlling slide deck and bind to keys
rawset(_G, "nextSlide", function()
helper.goToNextSlide(deck, interpolationDuration)
helper.goToNextSlide(deck, interpolationDuration)
end)
rawset(_G, "previousSlide", function()

View File

@@ -39,7 +39,7 @@ asset.onInitialize(function()
openspace.addSceneGraphNode(n)
end
end)
asset.onDeinitialize(function()
for _, n in ipairs(spheres) do
openspace.removeSceneGraphNode(n)

View File

@@ -1,11 +1,11 @@
-- Create a state machine with a few different states. The state machine can be controlled through
-- the scripting commands from the state machine module.
local targetNode = function(nodeIdentifier)
local targetNode = function(nodeIdentifier)
return [[
openspace.setPropertyValueSingle("NavigationHandler.OrbitalNavigator.RetargetAnchor", nil)
openspace.setPropertyValueSingle(
"NavigationHandler.OrbitalNavigator.Anchor",
"NavigationHandler.OrbitalNavigator.Anchor",
"]] .. nodeIdentifier .. [["
)
openspace.setPropertyValueSingle("NavigationHandler.OrbitalNavigator.Aim", "")

View File

@@ -40,7 +40,7 @@ local layer_folder = {
Description = "Temporal coverage: 01 Jan 1981 - 31 Dec 2020"
}
asset.onInitialize(function()
asset.onInitialize(function()
openspace.globebrowsing.addLayer(globeIdentifier, "ColorLayers", layer_prototype)
openspace.globebrowsing.addLayer(globeIdentifier, "ColorLayers", layer_folder)
end)

View File

@@ -9,36 +9,36 @@ local transforms = asset.require("scene/solarsystem/sun/transforms")
local sunRadius = 695508000
local volume = {
Identifier = "GeneratedVolume",
Parent = transforms.SolarSystemBarycenter.Identifier,
Renderable = {
Type = "RenderableTimeVaryingVolume",
SourceDirectory = asset.localResource("cartesian"),
TransferFunction = asset.localResource("../transferfunction.txt"),
StepSize = 0.01,
MinValue = 0,
MaxValue = 1,
GridType = "Cartesian",
SecondsBefore = 50*365*24*60*60, -- 50 years before
SecondsAfter = 50*365*24*60*60 -- 50 years after
},
GUI = {
Path = "/Examples"
},
Transform = {
Scale = {
Type = "StaticScale",
Scale = 1000 * sunRadius
}
Identifier = "GeneratedVolume",
Parent = transforms.SolarSystemBarycenter.Identifier,
Transform = {
Scale = {
Type = "StaticScale",
Scale = 1000 * sunRadius
}
},
Renderable = {
Type = "RenderableTimeVaryingVolume",
SourceDirectory = asset.localResource("cartesian"),
TransferFunction = asset.localResource("../transferfunction.txt"),
StepSize = 0.01,
MinValue = 0,
MaxValue = 1,
GridType = "Cartesian",
SecondsBefore = 50*365*24*60*60, -- 50 years before
SecondsAfter = 50*365*24*60*60 -- 50 years after
},
GUI = {
Path = "/Examples"
}
}
asset.onInitialize(function()
openspace.addSceneGraphNode(volume)
end)
asset.onDeinitialize(function()
openspace.removeSceneGraphNode(volume)
end)
asset.export(volume)

View File

@@ -36,7 +36,7 @@ local volume = {
asset.onInitialize(function()
openspace.addSceneGraphNode(volume)
end)
asset.onDeinitialize(function()
openspace.removeSceneGraphNode(volume)
end)

View File

@@ -11,6 +11,12 @@ local astronomicalUnit = 149597870700
local volume = {
Identifier = "GeneratedVolume",
Parent = transforms.SolarSystemBarycenter.Identifier,
Transform = {
Scale = {
Type = "StaticScale",
Scale = astronomicalUnit
}
},
Renderable = {
Type = "RenderableTimeVaryingVolume",
SourceDirectory = asset.localResource("spherical"),
@@ -24,19 +30,13 @@ local volume = {
},
GUI = {
Path = "/Examples"
},
Transform = {
Scale = {
Type = "StaticScale",
Scale = astronomicalUnit
}
}
}
asset.onInitialize(function()
openspace.addSceneGraphNode(volume)
end)
asset.onDeinitialize(function()
openspace.removeSceneGraphNode(volume)
end)

View File

@@ -20,9 +20,9 @@ local ToyVolume = {
asset.onInitialize(function()
openspace.addSceneGraphNode(ToyVolume)
end)
asset.onDeinitialize(function()
openspace.removeSceneGraphNode(ToyVolume)
end)
asset.export(ToyVolume)

View File

@@ -5,16 +5,18 @@ local nodes = bookmarkHelper.getBookmarks("Local Bookmarks", "${ASSETS}/customiz
asset.onInitialize(function()
for _, n in ipairs(nodes) do
openspace.addSceneGraphNode(n)
pcall(openspace.addSceneGraphNode, n)
end
end)
asset.onDeinitialize(function()
for _, n in ipairs(nodes) do
openspace.removeSceneGraphNode(n)
if openspace.hasSceneGraphNode(n.Identifier) then
openspace.removeSceneGraphNode(n)
end
end
end)
for _, n in ipairs(nodes) do
asset.export(n)
end

View File

@@ -1,4 +1,4 @@
asset.onInitialize(function ()
asset.onInitialize(function ()
openspace.setPropertyValueSingle("Modules.Exoplanets.Enabled", true)
openspace.setPropertyValueSingle("Modules.Exoplanets.ShowComparisonCircle", false)
openspace.setPropertyValueSingle("Modules.Exoplanets.ShowHabitableZone", true)

View File

@@ -12,7 +12,7 @@ local colormaps = asset.syncedResource({
Version = 3
})
asset.onInitialize(function ()
asset.onInitialize(function ()
-- Set the default data files used for the exoplanet system creation
-- (Check if already set, to not override value set in another file)
local p = "Modules.Exoplanets.DataFolder";
@@ -31,9 +31,9 @@ asset.export("DataPath", DataPath)
asset.meta = {
Name = "Exoplanet Data",
Version = "3.0",
Description = [[The data that is used for the exoplanet systems. The data has been
derived from the 'Planetary Systems Composite Data' dataset from the NASA Exoplanet
Archive]],
Description = [[The data that is used for the exoplanet systems. The data has been
derived from the 'Planetary Systems Composite Data' dataset from the NASA Exoplanet
Archive]],
Author = "OpenSpace Team",
URL = "https://exoplanetarchive.ipac.caltech.edu/docs/data.html",
License = "MIT license"

View File

@@ -1,4 +1,4 @@
asset.onInitialize(function ()
asset.onInitialize(function ()
openspace.setPropertyValueSingle("Modules.SkyBrowser.Enabled", true)
openspace.setPropertyValueSingle("Modules.SkyBrowser.ShowTitleInGuiBrowser", false)
-- More settings are available, but for now using the default values

View File

@@ -21,8 +21,8 @@ local circle = {
},
GUI = {
Name = "Hover Circle",
Description = [[A circular marker that shows the position on the night sky
of the object hovered in the sky browser UI. The circle will hide/show up
Description = [[A circular marker that shows the position on the night sky
of the object hovered in the sky browser UI. The circle will hide/show up
dynamically, depending on the interaction with the items in the UI]],
Path = "/SkyBrowser"
}
@@ -42,7 +42,7 @@ asset.export(circle)
asset.meta = {
Name = "SkyBrowser Hover Circle",
Version = "1.0",
Description = [[Includes a circular marker that shows the position on the night sky
Description = [[Includes a circular marker that shows the position on the night sky
of the object hovered in the sky browser UI]],
Author = "OpenSpace Team",
URL = "http://openspaceproject.com",

View File

@@ -53,11 +53,11 @@ local object = {
asset.onInitialize(function()
openspace.addSceneGraphNode(object)
end)
asset.onDeinitialize(function()
openspace.removeSceneGraphNode(object)
end)
asset.export(object)

View File

@@ -48,11 +48,11 @@ local object = {
asset.onInitialize(function()
openspace.addSceneGraphNode(object)
end)
asset.onDeinitialize(function()
openspace.removeSceneGraphNode(object)
end)
asset.export(object)

Some files were not shown because too many files have changed in this diff Show More