merging master into thesis branch

This commit is contained in:
OLSSON
2020-02-19 10:22:47 -05:00
1344 changed files with 20390 additions and 15165 deletions

2
.gitmodules vendored
View File

@@ -16,7 +16,7 @@
branch = OpenSpace
[submodule "apps/OpenSpace/ext/sgct"]
path = apps/OpenSpace/ext/sgct
url = https://github.com/opensgct/sgct
url = https://github.com/sgct/sgct
[submodule "modules/fitsfilereader/ext/CCfits"]
path = modules/fitsfilereader/ext/CCfits
url = https://github.com/OpenSpace/CCfits.git

View File

@@ -2,7 +2,7 @@
# #
# OpenSpace #
# #
# Copyright (c) 2014-2019 #
# Copyright (c) 2014-2020 #
# #
# Permission is hereby granted, free of charge, to any person obtaining a copy of this #
# software and associated documentation files (the "Software"), to deal in the Software #
@@ -28,7 +28,7 @@ project(OpenSpace)
set(OPENSPACE_VERSION_MAJOR 0)
set(OPENSPACE_VERSION_MINOR 15)
set(OPENSPACE_VERSION_PATCH 0)
set(OPENSPACE_VERSION_PATCH 1)
set(OPENSPACE_VERSION_STRING "Beta-5")
@@ -43,7 +43,6 @@ include(${OPENSPACE_CMAKE_EXT_DIR}/handle_modules.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(${GHOUL_BASE_DIR}/support/cmake/include_gtest.cmake)
begin_header("Configuring OpenSpace project")
message(STATUS "CMake version: ${CMAKE_VERSION}")
@@ -51,7 +50,7 @@ message(STATUS "CMake version: ${CMAKE_VERSION}")
# Bail out if the user tries to generate a 32 bit project.
if (NOT ${CMAKE_SIZEOF_VOID_P} EQUAL 8)
message(FATAL_ERROR "OpenSpace can only be generated for 64 bit architectures.")
endif()
endif ()
##########################################################################################
# Cleanup project #
@@ -64,7 +63,7 @@ if (NOT EXISTS ${OPENSPACE_EXT_DIR}/ghoul/CMakeLists.txt)
"git submodule update --init --recursive \n"
"to download the missing dependencies."
)
endif()
endif ()
set_property(GLOBAL PROPERTY USE_FOLDERS On)
set_property(GLOBAL PROPERTY PREDEFINED_TARGETS_FOLDER CMake)
@@ -107,10 +106,34 @@ if (NOT OPENSPACE_GIT_STATUS_RETURN EQUAL 0)
set(OPENSPACE_GIT_STATUS "uncommitted changes")
else()
set(OPENSPACE_GIT_STATUS "")
endif()
endif ()
option(OPENSPACE_WARNINGS_AS_ERRORS "Treat warnings as errors" OFF)
if (MSVC)
option(OPENSPACE_OPTIMIZATION_ENABLE_AVX "Enable AVX instruction set for compilation" OFF)
option(OPENSPACE_OPTIMIZATION_ENABLE_AVX2 "Enable AVX2 instruction set for compilation" OFF)
option(OPENSPACE_OPTIMIZATION_ENABLE_AVX512 "Enable AVX2 instruction set for compilation" OFF)
option(OPENSPACE_OPTIMIZATION_ENABLE_OTHER_OPTIMIZATIONS "Enable other optimizations, like LTCG, intrinsics, etc")
if (OPENSPACE_OPTIMIZATION_ENABLE_AVX AND OPENSPACE_OPTIMIZATION_ENABLE_AVX2)
message(FATAL_ERROR "Cannot enable AVX and AVX2 instructions simultaneously")
endif ()
if (OPENSPACE_OPTIMIZATION_ENABLE_AVX AND OPENSPACE_OPTIMIZATION_ENABLE_AVX512)
message(FATAL_ERROR "Cannot enable AVX and AVX512 instructions simultaneously")
endif ()
if (OPENSPACE_OPTIMIZATION_ENABLE_AVX2 AND OPENSPACE_OPTIMIZATION_ENABLE_AVX512)
message(FATAL_ERROR "Cannot enable AVX2 and AVX512 instructions simultaneously")
endif ()
set(GHOUL_OPTIMIZATION_ENABLE_AVX ${OPENSPACE_OPTIMIZATION_ENABLE_AVX} CACHE BOOL "" FORCE)
set(GHOUL_OPTIMIZATION_ENABLE_AVX2 ${OPENSPACE_OPTIMIZATION_ENABLE_AVX2} CACHE BOOL "" FORCE)
set(GHOUL_OPTIMIZATION_ENABLE_AVX512 ${OPENSPACE_OPTIMIZATION_ENABLE_AVX512} CACHE BOOL "" FORCE)
set(GHOUL_OPTIMIZATION_ENABLE_OTHER_OPTIMIZATIONS ${OPENSPACE_OPTIMIZATION_ENABLE_OTHER_OPTIMIZATIONS} CACHE BOOL "" FORCE)
endif ()
include(src/CMakeLists.txt)
##########################################################################################
@@ -128,11 +151,12 @@ if (APPLE)
target_link_libraries(openspace-core ${CARBON_LIBRARY} ${COREFOUNDATION_LIBRARY}
${COCOA_LIBRARY} ${APP_SERVICES_LIBRARY})
end_dependency()
endif()
endif ()
# Ghoul
add_subdirectory(${OPENSPACE_EXT_DIR}/ghoul)
target_link_libraries(openspace-core Ghoul)
set_openspace_compile_settings(Ghoul)
set_folder_location(Lua "External")
set_folder_location(lz4 "External")
set_folder_location(GhoulTest "Unit Tests")
@@ -159,7 +183,7 @@ else ()
target_link_libraries(openspace-core ${CURL_LIBRARIES})
target_compile_definitions(openspace-core PUBLIC "OPENSPACE_CURL_ENABLED")
endif ()
endif()
endif ()
end_dependency()
# Qt
@@ -205,40 +229,8 @@ if (MSVC)
target_include_directories(openspace-core PUBLIC "${OPENSPACE_NVTOOLS_PATH}/include")
end_dependency()
endif ()
endif ()
##########################################################################################
# Tests #
##########################################################################################
option(OPENSPACE_HAVE_TESTS "Activate the OpenSpace unit tests" ON)
if (OPENSPACE_HAVE_TESTS)
include_gtest("${GHOUL_BASE_DIR}/ext/googletest")
file(GLOB_RECURSE OPENSPACE_TEST_FILES ${OPENSPACE_BASE_DIR}/tests/*.inl)
add_executable(OpenSpaceTest ${OPENSPACE_BASE_DIR}/tests/main.cpp ${OPENSPACE_TEST_FILES})
target_include_directories(OpenSpaceTest PUBLIC
"${OPENSPACE_BASE_DIR}/include"
"${OPENSPACE_BASE_DIR}/tests"
"${OPENSPACE_EXT_DIR}/ghoul/ext/googletest/googletest/include"
)
target_compile_definitions(OpenSpaceTest PUBLIC
"GHL_THROW_ON_ASSERT" "GTEST_HAS_TR1_TUPLE=0"
)
target_link_libraries(OpenSpaceTest gtest openspace-core)
set_folder_location(OpenSpaceTest "Unit Tests")
if (MSVC)
set_target_properties(OpenSpaceTest PROPERTIES LINK_FLAGS
"/NODEFAULTLIB:LIBCMTD.lib /NODEFAULTLIB:LIBCMT.lib"
)
endif ()
set_openspace_compile_settings(OpenSpaceTest)
endif (OPENSPACE_HAVE_TESTS)
begin_header("Configuring Modules")
set(OPENSPACE_EXTERNAL_MODULES_PATHS "" CACHE STRING "List of external modules")
handle_modules("${OPENSPACE_BASE_DIR}/modules" "${OPENSPACE_EXTERNAL_MODULES_PATHS}")
@@ -250,6 +242,13 @@ handle_applications()
end_header("End: Configuring Applications")
message(STATUS "")
option(OPENSPACE_HAVE_TESTS "Activate the OpenSpace unit tests" ON)
if (OPENSPACE_HAVE_TESTS)
begin_header("Generating OpenSpace unit test")
add_subdirectory("${OPENSPACE_BASE_DIR}/tests")
end_header()
endif (OPENSPACE_HAVE_TESTS)
# Web Browser and Web gui
# Why not put these in the module's path? Because they do not have access to the
@@ -268,11 +267,6 @@ if (OPENSPACE_MODULE_WEBBROWSER AND CEF_ROOT)
# find CEF to initialize it properly.
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${WEBBROWSER_MODULE_PATH}/cmake")
include(webbrowser_helpers)
if (TARGET OpenSpaceTest)
set_cef_targets("${CEF_ROOT}" OpenSpaceTest)
run_cef_platform_config("${CEF_ROOT}" "${CEF_TARGET}" "${WEBBROWSER_MODULE_PATH}")
endif ()
elseif (OPENSPACE_MODULE_WEBBROWSER)
message(WARNING "Web configured to be included, but no CEF_ROOT was found, please try configuring CMake again.")
endif ()

View File

@@ -1,4 +1,4 @@
Copyright (c) 2014-2019
Copyright (c) 2014-2020
Permission is hereby granted, free of charge, to any person obtaining a copy of this
software and associated documentation files (the "Software"), to deal in the Software

View File

@@ -2,7 +2,7 @@
# #
# OpenSpace #
# #
# Copyright (c) 2014-2019 #
# Copyright (c) 2014-2020 #
# #
# Permission is hereby granted, free of charge, to any person obtaining a copy of this #
# software and associated documentation files (the "Software"), to deal in the Software #

View File

@@ -2,7 +2,7 @@
* *
* OpenSpace *
* *
* Copyright (c) 2014-2019 *
* Copyright (c) 2014-2020 *
* *
* Permission is hereby granted, free of charge, to any person obtaining a copy of this *
* software and associated documentation files (the "Software"), to deal in the Software *

View File

@@ -2,7 +2,7 @@
# #
# OpenSpace #
# #
# Copyright (c) 2014-2019 #
# Copyright (c) 2014-2020 #
# #
# Permission is hereby granted, free of charge, to any person obtaining a copy of this #
# software and associated documentation files (the "Software"), to deal in the Software #
@@ -61,7 +61,7 @@ if (OPENSPACE_OPENVR_SUPPORT)
)
endif ()
end_header("Dependency: OpenVR")
endif()
endif ()
#####
# Spout
@@ -72,7 +72,15 @@ if (SGCT_SPOUT_SUPPORT AND NOT OPENSPACE_MODULE_SPOUT)
set(OPENSPACE_MODULE_SPOUT ON CACHE BOOL "Build OPENSPACE_MODULE_SPOUTModule" FORCE)
endif ()
set(MACOSX_BUNDLE_ICON_FILE openspace.icns)
#####
# macos
#####
if (APPLE)
set(MACOSX_BUNDLE_ICON_FILE openspace.icns)
set(CMAKE_OSX_DEPLOYMENT_TARGET "10.14" CACHE STRING "Minimum OS X deployment version" FORCE)
set(CMAKE_XCODE_ATTRIBUTE_OTHER_CODE_SIGN_FLAGS "--deep" CACHE STRING "Other Code Signing Flags" FORCE)
endif ()
create_new_application(OpenSpace
${SGCT_OPENVR_FILES}

View File

@@ -2,7 +2,7 @@
* *
* OpenSpace *
* *
* Copyright (c) 2014-2019 *
* Copyright (c) 2014-2020 *
* *
* Permission is hereby granted, free of charge, to any person obtaining a copy of this *
* software and associated documentation files (the "Software"), to deal in the Software *
@@ -45,6 +45,8 @@
#include <chrono>
#include <ctime>
#include <stb_image.h>
#include <Tracy.hpp>
#include <TracyOpenGL.hpp>
#ifdef WIN32
#include <openspace/openspace.h>
@@ -249,11 +251,20 @@ std::pair<int, int> supportedOpenGLVersion() {
return { major, minor };
}
//
// Context creation function
//
void mainContextCreationFunc(GLFWwindow* win) {
// @TODO (abock, 2020-02-10) Remove this after updating SGCT to 3.0
TracyGpuContext
}
//
// Init function
//
void mainInitFunc() {
ZoneScoped
#ifdef OPENSPACE_HAS_VTUNE
if (EnableDetailedVtune) {
__itt_frame_begin_v3(_vTune.init, nullptr);
@@ -383,7 +394,10 @@ void mainInitFunc() {
for (size_t i = 0; i < nWindows; ++i) {
sgct::SGCTWindow* w = SgctEngine->getWindowPtr(i);
constexpr const char* screenshotNames = "OpenSpace";
const std::string screenshotNames = nWindows > 1 ?
fmt::format("OpenSpace_{}", i) :
"OpenSpace";
sgct_core::ScreenCapture* cpt0 = w->getScreenCapturePointer(0);
sgct_core::ScreenCapture* cpt1 = w->getScreenCapturePointer(1);
@@ -407,6 +421,12 @@ void mainInitFunc() {
void mainPreSyncFunc() {
// @TODO (abock, 2020-02-10) Remove this after merging SGCT version 3.0
FrameMark
ZoneScoped
#ifdef OPENSPACE_HAS_VTUNE
if (EnableDetailedVtune) {
__itt_frame_begin_v3(_vTune.preSync, nullptr);
@@ -414,12 +434,20 @@ void mainPreSyncFunc() {
#endif // OPENSPACE_HAS_VTUNE
LTRACE("main::mainPreSyncFunc(begin)");
global::openSpaceEngine.preSynchronization();
try {
global::openSpaceEngine.preSynchronization();
}
catch (const ghoul::RuntimeError& e) {
LFATALC(e.component, e.message);
sgct::Engine::instance()->terminate();
}
// Query joystick status
using namespace interaction;
for (int i = GLFW_JOYSTICK_1; i <= GLFW_JOYSTICK_LAST; ++i) {
ZoneScopedN("Joystick state");
JoystickInputState& state = global::joystickInputStates[i];
int present = glfwJoystickPresent(i);
@@ -503,6 +531,8 @@ void mainPreSyncFunc() {
void mainPostSyncPreDrawFunc() {
ZoneScoped
#ifdef OPENSPACE_HAS_VTUNE
if (EnableDetailedVtune) {
__itt_frame_begin_v3(_vTune.postSyncPreDraw, nullptr);
@@ -537,6 +567,8 @@ void mainPostSyncPreDrawFunc() {
void mainRenderFunc() {
ZoneScoped
#ifdef OPENSPACE_HAS_VTUNE
if (EnableDetailedVtune) {
__itt_frame_begin_v3(_vTune.render, nullptr);
@@ -585,6 +617,8 @@ void mainRenderFunc() {
void mainDraw2DFunc() {
ZoneScoped
#ifdef OPENSPACE_HAS_VTUNE
if (EnableDetailedVtune) {
__itt_frame_begin_v3(_vTune.draw2D, nullptr);
@@ -615,6 +649,8 @@ void mainDraw2DFunc() {
void mainPostDrawFunc() {
ZoneScoped
#ifdef OPENSPACE_HAS_VTUNE
if (EnableDetailedVtune) {
__itt_frame_begin_v3(_vTune.postDraw, nullptr);
@@ -670,6 +706,8 @@ void mainPostDrawFunc() {
void mainKeyboardCallback(int key, int, int action, int modifiers) {
ZoneScoped
#ifdef OPENSPACE_HAS_VTUNE
if (EnableDetailedVtune) {
__itt_frame_begin_v3(_vTune.keyboard, nullptr);
@@ -693,6 +731,8 @@ void mainKeyboardCallback(int key, int, int action, int modifiers) {
void mainMouseButtonCallback(int key, int action, int modifiers) {
ZoneScoped
#ifdef OPENSPACE_HAS_VTUNE
if (EnableDetailedVtune) {
__itt_frame_begin_v3(_vTune.mouseButton, nullptr);
@@ -716,6 +756,8 @@ void mainMouseButtonCallback(int key, int action, int modifiers) {
void mainMousePosCallback(double x, double y) {
ZoneScoped
#ifdef OPENSPACE_HAS_VTUNE
if (EnableDetailedVtune) {
__itt_frame_begin_v3(_vTune.mousePos, nullptr);
@@ -734,6 +776,8 @@ void mainMousePosCallback(double x, double y) {
void mainMouseScrollCallback(double posX, double posY) {
ZoneScoped
#ifdef OPENSPACE_HAS_VTUNE
if (EnableDetailedVtune) {
__itt_frame_begin_v3(_vTune.mouseScroll, nullptr);
@@ -754,6 +798,8 @@ void mainMouseScrollCallback(double posX, double posY) {
void mainCharCallback(unsigned int codepoint, int modifiers) {
ZoneScoped
#ifdef OPENSPACE_HAS_VTUNE
if (EnableDetailedVtune) {
__itt_frame_begin_v3(_vTune.character, nullptr);
@@ -773,6 +819,8 @@ void mainCharCallback(unsigned int codepoint, int modifiers) {
void mainEncodeFun() {
ZoneScoped
#ifdef OPENSPACE_HAS_VTUNE
if (EnableDetailedVtune) {
__itt_frame_begin_v3(_vTune.encode, nullptr);
@@ -795,6 +843,8 @@ void mainEncodeFun() {
void mainDecodeFun() {
ZoneScoped
#ifdef OPENSPACE_HAS_VTUNE
if (EnableDetailedVtune) {
__itt_frame_begin_v3(_vTune.decode, nullptr);
@@ -817,6 +867,8 @@ void mainDecodeFun() {
void mainLogCallback(const char* msg) {
ZoneScoped
std::string message = msg;
if (message.empty() || message == ".") {
// We don't want the empty '.' message that SGCT sends while it is waiting for
@@ -834,12 +886,18 @@ void setSgctDelegateFunctions() {
WindowDelegate& sgctDelegate = global::windowDelegate;
sgctDelegate.terminate = []() { sgct::Engine::instance()->terminate(); };
sgctDelegate.setBarrier = [](bool enabled) {
ZoneScoped
sgct::SGCTWindow::setBarrier(enabled);
};
sgctDelegate.setSynchronization = [](bool enabled) {
ZoneScoped
sgct_core::ClusterManager::instance()->setUseIgnoreSync(enabled);
};
sgctDelegate.clearAllWindows = [](const glm::vec4& clearColor) {
ZoneScoped
size_t n = sgct::Engine::instance()->getNumberOfWindows();
for (size_t i = 0; i < n; ++i) {
glClearColor(clearColor.r, clearColor.g, clearColor.b, clearColor.a);
@@ -849,27 +907,51 @@ void setSgctDelegateFunctions() {
}
};
sgctDelegate.windowHasResized = []() {
ZoneScoped
return sgct::Engine::instance()->getCurrentWindowPtr()->isWindowResized();
};
sgctDelegate.averageDeltaTime = []() { return sgct::Engine::instance()->getAvgDt(); };
sgctDelegate.averageDeltaTime = []() {
ZoneScoped
return sgct::Engine::instance()->getAvgDt();
};
sgctDelegate.deltaTimeStandardDeviation = []() {
ZoneScoped
return sgct::Engine::instance()->getDtStandardDeviation();
};
sgctDelegate.minDeltaTime = []() {
ZoneScoped
return sgct::Engine::instance()->getMinDt();
};
sgctDelegate.maxDeltaTime = []() {
ZoneScoped
return sgct::Engine::instance()->getMaxDt();
};
sgctDelegate.deltaTime = []() { return sgct::Engine::instance()->getDt(); };
sgctDelegate.applicationTime = []() { return sgct::Engine::getTime(); };
sgctDelegate.deltaTime = []() {
ZoneScoped
return sgct::Engine::instance()->getDt();
};
sgctDelegate.applicationTime = []() {
ZoneScoped
return sgct::Engine::getTime();
};
sgctDelegate.mousePosition = []() {
ZoneScoped
int id = sgct::Engine::instance()->getCurrentWindowPtr()->getId();
double posX, posY;
sgct::Engine::getMousePos(id, &posX, &posY);
return glm::vec2(posX, posY);
};
sgctDelegate.mouseButtons = [](int maxNumber) {
ZoneScoped
int id = sgct::Engine::instance()->getCurrentWindowPtr()->getId();
uint32_t result = 0;
for (int i = 0; i < maxNumber; ++i) {
@@ -881,12 +963,21 @@ void setSgctDelegateFunctions() {
return result;
};
sgctDelegate.currentWindowSize = []() {
ZoneScoped
return glm::ivec2(
sgct::Engine::instance()->getCurrentWindowPtr()->getXResolution(),
sgct::Engine::instance()->getCurrentWindowPtr()->getYResolution());
};
sgctDelegate.currentSubwindowSize = []() {
ZoneScoped
auto window = sgct::Engine::instance()->getCurrentWindowPtr();
if (sgct::Engine::instance()->getCurrentWindowPtr()->getNumberOfViewports() > 1) {
sgct_core::Viewport* viewport =
sgct::Engine::instance()->getCurrentWindowPtr()->getViewport(0);
return glm::ivec2(window->getXResolution()*viewport->getXSize(), window->getYResolution()*viewport->getYSize());
}
switch (window->getStereoMode()) {
case sgct::SGCTWindow::Side_By_Side_Stereo:
case sgct::SGCTWindow::Side_By_Side_Inverted_Stereo:
@@ -899,12 +990,16 @@ void setSgctDelegateFunctions() {
}
};
sgctDelegate.currentWindowResolution = []() {
ZoneScoped
int x, y;
auto window = sgct::Engine::instance()->getCurrentWindowPtr();
window->getFinalFBODimensions(x, y);
return glm::ivec2(x, y);
};
sgctDelegate.currentDrawBufferResolution = []() {
ZoneScoped
sgct_core::Viewport* viewport =
sgct::Engine::instance()->getCurrentWindowPtr()->getViewport(0);
if (viewport != nullptr) {
@@ -912,6 +1007,12 @@ void setSgctDelegateFunctions() {
int res = viewport->getNonLinearProjectionPtr()->getCubemapResolution();
return glm::ivec2(res, res);
}
else if (sgct::Engine::instance()->getCurrentWindowPtr()->getNumberOfViewports() > 1) {
int x, y;
auto window = sgct::Engine::instance()->getCurrentWindowPtr();
window->getFinalFBODimensions(x, y);
return glm::ivec2(x*viewport->getXSize(), y*viewport->getYSize());
}
else {
int x, y;
auto window = sgct::Engine::instance()->getCurrentWindowPtr();
@@ -922,6 +1023,8 @@ void setSgctDelegateFunctions() {
return glm::ivec2(-1, -1);
};
sgctDelegate.currentViewportSize = []() {
ZoneScoped
sgct_core::Viewport* viewport =
sgct::Engine::instance()->getCurrentWindowPtr()->getViewport(0);
if (viewport != nullptr) {
@@ -933,25 +1036,21 @@ void setSgctDelegateFunctions() {
return glm::ivec2(-1, -1);
};
sgctDelegate.dpiScaling = []() {
ZoneScoped
return glm::vec2(
sgct::Engine::instance()->getCurrentWindowPtr()->getXScale(),
sgct::Engine::instance()->getCurrentWindowPtr()->getYScale()
);
};
sgctDelegate.currentNumberOfAaSamples = []() {
ZoneScoped
return sgct::Engine::instance()->getCurrentWindowPtr()->getNumberOfAASamples();
};
sgctDelegate.isRegularRendering = []() {
sgct::SGCTWindow* w = sgct::Engine::instance()->getCurrentWindowPtr();
ghoul_assert(
w->getNumberOfViewports() > 0,
"At least one viewport must exist at this time"
);
sgct_core::Viewport* vp = w->getViewport(0);
sgct_core::NonLinearProjection* nlp = vp->getNonLinearProjectionPtr();
return nlp == nullptr;
};
sgctDelegate.hasGuiWindow = []() {
ZoneScoped
auto engine = sgct::Engine::instance();
for (size_t i = 0; i < engine->getNumberOfWindows(); ++i) {
if (engine->getWindowPtr(i)->checkIfTagExists("GUI")) {
@@ -961,84 +1060,130 @@ void setSgctDelegateFunctions() {
return false;
};
sgctDelegate.isGuiWindow = []() {
ZoneScoped
return sgct::Engine::instance()->getCurrentWindowPtr()->checkIfTagExists("GUI");
};
sgctDelegate.isMaster = []() { return sgct::Engine::instance()->isMaster(); };
sgctDelegate.isMaster = []() {
ZoneScoped
return sgct::Engine::instance()->isMaster();
};
sgctDelegate.isUsingSwapGroups = []() {
ZoneScoped
return sgct::SGCTWindow::isUsingSwapGroups();
};
sgctDelegate.isSwapGroupMaster = []() {
ZoneScoped
return sgct::SGCTWindow::isSwapGroupMaster();
};
sgctDelegate.viewProjectionMatrix = []() {
ZoneScoped
return sgct::Engine::instance()->getCurrentModelViewProjectionMatrix();
};
sgctDelegate.modelMatrix = []() {
ZoneScoped
return sgct::Engine::instance()->getModelMatrix();
};
sgctDelegate.setNearFarClippingPlane = [](float nearPlane, float farPlane) {
ZoneScoped
sgct::Engine::instance()->setNearAndFarClippingPlanes(nearPlane, farPlane);
};
sgctDelegate.setEyeSeparationDistance = [](float distance) {
ZoneScoped
sgct::Engine::instance()->setEyeSeparation(distance);
};
sgctDelegate.viewportPixelCoordinates = []() {
ZoneScoped
sgct::SGCTWindow* window = sgct::Engine::instance()->getCurrentWindowPtr();
if (!window || !window->getCurrentViewport()) {
return glm::ivec4(0, 0, 0, 0);
return glm::ivec4(0);
}
else {
const int* data = sgct::Engine::instance()->getCurrentViewportPixelCoords();
return glm::ivec4(data[0], data[2], data[1], data[3]);
}
};
sgctDelegate.isExternalControlConnected = []() {
return sgct::Engine::instance()->isExternalControlConnected();
};
sgctDelegate.sendMessageToExternalControl = [](const std::vector<char>& message) {
ZoneScoped
sgct::Engine::instance()->sendMessageToExternalControl(
message.data(),
static_cast<int>(message.size())
);
};
sgctDelegate.isSimpleRendering = []() {
return (sgct::Engine::instance()->getCurrentRenderTarget() !=
sgct::Engine::NonLinearBuffer);
};
sgctDelegate.isFisheyeRendering = []() {
ZoneScoped
sgct::SGCTWindow* w = sgct::Engine::instance()->getCurrentWindowPtr();
return dynamic_cast<sgct_core::FisheyeProjection*>(
w->getViewport(0)->getNonLinearProjectionPtr()
) != nullptr;
};
sgctDelegate.takeScreenshot = [](bool applyWarping) {
ZoneScoped
sgct::SGCTSettings::instance()->setCaptureFromBackBuffer(applyWarping);
sgct::Engine::instance()->takeScreenshot();
return sgct::Engine::instance()->getScreenShotNumber();
};
sgctDelegate.swapBuffer = []() {
ZoneScoped
GLFWwindow* w = glfwGetCurrentContext();
glfwSwapBuffers(w);
glfwPollEvents();
};
sgctDelegate.nWindows = []() {
ZoneScoped
return static_cast<int>(sgct::Engine::instance()->getNumberOfWindows());
};
sgctDelegate.currentWindowId = []() {
ZoneScoped
return sgct::Engine::instance()->getCurrentWindowPtr()->getId();
};
sgctDelegate.openGLProcedureAddress = [](const char* func) {
ZoneScoped
return glfwGetProcAddress(func);
};
sgctDelegate.getHorizFieldOfView = []() {
ZoneScoped
return static_cast<double>(
sgct::Engine::instance()->getWindowPtr(0)->getHorizFieldOfViewDegrees()
);
};
sgctDelegate.setHorizFieldOfView = [](float hFovDeg) {
ZoneScoped
sgct::SGCTWindow* w = sgct::Engine::instance()->getWindowPtr(0);
w->setHorizFieldOfView(hFovDeg);
};
#ifdef WIN32
sgctDelegate.getNativeWindowHandle = [](size_t windowIndex) -> void* {
ZoneScoped
sgct::SGCTWindow* w = sgct::Engine::instance()->getWindowPtr(windowIndex);
if (w) {
HWND hWnd = glfwGetWin32Window(w->getWindowHandle());
return reinterpret_cast<void*>(hWnd);
}
return nullptr;
};
#endif // WIN32
sgctDelegate.frustumMode = []() {
ZoneScoped
using FM = sgct_core::Frustum::FrustumMode;
switch (sgct::Engine::instance()->getCurrentFrustumMode()) {
case FM::MonoEye: return WindowDelegate::Frustum::Mono;
@@ -1047,6 +1192,8 @@ void setSgctDelegateFunctions() {
}
};
sgctDelegate.swapGroupFrameNumber = []() {
ZoneScoped
unsigned int fn = 0;
sgct::Engine::instance()->getCurrentWindowPtr()->getSwapGroupFrameNumber(fn);
return static_cast<uint64_t>(fn);
@@ -1172,7 +1319,7 @@ int main(int argc, char** argv) {
configurationFilePath
);
// If the user requested a commandline-based configuation script that should
// If the user requested a commandline-based configuration script that should
// overwrite some of the values, this is the time to do it
if (!commandlineArguments.configurationOverride.empty()) {
LDEBUG("Executing Lua script passed through the commandline:");
@@ -1232,6 +1379,7 @@ int main(int argc, char** argv) {
SgctEngine = new sgct::Engine(arguments);
// Bind functions
SgctEngine->setContextCreationCallback(mainContextCreationFunc);
SgctEngine->setInitOGLFunction(mainInitFunc);
SgctEngine->setPreSyncFunction(mainPreSyncFunc);
SgctEngine->setPostSyncPreDrawFunction(mainPostSyncPreDrawFunc);

View File

@@ -2,7 +2,7 @@
# #
# OpenSpace #
# #
# Copyright (c) 2014-2018 #
# Copyright (c) 2014-2020 #
# #
# Permission is hereby granted, free of charge, to any person obtaining a copy of this #
# software and associated documentation files (the "Software"), to deal in the Software #

View File

@@ -2,7 +2,7 @@
* *
* OpenSpace *
* *
* Copyright (c) 2014-2019 *
* Copyright (c) 2014-2020 *
* *
* Permission is hereby granted, free of charge, to any person obtaining a copy of this *
* software and associated documentation files (the "Software"), to deal in the Software *

View File

@@ -2,7 +2,7 @@
# #
# OpenSpace #
# #
# Copyright (c) 2014-2018 #
# Copyright (c) 2014-2020 #
# #
# Permission is hereby granted, free of charge, to any person obtaining a copy of this #
# software and associated documentation files (the "Software"), to deal in the Software #

View File

@@ -2,7 +2,7 @@
* *
* OpenSpace *
* *
* Copyright (c) 2014-2019 *
* Copyright (c) 2014-2020 *
* *
* Permission is hereby granted, free of charge, to any person obtaining a copy of this *
* software and associated documentation files (the "Software"), to deal in the Software *

View File

@@ -1,86 +0,0 @@
/*****************************************************************************************
* *
* OpenSpace *
* *
* Copyright (c) 2014-2019 *
* *
* Permission is hereby granted, free of charge, to any person obtaining a copy of this *
* software and associated documentation files (the "Software"), to deal in the Software *
* without restriction, including without limitation the rights to use, copy, modify, *
* merge, publish, distribute, sublicense, and/or sell copies of the Software, and to *
* permit persons to whom the Software is furnished to do so, subject to the following *
* conditions: *
* *
* The above copyright notice and this permission notice shall be included in all copies *
* or substantial portions of the Software. *
* *
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, *
* INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A *
* PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT *
* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF *
* CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE *
* OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. *
****************************************************************************************/
#include "configurationwidget.h"
#include <QGridLayout>
#include <QGroupBox>
#include <QLabel>
#include <QTimer>
ConfigurationWidget::ConfigurationWidget(QWidget* parent)
: QWidget(parent)
, _ipAddress(new QLineEdit("localhost"))
, _port(new QLineEdit("20500"))
, _connect(new QPushButton("Connect"))
{
_connect->setObjectName("connection");
QGroupBox* box = new QGroupBox("Connection", this);
QGridLayout* layout = new QGridLayout;
layout->setVerticalSpacing(0);
{
QLabel* t = new QLabel("IP Address");
t->setObjectName("label");
layout->addWidget(t, 0, 0);
}
layout->addWidget(_ipAddress, 1, 0);
{
QLabel* t = new QLabel("Port");
t->setObjectName("label");
layout->addWidget(t, 0, 1);
}
layout->addWidget(_port, 1, 1);
layout->addWidget(_connect, 1, 2, 1, 1);
box->setLayout(layout);
QHBoxLayout* l = new QHBoxLayout;
l->addWidget(box);
setLayout(l);
QObject::connect(_connect, SIGNAL(clicked()), this, SLOT(onConnectButton()));
QTimer::singleShot(100, this, SLOT(onConnectButton()));
}
void ConfigurationWidget::onConnectButton() {
emit connect(_ipAddress->text(), _port->text());
}
void ConfigurationWidget::socketConnected() {
_ipAddress->setEnabled(false);
_port->setEnabled(false);
_connect->setText("Disconnect");
QObject::disconnect(_connect, SIGNAL(clicked()), this, SLOT(onConnectButton()));
QObject::connect(_connect, SIGNAL(clicked()), this, SIGNAL(disconnect()));
}
void ConfigurationWidget::socketDisconnected() {
_ipAddress->setEnabled(true);
_port->setEnabled(true);
_connect->setText("Connect");
QObject::disconnect(_connect, SIGNAL(clicked()), this, SIGNAL(disconnect()));
QObject::connect(_connect, SIGNAL(clicked()), this, SLOT(onConnectButton()));
}

View File

@@ -1,319 +0,0 @@
/*****************************************************************************************
* *
* OpenSpace *
* *
* Copyright (c) 2014-2019 *
* *
* Permission is hereby granted, free of charge, to any person obtaining a copy of this *
* software and associated documentation files (the "Software"), to deal in the Software *
* without restriction, including without limitation the rights to use, copy, modify, *
* merge, publish, distribute, sublicense, and/or sell copies of the Software, and to *
* permit persons to whom the Software is furnished to do so, subject to the following *
* conditions: *
* *
* The above copyright notice and this permission notice shall be included in all copies *
* or substantial portions of the Software. *
* *
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, *
* INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A *
* PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT *
* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF *
* CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE *
* OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. *
****************************************************************************************/
#include "controlwidget.h"
#include "mainwindow.h"
#include <QComboBox>
#include <QGridLayout>
#include <QGroupBox>
#include <QHBoxLayout>
#include <QLabel>
#include <QPushButton>
#include <QSlider>
#include <math.h>
namespace {
struct ImportantDate {
QString date;
QString focus;
QString coordinateSystem;
};
const ImportantDate ImportantDates[] = {
{ "", "", "" },
{ "2007-02-27T16:40:00.00", "JupiterProjection", "Jupiter" },
{ "2015-07-14T10:10:00.00", "PlutoProjection", "Pluto" },
{ "2015-07-14T10:50:00.00", "PlutoProjection", "Pluto" },
{ "2015-07-14T11:22:00.00", "PlutoProjection", "Pluto" },
{ "2015-07-14T11:36:40.00", "PlutoProjection", "Pluto" },
{ "2015-07-14T11:48:43.00", "PlutoProjection", "Pluto" },
{ "2015-07-14T12:04:35.00", "PlutoProjection", "Pluto" },
{ "2015-07-14T15:02:46.00", "PlutoProjection", "Pluto" }
};
struct FocusNode {
QString guiName;
QString name;
QString coordinateSystem;
};
const FocusNode FocusNodes[] = {
{ "Earth", "Earth", "Sun" },
{ "Sun", "Sun", "Sun" },
{ "Pluto", "PlutoProjection", "Pluto" },
{ "Charon", "Charon", "Pluto" },
{ "Jupiter", "JupiterProjection", "Jupiter" },
{ "Nix", "Nix", "Pluto" },
{ "Kerberos", "Kerberos", "Pluto" },
{ "Hydra", "Hydra", "Pluto" },
};
}
ControlWidget::ControlWidget(QWidget* parent)
: QWidget(parent)
, _currentTime(new QLabel(""))
, _setTime(new QComboBox)
, _currentDelta(new QLabel(""))
, _setDelta(new QSlider(Qt::Horizontal))
, _pause(new QPushButton("Pause"))
, _play(new QPushButton("Play"))
, _focusNode(new QComboBox)
, _setFocusToNextTarget(new QPushButton("Set Focus to the next Target"))
, _setFocusToNewHorizons(new QPushButton("Set Focus to New Horizons"))
{
_pause->setObjectName("pause");
_play->setObjectName("play");
_currentTime->setObjectName("value");
_currentDelta->setObjectName("value");
for (const ImportantDate& d : ImportantDates)
_setTime->addItem(d.date);
QObject::connect(
_setTime,
SIGNAL(currentIndexChanged(int)),
this,
SLOT(onDateChange())
);
for (const FocusNode& f : FocusNodes)
_focusNode->addItem(f.guiName);
QObject::connect(
_focusNode,
SIGNAL(currentIndexChanged(int)),
this,
SLOT(onFocusChange())
);
_setDelta->setMinimum(-100);
_setDelta->setMaximum(100);
_setDelta->setValue(0);
QObject::connect(
_setDelta,
SIGNAL(valueChanged(int)),
this,
SLOT(onValueChange())
);
QObject::connect(
_pause,
SIGNAL(clicked()),
this,
SLOT(onPauseButton())
);
QObject::connect(
_play,
SIGNAL(clicked()),
this,
SLOT(onPlayButton())
);
QObject::connect(
_setFocusToNextTarget,
SIGNAL(clicked()),
this,
SLOT(onFocusToTargetButton())
);
QObject::connect(
_setFocusToNewHorizons,
SIGNAL(clicked()),
this,
SLOT(onFocusToNewHorizonsButton())
);
QVBoxLayout* mainLayout = new QVBoxLayout;
{
QGroupBox* box = new QGroupBox("Time", this);
QGridLayout* layout = new QGridLayout;
//layout->setRowStretch(1, 5);
box->setLayout(layout);
{
QLabel* l = new QLabel("Current Time (UTC):");
l->setObjectName("label");
layout->addWidget(l, 0, 0, Qt::AlignLeft);
layout->addWidget(_currentTime, 0, 1, Qt::AlignRight);
}
{
QLabel* l = new QLabel("Bookmarked Times:");
l->setObjectName("label");
layout->addWidget(l, 1, 0, Qt::AlignLeft);
layout->addWidget(_setTime, 1, 1, Qt::AlignRight);
}
layout->addItem(new QSpacerItem(0, 7), 2, 0, 1, 2);
{
QLabel* l = new QLabel("Current Time Increment\n(seconds per second):");
l->setObjectName("label");
layout->addWidget(l, 3, 0, Qt::AlignLeft);
layout->addWidget(_currentDelta, 3, 1, Qt::AlignRight);
}
_setDelta->setObjectName("background");
layout->addWidget(_setDelta, 4, 0, 1, 2);
QWidget* controlContainer = new QWidget;
controlContainer->setObjectName("background");
QHBoxLayout* controlContainerLayout = new QHBoxLayout;
controlContainerLayout->addWidget(_pause);
controlContainerLayout->addWidget(_play);
controlContainer->setLayout(controlContainerLayout);
layout->addWidget(controlContainer, 5, 0, 1, 2);
mainLayout->addWidget(box);
}
{
QGroupBox* box = new QGroupBox("Focus");
QGridLayout* layout = new QGridLayout;
box->setLayout(layout);
{
QLabel* l = new QLabel("Set Focus:");
l->setObjectName("label");
layout->addWidget(l, 0, 0, Qt::AlignLeft);
_focusNode->setMinimumWidth(200);
layout->addWidget(_focusNode, 0, 1, Qt::AlignRight);
}
layout->addWidget(_setFocusToNextTarget, 1, 0, 1, 2);
layout->addWidget(_setFocusToNewHorizons, 2, 0, 1, 2);
mainLayout->addWidget(box);
}
setLayout(mainLayout);
}
void ControlWidget::update(QString currentTime, QString currentDelta) {
currentTime.replace("T", " ");
_currentTime->setText(currentTime);
_currentDelta->setText(currentDelta);
}
void ControlWidget::onValueChange() {
float value = static_cast<float>(_setDelta->value());
float delta;
if (value < 0.f) {
value = -value;
float d = pow(3, value / 10) - 1.f;
delta = -d;
}
else {
float d = pow(3, value / 10) - 1.f;
delta = d;
}
QString script = "openspace.time.setDeltaTime(" + QString::number(delta) + ");";
emit scriptActivity(script);
}
void ControlWidget::onPauseButton() {
QString script = "openspace.time.setPause(true);";
emit scriptActivity(script);
}
void ControlWidget::onPlayButton() {
QString script = "openspace.time.setPause(false);";
emit scriptActivity(script);
}
void ControlWidget::onDateChange() {
int index = _setTime->currentIndex();
if (index != 0) {
QString date = ImportantDates[index].date;
QString focus = ImportantDates[index].focus;
QString coordinateSystem = ImportantDates[index].coordinateSystem;
QString script =
"openspace.time.setTime('" + date + "');\
openspace.setPropertyValue('Interaction.origin', '" + focus + "');\
openspace.setPropertyValue('Interaction.coordinateSystem', '" +
coordinateSystem + "')";
emit scriptActivity(script);
}
_setTime->blockSignals(true);
_setTime->setCurrentIndex(0);
_setTime->blockSignals(false);
}
void ControlWidget::onFocusChange() {
int index = _focusNode->currentIndex();
QString name = FocusNodes[index].name;
QString coordinateSystem = FocusNodes[index].coordinateSystem;
QString script = "openspace.setPropertyValue('Interaction.origin', '" + name +
"');openspace.setPropertyValue('Interaction.coordinateSystem', '" +
coordinateSystem + "');";
emit scriptActivity(script);
}
void ControlWidget::onFocusToTargetButton() {
std::string target = reinterpret_cast<MainWindow*>(parent())->nextTarget();
if (!target.empty()) {
auto it = std::find_if(
std::begin(FocusNodes),
std::end(FocusNodes),
[target](const FocusNode& n) {
return n.guiName.toLower() == QString::fromStdString(target).toLower();
});
if (it != std::end(FocusNodes)) {
QString name = it->name;
QString coordinateSystem = it->coordinateSystem;
QString script =
"openspace.setPropertyValue('Interaction.origin', '" + name +
"');openspace.setPropertyValue('Interaction.coordinateSystem', '" +
coordinateSystem + "');";
emit scriptActivity(script);
}
}
}
void ControlWidget::onFocusToNewHorizonsButton() {
QString coordinateSystem;
int date = _currentTime->text().left(4).toInt();
if (date < 2008)
coordinateSystem = "Jupiter";
else if (date < 2014)
coordinateSystem = "Sun";
else
coordinateSystem = "Pluto";
QString script = "openspace.setPropertyValue('Interaction.origin', 'NewHorizons');\
openspace.setPropertyValue('Interaction.coordinateSystem', '" + coordinateSystem +
"');";
emit scriptActivity(script);
}
void ControlWidget::socketConnected() {
setDisabled(false);
}
void ControlWidget::socketDisconnected() {
setDisabled(true);
}

View File

@@ -1,69 +0,0 @@
/*****************************************************************************************
* *
* OpenSpace *
* *
* Copyright (c) 2014-2019 *
* *
* Permission is hereby granted, free of charge, to any person obtaining a copy of this *
* software and associated documentation files (the "Software"), to deal in the Software *
* without restriction, including without limitation the rights to use, copy, modify, *
* merge, publish, distribute, sublicense, and/or sell copies of the Software, and to *
* permit persons to whom the Software is furnished to do so, subject to the following *
* conditions: *
* *
* The above copyright notice and this permission notice shall be included in all copies *
* or substantial portions of the Software. *
* *
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, *
* INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A *
* PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT *
* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF *
* CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE *
* OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. *
****************************************************************************************/
#ifndef __OPENSPACE_APP_TIMELINEVIEW___CONTROLWIDGET___H__
#define __OPENSPACE_APP_TIMELINEVIEW___CONTROLWIDGET___H__
#include <QWidget>
class QComboBox;
class QLabel;
class QPushButton;
class QSlider;
class ControlWidget : public QWidget {
Q_OBJECT
public:
ControlWidget(QWidget* parent);
void update(QString currentTime, QString currentDelta);
void socketConnected();
void socketDisconnected();
signals:
void scriptActivity(QString script);
private slots:
void onValueChange();
void onDateChange();
void onFocusChange();
void onPauseButton();
void onPlayButton();
void onFocusToTargetButton();
void onFocusToNewHorizonsButton();
private:
QLabel* _currentTime;
QComboBox* _setTime;
QLabel* _currentDelta;
QSlider* _setDelta;
QPushButton* _pause;
QPushButton* _play;
QComboBox* _focusNode;
QPushButton* _setFocusToNextTarget;
QPushButton* _setFocusToNewHorizons;
};
#endif // __OPENSPACE_APP_TIMELINEVIEW___CONTROLWIDGET___H__

View File

@@ -1,160 +0,0 @@
/*****************************************************************************************
* *
* OpenSpace *
* *
* Copyright (c) 2014-2019 *
* *
* Permission is hereby granted, free of charge, to any person obtaining a copy of this *
* software and associated documentation files (the "Software"), to deal in the Software *
* without restriction, including without limitation the rights to use, copy, modify, *
* merge, publish, distribute, sublicense, and/or sell copies of the Software, and to *
* permit persons to whom the Software is furnished to do so, subject to the following *
* conditions: *
* *
* The above copyright notice and this permission notice shall be included in all copies *
* or substantial portions of the Software. *
* *
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, *
* INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A *
* PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT *
* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF *
* CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE *
* OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. *
****************************************************************************************/
#include <QApplication>
#include "mainwindow.h"
static const QString style = R"style(
QWidget {
background-color: rgb(80, 80, 80);
font-family: Helvetica;
}
QGroupBox {
background-color: qlineargradient(
x1: 0, y1: 0, x2: 0, y2: 1,
stop: 0 #858585,
stop: 1 #959595);
border: 2px solid gray;
border-radius: 5px;
margin-top: 4ex;
font-size: bold 12px;
}
QGroupBox::title {
background-color: #E0E0E0;
border: 2px solid gray;
border-radius: 5px;
subcontrol-origin: margin;
subcontrol-position: top center;
padding: 0 10px;
}
QLineEdit {
color: lightgray;
}
QSlider::groove:horizontal {
border: 1px solid #999999;
/* the groove expands to the size of the slider by default. by giving it a height,
it has a fixed size */
height: 8px;
background: qlineargradient(
x1:0, y1:0, x2:1, y2:0,
stop:0 #c4c4c4,
stop:0.5 #555555,
stop:1 #c4c4c4
);
margin: 2px 0;
}
QSlider::handle:horizontal {
background: qlineargradient(x1:0, y1:0, x2:0, y2:1, stop:0 #b4b4b4, stop:1 #8f8f8f);
border: 1px solid #5c5c5c;
width: 18px;
/* handle is placed by default on the contents rect of the groove.
Expand outside the groove */
margin: -2px 0;
border-radius: 3px;
}
QPushButton {
background-color: lightgray;
border-style: outset;
border-width: 0.5px;
border-radius: 5px;
border-color: black;
font: bold 12px;
min-width: 10em;
}
QPushButton#connection {
background-color: lightgreen;
}
QPushButton#connection:pressed {
background-color: green;
}
QPushButton#pause, QPushButton#play {
padding: 5px;
}
QPushButton#pause:pressed, QPushButton#play:pressed, QPushButton:pressed {
background-color: darkgray;
border-style: inset;
}
QCombobox {
border: 1px solid gray;
border-radius: 3px;
padding: 1px 18px 1px 3px;
min-width: 6em;
}
QComboBox:editable {
background: lightgrey;
}
QComboBox QAbstractItemView {
border: 2px solid darkgray;
border-radius: 5px;
background-color: #a8a8a8;
selection-background-color: #a8a8a8;
}
QLabel#label {
font-size: 13px;
background-color: transparent;
font-variant: small-caps;
}
QLabel#value {
font-family: monospace;
font-weight: bold;
font-size: 14px;
background-color: transparent;
}
QWidget#background {
background-color: transparent;
}
QTextEdit {
font-family: monospace;
}
)style";
int main(int argc, char** argv) {
QApplication app(argc, argv);
app.setStyleSheet(style);
MainWindow window;
window.show();
return app.exec();
}

