mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-05-12 14:29:42 -05:00
Merge branch 'master' into feature/min-max-distance
* Solve conflicts
This commit is contained in:
@@ -39,3 +39,4 @@ COMMIT.md
|
||||
*_codegen.cpp
|
||||
# SkyBrowser Module downloaded data
|
||||
/modules/skybrowser/wwtimagedata
|
||||
doc
|
||||
|
||||
@@ -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
|
||||
+45
-57
@@ -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,13 @@ 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 "modules" "src"
|
||||
WORKING_DIRECTORY "${PROJECT_SOURCE_DIR}"
|
||||
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 +206,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 +223,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 +238,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 +254,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")
|
||||
|
||||
+1
-1
@@ -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.
|
||||
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -33,6 +33,7 @@ class QCheckBox;
|
||||
class QComboBox;
|
||||
class QDialogButtonBox;
|
||||
class QGridLayout;
|
||||
class QLabel;
|
||||
class QLineEdit;
|
||||
class QListWidget;
|
||||
class QPushButton;
|
||||
@@ -58,7 +59,7 @@ private:
|
||||
void clearActionFields();
|
||||
void actionRejected();
|
||||
void chooseScripts();
|
||||
void appendScriptsToTextfield(std::string scripts);
|
||||
void appendScriptsToTextfield(std::vector<std::string> scripts);
|
||||
|
||||
openspace::Profile::Keybinding* selectedKeybinding();
|
||||
void keybindingAdd();
|
||||
@@ -77,6 +78,7 @@ private:
|
||||
struct {
|
||||
QListWidget* list = nullptr;
|
||||
QLineEdit* identifier = nullptr;
|
||||
QLabel* infoText = nullptr;
|
||||
QLineEdit* name = nullptr;
|
||||
QLineEdit* guiPath = nullptr;
|
||||
QLineEdit* documentation = nullptr;
|
||||
@@ -101,7 +103,7 @@ private:
|
||||
QDialogButtonBox* saveButtons = nullptr;
|
||||
} _keybindingWidgets;
|
||||
|
||||
QDialogButtonBox* _mainButtons = nullptr;
|
||||
QDialogButtonBox* _mainButton = nullptr;
|
||||
};
|
||||
|
||||
#endif // __OPENSPACE_UI_LAUNCHER___ACTIONDIALOG___H__
|
||||
|
||||
@@ -52,7 +52,7 @@ private:
|
||||
*
|
||||
* \param scripts #std::string scripts to be appended
|
||||
*/
|
||||
void appendScriptsToTextfield(std::string scripts);
|
||||
void appendScriptsToTextfield(std::vector<std::string> scripts);
|
||||
|
||||
std::vector<std::string>* _scripts = nullptr;
|
||||
std::vector<std::string> _scriptsData;
|
||||
|
||||
@@ -63,7 +63,7 @@ public:
|
||||
|
||||
private:
|
||||
void createWidgets();
|
||||
|
||||
|
||||
void listItemSelected();
|
||||
void valueChanged(const QString& text);
|
||||
void saveDeltaTimeValue();
|
||||
@@ -76,7 +76,7 @@ private:
|
||||
* Called to transition to editing a particular dt value (gui settings)
|
||||
*
|
||||
* \param index index in dt list
|
||||
* \param state \c true if the edit mode should be turned on, \c false otherwise
|
||||
* \param state `true` if the edit mode should be turned on, `false` otherwise
|
||||
*/
|
||||
void transitionEditMode(int index, bool state);
|
||||
|
||||
|
||||
@@ -58,9 +58,7 @@ private:
|
||||
void listItemRemove();
|
||||
void parseSelections();
|
||||
|
||||
std::vector<QListWidgetItem*> _markedNodesListItems;
|
||||
std::vector<std::string>* _markedNodes;
|
||||
std::vector<std::string> _markedNodesData;
|
||||
|
||||
QListWidget* _list = nullptr;
|
||||
QPushButton* _removeButton = nullptr;
|
||||
|
||||
@@ -34,10 +34,10 @@ class QPushButton;
|
||||
class ScriptlogDialog final : public QDialog {
|
||||
Q_OBJECT
|
||||
public:
|
||||
ScriptlogDialog(QWidget* parent);
|
||||
ScriptlogDialog(QWidget* parent, std::string filter = "");
|
||||
|
||||
signals:
|
||||
void scriptsSelected(std::string script);
|
||||
void scriptsSelected(std::vector<std::string> script);
|
||||
|
||||
private:
|
||||
void createWidgets();
|
||||
@@ -50,7 +50,10 @@ private:
|
||||
QListWidget* _scriptlogList = nullptr;
|
||||
QLineEdit* _filter = nullptr;
|
||||
QPushButton* _reloadFile = nullptr;
|
||||
std::string _scriptLogFile;
|
||||
std::vector<std::string> _scripts;
|
||||
|
||||
std::string _fixedFilter;
|
||||
};
|
||||
|
||||
#endif // __OPENSPACE_UI_LAUNCHER___SCRIPTLOGDIALOG___H__
|
||||
|
||||
@@ -29,6 +29,7 @@
|
||||
|
||||
#include <openspace/scene/profile.h>
|
||||
|
||||
class QCheckBox;
|
||||
class QComboBox;
|
||||
class QDateTimeEdit;
|
||||
class QLabel;
|
||||
@@ -63,6 +64,7 @@ private:
|
||||
QDateTimeEdit* _absoluteEdit = nullptr;
|
||||
QLabel* _relativeLabel = nullptr;
|
||||
QLineEdit* _relativeEdit = nullptr;
|
||||
QCheckBox* _startPaused = nullptr;
|
||||
};
|
||||
|
||||
#endif // __OPENSPACE_UI_LAUNCHER___TIMEDIALOG___H__
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
};
|
||||
|
||||
@@ -36,7 +36,7 @@ LauncherWindow QComboBox#config {
|
||||
border-radius: 3px;
|
||||
border-color: rgb(225, 225, 225);
|
||||
padding: 1px 18px 1px 3px;
|
||||
min-width: 6em;
|
||||
min-width: 14em;
|
||||
font-size: 10pt;
|
||||
font-family: Segoe UI;
|
||||
font-weight: bold;
|
||||
|
||||
@@ -51,7 +51,7 @@ namespace {
|
||||
|
||||
constexpr int LeftRuler = 40;
|
||||
constexpr int TopRuler = 80;
|
||||
constexpr int ItemWidth = 240;
|
||||
constexpr int ItemWidth = 260;
|
||||
constexpr int ItemHeight = ItemWidth / 4;
|
||||
constexpr int SmallItemWidth = 100;
|
||||
constexpr int SmallItemHeight = SmallItemWidth / 4;
|
||||
@@ -62,7 +62,7 @@ namespace {
|
||||
constexpr QRect ChooseLabel(LeftRuler, TopRuler + 80, 151, 24);
|
||||
constexpr QRect ProfileBox(LeftRuler, TopRuler + 110, ItemWidth, ItemHeight);
|
||||
constexpr QRect NewProfileButton(
|
||||
LeftRuler + 140, TopRuler + 180, SmallItemWidth, SmallItemHeight
|
||||
LeftRuler + 160, TopRuler + 180, SmallItemWidth, SmallItemHeight
|
||||
);
|
||||
constexpr QRect EditProfileButton(
|
||||
LeftRuler, TopRuler + 180, SmallItemWidth, SmallItemHeight
|
||||
@@ -70,7 +70,7 @@ namespace {
|
||||
constexpr QRect OptionsLabel(LeftRuler, TopRuler + 230, 151, 24);
|
||||
constexpr QRect WindowConfigBox(LeftRuler, TopRuler + 260, ItemWidth, ItemHeight);
|
||||
constexpr QRect NewWindowButton(
|
||||
LeftRuler + 140, TopRuler + 330, SmallItemWidth, SmallItemHeight
|
||||
LeftRuler + 160, TopRuler + 330, SmallItemWidth, SmallItemHeight
|
||||
);
|
||||
constexpr QRect EditWindowButton(
|
||||
LeftRuler, TopRuler + 330, SmallItemWidth, SmallItemHeight
|
||||
@@ -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
|
||||
|
||||
@@ -75,62 +75,58 @@ ActionDialog::ActionDialog(QWidget* parent,
|
||||
}
|
||||
|
||||
void ActionDialog::createWidgets() {
|
||||
// Column 0 Column 1 Column 2
|
||||
// *----------------------*---------------*----------------*
|
||||
// | Actions | Row 0
|
||||
// | | Identifier | [oooooooooooo] | Row 1
|
||||
// | | Name | [oooooooooooo] | Row 2
|
||||
// | | GUI Path | [oooooooooooo] | Row 3
|
||||
// | | Documentation | [oooooooooooo] | Row 4
|
||||
// | | Is Local | [] [choosescr] | Row 5
|
||||
// | | Script | [oooooooooooo] | Row 6
|
||||
// *----------------------*---------------*----------------*
|
||||
// | [+] [-] | | <Save> <Cancel>| Row 7
|
||||
// *----------------------*---------------*----------------*
|
||||
// |=======================================================| Row 8
|
||||
// | Keybindings | Row 9
|
||||
// *----------------------*---------------*----------------|
|
||||
// | | Modifier | []S []C []A | Row 10
|
||||
// | | Key | DDDDDDDDDDDD> | Row 11
|
||||
// | | Add actions | DDDDDDDDDDDD> | Row 12
|
||||
// | | Action | [oooooooooooo] | Row 13
|
||||
// *----------------------*---------------*----------------*
|
||||
// | [+] [-] | | <Save> <Cancel>| Row 14
|
||||
// *----------------------*---------------*----------------*
|
||||
// |=======================================================| Row 16
|
||||
// *----------------------*---------------*----------------*
|
||||
// | | <Save> <Cancel>| Row 17
|
||||
// *----------------------*---------------*----------------*
|
||||
// Column 0 Column 1 Column 2 Col3
|
||||
// *----------------------*---------------*----------|------*
|
||||
// | Actions | Row 0
|
||||
// | | Identifier | [oooooo] | Info | Row 1
|
||||
// | | Name | [ooooooooooooo] | Row 2
|
||||
// | | GUI Path | [ooooooooooooo] | Row 3
|
||||
// | | Documentation | [ooooooooooooo] | Row 4
|
||||
// | | Is Local | [] [choosescr] | Row 5
|
||||
// | | Script | [ooooooooooooo] | Row 6
|
||||
// *----------------------*---------------*-----------------*
|
||||
// | [+] [-] | | <Save> <Cancel> | Row 7
|
||||
// *----------------------*---------------*-----------------*
|
||||
// |========================================================| Row 8
|
||||
// | Keybindings | Row 9
|
||||
// *----------------------*---------------*-----------------|
|
||||
// | | Modifier | []S []C []A | Row 10
|
||||
// | | Key | DDDDDDDDDDDD> | Row 11
|
||||
// | | Add actions | DDDDDDDDDDDD> | Row 12
|
||||
// | | Action | [ooooooooooooo] | Row 13
|
||||
// *----------------------*---------------*-----------------*
|
||||
// | [+] [-] | | <Save> <Cancel> | Row 14
|
||||
// *----------------------*---------------*-----------------*
|
||||
// |========================================================| Row 16
|
||||
// *----------------------*---------------*-----------------*
|
||||
// | | <Save> <Cancel> | Row 17
|
||||
// *----------------------*---------------*-----------------*
|
||||
|
||||
QGridLayout* layout = new QGridLayout(this);
|
||||
|
||||
createActionWidgets(layout);
|
||||
clearActionFields();
|
||||
|
||||
layout->addWidget(new Line, 8, 0, 1, 3);
|
||||
layout->addWidget(new Line, 8, 0, 1, 4);
|
||||
|
||||
createKeyboardWidgets(layout);
|
||||
clearKeybindingFields();
|
||||
|
||||
layout->addWidget(new Line, 16, 0, 1, 3);
|
||||
layout->addWidget(new Line, 16, 0, 1, 4);
|
||||
|
||||
_mainButtons = new QDialogButtonBox;
|
||||
_mainButtons->setStandardButtons(QDialogButtonBox::Save | QDialogButtonBox::Cancel);
|
||||
_mainButton = new QDialogButtonBox;
|
||||
_mainButton->setStandardButtons(QDialogButtonBox::Close);
|
||||
QObject::connect(
|
||||
_mainButtons, &QDialogButtonBox::accepted,
|
||||
this, &ActionDialog::applyChanges
|
||||
);
|
||||
QObject::connect(
|
||||
_mainButtons, &QDialogButtonBox::rejected,
|
||||
_mainButton, &QDialogButtonBox::rejected,
|
||||
this, &ActionDialog::reject
|
||||
);
|
||||
layout->addWidget(_mainButtons, 17, 2, Qt::AlignRight);
|
||||
layout->addWidget(_mainButton, 17, 2, Qt::AlignRight);
|
||||
}
|
||||
|
||||
void ActionDialog::createActionWidgets(QGridLayout* layout) {
|
||||
QLabel* title = new QLabel("Actions");
|
||||
title->setObjectName("heading");
|
||||
layout->addWidget(title, 0, 0, 1, 3);
|
||||
layout->addWidget(title, 0, 0, 1, 4);
|
||||
|
||||
_actionWidgets.list = new QListWidget;
|
||||
_actionWidgets.list->setToolTip(
|
||||
@@ -161,8 +157,31 @@ void ActionDialog::createActionWidgets(QGridLayout* layout) {
|
||||
"separated hierarchical structure is suggested to prevent name clashes"
|
||||
);
|
||||
_actionWidgets.identifier->setEnabled(false);
|
||||
connect(
|
||||
_actionWidgets.identifier, &QLineEdit::textEdited,
|
||||
[this]() {
|
||||
// Check if the identifier is legal
|
||||
std::string identifier = _actionWidgets.identifier->text().toStdString();
|
||||
bool isLegal = identifier.find_first_of("\t\n. ") == std::string::npos;
|
||||
if (isLegal) {
|
||||
_actionWidgets.infoText->clear();
|
||||
_actionWidgets.infoText->setHidden(true);
|
||||
}
|
||||
else {
|
||||
_actionWidgets.infoText->setText(
|
||||
"Identifier must not contain whitespace or ."
|
||||
);
|
||||
_actionWidgets.infoText->setHidden(false);
|
||||
}
|
||||
}
|
||||
);
|
||||
layout->addWidget(_actionWidgets.identifier, 1, 2);
|
||||
|
||||
_actionWidgets.infoText = new QLabel;
|
||||
_actionWidgets.infoText->setHidden(true);
|
||||
_actionWidgets.infoText->setObjectName("error-message");
|
||||
layout->addWidget(_actionWidgets.infoText, 1, 3);
|
||||
|
||||
layout->addWidget(new QLabel("Name"), 2, 1);
|
||||
_actionWidgets.name = new QLineEdit;
|
||||
_actionWidgets.name->setToolTip(
|
||||
@@ -170,7 +189,7 @@ void ActionDialog::createActionWidgets(QGridLayout* layout) {
|
||||
"name should be as concise and informative as possible"
|
||||
);
|
||||
_actionWidgets.name->setEnabled(false);
|
||||
layout->addWidget(_actionWidgets.name, 2, 2);
|
||||
layout->addWidget(_actionWidgets.name, 2, 2, 1, 2);
|
||||
|
||||
layout->addWidget(new QLabel("GUI Path"), 3, 1);
|
||||
_actionWidgets.guiPath = new QLineEdit;
|
||||
@@ -180,7 +199,7 @@ void ActionDialog::createActionWidgets(QGridLayout* layout) {
|
||||
"character that denotes the root folder"
|
||||
);
|
||||
_actionWidgets.guiPath->setEnabled(false);
|
||||
layout->addWidget(_actionWidgets.guiPath, 3, 2);
|
||||
layout->addWidget(_actionWidgets.guiPath, 3, 2, 1, 2);
|
||||
|
||||
layout->addWidget(new QLabel("Documentation"), 4, 1);
|
||||
_actionWidgets.documentation = new QLineEdit;
|
||||
@@ -191,7 +210,7 @@ void ActionDialog::createActionWidgets(QGridLayout* layout) {
|
||||
"parameters that that action can consume"
|
||||
);
|
||||
_actionWidgets.documentation->setEnabled(false);
|
||||
layout->addWidget(_actionWidgets.documentation, 4, 2);
|
||||
layout->addWidget(_actionWidgets.documentation, 4, 2, 1, 2);
|
||||
|
||||
layout->addWidget(new QLabel("Is Local"), 5, 1);
|
||||
_actionWidgets.isLocal = new QCheckBox;
|
||||
@@ -204,7 +223,7 @@ void ActionDialog::createActionWidgets(QGridLayout* layout) {
|
||||
"instances as well"
|
||||
);
|
||||
_actionWidgets.isLocal->setEnabled(false);
|
||||
layout->addWidget(_actionWidgets.isLocal, 5, 2);
|
||||
layout->addWidget(_actionWidgets.isLocal, 5, 2, 1, 2);
|
||||
|
||||
_actionWidgets.chooseScripts = new QPushButton("Choose Scripts");
|
||||
_actionWidgets.chooseScripts->setToolTip(
|
||||
@@ -215,7 +234,7 @@ void ActionDialog::createActionWidgets(QGridLayout* layout) {
|
||||
this, &ActionDialog::chooseScripts
|
||||
);
|
||||
_actionWidgets.chooseScripts->setEnabled(false);
|
||||
layout->addWidget(_actionWidgets.chooseScripts, 5, 2, Qt::AlignRight);
|
||||
layout->addWidget(_actionWidgets.chooseScripts, 5, 2, 1, 2, Qt::AlignRight);
|
||||
|
||||
layout->addWidget(new QLabel("Script"), 6, 1);
|
||||
_actionWidgets.script = new QTextEdit;
|
||||
@@ -226,7 +245,7 @@ void ActionDialog::createActionWidgets(QGridLayout* layout) {
|
||||
"variable does not exist"
|
||||
);
|
||||
_actionWidgets.script->setEnabled(false);
|
||||
layout->addWidget(_actionWidgets.script, 6, 2);
|
||||
layout->addWidget(_actionWidgets.script, 6, 2, 1, 2);
|
||||
|
||||
|
||||
// + / - buttons
|
||||
@@ -270,13 +289,13 @@ void ActionDialog::createActionWidgets(QGridLayout* layout) {
|
||||
_actionWidgets.saveButtons, &QDialogButtonBox::rejected,
|
||||
this, &ActionDialog::actionRejected
|
||||
);
|
||||
layout->addWidget(_actionWidgets.saveButtons, 7, 2, Qt::AlignRight);
|
||||
layout->addWidget(_actionWidgets.saveButtons, 7, 2, 1, 2, Qt::AlignRight);
|
||||
}
|
||||
|
||||
void ActionDialog::createKeyboardWidgets(QGridLayout* layout) {
|
||||
QLabel* title = new QLabel("Keybindings");
|
||||
title->setObjectName("heading");
|
||||
layout->addWidget(title);
|
||||
layout->addWidget(title, 9, 0, 1, 4);
|
||||
|
||||
_keybindingWidgets.list = new QListWidget;
|
||||
_keybindingWidgets.list->setToolTip(
|
||||
@@ -311,7 +330,7 @@ void ActionDialog::createKeyboardWidgets(QGridLayout* layout) {
|
||||
_keybindingWidgets.altModifier = new QCheckBox("Alt");
|
||||
_keybindingWidgets.altModifier->setEnabled(false);
|
||||
containerLayout->addWidget(_keybindingWidgets.altModifier);
|
||||
layout->addWidget(container, 10, 2);
|
||||
layout->addWidget(container, 10, 2, 1, 2);
|
||||
}
|
||||
|
||||
layout->addWidget(new QLabel("Key"), 11, 1);
|
||||
@@ -342,7 +361,7 @@ void ActionDialog::createKeyboardWidgets(QGridLayout* layout) {
|
||||
);
|
||||
}
|
||||
);
|
||||
layout->addWidget(_keybindingWidgets.key, 11, 2);
|
||||
layout->addWidget(_keybindingWidgets.key, 11, 2, 1, 2);
|
||||
|
||||
layout->addWidget(new QLabel("Action chooser"), 12, 1);
|
||||
_keybindingWidgets.action = new QComboBox;
|
||||
@@ -361,7 +380,7 @@ void ActionDialog::createKeyboardWidgets(QGridLayout* layout) {
|
||||
);
|
||||
|
||||
_keybindingWidgets.action->setEnabled(false);
|
||||
layout->addWidget(_keybindingWidgets.action, 12, 2);
|
||||
layout->addWidget(_keybindingWidgets.action, 12, 2, 1, 2);
|
||||
|
||||
layout->addWidget(new QLabel("Action"), 13, 1);
|
||||
_keybindingWidgets.actionText = new QLineEdit;
|
||||
@@ -376,7 +395,7 @@ void ActionDialog::createKeyboardWidgets(QGridLayout* layout) {
|
||||
"at startup"
|
||||
);
|
||||
_keybindingWidgets.actionText->setEnabled(false);
|
||||
layout->addWidget(_keybindingWidgets.actionText, 13, 2);
|
||||
layout->addWidget(_keybindingWidgets.actionText, 13, 2, 1, 2);
|
||||
|
||||
|
||||
// +/- buttons
|
||||
@@ -424,13 +443,7 @@ void ActionDialog::createKeyboardWidgets(QGridLayout* layout) {
|
||||
this, &ActionDialog::keybindingRejected
|
||||
);
|
||||
|
||||
layout->addWidget(_keybindingWidgets.saveButtons, 14, 2, Qt::AlignRight);
|
||||
}
|
||||
|
||||
void ActionDialog::applyChanges() {
|
||||
*_actions = std::move(_actionData);
|
||||
*_keybindings = std::move(_keybindingsData);
|
||||
accept();
|
||||
layout->addWidget(_keybindingWidgets.saveButtons, 14, 2, 1, 2, Qt::AlignRight);
|
||||
}
|
||||
|
||||
Profile::Action* ActionDialog::selectedAction() {
|
||||
@@ -476,6 +489,10 @@ void ActionDialog::actionRemove() {
|
||||
_keybindingsData.erase(_keybindingsData.begin() + i);
|
||||
delete _keybindingWidgets.list->takeItem(static_cast<int>(i));
|
||||
i--;
|
||||
//Save the updated keybindings to the profile
|
||||
if (_keybindings) {
|
||||
*_keybindings = _keybindingsData;
|
||||
}
|
||||
}
|
||||
else {
|
||||
// If the user chooses 'No' at least once, we have to bail
|
||||
@@ -494,6 +511,10 @@ void ActionDialog::actionRemove() {
|
||||
_keybindingWidgets.action->addItem(QString::fromStdString(a.identifier));
|
||||
}
|
||||
clearKeybindingFields();
|
||||
//Save the updated actions to the profile
|
||||
if (_actions) {
|
||||
*_actions = _actionData;
|
||||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -523,9 +544,10 @@ void ActionDialog::actionSelected() {
|
||||
_actionWidgets.addButton->setEnabled(false);
|
||||
_actionWidgets.removeButton->setEnabled(true);
|
||||
_actionWidgets.saveButtons->setEnabled(true);
|
||||
if (_mainButtons) {
|
||||
_mainButtons->setEnabled(false);
|
||||
if (_mainButton) {
|
||||
_mainButton->setEnabled(false);
|
||||
}
|
||||
_actionWidgets.list->setEnabled(false);
|
||||
}
|
||||
else {
|
||||
// No action selected
|
||||
@@ -533,9 +555,10 @@ void ActionDialog::actionSelected() {
|
||||
_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);
|
||||
if (_mainButton && !_keybindingWidgets.saveButtons->isEnabled()) {
|
||||
_mainButton->setEnabled(true);
|
||||
}
|
||||
_actionWidgets.list->setEnabled(true);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -594,7 +617,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();
|
||||
@@ -606,6 +633,10 @@ void ActionDialog::actionSaved() {
|
||||
for (const Profile::Action& a : _actionData) {
|
||||
_keybindingWidgets.action->addItem(QString::fromStdString(a.identifier));
|
||||
}
|
||||
//Save the updated actions to the profile
|
||||
if (_actions) {
|
||||
*_actions = _actionData;
|
||||
}
|
||||
clearKeybindingFields();
|
||||
clearActionFields();
|
||||
}
|
||||
@@ -614,6 +645,8 @@ void ActionDialog::clearActionFields() {
|
||||
_actionWidgets.list->setCurrentRow(-1);
|
||||
_actionWidgets.identifier->clear();
|
||||
_actionWidgets.identifier->setEnabled(false);
|
||||
_actionWidgets.infoText->clear();
|
||||
_actionWidgets.infoText->setHidden(true);
|
||||
_actionWidgets.name->clear();
|
||||
_actionWidgets.name->setEnabled(false);
|
||||
_actionWidgets.guiPath->clear();
|
||||
@@ -626,6 +659,7 @@ void ActionDialog::clearActionFields() {
|
||||
_actionWidgets.script->clear();
|
||||
_actionWidgets.script->setEnabled(false);
|
||||
_actionWidgets.saveButtons->setEnabled(false);
|
||||
_actionWidgets.list->setEnabled(true);
|
||||
}
|
||||
|
||||
void ActionDialog::actionRejected() {
|
||||
@@ -640,12 +674,17 @@ void ActionDialog::actionRejected() {
|
||||
|
||||
void ActionDialog::chooseScripts() {
|
||||
ScriptlogDialog d(this);
|
||||
connect(&d, &ScriptlogDialog::scriptsSelected, this, &ActionDialog::appendScriptsToTextfield);
|
||||
connect(
|
||||
&d, &ScriptlogDialog::scriptsSelected,
|
||||
this, &ActionDialog::appendScriptsToTextfield
|
||||
);
|
||||
d.exec();
|
||||
}
|
||||
|
||||
void ActionDialog::appendScriptsToTextfield(std::string scripts) {
|
||||
_actionWidgets.script->append(QString::fromStdString(std::move(scripts)));
|
||||
void ActionDialog::appendScriptsToTextfield(std::vector<std::string> scripts) {
|
||||
for (std::string script : scripts) {
|
||||
_actionWidgets.script->append(QString::fromStdString(std::move(script)));
|
||||
}
|
||||
}
|
||||
|
||||
Profile::Keybinding* ActionDialog::selectedKeybinding() {
|
||||
@@ -671,6 +710,10 @@ void ActionDialog::keybindingRemove() {
|
||||
clearKeybindingFields();
|
||||
_keybindingsData.erase(_keybindingsData.begin() + i);
|
||||
delete _keybindingWidgets.list->takeItem(static_cast<int>(i));
|
||||
//Save the updated keybindings to the profile
|
||||
if (_keybindings) {
|
||||
*_keybindings = _keybindingsData;
|
||||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -712,9 +755,10 @@ void ActionDialog::keybindingSelected() {
|
||||
_keybindingWidgets.saveButtons->button(QDialogButtonBox::Save)->setEnabled(
|
||||
_keybindingWidgets.key->currentIndex() > 0
|
||||
);
|
||||
if (_mainButtons) {
|
||||
_mainButtons->setEnabled(false);
|
||||
if (_mainButton) {
|
||||
_mainButton->setEnabled(false);
|
||||
}
|
||||
_keybindingWidgets.list->setEnabled(false);
|
||||
}
|
||||
else {
|
||||
// No keybinding selected
|
||||
@@ -722,9 +766,10 @@ void ActionDialog::keybindingSelected() {
|
||||
_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);
|
||||
if (_mainButton && !_actionWidgets.saveButtons->isEnabled()) {
|
||||
_mainButton->setEnabled(true);
|
||||
}
|
||||
_keybindingWidgets.list->setEnabled(true);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -762,6 +807,10 @@ void ActionDialog::keybindingSaved() {
|
||||
keybinding->action = _keybindingWidgets.actionText->text().toStdString();
|
||||
|
||||
updateListItem(_keybindingWidgets.list->currentItem(), *keybinding);
|
||||
//Save the updated keybindings to the profile
|
||||
if (_keybindings) {
|
||||
*_keybindings = _keybindingsData;
|
||||
}
|
||||
clearKeybindingFields();
|
||||
}
|
||||
|
||||
@@ -779,6 +828,7 @@ void ActionDialog::clearKeybindingFields() {
|
||||
_keybindingWidgets.action->setEnabled(false);
|
||||
_keybindingWidgets.actionText->clear();
|
||||
_keybindingWidgets.actionText->setEnabled(false);
|
||||
_keybindingWidgets.list->setEnabled(true);
|
||||
}
|
||||
|
||||
void ActionDialog::keybindingRejected() {
|
||||
|
||||
@@ -109,6 +109,8 @@ void AdditionalScriptsDialog::chooseScripts() {
|
||||
d.exec();
|
||||
}
|
||||
|
||||
void AdditionalScriptsDialog::appendScriptsToTextfield(std::string scripts) {
|
||||
_textScripts->append(QString::fromStdString(std::move(scripts)));
|
||||
void AdditionalScriptsDialog::appendScriptsToTextfield(std::vector<std::string> scripts) {
|
||||
for (std::string script : scripts) {
|
||||
_textScripts->append(QString::fromStdString(std::move(script)));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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()
|
||||
@@ -734,9 +734,8 @@ bool HorizonsDialog::handleRequest() {
|
||||
std::string newName = _horizonsFile.file().filename().stem().string();
|
||||
|
||||
std::filesystem::path oldFile = _horizonsFile.file();
|
||||
std::filesystem::path newFile = _horizonsFile.file().replace_filename(
|
||||
newName + "_error.txt"
|
||||
);
|
||||
std::filesystem::path newFile = oldFile;
|
||||
newFile.replace_filename(newName + "_error.txt");
|
||||
|
||||
std::filesystem::rename(oldFile, newFile);
|
||||
|
||||
|
||||
@@ -38,7 +38,6 @@
|
||||
MarkNodesDialog::MarkNodesDialog(QWidget* parent, std::vector<std::string>* markedNodes)
|
||||
: QDialog(parent)
|
||||
, _markedNodes(markedNodes)
|
||||
, _markedNodesData(*_markedNodes)
|
||||
{
|
||||
setWindowTitle("Mark Interesting Nodes");
|
||||
createWidgets();
|
||||
@@ -55,13 +54,13 @@ void MarkNodesDialog::createWidgets() {
|
||||
);
|
||||
_list->setAlternatingRowColors(true);
|
||||
_list->setMovement(QListView::Free);
|
||||
_list->setDragDropMode(QListView::InternalMove);
|
||||
_list->setResizeMode(QListView::Adjust);
|
||||
|
||||
for (size_t i = 0; i < _markedNodesData.size(); ++i) {
|
||||
_markedNodesListItems.push_back(
|
||||
new QListWidgetItem(QString::fromStdString(_markedNodesData[i]))
|
||||
);
|
||||
_list->addItem(_markedNodesListItems[i]);
|
||||
for (size_t i = 0; i < _markedNodes->size(); ++i) {
|
||||
QListWidgetItem* item =
|
||||
new QListWidgetItem(QString::fromStdString(_markedNodes->at(i)));
|
||||
_list->addItem(item);
|
||||
}
|
||||
layout->addWidget(_list);
|
||||
|
||||
@@ -102,23 +101,11 @@ void MarkNodesDialog::listItemAdded() {
|
||||
}
|
||||
|
||||
std::string itemToAdd = _newNode->text().toStdString();
|
||||
const auto it = std::find(
|
||||
_markedNodesData.cbegin(), _markedNodesData.cend(),
|
||||
itemToAdd
|
||||
);
|
||||
if (it != _markedNodesData.end()) {
|
||||
_list->setCurrentRow(
|
||||
static_cast<int>(std::distance(_markedNodesData.cbegin(), it))
|
||||
);
|
||||
}
|
||||
else {
|
||||
_markedNodesData.push_back(itemToAdd);
|
||||
_markedNodesListItems.push_back(new QListWidgetItem(_newNode->text()));
|
||||
_list->addItem(_markedNodesListItems.back());
|
||||
QListWidgetItem* item = new QListWidgetItem(_newNode->text());
|
||||
_list->addItem(item);
|
||||
|
||||
// Scroll down to that blank line highlighted
|
||||
_list->setCurrentItem(_markedNodesListItems.back());
|
||||
}
|
||||
// Scroll down to that blank line highlighted
|
||||
_list->setCurrentItem(item);
|
||||
|
||||
// Blank-out entry again
|
||||
_newNode->clear();
|
||||
@@ -127,18 +114,16 @@ void MarkNodesDialog::listItemAdded() {
|
||||
void MarkNodesDialog::listItemRemove() {
|
||||
QListWidgetItem* item = _list->currentItem();
|
||||
int index = _list->row(item);
|
||||
|
||||
if (index < 0 || index >= static_cast<int>(_markedNodesListItems.size())) {
|
||||
return;
|
||||
}
|
||||
|
||||
_list->takeItem(index);
|
||||
_markedNodesData.erase(_markedNodesData.begin() + index);
|
||||
_markedNodesListItems.erase(_markedNodesListItems.begin() + index);
|
||||
}
|
||||
|
||||
void MarkNodesDialog::parseSelections() {
|
||||
*_markedNodes = std::move(_markedNodesData);
|
||||
std::vector<std::string> nodes;
|
||||
for (int i = 0; i < _list->count(); i++) {
|
||||
QString node = _list->item(i)->text();
|
||||
nodes.push_back(node.toStdString());
|
||||
}
|
||||
*_markedNodes = std::move(nodes);
|
||||
accept();
|
||||
}
|
||||
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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)
|
||||
));
|
||||
|
||||
@@ -25,6 +25,7 @@
|
||||
#include "profile/propertiesdialog.h"
|
||||
|
||||
#include "profile/line.h"
|
||||
#include "profile/scriptlogdialog.h"
|
||||
#include <ghoul/filesystem/filesystem.h>
|
||||
#include <QComboBox>
|
||||
#include <QDialogButtonBox>
|
||||
@@ -92,17 +93,17 @@ void PropertiesDialog::createWidgets() {
|
||||
|
||||
box->addStretch();
|
||||
|
||||
layout->addLayout(box);
|
||||
}
|
||||
layout->addWidget(new Line);
|
||||
{
|
||||
_fillFromScriptLog = new QPushButton("Fill from ScriptLog");
|
||||
connect(
|
||||
_fillFromScriptLog, &QPushButton::clicked,
|
||||
this, &PropertiesDialog::selectLineFromScriptLog
|
||||
);
|
||||
layout->addWidget(_fillFromScriptLog);
|
||||
box->addWidget(_fillFromScriptLog);
|
||||
|
||||
layout->addLayout(box);
|
||||
}
|
||||
layout->addWidget(new Line);
|
||||
{
|
||||
_commandLabel = new QLabel("Property Set Command");
|
||||
layout->addWidget(_commandLabel);
|
||||
|
||||
@@ -339,7 +340,6 @@ void PropertiesDialog::transitionFromEditMode() {
|
||||
}
|
||||
|
||||
void PropertiesDialog::editBoxDisabled(bool disabled) {
|
||||
_fillFromScriptLog->setDisabled(disabled);
|
||||
_commandLabel->setDisabled(disabled);
|
||||
_commandCombo->setDisabled(disabled);
|
||||
_propertyLabel->setDisabled(disabled);
|
||||
@@ -374,91 +374,52 @@ void PropertiesDialog::keyPressEvent(QKeyEvent* evt) {
|
||||
}
|
||||
|
||||
void PropertiesDialog::selectLineFromScriptLog() {
|
||||
QComboBox* comboBox = new QComboBox;
|
||||
|
||||
QFile file(QString::fromStdString(absPath("${LOGS}/scriptLog.txt").string()));
|
||||
if (file.open(QIODevice::ReadOnly | QIODevice::Text)) {
|
||||
QTextStream in(&file);
|
||||
while (!in.atEnd()) {
|
||||
QString line = in.readLine();
|
||||
// removing return from a few statments
|
||||
// these are usually generated by gui panels
|
||||
line.remove(QRegularExpression("^return "));
|
||||
|
||||
if (line.isEmpty()) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!line.startsWith("openspace.setPropertyValue")) {
|
||||
continue;
|
||||
}
|
||||
|
||||
comboBox->addItem(line);
|
||||
}
|
||||
}
|
||||
|
||||
QDialog dialog;
|
||||
|
||||
ScriptlogDialog d(this, "openspace.setPropertyValue");
|
||||
connect(
|
||||
&dialog, &QDialog::finished,
|
||||
[this, comboBox](int result) {
|
||||
if (result == QDialog::Rejected) {
|
||||
return;
|
||||
&d, &ScriptlogDialog::scriptsSelected,
|
||||
[this](std::vector<std::string> scripts) {
|
||||
for (const std::string& script : scripts) {
|
||||
listItemAdded();
|
||||
|
||||
QString text = QString::fromStdString(script);
|
||||
if (!text.startsWith("openspace.setPropertyValue")) {
|
||||
return;
|
||||
}
|
||||
|
||||
// We have a string that is of the form:
|
||||
// openspace.setPropertyValue('prop', value);
|
||||
if (text.startsWith("openspace.setPropertyValueSingle")) {
|
||||
_commandCombo->setCurrentIndex(0);
|
||||
std::string_view prefix = "openspace.setPropertyValueSingle";
|
||||
text = text.mid(static_cast<int>(prefix.size()) + 1); // +1 for (
|
||||
}
|
||||
else {
|
||||
// command == "openspace.setPropertyValue"
|
||||
_commandCombo->setCurrentIndex(1);
|
||||
std::string_view prefix = "openspace.setPropertyValue";
|
||||
text = text.mid(static_cast<int>(prefix.size()) + 1); // +1 for (
|
||||
}
|
||||
|
||||
// Remove everything past the closing brace
|
||||
text = text.left(text.indexOf(")"));
|
||||
QStringList textList = text.split(",");
|
||||
|
||||
if (textList.size() < 2) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Remove the string markers around the property
|
||||
QString property = textList[0].mid(1, textList[0].size() - 2);
|
||||
|
||||
textList.removeFirst();
|
||||
QString value = textList.join(",");
|
||||
|
||||
|
||||
_propertyEdit->setText(property.trimmed());
|
||||
_valueEdit->setText(value.trimmed());
|
||||
listItemSave();
|
||||
}
|
||||
|
||||
QString text = comboBox->currentText();
|
||||
if (!text.startsWith("openspace.setPropertyValue")) {
|
||||
return;
|
||||
}
|
||||
|
||||
// We have a string that is of the form:
|
||||
// openspace.setPropertyValue('prop', value);
|
||||
|
||||
if (text.startsWith("openspace.setPropertyValueSingle")) {
|
||||
_commandCombo->setCurrentIndex(0);
|
||||
std::string_view prefix = "openspace.setPropertyValueSingle";
|
||||
text = text.mid(static_cast<int>(prefix.size()) + 1); // +1 for (
|
||||
}
|
||||
else {
|
||||
// command == "openspace.setPropertyValue"
|
||||
_commandCombo->setCurrentIndex(1);
|
||||
std::string_view prefix = "openspace.setPropertyValue";
|
||||
text = text.mid(static_cast<int>(prefix.size()) + 1); // +1 for (
|
||||
}
|
||||
|
||||
// Remove everything past the closing brace
|
||||
text = text.left(text.indexOf(")"));
|
||||
QStringList textList = text.split(",");
|
||||
|
||||
if (textList.size() < 2) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Remove the string markers around the property
|
||||
QString property = textList[0].mid(1, textList[0].size() - 2);
|
||||
|
||||
textList.removeFirst();
|
||||
QString value = textList.join(",");
|
||||
|
||||
|
||||
_propertyEdit->setText(property.trimmed());
|
||||
_valueEdit->setText(value.trimmed());
|
||||
}
|
||||
);
|
||||
|
||||
QLayout* layout = new QVBoxLayout;
|
||||
QLabel* label = new QLabel("Select a line from the Script Log to add");
|
||||
layout->addWidget(label);
|
||||
|
||||
layout->addWidget(comboBox);
|
||||
|
||||
QDialogButtonBox* bb = new QDialogButtonBox(
|
||||
QDialogButtonBox::Ok | QDialogButtonBox::Cancel
|
||||
);
|
||||
connect(bb, &QDialogButtonBox::accepted, &dialog, &QDialog::accept);
|
||||
connect(bb, &QDialogButtonBox::rejected, &dialog, &QDialog::reject);
|
||||
layout->addWidget(bb);
|
||||
|
||||
dialog.setLayout(layout);
|
||||
dialog.exec();
|
||||
d.exec();
|
||||
}
|
||||
|
||||
@@ -32,6 +32,7 @@
|
||||
#include <ghoul/fmt.h>
|
||||
#include <QGridLayout>
|
||||
#include <QDialogButtonBox>
|
||||
#include <QFileDialog>
|
||||
#include <QLabel>
|
||||
#include <QLineEdit>
|
||||
#include <QListWidget>
|
||||
@@ -39,8 +40,10 @@
|
||||
#include <QPushButton>
|
||||
#include <QTextStream>
|
||||
|
||||
ScriptlogDialog::ScriptlogDialog(QWidget* parent)
|
||||
ScriptlogDialog::ScriptlogDialog(QWidget* parent, std::string filter)
|
||||
: QDialog(parent)
|
||||
, _scriptLogFile(openspace::global::configuration->scriptLog)
|
||||
, _fixedFilter(std::move(filter))
|
||||
{
|
||||
setWindowTitle("Scriptlog");
|
||||
createWidgets();
|
||||
@@ -63,10 +66,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 +124,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);
|
||||
@@ -126,7 +152,10 @@ void ScriptlogDialog::updateScriptList() {
|
||||
int index = -1;
|
||||
_scriptlogList->clear();
|
||||
for (const std::string& script : _scripts) {
|
||||
if (script.find(filter) != std::string::npos) {
|
||||
bool foundDynamic = script.find(filter) != std::string::npos;
|
||||
bool foundStatic =
|
||||
_fixedFilter.empty() ? true : script.find(_fixedFilter) != std::string::npos;
|
||||
if (foundDynamic && foundStatic) {
|
||||
if (script == selection && index == -1) {
|
||||
index = _scriptlogList->count();
|
||||
}
|
||||
@@ -136,15 +165,11 @@ void ScriptlogDialog::updateScriptList() {
|
||||
}
|
||||
|
||||
void ScriptlogDialog::saveChosenScripts() {
|
||||
std::string chosenScripts;
|
||||
std::vector<std::string> chosenScripts;
|
||||
QList<QListWidgetItem*> itemList = _scriptlogList->selectedItems();
|
||||
for (int i = 0; i < itemList.size(); ++i) {
|
||||
chosenScripts += itemList.at(i)->text().toStdString();
|
||||
if (i < itemList.size()) {
|
||||
chosenScripts += "\n";
|
||||
}
|
||||
for (QListWidgetItem* item : _scriptlogList->selectedItems()) {
|
||||
chosenScripts.push_back(item->text().toStdString());
|
||||
}
|
||||
emit scriptsSelected(chosenScripts);
|
||||
|
||||
accept();
|
||||
}
|
||||
|
||||
@@ -25,6 +25,7 @@
|
||||
#include "profile/timedialog.h"
|
||||
|
||||
#include "profile/line.h"
|
||||
#include <QCheckBox>
|
||||
#include <QComboBox>
|
||||
#include <QDateTimeEdit>
|
||||
#include <QDialogButtonBox>
|
||||
@@ -52,7 +53,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);
|
||||
@@ -62,6 +64,8 @@ TimeDialog::TimeDialog(QWidget* parent, std::optional<openspace::Profile::Time>*
|
||||
_timeData.type = Profile::Time::Type::Relative;
|
||||
_timeData.value = "0d";
|
||||
}
|
||||
_startPaused->setChecked(_timeData.startPaused);
|
||||
|
||||
_initializedAsAbsolute = (_timeData.type == Profile::Time::Type::Absolute);
|
||||
enableAccordingToType(static_cast<int>(_timeData.type));
|
||||
}
|
||||
@@ -97,6 +101,14 @@ void TimeDialog::createWidgets() {
|
||||
);
|
||||
layout->addWidget(_relativeEdit);
|
||||
}
|
||||
{
|
||||
_startPaused = new QCheckBox("Start with time paused");
|
||||
_startPaused->setChecked(false);
|
||||
_startPaused->setToolTip(
|
||||
"If this is checked, the profile will start with the delta time paused"
|
||||
);
|
||||
layout->addWidget(_startPaused);
|
||||
}
|
||||
layout->addWidget(new Line);
|
||||
{
|
||||
QDialogButtonBox* buttons = new QDialogButtonBox;
|
||||
@@ -152,6 +164,7 @@ void TimeDialog::approved() {
|
||||
Profile::Time t;
|
||||
t.type = Profile::Time::Type::Relative;
|
||||
t.value = _relativeEdit->text().toStdString();
|
||||
t.startPaused = _startPaused->isChecked();
|
||||
*_time = t;
|
||||
}
|
||||
}
|
||||
@@ -163,6 +176,7 @@ void TimeDialog::approved() {
|
||||
_absoluteEdit->date().toString("yyyy-MM-dd").toStdString(),
|
||||
_absoluteEdit->time().toString().toStdString()
|
||||
);
|
||||
t.startPaused = _startPaused->isChecked();
|
||||
*_time = t;
|
||||
}
|
||||
accept();
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
@@ -277,13 +277,18 @@ sgct::config::Cluster SgctEdit::generateConfiguration() const {
|
||||
window.tags.push_back("GUI");
|
||||
window.draw2D = true;
|
||||
window.draw3D = false;
|
||||
|
||||
// Disable 2D rendering on all non-GUI windows
|
||||
for (size_t w = 1; w < node.windows.size(); ++w) {
|
||||
node.windows[w].draw2D = false;
|
||||
}
|
||||
}
|
||||
|
||||
cluster.nodes.push_back(node);
|
||||
|
||||
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;
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
+1
-1
Submodule apps/OpenSpace/ext/sgct updated: ad7ac43b19...2f82990b3d
+75
-66
@@ -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>
|
||||
@@ -52,7 +53,7 @@
|
||||
#include <sgct/user.h>
|
||||
#include <sgct/window.h>
|
||||
#include <stb_image.h>
|
||||
#include <Tracy.hpp>
|
||||
#include <tracy/Tracy.hpp>
|
||||
#include <iostream>
|
||||
#include <string_view>
|
||||
|
||||
@@ -108,7 +109,7 @@ Window* FirstOpenVRWindow = nullptr;
|
||||
/**
|
||||
* This struct stores all information about a single render window. Depending on the
|
||||
* frame setup, each window can be mono or stereo, the information of which is stored in
|
||||
* the \c leftOrMain and \c right members respectively.
|
||||
* the `leftOrMain` and `right` members respectively.
|
||||
*/
|
||||
struct SpoutWindow {
|
||||
/// The left framebuffer (or main, if there is no stereo rendering)
|
||||
@@ -274,7 +275,7 @@ bool isGuiWindow(sgct::Window* window) {
|
||||
// Init function
|
||||
//
|
||||
void mainInitFunc(GLFWwindow*) {
|
||||
ZoneScoped
|
||||
ZoneScoped;
|
||||
|
||||
LTRACE("main::mainInitFunc(begin)");
|
||||
|
||||
@@ -391,7 +392,7 @@ void mainInitFunc(GLFWwindow*) {
|
||||
|
||||
|
||||
void mainPreSyncFunc() {
|
||||
ZoneScoped
|
||||
ZoneScoped;
|
||||
LTRACE("main::mainPreSyncFunc(begin)");
|
||||
|
||||
try {
|
||||
@@ -411,7 +412,7 @@ void mainPreSyncFunc() {
|
||||
|
||||
|
||||
void mainPostSyncPreDrawFunc() {
|
||||
ZoneScoped
|
||||
ZoneScoped;
|
||||
|
||||
#ifdef OPENSPACE_HAS_NVTOOLS
|
||||
nvtxRangePush("postSyncPreDraw");
|
||||
@@ -437,7 +438,7 @@ void mainPostSyncPreDrawFunc() {
|
||||
|
||||
|
||||
void mainRenderFunc(const sgct::RenderData& data) {
|
||||
ZoneScoped
|
||||
ZoneScoped;
|
||||
|
||||
#ifdef OPENSPACE_HAS_NVTOOLS
|
||||
nvtxRangePush("render");
|
||||
@@ -525,7 +526,7 @@ void mainRenderFunc(const sgct::RenderData& data) {
|
||||
|
||||
|
||||
void mainDraw2DFunc(const sgct::RenderData& data) {
|
||||
ZoneScoped
|
||||
ZoneScoped;
|
||||
LTRACE("main::mainDraw2DFunc(begin)");
|
||||
|
||||
currentWindow = &data.window;
|
||||
@@ -550,7 +551,7 @@ void mainDraw2DFunc(const sgct::RenderData& data) {
|
||||
|
||||
|
||||
void mainPostDrawFunc() {
|
||||
ZoneScoped
|
||||
ZoneScoped;
|
||||
LTRACE("main::mainPostDrawFunc(begin)");
|
||||
|
||||
#ifdef OPENVR_SUPPORT
|
||||
@@ -570,7 +571,7 @@ void mainPostDrawFunc() {
|
||||
void mainKeyboardCallback(sgct::Key key, sgct::Modifier modifiers, sgct::Action action,
|
||||
int, sgct::Window* window)
|
||||
{
|
||||
ZoneScoped
|
||||
ZoneScoped;
|
||||
LTRACE("main::mainKeyboardCallback(begin)");
|
||||
|
||||
const openspace::Key k = openspace::Key(key);
|
||||
@@ -588,7 +589,7 @@ void mainKeyboardCallback(sgct::Key key, sgct::Modifier modifiers, sgct::Action
|
||||
void mainMouseButtonCallback(sgct::MouseButton key, sgct::Modifier modifiers,
|
||||
sgct::Action action, sgct::Window* window)
|
||||
{
|
||||
ZoneScoped
|
||||
ZoneScoped;
|
||||
LTRACE("main::mainMouseButtonCallback(begin)");
|
||||
|
||||
const openspace::MouseButton k = openspace::MouseButton(key);
|
||||
@@ -604,7 +605,7 @@ void mainMouseButtonCallback(sgct::MouseButton key, sgct::Modifier modifiers,
|
||||
|
||||
|
||||
void mainMousePosCallback(double x, double y, sgct::Window* window) {
|
||||
ZoneScoped
|
||||
ZoneScoped;
|
||||
const IsGuiWindow isGui = IsGuiWindow(isGuiWindow(window));
|
||||
global::openSpaceEngine->mousePositionCallback(x, y, isGui);
|
||||
}
|
||||
@@ -612,7 +613,7 @@ void mainMousePosCallback(double x, double y, sgct::Window* window) {
|
||||
|
||||
|
||||
void mainMouseScrollCallback(double posX, double posY, sgct::Window* window) {
|
||||
ZoneScoped
|
||||
ZoneScoped;
|
||||
LTRACE("main::mainMouseScrollCallback(begin");
|
||||
|
||||
const IsGuiWindow isGui = IsGuiWindow(isGuiWindow(window));
|
||||
@@ -624,7 +625,7 @@ void mainMouseScrollCallback(double posX, double posY, sgct::Window* window) {
|
||||
|
||||
|
||||
void mainCharCallback(unsigned int codepoint, int modifiers, sgct::Window* window) {
|
||||
ZoneScoped
|
||||
ZoneScoped;
|
||||
|
||||
const KeyModifier m = KeyModifier(modifiers);
|
||||
const IsGuiWindow isGui = IsGuiWindow(isGuiWindow(window));
|
||||
@@ -646,7 +647,7 @@ void mainDropCallback(int amount, const char** paths) {
|
||||
|
||||
|
||||
std::vector<std::byte> mainEncodeFun() {
|
||||
ZoneScoped
|
||||
ZoneScoped;
|
||||
LTRACE("main::mainEncodeFun(begin)");
|
||||
|
||||
std::vector<std::byte> data = global::openSpaceEngine->encode();
|
||||
@@ -657,8 +658,8 @@ std::vector<std::byte> mainEncodeFun() {
|
||||
|
||||
|
||||
|
||||
void mainDecodeFun(const std::vector<std::byte>& data, unsigned int) {
|
||||
ZoneScoped
|
||||
void mainDecodeFun(const std::vector<std::byte>& data) {
|
||||
ZoneScoped;
|
||||
LTRACE("main::mainDecodeFun(begin)");
|
||||
|
||||
global::openSpaceEngine->decode(data);
|
||||
@@ -669,7 +670,7 @@ void mainDecodeFun(const std::vector<std::byte>& data, unsigned int) {
|
||||
|
||||
|
||||
void mainLogCallback(Log::Level level, std::string_view message) {
|
||||
ZoneScoped
|
||||
ZoneScoped;
|
||||
|
||||
switch (level) {
|
||||
case Log::Level::Debug:
|
||||
@@ -693,54 +694,52 @@ void setSgctDelegateFunctions() {
|
||||
WindowDelegate& sgctDelegate = *global::windowDelegate;
|
||||
sgctDelegate.terminate = []() { Engine::instance().terminate(); };
|
||||
sgctDelegate.setBarrier = [](bool enabled) {
|
||||
ZoneScoped
|
||||
ZoneScoped;
|
||||
|
||||
sgct::Window::setBarrier(enabled);
|
||||
};
|
||||
sgctDelegate.setSynchronization = [](bool enabled) {
|
||||
ZoneScoped
|
||||
ZoneScoped;
|
||||
|
||||
sgct::ClusterManager::instance().setUseIgnoreSync(enabled);
|
||||
};
|
||||
sgctDelegate.windowHasResized = []() {
|
||||
ZoneScoped
|
||||
ZoneScoped;
|
||||
|
||||
return currentWindow->isWindowResized();
|
||||
};
|
||||
sgctDelegate.averageDeltaTime = []() {
|
||||
ZoneScoped
|
||||
ZoneScoped;
|
||||
|
||||
return Engine::instance().statistics().avgDt(
|
||||
Engine::instance().currentFrameNumber()
|
||||
);
|
||||
return Engine::instance().statistics().avgDt();
|
||||
};
|
||||
sgctDelegate.minDeltaTime = []() {
|
||||
ZoneScoped
|
||||
ZoneScoped;
|
||||
|
||||
return Engine::instance().statistics().minDt();
|
||||
};
|
||||
sgctDelegate.maxDeltaTime = []() {
|
||||
ZoneScoped
|
||||
ZoneScoped;
|
||||
|
||||
return Engine::instance().statistics().maxDt();
|
||||
};
|
||||
sgctDelegate.deltaTime = []() {
|
||||
ZoneScoped
|
||||
ZoneScoped;
|
||||
|
||||
return Engine::instance().statistics().dt();
|
||||
};
|
||||
sgctDelegate.applicationTime = []() {
|
||||
ZoneScoped
|
||||
ZoneScoped;
|
||||
|
||||
return sgct::Engine::getTime();
|
||||
return time();
|
||||
};
|
||||
sgctDelegate.currentWindowSize = []() {
|
||||
ZoneScoped
|
||||
ZoneScoped;
|
||||
|
||||
return glm::ivec2(currentWindow->resolution().x, currentWindow->resolution().y);
|
||||
};
|
||||
sgctDelegate.currentSubwindowSize = []() {
|
||||
ZoneScoped
|
||||
ZoneScoped;
|
||||
|
||||
if (currentWindow->viewports().size() > 1) {
|
||||
const Viewport& viewport = *currentWindow->viewports().front();
|
||||
@@ -770,7 +769,7 @@ void setSgctDelegateFunctions() {
|
||||
}
|
||||
};
|
||||
sgctDelegate.currentDrawBufferResolution = []() {
|
||||
ZoneScoped
|
||||
ZoneScoped;
|
||||
|
||||
Viewport* viewport = currentWindow->viewports().front().get();
|
||||
if (viewport != nullptr) {
|
||||
@@ -792,7 +791,7 @@ void setSgctDelegateFunctions() {
|
||||
return glm::ivec2(-1, -1);
|
||||
};
|
||||
sgctDelegate.currentViewportSize = []() {
|
||||
ZoneScoped
|
||||
ZoneScoped;
|
||||
|
||||
if (currentViewport != nullptr) {
|
||||
vec2 size = currentViewport->size();
|
||||
@@ -801,13 +800,13 @@ void setSgctDelegateFunctions() {
|
||||
return glm::ivec2(-1, -1);
|
||||
};
|
||||
sgctDelegate.dpiScaling = []() {
|
||||
ZoneScoped
|
||||
ZoneScoped;
|
||||
|
||||
vec2 scale = currentWindow->scale();
|
||||
return glm::vec2(scale.x, scale.y);
|
||||
};
|
||||
sgctDelegate.osDpiScaling = []() {
|
||||
ZoneScoped
|
||||
ZoneScoped;
|
||||
|
||||
// Detect which DPI scaling to use
|
||||
// 1. If there is a GUI window, use the GUI window's content scale value
|
||||
@@ -837,7 +836,7 @@ void setSgctDelegateFunctions() {
|
||||
return scale.x;
|
||||
};
|
||||
sgctDelegate.hasGuiWindow = []() {
|
||||
ZoneScoped
|
||||
ZoneScoped;
|
||||
|
||||
for (const std::unique_ptr<Window>& window : Engine::instance().windows()) {
|
||||
if (window->hasTag("GUI")) {
|
||||
@@ -847,70 +846,74 @@ void setSgctDelegateFunctions() {
|
||||
return false;
|
||||
};
|
||||
sgctDelegate.isGuiWindow = []() {
|
||||
ZoneScoped
|
||||
ZoneScoped;
|
||||
|
||||
return currentWindow->hasTag("GUI");
|
||||
};
|
||||
sgctDelegate.isMaster = []() {
|
||||
ZoneScoped
|
||||
ZoneScoped;
|
||||
|
||||
return Engine::instance().isMaster();
|
||||
};
|
||||
sgctDelegate.modelMatrix = []() {
|
||||
ZoneScoped
|
||||
ZoneScoped;
|
||||
|
||||
return currentModelMatrix;
|
||||
};
|
||||
sgctDelegate.setNearFarClippingPlane = [](float nearPlane, float farPlane) {
|
||||
ZoneScoped
|
||||
ZoneScoped;
|
||||
|
||||
Engine::instance().setNearAndFarClippingPlanes(nearPlane, farPlane);
|
||||
};
|
||||
sgctDelegate.isFisheyeRendering = []() {
|
||||
ZoneScoped
|
||||
ZoneScoped;
|
||||
|
||||
return dynamic_cast<FisheyeProjection*>(
|
||||
currentWindow->viewports().front()->nonLinearProjection()
|
||||
) != nullptr;
|
||||
};
|
||||
sgctDelegate.takeScreenshot = [](bool applyWarping, std::vector<int> windowIds) {
|
||||
ZoneScoped
|
||||
ZoneScoped;
|
||||
|
||||
Settings::instance().setCaptureFromBackBuffer(applyWarping);
|
||||
Engine::instance().takeScreenshot(std::move(windowIds));
|
||||
return Engine::instance().screenShotNumber();
|
||||
};
|
||||
sgctDelegate.resetScreenshotNumber = []() {
|
||||
ZoneScoped;
|
||||
Engine::instance().resetScreenshotNumber();
|
||||
};
|
||||
sgctDelegate.swapBuffer = []() {
|
||||
ZoneScoped
|
||||
ZoneScoped;
|
||||
|
||||
GLFWwindow* w = glfwGetCurrentContext();
|
||||
glfwSwapBuffers(w);
|
||||
glfwPollEvents();
|
||||
};
|
||||
sgctDelegate.nWindows = []() {
|
||||
ZoneScoped
|
||||
ZoneScoped;
|
||||
|
||||
return static_cast<int>(Engine::instance().windows().size());
|
||||
};
|
||||
sgctDelegate.currentWindowId = []() {
|
||||
ZoneScoped
|
||||
ZoneScoped;
|
||||
|
||||
return currentWindow->id();
|
||||
};
|
||||
sgctDelegate.openGLProcedureAddress = [](const char* func) {
|
||||
ZoneScoped
|
||||
ZoneScoped;
|
||||
|
||||
return glfwGetProcAddress(func);
|
||||
};
|
||||
sgctDelegate.getHorizFieldOfView = []() {
|
||||
ZoneScoped
|
||||
ZoneScoped;
|
||||
|
||||
return static_cast<double>(
|
||||
Engine::instance().windows().front()->horizFieldOfViewDegrees()
|
||||
);
|
||||
};
|
||||
sgctDelegate.setHorizFieldOfView = [](float hFovDeg) {
|
||||
ZoneScoped
|
||||
ZoneScoped;
|
||||
|
||||
for (std::unique_ptr<sgct::Window> const& w : Engine::instance().windows()) {
|
||||
w->setHorizFieldOfView(hFovDeg);
|
||||
@@ -918,7 +921,7 @@ void setSgctDelegateFunctions() {
|
||||
};
|
||||
#ifdef WIN32
|
||||
sgctDelegate.getNativeWindowHandle = [](size_t windowIndex) -> void* {
|
||||
ZoneScoped
|
||||
ZoneScoped;
|
||||
|
||||
Window* w = Engine::instance().windows()[windowIndex].get();
|
||||
if (w) {
|
||||
@@ -929,7 +932,7 @@ void setSgctDelegateFunctions() {
|
||||
};
|
||||
#endif // WIN32
|
||||
sgctDelegate.frustumMode = []() {
|
||||
ZoneScoped
|
||||
ZoneScoped;
|
||||
|
||||
switch (currentFrustumMode) {
|
||||
default:
|
||||
@@ -939,7 +942,7 @@ void setSgctDelegateFunctions() {
|
||||
}
|
||||
};
|
||||
sgctDelegate.swapGroupFrameNumber = []() -> uint64_t {
|
||||
ZoneScoped
|
||||
ZoneScoped;
|
||||
|
||||
return currentWindow->swapGroupFrameNumber();
|
||||
};
|
||||
@@ -1076,7 +1079,6 @@ int main(int argc, char* argv[]) {
|
||||
LogMgr.addLog(std::make_unique<ghoul::logging::VisualStudioOutputLog>());
|
||||
}
|
||||
#endif // WIN32
|
||||
|
||||
}
|
||||
|
||||
ghoul::initialize();
|
||||
@@ -1108,7 +1110,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 "
|
||||
@@ -1116,7 +1118,9 @@ int main(int argc, char* argv[]) {
|
||||
"configuration file without editing the file on disk, for example in a "
|
||||
"planetarium environment. Please not that the Lua script must not contain any - "
|
||||
"or they will be interpreted as a new command. Similar, in Bash, ${...} will be "
|
||||
"evaluated before it is passed to OpenSpace"
|
||||
"evaluated before it is passed to OpenSpace. Windows does not approve of using \""
|
||||
"either, so it is recommended to deliniate strings with [[ ]] instead. For "
|
||||
"example: OpenSpace --config Profile=[[jwst]]"
|
||||
));
|
||||
|
||||
// setCommandLine returns a reference to the vector that will be filled later
|
||||
@@ -1124,10 +1128,16 @@ int main(int argc, char* argv[]) {
|
||||
{ argv, argv + argc }
|
||||
);
|
||||
|
||||
bool showHelp = parser.execute();
|
||||
if (showHelp) {
|
||||
std::cout << parser.helpText();
|
||||
exit(EXIT_SUCCESS);
|
||||
try {
|
||||
bool showHelp = parser.execute();
|
||||
if (showHelp) {
|
||||
std::cout << parser.helpText();
|
||||
exit(EXIT_SUCCESS);
|
||||
}
|
||||
}
|
||||
catch (const ghoul::RuntimeError& e) {
|
||||
LFATALC(e.component, e.message);
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
// Take an actual copy of the arguments
|
||||
std::vector<std::string> arguments = sgctArguments;
|
||||
@@ -1181,10 +1191,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
|
||||
@@ -1194,12 +1208,7 @@ int main(int argc, char* argv[]) {
|
||||
}
|
||||
catch (const documentation::SpecificationError& e) {
|
||||
LFATALC("main", "Loading of configuration file failed");
|
||||
for (const documentation::TestResult::Offense& o : e.result.offenses) {
|
||||
LERRORC(o.offender, ghoul::to_string(o.reason));
|
||||
}
|
||||
for (const documentation::TestResult::Warning& w : e.result.warnings) {
|
||||
LWARNINGC(w.offender, ghoul::to_string(w.reason));
|
||||
}
|
||||
logError(e);
|
||||
ghoul::deinitialize();
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
@@ -1366,7 +1375,7 @@ int main(int argc, char* argv[]) {
|
||||
Engine::instance().setSyncParameters(false, 15.f * 60.f);
|
||||
|
||||
LINFO("Starting rendering loop");
|
||||
Engine::instance().render();
|
||||
Engine::instance().exec();
|
||||
LINFO("Ending rendering loop");
|
||||
|
||||
global::openSpaceEngine->deinitializeGL();
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -30,11 +30,10 @@
|
||||
},
|
||||
{
|
||||
"fullscreen": true,
|
||||
"monitor": 1,
|
||||
"name": "OpenSpace",
|
||||
"draw2d": false,
|
||||
"stereo": "none",
|
||||
"pos": { "x": 0, "y": 0 },
|
||||
"pos": { "x": 1920, "y": 1080 },
|
||||
"size": { "x": 1920, "y": 1080 },
|
||||
"viewports": [
|
||||
{
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
"stereo": "none",
|
||||
"pos": { "x": 50, "y": 50 },
|
||||
"size": { "x": 1280, "y": 720 },
|
||||
"res": { "x": 2560, "y": 1440 },
|
||||
"viewports": [
|
||||
{
|
||||
"tracked": true,
|
||||
|
||||
@@ -0,0 +1,71 @@
|
||||
{
|
||||
"version": 1,
|
||||
"masteraddress": "localhost",
|
||||
"externalcontrolport": 20500,
|
||||
"settings": {
|
||||
"display": {
|
||||
"swapinterval": 0
|
||||
}
|
||||
},
|
||||
"nodes": [
|
||||
{
|
||||
"address": "localhost",
|
||||
"port": 20401,
|
||||
"windows": [
|
||||
{
|
||||
"name": "GUI",
|
||||
"tags": [ "GUI" ],
|
||||
"fullscreen": false,
|
||||
"draw3d": false,
|
||||
"blitwindowid": 1,
|
||||
"stereo": "none",
|
||||
"pos": { "x": 50, "y": 50 },
|
||||
"size": { "x": 1280, "y": 720 },
|
||||
"viewports": [
|
||||
{
|
||||
"pos": { "x": 0.0, "y": 0.0 },
|
||||
"size": { "x": 1.0, "y": 1.0 },
|
||||
"projection": {
|
||||
"type": "PlanarProjection",
|
||||
"fov": {
|
||||
"hfov": 80.0,
|
||||
"vfov": 50.534015846724
|
||||
},
|
||||
"orientation": { "yaw": 0.0, "pitch": 0.0, "roll": 0.0 }
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "OpenSpace",
|
||||
"fullscreen": false,
|
||||
"draw2d": false,
|
||||
"stereo": "none",
|
||||
"pos": { "x": 50, "y": 50 },
|
||||
"size": { "x": 1280, "y": 720 },
|
||||
"viewports": [
|
||||
{
|
||||
"tracked": true,
|
||||
"pos": { "x": 0.0, "y": 0.0 },
|
||||
"size": { "x": 1.0, "y": 1.0 },
|
||||
"projection": {
|
||||
"type": "PlanarProjection",
|
||||
"fov": {
|
||||
"hfov": 80.0,
|
||||
"vfov": 50.534015846724
|
||||
},
|
||||
"orientation": { "yaw": 0.0, "pitch": 0.0, "roll": 0.0 }
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"users": [
|
||||
{
|
||||
"eyeseparation": 0.065,
|
||||
"pos": { "x": 0.0, "y": 0.0, "z": 0.0 }
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -25,7 +25,8 @@
|
||||
"pos": { "x": 0.0, "y": 0.0 },
|
||||
"size": { "x": 1.0, "y": 1.0 },
|
||||
"projection": {
|
||||
"PlanarProjection": {
|
||||
"type": "SpoutFlatProjection",
|
||||
"planarprojection": {
|
||||
"fov": {
|
||||
"hfov": 80.0,
|
||||
"vfov": 50.534015846724
|
||||
@@ -38,11 +39,10 @@
|
||||
"b": 0.1,
|
||||
"a": 1.0
|
||||
},
|
||||
"drawMain": true,
|
||||
"height": "1080",
|
||||
"drawmain": true,
|
||||
"height": 1080,
|
||||
"mappingspoutname": "OS_FLAT",
|
||||
"type": "SpoutFlatProjection",
|
||||
"width": "1920"
|
||||
"width": 1920
|
||||
}
|
||||
}
|
||||
]
|
||||
|
||||
@@ -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"
|
||||
}
|
||||
@@ -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"
|
||||
}
|
||||
@@ -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")
|
||||
|
||||
@@ -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,12 @@ 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.require("modules/touch/default_settings")
|
||||
|
||||
|
||||
asset.onInitialize(function ()
|
||||
webGui.setCefRoute("onscreen")
|
||||
openspace.setDefaultGuiSorting()
|
||||
|
||||
@@ -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,,,,,,
|
||||
|
||||
|
@@ -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)
|
||||
|
||||
@@ -58,6 +58,11 @@ local elapsed_time = {
|
||||
ReferenceTime = "2022-10-12 12:00:00"
|
||||
}
|
||||
|
||||
local input_state = {
|
||||
Type = "DashboardItemInputState",
|
||||
Identifier = "InputState"
|
||||
}
|
||||
|
||||
asset.onInitialize(function()
|
||||
openspace.dashboard.addDashboardItem(angle)
|
||||
openspace.dashboard.addDashboardItem(date)
|
||||
@@ -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)
|
||||
|
||||
@@ -1,17 +1,26 @@
|
||||
local bookmarkHelper = asset.require("util/generate_bookmarks")
|
||||
|
||||
-- Most of the local bookmarks we are loading are relative to the Earth so we should
|
||||
-- ensure that it is loaded first
|
||||
asset.require("scene/solarsystem/planets/earth/earth")
|
||||
|
||||
local nodes = bookmarkHelper.getBookmarks("Local Bookmarks", "${ASSETS}/customization/localbookmarks.csv")
|
||||
|
||||
|
||||
asset.onInitialize(function()
|
||||
for _, n in ipairs(nodes) do
|
||||
openspace.addSceneGraphNode(n)
|
||||
local success, error = pcall(openspace.addSceneGraphNode, n)
|
||||
if not success then
|
||||
openspace.printError(error)
|
||||
end
|
||||
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)
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@ local DataPath = asset.syncedResource({
|
||||
Name = "Exoplanet Data Files",
|
||||
Type = "HttpSynchronization",
|
||||
Identifier = "exoplanets_data",
|
||||
Version = 3
|
||||
Version = 4
|
||||
})
|
||||
|
||||
local colormaps = asset.syncedResource({
|
||||
@@ -30,7 +30,7 @@ asset.export("DataPath", DataPath)
|
||||
|
||||
asset.meta = {
|
||||
Name = "Exoplanet Data",
|
||||
Version = "3.0",
|
||||
Version = "4.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]],
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
asset.onInitialize(function ()
|
||||
-- Avoid errors for developers when building without the touch module
|
||||
if not openspace.modules.isLoaded("Touch") then
|
||||
return
|
||||
end
|
||||
|
||||
openspace.setPropertyValueSingle("Modules.Touch.EnableTouchInteraction", true)
|
||||
|
||||
-- A list of renderable types that apply the "direct manipulation". Works best for
|
||||
-- things with a sperical-ish shape and an intearction sphere of about the same size
|
||||
-- as the bounding sphere.
|
||||
-- Can also be set for each scene graph node using the "IsDirectlyTouchable" property
|
||||
local directTouchList = { "RenderableGlobe" }
|
||||
openspace.setPropertyValueSingle("Modules.Touch.DefaultDirectTouchRenderableTypes", directTouchList)
|
||||
end)
|
||||
|
||||
asset.meta = {
|
||||
Name = "Touch Module Default Settings",
|
||||
Version = "1.0",
|
||||
Description = "Some default settings related to the touch module",
|
||||
Author = "OpenSpace Team",
|
||||
URL = "http://openspaceproject.com",
|
||||
License = "MIT license"
|
||||
}
|
||||
@@ -17,9 +17,10 @@ local speck = asset.syncedResource({
|
||||
Name = "Grids Speck Files",
|
||||
Type = "HttpSynchronization",
|
||||
Identifier = "digitaluniverse_grids_speck",
|
||||
Version = 2
|
||||
Version = 3
|
||||
})
|
||||
|
||||
local lightHour = 1.0792528488E12
|
||||
local lightDay = 2.59020684E13
|
||||
local lightMonth = 7.771E14
|
||||
local lightYear = 9.4605284E15
|
||||
@@ -236,6 +237,37 @@ local galacticLabels = {
|
||||
}
|
||||
}
|
||||
|
||||
local plane1lh = {
|
||||
Identifier = "1lhGrid",
|
||||
Parent = transforms.SolarSystemBarycenter.Name,
|
||||
Transform = {
|
||||
Rotation = {
|
||||
Type = "StaticRotation",
|
||||
Rotation = eclipticRotationMatrix
|
||||
}
|
||||
},
|
||||
Renderable = {
|
||||
Type = "RenderableGrid",
|
||||
Enabled = false,
|
||||
Labels = {
|
||||
File = speck .. "1lh.label",
|
||||
Color = { 0.0, 0.2, 0.5 },
|
||||
Size = 9.5,
|
||||
MinMaxSize = { 0, 30 },
|
||||
Unit = "Km"
|
||||
},
|
||||
Opacity = 0.4,
|
||||
Color = { 0.1, 0.5, 0.6 },
|
||||
LineWidth = 2.0,
|
||||
Segments = { 20, 20 },
|
||||
Size = { 2*lightHour, 2*lightHour }
|
||||
},
|
||||
GUI = {
|
||||
Name = "1lh Grid",
|
||||
Path = "/Other/Grids"
|
||||
}
|
||||
}
|
||||
|
||||
local plane1ld = {
|
||||
Identifier = "1ldGrid",
|
||||
Parent = transforms.SolarSystemBarycenter.Name,
|
||||
@@ -585,7 +617,7 @@ local plane20Gly = {
|
||||
|
||||
local nodes = {
|
||||
radio, oort, ecliptic, eclipticLabels, equatorial, equatorialLabels,
|
||||
galactic, galacticLabels, plane1ld, plane1lm, plane1ly, plane10ly,
|
||||
galactic, galacticLabels, plane1lh, plane1ld, plane1lm, plane1ly, plane10ly,
|
||||
plane100ly, plane1kly, plane10kly, plane100kly, plane1Mly, plane10Mly, plane100Mly,
|
||||
plane20Gly
|
||||
}
|
||||
|
||||
@@ -31,7 +31,7 @@ local plane = {
|
||||
},
|
||||
GUI = {
|
||||
Name = "Milky Way Galaxy Image",
|
||||
Path = "/Universe/Galaxies",
|
||||
Path = "/Milky Way",
|
||||
Description = [[Census: 1 image. DU Version 2.2. <br> The exterior view of the
|
||||
Milky Way is simply a two-dimensional image. The image is that of NGC 1232, a
|
||||
galaxy thought to resemble our Milky Way. The image has been properly sized
|
||||
|
||||
@@ -31,7 +31,7 @@ local plane = {
|
||||
},
|
||||
GUI = {
|
||||
Name = "Milky Way Arms Labels",
|
||||
Path = "/Universe/Galaxies",
|
||||
Path = "/Milky Way",
|
||||
Description = [[Census: 1 image. DU Version: 1.2. This image contains labels for
|
||||
the Milky Way's spiral arms. We label them in this manner ("hard coding" the
|
||||
labels into an image rather than having native labels) so that they can retain
|
||||
|
||||
@@ -34,7 +34,7 @@ local gaia_abundance_apogee = {
|
||||
ColorRange = { { -0.8, 0.6 } },
|
||||
-- ShapeTexture = textures .. "disc.png",
|
||||
ColorMap = colormaps .. "colorbv.cmap",
|
||||
OtherDataColorMap = colormaps .. "RainbowGradient.cmap",
|
||||
OtherDataColorMap = colormaps .. "rainbowgradient.cmap",
|
||||
StaticFilter = -9999,
|
||||
StaticFilterReplacement = 0.0,
|
||||
DataMapping = {
|
||||
|
||||
@@ -5,12 +5,14 @@ local gaia618Destination = asset.syncedResource({
|
||||
Name = "Gaia DR2 618M Octree",
|
||||
Type = "HttpSynchronization",
|
||||
Identifier = "gaia_stars_618M_octree",
|
||||
Version = 1
|
||||
Version = 1,
|
||||
UnzipFiles = true,
|
||||
UnzipFilesDestination = "data"
|
||||
})
|
||||
local gaia618DestinationExtracted = gaia618Destination .. "data";
|
||||
|
||||
-- Download the full DR2 dataset with 24 values per star (preprocessed with theReadFitsTask (gaia_read.task) into 8 binary files).
|
||||
-- From these files new subsets can be created with the ConstructOctreeTask (gaia_octree.task).
|
||||
-- From these files new subsets can be created with the ConstructOctreeTask (gaia_octree.task).
|
||||
-- Total size of download is 151 GB.
|
||||
local gaiaFull = asset.syncedResource({
|
||||
Name = "Gaia DR2 Full Raw",
|
||||
@@ -19,13 +21,6 @@ local gaiaFull = asset.syncedResource({
|
||||
Version = 1
|
||||
})
|
||||
|
||||
asset.onInitialize(function()
|
||||
if not openspace.directoryExists(gaia618DestinationExtracted) then
|
||||
openspace.printInfo("Extracted Gaia dataset")
|
||||
openspace.unzipFile(gaia618Destination .. "DR2_full_Octree[50kSPN,500dist]_50,50.zip", gaia618DestinationExtracted, true)
|
||||
end
|
||||
end)
|
||||
|
||||
asset.export("GaiaDR2_618M", gaia618DestinationExtracted)
|
||||
asset.export("GaiaFullDataset", gaiaFull)
|
||||
|
||||
|
||||
@@ -33,7 +33,7 @@ local gaia_abundance_galah = {
|
||||
ColorOption = "Other Data",
|
||||
OtherData = "FeH",
|
||||
ColorMap = colormaps .. "colorbv.cmap",
|
||||
OtherDataColorMap = colormaps .. "RainbowGradient.cmap",
|
||||
OtherDataColorMap = colormaps .. "rainbowgradient.cmap",
|
||||
ColorRange = { { -0.8, 0.6 } },
|
||||
StaticFilter = -9999,
|
||||
StaticFilterReplacement = 0.0,
|
||||
|
||||
@@ -50,11 +50,38 @@ local Charon = {
|
||||
}
|
||||
}
|
||||
|
||||
local CharonLabel = {
|
||||
Identifier = "CharonLabel",
|
||||
Parent = Charon.Identifier,
|
||||
Renderable = {
|
||||
Enabled = false,
|
||||
Type = "RenderableLabel",
|
||||
Text = "Charon",
|
||||
FontSize = 70.0,
|
||||
Size = 6.0,
|
||||
MinMaxSize = { 1, 25 },
|
||||
OrientationOption = "Camera View Direction",
|
||||
BlendMode = "Normal",
|
||||
EnableFading = true,
|
||||
FadeUnit = "Mm",
|
||||
FadeDistances = { 250.0, 500.0 },
|
||||
FadeWidths = { 150.0, 250.0 }
|
||||
},
|
||||
Tag = { "solarsystem_labels", "moon_labels", "major_moon_labels" },
|
||||
GUI = {
|
||||
Name = "Charon Label",
|
||||
Path = "/Solar System/Dwarf Planets/Pluto/Moons",
|
||||
Description = "Label for Pluto's moon Charon"
|
||||
}
|
||||
}
|
||||
|
||||
asset.onInitialize(function()
|
||||
openspace.addSceneGraphNode(Charon)
|
||||
openspace.addSceneGraphNode(CharonLabel)
|
||||
end)
|
||||
|
||||
asset.onDeinitialize(function()
|
||||
openspace.removeSceneGraphNode(CharonLabel)
|
||||
openspace.removeSceneGraphNode(Charon)
|
||||
end)
|
||||
|
||||
|
||||
@@ -52,12 +52,39 @@ local HydraTrail = {
|
||||
}
|
||||
}
|
||||
|
||||
local HydraLabel = {
|
||||
Identifier = "HydraLabel",
|
||||
Parent = Hydra.Identifier,
|
||||
Renderable = {
|
||||
Enabled = false,
|
||||
Type = "RenderableLabel",
|
||||
Text = "Hydra",
|
||||
FontSize = 70.0,
|
||||
Size = 6.0,
|
||||
MinMaxSize = { 1, 25 },
|
||||
OrientationOption = "Camera View Direction",
|
||||
BlendMode = "Normal",
|
||||
EnableFading = true,
|
||||
FadeUnit = "Mm",
|
||||
FadeDistances = { 250.0, 1000.0 },
|
||||
FadeWidths = { 150.0, 500.0 }
|
||||
},
|
||||
Tag = { "solarsystem_labels", "moon_labels", "minor_moon_labels" },
|
||||
GUI = {
|
||||
Name = "Cheron Label",
|
||||
Path = "/Solar System/Dwarf Planets/Pluto/Moons",
|
||||
Description = "Label for Pluto's moon Hydra"
|
||||
}
|
||||
}
|
||||
|
||||
asset.onInitialize(function()
|
||||
openspace.addSceneGraphNode(Hydra)
|
||||
openspace.addSceneGraphNode(HydraTrail)
|
||||
openspace.addSceneGraphNode(HydraLabel)
|
||||
end)
|
||||
|
||||
asset.onDeinitialize(function()
|
||||
openspace.removeSceneGraphNode(HydraLabel)
|
||||
openspace.removeSceneGraphNode(HydraTrail)
|
||||
openspace.removeSceneGraphNode(Hydra)
|
||||
end)
|
||||
|
||||
@@ -51,12 +51,39 @@ local KerberosTrail = {
|
||||
}
|
||||
}
|
||||
|
||||
local KerberosLabel = {
|
||||
Identifier = "KerberosLabel",
|
||||
Parent = Kerberos.Identifier,
|
||||
Renderable = {
|
||||
Enabled = false,
|
||||
Type = "RenderableLabel",
|
||||
Text = "Kerberos",
|
||||
FontSize = 70.0,
|
||||
Size = 6.0,
|
||||
MinMaxSize = { 1, 25 },
|
||||
OrientationOption = "Camera View Direction",
|
||||
BlendMode = "Normal",
|
||||
EnableFading = true,
|
||||
FadeUnit = "Mm",
|
||||
FadeDistances = { 250.0, 1000.0 },
|
||||
FadeWidths = { 150.0, 500.0 }
|
||||
},
|
||||
Tag = { "solarsystem_labels", "moon_labels", "minor_moon_labels" },
|
||||
GUI = {
|
||||
Name = "Cheron Label",
|
||||
Path = "/Solar System/Dwarf Planets/Pluto/Moons",
|
||||
Description = "Label for Pluto's moon Kerberos"
|
||||
}
|
||||
}
|
||||
|
||||
asset.onInitialize(function()
|
||||
openspace.addSceneGraphNode(Kerberos)
|
||||
openspace.addSceneGraphNode(KerberosTrail)
|
||||
openspace.addSceneGraphNode(KerberosLabel)
|
||||
end)
|
||||
|
||||
asset.onDeinitialize(function()
|
||||
openspace.removeSceneGraphNode(KerberosLabel)
|
||||
openspace.removeSceneGraphNode(KerberosTrail)
|
||||
openspace.removeSceneGraphNode(Kerberos)
|
||||
end)
|
||||
|
||||
@@ -51,12 +51,39 @@ local NixTrail = {
|
||||
}
|
||||
}
|
||||
|
||||
local NixLabel = {
|
||||
Identifier = "NixLabel",
|
||||
Parent = Nix.Identifier,
|
||||
Renderable = {
|
||||
Enabled = false,
|
||||
Type = "RenderableLabel",
|
||||
Text = "Nix",
|
||||
FontSize = 70.0,
|
||||
Size = 6.0,
|
||||
MinMaxSize = { 1, 25 },
|
||||
OrientationOption = "Camera View Direction",
|
||||
BlendMode = "Normal",
|
||||
EnableFading = true,
|
||||
FadeUnit = "Mm",
|
||||
FadeDistances = { 250.0, 1000.0 },
|
||||
FadeWidths = { 150.0, 500.0 }
|
||||
},
|
||||
Tag = { "solarsystem_labels", "moon_labels", "minor_moon_labels" },
|
||||
GUI = {
|
||||
Name = "Cheron Label",
|
||||
Path = "/Solar System/Dwarf Planets/Pluto/Moons",
|
||||
Description = "Label for Pluto's moon Nix"
|
||||
}
|
||||
}
|
||||
|
||||
asset.onInitialize(function()
|
||||
openspace.addSceneGraphNode(Nix)
|
||||
openspace.addSceneGraphNode(NixTrail)
|
||||
openspace.addSceneGraphNode(NixLabel)
|
||||
end)
|
||||
|
||||
asset.onDeinitialize(function()
|
||||
openspace.removeSceneGraphNode(NixLabel)
|
||||
openspace.removeSceneGraphNode(NixTrail)
|
||||
openspace.removeSceneGraphNode(Nix)
|
||||
end)
|
||||
|
||||
@@ -50,12 +50,39 @@ local StyxTrail = {
|
||||
}
|
||||
}
|
||||
|
||||
local StyxLabel = {
|
||||
Identifier = "StyxLabel",
|
||||
Parent = Styx.Identifier,
|
||||
Renderable = {
|
||||
Enabled = false,
|
||||
Type = "RenderableLabel",
|
||||
Text = "Styx",
|
||||
FontSize = 70.0,
|
||||
Size = 6.0,
|
||||
MinMaxSize = { 1, 25 },
|
||||
OrientationOption = "Camera View Direction",
|
||||
BlendMode = "Normal",
|
||||
EnableFading = true,
|
||||
FadeUnit = "Mm",
|
||||
FadeDistances = { 250.0, 1000.0 },
|
||||
FadeWidths = { 150.0, 500.0 }
|
||||
},
|
||||
Tag = { "solarsystem_labels", "moon_labels", "minor_moon_labels" },
|
||||
GUI = {
|
||||
Name = "Cheron Label",
|
||||
Path = "/Solar System/Dwarf Planets/Pluto/Moons",
|
||||
Description = "Label for Pluto's moon Styx"
|
||||
}
|
||||
}
|
||||
|
||||
asset.onInitialize(function()
|
||||
openspace.addSceneGraphNode(Styx)
|
||||
openspace.addSceneGraphNode(StyxTrail)
|
||||
openspace.addSceneGraphNode(StyxLabel)
|
||||
end)
|
||||
|
||||
asset.onDeinitialize(function()
|
||||
openspace.removeSceneGraphNode(StyxLabel)
|
||||
openspace.removeSceneGraphNode(StyxTrail)
|
||||
openspace.removeSceneGraphNode(Styx)
|
||||
end)
|
||||
|
||||
@@ -57,10 +57,14 @@ local PlutoLabel = {
|
||||
Type = "RenderableLabel",
|
||||
Text = "Pluto",
|
||||
FontSize = 70.0,
|
||||
Size = 9.05,
|
||||
Size = 9.10,
|
||||
MinMaxSize = { 1, 100 },
|
||||
BlendMode = "Additive",
|
||||
OrientationOption = "Camera View Direction"
|
||||
OrientationOption = "Camera View Direction",
|
||||
EnableFading = true,
|
||||
FadeUnit = "au",
|
||||
FadeDistances = { 2.0, 120.0 },
|
||||
FadeWidths = { 1.0, 150.0 }
|
||||
},
|
||||
Tag = { "solarsystem_labels" },
|
||||
GUI = {
|
||||
|
||||
+8
-20
@@ -12,9 +12,16 @@ local fieldlineData = asset.syncedResource({
|
||||
Name = "Fieldlines Data BATSRUS",
|
||||
Type = "HttpSynchronization",
|
||||
Identifier = "sun_earth_event_july_2012-batsrus",
|
||||
Version = 1
|
||||
Version = 1,
|
||||
UnzipFiles = true
|
||||
})
|
||||
|
||||
local unzippedDataDestination = {
|
||||
openClosed = fieldlineData .. "magnetic_fieldlines-open_closed",
|
||||
velocityFlow = fieldlineData .. "velocity_flowlines-upstream",
|
||||
asherStatic = fieldlineData .. "ashers_static_seeds"
|
||||
}
|
||||
|
||||
local loop = {
|
||||
Documentation = "Sets time to start of data, sets higher delta time and loops back from start, when at end of data",
|
||||
GuiPath = "2012July",
|
||||
@@ -30,12 +37,6 @@ local batsrusCurrentColorTable = transferFunctions .. "batsrus_current2.txt"
|
||||
local batsrusVelocityColorTable = transferFunctions .. "batsrus_velocity.txt"
|
||||
local batsrusTopologyColorTable = transferFunctions .. "batsrus_topology.txt"
|
||||
|
||||
local unzippedDataDestination = {
|
||||
openClosed = fieldlineData .. "magnetic_fieldlines-open_closed",
|
||||
velocityFlow = fieldlineData .. "velocity_flowlines-upstream",
|
||||
asherStatic = fieldlineData .. "ashers_static_seeds"
|
||||
}
|
||||
|
||||
local colorRanges = {
|
||||
{ 0, 100000000 },
|
||||
{ 0, 60 },
|
||||
@@ -131,19 +132,6 @@ local BatsrusAsherStaticSeedsFlowLines = {
|
||||
asset.onInitialize(function ()
|
||||
openspace.action.registerAction(loop)
|
||||
|
||||
if not openspace.directoryExists(unzippedDataDestination.openClosed) then
|
||||
openspace.printInfo("Extracting " .. "Fieldlines from Batsrus model of 2012 event")
|
||||
openspace.unzipFile(fieldlineData .. "magnetic_fieldlines-open_closed.zip", unzippedDataDestination.openClosed, true)
|
||||
end
|
||||
if not openspace.directoryExists(unzippedDataDestination.velocityFlow) then
|
||||
openspace.printInfo("Extracting " .. "Fieldlines from Batsrus model of 2012 event")
|
||||
openspace.unzipFile(fieldlineData .. "velocity_flowlines-upstream.zip", unzippedDataDestination.velocityFlow, true)
|
||||
end
|
||||
if not openspace.directoryExists(unzippedDataDestination.asherStatic) then
|
||||
openspace.printInfo("Extracting " .. "Fieldlines from Batsrus model of 2012 event")
|
||||
openspace.unzipFile(fieldlineData .. "ashers_static_seeds.zip", unzippedDataDestination.asherStatic, true)
|
||||
end
|
||||
|
||||
openspace.addSceneGraphNode(BatsrusJ12OpenClosed)
|
||||
openspace.addSceneGraphNode(BatsrusJ12FlowLines)
|
||||
openspace.addSceneGraphNode(BatsrusAsherStaticSeedsFlowLines)
|
||||
|
||||
+3
-27
@@ -8,11 +8,12 @@ local transferFunctions = asset.syncedResource({
|
||||
Version = 1
|
||||
})
|
||||
|
||||
local fieldlineData = asset.syncedResource({
|
||||
local fieldlineData = asset.syncedResource({
|
||||
Name = "Fieldlines Data ENLIL",
|
||||
Type = "HttpSynchronization",
|
||||
Identifier = "sun_earth_event_july_2012-enlil",
|
||||
Version = 1
|
||||
Version = 1,
|
||||
UnzipFiles = true
|
||||
})
|
||||
|
||||
local loop = {
|
||||
@@ -187,31 +188,6 @@ local ENLILStereoA = {
|
||||
asset.onInitialize(function ()
|
||||
openspace.action.registerAction(loop)
|
||||
|
||||
if not openspace.directoryExists(unzippedDataDestination.EqPlane011AU1) then
|
||||
openspace.printInfo("Extracting " .. "Fieldlines from ENLIL model of 2012 event")
|
||||
openspace.unzipFile(fieldlineData .. "011AU_eq_plane_1.zip", unzippedDataDestination.EqPlane011AU1, true)
|
||||
end
|
||||
if not openspace.directoryExists(unzippedDataDestination.EqPlane011AU2) then
|
||||
openspace.printInfo("Extracting " .. "Fieldlines from ENLIL model of 2012 event")
|
||||
openspace.unzipFile(fieldlineData .. "011AU_eq_plane_2.zip", unzippedDataDestination.EqPlane011AU2, true)
|
||||
end
|
||||
if not openspace.directoryExists(unzippedDataDestination.Lat4011AU1) then
|
||||
openspace.printInfo("Extracting " .. "Fieldlines from ENLIL model of 2012 event")
|
||||
openspace.unzipFile(fieldlineData .. "011AU_lat4_1.zip", unzippedDataDestination.Lat4011AU1, true)
|
||||
end
|
||||
if not openspace.directoryExists(unzippedDataDestination.Lat4011AU2) then
|
||||
openspace.printInfo("Extracting " .. "Fieldlines from ENLIL model of 2012 event")
|
||||
openspace.unzipFile(fieldlineData .. "011AU_lat4_2.zip", unzippedDataDestination.Lat4011AU2, true)
|
||||
end
|
||||
if not openspace.directoryExists(unzippedDataDestination.Earth) then
|
||||
openspace.printInfo("Extracting " .. "Fieldlines from ENLIL model of 2012 event")
|
||||
openspace.unzipFile(fieldlineData .. "earth.zip", unzippedDataDestination.Earth, true)
|
||||
end
|
||||
if not openspace.directoryExists(unzippedDataDestination.StereoA) then
|
||||
openspace.printInfo("Extracting " .. "Fieldlines from ENLIL model of 2012 event")
|
||||
openspace.unzipFile(fieldlineData .. "stereoa.zip", unzippedDataDestination.StereoA, true)
|
||||
end
|
||||
|
||||
openspace.addSceneGraphNode(ENLILSliceEqPlane11AU1)
|
||||
openspace.addSceneGraphNode(ENLILSliceEqPlane11AU2)
|
||||
openspace.addSceneGraphNode(ENLILSliceLat411AU1)
|
||||
|
||||
@@ -11,7 +11,8 @@ local fieldlineData = asset.syncedResource({
|
||||
Name = "Fieldlines Data PFSS",
|
||||
Type = "HttpSynchronization",
|
||||
Identifier = "sun_earth_event_july_2012-pfss",
|
||||
Version = 1
|
||||
Version = 1,
|
||||
UnzipFiles = true
|
||||
})
|
||||
|
||||
local darkenSun = {
|
||||
@@ -64,11 +65,6 @@ local PFSS = {
|
||||
asset.onInitialize(function ()
|
||||
openspace.action.registerAction(darkenSun)
|
||||
|
||||
if not openspace.directoryExists(PFSSPaths.SolarSoft) then
|
||||
openspace.printInfo("Extracting " .. "Fieldlines from PFSS model of 2012 event")
|
||||
openspace.unzipFile(fieldlineData .. "leilas_solar_soft.zip", PFSSPaths.SolarSoft, true)
|
||||
end
|
||||
|
||||
openspace.addSceneGraphNode(PFSS)
|
||||
|
||||
-- openspace.setPropertyValueSingle("Scene.FL_PFSS.Renderable.FlowEnabled", true)
|
||||
|
||||
@@ -0,0 +1,97 @@
|
||||
local bastilleday_setup_startofcme = {
|
||||
Identifier = "os.events.bastilleday.setup.startofcme",
|
||||
Name = "Reset to start of CME, no loop",
|
||||
Command = [[
|
||||
openspace.time.setTime('2000-JUL-14 10:03:00.00');
|
||||
openspace.scriptScheduler.clear();
|
||||
]],
|
||||
Documentation = "Button to reset to the the start of the CME",
|
||||
GuiPath = "/Bastille-Day 2000",
|
||||
IsLocal = false
|
||||
}
|
||||
|
||||
local bastilleday_setup_shortloop = {
|
||||
Identifier = "os.events.bastilleday.setup.shortloop",
|
||||
Name = "Loop 10:03 - 10:16, at 2 min/second",
|
||||
Command = [[
|
||||
local EndtimeShortLoop = "2000 JUL 14 10:16:00";
|
||||
local starttimescriptslowloop = "openspace.time.setTime('2000 JUL 14 10:03:00')";
|
||||
openspace.scriptScheduler.clear();
|
||||
openspace.time.setDeltaTime(120);
|
||||
openspace.time.setTime('2000-JUL-14 10:03:00.00');
|
||||
openspace.scriptScheduler.loadScheduledScript(EndtimeShortLoop, starttimescriptslowloop);
|
||||
]],
|
||||
Documentation = "New loop: Restarts time at 10:03 and stops at 10:16, sets delta time to 2 min/second (120 seconds/second)",
|
||||
GuiPath = "/Bastille-Day 2000",
|
||||
IsLocal = false
|
||||
}
|
||||
|
||||
local bastilleday_setup_standardloop = {
|
||||
Identifier = "os.events.bastilleday.setup.standardloop",
|
||||
Name = "Loop 10:03 - 11:00, at 4 min/second",
|
||||
Command = [[
|
||||
local starttimescriptslowloop = "openspace.time.setTime('2000 JUL 14 10:03:00')";
|
||||
openspace.scriptScheduler.clear();
|
||||
openspace.time.setDeltaTime(240);
|
||||
openspace.time.setTime('2000-JUL-14 10:03:00.00');
|
||||
openspace.scriptScheduler.loadScheduledScript('2000 JUL 14 11:00:00', starttimescriptslowloop);
|
||||
]],
|
||||
Documentation = "New loop: Restarts time at 10:03 and stops at 11:00, delta time to 4 min/second (240 seconds/second)",
|
||||
GuiPath = "/Bastille-Day 2000",
|
||||
IsLocal = false
|
||||
}
|
||||
|
||||
local bastilleday_setup_fastloop = {
|
||||
Identifier = "os.events.bastilleday.setup.fastloop",
|
||||
Name = "Loop 10:03 - 11.48, at 15 min/second",
|
||||
Command = [[
|
||||
local starttimescriptfastloop = "openspace.time.setTime('2000 JUL 14 10:03:00')";
|
||||
openspace.scriptScheduler.clear();
|
||||
openspace.time.setDeltaTime(900);
|
||||
openspace.time.setTime('2000-JUL-14 10:03:00.00');
|
||||
openspace.scriptScheduler.loadScheduledScript('2000 JUL 14 11:48:00', starttimescriptfastloop);
|
||||
]],
|
||||
Documentation = "Fast loop: Starts from 10:03 and sets delta time to 15 min/second (900 seconds/second)",
|
||||
GuiPath = "/Bastille-Day 2000",
|
||||
IsLocal = false
|
||||
}
|
||||
|
||||
local bastilleday_setup_longloop = {
|
||||
Identifier = "os.events.bastilleday.setup.longloop",
|
||||
Name = "Loop 09:30 - 13:00, at 4 min/second",
|
||||
Command = [[
|
||||
local starttimescriptlongloop = "openspace.time.setTime('2000 JUL 14 09:30:00')";
|
||||
openspace.scriptScheduler.clear();
|
||||
openspace.time.setDeltaTime(240);
|
||||
openspace.time.setTime('2000-JUL-14 09:30:00.00');
|
||||
openspace.scriptScheduler.loadScheduledScript('2000 JUL 14 13:00:00', starttimescriptlongloop);
|
||||
]],
|
||||
Documentation = "Long loop: Restarts time at 09:30 and stops at 11:50, delta time to 4 min/second (240 seconds/second)",
|
||||
GuiPath = "/Bastille-Day 2000",
|
||||
IsLocal = false
|
||||
}
|
||||
|
||||
asset.onInitialize(function()
|
||||
openspace.action.registerAction(bastilleday_setup_startofcme)
|
||||
openspace.action.registerAction(bastilleday_setup_shortloop)
|
||||
openspace.action.registerAction(bastilleday_setup_standardloop)
|
||||
openspace.action.registerAction(bastilleday_setup_fastloop)
|
||||
openspace.action.registerAction(bastilleday_setup_longloop)
|
||||
end)
|
||||
|
||||
asset.onDeinitialize(function()
|
||||
openspace.action.removeAction(bastilleday_setup_longloop)
|
||||
openspace.action.removeAction(bastilleday_setup_fastloop)
|
||||
openspace.action.removeAction(bastilleday_setup_standardloop)
|
||||
openspace.action.removeAction(bastilleday_setup_shortloop)
|
||||
openspace.action.removeAction(bastilleday_setup_startofcme)
|
||||
end)
|
||||
|
||||
asset.meta = {
|
||||
Name = "Bastille day actions",
|
||||
Version = "1.0",
|
||||
Description = "Asset with actions related to Bastille day",
|
||||
Author = "CCMC, OpenSpace Team",
|
||||
URL = "http://openspaceproject.com",
|
||||
License = "MIT license"
|
||||
}
|
||||
@@ -49,7 +49,7 @@ local densityVolume = {
|
||||
}
|
||||
|
||||
local toggle_volume = {
|
||||
Identifier = "density_volume.toggle_volume",
|
||||
Identifier = "os.events.bastilleday.densityvolume.togglevolume",
|
||||
Name = "Toggle volume",
|
||||
Command = propertyHelper.invert("Scene.MAS-MHD-Density-bastille-day-2000.Renderable.Enabled"),
|
||||
Documentation = "Toggle volume rendering of CME",
|
||||
@@ -72,7 +72,7 @@ asset.export(densityVolume)
|
||||
|
||||
asset.meta = {
|
||||
Name = "Predictive Science Inc. Volume Rendering Bastille Day",
|
||||
Version = "1.0",
|
||||
Version = "1.1",
|
||||
Description = "Volumetric rendering for the bastille day CME event",
|
||||
Author = "CCMC, OpenSpace team",
|
||||
URL = "https://dx.doi.org/10.3847/1538-4357/aab36d",
|
||||
|
||||
@@ -48,7 +48,7 @@ local fieldlines = {
|
||||
}
|
||||
|
||||
local toggle_fieldlines = {
|
||||
Identifier = "fieldlines.toggle_fieldlines",
|
||||
Identifier = "os.events.bastilleday.fieldlines.togglefieldlines",
|
||||
Name = "Toggle Fieldlines",
|
||||
Command = propertyHelper.invert("Scene.MAS-MHD-Fieldlines-bastille-day-2000.Renderable.Enabled"),
|
||||
Documentation = "Toggle fieldline rendering of CME",
|
||||
@@ -70,7 +70,7 @@ asset.export(fieldlines)
|
||||
|
||||
asset.meta = {
|
||||
Name = "Predictive Science Inc. Fieldlines Bastille Day",
|
||||
Version = "1.0",
|
||||
Version = "1.1",
|
||||
Description = "Magnetic fieldlines for the bastille day CME event",
|
||||
Author = "CCMC, Jonathan Grangien, Matthias Berg",
|
||||
URL = "https://dx.doi.org/10.3847/1538-4357/aab36d",
|
||||
|
||||
@@ -33,7 +33,7 @@ local fluxNodes = {
|
||||
}
|
||||
|
||||
local toggle_fluxnodes = {
|
||||
Identifier = "fluxnodes.toggle_fluxnodes",
|
||||
Identifier = "os.events.bastilleday.fluxnodes.togglefluxnodes",
|
||||
Name = "Toggle flux nodes",
|
||||
Command = propertyHelper.invert("Scene.MAS-MHD-FluxNodes-bastille-day-2000.Renderable.Enabled"),
|
||||
Documentation = "Toggle flux node rendering of CME",
|
||||
@@ -56,7 +56,7 @@ asset.export(fluxNodes)
|
||||
|
||||
asset.meta = {
|
||||
Name = "Predictive Science Inc. Flux nodes Bastille Day",
|
||||
Version = "1.0",
|
||||
Version = "1.1",
|
||||
Description = "Flux nodes for the bastille day CME event",
|
||||
Author = "CCMC, Christian Adamsson, Emilie Ho",
|
||||
URL = "https://dx.doi.org/10.3847/1538-4357/aab36d",
|
||||
|
||||
@@ -70,7 +70,7 @@ local MeridialCutplane = {
|
||||
}
|
||||
|
||||
local toggle_equatorial = {
|
||||
Identifier = "fluxnodescutplane.toggle_equatorial",
|
||||
Identifier = "os.events.bastilleday.fluxnodescutplane.toggleequatorial",
|
||||
Name = "Toggle equatorial cutplane",
|
||||
Command = propertyHelper.invert("Scene.EquatorialCutplane-bastille-day-2000.Renderable.Enabled"),
|
||||
Documentation = "Toggle equatorial cutplane of CME",
|
||||
@@ -78,7 +78,7 @@ local toggle_equatorial = {
|
||||
IsLocal = false
|
||||
}
|
||||
local toggle_meridial = {
|
||||
Identifier = "fluxnodescutplane.toggle_meridial",
|
||||
Identifier = "os.events.bastilleday.fluxnodescutplane.togglemeridial",
|
||||
Name = "Toggle meridial cutplane",
|
||||
Command = propertyHelper.invert("Scene.MeridialCutplane-bastille-day-2000.Renderable.Enabled"),
|
||||
Documentation = "Toggle meridial cutplane of CME",
|
||||
@@ -106,7 +106,7 @@ asset.export(MeridialCutplane)
|
||||
|
||||
asset.meta = {
|
||||
Name = "Predictive Science Inc. Cutplanes Bastille Days",
|
||||
Version = "1.0",
|
||||
Version = "1.1",
|
||||
Description = "Cutplanes for the bastille day CME event",
|
||||
Author = "CCMC, Christian Adamsson, Emilie Ho",
|
||||
URL = "https://dx.doi.org/10.3847/1538-4357/aab36d",
|
||||
|
||||
@@ -16,7 +16,7 @@ local legend = {
|
||||
}
|
||||
|
||||
local show_legend = {
|
||||
Identifier = "fluxnodelegend.show_legend",
|
||||
Identifier = "os.events.bastilleday.fluxnodelegend.showlegend",
|
||||
Name = "Show the legend image",
|
||||
Command = [[
|
||||
openspace.setPropertyValueSingle("ScreenSpace.LegendFluxNodes-bastille-day-2000.Opacity", 0.0);
|
||||
@@ -27,8 +27,9 @@ local show_legend = {
|
||||
GuiPath = "/Bastille-Day 2000",
|
||||
IsLocal = false
|
||||
}
|
||||
|
||||
local hide_legend = {
|
||||
Identifier = "fluxnodelegend.hide_legend",
|
||||
Identifier = "os.events.bastilleday.fluxnodelegend.hidelegend",
|
||||
Name = "Hides the legend image",
|
||||
Command = [[openspace.setPropertyValueSingle("ScreenSpace.LegendFluxNodes-bastille-day-2000.Opacity", 0.0, 2)]],
|
||||
Documentation = "Hides the legend image",
|
||||
@@ -52,7 +53,7 @@ end)
|
||||
|
||||
asset.meta = {
|
||||
Name = "Predictive Science Inc. Flux nodes legend for Bastille Days",
|
||||
Version = "1.0",
|
||||
Version = "1.1",
|
||||
Description = [[Screen space renderable image legend of flux nodes for the bastille day
|
||||
CME event]],
|
||||
Author = "Christian Adamsson, Emilie Ho",
|
||||
|
||||
@@ -5,7 +5,7 @@ local magnetogramDirectory = asset.require("./magnetogram").TexturesPath;
|
||||
local magnetograms;
|
||||
|
||||
local switch_color_layer = {
|
||||
Identifier = "magnetogram_texture.switch_color_layer",
|
||||
Identifier = "os.events.bastilleday.magnetogramtexture.switchcolorlayer",
|
||||
Name = "Next sun texture",
|
||||
Command = [[
|
||||
local textureList = openspace.globebrowsing.getLayers("Sun", "ColorLayers");
|
||||
@@ -59,7 +59,7 @@ end)
|
||||
|
||||
asset.meta = {
|
||||
Name = "Bastille Day magnetogram textures",
|
||||
Version = "1.0",
|
||||
Version = "1.1",
|
||||
Description = [[This asset adds multiple magnetogram textures to the Sun. In addition
|
||||
it provides an action to cycle through the textures. See magnetogram.asset for details
|
||||
of the textures]],
|
||||
|
||||
@@ -0,0 +1,36 @@
|
||||
asset.require("../apollo_globebrowsing")
|
||||
|
||||
local apollo11_setup_landingsite = {
|
||||
Identifier = "os.missions.apollo11.setup.landingsite",
|
||||
Name = "Setup Apollo 11 landing site",
|
||||
Command = [[
|
||||
openspace.time.setTime('1969 JUL 20 20:17:40');
|
||||
openspace.setPropertyValueSingle('Scene.Moon.Renderable.Layers.HeightLayers.LRO_NAC_Apollo_11.Enabled', true);
|
||||
openspace.setPropertyValueSingle('Scene.Moon.Renderable.Layers.ColorLayers.A11_M177481212_p_longlat.Enabled', true);
|
||||
openspace.setPropertyValueSingle('Scene.Moon.Renderable.TargetLodScaleFactor', 20.11);
|
||||
openspace.setPropertyValue('NavigationHandler.OrbitalNavigator.Anchor', 'Apollo11LemPosition');
|
||||
openspace.setPropertyValue('NavigationHandler.OrbitalNavigator.RetargetAnchor', nil);
|
||||
openspace.setPropertyValueSingle('Scene.Apollo11MoonTrail.Renderable.Enabled', true);
|
||||
openspace.setPropertyValueSingle('Scene.Apollo11LemTrail.Renderable.Enabled', true);
|
||||
]],
|
||||
Documentation = "Setup for Apollo 11 landing site",
|
||||
GuiPath = "/Missions/Apollo/11",
|
||||
IsLocal = false
|
||||
}
|
||||
|
||||
asset.onInitialize(function()
|
||||
openspace.action.registerAction(apollo11_setup_landingsite)
|
||||
end)
|
||||
|
||||
asset.onDeinitialize(function()
|
||||
openspace.action.removeAction(apollo11_setup_landingsite)
|
||||
end)
|
||||
|
||||
asset.meta = {
|
||||
Name = "Apollo 11 Actions",
|
||||
Version = "1.0",
|
||||
Description = "Asset with actions related to the Apollo 11 mission",
|
||||
Author = "OpenSpace Team",
|
||||
URL = "http://openspaceproject.com",
|
||||
License = "MIT license"
|
||||
}
|
||||
@@ -1,3 +1,7 @@
|
||||
asset.require("spice/base")
|
||||
asset.require("../actions")
|
||||
asset.require("./actions")
|
||||
|
||||
local sun = asset.require("scene/solarsystem/sun/sun")
|
||||
local moon_transforms = asset.require("scene/solarsystem/planets/earth/moon/moon")
|
||||
|
||||
@@ -5,7 +9,6 @@ local descentKeyframes = asset.require("./lem_descent.asset")
|
||||
local descentRotationKeyframes = asset.require("./lem_descent_rotation.asset")
|
||||
|
||||
local kernels = asset.require("./kernels").kernels
|
||||
asset.require("spice/base")
|
||||
|
||||
local models = asset.syncedResource({
|
||||
Name = "Apollo Models",
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
local moon_transforms = asset.require("scene/solarsystem/planets/earth/moon/moon")
|
||||
local sun = asset.require("scene/solarsystem/sun/sun")
|
||||
asset.require("spice/base")
|
||||
asset.require("../actions")
|
||||
|
||||
local models = asset.syncedResource({
|
||||
Name = "Apollo Models",
|
||||
|
||||
@@ -0,0 +1,40 @@
|
||||
asset.require("../apollo_globebrowsing")
|
||||
|
||||
local apollo17_setup_landingsite = {
|
||||
Identifier = "os.missions.apollo17.setup.landingsite",
|
||||
Name = "Setup for Apollo 17 landing site",
|
||||
Command = [[
|
||||
openspace.time.setTime('1972 DEC 12 19:47:11');
|
||||
openspace.setPropertyValueSingle('Scene.Moon.Renderable.Layers.ColorLayers.A17_travmap.BlendMode', 0.000000);
|
||||
openspace.setPropertyValueSingle('Scene.Moon.Renderable.Layers.ColorLayers.A17_travmap.Enabled', true);
|
||||
openspace.setPropertyValueSingle('Scene.Moon.Renderable.Layers.HeightLayers.LRO_NAC_Apollo_17.Enabled', true);
|
||||
openspace.setPropertyValueSingle('Scene.Moon.Renderable.Layers.ColorLayers.A17_LEM.Enabled', true);
|
||||
openspace.setPropertyValueSingle('Scene.Moon.Renderable.Layers.ColorLayers.A17_LEM.BlendMode', 0.000000);
|
||||
openspace.setPropertyValueSingle('Scene.Moon.Renderable.Layers.ColorLayers.A17_NAC_Alt_p.Enabled', true);
|
||||
openspace.setPropertyValueSingle('Scene.Moon.Renderable.Layers.ColorLayers.A17_NAC_Alt_p.BlendMode', 0.000000);
|
||||
openspace.setPropertyValueSingle('Scene.Moon.Renderable.TargetLodScaleFactor', 20.17);
|
||||
openspace.setPropertyValue('NavigationHandler.OrbitalNavigator.Anchor', 'Apollo17LemModel');
|
||||
openspace.setPropertyValue('NavigationHandler.OrbitalNavigator.RetargetAnchor', nil);
|
||||
openspace.setPropertyValueSingle('Scene.Moon.Renderable.Layers.ColorLayers.A17_station7.BlendMode', 0.000000);
|
||||
]],
|
||||
Documentation = "Setup for Apollo 17 landing site",
|
||||
GuiPath = "/Missions/Apollo/17",
|
||||
IsLocal = false
|
||||
}
|
||||
|
||||
asset.onInitialize(function()
|
||||
openspace.action.registerAction(apollo17_setup_landingsite)
|
||||
end)
|
||||
|
||||
asset.onDeinitialize(function()
|
||||
openspace.action.removeAction(apollo17_setup_landingsite)
|
||||
end)
|
||||
|
||||
asset.meta = {
|
||||
Name = "Apollo 17 Actions",
|
||||
Version = "1.0",
|
||||
Description = "Asset with actions related to the Apollo 11 mission",
|
||||
Author = "OpenSpace Team",
|
||||
URL = "http://openspaceproject.com",
|
||||
License = "MIT license"
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
asset.require("./lem")
|
||||
asset.require("./actions")
|
||||
asset.require("../actions")
|
||||
@@ -0,0 +1,47 @@
|
||||
local apollo8_setup_earthrise = {
|
||||
Identifier = "os.missions.apollo8.setup.earthrise",
|
||||
Name = "Set Earthrise time",
|
||||
Command = [[
|
||||
openspace.time.setPause(true);
|
||||
openspace.time.setDeltaTime(1);
|
||||
openspace.time.setTime('1968 DEC 24 16:37:31');
|
||||
openspace.navigation.setNavigationState({Anchor = 'Apollo8', Position = { 1.494592E1, 3.236777E1, -4.171296E1 }, ReferenceFrame = 'Root', Up = { 0.960608E0, -0.212013E0, 0.179675E0 }});
|
||||
openspace.setPropertyValue('*Trail.Renderable.Enabled', false);
|
||||
]],
|
||||
Documentation = "Jump to right before the earthrise photo",
|
||||
GuiPath = "/Missions/Apollo/8",
|
||||
IsLocal = false
|
||||
}
|
||||
|
||||
local apollo8_setup_launch = {
|
||||
Identifier = "os.missions.apollo8.setup.launch",
|
||||
Name = "Set Apollo 8 launch time",
|
||||
Command = [[
|
||||
openspace.time.setTime('1968-12-21T12:51:37.00');
|
||||
openspace.setPropertyValueSingle('Scene.Apollo8LaunchTrail.Renderable.Enabled', true);
|
||||
]],
|
||||
Documentation = "Jump to time right before Apollo 8 liftoff, with its trail enabled",
|
||||
GuiPath = "/Missions/Apollo/8",
|
||||
IsLocal = false
|
||||
}
|
||||
|
||||
|
||||
|
||||
asset.onInitialize(function()
|
||||
openspace.action.registerAction(apollo8_setup_earthrise)
|
||||
openspace.action.registerAction(apollo8_setup_launch)
|
||||
end)
|
||||
|
||||
asset.onDeinitialize(function()
|
||||
openspace.action.removeAction(apollo8_setup_launch)
|
||||
openspace.action.removeAction(apollo8_setup_earthrise)
|
||||
end)
|
||||
|
||||
asset.meta = {
|
||||
Name = "Apollo 8 Actions",
|
||||
Version = "1.0",
|
||||
Description = "Asset with actions related to the Apollo 8 mission",
|
||||
Author = "OpenSpace Team",
|
||||
URL = "http://openspaceproject.com",
|
||||
License = "MIT license"
|
||||
}
|
||||
@@ -1,3 +1,5 @@
|
||||
asset.require("./model")
|
||||
asset.require("./launch_model")
|
||||
asset.require("./trails")
|
||||
asset.require("./actions")
|
||||
asset.require("../actions")
|
||||
|
||||
@@ -0,0 +1,57 @@
|
||||
local toggle_moon_shading = {
|
||||
Identifier = "os.missions.apollo.moon.toggleshading",
|
||||
Name = "Toggle Moon shading",
|
||||
Command = [[
|
||||
openspace.setPropertyValueSingle('Scene.Moon.Renderable.PerformShading', not openspace.getPropertyValue('Scene.Moon.Renderable.PerformShading'));
|
||||
]],
|
||||
Documentation = "Toggles the shading of the Moon",
|
||||
GuiPath = "/Missions/Apollo",
|
||||
isLocal = false
|
||||
}
|
||||
|
||||
local focus_moon = {
|
||||
Identifier = "os.missions.apollo.moon.focus",
|
||||
Name = "Focus on Moon",
|
||||
Command = [[
|
||||
openspace.setPropertyValueSingle('NavigationHandler.OrbitalNavigator.Aim', '');
|
||||
openspace.setPropertyValueSingle('NavigationHandler.OrbitalNavigator.Anchor', 'Moon');
|
||||
openspace.setPropertyValueSingle('NavigationHandler.OrbitalNavigator.RetargetAnchor', nil);
|
||||
]],
|
||||
Documentation = "Set camera focus on the Moon",
|
||||
GuiPath = "/Missions/Apollo",
|
||||
isLocal = false
|
||||
}
|
||||
|
||||
local focus_earth = {
|
||||
Identifier = "os.missions.apollo.earth.focus",
|
||||
Name = "Focus on Earth",
|
||||
Command = [[
|
||||
openspace.setPropertyValueSingle('NavigationHandler.OrbitalNavigator.Aim', '');
|
||||
openspace.setPropertyValueSingle('NavigationHandler.OrbitalNavigator.Anchor', 'Earth');
|
||||
openspace.setPropertyValueSingle('NavigationHandler.OrbitalNavigator.RetargetAnchor', nil);
|
||||
]],
|
||||
Documentation = "Set camera focus on the Earth",
|
||||
GuiPath = "/Missions/Apollo",
|
||||
isLocal = false
|
||||
}
|
||||
|
||||
asset.onInitialize(function()
|
||||
openspace.action.registerAction(toggle_moon_shading)
|
||||
openspace.action.registerAction(focus_moon)
|
||||
openspace.action.registerAction(focus_earth)
|
||||
end)
|
||||
|
||||
asset.onDeinitialize(function()
|
||||
openspace.action.removeAction(focus_earth)
|
||||
openspace.action.removeAction(focus_moon)
|
||||
openspace.action.removeAction(toggle_moon_shading)
|
||||
end)
|
||||
|
||||
asset.meta = {
|
||||
Name = "Actions - Apollo missions",
|
||||
Version = "1.0",
|
||||
Description = "Actions related to the Apollo missions",
|
||||
Author = "OpenSpace Team",
|
||||
URL = "http://openspaceproject.com",
|
||||
License = "MIT license"
|
||||
}
|
||||
@@ -28,9 +28,45 @@ local stations = asset.syncedResource({
|
||||
Version = 1
|
||||
})
|
||||
|
||||
|
||||
local apollo_moon_togglekaguyalayer = {
|
||||
Identifier = "os.missions.apollo.moon.togglekaguyalayer",
|
||||
Name = "Toggle Kaguya layer",
|
||||
Command = [[
|
||||
openspace.setPropertyValueSingle('Scene.Moon.Renderable.Layers.ColorLayers.Kaguya_Utah.Enabled', not openspace.getPropertyValue('Scene.Moon.Renderable.Layers.ColorLayers.Kaguya_Utah.Enabled'));
|
||||
]],
|
||||
Documentation = "Toggles Moon Kaguya color layer",
|
||||
GuiPath = "/Missions/Apollo",
|
||||
IsLocal = false
|
||||
}
|
||||
|
||||
local apollo_moon_disableapollosites= {
|
||||
Identifier = "os.missions.apollo.moon.disableapollosites",
|
||||
Name = "Disable Apollo sites",
|
||||
Command = [[
|
||||
openspace.setPropertyValue('Scene.Moon.Renderable.Layers.ColorLayers.A17_*.Enabled', false);
|
||||
openspace.setPropertyValueSingle('Scene.Moon.Renderable.Layers.HeightLayers.LRO_NAC_Apollo_11.Enabled', false);
|
||||
openspace.setPropertyValueSingle('Scene.Moon.Renderable.Layers.ColorLayers.A11_M177481212_p_longlat.Enabled', false);
|
||||
openspace.setPropertyValueSingle('Scene.Apollo11MoonTrail.Renderable.Enabled', false);
|
||||
openspace.setPropertyValueSingle('Scene.Apollo11LemTrail.Renderable.Enabled', false);
|
||||
openspace.setPropertyValueSingle('Scene.Moon.Renderable.Layers.HeightLayers.LRO_NAC_Apollo_17.Enabled', false);
|
||||
]],
|
||||
Documentation = "Disable apollo site on moon when leaving",
|
||||
GuiPath = "/Missions/Apollo",
|
||||
IsLocal = false
|
||||
}
|
||||
|
||||
asset.onInitialize(function ()
|
||||
openspace.globebrowsing.addBlendingLayersFromDirectory(heightmaps, moon_transforms.Moon.Identifier)
|
||||
openspace.globebrowsing.addBlendingLayersFromDirectory(basemaps, moon_transforms.Moon.Identifier)
|
||||
openspace.globebrowsing.addBlendingLayersFromDirectory(naclighting, moon_transforms.Moon.Identifier)
|
||||
openspace.globebrowsing.addBlendingLayersFromDirectory(stations, moon_transforms.Moon.Identifier)
|
||||
|
||||
openspace.action.registerAction(apollo_moon_togglekaguyalayer)
|
||||
openspace.action.registerAction(apollo_moon_disableapollosites)
|
||||
end)
|
||||
|
||||
asset.onDeinitialize(function ()
|
||||
openspace.action.removeAction(apollo_moon_disableapollosites)
|
||||
openspace.action.removeAction(apollo_moon_togglekaguyalayer)
|
||||
end)
|
||||
|
||||
@@ -0,0 +1,50 @@
|
||||
local setup_insight = {
|
||||
Identifier = "os.missions.insight.setup",
|
||||
Name = "Setup scene for insight EDL",
|
||||
Command = [[
|
||||
openspace.setPropertyValueSingle('Scene.Mars.Renderable.Layers.HeightLayers.Mola_Utah.Settings.Offset', -469.300000);
|
||||
openspace.setPropertyValueSingle('Scene.Mars.Renderable.Layers.HeightLayers.HiRISE-LS-DEM.Settings.Offset', -470.850006);
|
||||
openspace.setPropertyValueSingle('Scene.Mars.Renderable.Layers.HeightLayers.MDEM200M.Settings.Offset', -470.000000);
|
||||
openspace.setPropertyValueSingle('Scene.Mars.Renderable.Layers.HeightLayers.HiRISE-LS-DEM.Enabled', true);
|
||||
openspace.setPropertyValueSingle('Scene.Mars.Renderable.Layers.ColorLayers.HiRISE-LS.Enabled', true);
|
||||
openspace.time.setPause(true);
|
||||
openspace.time.setTime('2018 NOV 26 19:39:01.68');
|
||||
openspace.navigation.setNavigationState({Anchor = 'Insight',Pitch = 0.567457E-4,Position = { 1.240506E1,-1.369270E1,-2.423553E0 },ReferenceFrame = 'Root',Up = { 0.441211E0,0.247019E0,0.862737E0 },Yaw = -0.446853E-4});
|
||||
]],
|
||||
Documentation = "Set and goto Insight Landing",
|
||||
GuiPath = "/Missions/Insight",
|
||||
isLocal = false
|
||||
}
|
||||
|
||||
local setup_disablelayers = {
|
||||
Identifier = "os.missions.insight.setup.disablelayers",
|
||||
Name = "Disable insight EDL layers",
|
||||
Command = [[
|
||||
openspace.setPropertyValueSingle('Scene.Mars.Renderable.Layers.HeightLayers.Mola_Utah.Settings.Offset', 0);
|
||||
openspace.setPropertyValueSingle('Scene.Mars.Renderable.Layers.HeightLayers.HiRISE-LS-DEM.Settings.Offset', 0);
|
||||
openspace.setPropertyValueSingle('Scene.Mars.Renderable.Layers.HeightLayers.HiRISE-LS-DEM.Enabled', false);
|
||||
openspace.setPropertyValueSingle('Scene.Mars.Renderable.Layers.ColorLayers.HiRISE-LS.Enabled', false);
|
||||
]],
|
||||
Documentation = "Disable Mars layer settings used for insight EDL",
|
||||
GuiPath = "/Missions/Insight",
|
||||
isLocal = false
|
||||
}
|
||||
|
||||
asset.onInitialize(function()
|
||||
openspace.action.registerAction(setup_insight)
|
||||
openspace.action.registerAction(setup_disablelayers)
|
||||
end)
|
||||
|
||||
asset.onDeinitialize(function()
|
||||
openspace.action.removeAction(setup_disablelayers)
|
||||
openspace.action.removeAction(setup_insight)
|
||||
end)
|
||||
|
||||
asset.meta = {
|
||||
Name = "Insight Actions",
|
||||
Version = "1.0",
|
||||
Description = "Actions related to the Insight mission",
|
||||
Author = "OpenSpace Team",
|
||||
URL = "http://openspaceproject.com",
|
||||
License = "MIT license"
|
||||
}
|
||||
@@ -1,6 +1,8 @@
|
||||
asset.require("spice/base")
|
||||
asset.require("./actions")
|
||||
local sun = asset.require("scene/solarsystem/sun/sun")
|
||||
local mars = asset.require("scene/solarsystem/planets/mars/mars")
|
||||
asset.require("scene/solarsystem/planets/mars/default_layers")
|
||||
|
||||
local models = asset.syncedResource({
|
||||
Name = "Insight Models Chutes",
|
||||
|
||||
@@ -14,7 +14,7 @@ local kernels = asset.syncedResource({
|
||||
Name = "Juno Kernels",
|
||||
Type = "HttpSynchronization",
|
||||
Identifier = "juno_kernels",
|
||||
Version = 2
|
||||
Version = 3
|
||||
})
|
||||
|
||||
local JunoKernels = {
|
||||
@@ -31,6 +31,7 @@ local JunoKernels = {
|
||||
kernels .. "juno_waves_v00.ti",
|
||||
kernels .. "juno_mwr_v01.ti",
|
||||
kernels .. "spk_merge_110805_171017_130515.bsp",
|
||||
kernels .. "spk_ref_210111_251021_210111.bsp",
|
||||
kernels .. "juno_sc_nom_110807_171016_v01.bc",
|
||||
kernels .. "juno_sc_prl_110930_111028_jc003c01_v01.bc",
|
||||
kernels .. "juno_sc_prl_111028_111125_jc004b00_v01.bc",
|
||||
@@ -121,7 +122,8 @@ local JunoKernels = {
|
||||
kernels .. "juno_sc_prl_170831_170927_jm0081a00_v01.bc",
|
||||
kernels .. "juno_sc_prl_170927_171023_jm0082a00_v01.bc",
|
||||
kernels .. "juno_sc_prl_171023_171030_jm0091a00_v01.bc",
|
||||
kernels .. "juno_sc_prl_171023_171030_jm0091a00_v01.bc"
|
||||
kernels .. "juno_sc_prl_171023_171030_jm0091a00_v01.bc",
|
||||
kernels .. "juno_sc_prl_230228_230407_jm0490rp_v01.bc"
|
||||
}
|
||||
|
||||
local RotationMatrix = {
|
||||
@@ -163,7 +165,7 @@ local Juno = {
|
||||
TimeFrame = {
|
||||
Type = "TimeFrameInterval",
|
||||
Start = "2011-08-07T17:15:00",
|
||||
End = "2017-10-16T19:29:24"
|
||||
End = "2025-10-16T19:29:24"
|
||||
},
|
||||
GUI = {
|
||||
Path = "/Solar System/Missions/Juno"
|
||||
@@ -183,7 +185,7 @@ local JunoTrail = {
|
||||
},
|
||||
Color = { 0.70, 0.50, 0.20 },
|
||||
StartTime = "2016 JUL 01",
|
||||
EndTime = "2016 DEC 13",
|
||||
EndTime = "2025 DEC 13",
|
||||
SampleInterval = 3600
|
||||
},
|
||||
GUI = {
|
||||
@@ -196,11 +198,11 @@ asset.onInitialize(function()
|
||||
openspace.addSceneGraphNode(Juno)
|
||||
openspace.addSceneGraphNode(JunoTrail)
|
||||
end)
|
||||
|
||||
|
||||
asset.onDeinitialize(function()
|
||||
openspace.removeSceneGraphNode(JunoTrail)
|
||||
openspace.removeSceneGraphNode(Juno)
|
||||
end)
|
||||
|
||||
|
||||
asset.export(Juno)
|
||||
asset.export(JunoTrail)
|
||||
|
||||
@@ -0,0 +1,157 @@
|
||||
local toggle_lagrangian_points = {
|
||||
Identifier = "os.missions.jwst.togglelagrangianpoints",
|
||||
Name = "Toggle Lagrangian points",
|
||||
Command = [[
|
||||
local list = openspace.getProperty('{lagrange_points_earth}.Renderable.Enabled');
|
||||
for _,v in pairs(list) do
|
||||
openspace.setPropertyValueSingle(v, not openspace.getPropertyValue(v))
|
||||
end
|
||||
]],
|
||||
Documentation = "Toggle points and labels for the Lagrangian points for Earth Sun system",
|
||||
GuiPath = "/JWST",
|
||||
isLocal = false
|
||||
}
|
||||
|
||||
local toggle_hudf = {
|
||||
Identifier = "os.missions.jwst.togglehudf",
|
||||
Name = "Toggle Hubble Ultra Deep Field",
|
||||
Command = [[
|
||||
local list = openspace.getProperty('{mission_jwst_hudf}.*.Enabled');
|
||||
for _,v in pairs(list) do
|
||||
openspace.setPropertyValueSingle(v, not openspace.getPropertyValue(v))
|
||||
end
|
||||
]],
|
||||
Documentation = "Toggle Hubble Ultra Deep Field image and line towards its coordinate",
|
||||
GuiPath = "/JWST",
|
||||
isLocal = false
|
||||
}
|
||||
|
||||
local toggle_l2 = {
|
||||
Identifier = "os.missions.jwst.togglel2",
|
||||
Name = "Toggle L2 line and small L2 label",
|
||||
Command = [[
|
||||
local list = openspace.getProperty('{lagrange_points_earth_l2_small}.*.Enabled');
|
||||
for _,v in pairs(list) do
|
||||
openspace.setPropertyValueSingle(v, not openspace.getPropertyValue(v))
|
||||
end
|
||||
]],
|
||||
Documentation = "Toggle L2 label, point and line",
|
||||
GuiPath = "/JWST",
|
||||
isLocal = false
|
||||
}
|
||||
|
||||
local toggle_fov = {
|
||||
Identifier = "os.missions.jwst.togglefov",
|
||||
Name = "Toggle JWST field of view and view band",
|
||||
Command = [[
|
||||
local list = openspace.getProperty('{mission_jwst_fov}.*.Enabled');
|
||||
for _,v in pairs(list) do
|
||||
openspace.setPropertyValueSingle(v, not openspace.getPropertyValue(v))
|
||||
end
|
||||
]],
|
||||
Documentation = "Toggle James Webb Space Telecope field of view and view band",
|
||||
GuiPath = "/JWST",
|
||||
isLocal = false
|
||||
}
|
||||
|
||||
local setup_launch = {
|
||||
Identifier = "os.missoins.jwst.setup.launch",
|
||||
Name = "Set to JWST launch time",
|
||||
Command = [[
|
||||
openspace.time.setDeltaTime(1);
|
||||
openspace.time.setTime('2021-12-25T12:20:01');
|
||||
]],
|
||||
Documentation = "Set the time to the launch time of JWST",
|
||||
GuiPath = "/JWST",
|
||||
isLocal = false
|
||||
}
|
||||
|
||||
local setup_detach = {
|
||||
Identifier = "os.missions.jwst.setup.detach",
|
||||
Name = "Set to JWST detach time",
|
||||
Command = [[
|
||||
openspace.time.setDeltaTime(1);
|
||||
openspace.time.setTime('2021-12-25T12:50:00');
|
||||
]],
|
||||
Documentation = "Set the time to the detach time of JWST",
|
||||
GuiPath = "/JWST",
|
||||
isLocal = false
|
||||
}
|
||||
|
||||
local toggle_sun_trail = {
|
||||
Identifier = "os.missions.jwst.togglesuntrail",
|
||||
Name = "Toggle JWST Sun trail",
|
||||
Command = [[
|
||||
local value = openspace.getPropertyValue('Scene.JWSTSunTrail.Renderable.Enabled');
|
||||
openspace.setPropertyValueSingle('Scene.JWSTSunTrail.Renderable.Enabled', not value);
|
||||
]],
|
||||
Documentation = "Toggle JWST trail relative to the Sun",
|
||||
GuiPath = "/JWST",
|
||||
isLocal = false
|
||||
}
|
||||
|
||||
local toggle_trails_except_moon = {
|
||||
Identifier = "os.missions.jwst.toggletrialsexceptmoon",
|
||||
Name = "Toggle trails (except Moon)",
|
||||
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
|
||||
openspace.setPropertyValueSingle('Scene.MoonTrail.Renderable.Enabled', true)
|
||||
]],
|
||||
Documentation = "Toggle all planet and moon trails, except the Moon",
|
||||
GuiPath = "/JWST",
|
||||
isLocal = false
|
||||
}
|
||||
|
||||
local toggle_jwst_trail = {
|
||||
Identifier = "os.missions.jwst.togglejwsttrails",
|
||||
Name = "Toggle JWST trail",
|
||||
Command = [[
|
||||
local list = {'Scene.JWSTTrailLaunch.Renderable.Enabled', 'Scene.JWSTTrailCruise.Renderable.Enabled', 'Scene.JWSTTrailCoRevOrbit.Renderable.Enabled'};
|
||||
for _,v in pairs(list) do
|
||||
openspace.setPropertyValueSingle(v, not openspace.getPropertyValue(v));
|
||||
end
|
||||
]],
|
||||
Documentation = "Toggle JWST launch, cruise and L2 co-revolving orbit trails, not the Sun trail",
|
||||
GuiPath = "/JWST",
|
||||
isLocal = false
|
||||
}
|
||||
|
||||
asset.onInitialize(function()
|
||||
openspace.action.registerAction(toggle_lagrangian_points)
|
||||
openspace.action.registerAction(toggle_hudf)
|
||||
openspace.action.registerAction(toggle_l2)
|
||||
openspace.action.registerAction(toggle_fov)
|
||||
openspace.action.registerAction(setup_launch)
|
||||
openspace.action.registerAction(setup_detach)
|
||||
openspace.action.registerAction(toggle_sun_trail)
|
||||
openspace.action.registerAction(toggle_trails_except_moon)
|
||||
openspace.action.registerAction(toggle_jwst_trail)
|
||||
end)
|
||||
|
||||
asset.onDeinitialize(function()
|
||||
openspace.action.removeAction(toggle_jwst_trail)
|
||||
openspace.action.removeAction(toggle_trails_except_moon)
|
||||
openspace.action.removeAction(toggle_sun_trail)
|
||||
openspace.action.removeAction(setup_detach)
|
||||
openspace.action.removeAction(setup_launch)
|
||||
openspace.action.removeAction(toggle_fov)
|
||||
openspace.action.removeAction(toggle_l2)
|
||||
openspace.action.removeAction(toggle_hudf)
|
||||
openspace.action.removeAction(toggle_lagrangian_points)
|
||||
end)
|
||||
|
||||
asset.meta = {
|
||||
Name = "Actions - JWST",
|
||||
Version = "1.0",
|
||||
Description = "Actions related to the JWST mission",
|
||||
Author = "OpenSpace Team",
|
||||
URL = "http://openspaceproject.com",
|
||||
License = "MIT license"
|
||||
}
|
||||
@@ -1,9 +1,11 @@
|
||||
asset.require("spice/base")
|
||||
asset.require("./actions")
|
||||
asset.require("scene/solarsystem/planets/earth/layers/colorlayers/terra_modis_temporal")
|
||||
asset.require("scene/solarsystem/planets/earth/layers/colorlayers/esri_viirs_combo")
|
||||
|
||||
local sun = asset.require("scene/solarsystem/sun/sun")
|
||||
local sunTransforms = asset.require("scene/solarsystem/sun/transforms")
|
||||
local transforms = asset.require("./transforms")
|
||||
asset.require("spice/base")
|
||||
asset.require("scene/solarsystem/planets/earth/layers/colorlayers/terra_modis_temporal")
|
||||
asset.require("scene/solarsystem/planets/earth/layers/colorlayers/esri_viirs_combo")
|
||||
|
||||
local models = asset.syncedResource({
|
||||
Name = "JWST Model",
|
||||
@@ -218,7 +220,7 @@ asset.export(JWSTLabel)
|
||||
|
||||
asset.meta = {
|
||||
Name = "James Webb Space Telescope",
|
||||
Version = "1.0",
|
||||
Version = "1.1",
|
||||
Description = [[
|
||||
James Webb Space Telescope animated model, safe viewing band, field of view and label.
|
||||
]],
|
||||
|
||||
@@ -504,7 +504,7 @@ end
|
||||
|
||||
local function createActions()
|
||||
local playForwards = {
|
||||
Identifier = "jwst.play.forwards",
|
||||
Identifier = "os.missions.jwst.play.forwards",
|
||||
Name = "Play JWST from start",
|
||||
Command = [[
|
||||
openspace.scriptScheduler.clear(0)
|
||||
@@ -520,7 +520,7 @@ local function createActions()
|
||||
}
|
||||
|
||||
local playFromDetach = {
|
||||
Identifier = "jwst.play.detach",
|
||||
Identifier = "os.missions.jwst.play.detach",
|
||||
Name = "Play JWST from detach",
|
||||
Command = [[
|
||||
openspace.scriptScheduler.clear(0)
|
||||
@@ -538,7 +538,7 @@ local function createActions()
|
||||
}
|
||||
|
||||
local playBackwards = {
|
||||
Identifier = "jwst.play.backwards",
|
||||
Identifier = "os.missions.jwst.play.backwards",
|
||||
Name = "Play JWST from end",
|
||||
Command = [[
|
||||
openspace.scriptScheduler.clear(0)
|
||||
@@ -554,7 +554,7 @@ local function createActions()
|
||||
}
|
||||
|
||||
local clearPlay = {
|
||||
Identifier = "jwst.play.clear",
|
||||
Identifier = "os.missions.jwst.play.clear",
|
||||
Name = "Clear JWST timelapse",
|
||||
Command = [[
|
||||
openspace.scriptScheduler.clear(0)
|
||||
@@ -562,7 +562,7 @@ local function createActions()
|
||||
openspace.setPropertyValueSingle("Scene.Earth.Renderable.Layers.NightLayers.Earth_at_Night_2012.Settings.Gamma", 1.0)
|
||||
openspace.setPropertyValueSingle("Scene.EarthAtmosphere.Renderable.Enabled", true)
|
||||
local deltaTime = openspace.time.deltaTime()
|
||||
if deltaTime > 0 then
|
||||
if deltaTime >= 0 then
|
||||
openspace.time.setDeltaTime(1)
|
||||
else
|
||||
openspace.time.setDeltaTime(-1)
|
||||
@@ -574,7 +574,7 @@ local function createActions()
|
||||
}
|
||||
|
||||
local togglePlayDirection = {
|
||||
Identifier = "jwst.toggle.direction",
|
||||
Identifier = "os.missions.jwst.toggledirection",
|
||||
Name = "Toggle forwards / backwards",
|
||||
Command = [[
|
||||
-- Flip deltatime
|
||||
@@ -611,7 +611,7 @@ local function createActions()
|
||||
IsLocal = false
|
||||
}
|
||||
|
||||
return {playForwards, playFromDetach, playBackwards, clearPlay, togglePlayDirection}
|
||||
return { playForwards, playFromDetach, playBackwards, clearPlay, togglePlayDirection }
|
||||
end
|
||||
|
||||
local text = {
|
||||
@@ -623,7 +623,7 @@ local text = {
|
||||
|
||||
asset.onInitialize(function()
|
||||
actionsList = createActions()
|
||||
for i, action in ipairs(actionsList) do
|
||||
for _, action in ipairs(actionsList) do
|
||||
openspace.action.registerAction(action)
|
||||
end
|
||||
|
||||
@@ -642,7 +642,7 @@ end)
|
||||
|
||||
asset.meta = {
|
||||
Name = "James Webb Space Telescope Timelapse",
|
||||
Version = "1.0",
|
||||
Version = "1.1",
|
||||
Description = [[
|
||||
Scripts that are scheduled to alter the speed of the simulation time so the deployment
|
||||
of the James Webb Space Telescope looks smoother.
|
||||
|
||||
@@ -198,7 +198,7 @@ local MessengerTrail = {
|
||||
Identifier = "MessengerTrail",
|
||||
Parent = mercuryTransforms.MercuryBarycenter.Identifier,
|
||||
Renderable = {
|
||||
Type = "RenderableTrailOrbit",
|
||||
Type = "RenderableTrailTrajectory",
|
||||
Translation = {
|
||||
Type = "SpiceTranslation",
|
||||
Target = "MESSENGER",
|
||||
@@ -209,8 +209,7 @@ local MessengerTrail = {
|
||||
EnableFade = false,
|
||||
StartTime = "2011 MARCH 01 12:00:00",
|
||||
EndTime = "2011 MAY 30 12:00:00",
|
||||
Period = 12,
|
||||
Resolution = 10000
|
||||
SampleInterval = 360
|
||||
},
|
||||
GUI = {
|
||||
Name = "Messenger Trail",
|
||||
|
||||
@@ -0,0 +1,244 @@
|
||||
local focus_newhorizons = {
|
||||
Identifier = "os.missions.newhorizons.focus",
|
||||
Name = "Focus on New Horizons",
|
||||
Command = [[
|
||||
openspace.setPropertyValue('NavigationHandler.OrbitalNavigator.Anchor', 'NewHorizons');
|
||||
openspace.setPropertyValue('NavigationHandler.OrbitalNavigator.Aim', '');
|
||||
openspace.setPropertyValue('NavigationHandler.OrbitalNavigator.RetargetAnchor', nil);
|
||||
]],
|
||||
Documentation = "Sets the focus of the camera on 'NewHorizons'",
|
||||
GuiPath = "/Missions/New Horizons",
|
||||
isLocal = false
|
||||
}
|
||||
|
||||
local anchor_nh_aim_pluto = {
|
||||
Identifier = "os.missions.newhorizons.aimpluto",
|
||||
Name = "Anchor NH, Aim Pluto",
|
||||
Command = [[
|
||||
openspace.setPropertyValue('NavigationHandler.OrbitalNavigator.Anchor', 'NewHorizons');
|
||||
openspace.setPropertyValue('NavigationHandler.OrbitalNavigator.Aim', 'Pluto');
|
||||
openspace.setPropertyValue('NavigationHandler.OrbitalNavigator.RetargetAnchor', nil)
|
||||
]],
|
||||
Documentation = "Anchor at New Horizons, Aim at Pluto",
|
||||
GuiPath = "/Missions/New Horizons",
|
||||
isLocal = false
|
||||
}
|
||||
|
||||
local focus_pluto = {
|
||||
Identifier = "os.missions.newhorizons.pluto.focus",
|
||||
Name = "Focus on Pluto",
|
||||
Command = [[
|
||||
openspace.setPropertyValue('NavigationHandler.OrbitalNavigator.Anchor', 'PlutoProjection');
|
||||
openspace.setPropertyValue('NavigationHandler.OrbitalNavigator.Aim', '');
|
||||
openspace.setPropertyValue('NavigationHandler.OrbitalNavigator.RetargetAnchor', nil);
|
||||
]],
|
||||
Documentation = "Sets the focus of the camera on 'Pluto'",
|
||||
GuiPath = "/Missions/New Horizons",
|
||||
isLocal = false
|
||||
}
|
||||
|
||||
local focus_charon = {
|
||||
Identifier = "os.missions.newhorizons.charon.focus",
|
||||
Name = "Focus on Charon",
|
||||
Command = [[
|
||||
openspace.setPropertyValue('NavigationHandler.OrbitalNavigator.Anchor', 'Charon');
|
||||
openspace.setPropertyValue('NavigationHandler.OrbitalNavigator.Aim', '');
|
||||
openspace.setPropertyValue('NavigationHandler.OrbitalNavigator.RetargetAnchor', nil);
|
||||
]],
|
||||
Documentation = "Sets the focus of the camera on 'Charon'",
|
||||
GuiPath = "/Missions/New Horizons",
|
||||
isLocal = false
|
||||
}
|
||||
|
||||
local toggle_nh_imageprojection = {
|
||||
Identifier = "os.missions.newhorizons.toggleimageprojection",
|
||||
Name = "Toggle NH Image Projection",
|
||||
Command = [[
|
||||
local enabled = openspace.getPropertyValue('Scene.PlutoProjection.Renderable.ProjectionComponent.PerformProjection');
|
||||
openspace.setPropertyValue('Scene.PlutoProjection.Renderable.ProjectionComponent.PerformProjection', not enabled);
|
||||
openspace.setPropertyValue('Scene.CharonProjection.Renderable.ProjectionComponent.PerformProjection', not enabled);
|
||||
]],
|
||||
Documentation = "Toggles New Horizons image projection",
|
||||
GuiPath = "/Missions/New Horizons",
|
||||
isLocal = false
|
||||
}
|
||||
|
||||
local clear_image_projections = {
|
||||
Identifier = "os.missions.newhorizons.clearimageprojections",
|
||||
Name = "Clear image projections",
|
||||
Command = [[
|
||||
openspace.setPropertyValue('Scene.PlutoProjection.Renderable.ProjectionComponent.ClearAllProjections', true);
|
||||
openspace.setPropertyValue('Scene.CharonProjection.Renderable.ProjectionComponent.ClearAllProjections', true);
|
||||
]],
|
||||
Documentation = "Removes all image projections from Pluto and Charon",
|
||||
GuiPath = "/Missions/New Horizons",
|
||||
isLocal = false
|
||||
}
|
||||
|
||||
local approach_time_and_projections = {
|
||||
Identifier = "os.missions.newhorizons.approach",
|
||||
Name = "Reset time and projections",
|
||||
Command = [[
|
||||
openspace.time.setTime('2015-07-14T09:00:00.00');
|
||||
openspace.setPropertyValue('Scene.PlutoProjection.Renderable.ProjectionComponent.ClearAllProjections', true);
|
||||
openspace.setPropertyValue('Scene.CharonProjection.Renderable.ProjectionComponent.ClearAllProjections', true);
|
||||
]],
|
||||
Documentation = "Jumps to the 14th of July 2015 at 0900 UTC and clears all projections",
|
||||
GuiPath = "/Missions/New Horizons",
|
||||
isLocal = false
|
||||
}
|
||||
|
||||
local increase_hightmap_pluto = {
|
||||
Identifier = "os.missions.newhorizons.pluto.increasehightmap",
|
||||
Name = "Pluto HeightExaggeration +",
|
||||
Command = [[
|
||||
openspace.setPropertyValueSingle("Scene.PlutoProjection.Renderable.HeightExaggeration", openspace.getPropertyValue("Scene.PlutoProjection.Renderable.HeightExaggeration") + 5000);
|
||||
]],
|
||||
Documentation = "Increases the height map exaggeration on Pluto",
|
||||
GuiPath = "/Missions/New Horizons",
|
||||
isLocal = false
|
||||
}
|
||||
|
||||
local decrease_hightmap_pluto = {
|
||||
Identifier = "os.missions.newhorizons.pluto.decreasehightmap",
|
||||
Name = "Pluto HeightExaggeration -",
|
||||
Command = [[
|
||||
openspace.setPropertyValueSingle("Scene.PlutoProjection.Renderable.HeightExaggeration", openspace.getPropertyValue("Scene.PlutoProjection.Renderable.HeightExaggeration") - 5000);
|
||||
]],
|
||||
Documentation = "Decreases the height map exaggeration on Pluto",
|
||||
GuiPath = "/Missions/New Horizons",
|
||||
isLocal = false
|
||||
}
|
||||
|
||||
local increase_hightmap_charon = {
|
||||
Identifier = "os.missions.newhorizons.charon.increasehightmap",
|
||||
Name = "Charon HeightExaggeration +",
|
||||
Command = [[
|
||||
openspace.setPropertyValueSingle("Scene.CharonProjection.Renderable.HeightExaggeration", openspace.getPropertyValue("Scene.CharonProjection.Renderable.HeightExaggeration") + 5000);
|
||||
]],
|
||||
Documentation = "Increases the height map exaggeration on Charon",
|
||||
GuiPath = "/Missions/New Horizons",
|
||||
isLocal = false
|
||||
}
|
||||
|
||||
local decrease_hightmap_charon = {
|
||||
Identifier = "os.missions.newhorizons.charon.decreasehightmap",
|
||||
Name = "Charon HeightExaggeration -",
|
||||
Command = [[
|
||||
openspace.setPropertyValueSingle("Scene.CharonProjection.Renderable.HeightExaggeration", openspace.getPropertyValue("Scene.CharonProjection.Renderable.HeightExaggeration") - 5000);
|
||||
]],
|
||||
Documentation = "Decreases the height map exaggeration on Charon",
|
||||
GuiPath = "/Missions/New Horizons",
|
||||
isLocal = false
|
||||
}
|
||||
|
||||
local toggle_pluto_trail = {
|
||||
Identifier = "os.missions.newhorizons.pluto.toggletrail",
|
||||
Name = "Toggle Pluto Trail",
|
||||
Command = [[
|
||||
openspace.setPropertyValueSingle('Scene.PlutoBarycentricTrail.Renderable.Enabled', not openspace.getPropertyValue('Scene.PlutoBarycentricTrail.Renderable.Enabled'));
|
||||
]],
|
||||
Documentation = "Toggles the visibility of the trail behind Pluto",
|
||||
GuiPath = "/Missions/New Horizons",
|
||||
isLocal = false
|
||||
}
|
||||
|
||||
local toggle_pluto_labels = {
|
||||
Identifier = "os.missions.newhorizons.pluto.togglelabels",
|
||||
Name = "Toggle Pluto Labels",
|
||||
Command = [[
|
||||
local list = {"Scene.PlutoText.Renderable.Enabled", "Scene.CharonText.Renderable.Enabled", "Scene.HydraText.Renderable.Enabled", "Scene.NixText.Renderable.Enabled", "Scene.KerberosText.Renderable.Enabled", "Scene.StyxText.Renderable.Enabled"};
|
||||
for _,v in pairs(list) do
|
||||
openspace.setPropertyValueSingle(v, not openspace.getPropertyValue(v))
|
||||
end
|
||||
]],
|
||||
Documentation = "Toggles the visibility of the text labels of Pluto, Charon, Hydra, Nix, Kerberos, and Styx",
|
||||
GuiPath = "/Missions/New Horizons",
|
||||
isLocal = false
|
||||
}
|
||||
|
||||
local toggle_nh_labels = {
|
||||
Identifier = "os.missions.newhorizons.togglelabels",
|
||||
Name = "Toggle New Horizons Labels",
|
||||
Command = [[
|
||||
local v = openspace.getPropertyValue("Scene.Labels.Renderable.Opacity");
|
||||
if v <= 0.5 then
|
||||
openspace.setPropertyValueSingle("Scene.Labels.Renderable.Opacity",1.0,2.0)
|
||||
else
|
||||
openspace.setPropertyValueSingle("Scene.Labels.Renderable.Opacity",0.0,2.0)
|
||||
end
|
||||
]],
|
||||
Documentation = "Toggles the visibility of the labels for the New Horizons instruments",
|
||||
GuiPath = "/Missions/New Horizons",
|
||||
isLocal = false
|
||||
}
|
||||
|
||||
local toggle_shadows = {
|
||||
Identifier = "os.missions.newhorizons.toggleshadows",
|
||||
Name = "Toggle Shadows",
|
||||
Command = [[
|
||||
openspace.setPropertyValueSingle('Scene.PlutoShadow.Renderable.Enabled', not openspace.getPropertyValue('Scene.PlutoShadow.Renderable.Enabled'));
|
||||
openspace.setPropertyValueSingle('Scene.CharonShadow.Renderable.Enabled', not openspace.getPropertyValue('Scene.CharonShadow.Renderable.Enabled'));
|
||||
]],
|
||||
Documentation = "Toggles the visibility of the shadow visualization of Pluto and Charon",
|
||||
GuiPath = "/Missions/New Horizons",
|
||||
isLocal = false
|
||||
}
|
||||
|
||||
local toggle_nh_trail = {
|
||||
Identifier = "os.missions.newhorizons.toggletrail",
|
||||
Name = "Toggle NH Trail",
|
||||
Command = [[
|
||||
openspace.setPropertyValueSingle('Scene.NewHorizonsTrailPluto.Renderable.Enabled', not openspace.getPropertyValue('Scene.NewHorizonsTrailPluto.Renderable.Enabled'));
|
||||
]],
|
||||
Documentation = "Toggles the trail of New Horizons",
|
||||
GuiPath = "/Missions/New Horizons",
|
||||
isLocal = false
|
||||
}
|
||||
|
||||
asset.onInitialize(function()
|
||||
openspace.action.registerAction(focus_newhorizons)
|
||||
openspace.action.registerAction(anchor_nh_aim_pluto)
|
||||
openspace.action.registerAction(focus_pluto)
|
||||
openspace.action.registerAction(focus_charon)
|
||||
openspace.action.registerAction(toggle_nh_imageprojection)
|
||||
openspace.action.registerAction(clear_image_projections)
|
||||
openspace.action.registerAction(approach_time_and_projections)
|
||||
openspace.action.registerAction(decrease_hightmap_pluto)
|
||||
openspace.action.registerAction(increase_hightmap_charon)
|
||||
openspace.action.registerAction(decrease_hightmap_charon)
|
||||
openspace.action.registerAction(toggle_pluto_trail)
|
||||
openspace.action.registerAction(toggle_pluto_labels)
|
||||
openspace.action.registerAction(toggle_nh_labels)
|
||||
openspace.action.registerAction(toggle_shadows)
|
||||
openspace.action.registerAction(toggle_nh_trail)
|
||||
openspace.action.registerAction(increase_hightmap_pluto)
|
||||
end)
|
||||
|
||||
asset.onDeinitialize(function()
|
||||
openspace.action.removeAction(increase_hightmap_pluto)
|
||||
openspace.action.removeAction(toggle_nh_trail)
|
||||
openspace.action.removeAction(toggle_shadows)
|
||||
openspace.action.removeAction(toggle_nh_labels)
|
||||
openspace.action.removeAction(toggle_pluto_labels)
|
||||
openspace.action.removeAction(toggle_pluto_trail)
|
||||
openspace.action.removeAction(decrease_hightmap_charon)
|
||||
openspace.action.removeAction(increase_hightmap_charon)
|
||||
openspace.action.removeAction(decrease_hightmap_pluto)
|
||||
openspace.action.removeAction(approach_time_and_projections)
|
||||
openspace.action.removeAction(clear_image_projections)
|
||||
openspace.action.removeAction(toggle_nh_imageprojection)
|
||||
openspace.action.removeAction(focus_charon)
|
||||
openspace.action.removeAction(focus_pluto)
|
||||
openspace.action.removeAction(anchor_nh_aim_pluto)
|
||||
openspace.action.removeAction(focus_newhorizons)
|
||||
end)
|
||||
|
||||
asset.meta = {
|
||||
Name = "New Horizons actions",
|
||||
Version = "1.0",
|
||||
Description = "Actions for the New Horizons mission",
|
||||
Author = "OpenSpace Team",
|
||||
URL = "http://openspaceproject.com",
|
||||
License = "MIT license"
|
||||
}
|
||||
@@ -8,6 +8,8 @@ asset.require("./charon")
|
||||
|
||||
asset.require("./othermoons")
|
||||
|
||||
asset.require("./actions")
|
||||
|
||||
local mission = asset.localResource("newhorizons.mission")
|
||||
local missionName
|
||||
|
||||
|
||||
@@ -0,0 +1,113 @@
|
||||
local focus_osirisrex = {
|
||||
Identifier = "os.missions.osirisrex.focus",
|
||||
Name = "Focus on OsirisRex",
|
||||
Command = [[
|
||||
openspace.setPropertyValue('NavigationHandler.OrbitalNavigator.Anchor', 'OsirisRex');
|
||||
openspace.setPropertyValue('NavigationHandler.OrbitalNavigator.Aim', '');
|
||||
openspace.setPropertyValue('NavigationHandler.OrbitalNavigator.RetargetAnchor', nil);
|
||||
]],
|
||||
Documentation = "Sets the focus of the camera on 'OsirisRex'",
|
||||
GuiPath = "/Missions/Osiris Rex",
|
||||
isLocal = false
|
||||
}
|
||||
|
||||
local focus_bennu = {
|
||||
Identifier = "os.missions.osirisrex.bennu.focus",
|
||||
Name = "Focus on Bennu",
|
||||
Command = [[
|
||||
openspace.setPropertyValue('NavigationHandler.OrbitalNavigator.Anchor', 'BennuBarycenter');
|
||||
openspace.setPropertyValue('NavigationHandler.OrbitalNavigator.Aim', '');
|
||||
openspace.setPropertyValue('NavigationHandler.OrbitalNavigator.RetargetAnchor', nil);
|
||||
]],
|
||||
Documentation = "Sets the focus of the camera on 'Bennu'",
|
||||
GuiPath = "/Missions/Osiris Rex",
|
||||
isLocal = false
|
||||
}
|
||||
|
||||
local bennu_approach_time = {
|
||||
Identifier = "os.missions.osirisrex.setup.bennuapproach",
|
||||
Name = "Set Bennu approach time",
|
||||
Command = [[
|
||||
openspace.printInfo('Set time: Approach');
|
||||
openspace.time.setTime('2018-SEP-11 21:31:01.183');
|
||||
]],
|
||||
Documentation = "Sets the time to the approach at Bennu",
|
||||
GuiPath = "/Missions/Osiris Rex",
|
||||
isLocal = false
|
||||
}
|
||||
|
||||
local bennu_survey_time = {
|
||||
Identifier = "os.missions.osirisrex.setup.bennusurvey",
|
||||
Name = "Set Bennu survey time",
|
||||
Command = [[
|
||||
openspace.printInfo('Set time: Preliminary Survey');
|
||||
openspace.time.setTime('2018-NOV-20 01:13:12.183');
|
||||
]],
|
||||
Documentation = "Sets the time to the preliminary survey of Bennu",
|
||||
GuiPath = "/Missions/Osiris Rex",
|
||||
isLocal = false
|
||||
}
|
||||
|
||||
local bennu_event_b = {
|
||||
Identifier = "os.missions.osirisrex.setup.bennueventb",
|
||||
Name = "Set orbital B event time",
|
||||
Command = [[
|
||||
openspace.printInfo('Set time: Orbital B');
|
||||
openspace.time.setTime('2019-APR-08 10:35:27.186');
|
||||
]],
|
||||
Documentation = "Sets the time to the orbital B event",
|
||||
GuiPath = "/Missions/Osiris Rex",
|
||||
isLocal = false
|
||||
}
|
||||
|
||||
local bennu_recon_event = {
|
||||
Identifier = "os.missions.osirisrex.setup.bennureconevent",
|
||||
Name = "Set recon event time",
|
||||
Command = [[
|
||||
openspace.printInfo('Set time: Recon');
|
||||
openspace.time.setTime('2019-MAY-25 03:50:31.195');
|
||||
]],
|
||||
Documentation = "Sets the time to the recon event",
|
||||
GuiPath = "/Missions/Osiris Rex",
|
||||
isLocal = false
|
||||
}
|
||||
|
||||
local toggle_sun_marker = {
|
||||
Identifier = "os.missions.osirisrex.togglesunmarker",
|
||||
Name = "Toggle Sun marker",
|
||||
Command = [[
|
||||
openspace.setPropertyValueSingle('Scene.SunMarker.Renderable.Enabled', not openspace.getPropertyValue('Scene.SunMarker.Renderable.Enabled'));
|
||||
]],
|
||||
Documentation = "Toggles the visibility of the text marking the location of the Sun",
|
||||
GuiPath = "/Missions/Osiris Rex",
|
||||
isLocal = false
|
||||
}
|
||||
|
||||
asset.onInitialize(function()
|
||||
openspace.action.registerAction(focus_osirisrex)
|
||||
openspace.action.registerAction(focus_bennu)
|
||||
openspace.action.registerAction(bennu_approach_time)
|
||||
openspace.action.registerAction(bennu_survey_time)
|
||||
openspace.action.registerAction(bennu_event_b)
|
||||
openspace.action.registerAction(bennu_recon_event)
|
||||
openspace.action.registerAction(toggle_sun_marker)
|
||||
end)
|
||||
|
||||
asset.onDeinitialize(function()
|
||||
openspace.action.removeAction(toggle_sun_marker)
|
||||
openspace.action.removeAction(bennu_recon_event)
|
||||
openspace.action.removeAction(bennu_event_b)
|
||||
openspace.action.removeAction(bennu_survey_time)
|
||||
openspace.action.removeAction(bennu_approach_time)
|
||||
openspace.action.removeAction(focus_bennu)
|
||||
openspace.action.removeAction(focus_osirisrex)
|
||||
end)
|
||||
|
||||
asset.meta = {
|
||||
Name = "OsirisRex Actions",
|
||||
Version = "1.0",
|
||||
Description = "Actions related to the OsirisRex mission",
|
||||
Author = "OpenSpace Team",
|
||||
URL = "http://openspaceproject.com",
|
||||
License = "MIT license"
|
||||
}
|
||||
@@ -116,7 +116,7 @@ local Rexis = {
|
||||
}
|
||||
|
||||
local PolyCamFov = {
|
||||
Identifier = "POLYCAM FOV",
|
||||
Identifier = "POLYCAM_FOV",
|
||||
Parent = PolyCam.Identifier,
|
||||
Renderable = {
|
||||
Type = "RenderableFov",
|
||||
@@ -171,7 +171,7 @@ local nodes = {
|
||||
}
|
||||
|
||||
asset.onInitialize(function()
|
||||
for i, node in ipairs(nodes) do
|
||||
for _, node in ipairs(nodes) do
|
||||
openspace.addSceneGraphNode(node)
|
||||
end
|
||||
end)
|
||||
|
||||
@@ -5,6 +5,7 @@ asset.require("./trail")
|
||||
asset.require("scene/solarsystem/sun/marker")
|
||||
|
||||
asset.require("./script_schedule")
|
||||
asset.require("./actions")
|
||||
|
||||
local mission = asset.localResource("osirisrex.mission")
|
||||
local missionName
|
||||
|
||||
@@ -0,0 +1,34 @@
|
||||
local setup_perseverance = {
|
||||
Identifier = "os.missions.perseverance.setup",
|
||||
Name = "Setup and Goto Perseverance",
|
||||
Command = [[
|
||||
openspace.setPropertyValueSingle('Scene.Mars.Renderable.Layers.HeightLayers.Mola_Utah.Settings.Offset', -1685.5);
|
||||
openspace.setPropertyValueSingle('Scene.Mars.Renderable.Layers.HeightLayers.HiRISE-LS-DEM.Settings.Offset', -1686.0);
|
||||
openspace.setPropertyValueSingle('Scene.Mars.Renderable.Layers.HeightLayers.MDEM200M.Settings.Offset', -1686);
|
||||
openspace.time.setPause(true);
|
||||
openspace.time.setTime('2021 FEB 18 20:32:16');
|
||||
openspace.setPropertyValueSingle('Scene.Mars.Renderable.Layers.HeightLayers.HiRISE-LS-DEM.Enabled', true);
|
||||
openspace.setPropertyValueSingle('Scene.Mars.Renderable.Layers.ColorLayers.HiRISE-LS.Enabled', true);
|
||||
openspace.navigation.setNavigationState({Anchor = 'Perseverance',Pitch = 0.567457E-4,Position = { 1.240506E1,-1.369270E1,-2.423553E0 },ReferenceFrame = 'Root',Up = { 0.441211E0,0.247019E0,0.862737E0 },Yaw = -0.446853E-4});
|
||||
]],
|
||||
Documentation = "Sets time and layers for Perseverance landing",
|
||||
GuiPath = "/Missions/Perseverance",
|
||||
isLocal = false
|
||||
}
|
||||
|
||||
asset.onInitialize(function()
|
||||
openspace.action.registerAction(setup_perseverance)
|
||||
end)
|
||||
|
||||
asset.onDeinitialize(function()
|
||||
openspace.action.removeAction(setup_perseverance)
|
||||
end)
|
||||
|
||||
asset.meta = {
|
||||
Name = "Perseverance Actions",
|
||||
Version = "1.0",
|
||||
Description = "Actions related to the Perseverance mission",
|
||||
Author = "OpenSpace Team",
|
||||
URL = "http://openspaceproject.com",
|
||||
License = "MIT license"
|
||||
}
|
||||
@@ -1,2 +1,5 @@
|
||||
asset.require("./model")
|
||||
asset.require("./trail")
|
||||
asset.require("./actions")
|
||||
asset.require("scene/solarsystem/planets/mars/mars")
|
||||
asset.require("scene/solarsystem/planets/mars/default_layers")
|
||||
|
||||
@@ -20,10 +20,11 @@ local images = asset.syncedResource({
|
||||
Name = "Rosetta Images",
|
||||
Type = "HttpSynchronization",
|
||||
Identifier = "rosettaimages",
|
||||
Version = 2
|
||||
Version = 2,
|
||||
UnzipFiles = true
|
||||
})
|
||||
|
||||
local imagesDestination = images .. "images"
|
||||
local imagesDestination = images .. "images_v1_v2"
|
||||
|
||||
local Barycenter = {
|
||||
Identifier = "67PBarycenter",
|
||||
@@ -70,7 +71,7 @@ local Comet67P = {
|
||||
Spice = { "ROS_NAVCAM-A" }
|
||||
}
|
||||
},
|
||||
Target = {
|
||||
Target = {
|
||||
Read = {
|
||||
"TARGET_NAME",
|
||||
"INSTRUMENT_HOST_NAME",
|
||||
@@ -130,22 +131,58 @@ local Trail67P = {
|
||||
}
|
||||
}
|
||||
|
||||
asset.onInitialize(function()
|
||||
if not openspace.directoryExists(imagesDestination) then
|
||||
openspace.printInfo("Extracting Rosetta images")
|
||||
openspace.unzipFile(images .. "images_v1_v2.zip", imagesDestination, true)
|
||||
end
|
||||
end)
|
||||
-- actions
|
||||
local focus_67p = {
|
||||
Identifier = "os.missions.rosetta.67p.focus",
|
||||
Name = "Focus on 67P",
|
||||
Command = [[
|
||||
openspace.setPropertyValue('NavigationHandler.OrbitalNavigator.Anchor', '67P');
|
||||
openspace.setPropertyValue('NavigationHandler.OrbitalNavigator.Aim', '');
|
||||
openspace.setPropertyValue('NavigationHandler.OrbitalNavigator.RetargetAnchor', nil);
|
||||
]],
|
||||
Documentation = "Sets the focus of the camera on 67P",
|
||||
GuiPath = "/Missions/Rosetta",
|
||||
isLocal = false
|
||||
}
|
||||
|
||||
local clear_image_projections_67p = {
|
||||
Identifier = "os.missions.rosetta.67p.clearimageprojections",
|
||||
Name = "Clear 67P projections",
|
||||
Command = [[
|
||||
openspace.setPropertyValue('Scene.67P.Renderable.ProjectionComponent.ClearAllProjections', true);
|
||||
]],
|
||||
Documentation = "Removes all image projections from 67P",
|
||||
GuiPath = "/Missions/Rosetta",
|
||||
isLocal = false
|
||||
}
|
||||
|
||||
local toggle_67p_projection = {
|
||||
Identifier = "os.missions.rosetta.toggle67pprojection",
|
||||
Name = "Toggle 67P projection",
|
||||
Command = [[
|
||||
openspace.setPropertyValueSingle('Scene.67P.Renderable.ProjectionComponent.PerformProjection', not openspace.getPropertyValue('Scene.67P.Renderable.ProjectionComponent.PerformProjection'));
|
||||
]],
|
||||
Documentation = "Enables or disables the image projection on 67P",
|
||||
GuiPath = "/Missions/Rosetta",
|
||||
isLocal = false
|
||||
}
|
||||
|
||||
|
||||
asset.onInitialize(function()
|
||||
openspace.addSceneGraphNode(Barycenter)
|
||||
openspace.addSceneGraphNode(Comet67P)
|
||||
openspace.addSceneGraphNode(Trail67P)
|
||||
|
||||
openspace.action.registerAction(focus_67p)
|
||||
openspace.action.registerAction(clear_image_projections_67p)
|
||||
openspace.action.registerAction(toggle_67p_projection)
|
||||
end)
|
||||
|
||||
asset.onDeinitialize(function()
|
||||
openspace.action.removeAction(toggle_67p_projection)
|
||||
openspace.action.removeAction(clear_image_projections_67p)
|
||||
openspace.action.removeAction(focus_67p)
|
||||
|
||||
openspace.removeSceneGraphNode(Trail67P)
|
||||
openspace.removeSceneGraphNode(Comet67P)
|
||||
openspace.removeSceneGraphNode(Barycenter)
|
||||
|
||||
@@ -0,0 +1,30 @@
|
||||
local toggle_outer_planetary_trails = {
|
||||
Identifier = "os.missions.rosetta.toggleouterplanetarytrails",
|
||||
Name = "Toggle outer planetary trails",
|
||||
Command = [[
|
||||
local list = openspace.getProperty('{planetTrail_giants}.Renderable.Enabled');
|
||||
for _,v in pairs(list) do
|
||||
openspace.setPropertyValueSingle(v, not openspace.getPropertyValue(v))
|
||||
end
|
||||
]],
|
||||
Documentation = "Toggles the visibility of all trails further from the Sun than 67P",
|
||||
GuiPath = "/Missions/Rosetta",
|
||||
isLocal = false
|
||||
}
|
||||
|
||||
asset.onInitialize(function()
|
||||
openspace.action.registerAction(toggle_outer_planetary_trails)
|
||||
end)
|
||||
|
||||
asset.onDeinitialize(function()
|
||||
openspace.action.removeAction(toggle_outer_planetary_trails)
|
||||
end)
|
||||
|
||||
asset.meta = {
|
||||
Name = "Rosetta actions",
|
||||
Version = "1.0",
|
||||
Description = "Actions related to the rosetta mission",
|
||||
Author = "OpenSpace Team",
|
||||
URL = "http://openspaceproject.com",
|
||||
License = "MIT license"
|
||||
}
|
||||
@@ -2,7 +2,6 @@ local sun = asset.require("scene/solarsystem/sun/sun")
|
||||
local sunTransforms = asset.require("scene/solarsystem/sun/transforms")
|
||||
local transforms = asset.require("./67p")
|
||||
|
||||
|
||||
local models = asset.syncedResource({
|
||||
Name = "Rosetta Models",
|
||||
Type = "HttpSynchronization",
|
||||
@@ -556,13 +555,70 @@ local nodes = {
|
||||
PhilaeTrail
|
||||
}
|
||||
|
||||
-- actions
|
||||
local focus_rosetta = {
|
||||
Identifier = "os.missions.rosetta.focus",
|
||||
Name = "Focus on Rosetta",
|
||||
Command = [[
|
||||
openspace.setPropertyValue('NavigationHandler.OrbitalNavigator.Anchor', 'Rosetta');
|
||||
openspace.setPropertyValue('NavigationHandler.OrbitalNavigator.Aim', '');
|
||||
openspace.setPropertyValue('NavigationHandler.OrbitalNavigator.RetargetAnchor', nil);
|
||||
]],
|
||||
Documentation = "Sets the focus of the camera on Rosetta",
|
||||
GuiPath = "/Missions/Rosetta",
|
||||
isLocal = false
|
||||
}
|
||||
|
||||
local setup_lander_release_time = {
|
||||
Identifier = "os.missions.rosetta.setup.landerrelease",
|
||||
Name = "Set lander release time",
|
||||
Command = [[
|
||||
openspace.time.setTime('2014-11-12T08:20:00.00');
|
||||
]],
|
||||
Documentation = "Jumps to the time when the Philae lander is released",
|
||||
GuiPath = "/Missions/Rosetta",
|
||||
isLocal = false
|
||||
}
|
||||
|
||||
local toggle_image_plane = {
|
||||
Identifier = "os.missions.rosetta.toggleimageplane",
|
||||
Name = "Toggle image plane",
|
||||
Command = [[
|
||||
openspace.setPropertyValueSingle('Scene.ImagePlaneRosetta.Renderable.Enabled', not openspace.getPropertyValue('Scene.ImagePlaneRosetta.Renderable.Enabled'));
|
||||
]],
|
||||
Documentation = "Toggles the visibility of the free floating image plane",
|
||||
GuiPath = "/Missions/Rosetta",
|
||||
isLocal = false
|
||||
}
|
||||
|
||||
local toggle_philae_trail = {
|
||||
Identifier = "os.mission.rosetta.togglephilaetrail",
|
||||
Name = "Toggle Philae trail",
|
||||
Command = [[
|
||||
openspace.setPropertyValueSingle('Scene.PhilaeTrail.Renderable.Enabled', not openspace.getPropertyValue('Scene.PhilaeTrail.Renderable.Enabled'));
|
||||
]],
|
||||
Documentation = "Toggles the visibility of Philae's trail",
|
||||
GuiPath = "/Missions/Rosetta",
|
||||
isLocal = false
|
||||
}
|
||||
|
||||
asset.onInitialize(function ()
|
||||
for i, node in ipairs(nodes) do
|
||||
for _, node in ipairs(nodes) do
|
||||
openspace.addSceneGraphNode(node)
|
||||
end
|
||||
|
||||
openspace.action.registerAction(focus_rosetta)
|
||||
openspace.action.registerAction(setup_lander_release_time)
|
||||
openspace.action.registerAction(toggle_image_plane)
|
||||
openspace.action.registerAction(toggle_philae_trail)
|
||||
end)
|
||||
|
||||
asset.onDeinitialize(function ()
|
||||
openspace.action.removeAction(toggle_philae_trail)
|
||||
openspace.action.removeAction(toggle_image_plane)
|
||||
openspace.action.removeAction(setup_lander_release_time)
|
||||
openspace.action.removeAction(focus_rosetta)
|
||||
|
||||
for i = #nodes, 1, -1 do
|
||||
openspace.removeSceneGraphNode(nodes[i])
|
||||
end
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user