View File

@@ -1,398 +0,0 @@
/*****************************************************************************************
* *
* OpenSpace *
* *
* Copyright (c) 2014-2019 *
* *
* Permission is hereby granted, free of charge, to any person obtaining a copy of this *
* software and associated documentation files (the "Software"), to deal in the Software *
* without restriction, including without limitation the rights to use, copy, modify, *
* merge, publish, distribute, sublicense, and/or sell copies of the Software, and to *
* permit persons to whom the Software is furnished to do so, subject to the following *
* conditions: *
* *
* The above copyright notice and this permission notice shall be included in all copies *
* or substantial portions of the Software. *
* *
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, *
* INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A *
* PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT *
* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF *
* CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE *
* OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. *
****************************************************************************************/
#include "mainwindow.h"
#include "configurationwidget.h"
#include "controlwidget.h"
#include "informationwidget.h"
#include "timelinewidget.h"
#include <QGridLayout>
#include <QPushButton>
#include <QTextEdit>
#include <QThread>
#include <array>
#include <cstdint>
namespace {
QByteArray continuousData;
}
template <typename T>
T readFromBuffer(char* buffer, size_t& currentReadLocation) {
union {
T value;
std::array<char, sizeof(T)> data;
} b;
std::memmove(b.data.data(), buffer + currentReadLocation, sizeof(T));
currentReadLocation += sizeof(T);
return b.value;
}
template <>
std::string readFromBuffer(char* buffer, size_t& currentReadLocation) {
uint8_t size = readFromBuffer<uint8_t>(buffer, currentReadLocation);
std::string result(buffer + currentReadLocation, buffer + currentReadLocation + size);
currentReadLocation += size;
return result;
}
MainWindow::MainWindow()
: QWidget(nullptr)
, _configurationWidget(nullptr)
, _timeControlWidget(nullptr)
, _informationWidget(nullptr)
, _timelineWidget(nullptr)
, _socket(nullptr)
{
setWindowTitle("OpenSpace Timeline");
_configurationWidget = new ConfigurationWidget(this);
_configurationWidget->setMinimumWidth(350);
_timeControlWidget = new ControlWidget(this);
_timeControlWidget->setMinimumWidth(350);
_informationWidget = new InformationWidget(this);
_informationWidget->setMinimumWidth(350);
_timelineWidget = new TimelineWidget(this);
QGridLayout* layout = new QGridLayout;
layout->addWidget(_configurationWidget, 0, 0);
layout->addWidget(_timeControlWidget, 1, 0);
layout->addWidget(_informationWidget, 2, 0);
layout->addWidget(_timelineWidget, 0, 1, 3, 1);
layout->setColumnStretch(1, 5);
QObject::connect(
_configurationWidget, SIGNAL(connect(QString, QString)),
this, SLOT(onConnect(QString, QString))
);
QObject::connect(
_configurationWidget, SIGNAL(disconnect()),
this, SLOT(onDisconnect())
);
QObject::connect(
_timeControlWidget, SIGNAL(scriptActivity(QString)),
this, SLOT(sendScript(QString))
);
setLayout(layout);
_configurationWidget->socketDisconnected();
_timeControlWidget->socketDisconnected();
_informationWidget->socketDisconnected();
_timelineWidget->socketDisconnected();
}
MainWindow::~MainWindow() {
delete _socket;
}
void MainWindow::onConnect(QString host, QString port) {
delete _socket;
_socket = new QTcpSocket(this);
QObject::connect(_socket, SIGNAL(readyRead()), SLOT(readTcpData()));
QObject::connect(_socket, SIGNAL(connected()), SLOT(onSocketConnected()));
QObject::connect(_socket, SIGNAL(disconnected()), SLOT(onSocketDisconnected()));
_socket->connectToHost(host, port.toUInt());
}
void MainWindow::onDisconnect() {
delete _socket;
_socket = nullptr;
}
void MainWindow::readTcpData() {
static const uint16_t MessageTypeStatus = 0;
static const uint16_t MessageTypeMappingIdentifier = 1;
static const uint16_t MessageTypeInitialMessageFinished = 2;
static const uint16_t MessageTypePlayBookLabel = 3;
static const uint16_t MessageTypePlayBookHongKang = 4;
QByteArray data = continuousData.append(_socket->readAll());
// int d = data.size();
if (QString(data) == "Connected to SGCT!\r\n") {
continuousData.clear();
return;
}
if (QString(data) == "OK\r\n") {
continuousData.clear();
return;
}
if (data.size() != 42)
qDebug() << QString(data);
QByteArray messageTypeData = data.left(2);
union {
uint16_t value;
std::array<char, 2> data;
} messageType;
std::memcpy(messageType.data.data(), messageTypeData.data(), sizeof(uint16_t));
switch (messageType.value) {
case MessageTypeStatus:
break;
case MessageTypeMappingIdentifier:
qDebug() << "Mapping Identifier received";
printMapping(data.mid(2));
continuousData.clear();
break;
case MessageTypeInitialMessageFinished:
qDebug() << "InitialMessageFinished received";
break;
case MessageTypePlayBookHongKang:
qDebug() << "Hong Kang Playbook received";
break;
case MessageTypePlayBookLabel:
qDebug() << "Label Playbook received";
break;
default:
qDebug() << "Unknown message of type '" << messageType.value << "'";
}
switch (messageType.value) {
case MessageTypeStatus:
{
if (_isConnected)
handleStatusMessage(data.mid(2));
continuousData.clear();
break;
}
case MessageTypePlayBookHongKang:
case MessageTypePlayBookLabel:
{
// const char* payloadDebug = data.mid(2).data();
size_t beginning = 0;
uint32_t size = readFromBuffer<uint32_t>(data.mid(2).data(), beginning);
//qDebug() << "Begin reading data";
while (_socket->waitForReadyRead() && data.size() < int(size)) {
//qDebug() << ".";
//_socket->read
//data = data.append(_socket->re)
data = data.append(_socket->readAll());
//data = data.append(_socket->read(int(size) - data.size()));
//QThread::msleep(50);
}
//qDebug() << "Finished reading data. Handling playbook";
continuousData = handlePlaybook(data.mid(2));
//qDebug() << "Finished handling playbook";
//if (messageType.value == MessageTypePlayBookHongKang)
// _hasHongKangTimeline = true;
//if (messageType.value == MessageTypePlayBookLabel)
// _hasLabelTimeline = true;
//if (_hasHongKangTimeline && _hasLabelTimeline) {
// fullyConnected();
//}
break;
}
case MessageTypeInitialMessageFinished:
_isConnected = true;
fullyConnected();
continuousData.clear();
break;
default:
qDebug() << QString(data);
}
}
void MainWindow::handleStatusMessage(QByteArray data) {
const char* buffer = data.data();
union {
double value;
std::array<char, 8> buffer;
} et;
std::memmove(et.buffer.data(), buffer, sizeof(double));
std::vector<char> timeString(24);
std::memmove(timeString.data(), buffer + sizeof(double), 24);
union {
double value;
std::array<char, 8> buffer;
} delta;
std::memmove(delta.buffer.data(), buffer + sizeof(double) + 24, sizeof(double));
_timeControlWidget->update(
QString::fromStdString(std::string(timeString.begin(), timeString.end())),
QString::number(delta.value)
);
_timelineWidget->setCurrentTime(
std::string(timeString.begin(), timeString.end()),
et.value
);
}
std::vector<std::string> instrumentsFromId(uint16_t instrumentId,
std::map<uint16_t, std::string> instrumentMap)
{
std::vector<std::string> results;
for (int i = 0; i < 16; ++i) {
uint16_t testValue = 1 << i;
if ((testValue & instrumentId) != 0) {
std::string t = instrumentMap.at(testValue);
if (t.empty()) {
qDebug() << "Empty instrument";
}
results.push_back(t);
}
}
return results;
}
QByteArray MainWindow::handlePlaybook(QByteArray data) {
char* buffer = data.data();
size_t currentReadLocation = 0;
uint32_t totalData = readFromBuffer<uint32_t>(buffer, currentReadLocation);
uint8_t nTargets = readFromBuffer<uint8_t>(buffer, currentReadLocation);
qDebug() << "Targets: " << nTargets;
std::map<uint8_t, std::string> targetMap;
for (uint8_t i = 0; i < nTargets; ++i) {
uint8_t id = readFromBuffer<uint8_t>(buffer, currentReadLocation);
std::string value = readFromBuffer<std::string>(buffer, currentReadLocation);
qDebug() << QString::fromStdString(value);
targetMap[id] = value;
}
uint8_t nInstruments = readFromBuffer<uint8_t>(buffer, currentReadLocation);
qDebug() << "Instruments: " << nInstruments;
std::map<uint16_t, std::string> instrumentMap;
for (uint8_t i = 0; i < nInstruments; ++i) {
uint16_t id = readFromBuffer<uint16_t>(buffer, currentReadLocation);
std::string value = readFromBuffer<std::string>(buffer, currentReadLocation);
qDebug() << QString::fromStdString(value);
instrumentMap[id] = value;
}
uint32_t nImages = readFromBuffer<uint32_t>(buffer, currentReadLocation);
std::vector<Image> images;
for (uint32_t i = 0; i < nImages; ++i) {
Image image;
image.beginning = readFromBuffer<double>(buffer, currentReadLocation);
image.ending = readFromBuffer<double>(buffer, currentReadLocation);
image.beginningString = readFromBuffer<std::string>(buffer, currentReadLocation);
image.endingString = readFromBuffer<std::string>(buffer, currentReadLocation);
uint8_t targetId = readFromBuffer<uint8_t>(buffer, currentReadLocation);
uint16_t instrumentId = readFromBuffer<uint16_t>(buffer, currentReadLocation);
image.target = targetMap[targetId];
image.instruments = instrumentsFromId(instrumentId, instrumentMap);
if (image.instruments.empty())
qDebug() << "Instruments were empty";
images.push_back(image);
}
_timelineWidget->setData(
std::move(images),
std::move(targetMap),
std::move(instrumentMap)
);
auto dataSize = data.size();
auto readSize = currentReadLocation;
auto extraBytes = dataSize - readSize;
if (extraBytes > 0) {
return data.mid(currentReadLocation);
}
else {
return QByteArray();
}
}
void MainWindow::sendScript(QString script) {
if (_socket) {
_socket->write(("0" + script + "\r\n").toLatin1());
//QByteArray data = (QString("0") + script).toLocal8Bit();
//qDebug() << data;
//_socket->write(data);
//QThread::msleep(25);
}
//_socket->write(("0" + script + "\r\n").toLatin1());
//_socket->write(("0" + script + "\0").toLatin1());
}
void MainWindow::onSocketConnected() {
_socket->write(QString("1\r\n").toLatin1());
//_socket->write(QString("1").toLatin1());
}
void MainWindow::onSocketDisconnected() {
_configurationWidget->socketDisconnected();
_timeControlWidget->socketDisconnected();
_informationWidget->socketDisconnected();
_timelineWidget->socketDisconnected();
_informationWidget->logInformation("Disconnected.");
}
std::string MainWindow::nextTarget() const {
return _timelineWidget->nextTarget();
}
void MainWindow::fullyConnected() {
_informationWidget->logInformation(
"Connected to " + _socket->peerName() + " on port " +
QString::number(_socket->peerPort()) + "."
);
_configurationWidget->socketConnected();
_timeControlWidget->socketConnected();
_informationWidget->socketConnected();
_timelineWidget->socketConnected();
}
void MainWindow::printMapping(QByteArray data) {
char* buffer = data.data();
size_t currentReadPosition = 0;
uint16_t size = readFromBuffer<uint16_t>(buffer, currentReadPosition);
for (uint16_t i = 0; i < size; ++i) {
uint16_t identifier = readFromBuffer<uint16_t>(buffer, currentReadPosition);
std::string mapping = readFromBuffer<std::string>(buffer, currentReadPosition);
qDebug() << identifier << ": " << QString::fromStdString(mapping);
}
}

View File

@@ -1,304 +0,0 @@
/*****************************************************************************************
* *
* OpenSpace *
* *
* Copyright (c) 2014-2019 *
* *
* Permission is hereby granted, free of charge, to any person obtaining a copy of this *
* software and associated documentation files (the "Software"), to deal in the Software *
* without restriction, including without limitation the rights to use, copy, modify, *
* merge, publish, distribute, sublicense, and/or sell copies of the Software, and to *
* permit persons to whom the Software is furnished to do so, subject to the following *
* conditions: *
* *
* The above copyright notice and this permission notice shall be included in all copies *
* or substantial portions of the Software. *
* *
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, *
* INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A *
* PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT *
* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF *
* CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE *
* OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. *
****************************************************************************************/
#include "timelinewidget.h"
#include <QDebug>
#include <QMap>
#include <QPainter>
#include <QPaintEvent>
#include <iostream>
#include <set>
namespace {
static const int LegendHeight = 105;
static const int TimeWidth = 200;
static const int TextOffset = 5;
QMap<QString, QColor> InstrumentColors = {
{ "NH_ALICE_AIRGLOW", QColor(40, 130, 200) },
{ "NH_ALICE_SOC", QColor(49, 234, 219) },
{ "NH_RALPH_LEISA", QColor(139, 86, 152) },
{ "NH_RALPH_MVIC_NIR", QColor(100, 14, 14) },
{ "NH_RALPH_MVIC_METHANE", QColor(211, 154, 31) },
{ "NH_RALPH_MVIC_RED", QColor(175, 18, 18) },
{ "NH_RALPH_MVIC_BLUE", QColor(84, 79, 149) },
{ "NH_LORRI", QColor(149, 219, 32) },
{ "NH_REX", QColor(35, 185, 125) },
{ "NH_RALPH_MVIC_PAN1", QColor(203, 153, 200) },
{ "NH_RALPH_MVIC_FT", QColor(242, 101, 74) },
{ "NH_RALPH_MVIC_PAN2", QColor(180, 180, 140) }
};
//{ "NH_ALICE_AIRGLOW", QColor(82, 145, 57) },
//{ "NH_ALICE_SOC", QColor(241, 231, 48) },
QMap<QString, QString> InstrumentConversion = {
{ "NH_ALICE_AIRGLOW", "ALICE Airglow" },
{ "NH_RALPH_LEISA", "RALPH LEISA" },
{ "NH_RALPH_MVIC_NIR", "RALPH MVIC NIR" },
{ "NH_ALICE_SOC", "ALICE SOC" },
{ "NH_RALPH_MVIC_BLUE", "RALPH MVIC Blue" },
{ "NH_RALPH_MVIC_PAN1" , "RALPH MVIC Pan1" },
{ "NH_LORRI", "LORRI" },
{ "NH_RALPH_MVIC_FT", "RALPH MVIC FT" },
{ "NH_RALPH_MVIC_PAN2", "RALPH MVIC Pan2" },
{ "NH_RALPH_MVIC_METHANE", "RALPH MVIC Methane" },
{ "NH_RALPH_MVIC_RED", "RALPH MVIC Red" },
{ "NH_REX", "REX" }
};
const double etSpread = 100.0;
}
TimelineWidget::TimelineWidget(QWidget* parent)
: QWidget(parent)
, _currentTime{"", 0.0}
{
setMinimumWidth(600);
setMinimumHeight(600);
}
void TimelineWidget::paintEvent(QPaintEvent* event) {
QPainter painter(this);
QRectF fullRect = contentsRect();
QRectF contentRect(0, 0, fullRect.width() - 1, fullRect.height() - LegendHeight);
QRectF legendRect(
0,
fullRect.bottom() - LegendHeight,
fullRect.right(),
fullRect.bottom()
);
painter.save();
drawContent(painter, contentRect);
painter.restore();
painter.save();
painter.translate(0, fullRect.height() - LegendHeight);
drawLegend(painter, QRectF(legendRect));
painter.restore();
}
void TimelineWidget::setData(std::vector<Image> images,
std::map<uint8_t, std::string> targetMap,
std::map<uint16_t, std::string> instrumentMap)
{
_images.insert(_images.end(), images.begin(), images.end());
std::sort(
_images.begin(),
_images.end(),
[](const Image& a, const Image& b) { return a.beginning < b.beginning; }
);
_targetMap.insert(targetMap.begin(), targetMap.end());
_instrumentMap.insert(instrumentMap.begin(), instrumentMap.end());
_instruments.clear();
std::set<std::string> instruments;
for (auto p : _instrumentMap)
instruments.insert(p.second);
std::copy(instruments.begin(), instruments.end(), std::back_inserter(_instruments));
_targets.clear();
std::set<std::string> targets;
for (auto p : _targetMap)
targets.insert(p.second);
std::copy(targets.begin(), targets.end(), std::back_inserter(_targets));
repaint();
}
void TimelineWidget::drawContent(QPainter& painter, QRectF rect) {
QRectF timelineRect(0, 0, rect.width() - TimeWidth, rect.height());
QRectF dateRect(rect.width() - TimeWidth, 0, TimeWidth, rect.height());
// Draw background
//painter.setBrush(QBrush(Qt::lightGray)); painter.drawRect(timelineRect);
painter.setBrush(QBrush(QColor(85, 85, 85))); painter.drawRect(timelineRect);
painter.setBrush(QBrush(QColor(165, 165, 165))); painter.drawRect(dateRect);
const double lowerTime = _currentTime.et - etSpread;
const double upperTime = _currentTime.et + etSpread;
std::vector<Image*> images;
for (Image& i : _images) {
if (i.beginning <= upperTime && i.ending >= lowerTime)
images.push_back(&i);
}
drawImages(painter, timelineRect, images, lowerTime, upperTime);
// Draw current time
painter.setBrush(QBrush(Qt::black));
painter.setPen(QPen(Qt::black, 2));
painter.drawLine(
QPointF(0, timelineRect.height() / 2),
QPointF(timelineRect.width(), timelineRect.height() / 2)
);
painter.drawText(
timelineRect.width(),
timelineRect.height() / 2 + TextOffset,
QString::fromStdString(_currentTime.time)
);
}
void TimelineWidget::drawLegend(QPainter& painter, QRectF rect) {
static const int Padding = 5;
static const int BoxSize = 20;
int currentHorizontalPosition = Padding;
int currentVerticalPosition = Padding + BoxSize + Padding;
// Draw Targets
// Draw Instruments
for (int i = 0; i < _instruments.size(); ++i) {
if (i == _instruments.size() / 3 || i == _instruments.size() * 2 / 3) {
currentVerticalPosition += BoxSize + Padding;
currentHorizontalPosition = Padding;
}
const std::string& instrument = _instruments[i];
;
painter.setBrush(QBrush(InstrumentColors[QString::fromStdString(instrument)]));
painter.setPen(QPen(InstrumentColors[QString::fromStdString(instrument)]));
painter.drawRect(
currentHorizontalPosition,
currentVerticalPosition,
BoxSize,
BoxSize
);
currentHorizontalPosition += BoxSize + Padding;
painter.setPen(QPen(QColor(200, 200, 200)));
//painter.setPen(QPen(Qt::black));
painter.drawText(
currentHorizontalPosition,
currentVerticalPosition + BoxSize / 2 + TextOffset,
InstrumentConversion[QString::fromStdString(instrument)]
);
currentHorizontalPosition += 125;
}
}
void TimelineWidget::setCurrentTime(std::string currentTime, double et) {
_currentTime.time = std::move(currentTime);
_currentTime.et = std::move(et);
repaint();
}
void TimelineWidget::drawImages(
QPainter& painter,
QRectF timelineRect,
std::vector<Image*> images,
double minimumTime, double maximumTime)
{
std::set<std::string> instrumentSet;
for (Image* i : images) {
for (std::string instrument : i->instruments) {
instrumentSet.insert(instrument);
}
}
std::map<std::string, int> instruments;
for (auto it = instrumentSet.begin(); it != instrumentSet.end(); ++it)
instruments[*it] = std::distance(instrumentSet.begin(), it);
for (Image* i : images) {
double tBeg = (i->beginning - minimumTime) / (maximumTime - minimumTime);
tBeg = std::max(tBeg, 0.0);
double tEnd = (i->ending - minimumTime) / (maximumTime - minimumTime);
tEnd = std::min(tEnd, 1.0);
int loc = timelineRect.top() + timelineRect.height() * tBeg;
int height = (timelineRect.top() + timelineRect.height() * tEnd) - loc;
height = std::max(height, 5);
if (loc + height > timelineRect.height()) {
height = timelineRect.height() - loc;
}
std::string target = i->target;
auto it = std::find(_targets.begin(), _targets.end(), target);
// int iTarget = std::distance(_targets.begin(), it);
for (std::string instrument : i->instruments) {
auto it = std::find(_instruments.begin(), _instruments.end(), instrument);
if (it == _instruments.end()) {
qDebug() << "Instrument not found";
}
painter.setBrush(
QBrush(InstrumentColors[QString::fromStdString(instrument)])
);
double width = timelineRect.width() / instruments.size();
double pos = instruments[instrument] * width;
painter.drawRect(pos, loc, width, height);
}
if (height >= 5) {
painter.setBrush(QBrush(Qt::black));
painter.setPen(QPen(Qt::black));
QString line = QString::fromStdString(i->beginningString) + QString(" (") +
QString::fromStdString(i->target) + QString(")");
painter.drawText(timelineRect.width(), loc + height / 2 + TextOffset, line);
}
}
}
void TimelineWidget::socketConnected() {
setDisabled(false);
}
void TimelineWidget::socketDisconnected() {
setDisabled(true);
_images.clear();
_instruments.clear();
_targets.clear();
}
std::string TimelineWidget::nextTarget() const {
auto it = std::lower_bound(
_images.begin(),
_images.end(),
_currentTime.et,
[](const Image& i, double et) { return i.beginning < et; }
);
if (it != _images.end()) {
return it->target;
}
else {
return "";
}
}

View File

@@ -2,7 +2,7 @@
# #
# OpenSpace #
# #
# Copyright (c) 2014-2018 #
# Copyright (c) 2014-2020 #
# #
# Permission is hereby granted, free of charge, to any person obtaining a copy of this #
# software and associated documentation files (the "Software"), to deal in the Software #

View File

@@ -2,7 +2,7 @@
* *
* OpenSpace *
* *
* Copyright (c) 2014-2019 *
* Copyright (c) 2014-2020 *
* *
* Permission is hereby granted, free of charge, to any person obtaining a copy of this *
* software and associated documentation files (the "Software"), to deal in the Software *

View File

@@ -17,7 +17,7 @@
</PlanarProjection>
</Viewport>
</Window>
<Window fullScreen="false" name="GUI" tags="GUI">
<Window fullScreen="false" border="false" name="GUI" tags="GUI">
<Stereo type="none" />
<Size x="1920" y="1080" />
<Pos x="0" y="0" />

View File

@@ -34,8 +34,7 @@
<Window fullScreen="false" name="GUI" tags="GUI">
<Stereo type="none" />
<Size x="1280" y="720" />
<Res x="2048" y="2048" />
<Size x="1024" y="1024" />
<Pos x="50" y="50" />
<Viewport>
<Pos x="0.0" y="0.0" />

View File

@@ -0,0 +1,30 @@
<?xml version="1.0" ?>
<Cluster masterAddress="localhost">
<Node address="localhost" port="20401">
<Window fullScreen="false">
<Stereo type="none" />
<Pos x="200" y="300" />
<!-- 16:9 aspect ratio -->
<Size x="1280" y="360" />
<Viewport eye="left">
<Pos x="0.0" y="0.0" />
<Size x="0.5" y="1.0" />
<PlanarProjection>
<FOV down="25.267007923362" left="40.0" right="40.0" up="25.267007923362" />
<Orientation heading="0.0" pitch="0.0" roll="0.0" />
</PlanarProjection>
</Viewport>
<Viewport eye="right">
<Pos x="0.5" y="0.0" />
<Size x="0.5" y="1.0" />
<PlanarProjection>
<FOV down="25.267007923362" left="40.0" right="40.0" up="25.267007923362" />
<Orientation heading="0.0" pitch="0.0" roll="0.0" />
</PlanarProjection>
</Viewport>
</Window>
</Node>
<User eyeSeparation="0.06">
<Pos x="0.0" y="0.0" z="0.0" />
</User>
</Cluster>

View File

@@ -0,0 +1,35 @@
#Version
1.0
#Asset
scene/solarsystem/planets/earth/moon/moon required
scene/solarsystem/missions/apollo/apollo8 required
scene/solarsystem/planets/earth/earth required
#Property
setPropertyValueSingle NavigationHandler.OrbitalNavigator.MinimumAllowedDistance 0.000000
setPropertyValueSingle Scene.Moon.Renderable.LodScaleFactor 24.0
#Keybinding
E Jump to right before the earthrise photo Set Earthrise time /Missions/Apollo/8 false "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)"
U Jump to time right before Apollo 8 liftoff, with its trail enabled Set Apollo 8 launch time /Missions/Apollo/8 false "openspace.time.setTime('1968-12-21T12:51:37.00'); openspace.setPropertyValueSingle('Scene.Apollo8LaunchTrail.Renderable.Enabled', true)"
K Toggles Moon Kaguya color layer Toggle Kaguya layer on the Moon /Missions/Apollo false propertyHelper.invert('Scene.Moon.Renderable.Layers.ColorLayers.Kaguya_Utah.Enabled')
T Toggles the trails of the Apollo 8 orbits, focused around the Moon Toggle Apollo 8 orbits /Missions/Apollo/8 false propertyHelper.invert('Scene.Apollo8MoonTrail.Renderable.Enabled')
SHIFT+T Toggles the trails of the Apollo 8 Launch, focused around the Earth Toggle Apollo 8 launch trail /Missions/Apollo/8 false propertyHelper.invert('Scene.Apollo8LaunchTrail.Renderable.Enabled')
CTRL+T Toggles the trails of the full Apollo 8, with Earth's frame of reference Toggles Apollo 8 full trail /Missions/Apollo/8 false propertyHelper.invert('Scene.Apollo8EarthBarycenterTrail.Renderable.Enabled')
S Toggles shading for the Moon Toggle Moon shading /Missions/Apollo false propertyHelper.invert('Scene.Moon.Renderable.PerformShading')
PAGE_UP Set camera focus to Apollo 8 Focus on Apollo 8 /Missions/Apollo/8 false "openspace.setPropertyValueSingle('NavigationHandler.OrbitalNavigator.Aim', ''); openspace.setPropertyValueSingle('NavigationHandler.OrbitalNavigator.Anchor', 'Apollo8'); openspace.setPropertyValueSingle('NavigationHandler.OrbitalNavigator.RetargetAnchor', nil)"
PAGE_DOWN Set camera focus to the Moon Focus on Moon /Missions/Apollo false "openspace.setPropertyValueSingle('NavigationHandler.OrbitalNavigator.Aim', ''); openspace.setPropertyValueSingle('NavigationHandler.OrbitalNavigator.Anchor', 'Moon'); openspace.setPropertyValueSingle('NavigationHandler.OrbitalNavigator.RetargetAnchor', nil)"
HOME Set camera focus to the Earth Focus on Earth /Missions/Apollo false "openspace.setPropertyValueSingle('NavigationHandler.OrbitalNavigator.Aim', ''); openspace.setPropertyValueSingle('NavigationHandler.OrbitalNavigator.Anchor', 'Earth'); openspace.setPropertyValueSingle('NavigationHandler.OrbitalNavigator.RetargetAnchor', nil)"
#Time
absolute 1968-12-21T12:51:51.0
#Camera
goToGeo "Earth" 20 -60 15000000
#MarkNodes
Earth
Moon
Apollo8
Apollo8Launch

View File

@@ -0,0 +1,36 @@
#Version
1.0
#Asset
scene/solarsystem/planets/earth/moon/moon required
scene/solarsystem/missions/apollo/apollo8 required
scene/solarsystem/missions/apollo/apollo11 required
scene/solarsystem/missions/apollo/a17_lem required
scene/solarsystem/missions/apollo/apollo_globebrowsing required
scene/solarsystem/missions/apollo/apollo_11_lem_flipbook required
scene/solarsystem/missions/apollo/insignias_map required
#Property
setPropertyValueSingle Scene.Moon.Renderable.Layers.ColorLayers.A17_travmap.BlendMode 0
setPropertyValueSingle Scene.Apollo11LemDescentModel.Renderable.RotationVector { 273.750,28.0,309.85 }
setPropertyValueSingle Scene.Apollo11LemLandedModel.Renderable.RotationVector { 273.750,28.0,309.85 }
setPropertyValueSingle Scene.Moon.Renderable.PerformShading false
#Keybinding
m Focus on Moon Focus on Moon /Missions/Apollo false "openspace.setPropertyValue('NavigationHandler.OrbitalNavigator.Anchor', 'Moon'); openspace.setPropertyValue('NavigationHandler.OrbitalNavigator.RetargetAnchor', nil);"
F9 Disable apollo site on moon when switching Disable Apollo site /Missions/Apollo false "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);"
F11 Setup for A11 site Setup A11 site /Missions/Apollo/11 false "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.LodScaleFactor', 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);"
F7 Setup for A17 site Setup A17 site /Missions/Apollo/17 false "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.LodScaleFactor', 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);"
#Time
absolute 1972 DEC 12 19:47:11
#Camera
goToGeo "Moon" 20 -60 15000000
#MarkNodes
Moon
Apollo11LemModel
Apollo17LemModel
Apollo11
Apollo11LunarLander

View File

@@ -58,11 +58,20 @@ local Keybindings = {
{
Key = "h",
Name="Toggle Trails",
Command = "local list = openspace.getProperty('*Trail.Renderable.Enabled'); for _,v in pairs(list) do openspace.setPropertyValueSingle(v, not openspace.getPropertyValue(v)) end",
Documentation = "Toggles the visibility of all trails",
Command = "local list = openspace.getProperty('{planetTrail_solarSystem}.Renderable.Enabled'); for _,v in pairs(list) do openspace.setPropertyValueSingle(v, not openspace.getPropertyValue(v)) end\n" ..
"local moonlist = openspace.getProperty('{moonTrail_solarSystem}.Renderable.Enabled'); for _,v in pairs(moonlist) do openspace.setPropertyValueSingle(v, not openspace.getPropertyValue(v)) end",
Documentation = "Toggles the visibility of planet and moon trails",
GuiPath = "/Rendering",
Local = false
},
{
Key = "l",
Name = "Toggle planet labels",
Command = "local list = openspace.getProperty('{solarsystem_labels}.Renderable.Enabled'); for _,v in pairs(list) do openspace.setPropertyValueSingle(v, not openspace.getPropertyValue(v)) end",
Documentation = "Turns on visibility for all solar system labels",
GuiPath = "/Rendering",
Local = false
}
}
asset.onInitialize(function ()

View File

@@ -15,7 +15,6 @@ asset.require('util/default_joystick')
-- Load web gui
asset.require('util/webgui')
asset.request('customization/globebrowsing')
asset.onInitialize(function ()
openspace.setDefaultGuiSorting()

View File

@@ -22,7 +22,6 @@ local vrt_folders = {
-- example: 'C:/OpenSpace/GlobeBrowsingData/Mars/CTX'
-- We recommend using this folder for CTX
openspace.absPath('${ASSETS}/scene/solarsystem/planets/mars/map_service_configs/ESRI/CTX'),
openspace.absPath('${BASE}/../OpenSpaceData/Mars/CTX'),
-- if not and you have a custom path for CTX layers, enter it below
'',

View File

@@ -0,0 +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,,,,,,
1 Group (optional) Name (required) Globe (optional) Lat (required if globe) Lon (required if globe) Altitude (optional if globe) x (required if not globe) y (required if not globe) z (required if not globe) Scale (optional) LineWidth (optional)
2 NASA Kenedy Space Center Earth 28.6658276 -80.70282839

18
data/assets/dawn.profile Normal file
View File

@@ -0,0 +1,18 @@
#Version
1.0
#Asset
scene/solarsystem/missions/dawn/ceres required
scene/solarsystem/missions/dawn/dawn required
scene/solarsystem/missions/dawn/vesta required
#Time
absolute 2011 AUG 06 00:00:00
#Camera
setNavigationState "Dawn" 526781518487.171326, 257168309890.072144, -1381125204152.817383
#MarkNodes
Dawn
Ceres
Vesta

View File

@@ -0,0 +1,21 @@
#Version
1.0
#Asset
scene/solarsystem/planets/earth/earth required
scene/solarsystem/planets/earth/satellites/satellites required
#Property
setPropertyValue {earth_satellites}.Renderable.Enabled false
#Time
relative -1d
#Camera
goToGeo "Earth" 58.5877 16.1924 20000000
#MarkNodes
Earth
Mars
Moon
Sun

View File

@@ -1,6 +1,8 @@
asset.require('./base')
local earthAsset = asset.require('scene/solarsystem/planets/earth/earth')
asset.require('scene/solarsystem/planets/earth/satellites/satellites.asset')
asset.require('scene/solarsystem/sssb/pha')
asset.onInitialize(function ()
local now = openspace.time.currentWallTime()
@@ -10,6 +12,8 @@ asset.onInitialize(function ()
openspace.globebrowsing.goToGeo("Earth", 58.5877, 16.1924, 20000000)
openspace.markInterestingNodes({ "Earth", "Mars", "Moon", "Sun" })
openspace.setPropertyValue("{earth_satellites}.Renderable.Enabled", false)
end)
asset.onDeinitialize(function ()

View File

@@ -0,0 +1,23 @@
#Version
1.0
#Asset
scene/solarsystem/planets/earth/earth required
scene/solarsystem/planets/jupiter/minor_moons required
scene/solarsystem/planets/saturn/minor_moons required
scene/solarsystem/planets/uranus/minor_moons required
scene/solarsystem/planets/neptune/inner_moons required
scene/solarsystem/planets/neptune/irregular_prograde_moons required
scene/solarsystem/planets/neptune/irregular_retrograde_moons required
#Time
relative -1d
#Camera
goToGeo "Earth" 58.5877 16.1924 20000000
#MarkNodes
Earth
Mars
Moon
Sun

22
data/assets/gaia.profile Normal file
View File

@@ -0,0 +1,22 @@
#Version
1.0
#Module
Gaia openspace.printFatal('Could not load scene due to missing module "gaia"')
#Asset
scene/solarsystem/planets/earth/earth required
scene/milkyway/gaia/gaiastars required
scene/milkyway/gaia/apogee required
scene/milkyway/gaia/galah required
scene/solarsystem/missions/gaia/gaia required
scene/solarsystem/missions/gaia/trail required
#Property
setPropertyValueSingle Scene.Stars.Renderable.Enabled false
#Camera
setNavigationState "Earth" 1000000000000.0, 1000000000000.0, 1000000000000.0
#MarkNodes
Gaia

View File

@@ -0,0 +1,5 @@
local assetHelper = asset.require('util/asset_helper')
local bookmarkHelper = asset.require('util/generate_bookmarks')
local nodes = bookmarkHelper.getBookmarks('Local Bookmarks', '${ASSETS}/customization/localbookmarks.csv')
assetHelper.registerSceneGraphNodesAndExport(asset, nodes);

View File

@@ -0,0 +1,28 @@
local assetHelper = asset.require('util/asset_helper')
local bookmarkHelper = asset.require('util/generate_bookmarks')
local dataProvider = 'http://data.openspaceproject.com/files/bookmarks/v1/bookmarks.csv'
local bookmarksCSV = asset.syncedResource({
Identifier = 'openspace_bookmarks',
Name = 'OpenSpace Bookmarks',
Type = 'UrlSynchronization',
UseHash = false,
Override = true,
Url = dataProvider
})
local nodes = {}
asset.onInitialize(function ()
nodes = bookmarkHelper.getBookmarks('OpenSpace Bookmarks', bookmarksCSV .. '/bookmarks.csv.txt')
for _, n in ipairs(nodes) do
openspace.addSceneGraphNode(n);
end
end)
asset.onDeinitialize(function ()
for _, n in ipairs(nodes) do
openspace.removeSceneGraphNode(n.Identifier);
end
end)

View File

@@ -0,0 +1,29 @@
#Version
1.0
#Asset
scene/solarsystem/missions/insight/edl required
#Property
setPropertyValueSingle Scene.PlutoBarycenterTrail.Renderable.Enabled false
setPropertyValueSingle Scene.Mars.Renderable.Layers.HeightLayers.Mola_Utah.Settings.Offset -469.300000
setPropertyValueSingle Scene.Mars.Renderable.Layers.HeightLayers.OnMarsHiRISELS.Settings.Offset -470.800006
setPropertyValueSingle Scene.Mars.Renderable.Layers.HeightLayers.OnMarsHiRISELS.Enabled true
setPropertyValueSingle Scene.Mars.Renderable.Layers.ColorLayers.MOC_WA_Color_Utah.Settings.Multiplier 2.81690
setPropertyValueSingle Scene.Mars.Renderable.Layers.ColorLayers.OnMarsHiRISELS.Settings.Gamma 0.938970
setPropertyValueSingle Scene.Mars.Renderable.Layers.ColorLayers.MOC_WA_Color_Utah.Settings.Gamma 2.394370
setPropertyValueSingle Scene.Mars.Renderable.Layers.ColorLayers.OnMarsHiRISELS.Enabled true
#Keybinding
i Setup Insight landing layers Setup Insight layers /Missions/Insight false "openspace.setPropertyValueSingle('Scene.Mars.Renderable.Layers.HeightLayers.Mola_Utah.Settings.Offset', -469.300000); openspace.setPropertyValueSingle('Scene.Mars.Renderable.Layers.HeightLayers.OnMarsHiRISELS.Settings.Offset', -470.800006); openspace.setPropertyValueSingle('Scene.Mars.Renderable.Layers.ColorLayers.insight_ctx.Enabled', true); openspace.setPropertyValueSingle('Scene.Mars.Renderable.Layers.HeightLayers.OnMarsHiRISELS.Enabled', true); openspace.setPropertyValueSingle('Scene.Mars.Renderable.Layers.ColorLayers.MOC_WA_Color_Utah.Settings.Multiplier', 2.816900); openspace.setPropertyValueSingle('Scene.Mars.Renderable.Layers.ColorLayers.OnMarsHiRISELS.Settings.Gamma', 0.938970); openspace.setPropertyValueSingle('Scene.Mars.Renderable.Layers.ColorLayers.MOC_WA_Color_Utah.Settings.Gamma', 2.394370); openspace.setPropertyValueSingle('Scene.Mars.Renderable.Layers.ColorLayers.OnMarsHiRISELS.Enabled', true);"
SHIFT+i Undo Insight landing layers setup Unset Insight layers /Missions/Insight false "openspace.setPropertyValueSingle('Scene.Mars.Renderable.Layers.HeightLayers.Mola_Utah.Settings.Offset', 0); openspace.setPropertyValueSingle('Scene.Mars.Renderable.Layers.HeightLayers.OnMarsHiRISELS.Settings.Offset', 0); openspace.setPropertyValueSingle('Scene.Mars.Renderable.Layers.ColorLayers.insight_ctx.Enabled', false); openspace.setPropertyValueSingle('Scene.Mars.Renderable.Layers.HeightLayers.OnMarsHiRISELS.Enabled', false); openspace.setPropertyValueSingle('Scene.Mars.Renderable.Layers.ColorLayers.OnMarsHiRISELS.Enabled', false); openspace.setPropertyValueSingle('Scene.Mars.Renderable.Layers.ColorLayers.MOC_WA_Color_Utah.Settings.Multiplier', 1.0); openspace.setPropertyValueSingle('Scene.Mars.Renderable.Layers.ColorLayers.OnMarsHiRISELS.Settings.Gamma', 1.0); openspace.setPropertyValueSingle('Scene.Mars.Renderable.Layers.ColorLayers.MOC_WA_Color_Utah.Settings.Gamma', 1.0);"
#Time
absolute 2018 NOV 26 19:39:03.68
#Camera
setNavigationState "Insight" "Root" 8.430115E0, -1.791710E1, 2.813660E0 0.494659E0,0.357162E0,0.792306E0
#MarkNodes
Insight

37
data/assets/juno.profile Normal file
View File

@@ -0,0 +1,37 @@
#Version
1.0
#Asset
scene/solarsystem/missions/juno/juno required
#Keybinding
1 Setting the simulation speed to 1 seconds per realtime second Set sim speed 1 /Simulation Speed false "openspace.time.interpolateDeltaTime(1)"
2 Setting the simulation speed to 5 seconds per realtime second Set sim speed 5 /Simulation Speed false "openspace.time.interpolateDeltaTime(5)"
3 Setting the simulation speed to 10 seconds per realtime second Set sim speed 10 /Simulation Speed false "openspace.time.interpolateDeltaTime(10)"
4 Setting the simulation speed to 20 seconds per realtime second Set sim speed 20 /Simulation Speed false "openspace.time.interpolateDeltaTime(20)"
5 Setting the simulation speed to 40 seconds per realtime second Set sim speed 40 /Simulation Speed false "openspace.time.interpolateDeltaTime(40)"
6 Setting the simulation speed to 90 seconds per realtime second Set sim speed 90 /Simulation Speed false "openspace.time.interpolateDeltaTime(90)"
7 Setting the simulation speed to 360 seconds per realtime second Set sim speed 360 /Simulation Speed false "openspace.time.interpolateDeltaTime(360)"
8 Setting the simulation speed to 720 seconds per realtime second Set sim speed 720 /Simulation Speed false "openspace.time.interpolateDeltaTime(720)"
9 Setting the simulation speed to 2880 seconds per realtime second Set sim speed 2880 /Simulation Speed false "openspace.time.interpolateDeltaTime(2880)"
0 Setting the simulation speed to 14400 seconds per realtime second Set sim speed 14400 /Simulation Speed false "openspace.time.interpolateDeltaTime(14400)"
Shift+1 Setting the simulation speed to 28800 seconds per realtime second Set sim speed 28800 /Simulation Speed false "openspace.time.interpolateDeltaTime(28800)"
Shift+2 Setting the simulation speed to 57600 seconds per realtime second Set sim speed 57600 /Simulation Speed false "openspace.time.interpolateDeltaTime(57600)"
Shift+3 Setting the simulation speed to 115200 seconds per realtime second Set sim speed 115200 /Simulation Speed false "openspace.time.interpolateDeltaTime(115200)"
Shift+4 Setting the simulation speed to 230400 seconds per realtime second Set sim speed 230400 /Simulation Speed false "openspace.time.interpolateDeltaTime(230400)"
Shift+5 Setting the simulation speed to 460800 seconds per realtime second Set sim speed 460800 /Simulation Speed false "openspace.time.interpolateDeltaTime(460800)"
Shift+6 Setting the simulation speed to 921600 seconds per realtime second Set sim speed 921600 /Simulation Speed false "openspace.time.interpolateDeltaTime(921600)"
Shift+7 Setting the simulation speed to 1843200 seconds per realtime second Set sim speed 1843200 /Simulation Speed false "openspace.time.interpolateDeltaTime(1843200)"
Shift+8 Setting the simulation speed to 3686400 seconds per realtime second Set sim speed 3686400 /Simulation Speed false "openspace.time.interpolateDeltaTime(3686400)"
Shift+9 Setting the simulation speed to 7372800 seconds per realtime second Set sim speed 7372800 /Simulation Speed false "openspace.time.interpolateDeltaTime(7372800)"
Shift+0 Setting the simulation speed to 14745600 seconds per realtime second Set sim speed 14745600 /Simulation Speed false "openspace.time.interpolateDeltaTime(14745600)"
#Time
absolute 2016-07-01T10:05:00.00
#Camera
setNavigationState "Juno" "Root" 1.243398E8, 7.176068E7, -1.519733E7 -0.377400E0, 0.764573E0, 0.522492E0
#MarkNodes
Jupiter
Juno

View File

@@ -0,0 +1,41 @@
#Version
1.0
#Module
Volume asset.require('scene/solarsystem/missions/messenger/mercurymagnetosphere') openspace.printWarning("Volume module is not loaded, skipping asset: mercurymagnetosphere")
#Asset
scene/solarsystem/missions/messenger/messengerSC required
#Keybinding
1 Setting the simulation speed to 1 seconds per realtime second Set sim speed 1 /Simulation Speed false "openspace.time.interpolateDeltaTime(1)"
2 Setting the simulation speed to 5 seconds per realtime second Set sim speed 5 /Simulation Speed false "openspace.time.interpolateDeltaTime(5)"
3 Setting the simulation speed to 10 seconds per realtime second Set sim speed 10 /Simulation Speed false "openspace.time.interpolateDeltaTime(10)"
4 Setting the simulation speed to 20 seconds per realtime second Set sim speed 20 /Simulation Speed false "openspace.time.interpolateDeltaTime(20)"
5 Setting the simulation speed to 40 seconds per realtime second Set sim speed 40 /Simulation Speed false "openspace.time.interpolateDeltaTime(40)"
6 Setting the simulation speed to 90 seconds per realtime second Set sim speed 90 /Simulation Speed false "openspace.time.interpolateDeltaTime(90)"
7 Setting the simulation speed to 360 seconds per realtime second Set sim speed 360 /Simulation Speed false "openspace.time.interpolateDeltaTime(360)"
8 Setting the simulation speed to 720 seconds per realtime second Set sim speed 720 /Simulation Speed false "openspace.time.interpolateDeltaTime(720)"
9 Setting the simulation speed to 2880 seconds per realtime second Set sim speed 2880 /Simulation Speed false "openspace.time.interpolateDeltaTime(2880)"
0 Setting the simulation speed to 14400 seconds per realtime second Set sim speed 14400 /Simulation Speed false "openspace.time.interpolateDeltaTime(14400)"
Shift+1 Setting the simulation speed to 28800 seconds per realtime second Set sim speed 28800 /Simulation Speed false "openspace.time.interpolateDeltaTime(28800)"
Shift+2 Setting the simulation speed to 57600 seconds per realtime second Set sim speed 57600 /Simulation Speed false "openspace.time.interpolateDeltaTime(57600)"
Shift+3 Setting the simulation speed to 115200 seconds per realtime second Set sim speed 115200 /Simulation Speed false "openspace.time.interpolateDeltaTime(115200)"
Shift+4 Setting the simulation speed to 230400 seconds per realtime second Set sim speed 230400 /Simulation Speed false "openspace.time.interpolateDeltaTime(230400)"
Shift+5 Setting the simulation speed to 460800 seconds per realtime second Set sim speed 460800 /Simulation Speed false "openspace.time.interpolateDeltaTime(460800)"
Shift+6 Setting the simulation speed to 921600 seconds per realtime second Set sim speed 921600 /Simulation Speed false "openspace.time.interpolateDeltaTime(921600)"
Shift+7 Setting the simulation speed to 1843200 seconds per realtime second Set sim speed 1843200 /Simulation Speed false "openspace.time.interpolateDeltaTime(1843200)"
Shift+8 Setting the simulation speed to 3686400 seconds per realtime second Set sim speed 3686400 /Simulation Speed false "openspace.time.interpolateDeltaTime(3686400)"
Shift+9 Setting the simulation speed to 7372800 seconds per realtime second Set sim speed 7372800 /Simulation Speed false "openspace.time.interpolateDeltaTime(7372800)"
Shift+0 Setting the simulation speed to 14745600 seconds per realtime second Set sim speed 14745600 /Simulation Speed false "openspace.time.interpolateDeltaTime(14745600)"
#Time
absolute 2011 MAY 13 00:05:18
#Camera
setNavigationState "Mercury" "Root" 2.423690E11, 1.979038E11, -2.241483E10 -0.492046E0, 0.666088E0, 0.560551E0
#MarkNodes
Mercury
Messenger
Sun

View File

@@ -0,0 +1,60 @@
#Version
1.0
#Asset
scene/solarsystem/missions/newhorizons/newhorizons required
scene/solarsystem/missions/newhorizons/model required
#Property
setPropertyValueSingle NavigationHandler.OrbitalNavigator.FollowAnchorNodeRotationDistance 20.000000
setPropertyValueSingle Scene.Pluto.Renderable.Enabled false
setPropertyValueSingle Scene.Charon.Renderable.Enabled false
setPropertyValueSingle Scene.PlutoBarycenterTrail.Renderable.Enabled false
#Keybinding
a Sets the focus of the camera on 'NewHorizons'. Focus on New Horizons /New Horizons false "openspace.setPropertyValue('NavigationHandler.OrbitalNavigator.Anchor', 'NewHorizons');openspace.setPropertyValue('NavigationHandler.OrbitalNavigator.Aim', '');openspace.setPropertyValue('NavigationHandler.OrbitalNavigator.RetargetAnchor', nil)"
SHIFT+a Sets the focus of the camera on 'NewHorizons'. Anchor at New Horizons, Aim at Pluto /New Horizons false "openspace.setPropertyValue('NavigationHandler.OrbitalNavigator.Anchor', 'NewHorizons');openspace.setPropertyValue('NavigationHandler.OrbitalNavigator.Aim', 'Pluto');openspace.setPropertyValue('NavigationHandler.OrbitalNavigator.RetargetAnchor', nil)"
s Sets the focus of the camera on 'Pluto' Focus on Pluto /New Horizons false "openspace.setPropertyValue('NavigationHandler.OrbitalNavigator.Anchor', 'Pluto') ;openspace.setPropertyValue('NavigationHandler.OrbitalNavigator.Aim', ''); openspace.setPropertyValue('NavigationHandler.OrbitalNavigator.RetargetAnchor', nil)"
d Sets the focus of the camera on 'Charon'. Focus on New Charon /New Horizons false "openspace.setPropertyValue('NavigationHandler.OrbitalNavigator.Anchor', 'Charon');openspace.setPropertyValue('NavigationHandler.OrbitalNavigator.Aim', '');openspace.setPropertyValue('NavigationHandler.OrbitalNavigator.RetargetAnchor', nil)"
F7 Toggles New Horizons image projection. Toggle NH Image Projection /New Horizons false [[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)]]
F8 Removes all image projections from Pluto and Charon. Clear image projections /New Horizons false "openspace.setPropertyValue('Scene.PlutoProjection.Renderable.ProjectionComponent.ClearAllProjections', true); openspace.setPropertyValue('Scene.CharonProjection.Renderable.ProjectionComponent.ClearAllProjections', true)"
F9 Jumps to the 14th of July 2015 at 0900 UTC and clears all projections. Reset time and projections /New Horizons false "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)"
KP_8 Increases the height map exaggeration on Pluto. Pluto HeightExaggeration + /New Horizons false propertyHelper.increment('Scene.PlutoProjection.Renderable.HeightExaggeration', 5000)
CTRL+I Increases the height map exaggeration on Pluto. Pluto HeightExaggeration + /New Horizons false propertyHelper.increment('Scene.PlutoProjection.Renderable.HeightExaggeration', 5000)
KP_2 Decreases the height map exaggeration on Pluto. Pluto HeightExaggeration - /New Horizons false propertyHelper.decrement('Scene.PlutoProjection.Renderable.HeightExaggeration', 5000)
CTRL+K Decreases the height map exaggeration on Pluto. Pluto HeightExaggeration - /New Horizons false propertyHelper.decrement('Scene.PlutoProjection.Renderable.HeightExaggeration', 5000)
KP_9 Increases the height map exaggeration on Charon. Charon HeightExaggeration + /New Horizons false propertyHelper.increment('Scene.CharonProjection.Renderable.HeightExaggeration', 5000)
CTRL+O Increases the height map exaggeration on Charon. Charon HeightExaggeration + /New Horizons false propertyHelper.increment('Scene.CharonProjection.Renderable.HeightExaggeration', 5000)
KP_3 Decreases the height map exaggeration on Charon. Charon HeightExaggeration - /New Horizons false propertyHelper.decrement('Scene.CharonProjection.Renderable.HeightExaggeration', 5000)
CTRL+L Decreases the height map exaggeration on Charon. Charon HeightExaggeration - /New Horizons false propertyHelper.decrement('Scene.CharonProjection.Renderable.HeightExaggeration', 5000)
o Toggles the visibility of the trail behind Pluto. Toggle Pluto Trail /New Horizons false propertyHelper.invert('Scene.PlutoBarycentricTrail.Renderable.Enabled')
j Toggles the visibility of the text labels of Pluto, Charon, Hydra, Nix, Kerberos, and Styx. Toggle Pluto Labels /New Horizons false renderableHelper.toggle('Scene.PlutoText') .. renderableHelper.toggle('Scene.CharonText') .. renderableHelper.toggle('Scene.HydraText') .. renderableHelper.toggle('Scene.NixText') .. renderableHelper.toggle('Scene.KerberosText') .. renderableHelper.toggle('Scene.StyxText')
l Toggles the visibility of the labels for the New Horizons instruments. Toggle New Horizons Labels /New Horizons false propertyHelper.fadeInOut('Scene.Labels.Renderable.Opacity', 2.0)
m Draws the instrument field of views in a solid color or as lines. Toggle instrument FOVs /New Horizons false propertyHelper.invert('Scene.NH_LORRI.Renderable.SolidDraw') .. propertyHelper.invert('Scene.NH_RALPH_LEISA.Renderable.SolidDraw') .. propertyHelper.invert('Scene.NH_RALPH_MVIC_PAN1.Renderable.SolidDraw') .. propertyHelper.invert('Scene.NH_RALPH_MVIC_PAN2.Renderable.SolidDraw') .. propertyHelper.invert('Scene.NH_RALPH_MVIC_RED.Renderable.SolidDraw') .. propertyHelper.invert('Scene.NH_RALPH_MVIC_BLUE.Renderable.SolidDraw') .. propertyHelper.invert('Scene.NH_RALPH_MVIC_FT.Renderable.SolidDraw') .. propertyHelper.invert('Scene.NH_RALPH_MVIC_METHANE.Renderable.SolidDraw') .. propertyHelper.invert('Scene.NH_RALPH_MVIC_NIR.Renderable.SolidDraw') .. propertyHelper.invert('Scene.NH_ALICE_AIRGLOW.Renderable.SolidDraw') .. propertyHelper.invert('Scene.NH_ALICE_SOC.Renderable.SolidDraw')
Shift+t Toggles the visibility of the shadow visualization of Pluto and Charon. Toggle Shadows /New Horizons false renderableHelper.toggle('Scene.PlutoShadow') .. renderableHelper.toggle('Scene.CharonShadow')
t Toggles the trail of New Horizons. Toggle NH Trail /New Horizons false renderableHelper.toggle('Scene.NewHorizonsTrailPluto')
h Disables visibility of the trails Hide Trails /Rendering false "local list = openspace.getProperty('*Trail.Renderable.Enabled'); for _,v in pairs(list) do openspace.setPropertyValueSingle(v, not openspace.getPropertyValue(v)) end"
1 Setting the simulation speed to 1 seconds per realtime second Set sim speed 1 /Simulation Speed false "openspace.time.interpolateDeltaTime(1)"
2 Setting the simulation speed to 5 seconds per realtime second Set sim speed 5 /Simulation Speed false "openspace.time.interpolateDeltaTime(5)"
3 Setting the simulation speed to 10 seconds per realtime second Set sim speed 10 /Simulation Speed false "openspace.time.interpolateDeltaTime(10)"
4 Setting the simulation speed to 20 seconds per realtime second Set sim speed 20 /Simulation Speed false "openspace.time.interpolateDeltaTime(20)"
5 Setting the simulation speed to 40 seconds per realtime second Set sim speed 40 /Simulation Speed false "openspace.time.interpolateDeltaTime(40)"
6 Setting the simulation speed to 60 seconds per realtime second Set sim speed 60 /Simulation Speed false "openspace.time.interpolateDeltaTime(60)"
7 Setting the simulation speed to 120 seconds per realtime second Set sim speed 120 /Simulation Speed false "openspace.time.interpolateDeltaTime(120)"
8 Setting the simulation speed to 360 seconds per realtime second Set sim speed 360 /Simulation Speed false "openspace.time.interpolateDeltaTime(360)"
9 Setting the simulation speed to 540 seconds per realtime second Set sim speed 540 /Simulation Speed false "openspace.time.interpolateDeltaTime(540)"
0 Setting the simulation speed to 1080 seconds per realtime second Set sim speed 1080 /Simulation Speed false "openspace.time.interpolateDeltaTime(1080)"
Shift+1 Setting the simulation speed to 2160 seconds per realtime second Set sim speed 2160 /Simulation Speed false "openspace.time.interpolateDeltaTime(2160)"
Shift+2 Setting the simulation speed to 4320 seconds per realtime second Set sim speed 4320 /Simulation Speed false "openspace.time.interpolateDeltaTime(4320)"
Shift+3 Setting the simulation speed to 8640 seconds per realtime second Set sim speed 8640 /Simulation Speed false "openspace.time.interpolateDeltaTime(8640)"
#Time
absolute 2015-07-14T08:00:00.00
#Camera
setNavigationState "NewHorizons" "Root" -6.572656E1, -7.239404E1, -2.111890E1 0.102164, -0.362945, 0.926193
#MarkNodes
Pluto
NewHorizons
Charon

View File

@@ -0,0 +1,45 @@
#Version
1.0
#Asset
scene/solarsystem/missions/osirisrex/model required
scene/solarsystem/missions/osirisrex/osirisrex required
#Property
setPropertyValueSingle NavigationHandler.OrbitalNavigator.FollowAnchorNodeRotationDistance 20.000000
setPropertyValueSingle Scene.Pluto.Renderable.Enabled false
setPropertyValueSingle Scene.Charon.Renderable.Enabled false
setPropertyValueSingle Scene.PlutoBarycenterTrail.Renderable.Enabled false
#Keybinding
a Sets the focus of the camera on 'OsirisRex'. Focus on OsirisRex /Missions/Osiris Rex false "openspace.setPropertyValue('NavigationHandler.OrbitalNavigator.Anchor', 'OsirisRex'); openspace.setPropertyValue('NavigationHandler.OrbitalNavigator.Aim', ''); openspace.setPropertyValue('NavigationHandler.OrbitalNavigator.RetargetAnchor', nil)"
s Sets the focus of the camera on 'Bennu' Focus on Bennu /Missions/Osiris Rex false "openspace.setPropertyValue('NavigationHandler.OrbitalNavigator.Anchor', 'BennuBarycenter'); openspace.setPropertyValue('NavigationHandler.OrbitalNavigator.Aim', ''); openspace.setPropertyValue('NavigationHandler.OrbitalNavigator.RetargetAnchor', nil)"
F8 Sets the time to the approach at Bennu. Set Bennu approach time /Missions/Osiris Rex false "openspace.printInfo('Set time: Approach'); openspace.time.setTime('2018-SEP-11 21:31:01.183')"
F9 Sets the time to the preliminary survey of Bennu. Set Bennu survey time /Missions/Osiris Rex false "openspace.printInfo('Set time: Preliminary Survey'); openspace.time.setTime('2018-NOV-20 01:13:12.183')"
F10 Sets the time to the orbital B event. Set orbital B event time /Missions/Osiris Rex false "openspace.printInfo('Set time: Orbital B'); openspace.time.setTime('2019-APR-08 10:35:27.186')"
F11 Sets the time to the recon event. Set recon event time /Missions/Osiris Rex false "openspace.printInfo('Set time: Recon'); openspace.time.setTime('2019-MAY-25 03:50:31.195')"
q Toggles the visibility of the text marking the location of the Sun. Toggle Sun marker /Missions/Osiris Rex false propertyHelper.invert('Scene.SunMarker.Renderable.Enabled')
1 Setting the simulation speed to 1 seconds per realtime second Set sim speed 1 /Simulation Speed false "openspace.time.interpolateDeltaTime(1)"
2 Setting the simulation speed to 5 seconds per realtime second Set sim speed 5 /Simulation Speed false "openspace.time.interpolateDeltaTime(5)"
3 Setting the simulation speed to 10 seconds per realtime second Set sim speed 10 /Simulation Speed false "openspace.time.interpolateDeltaTime(10)"
4 Setting the simulation speed to 20 seconds per realtime second Set sim speed 20 /Simulation Speed false "openspace.time.interpolateDeltaTime(20)"
5 Setting the simulation speed to 40 seconds per realtime second Set sim speed 40 /Simulation Speed false "openspace.time.interpolateDeltaTime(40)"
6 Setting the simulation speed to 60 seconds per realtime second Set sim speed 60 /Simulation Speed false "openspace.time.interpolateDeltaTime(60)"
7 Setting the simulation speed to 120 seconds per realtime second Set sim speed 120 /Simulation Speed false "openspace.time.interpolateDeltaTime(120)"
8 Setting the simulation speed to 360 seconds per realtime second Set sim speed 360 /Simulation Speed false "openspace.time.interpolateDeltaTime(360)"
9 Setting the simulation speed to 540 seconds per realtime second Set sim speed 540 /Simulation Speed false "openspace.time.interpolateDeltaTime(540)"
0 Setting the simulation speed to 1080 seconds per realtime second Set sim speed 1080 /Simulation Speed false "openspace.time.interpolateDeltaTime(1080)"
Shift+1 Setting the simulation speed to 2160 seconds per realtime second Set sim speed 2160 /Simulation Speed false "openspace.time.interpolateDeltaTime(2160)"
Shift+2 Setting the simulation speed to 4320 seconds per realtime second Set sim speed 4320 /Simulation Speed false "openspace.time.interpolateDeltaTime(4320)"
Shift+3 Setting the simulation speed to 8640 seconds per realtime second Set sim speed 8640 /Simulation Speed false "openspace.time.interpolateDeltaTime(8640)"
#Time
absolute 2018 10 30 23:00:00.500
#Camera
setNavigationState "OsirisRex" 26974590199.661884, 76314608558.908020, -127086452897.101791
#MarkNodes
OsirisRex
BennuBarycenter
Earth

View File

@@ -0,0 +1,35 @@
#Version
1.0
#Module
Volume asset.require('scene/solarsystem/missions/messenger/mercurymagnetosphere') openspace.printWarning("Volume module is not loaded, skipping asset: mercurymagnetosphere")
#Asset
scene/solarsystem/missions/rosetta/67p required
scene/solarsystem/missions/rosetta/rosetta required
#Property
setPropertyValue Scene.67P.Renderable.PerformShading false
setPropertyValue Scene.ImagePlaneRosetta.Renderable.Enabled false
#Keybinding
a Sets the focus of the camera on '67P'. Focus on 67P /Missions/Rosetta false "openspace.setPropertyValue('NavigationHandler.OrbitalNavigator.Anchor', '67P'); openspace.setPropertyValue('NavigationHandler.OrbitalNavigator.Aim', ''); openspace.setPropertyValue('NavigationHandler.OrbitalNavigator.RetargetAnchor', nil)"
s Sets the focus of the camera on 'Rosetta' Focus on Rosetta /Missions/Rosetta false "openspace.setPropertyValue('NavigationHandler.OrbitalNavigator.Anchor', 'Rosetta'); openspace.setPropertyValue('NavigationHandler.OrbitalNavigator.Aim', ''); openspace.setPropertyValue('NavigationHandler.OrbitalNavigator.RetargetAnchor', nil)"
F5 Jumps to the time of initial approach of Rosetta to 67P. Set initial approach time /Missions/Rosetta false "openspace.time.setTime('2014-08-01T03:05:18.101')"
F6 Jumps to the time when the Philae lander is released. Set lander release time /Missions/Rosetta false "openspace.time.setTime('2014-11-12T08:20:00.00')"
F8 Removes all image projections from 67P. Clear 67P projections /Missions/Rosetta false "openspace.setPropertyValue('Scene.67P.Renderable.ProjectionComponent.ClearAllProjections', true)"
e Toggles the visibility of all trails further from the Sun than 67P. Toggle outer planetary trails /Missions/Rosetta false renderableHelper.toggle('Scene.JupiterTrail')..renderableHelper.toggle('Scene.SaturnTrail')..renderableHelper.toggle('Scene.UranusTrail')..renderableHelper.toggle('Scene.NeptuneTrail')
i Toggles the visibility of the free floating image plane. Toggle image plane /Missions/Rosetta false renderableHelper.toggle('Scene.ImagePlaneRosetta')
g Toggles the visibility of Philae's trail. Toggle Philae trail /Missions/Rosetta false renderableHelper.toggle('Scene.PhilaeTrail')
p Enables or disables the image projection on 67P. Toggle 67P projection /Missions/Rosetta false propertyHelper.invert('Scene.67P.Renderable.ProjectionComponent.PerformProjection')
#Time
absolute 2014-08-01T03:05:00.000
#Camera
setNavigationState "67P" "Root" -7.294781E5 , -6.657894E5, 2.509047E6 0.146529E0, 0.944727E0, 0.293290E0
#MarkNodes
67P
Rosetta
Philae

View File

@@ -32,8 +32,8 @@ local Keybindings = {
Local = false
},
{
Key = "F5",
Command = "openspace.time.setTime('2014-08-01T03:05:18.101')",
Key = "Shift+F6",
Command = "openspace.time.setTime('2014-08-01T03:05:18.10')",
Documentation = "Jumps to the time of initial approach of Rosetta to 67P.",
Name = "Set initial approach time",
GuiPath = "/Missions/Rosetta",
@@ -81,7 +81,7 @@ local Keybindings = {
Local = false
},
{
Key = "g",
Key = "o",
Command = renderableHelper.toggle('Scene.PhilaeTrail'),
Documentation = "Toggles the visibility of Philae's trail.",
Name = "Toggle Philae trail",

View File

@@ -6,7 +6,7 @@ local textures = asset.syncedResource({
Name = "2dF Textures",
Type = "HttpSynchronization",
Identifier = "digitaluniverse_2dF_textures",
Version = 1
Version = 2
})
local speck = asset.syncedResource({
@@ -24,7 +24,7 @@ local object = {
Color = { 1.0, 1.0, 1.0 },
Opacity = 1.0,
File = speck .. "/2dF.speck",
Texture = textures .. "/point3.png",
Texture = textures .. "/point3A.png",
ColorMap = speck .. "/2dF.cmap",
ColorOption = { "redshift", "proximity" },
ColorRange = { { 0.0, 0.075 }, { 1.0, 25.0 } },

View File

@@ -6,7 +6,7 @@ local textures = asset.syncedResource({
Name = "2MASS Textures",
Type = "HttpSynchronization",
Identifier = "digitaluniverse_2mass_textures",
Version = 1
Version = 2
})
local speck = asset.syncedResource({
@@ -24,7 +24,7 @@ local object = {
Color = { 1.0, 0.4, 0.2 },
Opacity = 1.0,
File = speck .. "/2MASS.speck",
Texture = textures .. "/point3.png",
Texture = textures .. "/point3A.png",
ColorMap = speck .. "/lss.cmap",
ColorOption = { "redshift", "prox5Mpc" },
ColorRange = { { 0.0, 0.075 }, { 1.0, 50.0 } },

View File

@@ -6,7 +6,7 @@ local textures = asset.syncedResource({
Name = "6dF Textures",
Type = "HttpSynchronization",
Identifier = "digitaluniverse_6dF_textures",
Version = 1
Version = 2
})
local speck = asset.syncedResource({
@@ -24,7 +24,7 @@ local object = {
Color = { 1.0, 1.0, 0.0 },
Opacity = 1.0,
File = speck .. "/6dF.speck",
Texture = textures .. "/point3.png",
Texture = textures .. "/point3A.png",
ColorMap = speck .. "/6dF.cmap",
ColorOption = { "redshift", "proximity" },
ColorRange = { { 0.0, 0.075 }, { 1.0, 10.0 } },

View File

@@ -6,7 +6,7 @@ local textures = asset.syncedResource({
Name = "Abell Textures",
Type = "HttpSynchronization",
Identifier = "digitaluniverse_abell_textures",
Version = 1
Version = 2
})
local speck = asset.syncedResource({
@@ -25,7 +25,7 @@ local object = {
Opacity = 1.0,
--ColorMap = speck .. "/abell.cmap",
File = speck .. "/abell.speck",
Texture = textures .. "/point3.png",
Texture = textures .. "/point3A.png",
LabelFile = speck .. "/abell.label",
TextColor = { 0.0, 0.8, 0.0, 1.0 },
TextSize = 22,

View File

@@ -6,7 +6,7 @@ local textures = asset.syncedResource({
Name = "Quasars Textures",
Type = "HttpSynchronization",
Identifier = "digitaluniverse_quasars_textures",
Version = 1
Version = 2
})
local speck = asset.syncedResource({
@@ -24,7 +24,7 @@ local object = {
Color = { 1.0, 0.4, 0.2 },
Opacity = 0.95,
File = speck .. "/quasars.speck",
Texture = textures .. "/point3.png",
Texture = textures .. "/point3A.png",
Unit = "Mpc",
ScaleFactor = 540.9,
-- Fade in value in the same unit as "Unit"

View File

@@ -6,7 +6,7 @@ local textures = asset.syncedResource({
Name = "Sloan Digital Sky Survey Textures",
Type = "HttpSynchronization",
Identifier = "digitaluniverse_sloandss_textures",
Version = 1
Version = 2
})
local speck = asset.syncedResource({
@@ -28,7 +28,7 @@ local object = {
ColorMap = speck .. "/SDSSgals.cmap",
ColorOption = { "redshift", "proximity" },
ColorRange = { { 0.0, 0.075 }, { 1.0, 50.0 } },
Texture = textures .. "/point3.png",
Texture = textures .. "/point3A.png",
Unit = "Mpc",
-- Fade in value in the same unit as "Unit"
FadeInDistances = { 220.0, 650.0 },

View File

@@ -6,7 +6,7 @@ local textures = asset.syncedResource({
Name = "Galaxy Superclusters Textures",
Type = "HttpSynchronization",
Identifier = "digitaluniverse_superclusters_textures",
Version = 1
Version = 2
})
local speck = asset.syncedResource({
@@ -25,7 +25,7 @@ local object = {
Color = { 1.0, 1.0, 1.0 },
Opacity = 0.65,
File = speck .. "/superclust.speck",
Texture = textures .. "/point3.png",
Texture = textures .. "/point3A.png",
LabelFile = speck .. "/superclust.label",
TextColor = { 0.9, 0.9, 0.9, 1.0 },
ScaleFactor = 531.0,

View File

@@ -6,7 +6,7 @@ local textures = asset.syncedResource({
Name = "Tully Textures",
Type = "HttpSynchronization",
Identifier = "digitaluniverse_tully_textures",
Version = 2
Version = 3
})
local speck = asset.syncedResource({
@@ -25,7 +25,7 @@ local tullyPoints = {
Opacity = 0.99,
ScaleFactor = 500.0,
File = speck .. "/tully.speck",
Texture = textures .. "/point3.png",
Texture = textures .. "/point3A.png",
--ColorMap = speck .. "/tully.cmap",
ColorMap = speck .. "/lss.cmap",
--ColorOption = { "proximity" },

View File

@@ -10,21 +10,32 @@ local data = asset.syncedResource({
Version = 1
})
local kiloparsec = 3.086E19
local MilkyWayVolumeGalaxy = {
Identifier = "Milky Way Volume",
Identifier = "MilkyWayVolume",
Parent = transforms.SolarSystemBarycenter.Identifier,
Transform = {
Translation = {
Type = "StaticTranslation",
-- The center of the Milky Way is approximately 8 kiloparsec from the Sun.
-- The x-axis of galactic coordinates points from the sun towards the center
-- of the galaxy.
Position = { 8 * kiloparsec, 0, 0 }
}
},
Renderable = {
Type = "RenderableGalaxy",
StepSize = 0.01,
AbsorptionMultiply = 200,
EmissionMultiply = 250,
Translation = {0.2, 0, 0},
Rotation = {3.1415926, 3.1248, 4.45741},
Rotation = { 3.1415926, 3.1248, 4.45741 },
Volume = {
Type = "Volume",
Filename = data .. "/MilkyWayRGBAVolume1024x1024x128.raw",
Dimensions = {1024, 1024, 128},
Size = {1.2E21, 1.2E21, 0.15E21}
Dimensions = { 1024, 1024, 128 },
Size = { 1.2E21, 1.2E21, 0.15E21 },
Downscale = 0.4,
},
Points = {
Type = "Points",
@@ -34,9 +45,10 @@ local MilkyWayVolumeGalaxy = {
}
},
GUI = {
Path = "/Milky Way"
Path = "/Milky Way",
Name = "Milky Way Volume"
}
}
local objects = { MilkyWayVolumeGalaxy }
assetHelper.registerSceneGraphNodesAndExport(asset, objects)
assetHelper.registerSceneGraphNodesAndExport(asset, objects)

View File

@@ -2,7 +2,7 @@ local assetHelper = asset.require('util/asset_helper')
local transforms = asset.require('./transforms')
asset.require("spice/base")
asset.request('./trail')
local labelsPath = asset.require('./pluto_labels').LabelsPath
local labelsPath = asset.require('./pluto_globelabels').LabelsPath

View File

@@ -2,7 +2,7 @@ local assetHelper = asset.require('util/asset_helper')
local transforms = asset.require('./transforms')
asset.require("spice/base")
asset.request('./trail')
local labelsPath = asset.require('./pluto_labels').LabelsPath
local labelsPath = asset.require('./pluto_globelabels').LabelsPath
@@ -59,6 +59,25 @@ local Pluto = {
}
}
local PlutoLabel = {
Identifier = "PlutoLabel",
Parent = Pluto.Identifier,
Renderable = {
Enabled = false,
Type = "RenderableLabels",
LabelText = "Pluto",
FontSize = 100.0,
LabelSize = 8.9,
LabelMaxSize = 100.0,
LabelMinSize = 1.0,
BlendMode = "Additive",
LabelOrientationOption = "Camera View Direction"
},
Tag = { "solarsystem_labels" },
GUI = {
Name = "Pluto Label",
Path = "/Solar System/Dwarf Planets/Pluto"
}
}
assetHelper.registerSceneGraphNodesAndExport(asset, { Pluto })
assetHelper.registerSceneGraphNodesAndExport(asset, { Pluto, PlutoLabel })

View File

@@ -0,0 +1,46 @@
local assetHelper = asset.require('util/asset_helper')
local sunTransforms = asset.require('scene/solarsystem/sun/transforms')
local trajectory = asset.syncedResource({
Name = "C-2019 Q4 Borisov Trajectory",
Type = "HttpSynchronization",
Identifier = "borisov_horizons",
Version = 1
})
local C2019Q4BorisovTrail = {
Identifier = "C2019Q4BorisovTrail",
Parent = sunTransforms.SolarSystemBarycenter.Identifier,
Renderable = {
Type = "RenderableTrailTrajectory",
Translation = {
Type = "HorizonsTranslation",
HorizonsTextFile = trajectory .. "/horizons_c2019q4borisov.dat"
},
Color = { 0.9, 0.9, 0.0 },
StartTime = "2015 JAN 01 00:00:00",
EndTime = "2024 JAN 01 00:00:00",
SampleInterval = 60
},
GUI = {
Name = "C-2019 Q4 Borisov Trail",
Path = "/Solar System/Interstellar"
}
}
local C2019Q4BorisovPosition = {
Identifier = "C2019Q4BorisovPosition",
Parent = sunTransforms.SolarSystemBarycenter.Identifier,
Transform = {
Translation = {
Type = "HorizonsTranslation",
HorizonsTextFile = trajectory .. "/horizons_c2019q4borisov.dat"
},
},
GUI = {
Name = "C-2019 Q4 Borisov",
Path = "/Solar System/Interstellar"
}
}
assetHelper.registerSceneGraphNodesAndExport(asset, { C2019Q4BorisovPosition, C2019Q4BorisovTrail })

View File

@@ -35,7 +35,7 @@ local Apollo8Launch = {
Type = "SpiceTranslation",
Target = apolloSpiceId,
Observer = "EARTH",
Frame = "IAU_EARTH",
Frame = "IAU_EARTH",
Kernels = kernels
},
},
@@ -59,7 +59,7 @@ local Apollo8 = {
Type = "SpiceTranslation",
Target = apolloSpiceId,
Observer = "EARTH BARYCENTER",
Frame = "GALACTIC",
Frame = "GALACTIC",
Kernels = kernels
},
Rotation = {
@@ -124,7 +124,7 @@ local Apollo8Model = {
}
}
local PivotOffset = { 0, 2.5, 0}
local PivotOffset = { 0, 2.5, 0 }
-- The pivot node is used for navigation inside the spacecraft
@@ -153,7 +153,7 @@ local Apollo8LaunchTrail = {
Type = "SpiceTranslation",
Target = apolloSpiceId,
Observer = "EARTH",
Frame = "IAU_EARTH",
Frame = "IAU_EARTH",
Kernels = kernels
},
Color = { 0.70, 0.50, 0.20 },
@@ -176,7 +176,7 @@ local Apollo8MoonTrail = {
Type = "SpiceTranslation",
Target = apolloSpiceId,
Observer = "MOON",
Frame = "IAU_MOON",
Frame = "IAU_MOON",
Kernels = kernels
},
Color = { 0.70, 0.50, 0.20 },
@@ -199,15 +199,15 @@ local Apollo8EarthBarycenterTrail = {
Translation = {
Type = "SpiceTranslation",
Target = apolloSpiceId,
Observer = "EARTH BARYCENTER",
Frame = "GALACTIC",
Observer = "EARTH",
Frame = "GALACTIC",
Kernels = kernels
},
Color = { 1, 0.0, 0.0 },
Color = { 0.8, 0.2, 0.2 },
StartTime = "1968 DEC 21",
EndTime = "1968 DEC 28",
SampleInterval = 30,
Enabled = false,
Enabled = true,
},
GUI = {
Name = "Apollo 8 Earth Barycenter Trail",
@@ -215,10 +215,11 @@ local Apollo8EarthBarycenterTrail = {
}
}
local exportList = {
Apollo8,
Apollo8,
Apollo8Model,
Apollo8Launch,
Apollo8Launch,
Apollo8LaunchModel,
Apollo8Pivot,

View File

@@ -666,11 +666,17 @@ local Dawn = {
local DawnSolarArray1 = {
Identifier = "DawnSolar1",
Parent = Dawn.Identifier,
Transformation = {
Transform = {
-- JCC: Spice rotations are commented because spice ck files
-- are not present.
-- Rotation = {
-- Type = "SpiceRotation",
-- SourceFrame = "DAWN_SA-Y",
-- DestinationFrame = "DAWN_SPACECRAFT"
-- }
Rotation = {
Type = "SpiceRotation",
SourceFrame = "DAWN_SA-Y",
DestinationFrame = "DAWN_SPACECRAFT"
Type = "StaticRotation",
Rotation = {0.0, 4.71225, 0.0}
}
},
Renderable = {
@@ -693,11 +699,15 @@ local DawnSolarArray1 = {
local DawnSolarArray2 = {
Identifier = "DawnSolar2",
Parent = Dawn.Identifier,
Transformation = {
Transform = {
-- Rotation = {
-- Type = "SpiceRotation",
-- SourceFrame = "DAWN_SA+Y",
-- DestinationFrame = "DAWN_SPACECRAFT"
-- }
Rotation = {
Type = "SpiceRotation",
SourceFrame = "DAWN_SA+Y",
DestinationFrame = "DAWN_SPACECRAFT"
Type = "StaticRotation",
Rotation = {3.1415, 1.57075, 0.0}
}
},
Renderable = {

View File

@@ -2,7 +2,7 @@ local Kernels = asset.syncedResource({
Name = "Dawn Kernels",
Type = "HttpSynchronization",
Identifier = "dawn_kernels",
Version = 1
Version = 2
})
asset.export("Kernels", Kernels)

View File

@@ -47,8 +47,9 @@ local Vesta = {
Type = "RenderableModelProjection",
Geometry = {
Type = "MultiModelGeometry",
GeometryFile = models .. "/VestaComet/VestaComet_5000.obj"
GeometryFile = models .. "/VestaComet_5000.obj"
},
BoundingSphereRadius = 10.0,
ColorTexture = textures .. "/dummy.jpg",
Projection = {
Sequence = images,

View File

@@ -6,7 +6,7 @@ local localFolder = asset.syncedResource({
Name = "Mercury Magnetosphere",
Type = "HttpSynchronization",
Identifier = "mercury_magnetosphere",
Version = 1
Version = 3
})
@@ -22,7 +22,7 @@ local Magnetosphere = {
SourceDirectory = localFolder,
TransferFunction = localFolder .. "/transferfunction.txt",
Variable = "rho",
StepSize = "0.003",
StepSize = 0.003,
Dimensions = {64, 64, 64},
GridType = "Cartesian",
SecondsBefore = 24*60*60*365*100,

View File

@@ -1,33 +0,0 @@
OpenSpace ecliptic frames:
Mercury-centric Solar Ecliptic (MERCURYSE) frame
These frames are only defined as helper frames for OpenSpace.
+X is parallel to the geometric planet-sun position vector.
-Y axis is the normalized component of the planet's orbital vector
+Z axis is parallel to the cross product of the frame's +X axis
and the frame's +Y axis.
\begindata
FRAME_MERCURYSE = 4600199
FRAME_4600199_NAME = 'MERCURYSE'
FRAME_4600199_CLASS = 5
FRAME_4600199_CLASS_ID = 4600199
FRAME_4600199_CENTER = 199
FRAME_4600199_RELATIVE = 'J2000'
FRAME_4600199_DEF_STYLE = 'PARAMETERIZED'
FRAME_4600199_FAMILY = 'TWO-VECTOR'
FRAME_4600199_PRI_AXIS = 'X'
FRAME_4600199_PRI_VECTOR_DEF = 'OBSERVER_TARGET_POSITION'
FRAME_4600199_PRI_OBSERVER = 'MERCURY'
FRAME_4600199_PRI_TARGET = 'SUN'
FRAME_4600199_PRI_ABCORR = 'NONE'
FRAME_4600199_SEC_AXIS = 'Y'
FRAME_4600199_SEC_VECTOR_DEF = 'OBSERVER_TARGET_VELOCITY'
FRAME_4600199_SEC_OBSERVER = 'MERCURY'
FRAME_4600199_SEC_TARGET = 'SUN'
FRAME_4600199_SEC_ABCORR = 'NONE'
FRAME_4600199_SEC_FRAME = 'J2000'

View File

@@ -1,8 +0,0 @@
width 1024
lower 0.0
upper 0.1
mappingkey 0.0 255 0 0 0
mappingkey 0.01 255 0 0 0
mappingkey 0.1 255 255 0 100
mappingkey 0.5 255 255 0 255

View File

@@ -1,6 +1,7 @@
asset.request('./bennu')
asset.request('./model')
asset.request('./trail')
asset.request('scene/solarsystem/sun/marker')
asset.require('./script_schedule')

View File

@@ -1,6 +1,7 @@
asset.request('./planets/mercury/mercury')
asset.request('./planets/venus/venus')
asset.request('./planets/venus/atmosphere')
asset.request('./planets/earth/earth')
asset.request('./planets/earth/atmosphere')

View File

@@ -1,7 +1,7 @@
local transforms = asset.require('./transforms')
local assetHelper = asset.require('util/asset_helper')
local texturesPath = asset.require('./earth_textures').TexturesPath
local labelsPath = asset.require('./earth_labels').LabelsPath
local labelsPath = asset.require('./earth_globelabels').LabelsPath
asset.request('./trail')
@@ -91,7 +91,7 @@ local Earth = {
Type = "TemporalTileLayer",
FilePath = openspace.globebrowsing.createTemporalGibsGdalXml(
"MODIS_Aqua_CorrectedReflectance_TrueColor",
"2012-05-08",
"2002-07-04",
"Yesterday",
"1d",
"250m",
@@ -104,7 +104,7 @@ local Earth = {
Type = "TemporalTileLayer",
FilePath = openspace.globebrowsing.createTemporalGibsGdalXml(
"MODIS_Terra_CorrectedReflectance_TrueColor",
"2012-05-08",
"2000-02-24",
"Yesterday",
"1d",
"250m",
@@ -126,7 +126,7 @@ local Earth = {
Name = "AMSR2 GCOM W1 Sea Ice Concentration (Temporal)",
Type = "TemporalTileLayer",
FilePath = openspace.globebrowsing.createTemporalGibsGdalXml(
"AMSR2_Sea_Ice_Concentration_12km",
"AMSRU2_Sea_Ice_Concentration_12km",
"2012-05-08",
"Yesterday",
"1d",
@@ -287,6 +287,45 @@ local Earth = {
}
}
local EarthLabel = {
Identifier = "EarthLabel",
Parent = Earth.Identifier,
-- Transform = {
-- Translation = {
-- Type = "SpiceTranslation",
-- Target = "EARTH",
-- Observer = "EARTH BARYCENTER"
-- },
-- -- Rotation = {
-- -- Type = "SpiceRotation",
-- -- SourceFrame = "IAU_MOON",
-- -- DestinationFrame = "GALACTIC"
-- -- }
-- },
Renderable = {
Enabled = false,
Type = "RenderableLabels",
LabelText = "Earth",
FontSize = 100.0,
LabelSize = 8.6,
LabelMaxSize = 100.0,
LabelMinSize = 1.0,
LabelOrientationOption = "Camera View Direction",
BlendMode = "Additive",
EnableFading = true,
FadeStartUnit = "au",
FadeStartDistance = 1.5,
FadeStartSpeed = 1.0,
FadeEndUnit = "au",
FadeEndDistance = 15.0,
FadeEndSpeed = 25.0
},
Tag = { "solarsystem_labels" },
GUI = {
Name = "Earth Label",
Path = "/Solar System/Planets/Earth"
}
}
assetHelper.registerSceneGraphNodesAndExport(asset, { Earth })
assetHelper.registerSceneGraphNodesAndExport(asset, { Earth, EarthLabel })

View File

@@ -0,0 +1,28 @@
<VRTDataset rasterXSize="1474560" rasterYSize="737280">
<SRS>GEOGCS["GCS_Moon_2000",DATUM["D_Moon_2000",SPHEROID["Moon_2000_IAU_IAG",1737400.0,0.0]],PRIMEM["Reference_Meridian",0.0],UNIT["Degree",0.0174532925199433]]</SRS>
<GeoTransform> -1.8000000000000000e+02, 2.4414062500000000e-04, 0.0000000000000000e+00, 9.0000000000000000e+01, 0.0000000000000000e+00, -2.4414062500000000e-04</GeoTransform>
<VRTRasterBand dataType="Byte" band="1">
<ColorInterp>Gray</ColorInterp>
<SimpleSource>
<SourceFilename relativeToVRT="1">Kaguya.wms</SourceFilename>
<SourceBand>1</SourceBand>
<SourceProperties RasterXSize="1474560" RasterYSize="737280" DataType="Byte" BlockXSize="360" BlockYSize="360" />
<SrcRect xOff="0" yOff="0" xSize="1474560" ySize="737280" />
<DstRect xOff="0" yOff="0" xSize="1474560" ySize="737280" />
</SimpleSource>
</VRTRasterBand>
<VRTRasterBand dataType="Byte" band="2">
<ColorInterp>Alpha</ColorInterp>
<NoDataValue>0</NoDataValue>
<ComplexSource>
<SourceFilename relativeToVRT="1">Kaguya.wms</SourceFilename>
<SourceBand>1</SourceBand>
<SourceProperties RasterXSize="1474560" RasterYSize="737280" DataType="Byte" BlockXSize="360" BlockYSize="360" />
<SrcRect xOff="0" yOff="0" xSize="1474560" ySize="737280" />
<DstRect xOff="0" yOff="0" xSize="1474560" ySize="737280" />
<ScaleOffset>255</ScaleOffset>
<ScaleRatio>0</ScaleRatio>
<NODATA>0</NODATA>
</ComplexSource>
</VRTRasterBand>
</VRTDataset>

View File

@@ -0,0 +1,28 @@
<VRTDataset rasterXSize="1474560" rasterYSize="737280">
<SRS>GEOGCS["GCS_Moon_2000",DATUM["D_Moon_2000",SPHEROID["Moon_2000_IAU_IAG",1737400.0,0.0]],PRIMEM["Reference_Meridian",0.0],UNIT["Degree",0.0174532925199433]]</SRS>
<GeoTransform> -1.8000000000000000e+02, 2.4414062500000000e-04, 0.0000000000000000e+00, 9.0000000000000000e+01, 0.0000000000000000e+00, -2.4414062500000000e-04</GeoTransform>
<VRTRasterBand dataType="Byte" band="1">
<ColorInterp>Gray</ColorInterp>
<SimpleSource>
<SourceFilename relativeToVRT="1">Kaguya.wms</SourceFilename>
<SourceBand>1</SourceBand>
<SourceProperties RasterXSize="1474560" RasterYSize="737280" DataType="Byte" BlockXSize="360" BlockYSize="360" />
<SrcRect xOff="0" yOff="0" xSize="1474560" ySize="737280" />
<DstRect xOff="0" yOff="0" xSize="1474560" ySize="737280" />
</SimpleSource>
</VRTRasterBand>
<VRTRasterBand dataType="Byte" band="2">
<ColorInterp>Alpha</ColorInterp>
<NoDataValue>0</NoDataValue>
<ComplexSource>
<SourceFilename relativeToVRT="1">Kaguya.wms</SourceFilename>
<SourceBand>1</SourceBand>
<SourceProperties RasterXSize="1474560" RasterYSize="737280" DataType="Byte" BlockXSize="360" BlockYSize="360" />
<SrcRect xOff="0" yOff="0" xSize="1474560" ySize="737280" />
<DstRect xOff="0" yOff="0" xSize="1474560" ySize="737280" />
<ScaleOffset>255</ScaleOffset>
<ScaleRatio>0</ScaleRatio>
<NODATA>0</NODATA>
</ComplexSource>
</VRTRasterBand>
</VRTDataset>

View File

@@ -36,33 +36,39 @@ local Moon = {
Name = "WAC [Utah]",
FilePath = mapServiceConfigs .. "/Utah/Wac.wms",
Enabled = true,
Settings = { Multiplier = 2.0 }
Settings = { Gamma = 0.84 }
},
{
Identifier = "WAC_Sweden",
Name = "WAC [Sweden]",
FilePath = mapServiceConfigs .. "/LiU/WAC.wms",
Settings = { Multiplier = 2.0 }
Settings = { Gamma = 0.84 }
},
{
Identifier = "ClemUvvis_Utah",
Name = "Clem Uvvis [Utah]",
FilePath = mapServiceConfigs .. "/Utah/ClemUvvis.wms",
Settings = { Multiplier = 2.0 }
Settings = {
Gamma = 1.14,
Multiplier = 1.4
}
},
{
Identifier = "ClemUvvis_Sweden",
Name = "Clem Uvvis [Sweden]",
FilePath = mapServiceConfigs .. "/LiU/Clem_Uvvis.wms",
Settings = { Multiplier = 2.0 }
Settings = {
Gamma = 1.14,
Multiplier = 1.4
}
},
{
Identifier = "UvvisHybrid_Utah",
Name = "Uvvis Hybrid [Utah]",
FilePath = mapServiceConfigs .. "/Utah/UvvisHybrid.wms",
Settings = {
Gamma = 0.75,
Multiplier = 1.5
Gamma = 0.52,
Multiplier = 0.65
}
},
{
@@ -70,26 +76,26 @@ local Moon = {
Name = "Uvvis Hybrid [Sweden]",
FilePath = mapServiceConfigs .. "/LiU/Uvvis_Hybrid.wms",
Settings = {
Gamma = 0.75,
Multiplier = 1.5
Gamma = 0.52,
Multiplier = 0.65
}
},
{
Identifier = "Kaguya_Utah",
Name = "Kaguya [Utah]",
FilePath = mapServiceConfigs .. "/Utah/Kaguya.wms",
FilePath = mapServiceConfigs .. "/Utah/Kaguya.vrt",
Settings = {
Gamma = 1.12,
Multiplier = 2.7
Gamma = 1.0,
Multiplier = 1.23
}
},
{
Identifier = "Kaguya_Sweden",
Name = "Kaguya [Sweden]",
FilePath = mapServiceConfigs .. "/LiU/Kaguya.wms",
FilePath = mapServiceConfigs .. "/LiU/Kaguya.vrt",
Settings = {
Gamma = 1.12,
Multiplier = 2.7
Gamma = 1.0,
Multiplier = 1.23
}
},
{

View File

@@ -16,7 +16,8 @@ local MoonTrail = {
},
Color = { 0.5, 0.3, 0.3 },
Period = 27,
Resolution = 1000
Resolution = 1000,
Tag = { "moonTrail_solarSystem", "moonTrail_terrestrial", "moonTrail_earth" }
},
GUI = {
Name = "Moon Trail",

View File

@@ -1,5 +1,5 @@
local assetHelper = asset.require('util/asset_helper')
local shared = asset.require('../satellites_shared')
local shared = asset.require('util/tle_helper')
local group = {
Title = "Amateur Radio",

View File

@@ -1,5 +1,5 @@
local assetHelper = asset.require('util/asset_helper')
local shared = asset.require('../satellites_shared')
local shared = asset.require('util/tle_helper')
local group = {
Title = "Experimental",

View File

@@ -1,5 +1,5 @@
local assetHelper = asset.require('util/asset_helper')
local shared = asset.require('../satellites_shared')
local shared = asset.require('util/tle_helper')
local group = {
Title = "Geostationary",

View File

@@ -1,5 +1,5 @@
local assetHelper = asset.require('util/asset_helper')
local shared = asset.require('../satellites_shared')
local shared = asset.require('util/tle_helper')
local group = {
Title = "GlobalStar",

View File

@@ -1,5 +1,5 @@
local assetHelper = asset.require('util/asset_helper')
local shared = asset.require('../satellites_shared')
local shared = asset.require('util/tle_helper')
local group = {
Title = "Gorizont",

View File

@@ -1,5 +1,5 @@
local assetHelper = asset.require('util/asset_helper')
local shared = asset.require('../satellites_shared')
local shared = asset.require('util/tle_helper')
local group = {
Title = "Intelsat",

View File

@@ -1,5 +1,5 @@
local assetHelper = asset.require('util/asset_helper')
local shared = asset.require('../satellites_shared')
local shared = asset.require('util/tle_helper')
local group = {
Title = "Iridium",

View File

@@ -1,5 +1,5 @@
local assetHelper = asset.require('util/asset_helper')
local shared = asset.require('../satellites_shared')
local shared = asset.require('util/tle_helper')
local group = {
Title = "Iridium NEXT",

View File

@@ -1,5 +1,5 @@
local assetHelper = asset.require('util/asset_helper')
local shared = asset.require('../satellites_shared')
local shared = asset.require('util/tle_helper')
local group = {
Title = "Molniya",

View File

@@ -1,5 +1,5 @@
local assetHelper = asset.require('util/asset_helper')
local shared = asset.require('../satellites_shared')
local shared = asset.require('util/tle_helper')
local group = {
Title = "Orbcomm",

View File

@@ -1,5 +1,5 @@
local assetHelper = asset.require('util/asset_helper')
local shared = asset.require('../satellites_shared')
local shared = asset.require('util/tle_helper')
local group = {
Title = "Other comm",

View File

@@ -1,5 +1,5 @@
local assetHelper = asset.require('util/asset_helper')
local shared = asset.require('../satellites_shared')
local shared = asset.require('util/tle_helper')
local group = {
Title = "Raduga",

View File

@@ -1,5 +1,5 @@
local assetHelper = asset.require('util/asset_helper')
local shared = asset.require('../satellites_shared')
local shared = asset.require('util/tle_helper')
local group = {
Title = "SES",

View File

@@ -1,5 +1,5 @@
local assetHelper = asset.require('util/asset_helper')
local shared = asset.require('../debris_shared')
local shared = asset.require('util/tle_helper')
local group = {
Title = "Indian ASAT test Debris",

View File

@@ -1,5 +1,5 @@
local assetHelper = asset.require('util/asset_helper')
local shared = asset.require('../debris_shared')
local shared = asset.require('util/tle_helper')
local group = {
Title = "Breeze-M Breakup",

View File

@@ -1,5 +1,5 @@
local assetHelper = asset.require('util/asset_helper')
local shared = asset.require('../debris_shared')
local shared = asset.require('util/tle_helper')
local group = {
Title = "Fengyun Debris",

View File

@@ -1,5 +1,5 @@
local assetHelper = asset.require('util/asset_helper')
local shared = asset.require('../debris_shared')
local shared = asset.require('util/tle_helper')
local group = {
Title = "Iridium 33 Debris",

View File

@@ -1,5 +1,5 @@
local assetHelper = asset.require('util/asset_helper')
local shared = asset.require('../debris_shared')
local shared = asset.require('util/tle_helper')
local group = {
Title = "Kosmos 2251 Debris",

View File

@@ -1,74 +0,0 @@
local transforms = asset.require('scene/solarsystem/planets/earth/transforms')
local assetHelper = asset.require('util/asset_helper')
local satImageFolder = asset.syncedResource({
Name = "Satellite Image Files",
Type = "HttpSynchronization",
Identifier = "tle_satellites_images",
Version = 1
})
function downloadTLEFile(sceneAsset, url, name)
local identifier = name
identifier = identifier:gsub(" ", "")
identifier = identifier:gsub("&", "")
identifier = identifier:gsub("-", "")
return sceneAsset.syncedResource({
Name = "Satellite TLE Data (" .. name .. ")",
Type = "UrlSynchronization",
Identifier = "satellite_tle_data_" .. identifier,
Url = url
})
end
local registerSatelliteGroupObjects = function(containingAsset, group, tleFolder, shouldAddDuplicates)
local filename = group.Url:match("([^/]+)$")
local filenameSansExt = filename:gsub(filename:match("(%.%w+)$"), "")
local path = tleFolder .. "/" .. filename
function numLinesInFile(filename)
local ctr = 0
for _ in io.lines(filename) do ctr = ctr + 1 end
return ctr
end
-- Check format of a set of 3 TLE file lines and return nonzero if there is a format error
function isValidTLEFileFormat(lineArr)
function isEmpty(s) return s == nil or s == '' end
if isEmpty(lineArr[1]) or isEmpty(lineArr[2]) or isEmpty(lineArr[3]) then
return false
end
if string.sub(lineArr[2], 1, 2) ~= "1 " then
return false
end
if string.sub(lineArr[3], 1, 2) ~= "2 " then
return false
end
return true
end
function debris(title, file, color)
return {
Identifier = title,
Parent = transforms.EarthInertial.Identifier,
Renderable = {
Type = "RenderableSatellites",
Path = file,
Segments = 160,
Color = color,
Fade = 0.5
},
GUI = {
Path = "/Solar System/Planets/Earth/Satellites"
}
}
end
local Debris = debris(filenameSansExt, path, group.TrailColor)
assetHelper.registerSceneGraphNodesAndExport(containingAsset, { Debris })
end
asset.export("downloadTLEFile", downloadTLEFile)
asset.export("registerSatelliteGroupObjects", registerSatelliteGroupObjects)

View File

@@ -1,5 +1,5 @@
local assetHelper = asset.require('util/asset_helper')
local shared = asset.require('../satellites_shared')
local shared = asset.require('util/tle_helper')
local group = {
Title = "100 Brightest",

View File

@@ -1,5 +1,5 @@
local assetHelper = asset.require('util/asset_helper')
local shared = asset.require('../satellites_shared')
local shared = asset.require('util/tle_helper')
local group = {
Title = "CubeSat",

View File

@@ -0,0 +1,119 @@
local assetHelper = asset.require('util/asset_helper')
local satelliteHelper = asset.require('util/tle_helper')
local transforms = asset.require('scene/solarsystem/planets/earth/transforms')
local sunTransforms = asset.require('scene/solarsystem/sun/transforms')
local url = "https://celestrak.com/satcat/tle.php?CATNR=25544"
local identifier = "ISS"
local filename = "ISS.txt"
local nodes = {}
local tle = satelliteHelper.downloadTLEFile(asset, url, identifier, filename)
local modelsLocation = asset.syncedResource({
Name = "ISS Models",
Type = "HttpSynchronization",
Identifier = "iss_model",
Version = 1
})
local initializeAndAddNodes = function()
local lineElement = satelliteHelper.makeSingleLineElement(tle, filename)
local period = satelliteHelper.getPeriodFromElement(lineElement)
local path = tle .. "/" .. filename
-- TLE data is only relevant in EarthInertial frame which means the model
-- will inherit some irrelevant rotations from its parent. To get around that
-- we perform the reverse rotation back to EarthBarycenter frame after applying
-- the TLE translation
local iss = {
Identifier = identifier,
Parent = transforms.EarthInertial.Identifier,
Transform = {
Translation = {
Type = "TLETranslation",
Body = identifier,
Observer = transforms.EarthInertial.Identifier,
File = path,
LineNumber = 1
},
Rotation = {
Type = "SpiceRotation",
SourceFrame = "GALACTIC",
DestinationFrame = "J2000",
}
},
Tag = { "earth_satellite", "ISS" },
GUI = {
Path = "/Solar System/Planets/Earth/Satellites/ISS",
Hiden = true
}
}
local issModel = {
Identifier = identifier .. "_model",
Parent = iss.Identifier,
Transform = {
Rotation = {
Type = "FixedRotation",
Attached = "ISS_model",
XAxis = { 1.0, 0.0, 0.0 },
XAxisOrthogonal = true,
ZAxis = transforms.EarthInertial.Identifier
}
},
Renderable = {
Type = "RenderableModel",
Geometry = {
Type = "MultiModelGeometry",
GeometryFile = modelsLocation .. "/iss.obj"
},
ColorTexture = modelsLocation .. "/gray.png",
LightSources = assetHelper.getDefaultLightSources(sunTransforms.SolarSystemBarycenter.Identifier)
},
Tag = { "earth_satellite", "ISS" },
GUI = {
Path = "/Solar System/Planets/Earth/Satellites/ISS"
}
}
local issTrail = {
Identifier = identifier .. "_trail",
Parent = transforms.EarthInertial.Identifier,
Renderable = {
Type = "RenderableTrailOrbit",
Translation = {
Type = "TLETranslation",
Body = identifier,
Observer = transforms.EarthInertial.Identifier,
File = path,
LineNumber = 1
},
Color = { 0.9, 0.6715, 0.0 },
Fade = 1.5,
Period = period,
Resolution = 320
},
Tag = { "earth_satellite", "ISS" },
GUI = {
Path = "/Solar System/Planets/Earth/Satellites/ISS"
}
}
local myNodes = { iss, issModel, issTrail }
for _, node in ipairs(myNodes) do
openspace.addSceneGraphNode(node)
end
return myNodes
end
asset.onInitialize(function ()
nodes = initializeAndAddNodes()
end)
asset.onDeinitialize(function ()
openspace.removeSceneGraphNode(nodes[3].Identifier) -- Removing trail
openspace.removeSceneGraphNode(nodes[1].Identifier) -- Removing ISS and model recursively
end)

View File

@@ -1,5 +1,5 @@
local assetHelper = asset.require('util/asset_helper')
local shared = asset.require('../satellites_shared')
local shared = asset.require('util/tle_helper')
local group = {
Title = "Military",

View File

@@ -1,5 +1,5 @@
local assetHelper = asset.require('util/asset_helper')
local shared = asset.require('../satellites_shared')
local shared = asset.require('util/tle_helper')
local group = {
Title = "Other",

View File

@@ -1,5 +1,5 @@
local assetHelper = asset.require('util/asset_helper')
local shared = asset.require('../satellites_shared')
local shared = asset.require('util/tle_helper')
local group = {
Title = "Radar Calibration",

View File

@@ -1,5 +1,5 @@
local assetHelper = asset.require('util/asset_helper')
local shared = asset.require('../satellites_shared')
local shared = asset.require('util/tle_helper')
local group = {
Title = "SpaceStations",

View File

@@ -1,5 +1,5 @@
local assetHelper = asset.require('util/asset_helper')
local shared = asset.require('../satellites_shared')
local shared = asset.require('util/tle_helper')
local group = {
Title = "Last 30 Days",

View File

@@ -1,5 +1,5 @@
local assetHelper = asset.require('util/asset_helper')
local shared = asset.require('../satellites_shared')
local shared = asset.require('util/tle_helper')
local group = {
Title = "Beidou",

View File

@@ -1,5 +1,5 @@
local assetHelper = asset.require('util/asset_helper')
local shared = asset.require('../satellites_shared')
local shared = asset.require('util/tle_helper')
local group = {
Title = "Galileo",

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