From 6b9170f5c0cb806fee8e97c8e68be4a02f482179 Mon Sep 17 00:00:00 2001 From: Malin Ejdbo Date: Fri, 9 Oct 2020 12:11:14 +0200 Subject: [PATCH 01/28] Add caching of horizons files to optimize reading * Remove line 104 in horizonstranslation.cpp to prevent double reading * Add reading and writing of cached horizons files --- .../space/translation/horizonstranslation.cpp | 123 +++++++++++++++++- .../space/translation/horizonstranslation.h | 5 +- 2 files changed, 120 insertions(+), 8 deletions(-) diff --git a/modules/space/translation/horizonstranslation.cpp b/modules/space/translation/horizonstranslation.cpp index e8cf08330f..1bac1a179b 100644 --- a/modules/space/translation/horizonstranslation.cpp +++ b/modules/space/translation/horizonstranslation.cpp @@ -28,6 +28,7 @@ #include #include #include +#include #include #include #include @@ -83,7 +84,7 @@ HorizonsTranslation::HorizonsTranslation() requireUpdate(); notifyObservers(); }); - readHorizonsTextFile(_horizonsTextFile); + loadData(); }); } @@ -99,9 +100,6 @@ HorizonsTranslation::HorizonsTranslation(const ghoul::Dictionary& dictionary) _horizonsTextFile = absPath( dictionary.value(HorizonsTextFileInfo.identifier) ); - - // Read specified file and store it in memory. - readHorizonsTextFile(_horizonsTextFile); } glm::dvec3 HorizonsTranslation::position(const UpdateData& data) const { @@ -130,12 +128,50 @@ glm::dvec3 HorizonsTranslation::position(const UpdateData& data) const { return interpolatedPos; } -void HorizonsTranslation::readHorizonsTextFile(const std::string& horizonsTextFilePath) { - std::ifstream fileStream(horizonsTextFilePath); +void HorizonsTranslation::loadData() { + std::string _file = _horizonsTextFile; + if (!FileSys.fileExists(absPath(_file))) { + return; + } + + std::string cachedFile = FileSys.cacheManager()->cachedFilename( + _file, + ghoul::filesystem::CacheManager::Persistent::Yes + ); + + bool hasCachedFile = FileSys.fileExists(cachedFile); + if (hasCachedFile) { + LINFO(fmt::format("Cached file '{}' used for Horizon file '{}'", + cachedFile, _file + )); + + bool success = loadCachedFile(cachedFile); + if (success) { + return; + } + else { + FileSys.cacheManager()->removeCacheFile(_file); + // Intentional fall-through to the 'else' computation to generate the cache + // file for the next run + } + } + else { + LINFO(fmt::format("Cache for Horizon file '{}' not found", _file)); + } + LINFO(fmt::format("Loading Horizon file '{}'", _file)); + + readHorizonsTextFile(); + + LINFO("Saving cache"); + saveCachedFile(cachedFile); +} + +void HorizonsTranslation::readHorizonsTextFile() { + std::ifstream fileStream(_horizonsTextFile); if (!fileStream.good()) { LERROR(fmt::format( - "Failed to open Horizons text file '{}'", horizonsTextFilePath + "Failed to open Horizons text file '{}'", _horizonsTextFile )); return; } @@ -186,4 +222,77 @@ void HorizonsTranslation::readHorizonsTextFile(const std::string& horizonsTextFi fileStream.close(); } +bool HorizonsTranslation::loadCachedFile(const std::string& file) { + std::ifstream fileStream(file, std::ifstream::binary); + if (fileStream.good()) { + + // Read how many values to read + int32_t nKeyframes = 0; + fileStream.read(reinterpret_cast(&nKeyframes), sizeof(int32_t)); + if (nKeyframes == 0) { + throw ghoul::RuntimeError("Error reading cache: No values were loaded"); + } + + // Read the values in same order as they were written + double timestamp, x, y, z; + glm::dvec3 gPos; + for (int i = 0; i < nKeyframes; ++i) { + // Timestamp + fileStream.read(reinterpret_cast(×tamp), sizeof(double)); + + // Position vector components + fileStream.read(reinterpret_cast(&x), sizeof(glm::f64)); + fileStream.read(reinterpret_cast(&y), sizeof(glm::f64)); + fileStream.read(reinterpret_cast(&z), sizeof(glm::f64)); + + // Recreate the position vector + gPos = glm::dvec3(x, y, z); + + // Add keyframe in timeline + _timeline.addKeyframe(timestamp, std::move(gPos)); + } + + bool success = fileStream.good(); + return success; + } + else { + LERROR(fmt::format("Error opening file '{}' for loading cache file", file)); + return false; + } +} + +void HorizonsTranslation::saveCachedFile(const std::string& file) const { + std::ofstream fileStream(file, std::ofstream::binary); + if (!fileStream.good()) { + LERROR(fmt::format("Error opening file '{}' for save cache file", file)); + return; + } + + // Write how many values are to be written + int32_t nKeyframes = static_cast(_timeline.nKeyframes()); + if (nKeyframes == 0) { + throw ghoul::RuntimeError("Error writing cache: No values were loaded"); + } + fileStream.write(reinterpret_cast(&nKeyframes), sizeof(int32_t)); + + // Write data + std::deque> keyframes = _timeline.keyframes(); + for (int i = 0; i < nKeyframes; i++) { + // First write timestamp + fileStream.write(reinterpret_cast(&keyframes[i].timestamp), + sizeof(double) + ); + + // and then the components of the position vector one by one + fileStream.write(reinterpret_cast(&keyframes[i].data.x), + sizeof(glm::f64) + ); + fileStream.write(reinterpret_cast(&keyframes[i].data.y), + sizeof(glm::f64) + ); + fileStream.write(reinterpret_cast(&keyframes[i].data.z), + sizeof(glm::f64) + ); + } +} } // namespace openspace diff --git a/modules/space/translation/horizonstranslation.h b/modules/space/translation/horizonstranslation.h index a0c2a9fea8..f996373083 100644 --- a/modules/space/translation/horizonstranslation.h +++ b/modules/space/translation/horizonstranslation.h @@ -59,7 +59,10 @@ public: static documentation::Documentation Documentation(); private: - void readHorizonsTextFile(const std::string& _horizonsTextFilePath); + void loadData(); + void readHorizonsTextFile(); + bool loadCachedFile(const std::string& file); + void saveCachedFile(const std::string& file) const; properties::StringProperty _horizonsTextFile; std::unique_ptr _fileHandle; From efffc25ce04a61acdd01fb3ef4641dfcc59c5c30 Mon Sep 17 00:00:00 2001 From: Alexander Bock Date: Wed, 21 Oct 2020 22:30:05 +0200 Subject: [PATCH 02/28] Feature/globals handling (#1352) * Cleaner handling of global state * Prevent Lua memory corruption (closes #982) * Initialize glfw first thing to prevent weird joystick loading bug during startup --- apps/OpenSpace/main.cpp | 69 +-- include/openspace/engine/globals.h | 105 ++-- .../rendering/atmospheredeferredcaster.cpp | 10 +- .../rendering/renderableatmosphere.cpp | 4 +- modules/base/dashboard/dashboarditemangle.cpp | 12 +- modules/base/dashboard/dashboarditemdate.cpp | 10 +- .../base/dashboard/dashboarditemdistance.cpp | 12 +- .../base/dashboard/dashboarditemframerate.cpp | 26 +- .../base/dashboard/dashboarditemmission.cpp | 12 +- .../dashboarditemparallelconnection.cpp | 18 +- .../dashboard/dashboarditempropertyvalue.cpp | 6 +- .../dashboarditemsimulationincrement.cpp | 16 +- .../base/dashboard/dashboarditemvelocity.cpp | 10 +- .../lightsource/scenegraphlightsource.cpp | 4 +- .../rendering/grids/renderableboxgrid.cpp | 8 +- .../base/rendering/grids/renderablegrid.cpp | 8 +- .../rendering/grids/renderableradialgrid.cpp | 8 +- .../grids/renderablesphericalgrid.cpp | 8 +- modules/base/rendering/modelgeometry.cpp | 2 +- .../rendering/renderablecartesianaxes.cpp | 8 +- modules/base/rendering/renderablelabels.cpp | 4 +- modules/base/rendering/renderablemodel.cpp | 4 +- modules/base/rendering/renderablenodeline.cpp | 24 +- modules/base/rendering/renderableplane.cpp | 8 +- .../rendering/renderableplaneimageonline.cpp | 2 +- modules/base/rendering/renderablesphere.cpp | 8 +- modules/base/rendering/renderabletrail.cpp | 10 +- .../base/rendering/screenspacedashboard.cpp | 10 +- .../base/rendering/screenspaceframebuffer.cpp | 10 +- .../base/rendering/screenspaceimageonline.cpp | 2 +- modules/cefwebgui/cefwebguimodule.cpp | 28 +- modules/debugging/rendering/debugrenderer.cpp | 2 +- .../rendering/renderabledebugplane.cpp | 4 +- .../rendering/renderablebillboardscloud.cpp | 12 +- .../rendering/renderabledumeshes.cpp | 14 +- .../rendering/renderableplanescloud.cpp | 10 +- .../rendering/renderablepoints.cpp | 6 +- modules/exoplanets/exoplanetsmodule_lua.inl | 10 +- .../rendering/renderableorbitdisc.cpp | 10 +- .../rendering/renderablefieldlines.cpp | 4 +- .../renderablefieldlinessequence.cpp | 16 +- .../gaia/rendering/renderablegaiastars.cpp | 40 +- modules/galaxy/rendering/renderablegalaxy.cpp | 16 +- modules/globebrowsing/globebrowsingmodule.cpp | 8 +- .../globebrowsing/globebrowsingmodule_lua.inl | 26 +- .../src/asynctiledataprovider.cpp | 2 +- .../src/dashboarditemglobelocation.cpp | 12 +- modules/globebrowsing/src/gdalwrapper.cpp | 12 +- .../src/globelabelscomponent.cpp | 4 +- .../globebrowsing/src/globetranslation.cpp | 2 +- .../globebrowsing/src/rawtiledatareader.cpp | 2 +- modules/globebrowsing/src/renderableglobe.cpp | 20 +- modules/globebrowsing/src/ringscomponent.cpp | 12 +- modules/globebrowsing/src/shadowcomponent.cpp | 8 +- modules/globebrowsing/src/tileprovider.cpp | 16 +- modules/imgui/imguimodule.cpp | 26 +- modules/imgui/src/gui.cpp | 12 +- modules/imgui/src/guiassetcomponent.cpp | 2 +- modules/imgui/src/guigibscomponent.cpp | 2 +- .../imgui/src/guiglobebrowsingcomponent.cpp | 10 +- modules/imgui/src/guiiswacomponent.cpp | 24 +- modules/imgui/src/guijoystickcomponent.cpp | 10 +- modules/imgui/src/guimemorycomponent.cpp | 2 +- modules/imgui/src/guimissioncomponent.cpp | 8 +- modules/imgui/src/guiparallelcomponent.cpp | 24 +- modules/imgui/src/guishortcutscomponent.cpp | 8 +- modules/imgui/src/guispacetimecomponent.cpp | 75 +-- modules/imgui/src/renderproperties.cpp | 4 +- modules/iswa/rendering/dataplane.cpp | 2 +- modules/iswa/rendering/datasphere.cpp | 2 +- modules/iswa/rendering/iswacygnet.cpp | 14 +- modules/iswa/rendering/iswakameleongroup.cpp | 4 +- modules/iswa/rendering/kameleonplane.cpp | 8 +- modules/iswa/rendering/screenspacecygnet.cpp | 10 +- modules/iswa/rendering/textureplane.cpp | 2 +- modules/iswa/util/iswamanager.cpp | 26 +- modules/iswa/util/iswamanager_lua.inl | 8 +- .../rendering/renderablekameleonvolume.cpp | 8 +- .../rendering/renderablemultiresvolume.cpp | 6 +- modules/server/include/topics/topic.h | 2 +- modules/server/servermodule.cpp | 6 +- .../server/src/topics/documentationtopic.cpp | 6 +- .../src/topics/flightcontrollertopic.cpp | 34 +- .../server/src/topics/getpropertytopic.cpp | 2 +- modules/server/src/topics/luascripttopic.cpp | 2 +- .../src/topics/sessionrecordingtopic.cpp | 10 +- .../server/src/topics/setpropertytopic.cpp | 4 +- modules/server/src/topics/shortcuttopic.cpp | 4 +- modules/server/src/topics/timetopic.cpp | 36 +- .../src/topics/triggerpropertytopic.cpp | 2 +- modules/server/src/topics/versiontopic.cpp | 4 +- .../renderableconstellationbounds.cpp | 4 +- .../rendering/renderableorbitalkepler.cpp | 4 +- modules/space/rendering/renderablerings.cpp | 6 +- modules/space/rendering/renderablestars.cpp | 6 +- .../dashboard/dashboarditeminstruments.cpp | 14 +- .../rendering/renderablecrawlingline.cpp | 4 +- .../rendering/renderablefov.cpp | 16 +- .../rendering/renderablemodelprojection.cpp | 7 +- .../rendering/renderableplaneprojection.cpp | 10 +- .../rendering/renderableplanetprojection.cpp | 4 +- .../rendering/renderableshadowcylinder.cpp | 4 +- modules/sync/tasks/syncassettask.cpp | 2 +- modules/touch/src/touchinteraction.cpp | 24 +- modules/touch/src/touchmarker.cpp | 4 +- modules/touch/src/win32_touch.cpp | 6 +- modules/touch/touchmodule.cpp | 12 +- .../rendering/renderabletoyvolume.cpp | 8 +- .../rendering/renderabledistancelabel.cpp | 2 +- .../rendering/renderabletimevaryingvolume.cpp | 12 +- modules/webbrowser/src/browserinstance.cpp | 6 +- modules/webbrowser/src/eventhandler.cpp | 8 +- modules/webbrowser/src/screenspacebrowser.cpp | 6 +- modules/webbrowser/webbrowsermodule.cpp | 2 +- modules/webgui/webguimodule.cpp | 2 +- src/engine/globals.cpp | 461 +++++++++++------- src/engine/moduleengine_lua.inl | 2 +- src/engine/openspaceengine.cpp | 316 ++++++------ src/engine/openspaceengine_lua.inl | 24 +- src/interaction/externinteraction.cpp | 20 +- src/interaction/inputstate.cpp | 12 +- src/interaction/interactionmonitor.cpp | 4 +- src/interaction/joystickcamerastates.cpp | 4 +- src/interaction/keybindingmanager.cpp | 2 +- src/interaction/keybindingmanager_lua.inl | 12 +- src/interaction/keyframenavigator.cpp | 6 +- src/interaction/navigationhandler.cpp | 6 +- src/interaction/navigationhandler_lua.inl | 38 +- src/interaction/sessionrecording.cpp | 66 +-- src/interaction/sessionrecording_lua.inl | 18 +- src/interaction/shortcutmanager_lua.inl | 6 +- src/mission/missionmanager_lua.inl | 10 +- src/network/parallelpeer.cpp | 62 +-- src/network/parallelpeer_lua.inl | 16 +- src/query/query.cpp | 8 +- src/rendering/dashboard_lua.inl | 6 +- src/rendering/framebufferrenderer.cpp | 30 +- src/rendering/loadingscreen.cpp | 12 +- src/rendering/luaconsole.cpp | 32 +- src/rendering/renderable.cpp | 2 +- src/rendering/renderengine.cpp | 118 ++--- src/rendering/renderengine_lua.inl | 10 +- src/rendering/screenspacerenderable.cpp | 23 +- src/scene/assetmanager.cpp | 4 +- src/scene/assetmanager_lua.inl | 4 +- src/scene/profile.cpp | 2 +- src/scene/profile_lua.inl | 20 +- src/scene/rotation.cpp | 2 +- src/scene/scale.cpp | 2 +- src/scene/scene_lua.inl | 20 +- src/scene/scenegraphnode.cpp | 10 +- src/scene/sceneinitializer.cpp | 4 +- src/scene/scenelicensewriter.cpp | 2 +- src/scene/translation.cpp | 2 +- src/scripting/scriptengine.cpp | 14 +- src/scripting/scriptengine_lua.inl | 4 +- src/scripting/scriptscheduler_lua.inl | 16 +- src/util/time.cpp | 8 +- src/util/time_lua.inl | 78 +-- src/util/timemanager.cpp | 18 +- src/util/touch.cpp | 2 +- support/cmake/handle_modules.cmake | 4 + tests/main.cpp | 8 +- tests/test_assetloader.cpp | 8 +- 164 files changed, 1484 insertions(+), 1390 deletions(-) diff --git a/apps/OpenSpace/main.cpp b/apps/OpenSpace/main.cpp index d7d4c60fd5..c41a94245f 100644 --- a/apps/OpenSpace/main.cpp +++ b/apps/OpenSpace/main.cpp @@ -221,7 +221,7 @@ void mainInitFunc(GLFWwindow*) { LTRACE("main::mainInitFunc(begin)"); LDEBUG("Initializing OpenSpace Engine started"); - global::openSpaceEngine.initialize(); + global::openSpaceEngine->initialize(); LDEBUG("Initializing OpenSpace Engine finished"); { @@ -247,7 +247,7 @@ void mainInitFunc(GLFWwindow*) { currentViewport = currentWindow->viewports().front().get(); LDEBUG("Initializing OpenGL in OpenSpace Engine started"); - global::openSpaceEngine.initializeGL(); + global::openSpaceEngine->initializeGL(); LDEBUG("Initializing OpenGL in OpenSpace Engine finished"); @@ -325,7 +325,7 @@ void mainInitFunc(GLFWwindow*) { // Screenshots // std::string screenshotPath = "${SCREENSHOTS}"; - if (global::configuration.shouldUseScreenshotDate) { + if (global::configuration->shouldUseScreenshotDate) { std::time_t now = std::time(nullptr); std::tm* nowTime = std::localtime(&now); char mbstr[128]; @@ -351,7 +351,7 @@ void mainPreSyncFunc() { LTRACE("main::mainPreSyncFunc(begin)"); try { - global::openSpaceEngine.preSynchronization(); + global::openSpaceEngine->preSynchronization(); } catch (const ghoul::RuntimeError& e) { LFATALC(e.component, e.message); @@ -364,7 +364,7 @@ void mainPreSyncFunc() { for (int i = GLFW_JOYSTICK_1; i <= GLFW_JOYSTICK_LAST; ++i) { ZoneScopedN("Joystick state"); - JoystickInputState& state = global::joystickInputStates[i]; + JoystickInputState& state = global::joystickInputStates->at(i); int present = glfwJoystickPresent(i); if (present == GLFW_FALSE) { @@ -446,7 +446,7 @@ void mainPostSyncPreDrawFunc() { #endif // OPENSPACE_HAS_NVTOOLS LTRACE("main::postSynchronizationPreDraw(begin)"); - global::openSpaceEngine.postSynchronizationPreDraw(); + global::openSpaceEngine->postSynchronizationPreDraw(); #ifdef OPENVR_SUPPORT if (FirstOpenVRWindow) { @@ -515,7 +515,7 @@ void mainRenderFunc(const sgct::RenderData& data) { ); currentModelMatrix = modelMatrix; currentModelViewProjectionMatrix = modelMatrix * viewMatrix * projectionMatrix; - global::openSpaceEngine.render(modelMatrix, viewMatrix, projectionMatrix); + global::openSpaceEngine->render(modelMatrix, viewMatrix, projectionMatrix); } catch (const ghoul::RuntimeError& e) { LERRORC(e.component, e.message); @@ -538,7 +538,7 @@ void mainDraw2DFunc(const sgct::RenderData& data) { currentFrustumMode = data.frustumMode; try { - global::openSpaceEngine.drawOverlays(); + global::openSpaceEngine->drawOverlays(); } catch (const ghoul::RuntimeError& e) { LERRORC(e.component, e.message); @@ -565,7 +565,7 @@ void mainPostDrawFunc() { } #endif // OPENVR_SUPPORT - global::openSpaceEngine.postDraw(); + global::openSpaceEngine->postDraw(); #ifdef OPENSPACE_HAS_SPOUT for (const SpoutWindow& w : SpoutWindows) { @@ -609,7 +609,7 @@ void mainKeyboardCallback(sgct::Key key, sgct::Modifier modifiers, sgct::Action const openspace::Key k = openspace::Key(key); const KeyModifier m = KeyModifier(modifiers); const KeyAction a = KeyAction(action); - global::openSpaceEngine.keyboardCallback(k, m, a); + global::openSpaceEngine->keyboardCallback(k, m, a); LTRACE("main::mainKeyboardCallback(begin)"); } @@ -625,7 +625,7 @@ void mainMouseButtonCallback(sgct::MouseButton key, sgct::Modifier modifiers, const openspace::MouseButton k = openspace::MouseButton(key); const openspace::MouseAction a = openspace::MouseAction(action); const openspace::KeyModifier m = openspace::KeyModifier(modifiers); - global::openSpaceEngine.mouseButtonCallback(k, a, m); + global::openSpaceEngine->mouseButtonCallback(k, a, m); LTRACE("main::mainMouseButtonCallback(end)"); } @@ -634,7 +634,7 @@ void mainMouseButtonCallback(sgct::MouseButton key, sgct::Modifier modifiers, void mainMousePosCallback(double x, double y) { ZoneScoped - global::openSpaceEngine.mousePositionCallback(x, y); + global::openSpaceEngine->mousePositionCallback(x, y); } @@ -643,7 +643,7 @@ void mainMouseScrollCallback(double posX, double posY) { ZoneScoped LTRACE("main::mainMouseScrollCallback(begin"); - global::openSpaceEngine.mouseScrollWheelCallback(posX, posY); + global::openSpaceEngine->mouseScrollWheelCallback(posX, posY); LTRACE("main::mainMouseScrollCallback(end)"); } @@ -654,7 +654,7 @@ void mainCharCallback(unsigned int codepoint, int modifiers) { ZoneScoped const KeyModifier m = KeyModifier(modifiers); - global::openSpaceEngine.charCallback(codepoint, m); + global::openSpaceEngine->charCallback(codepoint, m); } @@ -663,7 +663,7 @@ std::vector mainEncodeFun() { ZoneScoped LTRACE("main::mainEncodeFun(begin)"); - std::vector data = global::openSpaceEngine.encode(); + std::vector data = global::openSpaceEngine->encode(); LTRACE("main::mainEncodeFun(end)"); return data; @@ -675,7 +675,7 @@ void mainDecodeFun(const std::vector& data, unsigned int) { ZoneScoped LTRACE("main::mainDecodeFun(begin)"); - global::openSpaceEngine.decode(data); + global::openSpaceEngine->decode(data); LTRACE("main::mainDecodeFun(end)"); } @@ -704,7 +704,7 @@ void mainLogCallback(Log::Level level, std::string_view message) { void setSgctDelegateFunctions() { - WindowDelegate& sgctDelegate = global::windowDelegate; + WindowDelegate& sgctDelegate = *global::windowDelegate; sgctDelegate.terminate = []() { Engine::instance().terminate(); }; sgctDelegate.setBarrier = [](bool enabled) { ZoneScoped @@ -959,7 +959,7 @@ std::string setWindowConfigPresetForGui(const std::string labelFromCfgFile, const std::string xmlExt, bool haveCliSGCTConfig, const std::string& sgctFunctionName) { - configuration::Configuration& config = global::configuration; + configuration::Configuration& config = *global::configuration; std::string preset; bool sgctConfigFileSpecifiedByLuaFunction = !config.sgctConfigNameInitialized.empty(); @@ -1003,12 +1003,14 @@ std::string selectedSgctProfileFromLauncher(LauncherWindow& lw, bool hasCliSGCTC else { config = "${CONFIG}/" + config + xmlExt; } - global::configuration.windowConfiguration = config; + global::configuration->windowConfiguration = config; } return config; } int main(int argc, char** argv) { + glfwInit(); + #ifdef WIN32 SetUnhandledExceptionFilter(generateMiniDump); #endif // WIN32 @@ -1031,6 +1033,7 @@ int main(int argc, char** argv) { } ghoul::initialize(); + global::create(); // Register the path of the executable, // to make it possible to find other files in the same directory. @@ -1104,7 +1107,7 @@ int main(int argc, char** argv) { // Loading configuration from disk LDEBUG("Loading configuration from disk"); - global::configuration = configuration::loadConfigurationFromFile( + *global::configuration = configuration::loadConfigurationFromFile( configurationFilePath ); // If the user requested a commandline-based configuration script that should @@ -1113,16 +1116,16 @@ int main(int argc, char** argv) { LDEBUG("Executing Lua script passed through the commandline:"); LDEBUG(commandlineArguments.configurationOverride); ghoul::lua::runScript( - global::configuration.state, + global::configuration->state, commandlineArguments.configurationOverride ); - parseLuaState(global::configuration); + parseLuaState(*global::configuration); } // Determining SGCT configuration file - LDEBUG("SGCT Configuration file: " + global::configuration.windowConfiguration); + LDEBUG("SGCT Configuration file: " + global::configuration->windowConfiguration); - windowConfiguration = global::configuration.windowConfiguration; + windowConfiguration = global::configuration->windowConfiguration; } catch (const documentation::SpecificationError& e) { LFATALC("main", "Loading of configuration file failed"); @@ -1145,7 +1148,7 @@ int main(int argc, char** argv) { return EXIT_FAILURE; } - global::openSpaceEngine.registerPathTokens(); + global::openSpaceEngine->registerPathTokens(); bool hasSGCTConfig = false; @@ -1164,12 +1167,12 @@ int main(int argc, char** argv) { ); bool skipLauncher = - (hasProfile && hasSGCTConfig) || global::configuration.bypassLauncher; + (hasProfile && hasSGCTConfig) || global::configuration->bypassLauncher; if (!skipLauncher) { int qac = 0; QApplication app(qac, nullptr); LauncherWindow win(!hasProfile, - global::configuration, !hasSGCTConfig, windowCfgPreset, nullptr); + *global::configuration, !hasSGCTConfig, windowCfgPreset, nullptr); win.show(); app.exec(); @@ -1177,7 +1180,7 @@ int main(int argc, char** argv) { exit(EXIT_SUCCESS); } - global::configuration.profile = win.selectedProfile(); + global::configuration->profile = win.selectedProfile(); windowConfiguration = selectedSgctProfileFromLauncher( win, hasSGCTConfig, @@ -1231,11 +1234,12 @@ int main(int argc, char** argv) { catch (const std::runtime_error& e) { LFATALC("main", e.what()); Engine::destroy(); - global::openSpaceEngine.deinitialize(); + global::openSpaceEngine->deinitialize(); ghoul::deinitialize(); + throw; } catch (...) { - global::openSpaceEngine.deinitialize(); + global::openSpaceEngine->deinitialize(); ghoul::deinitialize(); Engine::destroy(); throw; @@ -1274,8 +1278,9 @@ int main(int argc, char** argv) { Engine::instance().render(); LINFO("Ending rendering loop"); - global::openSpaceEngine.deinitializeGL(); - global::openSpaceEngine.deinitialize(); + global::openSpaceEngine->deinitializeGL(); + global::openSpaceEngine->deinitialize(); + global::destroy(); // Clear function bindings to avoid crash after destroying the OpenSpace Engine Log::instance().setLogCallback(nullptr); diff --git a/include/openspace/engine/globals.h b/include/openspace/engine/globals.h index 1fcfca9b96..2a1b946491 100644 --- a/include/openspace/engine/globals.h +++ b/include/openspace/engine/globals.h @@ -69,81 +69,42 @@ class Profile; namespace global { -namespace detail { - -ghoul::fontrendering::FontManager& gFontManager(); -Dashboard& gDashboard(); -DeferredcasterManager& gDeferredcasterManager(); -DownloadManager& gDownloadManager(); -LuaConsole& gLuaConsole(); -MemoryManager& gMemoryManager(); -MissionManager& gMissionManager(); -ModuleEngine& gModuleEngine(); -OpenSpaceEngine& gOpenSpaceEngine(); -ParallelPeer& gParallelPeer(); -RaycasterManager& gRaycasterManager(); -RenderEngine& gRenderEngine(); -std::vector>& gScreenspaceRenderables(); -SyncEngine& gSyncEngine(); -TimeManager& gTimeManager(); -VersionChecker& gVersionChecker(); -VirtualPropertyManager& gVirtualPropertyManager(); -WindowDelegate& gWindowDelegate(); -configuration::Configuration& gConfiguration(); -interaction::InteractionMonitor& gInteractionMonitor(); -interaction::JoystickInputStates& gJoystickInputStates(); -interaction::WebsocketInputStates& gWebsocketInputStates(); -interaction::KeybindingManager& gKeybindingManager(); -interaction::NavigationHandler& gNavigationHandler(); -interaction::SessionRecording& gSessionRecording(); -interaction::ShortcutManager& gShortcutManager(); -properties::PropertyOwner& gRootPropertyOwner(); -properties::PropertyOwner& gScreenSpaceRootPropertyOwner(); -scripting::ScriptEngine& gScriptEngine(); -scripting::ScriptScheduler& gScriptScheduler(); -Profile& gProfile(); - -} // namespace detail - -static ghoul::fontrendering::FontManager& fontManager = detail::gFontManager(); -static Dashboard& dashboard = detail::gDashboard(); -static DeferredcasterManager& deferredcasterManager = detail::gDeferredcasterManager(); -static DownloadManager& downloadManager = detail::gDownloadManager(); -static LuaConsole& luaConsole = detail::gLuaConsole(); -static MemoryManager& memoryManager = detail::gMemoryManager(); -static MissionManager& missionManager = detail::gMissionManager(); -static ModuleEngine& moduleEngine = detail::gModuleEngine(); -static OpenSpaceEngine& openSpaceEngine = detail::gOpenSpaceEngine(); -static ParallelPeer& parallelPeer = detail::gParallelPeer(); -static RaycasterManager& raycasterManager = detail::gRaycasterManager(); -static RenderEngine& renderEngine = detail::gRenderEngine(); -static std::vector>& screenSpaceRenderables = - detail::gScreenspaceRenderables(); -static SyncEngine& syncEngine = detail::gSyncEngine(); -static TimeManager& timeManager = detail::gTimeManager(); -static VersionChecker& versionChecker = detail::gVersionChecker(); -static VirtualPropertyManager& virtualPropertyManager = detail::gVirtualPropertyManager(); -static WindowDelegate& windowDelegate = detail::gWindowDelegate(); -static configuration::Configuration& configuration = detail::gConfiguration(); -static interaction::InteractionMonitor& interactionMonitor = - detail::gInteractionMonitor(); -static interaction::JoystickInputStates& joystickInputStates = - detail::gJoystickInputStates(); -static interaction::WebsocketInputStates& websocketInputStates = - detail::gWebsocketInputStates(); -static interaction::KeybindingManager& keybindingManager = detail::gKeybindingManager(); -static interaction::NavigationHandler& navigationHandler = detail::gNavigationHandler(); -static interaction::SessionRecording& sessionRecording = detail::gSessionRecording(); -static interaction::ShortcutManager& shortcutManager = detail::gShortcutManager(); -static properties::PropertyOwner& rootPropertyOwner = detail::gRootPropertyOwner(); -static properties::PropertyOwner& screenSpaceRootPropertyOwner = - detail::gScreenSpaceRootPropertyOwner(); -static scripting::ScriptEngine& scriptEngine = detail::gScriptEngine(); -static scripting::ScriptScheduler& scriptScheduler = detail::gScriptScheduler(); -static Profile& profile = detail::gProfile(); +inline ghoul::fontrendering::FontManager* fontManager; +inline Dashboard* dashboard; +inline DeferredcasterManager* deferredcasterManager; +inline DownloadManager* downloadManager; +inline LuaConsole* luaConsole; +inline MemoryManager* memoryManager; +inline MissionManager* missionManager; +inline ModuleEngine* moduleEngine; +inline OpenSpaceEngine* openSpaceEngine; +inline ParallelPeer* parallelPeer; +inline RaycasterManager* raycasterManager; +inline RenderEngine* renderEngine; +inline std::vector>* screenSpaceRenderables; +inline SyncEngine* syncEngine; +inline TimeManager* timeManager; +inline VersionChecker* versionChecker; +inline VirtualPropertyManager* virtualPropertyManager; +inline WindowDelegate* windowDelegate; +inline configuration::Configuration* configuration; +inline interaction::InteractionMonitor* interactionMonitor; +inline interaction::JoystickInputStates* joystickInputStates; +inline interaction::WebsocketInputStates* websocketInputStates; +inline interaction::KeybindingManager* keybindingManager; +inline interaction::NavigationHandler* navigationHandler; +inline interaction::SessionRecording* sessionRecording; +inline interaction::ShortcutManager* shortcutManager; +inline properties::PropertyOwner* rootPropertyOwner; +inline properties::PropertyOwner* screenSpaceRootPropertyOwner; +inline scripting::ScriptEngine* scriptEngine; +inline scripting::ScriptScheduler* scriptScheduler; +inline Profile* profile; +void create(); void initialize(); void initializeGL(); +void destroy(); void deinitialize(); void deinitializeGL(); diff --git a/modules/atmosphere/rendering/atmospheredeferredcaster.cpp b/modules/atmosphere/rendering/atmospheredeferredcaster.cpp index 56ebd46c71..54dfbaa48e 100644 --- a/modules/atmosphere/rendering/atmospheredeferredcaster.cpp +++ b/modules/atmosphere/rendering/atmospheredeferredcaster.cpp @@ -335,10 +335,10 @@ void AtmosphereDeferredcaster::preRaycast(const RenderData& renderData, const std::string source = shadowConf.source.first; SceneGraphNode* sourceNode = - global::renderEngine.scene()->sceneGraphNode(source); + global::renderEngine->scene()->sceneGraphNode(source); const std::string caster = shadowConf.caster.first; SceneGraphNode* casterNode = - global::renderEngine.scene()->sceneGraphNode(caster); + global::renderEngine->scene()->sceneGraphNode(caster); const double sourceRadiusScale = std::max( glm::compMax(sourceNode->scale()), @@ -1198,7 +1198,7 @@ void AtmosphereDeferredcaster::executeCalculations(GLuint quadCalcVAO, } // Restores OpenGL blending state - global::renderEngine.openglStateCache().resetBlendState(); + global::renderEngine->openglStateCache().resetBlendState(); } void AtmosphereDeferredcaster::preCalculateAtmosphereParam() { @@ -1217,7 +1217,7 @@ void AtmosphereDeferredcaster::preCalculateAtmosphereParam() { glGetIntegerv(GL_FRAMEBUFFER_BINDING, &defaultFBO); GLint m_viewport[4]; - global::renderEngine.openglStateCache().viewport(m_viewport); + global::renderEngine->openglStateCache().viewport(m_viewport); // Creates the FBO for the calculations GLuint calcFBO; @@ -1243,7 +1243,7 @@ void AtmosphereDeferredcaster::preCalculateAtmosphereParam() { // Restores system state glBindFramebuffer(GL_FRAMEBUFFER, defaultFBO); - global::renderEngine.openglStateCache().setViewportState(m_viewport); + global::renderEngine->openglStateCache().setViewportState(m_viewport); glDeleteBuffers(1, &quadCalcVBO); glDeleteVertexArrays(1, &quadCalcVAO); glDeleteFramebuffers(1, &calcFBO); diff --git a/modules/atmosphere/rendering/renderableatmosphere.cpp b/modules/atmosphere/rendering/renderableatmosphere.cpp index 7b31587b74..62582209a1 100644 --- a/modules/atmosphere/rendering/renderableatmosphere.cpp +++ b/modules/atmosphere/rendering/renderableatmosphere.cpp @@ -651,7 +651,7 @@ RenderableAtmosphere::RenderableAtmosphere(const ghoul::Dictionary& dictionary) void RenderableAtmosphere::deinitializeGL() { if (_deferredcaster) { - global::deferredcasterManager.detachDeferredcaster(*_deferredcaster); + global::deferredcasterManager->detachDeferredcaster(*_deferredcaster); _deferredcaster = nullptr; } } @@ -694,7 +694,7 @@ void RenderableAtmosphere::initializeGL() { _deferredcaster->initialize(); } - global::deferredcasterManager.attachDeferredcaster(*_deferredcaster); + global::deferredcasterManager->attachDeferredcaster(*_deferredcaster); } return; diff --git a/modules/base/dashboard/dashboarditemangle.cpp b/modules/base/dashboard/dashboarditemangle.cpp index e2a3c49b5d..6ad0945c11 100644 --- a/modules/base/dashboard/dashboarditemangle.cpp +++ b/modules/base/dashboard/dashboarditemangle.cpp @@ -219,12 +219,12 @@ DashboardItemAngle::DashboardItemAngle(const ghoul::Dictionary& dictionary) } _fontName.onChange([this]() { - _font = global::fontManager.font(_fontName, _fontSize); + _font = global::fontManager->font(_fontName, _fontSize); }); addProperty(_fontName); _fontSize.onChange([this]() { - _font = global::fontManager.font(_fontName, _fontSize); + _font = global::fontManager->font(_fontName, _fontSize); }); addProperty(_fontSize); @@ -352,7 +352,7 @@ DashboardItemAngle::DashboardItemAngle(const ghoul::Dictionary& dictionary) } addProperty(_destination.nodeName); - _font = global::fontManager.font(_fontName, _fontSize); + _font = global::fontManager->font(_fontName, _fontSize); _buffer.resize(128); } @@ -361,7 +361,7 @@ std::pair DashboardItemAngle::positionAndLabel( { if (comp.type == Type::Node) { if (!comp.node) { - comp.node = global::renderEngine.scene()->sceneGraphNode(comp.nodeName); + comp.node = global::renderEngine->scene()->sceneGraphNode(comp.nodeName); if (!comp.node) { LERRORC( @@ -379,14 +379,14 @@ std::pair DashboardItemAngle::positionAndLabel( case Type::Focus: { const SceneGraphNode* node = - global::navigationHandler.orbitalNavigator().anchorNode(); + global::navigationHandler->orbitalNavigator().anchorNode(); return { node->worldPosition(), "focus" }; } case Type::Camera: - return { global::renderEngine.scene()->camera()->positionVec3(), "camera" }; + return { global::renderEngine->scene()->camera()->positionVec3(), "camera" }; default: return { glm::dvec3(0.0), "Unknown" }; } diff --git a/modules/base/dashboard/dashboarditemdate.cpp b/modules/base/dashboard/dashboarditemdate.cpp index 0cd58ffe29..34b0dac408 100644 --- a/modules/base/dashboard/dashboarditemdate.cpp +++ b/modules/base/dashboard/dashboarditemdate.cpp @@ -95,7 +95,7 @@ DashboardItemDate::DashboardItemDate(const ghoul::Dictionary& dictionary) _fontName = dictionary.value(FontNameInfo.identifier); } _fontName.onChange([this](){ - _font = global::fontManager.font(_fontName, _fontSize); + _font = global::fontManager->font(_fontName, _fontSize); }); addProperty(_fontName); @@ -103,11 +103,11 @@ DashboardItemDate::DashboardItemDate(const ghoul::Dictionary& dictionary) _fontSize = static_cast(dictionary.value(FontSizeInfo.identifier)); } _fontSize.onChange([this](){ - _font = global::fontManager.font(_fontName, _fontSize); + _font = global::fontManager->font(_fontName, _fontSize); }); addProperty(_fontSize); - _font = global::fontManager.font(_fontName, _fontSize); + _font = global::fontManager->font(_fontName, _fontSize); } void DashboardItemDate::render(glm::vec2& penPosition) { @@ -116,7 +116,7 @@ void DashboardItemDate::render(glm::vec2& penPosition) { RenderFont( *_font, penPosition, - fmt::format("Date: {} UTC", global::timeManager.time().UTC()) + fmt::format("Date: {} UTC", global::timeManager->time().UTC()) ); penPosition.y -= _font->height(); } @@ -125,7 +125,7 @@ glm::vec2 DashboardItemDate::size() const { ZoneScoped return _font->boundingBox( - fmt::format("Date: {} UTC", global::timeManager.time().UTC()) + fmt::format("Date: {} UTC", global::timeManager->time().UTC()) ); } diff --git a/modules/base/dashboard/dashboarditemdistance.cpp b/modules/base/dashboard/dashboarditemdistance.cpp index 5780801960..e8f83a77bd 100644 --- a/modules/base/dashboard/dashboarditemdistance.cpp +++ b/modules/base/dashboard/dashboarditemdistance.cpp @@ -221,12 +221,12 @@ DashboardItemDistance::DashboardItemDistance(const ghoul::Dictionary& dictionary } _fontName.onChange([this]() { - _font = global::fontManager.font(_fontName, _fontSize); + _font = global::fontManager->font(_fontName, _fontSize); }); addProperty(_fontName); _fontSize.onChange([this]() { - _font = global::fontManager.font(_fontName, _fontSize); + _font = global::fontManager->font(_fontName, _fontSize); }); addProperty(_fontSize); @@ -358,7 +358,7 @@ DashboardItemDistance::DashboardItemDistance(const ghoul::Dictionary& dictionary _requestedUnit.setVisibility(properties::Property::Visibility::Hidden); addProperty(_requestedUnit); - _font = global::fontManager.font(_fontName, _fontSize); + _font = global::fontManager->font(_fontName, _fontSize); _buffer.resize(256); } @@ -369,7 +369,7 @@ std::pair DashboardItemDistance::positionAndLabel( { if ((mainComp.type == Type::Node) || (mainComp.type == Type::NodeSurface)) { if (!mainComp.node) { - mainComp.node = global::renderEngine.scene()->sceneGraphNode( + mainComp.node = global::renderEngine->scene()->sceneGraphNode( mainComp.nodeName ); @@ -406,7 +406,7 @@ std::pair DashboardItemDistance::positionAndLabel( } case Type::Focus: { const SceneGraphNode* anchor = - global::navigationHandler.orbitalNavigator().anchorNode(); + global::navigationHandler->orbitalNavigator().anchorNode(); if (!anchor) { return { glm::dvec3(0.0), "Unknown" }; } @@ -415,7 +415,7 @@ std::pair DashboardItemDistance::positionAndLabel( } } case Type::Camera: - return { global::renderEngine.scene()->camera()->positionVec3(), "camera" }; + return { global::renderEngine->scene()->camera()->positionVec3(), "camera" }; default: return { glm::dvec3(0.0), "Unknown" }; } diff --git a/modules/base/dashboard/dashboarditemframerate.cpp b/modules/base/dashboard/dashboarditemframerate.cpp index 8471fa2280..27e583f6d8 100644 --- a/modules/base/dashboard/dashboarditemframerate.cpp +++ b/modules/base/dashboard/dashboarditemframerate.cpp @@ -75,7 +75,7 @@ namespace { return fmt::format_to( buffer.data(), "Avg. Frametime: {:.2f} ms\0", - openspace::global::windowDelegate.averageDeltaTime() * 1000.0 + openspace::global::windowDelegate->averageDeltaTime() * 1000.0 ); } @@ -87,8 +87,8 @@ namespace { buffer.data(), "Last frametimes between: {:.2f} and {:.2f} ms\n" "Overall between: {:.2f} and {:.2f} ms\0", - openspace::global::windowDelegate.minDeltaTime() * 1000.0, - openspace::global::windowDelegate.maxDeltaTime() * 1000.0, + openspace::global::windowDelegate->minDeltaTime() * 1000.0, + openspace::global::windowDelegate->maxDeltaTime() * 1000.0, minFrametimeCache, maxFrametimeCache ); @@ -98,7 +98,7 @@ namespace { return fmt::format_to( buffer.data(), "Frametime standard deviation : {:.2f} ms\0", - openspace::global::windowDelegate.deltaTimeStandardDeviation() * 1000.0 + openspace::global::windowDelegate->deltaTimeStandardDeviation() * 1000.0 ); } @@ -106,8 +106,8 @@ namespace { return fmt::format_to( buffer.data(), "Frametime coefficient of variation : {:.2f} %\0", - openspace::global::windowDelegate.deltaTimeStandardDeviation() / - openspace::global::windowDelegate.averageDeltaTime() * 100.0 + openspace::global::windowDelegate->deltaTimeStandardDeviation() / + openspace::global::windowDelegate->averageDeltaTime() * 100.0 ); } @@ -115,7 +115,7 @@ namespace { return fmt::format_to( buffer.data(), "FPS: {:3.2f}\0", - 1.0 / openspace::global::windowDelegate.deltaTime() + 1.0 / openspace::global::windowDelegate->deltaTime() ); } @@ -123,7 +123,7 @@ namespace { return fmt::format_to( buffer.data(), "Avg. FPS: {:3.2f}\0", - 1.0 / openspace::global::windowDelegate.averageDeltaTime() + 1.0 / openspace::global::windowDelegate->averageDeltaTime() ); } @@ -221,7 +221,7 @@ DashboardItemFramerate::DashboardItemFramerate(const ghoul::Dictionary& dictiona _fontName = dictionary.value(FontNameInfo.identifier); } _fontName.onChange([this]() { - _font = global::fontManager.font(_fontName, _fontSize); + _font = global::fontManager->font(_fontName, _fontSize); }); addProperty(_fontName); @@ -231,7 +231,7 @@ DashboardItemFramerate::DashboardItemFramerate(const ghoul::Dictionary& dictiona ); } _fontSize.onChange([this](){ - _font = global::fontManager.font(_fontName, _fontSize); + _font = global::fontManager->font(_fontName, _fontSize); }); addProperty(_fontSize); @@ -287,7 +287,7 @@ DashboardItemFramerate::DashboardItemFramerate(const ghoul::Dictionary& dictiona }); addProperty(_clearCache); - _font = global::fontManager.font(_fontName, _fontSize); + _font = global::fontManager->font(_fontName, _fontSize); _buffer.resize(128); } @@ -303,11 +303,11 @@ void DashboardItemFramerate::render(glm::vec2& penPosition) { _minDeltaTimeCache = std::min( _minDeltaTimeCache, - global::windowDelegate.minDeltaTime() * 1000.0 + global::windowDelegate->minDeltaTime() * 1000.0 ); _maxDeltaTimeCache = std::max( _maxDeltaTimeCache, - global::windowDelegate.maxDeltaTime() * 1000.0 + global::windowDelegate->maxDeltaTime() * 1000.0 ); FrametimeType frametimeType = FrametimeType(_frametimeType.value()); diff --git a/modules/base/dashboard/dashboarditemmission.cpp b/modules/base/dashboard/dashboarditemmission.cpp index e2be50766f..881a12b953 100644 --- a/modules/base/dashboard/dashboarditemmission.cpp +++ b/modules/base/dashboard/dashboarditemmission.cpp @@ -114,7 +114,7 @@ DashboardItemMission::DashboardItemMission(const ghoul::Dictionary& dictionary) _fontName = dictionary.value(FontNameInfo.identifier); } _fontName.onChange([this](){ - _font = global::fontManager.font(_fontName, _fontSize); + _font = global::fontManager->font(_fontName, _fontSize); }); addProperty(_fontName); @@ -122,21 +122,21 @@ DashboardItemMission::DashboardItemMission(const ghoul::Dictionary& dictionary) _fontSize = static_cast(dictionary.value(FontSizeInfo.identifier)); } _fontSize.onChange([this](){ - _font = global::fontManager.font(_fontName, _fontSize); + _font = global::fontManager->font(_fontName, _fontSize); }); addProperty(_fontSize); - _font = global::fontManager.font(_fontName, _fontSize); + _font = global::fontManager->font(_fontName, _fontSize); } void DashboardItemMission::render(glm::vec2& penPosition) { ZoneScoped - if (!global::missionManager.hasCurrentMission()) { + if (!global::missionManager->hasCurrentMission()) { return; } - double currentTime = global::timeManager.time().j2000Seconds(); - const Mission& mission = global::missionManager.currentMission(); + double currentTime = global::timeManager->time().j2000Seconds(); + const Mission& mission = global::missionManager->currentMission(); if (mission.phases().empty()) { return; diff --git a/modules/base/dashboard/dashboarditemparallelconnection.cpp b/modules/base/dashboard/dashboarditemparallelconnection.cpp index be39c9bac4..8f23e4928d 100644 --- a/modules/base/dashboard/dashboarditemparallelconnection.cpp +++ b/modules/base/dashboard/dashboarditemparallelconnection.cpp @@ -99,7 +99,7 @@ DashboardItemParallelConnection::DashboardItemParallelConnection( _fontName = dictionary.value(FontNameInfo.identifier); } _fontName.onChange([this](){ - _font = global::fontManager.font(_fontName, _fontSize); + _font = global::fontManager->font(_fontName, _fontSize); }); addProperty(_fontName); @@ -107,19 +107,19 @@ DashboardItemParallelConnection::DashboardItemParallelConnection( _fontSize = static_cast(dictionary.value(FontSizeInfo.identifier)); } _fontSize.onChange([this](){ - _font = global::fontManager.font(_fontName, _fontSize); + _font = global::fontManager->font(_fontName, _fontSize); }); addProperty(_fontSize); - _font = global::fontManager.font(_fontName, _fontSize); + _font = global::fontManager->font(_fontName, _fontSize); } void DashboardItemParallelConnection::render(glm::vec2& penPosition) { ZoneScoped - const ParallelConnection::Status status = global::parallelPeer.status(); - const size_t nConnections = global::parallelPeer.nConnections(); - const std::string& hostName = global::parallelPeer.hostName(); + const ParallelConnection::Status status = global::parallelPeer->status(); + const size_t nConnections = global::parallelPeer->nConnections(); + const std::string& hostName = global::parallelPeer->hostName(); int nLines = 1; @@ -173,9 +173,9 @@ void DashboardItemParallelConnection::render(glm::vec2& penPosition) { glm::vec2 DashboardItemParallelConnection::size() const { ZoneScoped - ParallelConnection::Status status = global::parallelPeer.status(); - size_t nConnections = global::parallelPeer.nConnections(); - const std::string& hostName = global::parallelPeer.hostName(); + ParallelConnection::Status status = global::parallelPeer->status(); + size_t nConnections = global::parallelPeer->nConnections(); + const std::string& hostName = global::parallelPeer->hostName(); std::string connectionInfo; int nClients = static_cast(nConnections); diff --git a/modules/base/dashboard/dashboarditempropertyvalue.cpp b/modules/base/dashboard/dashboarditempropertyvalue.cpp index 052370463d..7040b00a07 100644 --- a/modules/base/dashboard/dashboarditempropertyvalue.cpp +++ b/modules/base/dashboard/dashboarditempropertyvalue.cpp @@ -125,7 +125,7 @@ DashboardItemPropertyValue::DashboardItemPropertyValue( _fontName = dictionary.value(FontNameInfo.identifier); } _fontName.onChange([this](){ - _font = global::fontManager.font(_fontName, _fontSize); + _font = global::fontManager->font(_fontName, _fontSize); }); addProperty(_fontName); @@ -133,7 +133,7 @@ DashboardItemPropertyValue::DashboardItemPropertyValue( _fontSize = static_cast(dictionary.value(FontSizeInfo.identifier)); } _fontSize.onChange([this](){ - _font = global::fontManager.font(_fontName, _fontSize); + _font = global::fontManager->font(_fontName, _fontSize); }); addProperty(_fontSize); @@ -148,7 +148,7 @@ DashboardItemPropertyValue::DashboardItemPropertyValue( } addProperty(_displayString); - _font = global::fontManager.font(_fontName, _fontSize); + _font = global::fontManager->font(_fontName, _fontSize); } void DashboardItemPropertyValue::render(glm::vec2& penPosition) { diff --git a/modules/base/dashboard/dashboarditemsimulationincrement.cpp b/modules/base/dashboard/dashboarditemsimulationincrement.cpp index 06b6375cf0..503f178d98 100644 --- a/modules/base/dashboard/dashboarditemsimulationincrement.cpp +++ b/modules/base/dashboard/dashboarditemsimulationincrement.cpp @@ -137,7 +137,7 @@ DashboardItemSimulationIncrement::DashboardItemSimulationIncrement( _fontName = dictionary.value(FontNameInfo.identifier); } _fontName.onChange([this](){ - _font = global::fontManager.font(_fontName, _fontSize); + _font = global::fontManager->font(_fontName, _fontSize); }); addProperty(_fontName); @@ -145,7 +145,7 @@ DashboardItemSimulationIncrement::DashboardItemSimulationIncrement( _fontSize = static_cast(dictionary.value(FontSizeInfo.identifier)); } _fontSize.onChange([this](){ - _font = global::fontManager.font(_fontName, _fontSize); + _font = global::fontManager->font(_fontName, _fontSize); }); addProperty(_fontSize); @@ -173,14 +173,14 @@ DashboardItemSimulationIncrement::DashboardItemSimulationIncrement( _requestedUnit.setVisibility(properties::Property::Visibility::Hidden); addProperty(_requestedUnit); - _font = global::fontManager.font(_fontName, _fontSize); + _font = global::fontManager->font(_fontName, _fontSize); } void DashboardItemSimulationIncrement::render(glm::vec2& penPosition) { ZoneScoped - const double targetDt = global::timeManager.targetDeltaTime(); - const double currentDt = global::timeManager.deltaTime(); + const double targetDt = global::timeManager->targetDeltaTime(); + const double currentDt = global::timeManager->deltaTime(); std::pair targetDeltaTime; std::pair currentDeltaTime; if (_doSimplification) { @@ -201,9 +201,9 @@ void DashboardItemSimulationIncrement::render(glm::vec2& penPosition) { } } - std::string pauseText = global::timeManager.isPaused() ? " (Paused)" : ""; + std::string pauseText = global::timeManager->isPaused() ? " (Paused)" : ""; - if (targetDt != currentDt && !global::timeManager.isPaused()) { + if (targetDt != currentDt && !global::timeManager->isPaused()) { // We are in the middle of a transition RenderFont( *_font, @@ -232,7 +232,7 @@ void DashboardItemSimulationIncrement::render(glm::vec2& penPosition) { glm::vec2 DashboardItemSimulationIncrement::size() const { ZoneScoped - double t = global::timeManager.targetDeltaTime(); + double t = global::timeManager->targetDeltaTime(); std::pair deltaTime; if (_doSimplification) { deltaTime = simplifyTime(t); diff --git a/modules/base/dashboard/dashboarditemvelocity.cpp b/modules/base/dashboard/dashboarditemvelocity.cpp index 7c12cc40be..5431ba92a0 100644 --- a/modules/base/dashboard/dashboarditemvelocity.cpp +++ b/modules/base/dashboard/dashboarditemvelocity.cpp @@ -149,12 +149,12 @@ DashboardItemVelocity::DashboardItemVelocity(const ghoul::Dictionary& dictionary } _fontName.onChange([this]() { - _font = global::fontManager.font(_fontName, _fontSize); + _font = global::fontManager->font(_fontName, _fontSize); }); addProperty(_fontName); _fontSize.onChange([this]() { - _font = global::fontManager.font(_fontName, _fontSize); + _font = global::fontManager->font(_fontName, _fontSize); }); addProperty(_fontSize); @@ -184,17 +184,17 @@ DashboardItemVelocity::DashboardItemVelocity(const ghoul::Dictionary& dictionary _requestedUnit.setVisibility(properties::Property::Visibility::Hidden); addProperty(_requestedUnit); - _font = global::fontManager.font(_fontName, _fontSize); + _font = global::fontManager->font(_fontName, _fontSize); } void DashboardItemVelocity::render(glm::vec2& penPosition) { ZoneScoped - const glm::dvec3 currentPos = global::renderEngine.scene()->camera()->positionVec3(); + const glm::dvec3 currentPos = global::renderEngine->scene()->camera()->positionVec3(); const glm::dvec3 dt = currentPos - _prevPosition; const double speedPerFrame = glm::length(dt); - const double secondsPerFrame = global::windowDelegate.averageDeltaTime(); + const double secondsPerFrame = global::windowDelegate->averageDeltaTime(); const double speedPerSecond = speedPerFrame / secondsPerFrame; diff --git a/modules/base/lightsource/scenegraphlightsource.cpp b/modules/base/lightsource/scenegraphlightsource.cpp index 4d2432fad9..50f6695d5b 100644 --- a/modules/base/lightsource/scenegraphlightsource.cpp +++ b/modules/base/lightsource/scenegraphlightsource.cpp @@ -110,7 +110,7 @@ SceneGraphLightSource::SceneGraphLightSource(const ghoul::Dictionary& dictionary _sceneGraphNodeReference.onChange([this]() { _sceneGraphNode = - global::renderEngine.scene()->sceneGraphNode(_sceneGraphNodeReference); + global::renderEngine->scene()->sceneGraphNode(_sceneGraphNodeReference); }); } @@ -119,7 +119,7 @@ bool SceneGraphLightSource::initialize() { ZoneScoped _sceneGraphNode = - global::renderEngine.scene()->sceneGraphNode(_sceneGraphNodeReference); + global::renderEngine->scene()->sceneGraphNode(_sceneGraphNodeReference); return _sceneGraphNode != nullptr; } diff --git a/modules/base/rendering/grids/renderableboxgrid.cpp b/modules/base/rendering/grids/renderableboxgrid.cpp index 672ebc2e6d..c05f583011 100644 --- a/modules/base/rendering/grids/renderableboxgrid.cpp +++ b/modules/base/rendering/grids/renderableboxgrid.cpp @@ -137,7 +137,7 @@ void RenderableBoxGrid::initializeGL() { _gridProgram = BaseModule::ProgramObjectManager.request( ProgramName, []() -> std::unique_ptr { - return global::renderEngine.buildRenderProgram( + return global::renderEngine->buildRenderProgram( ProgramName, absPath("${MODULE_BASE}/shaders/grid_vs.glsl"), absPath("${MODULE_BASE}/shaders/grid_fs.glsl") @@ -164,7 +164,7 @@ void RenderableBoxGrid::deinitializeGL() { BaseModule::ProgramObjectManager.release( ProgramName, [](ghoul::opengl::ProgramObject* p) { - global::renderEngine.removeRenderProgram(p); + global::renderEngine->removeRenderProgram(p); } ); _gridProgram = nullptr; @@ -203,8 +203,8 @@ void RenderableBoxGrid::render(const RenderData& data, RendererTasks&){ _gridProgram->deactivate(); // Restores GL State - global::renderEngine.openglStateCache().resetBlendState(); - global::renderEngine.openglStateCache().resetLineState(); + global::renderEngine->openglStateCache().resetBlendState(); + global::renderEngine->openglStateCache().resetLineState(); } void RenderableBoxGrid::update(const UpdateData&) { diff --git a/modules/base/rendering/grids/renderablegrid.cpp b/modules/base/rendering/grids/renderablegrid.cpp index 1bd1617c42..e8b8857103 100644 --- a/modules/base/rendering/grids/renderablegrid.cpp +++ b/modules/base/rendering/grids/renderablegrid.cpp @@ -153,7 +153,7 @@ void RenderableGrid::initializeGL() { _gridProgram = BaseModule::ProgramObjectManager.request( ProgramName, []() -> std::unique_ptr { - return global::renderEngine.buildRenderProgram( + return global::renderEngine->buildRenderProgram( ProgramName, absPath("${MODULE_BASE}/shaders/grid_vs.glsl"), absPath("${MODULE_BASE}/shaders/grid_fs.glsl") @@ -180,7 +180,7 @@ void RenderableGrid::deinitializeGL() { BaseModule::ProgramObjectManager.release( ProgramName, [](ghoul::opengl::ProgramObject* p) { - global::renderEngine.removeRenderProgram(p); + global::renderEngine->removeRenderProgram(p); } ); _gridProgram = nullptr; @@ -219,8 +219,8 @@ void RenderableGrid::render(const RenderData& data, RendererTasks&){ _gridProgram->deactivate(); // Restores GL State - global::renderEngine.openglStateCache().resetBlendState(); - global::renderEngine.openglStateCache().resetLineState(); + global::renderEngine->openglStateCache().resetBlendState(); + global::renderEngine->openglStateCache().resetLineState(); } void RenderableGrid::update(const UpdateData&) { diff --git a/modules/base/rendering/grids/renderableradialgrid.cpp b/modules/base/rendering/grids/renderableradialgrid.cpp index 7e94730f67..0b61d9fc56 100644 --- a/modules/base/rendering/grids/renderableradialgrid.cpp +++ b/modules/base/rendering/grids/renderableradialgrid.cpp @@ -221,7 +221,7 @@ void RenderableRadialGrid::initializeGL() { _gridProgram = BaseModule::ProgramObjectManager.request( ProgramName, []() -> std::unique_ptr { - return global::renderEngine.buildRenderProgram( + return global::renderEngine->buildRenderProgram( ProgramName, absPath("${MODULE_BASE}/shaders/grid_vs.glsl"), absPath("${MODULE_BASE}/shaders/grid_fs.glsl") @@ -234,7 +234,7 @@ void RenderableRadialGrid::deinitializeGL() { BaseModule::ProgramObjectManager.release( ProgramName, [](ghoul::opengl::ProgramObject* p) { - global::renderEngine.removeRenderProgram(p); + global::renderEngine->removeRenderProgram(p); } ); _gridProgram = nullptr; @@ -282,8 +282,8 @@ void RenderableRadialGrid::render(const RenderData& data, RendererTasks&) { _gridProgram->deactivate(); // Restores GL State - global::renderEngine.openglStateCache().resetBlendState(); - global::renderEngine.openglStateCache().resetLineState(); + global::renderEngine->openglStateCache().resetBlendState(); + global::renderEngine->openglStateCache().resetLineState(); } void RenderableRadialGrid::update(const UpdateData&) { diff --git a/modules/base/rendering/grids/renderablesphericalgrid.cpp b/modules/base/rendering/grids/renderablesphericalgrid.cpp index 8c537ced91..76e2467944 100644 --- a/modules/base/rendering/grids/renderablesphericalgrid.cpp +++ b/modules/base/rendering/grids/renderablesphericalgrid.cpp @@ -145,7 +145,7 @@ void RenderableSphericalGrid::initializeGL() { _gridProgram = BaseModule::ProgramObjectManager.request( ProgramName, []() -> std::unique_ptr { - return global::renderEngine.buildRenderProgram( + return global::renderEngine->buildRenderProgram( ProgramName, absPath("${MODULE_BASE}/shaders/grid_vs.glsl"), absPath("${MODULE_BASE}/shaders/grid_fs.glsl") @@ -177,7 +177,7 @@ void RenderableSphericalGrid::deinitializeGL() { BaseModule::ProgramObjectManager.release( ProgramName, [](ghoul::opengl::ProgramObject* p) { - global::renderEngine.removeRenderProgram(p); + global::renderEngine->removeRenderProgram(p); } ); _gridProgram = nullptr; @@ -224,8 +224,8 @@ void RenderableSphericalGrid::render(const RenderData& data, RendererTasks&){ _gridProgram->deactivate(); // Restores GL State - global::renderEngine.openglStateCache().resetBlendState(); - global::renderEngine.openglStateCache().resetLineState(); + global::renderEngine->openglStateCache().resetBlendState(); + global::renderEngine->openglStateCache().resetLineState(); } void RenderableSphericalGrid::update(const UpdateData&) { diff --git a/modules/base/rendering/modelgeometry.cpp b/modules/base/rendering/modelgeometry.cpp index b51938be98..f6a2e8424f 100644 --- a/modules/base/rendering/modelgeometry.cpp +++ b/modules/base/rendering/modelgeometry.cpp @@ -96,7 +96,7 @@ ghoul::mm_unique_ptr ModelGeometry::createFromDictionary( ModelGeometry* geometry = factory->create( geometryType, dictionary, - &global::memoryManager.PersistentMemory + &global::memoryManager->PersistentMemory ); return ghoul::mm_unique_ptr(geometry); } diff --git a/modules/base/rendering/renderablecartesianaxes.cpp b/modules/base/rendering/renderablecartesianaxes.cpp index 152fbea5a8..e188f362ac 100644 --- a/modules/base/rendering/renderablecartesianaxes.cpp +++ b/modules/base/rendering/renderablecartesianaxes.cpp @@ -146,7 +146,7 @@ void RenderableCartesianAxes::initializeGL() { _program = BaseModule::ProgramObjectManager.request( ProgramName, []() -> std::unique_ptr { - return global::renderEngine.buildRenderProgram( + return global::renderEngine->buildRenderProgram( ProgramName, absPath("${MODULE_BASE}/shaders/axes_vs.glsl"), absPath("${MODULE_BASE}/shaders/axes_fs.glsl") @@ -210,7 +210,7 @@ void RenderableCartesianAxes::deinitializeGL() { BaseModule::ProgramObjectManager.release( ProgramName, [](ghoul::opengl::ProgramObject* p) { - global::renderEngine.removeRenderProgram(p); + global::renderEngine->removeRenderProgram(p); } ); _program = nullptr; @@ -247,8 +247,8 @@ void RenderableCartesianAxes::render(const RenderData& data, RendererTasks&){ _program->deactivate(); // Restores GL State - global::renderEngine.openglStateCache().resetBlendState(); - global::renderEngine.openglStateCache().resetLineState(); + global::renderEngine->openglStateCache().resetBlendState(); + global::renderEngine->openglStateCache().resetLineState(); } } // namespace openspace diff --git a/modules/base/rendering/renderablelabels.cpp b/modules/base/rendering/renderablelabels.cpp index c435137a97..efadca6ec9 100644 --- a/modules/base/rendering/renderablelabels.cpp +++ b/modules/base/rendering/renderablelabels.cpp @@ -399,7 +399,7 @@ RenderableLabels::RenderableLabels(const ghoul::Dictionary& dictionary) _fontSize = dictionary.value(FontSizeInfo.identifier); } _fontSize.onChange([&]() { - _font = global::fontManager.font( + _font = global::fontManager->font( "Mono", _fontSize, ghoul::fontrendering::FontManager::Outline::Yes, @@ -612,7 +612,7 @@ void RenderableLabels::initialize() { void RenderableLabels::initializeGL() { if (_font == nullptr) { //size_t _fontSize = 50; - _font = global::fontManager.font( + _font = global::fontManager->font( "Mono", _fontSize, ghoul::fontrendering::FontManager::Outline::Yes, diff --git a/modules/base/rendering/renderablemodel.cpp b/modules/base/rendering/renderablemodel.cpp index e975a74247..0aa9bb2273 100644 --- a/modules/base/rendering/renderablemodel.cpp +++ b/modules/base/rendering/renderablemodel.cpp @@ -291,7 +291,7 @@ void RenderableModel::initializeGL() { _program = BaseModule::ProgramObjectManager.request( ProgramName, []() -> std::unique_ptr { - return global::renderEngine.buildRenderProgram( + return global::renderEngine->buildRenderProgram( ProgramName, absPath("${MODULE_BASE}/shaders/model_vs.glsl"), absPath("${MODULE_BASE}/shaders/model_fs.glsl") @@ -315,7 +315,7 @@ void RenderableModel::deinitializeGL() { BaseModule::ProgramObjectManager.release( ProgramName, [](ghoul::opengl::ProgramObject* p) { - global::renderEngine.removeRenderProgram(p); + global::renderEngine->removeRenderProgram(p); } ); _program = nullptr; diff --git a/modules/base/rendering/renderablenodeline.cpp b/modules/base/rendering/renderablenodeline.cpp index 34f579126c..fe875fd7df 100644 --- a/modules/base/rendering/renderablenodeline.cpp +++ b/modules/base/rendering/renderablenodeline.cpp @@ -76,7 +76,7 @@ namespace { glm::dvec3 anchorNodePos(0.0); const interaction::OrbitalNavigator& nav = - global::navigationHandler.orbitalNavigator(); + global::navigationHandler->orbitalNavigator(); if (nav.anchorNode()) { anchorNodePos = nav.anchorNode()->worldPosition(); @@ -178,7 +178,7 @@ void RenderableNodeLine::initializeGL() { _program = BaseModule::ProgramObjectManager.request( ProgramName, []() -> std::unique_ptr { - return global::renderEngine.buildRenderProgram( + return global::renderEngine->buildRenderProgram( ProgramName, absPath("${MODULE_BASE}/shaders/line_vs.glsl"), absPath("${MODULE_BASE}/shaders/line_fs.glsl") @@ -208,8 +208,8 @@ void RenderableNodeLine::deinitializeGL() { BaseModule::ProgramObjectManager.release( ProgramName, [](ghoul::opengl::ProgramObject* p) { - global::renderEngine.removeRenderProgram(p); - } + global::renderEngine->removeRenderProgram(p); + } ); _program = nullptr; } @@ -235,10 +235,10 @@ void RenderableNodeLine::updateVertexData() { // Update the positions of the nodes _startPos = coordinatePosFromAnchorNode( - global::renderEngine.scene()->sceneGraphNode(_start)->worldPosition() + global::renderEngine->scene()->sceneGraphNode(_start)->worldPosition() ); _endPos = coordinatePosFromAnchorNode( - global::renderEngine.scene()->sceneGraphNode(_end)->worldPosition() + global::renderEngine->scene()->sceneGraphNode(_end)->worldPosition() ); _vertexArray.push_back(static_cast(_startPos.x)); @@ -272,10 +272,10 @@ void RenderableNodeLine::render(const RenderData& data, RendererTasks&) { glm::dmat4 anchorTranslation(1.0); // Update anchor node information, used to counter precision problems - if (global::navigationHandler.orbitalNavigator().anchorNode()) { + if (global::navigationHandler->orbitalNavigator().anchorNode()) { anchorTranslation = glm::translate( glm::dmat4(1.0), - global::navigationHandler.orbitalNavigator().anchorNode()->worldPosition() + global::navigationHandler->orbitalNavigator().anchorNode()->worldPosition() ); } @@ -304,18 +304,18 @@ void RenderableNodeLine::render(const RenderData& data, RendererTasks&) { // Restore GL State unbindGL(); _program->deactivate(); - global::renderEngine.openglStateCache().resetBlendState(); - global::renderEngine.openglStateCache().resetLineState(); + global::renderEngine->openglStateCache().resetBlendState(); + global::renderEngine->openglStateCache().resetLineState(); } void RenderableNodeLine::validateNodes() { - if (!global::renderEngine.scene()->sceneGraphNode(_start)) { + if (!global::renderEngine->scene()->sceneGraphNode(_start)) { LERROR(fmt::format( "There is no scenegraph node with id {}, defaults to 'Root'", _start )); _start = Root; } - if (!global::renderEngine.scene()->sceneGraphNode(_end)) { + if (!global::renderEngine->scene()->sceneGraphNode(_end)) { LERROR(fmt::format( "There is no scenegraph node with id {}, defaults to 'Root'", _end )); diff --git a/modules/base/rendering/renderableplane.cpp b/modules/base/rendering/renderableplane.cpp index 3437bbd97f..93202d9578 100644 --- a/modules/base/rendering/renderableplane.cpp +++ b/modules/base/rendering/renderableplane.cpp @@ -176,7 +176,7 @@ void RenderablePlane::initializeGL() { _shader = BaseModule::ProgramObjectManager.request( ProgramName, []() -> std::unique_ptr { - return global::renderEngine.buildRenderProgram( + return global::renderEngine->buildRenderProgram( ProgramName, absPath("${MODULE_BASE}/shaders/plane_vs.glsl"), absPath("${MODULE_BASE}/shaders/plane_fs.glsl") @@ -197,7 +197,7 @@ void RenderablePlane::deinitializeGL() { BaseModule::ProgramObjectManager.release( ProgramName, [](ghoul::opengl::ProgramObject* p) { - global::renderEngine.removeRenderProgram(p); + global::renderEngine->removeRenderProgram(p); } ); _shader = nullptr; @@ -251,10 +251,10 @@ void RenderablePlane::render(const RenderData& data, RendererTasks&) { _shader->setUniform("texture1", unit); - bool usingFramebufferRenderer = global::renderEngine.rendererImplementation() == + bool usingFramebufferRenderer = global::renderEngine->rendererImplementation() == RenderEngine::RendererImplementation::Framebuffer; - bool usingABufferRenderer = global::renderEngine.rendererImplementation() == + bool usingABufferRenderer = global::renderEngine->rendererImplementation() == RenderEngine::RendererImplementation::ABuffer; if (usingABufferRenderer) { diff --git a/modules/base/rendering/renderableplaneimageonline.cpp b/modules/base/rendering/renderableplaneimageonline.cpp index 3914cd2ae0..86b93d5bd2 100644 --- a/modules/base/rendering/renderableplaneimageonline.cpp +++ b/modules/base/rendering/renderableplaneimageonline.cpp @@ -152,7 +152,7 @@ void RenderablePlaneImageOnline::update(const UpdateData&) { std::future RenderablePlaneImageOnline::downloadImageToMemory(const std::string& url) { - return global::downloadManager.fetchFile( + return global::downloadManager->fetchFile( url, [url](const DownloadManager::MemoryFile&) { LDEBUGC( diff --git a/modules/base/rendering/renderablesphere.cpp b/modules/base/rendering/renderablesphere.cpp index ae9a58ae92..f097a5a806 100644 --- a/modules/base/rendering/renderablesphere.cpp +++ b/modules/base/rendering/renderablesphere.cpp @@ -310,7 +310,7 @@ void RenderableSphere::initializeGL() { _shader = BaseModule::ProgramObjectManager.request( ProgramName, []() -> std::unique_ptr { - return global::renderEngine.buildRenderProgram( + return global::renderEngine->buildRenderProgram( ProgramName, absPath("${MODULE_BASE}/shaders/sphere_vs.glsl"), absPath("${MODULE_BASE}/shaders/sphere_fs.glsl") @@ -329,7 +329,7 @@ void RenderableSphere::deinitializeGL() { BaseModule::ProgramObjectManager.release( ProgramName, [](ghoul::opengl::ProgramObject* p) { - global::renderEngine.removeRenderProgram(p); + global::renderEngine->removeRenderProgram(p); } ); _shader = nullptr; @@ -430,10 +430,10 @@ void RenderableSphere::render(const RenderData& data, RendererTasks&) { glDisable(GL_CULL_FACE); } - bool usingFramebufferRenderer = global::renderEngine.rendererImplementation() == + bool usingFramebufferRenderer = global::renderEngine->rendererImplementation() == RenderEngine::RendererImplementation::Framebuffer; - bool usingABufferRenderer = global::renderEngine.rendererImplementation() == + bool usingABufferRenderer = global::renderEngine->rendererImplementation() == RenderEngine::RendererImplementation::ABuffer; if (usingABufferRenderer && _useAdditiveBlending) { diff --git a/modules/base/rendering/renderabletrail.cpp b/modules/base/rendering/renderabletrail.cpp index 102cf6f5ee..9c96849da0 100644 --- a/modules/base/rendering/renderabletrail.cpp +++ b/modules/base/rendering/renderabletrail.cpp @@ -288,7 +288,7 @@ void RenderableTrail::initializeGL() { _programObject = BaseModule::ProgramObjectManager.request( ProgramName, []() -> std::unique_ptr { - return global::renderEngine.buildRenderProgram( + return global::renderEngine->buildRenderProgram( ProgramName, absPath("${MODULE_BASE}/shaders/renderabletrail_apple_vs.glsl"), absPath("${MODULE_BASE}/shaders/renderabletrail_apple_fs.glsl") @@ -299,7 +299,7 @@ void RenderableTrail::initializeGL() { _programObject = BaseModule::ProgramObjectManager.request( ProgramName, []() -> std::unique_ptr { - return global::renderEngine.buildRenderProgram( + return global::renderEngine->buildRenderProgram( ProgramName, absPath("${MODULE_BASE}/shaders/renderabletrail_vs.glsl"), absPath("${MODULE_BASE}/shaders/renderabletrail_fs.glsl") @@ -315,7 +315,7 @@ void RenderableTrail::deinitializeGL() { BaseModule::ProgramObjectManager.release( ProgramName, [](ghoul::opengl::ProgramObject* p) { - global::renderEngine.removeRenderProgram(p); + global::renderEngine->removeRenderProgram(p); } ); _programObject = nullptr; @@ -359,7 +359,7 @@ void RenderableTrail::internalRender(bool renderLines, bool renderPoints, _programObject->setUniform(_uniformCache.nVertices, nVertices); #if !defined(__APPLE__) - glm::ivec2 resolution = global::renderEngine.renderingResolution(); + glm::ivec2 resolution = global::renderEngine->renderingResolution(); _programObject->setUniform(_uniformCache.resolution, resolution); _programObject->setUniform( _uniformCache.lineWidth, @@ -444,7 +444,7 @@ void RenderableTrail::render(const RenderData& data, RendererTasks&) { _programObject->setUniform(_uniformCache.resolution, resolution);*/ const bool usingFramebufferRenderer = - global::renderEngine.rendererImplementation() == + global::renderEngine->rendererImplementation() == RenderEngine::RendererImplementation::Framebuffer; if (usingFramebufferRenderer) { diff --git a/modules/base/rendering/screenspacedashboard.cpp b/modules/base/rendering/screenspacedashboard.cpp index a6dfd3a214..2ddcb82b82 100644 --- a/modules/base/rendering/screenspacedashboard.cpp +++ b/modules/base/rendering/screenspacedashboard.cpp @@ -70,7 +70,7 @@ int addDashboardItemToScreenSpace(lua_State* L) { return 0; } - ScreenSpaceRenderable* ssr = global::renderEngine.screenSpaceRenderable(name); + ScreenSpaceRenderable* ssr = global::renderEngine->screenSpaceRenderable(name); if (!ssr) { return ghoul::lua::luaError(L, "Provided name is not a ScreenSpace item"); @@ -98,7 +98,7 @@ int removeDashboardItemsFromScreenSpace(lua_State* L) { ghoul::lua::checkArgumentsAndThrow(L, 1, "lua::removeDashboardItemsFromScreenSpace"); const std::string& name = ghoul::lua::value(L, 1); - ScreenSpaceRenderable* ssr = global::renderEngine.screenSpaceRenderable(name); + ScreenSpaceRenderable* ssr = global::renderEngine->screenSpaceRenderable(name); if (!ssr) { return ghoul::lua::luaError(L, "Provided name is not a ScreenSpace item"); @@ -177,7 +177,7 @@ bool ScreenSpaceDashboard::initializeGL() { glm::vec2 penPosition = glm::vec2(10.f, _size.value().w ); if (_useMainDashboard) { - global::dashboard.render(penPosition); + global::dashboard->render(penPosition); } else { _dashboard.render(penPosition); @@ -200,8 +200,8 @@ bool ScreenSpaceDashboard::isReady() const { } void ScreenSpaceDashboard::update() { - if (global::windowDelegate.windowHasResized()) { - const glm::ivec2 size = global::windowDelegate.currentDrawBufferResolution(); + if (global::windowDelegate->windowHasResized()) { + const glm::ivec2 size = global::windowDelegate->currentDrawBufferResolution(); _size = { 0.f, 0.f, size.x, size.y }; createFramebuffer(); } diff --git a/modules/base/rendering/screenspaceframebuffer.cpp b/modules/base/rendering/screenspaceframebuffer.cpp index 2efde757e7..e2d0e6a409 100644 --- a/modules/base/rendering/screenspaceframebuffer.cpp +++ b/modules/base/rendering/screenspaceframebuffer.cpp @@ -78,7 +78,7 @@ ScreenSpaceFramebuffer::ScreenSpaceFramebuffer(const ghoul::Dictionary& dictiona setGuiName("ScreenSpaceFramebuffer " + std::to_string(iIdentifier)); } - glm::vec2 resolution = global::windowDelegate.currentDrawBufferResolution(); + glm::vec2 resolution = global::windowDelegate->currentDrawBufferResolution(); addProperty(_size); _size.set(glm::vec4(0, 0, resolution.x,resolution.y)); } @@ -104,7 +104,7 @@ bool ScreenSpaceFramebuffer::deinitializeGL() { } void ScreenSpaceFramebuffer::render() { - const glm::vec2& resolution = global::windowDelegate.currentDrawBufferResolution(); + const glm::vec2& resolution = global::windowDelegate->currentDrawBufferResolution(); const glm::vec4& size = _size.value(); const float xratio = resolution.x / (size.z - size.x); @@ -113,14 +113,14 @@ void ScreenSpaceFramebuffer::render() { if (!_renderFunctions.empty()) { GLint viewport[4]; //glGetIntegerv(GL_VIEWPORT, viewport); - global::renderEngine.openglStateCache().viewport(viewport); + global::renderEngine->openglStateCache().viewport(viewport); glViewport( static_cast(-size.x * xratio), static_cast(-size.y * yratio), static_cast(resolution.x * xratio), static_cast(resolution.y * yratio) ); - global::renderEngine.openglStateCache().setViewportState(viewport); + global::renderEngine->openglStateCache().setViewportState(viewport); GLint defaultFBO = _framebuffer->getActiveObject(); _framebuffer->activate(); @@ -171,7 +171,7 @@ void ScreenSpaceFramebuffer::removeAllRenderFunctions() { } void ScreenSpaceFramebuffer::createFramebuffer() { - glm::vec2 resolution = global::windowDelegate.currentDrawBufferResolution(); + glm::vec2 resolution = global::windowDelegate->currentDrawBufferResolution(); _framebuffer = std::make_unique(); _framebuffer->activate(); diff --git a/modules/base/rendering/screenspaceimageonline.cpp b/modules/base/rendering/screenspaceimageonline.cpp index 5dd4b7c736..8597122c44 100644 --- a/modules/base/rendering/screenspaceimageonline.cpp +++ b/modules/base/rendering/screenspaceimageonline.cpp @@ -162,7 +162,7 @@ void ScreenSpaceImageOnline::update() { std::future ScreenSpaceImageOnline::downloadImageToMemory( const std::string& url) { - return global::downloadManager.fetchFile( + return global::downloadManager->fetchFile( url, [url](const DownloadManager::MemoryFile&) { LDEBUGC( diff --git a/modules/cefwebgui/cefwebguimodule.cpp b/modules/cefwebgui/cefwebguimodule.cpp index 7de3a160de..ceecc0e650 100644 --- a/modules/cefwebgui/cefwebguimodule.cpp +++ b/modules/cefwebgui/cefwebguimodule.cpp @@ -89,9 +89,9 @@ CefWebGuiModule::CefWebGuiModule() void CefWebGuiModule::startOrStopGui() { ZoneScoped - WebBrowserModule* webBrowserModule = global::moduleEngine.module(); + WebBrowserModule* webBrowserModule = global::moduleEngine->module(); - const bool isMaster = global::windowDelegate.isMaster(); + const bool isMaster = global::windowDelegate->isMaster(); if (_enabled && isMaster) { LDEBUGC("WebBrowser", fmt::format("Loading GUI from {}", _url)); @@ -103,9 +103,9 @@ void CefWebGuiModule::startOrStopGui() { ); _instance->initialize(); _instance->reshape(static_cast( - static_cast(global::windowDelegate.currentSubwindowSize()) * - global::windowDelegate.dpiScaling() - )); + static_cast(global::windowDelegate->currentSubwindowSize()) * + global::windowDelegate->dpiScaling() + )); if (!_url.value().empty()) { _instance->loadUrl(_url); } @@ -130,7 +130,7 @@ void CefWebGuiModule::internalInitialize(const ghoul::Dictionary& configuration) ZoneScoped WebBrowserModule* webBrowserModule = - global::moduleEngine.module(); + global::moduleEngine->module(); bool available = webBrowserModule && webBrowserModule->isEnabled(); @@ -185,7 +185,7 @@ void CefWebGuiModule::internalInitialize(const ghoul::Dictionary& configuration) // TODO: See if the hardcoded endpoint `frontend` below can be removed. // Possible fix: Reload browser if cefwebgui is routed to localhost // and the same endpoint that just came online. - WebGuiModule* webGuiModule = global::moduleEngine.module(); + WebGuiModule* webGuiModule = global::moduleEngine->module(); _endpointCallback = webGuiModule->addEndpointChangeCallback( [this](const std::string& endpoint, bool exists) { @@ -214,16 +214,16 @@ void CefWebGuiModule::internalInitialize(const ghoul::Dictionary& configuration) ZoneScopedN("CefWebGuiModule") const bool isGuiWindow = - global::windowDelegate.hasGuiWindow() ? - global::windowDelegate.isGuiWindow() : + global::windowDelegate->hasGuiWindow() ? + global::windowDelegate->isGuiWindow() : true; - const bool isMaster = global::windowDelegate.isMaster(); + const bool isMaster = global::windowDelegate->isMaster(); if (isGuiWindow && isMaster && _instance) { - if (global::windowDelegate.windowHasResized() || _instance->_shouldReshape) { - glm::ivec2 csws = global::windowDelegate.currentSubwindowSize(); + if (global::windowDelegate->windowHasResized() || _instance->_shouldReshape) { + glm::ivec2 csws = global::windowDelegate->currentSubwindowSize(); _instance->reshape(static_cast( - static_cast(csws) * global::windowDelegate.dpiScaling() + static_cast(csws) * global::windowDelegate->dpiScaling() )); _instance->_shouldReshape = false; } @@ -237,7 +237,7 @@ void CefWebGuiModule::internalInitialize(const ghoul::Dictionary& configuration) ZoneScopedN("CefWebGuiModule") if (_endpointCallback != -1) { - WebGuiModule* webGuiModule = global::moduleEngine.module(); + WebGuiModule* webGuiModule = global::moduleEngine->module(); webGuiModule->removeEndpointChangeCallback(_endpointCallback); _endpointCallback = -1; } diff --git a/modules/debugging/rendering/debugrenderer.cpp b/modules/debugging/rendering/debugrenderer.cpp index 362bfe6580..56058fe9eb 100644 --- a/modules/debugging/rendering/debugrenderer.cpp +++ b/modules/debugging/rendering/debugrenderer.cpp @@ -42,7 +42,7 @@ namespace openspace { DebugRenderer* DebugRenderer::_reference = nullptr; DebugRenderer::DebugRenderer() { - _programObject = global::renderEngine.buildRenderProgram( + _programObject = global::renderEngine->buildRenderProgram( "BasicDebugShader", absPath("${MODULE_DEBUGGING}/rendering/debugshader_vs.glsl"), absPath("${MODULE_DEBUGGING}/rendering/debugshader_fs.glsl") diff --git a/modules/debugging/rendering/renderabledebugplane.cpp b/modules/debugging/rendering/renderabledebugplane.cpp index 770211d15a..a54ab4504d 100644 --- a/modules/debugging/rendering/renderabledebugplane.cpp +++ b/modules/debugging/rendering/renderabledebugplane.cpp @@ -187,7 +187,7 @@ void RenderableDebugPlane::initializeGL() { createPlane(); if (!_shader) { - _shader = global::renderEngine.buildRenderProgram("PlaneProgram", + _shader = global::renderEngine->buildRenderProgram("PlaneProgram", absPath("${MODULE_BASE}/shaders/plane_vs.glsl"), absPath("${MODULE_BASE}/shaders/plane_fs.glsl") ); @@ -202,7 +202,7 @@ void RenderableDebugPlane::deinitializeGL() { _vertexPositionBuffer = 0; if (_shader) { - global::renderEngine.removeRenderProgram(_shader.get()); + global::renderEngine->removeRenderProgram(_shader.get()); _shader = nullptr; } } diff --git a/modules/digitaluniverse/rendering/renderablebillboardscloud.cpp b/modules/digitaluniverse/rendering/renderablebillboardscloud.cpp index 7481deea0c..ef9aaf92bd 100644 --- a/modules/digitaluniverse/rendering/renderablebillboardscloud.cpp +++ b/modules/digitaluniverse/rendering/renderablebillboardscloud.cpp @@ -785,7 +785,7 @@ void RenderableBillboardsCloud::initializeGL() { _program = DigitalUniverseModule::ProgramObjectManager.request( ProgramObjectName, []() { - return global::renderEngine.buildRenderProgram( + return global::renderEngine->buildRenderProgram( ProgramObjectName, absPath("${MODULE_DIGITALUNIVERSE}/shaders/billboard_vs.glsl"), absPath("${MODULE_DIGITALUNIVERSE}/shaders/billboard_fs.glsl"), @@ -815,7 +815,7 @@ void RenderableBillboardsCloud::initializeGL() { if (_hasLabel) { if (_font == nullptr) { size_t _fontSize = 50; - _font = global::fontManager.font( + _font = global::fontManager->font( "Mono", static_cast(_fontSize), ghoul::fontrendering::FontManager::Outline::Yes, @@ -834,7 +834,7 @@ void RenderableBillboardsCloud::deinitializeGL() { DigitalUniverseModule::ProgramObjectManager.release( ProgramObjectName, [](ghoul::opengl::ProgramObject* p) { - global::renderEngine.removeRenderProgram(p); + global::renderEngine->removeRenderProgram(p); } ); _program = nullptr; @@ -866,7 +866,7 @@ void RenderableBillboardsCloud::renderBillboards(const RenderData& data, _program->setUniform( "screenSize", - glm::vec2(global::renderEngine.renderingResolution()) + glm::vec2(global::renderEngine->renderingResolution()) ); _program->setUniform(_uniformCache.cameraPos, data.camera.positionVec3()); @@ -925,8 +925,8 @@ void RenderableBillboardsCloud::renderBillboards(const RenderData& data, glBindVertexArray(0); _program->deactivate(); - global::renderEngine.openglStateCache().resetBlendState(); - global::renderEngine.openglStateCache().resetDepthState(); + global::renderEngine->openglStateCache().resetBlendState(); + global::renderEngine->openglStateCache().resetDepthState(); } void RenderableBillboardsCloud::renderLabels(const RenderData& data, diff --git a/modules/digitaluniverse/rendering/renderabledumeshes.cpp b/modules/digitaluniverse/rendering/renderabledumeshes.cpp index 38f12c8326..afff95f42d 100644 --- a/modules/digitaluniverse/rendering/renderabledumeshes.cpp +++ b/modules/digitaluniverse/rendering/renderabledumeshes.cpp @@ -249,7 +249,7 @@ RenderableDUMeshes::RenderableDUMeshes(const ghoul::Dictionary& dictionary) _renderOption.addOption(RenderOptionViewDirection, "Camera View Direction"); _renderOption.addOption(RenderOptionPositionNormal, "Camera Position Normal"); - if (global::windowDelegate.isFisheyeRendering()) { + if (global::windowDelegate->isFisheyeRendering()) { _renderOption = RenderOptionPositionNormal; } else { @@ -352,7 +352,7 @@ void RenderableDUMeshes::initializeGL() { _program = DigitalUniverseModule::ProgramObjectManager.request( ProgramObjectName, []() { - return global::renderEngine.buildRenderProgram( + return global::renderEngine->buildRenderProgram( "RenderableDUMeshes", absPath("${MODULE_DIGITALUNIVERSE}/shaders/dumesh_vs.glsl"), absPath("${MODULE_DIGITALUNIVERSE}/shaders/dumesh_fs.glsl") @@ -372,7 +372,7 @@ void RenderableDUMeshes::initializeGL() { if (_hasLabel) { if (!_font) { constexpr const int FontSize = 50; - _font = global::fontManager.font( + _font = global::fontManager->font( "Mono", static_cast(FontSize), ghoul::fontrendering::FontManager::Outline::Yes, @@ -393,7 +393,7 @@ void RenderableDUMeshes::deinitializeGL() { DigitalUniverseModule::ProgramObjectManager.release( ProgramObjectName, [](ghoul::opengl::ProgramObject* p) { - global::renderEngine.removeRenderProgram(p); + global::renderEngine->removeRenderProgram(p); } ); } @@ -424,7 +424,7 @@ void RenderableDUMeshes::renderMeshes(const RenderData&, case Wire: glLineWidth(_lineWidth); glDrawArrays(GL_LINE_STRIP, 0, pair.second.numV); - global::renderEngine.openglStateCache().resetLineState(); + global::renderEngine->openglStateCache().resetLineState(); break; case Point: glDrawArrays(GL_POINTS, 0, pair.second.numV); @@ -439,8 +439,8 @@ void RenderableDUMeshes::renderMeshes(const RenderData&, _program->deactivate(); // Restores GL State - global::renderEngine.openglStateCache().resetDepthState(); - global::renderEngine.openglStateCache().resetBlendState(); + global::renderEngine->openglStateCache().resetDepthState(); + global::renderEngine->openglStateCache().resetBlendState(); } void RenderableDUMeshes::renderLabels(const RenderData& data, diff --git a/modules/digitaluniverse/rendering/renderableplanescloud.cpp b/modules/digitaluniverse/rendering/renderableplanescloud.cpp index bf103c7920..04aaa90d06 100644 --- a/modules/digitaluniverse/rendering/renderableplanescloud.cpp +++ b/modules/digitaluniverse/rendering/renderableplanescloud.cpp @@ -494,7 +494,7 @@ void RenderablePlanesCloud::initializeGL() { _program = DigitalUniverseModule::ProgramObjectManager.request( ProgramObjectName, []() -> std::unique_ptr { - return global::renderEngine.buildRenderProgram( + return global::renderEngine->buildRenderProgram( "RenderablePlanesCloud", absPath("${MODULE_DIGITALUNIVERSE}/shaders/plane_vs.glsl"), absPath("${MODULE_DIGITALUNIVERSE}/shaders/plane_fs.glsl") @@ -511,7 +511,7 @@ void RenderablePlanesCloud::initializeGL() { if (_hasLabel) { if (!_font) { constexpr const int FontSize = 30; - _font = global::fontManager.font( + _font = global::fontManager->font( "Mono", static_cast(FontSize), ghoul::fontrendering::FontManager::Outline::Yes, @@ -537,7 +537,7 @@ void RenderablePlanesCloud::deinitializeGL() { DigitalUniverseModule::ProgramObjectManager.release( ProgramObjectName, [](ghoul::opengl::ProgramObject* p) { - global::renderEngine.removeRenderProgram(p); + global::renderEngine->removeRenderProgram(p); } ); } @@ -590,8 +590,8 @@ void RenderablePlanesCloud::renderPlanes(const RenderData&, _program->deactivate(); // Restores OpenGL Rendering State - global::renderEngine.openglStateCache().resetBlendState(); - global::renderEngine.openglStateCache().resetDepthState(); + global::renderEngine->openglStateCache().resetBlendState(); + global::renderEngine->openglStateCache().resetDepthState(); } void RenderablePlanesCloud::renderLabels(const RenderData& data, diff --git a/modules/digitaluniverse/rendering/renderablepoints.cpp b/modules/digitaluniverse/rendering/renderablepoints.cpp index 7b5bca997f..ebfc9fff45 100644 --- a/modules/digitaluniverse/rendering/renderablepoints.cpp +++ b/modules/digitaluniverse/rendering/renderablepoints.cpp @@ -256,7 +256,7 @@ void RenderablePoints::initializeGL() { _program = DigitalUniverseModule::ProgramObjectManager.request( "RenderablePoints Sprite", []() -> std::unique_ptr { - return global::renderEngine.buildRenderProgram( + return global::renderEngine->buildRenderProgram( "RenderablePoints Sprite", absPath("${MODULE_DIGITALUNIVERSE}/shaders/points_vs.glsl"), absPath("${MODULE_DIGITALUNIVERSE}/shaders/points_sprite_fs.glsl") @@ -268,7 +268,7 @@ void RenderablePoints::initializeGL() { _program = DigitalUniverseModule::ProgramObjectManager.request( "RenderablePoints", []() -> std::unique_ptr { - return global::renderEngine.buildRenderProgram( + return global::renderEngine->buildRenderProgram( "RenderablePoints", absPath("${MODULE_DIGITALUNIVERSE}/shaders/points_vs.glsl"), absPath("${MODULE_DIGITALUNIVERSE}/shaders/points_sprite_fs.glsl") @@ -288,7 +288,7 @@ void RenderablePoints::deinitializeGL() { DigitalUniverseModule::ProgramObjectManager.release( _program->name(), [](ghoul::opengl::ProgramObject* p) { - global::renderEngine.removeRenderProgram(p); + global::renderEngine->removeRenderProgram(p); } ); diff --git a/modules/exoplanets/exoplanetsmodule_lua.inl b/modules/exoplanets/exoplanetsmodule_lua.inl index 77f7989a63..cd73664631 100644 --- a/modules/exoplanets/exoplanetsmodule_lua.inl +++ b/modules/exoplanets/exoplanetsmodule_lua.inl @@ -210,7 +210,7 @@ void createExoplanetSystem(std::string_view starName) { "}" "}"; - openspace::global::scriptEngine.queueScript( + openspace::global::scriptEngine->queueScript( "openspace.addSceneGraphNode(" + starParent + ");", scripting::ScriptEngine::RemoteScripting::Yes ); @@ -314,7 +314,7 @@ void createExoplanetSystem(std::string_view starName) { trailResolution *= 2; } - openspace::global::scriptEngine.queueScript( + openspace::global::scriptEngine->queueScript( "openspace.addSceneGraphNode(" + planetNode + ");", scripting::ScriptEngine::RemoteScripting::Yes ); @@ -336,7 +336,7 @@ void createExoplanetSystem(std::string_view starName) { "}" "}"; - openspace::global::scriptEngine.queueScript( + openspace::global::scriptEngine->queueScript( "openspace.addSceneGraphNode(" + planetTrailNode + ");", openspace::scripting::ScriptEngine::RemoteScripting::Yes ); @@ -380,7 +380,7 @@ void createExoplanetSystem(std::string_view starName) { "}" "}"; - openspace::global::scriptEngine.queueScript( + openspace::global::scriptEngine->queueScript( "openspace.addSceneGraphNode(" + discNode + ");", scripting::ScriptEngine::RemoteScripting::Yes ); @@ -430,7 +430,7 @@ int removeExoplanetSystem(lua_State* L) { const std::string starNameSpeck = std::string(speckStarName(starName)); const std::string starIdentifier = createIdentifier(starNameSpeck); - openspace::global::scriptEngine.queueScript( + openspace::global::scriptEngine->queueScript( "openspace.removeSceneGraphNode('" + starIdentifier + "');", scripting::ScriptEngine::RemoteScripting::Yes ); diff --git a/modules/exoplanets/rendering/renderableorbitdisc.cpp b/modules/exoplanets/rendering/renderableorbitdisc.cpp index 150a4d0e3d..216d8c16fa 100644 --- a/modules/exoplanets/rendering/renderableorbitdisc.cpp +++ b/modules/exoplanets/rendering/renderableorbitdisc.cpp @@ -157,7 +157,7 @@ bool RenderableOrbitDisc::isReady() const { } void RenderableOrbitDisc::initializeGL() { - _shader = global::renderEngine.buildRenderProgram( + _shader = global::renderEngine->buildRenderProgram( "OrbitdiscProgram", absPath("${BASE}/modules/exoplanets/shaders/orbitdisc_vs.glsl"), absPath("${BASE}/modules/exoplanets/shaders/orbitdisc_fs.glsl") @@ -189,7 +189,7 @@ void RenderableOrbitDisc::deinitializeGL() { _textureFile = nullptr; _texture = nullptr; - global::renderEngine.removeRenderProgram(_shader.get()); + global::renderEngine->removeRenderProgram(_shader.get()); _shader = nullptr; } @@ -228,9 +228,9 @@ void RenderableOrbitDisc::render(const RenderData& data, RendererTasks&) { _shader->deactivate(); // Restores GL State - global::renderEngine.openglStateCache().resetBlendState(); - global::renderEngine.openglStateCache().resetDepthState(); - global::renderEngine.openglStateCache().resetPolygonAndClippingState(); + global::renderEngine->openglStateCache().resetBlendState(); + global::renderEngine->openglStateCache().resetDepthState(); + global::renderEngine->openglStateCache().resetPolygonAndClippingState(); } void RenderableOrbitDisc::update(const UpdateData& data) { diff --git a/modules/fieldlines/rendering/renderablefieldlines.cpp b/modules/fieldlines/rendering/renderablefieldlines.cpp index b8970efb3b..e75f6de397 100644 --- a/modules/fieldlines/rendering/renderablefieldlines.cpp +++ b/modules/fieldlines/rendering/renderablefieldlines.cpp @@ -200,7 +200,7 @@ void RenderableFieldlines::initializeGL() { throw ghoul::RuntimeError("Error initializing"); } - _program = global::renderEngine.buildRenderProgram( + _program = global::renderEngine->buildRenderProgram( "Fieldline", absPath("${MODULE_FIELDLINES}/shaders/fieldline_vs.glsl"), absPath("${MODULE_FIELDLINES}/shaders/fieldline_fs.glsl"), @@ -215,7 +215,7 @@ void RenderableFieldlines::deinitializeGL() { _vertexPositionBuffer = 0; if (_program) { - global::renderEngine.removeRenderProgram(_program.get()); + global::renderEngine->removeRenderProgram(_program.get()); _program = nullptr; } } diff --git a/modules/fieldlinessequence/rendering/renderablefieldlinessequence.cpp b/modules/fieldlinessequence/rendering/renderablefieldlinessequence.cpp index 003ec69e3c..00b57c7e3d 100644 --- a/modules/fieldlinessequence/rendering/renderablefieldlinessequence.cpp +++ b/modules/fieldlinessequence/rendering/renderablefieldlinessequence.cpp @@ -348,7 +348,7 @@ void RenderableFieldlinesSequence::initializeGL() { setupProperties(); // Setup shader program - _shaderProgram = global::renderEngine.buildRenderProgram( + _shaderProgram = global::renderEngine->buildRenderProgram( "FieldlinesSequence", absPath("${MODULE_FIELDLINESSEQUENCE}/shaders/fieldlinessequence_vs.glsl"), absPath("${MODULE_FIELDLINESSEQUENCE}/shaders/fieldlinessequence_fs.glsl") @@ -757,21 +757,21 @@ void RenderableFieldlinesSequence::definePropertyCallbackFunctions() { } _pFocusOnOriginBtn.onChange([this] { - SceneGraphNode* node = global::renderEngine.scene()->sceneGraphNode(_identifier); + SceneGraphNode* node = global::renderEngine->scene()->sceneGraphNode(_identifier); if (!node) { LWARNING(fmt::format( "Could not find a node in scenegraph called '{}'", _identifier )); return; } - global::navigationHandler.orbitalNavigator().setFocusNode( + global::navigationHandler->orbitalNavigator().setFocusNode( node->parent()->identifier() ); - global::navigationHandler.orbitalNavigator().startRetargetAnchor(); + global::navigationHandler->orbitalNavigator().startRetargetAnchor(); }); _pJumpToStartBtn.onChange([this] { - global::timeManager.setTimeNextFrame(Time(_startTimes[0])); + global::timeManager->setTimeNextFrame(Time(_startTimes[0])); }); } @@ -1027,7 +1027,7 @@ void RenderableFieldlinesSequence::deinitializeGL() { _vertexMaskingBuffer = 0; if (_shaderProgram) { - global::renderEngine.removeRenderProgram(_shaderProgram.get()); + global::renderEngine->removeRenderProgram(_shaderProgram.get()); _shaderProgram = nullptr; } @@ -1092,12 +1092,12 @@ void RenderableFieldlinesSequence::render(const RenderData& data, RendererTasks& _shaderProgram->setUniform("particleSpeed", _pFlowSpeed); _shaderProgram->setUniform( "time", - global::windowDelegate.applicationTime() * (_pFlowReversed ? -1 : 1) + global::windowDelegate->applicationTime() * (_pFlowReversed ? -1 : 1) ); bool additiveBlending = false; if (_pColorABlendEnabled) { - const auto renderer = global::renderEngine.rendererImplementation(); + const auto renderer = global::renderEngine->rendererImplementation(); const bool usingFBufferRenderer = renderer == RenderEngine::RendererImplementation::Framebuffer; diff --git a/modules/gaia/rendering/renderablegaiastars.cpp b/modules/gaia/rendering/renderablegaiastars.cpp index a67a1d17c2..ff10f2a3f1 100644 --- a/modules/gaia/rendering/renderablegaiastars.cpp +++ b/modules/gaia/rendering/renderablegaiastars.cpp @@ -888,7 +888,7 @@ void RenderableGaiaStars::initializeGL() { _uniformCache.valuesPerStar = _program->uniformLocation("valuesPerStar"); _uniformCache.nChunksToRender = _program->uniformLocation("nChunksToRender"); - _programTM = global::renderEngine.buildRenderProgram( + _programTM = global::renderEngine->buildRenderProgram( "ToneMapping", absPath("${MODULE_GAIA}/shaders/gaia_tonemapping_vs.glsl"), absPath("${MODULE_GAIA}/shaders/gaia_tonemapping_point_fs.glsl") @@ -913,7 +913,7 @@ void RenderableGaiaStars::initializeGL() { absPath("${MODULE_GAIA}/shaders/gaia_point_ge.glsl") ); - _programTM = global::renderEngine.buildRenderProgram("ToneMapping", + _programTM = global::renderEngine->buildRenderProgram("ToneMapping", absPath("${MODULE_GAIA}/shaders/gaia_tonemapping_vs.glsl"), absPath("${MODULE_GAIA}/shaders/gaia_tonemapping_point_fs.glsl") ); @@ -950,7 +950,7 @@ void RenderableGaiaStars::initializeGL() { _uniformCache.valuesPerStar = _program->uniformLocation("valuesPerStar"); _uniformCache.nChunksToRender = _program->uniformLocation("nChunksToRender"); - _programTM = global::renderEngine.buildRenderProgram( + _programTM = global::renderEngine->buildRenderProgram( "ToneMapping", absPath("${MODULE_GAIA}/shaders/gaia_tonemapping_vs.glsl"), absPath("${MODULE_GAIA}/shaders/gaia_tonemapping_billboard_fs.glsl") @@ -964,7 +964,7 @@ void RenderableGaiaStars::initializeGL() { break; } case gaia::ShaderOption::Billboard_SSBO_noFBO: { - _program = global::renderEngine.buildRenderProgram("GaiaStar", + _program = global::renderEngine->buildRenderProgram("GaiaStar", absPath("${MODULE_GAIA}/shaders/gaia_ssbo_vs.glsl"), absPath("${MODULE_GAIA}/shaders/gaia_billboard_nofbo_fs.glsl"), absPath("${MODULE_GAIA}/shaders/gaia_billboard_ge.glsl") @@ -1006,7 +1006,7 @@ void RenderableGaiaStars::initializeGL() { ); _uniformCache.psfTexture = _program->uniformLocation("psfTexture"); - _programTM = global::renderEngine.buildRenderProgram("ToneMapping", + _programTM = global::renderEngine->buildRenderProgram("ToneMapping", absPath("${MODULE_GAIA}/shaders/gaia_tonemapping_vs.glsl"), absPath("${MODULE_GAIA}/shaders/gaia_tonemapping_billboard_fs.glsl") ); @@ -1124,11 +1124,11 @@ void RenderableGaiaStars::deinitializeGL() { _fboTexture = nullptr; if (_program) { - global::renderEngine.removeRenderProgram(_program.get()); + global::renderEngine->removeRenderProgram(_program.get()); _program = nullptr; } if (_programTM) { - global::renderEngine.removeRenderProgram(_programTM.get()); + global::renderEngine->removeRenderProgram(_programTM.get()); _programTM = nullptr; } } @@ -1149,7 +1149,7 @@ void RenderableGaiaStars::render(const RenderData& data, RendererTasks&) { glm::dmat4 projection = data.camera.projectionMatrix(); glm::dmat4 modelViewProjMat = projection * view * model; - glm::vec2 screenSize = glm::vec2(global::renderEngine.renderingResolution()); + glm::vec2 screenSize = glm::vec2(global::renderEngine->renderingResolution()); // Wait until camera has stabilized before we traverse the Octree/stream from files. const double rotationDiff = abs(length(_previousCameraRotation) - @@ -1593,7 +1593,7 @@ void RenderableGaiaStars::update(const UpdateData&) { absPath("${MODULE_GAIA}/shaders/gaia_point_ge.glsl") ); if (_program) { - global::renderEngine.removeRenderProgram(_program.get()); + global::renderEngine->removeRenderProgram(_program.get()); } _program = std::move(program); @@ -1656,7 +1656,7 @@ void RenderableGaiaStars::update(const UpdateData&) { absPath("${MODULE_GAIA}/shaders/gaia_point_ge.glsl") ); if (_program) { - global::renderEngine.removeRenderProgram(_program.get()); + global::renderEngine->removeRenderProgram(_program.get()); } _program = std::move(program); @@ -1699,7 +1699,7 @@ void RenderableGaiaStars::update(const UpdateData&) { ); } else { - program = global::renderEngine.buildRenderProgram("GaiaStar", + program = global::renderEngine->buildRenderProgram("GaiaStar", absPath("${MODULE_GAIA}/shaders/gaia_ssbo_vs.glsl"), absPath("${MODULE_GAIA}/shaders/gaia_billboard_nofbo_fs.glsl"), absPath("${MODULE_GAIA}/shaders/gaia_billboard_ge.glsl") @@ -1707,7 +1707,7 @@ void RenderableGaiaStars::update(const UpdateData&) { } if (_program) { - global::renderEngine.removeRenderProgram(_program.get()); + global::renderEngine->removeRenderProgram(_program.get()); } _program = std::move(program); @@ -1781,7 +1781,7 @@ void RenderableGaiaStars::update(const UpdateData&) { absPath("${MODULE_GAIA}/shaders/gaia_billboard_ge.glsl") ); if (_program) { - global::renderEngine.removeRenderProgram(_program.get()); + global::renderEngine->removeRenderProgram(_program.get()); } _program = std::move(program); @@ -1851,13 +1851,13 @@ void RenderableGaiaStars::update(const UpdateData&) { case gaia::ShaderOption::Point_SSBO: case gaia::ShaderOption::Point_VBO: { std::unique_ptr programTM = - global::renderEngine.buildRenderProgram( + global::renderEngine->buildRenderProgram( "ToneMapping", absPath("${MODULE_GAIA}/shaders/gaia_tonemapping_vs.glsl"), absPath("${MODULE_GAIA}/shaders/gaia_tonemapping_point_fs.glsl") ); if (_programTM) { - global::renderEngine.removeRenderProgram(_programTM.get()); + global::renderEngine->removeRenderProgram(_programTM.get()); } _programTM = std::move(programTM); @@ -1879,9 +1879,9 @@ void RenderableGaiaStars::update(const UpdateData&) { "${MODULE_GAIA}/shaders/gaia_tonemapping_billboard_fs.glsl" ); std::unique_ptr programTM = - global::renderEngine.buildRenderProgram("ToneMapping", vs, fs); + global::renderEngine->buildRenderProgram("ToneMapping", vs, fs); if (_programTM) { - global::renderEngine.removeRenderProgram(_programTM.get()); + global::renderEngine->removeRenderProgram(_programTM.get()); } _programTM = std::move(programTM); break; @@ -2236,7 +2236,7 @@ void RenderableGaiaStars::update(const UpdateData&) { } if (!_fboTexture) { // Generate a new texture and attach it to our FBO. - glm::vec2 screenSize = glm::vec2(global::renderEngine.renderingResolution()); + glm::vec2 screenSize = glm::vec2(global::renderEngine->renderingResolution()); _fboTexture = std::make_unique( glm::uvec3(screenSize, 1), ghoul::opengl::Texture::Format::RGBA, @@ -2321,9 +2321,9 @@ void RenderableGaiaStars::update(const UpdateData&) { _colorTextureIsDirty = false; } - if (global::windowDelegate.windowHasResized()) { + if (global::windowDelegate->windowHasResized()) { // Update FBO texture resolution if we haven't already. - glm::vec2 screenSize = glm::vec2(global::renderEngine.renderingResolution()); + glm::vec2 screenSize = glm::vec2(global::renderEngine->renderingResolution()); const bool hasChanged = glm::any( glm::notEqual(_fboTexture->dimensions(), glm::uvec3(screenSize, 1)) ); diff --git a/modules/galaxy/rendering/renderablegalaxy.cpp b/modules/galaxy/rendering/renderablegalaxy.cpp index d7cbfc22e4..34cf343446 100644 --- a/modules/galaxy/rendering/renderablegalaxy.cpp +++ b/modules/galaxy/rendering/renderablegalaxy.cpp @@ -356,10 +356,10 @@ RenderableGalaxy::RenderableGalaxy(const ghoul::Dictionary& dictionary) auto onChange = [&](bool enabled) { if (enabled) { - global::raycasterManager.attachRaycaster(*_raycaster); + global::raycasterManager->attachRaycaster(*_raycaster); } else { - global::raycasterManager.detachRaycaster(*_raycaster); + global::raycasterManager->detachRaycaster(*_raycaster); } }; @@ -464,19 +464,19 @@ void RenderableGalaxy::initializeGL() { // We no longer need the data _volume = nullptr; - global::raycasterManager.attachRaycaster(*_raycaster); + global::raycasterManager->attachRaycaster(*_raycaster); // initialize points. if (_pointsFilename.empty()) { return; } - _pointsProgram = global::renderEngine.buildRenderProgram( + _pointsProgram = global::renderEngine->buildRenderProgram( "Galaxy points", absPath("${MODULE_GALAXY}/shaders/points_vs.glsl"), absPath("${MODULE_GALAXY}/shaders/points_fs.glsl") ); - _billboardsProgram = global::renderEngine.buildRenderProgram( + _billboardsProgram = global::renderEngine->buildRenderProgram( "Galaxy billboard", absPath("${MODULE_GALAXY}/shaders/billboard_vs.glsl"), absPath("${MODULE_GALAXY}/shaders/billboard_fs.glsl"), @@ -557,7 +557,7 @@ void RenderableGalaxy::initializeGL() { void RenderableGalaxy::deinitializeGL() { if (_raycaster) { - global::raycasterManager.detachRaycaster(*_raycaster); + global::raycasterManager->detachRaycaster(*_raycaster); _raycaster = nullptr; } @@ -716,8 +716,8 @@ void RenderableGalaxy::renderPoints(const RenderData& data) { _pointsProgram->deactivate(); // Restores OpenGL Rendering State - global::renderEngine.openglStateCache().resetBlendState(); - global::renderEngine.openglStateCache().resetDepthState(); + global::renderEngine->openglStateCache().resetBlendState(); + global::renderEngine->openglStateCache().resetDepthState(); } void RenderableGalaxy::renderBillboards(const RenderData& data) { diff --git a/modules/globebrowsing/globebrowsingmodule.cpp b/modules/globebrowsing/globebrowsingmodule.cpp index 89972ee1fb..e7e36ddaa1 100644 --- a/modules/globebrowsing/globebrowsingmodule.cpp +++ b/modules/globebrowsing/globebrowsingmodule.cpp @@ -511,7 +511,7 @@ void GlobeBrowsingModule::goToChunk(const globebrowsing::RenderableGlobe& globe, }; // Compute altitude - const glm::dvec3 cameraPosition = global::navigationHandler.camera()->positionVec3(); + const glm::dvec3 cameraPosition = global::navigationHandler->camera()->positionVec3(); SceneGraphNode* globeSceneGraphNode = dynamic_cast(globe.owner()); if (!globeSceneGraphNode) { LERROR( @@ -545,7 +545,7 @@ void GlobeBrowsingModule::goToGeodetic2(const globebrowsing::RenderableGlobe& gl { using namespace globebrowsing; - const glm::dvec3 cameraPosition = global::navigationHandler.camera()->positionVec3(); + const glm::dvec3 cameraPosition = global::navigationHandler->camera()->positionVec3(); SceneGraphNode* globeSceneGraphNode = dynamic_cast(globe.owner()); if (!globeSceneGraphNode) { LERROR("Error when going to Geodetic2"); @@ -585,7 +585,7 @@ void GlobeBrowsingModule::goToGeodetic3(const globebrowsing::RenderableGlobe& gl state.position = positionModelSpace; state.up = slightlyNorth; - global::navigationHandler.setNavigationStateNextFrame(state); + global::navigationHandler->setNavigationStateNextFrame(state); } glm::dquat GlobeBrowsingModule::lookDownCameraRotation( @@ -624,7 +624,7 @@ GlobeBrowsingModule::castFocusNodeRenderableToGlobe() using namespace globebrowsing; const Renderable* renderable = - global::navigationHandler.orbitalNavigator().anchorNode()->renderable(); + global::navigationHandler->orbitalNavigator().anchorNode()->renderable(); if (!renderable) { return nullptr; diff --git a/modules/globebrowsing/globebrowsingmodule_lua.inl b/modules/globebrowsing/globebrowsingmodule_lua.inl index 5f091b8108..8bd0fb47a3 100644 --- a/modules/globebrowsing/globebrowsingmodule_lua.inl +++ b/modules/globebrowsing/globebrowsingmodule_lua.inl @@ -53,7 +53,7 @@ int addLayer(lua_State* L) { const std::string& layerGroupName = ghoul::lua::value(L, 2); // Get the node and make sure it exists - SceneGraphNode* n = global::renderEngine.scene()->sceneGraphNode(globeName); + SceneGraphNode* n = global::renderEngine->scene()->sceneGraphNode(globeName); if (!n) { return ghoul::lua::luaError(L, "Unknown globe name: " + globeName); } @@ -105,7 +105,7 @@ int deleteLayer(lua_State* L) { lua_pop(L, 3); // Get the node and make sure it exists - SceneGraphNode* n = global::renderEngine.scene()->sceneGraphNode(globeName); + SceneGraphNode* n = global::renderEngine->scene()->sceneGraphNode(globeName); if (!n) { return ghoul::lua::luaError(L, "Unknown globe name: " + globeName); } @@ -220,7 +220,7 @@ int goToChunk(lua_State* L) { return ghoul::lua::luaError(L, "Identifier must be a RenderableGlobe"); } - global::moduleEngine.module()->goToChunk(*globe, x, y, level); + global::moduleEngine->module()->goToChunk(*globe, x, y, level); ghoul_assert(lua_gettop(L) == 0, "Incorrect number of items left on stack"); return 0; @@ -243,7 +243,7 @@ int goToGeo(lua_State* L) { } } else { - n = global::navigationHandler.orbitalNavigator().anchorNode(); + n = global::navigationHandler->orbitalNavigator().anchorNode(); if (!n) { return ghoul::lua::luaError(L, "No anchor node is set."); } @@ -267,13 +267,13 @@ int goToGeo(lua_State* L) { } if (nArguments == parameterOffset + 2) { - global::moduleEngine.module()->goToGeo( + global::moduleEngine->module()->goToGeo( *globe, latitude, longitude ); } else if (nArguments == parameterOffset + 3) { const double altitude = ghoul::lua::value(L, parameterOffset + 3); - global::moduleEngine.module()->goToGeo( + global::moduleEngine->module()->goToGeo( *globe, latitude, longitude, @@ -305,7 +305,7 @@ int getGeoPosition(lua_State* L) { return ghoul::lua::luaError(L, "Identifier must be a RenderableGlobe"); } - GlobeBrowsingModule& mod = *(global::moduleEngine.module()); + GlobeBrowsingModule& mod = *(global::moduleEngine->module()); glm::vec3 pos = mod.cartesianCoordinatesFromGeo( *globe, latitude, @@ -322,15 +322,15 @@ int getGeoPosition(lua_State* L) { int getGeoPositionForCamera(lua_State* L) { ghoul::lua::checkArgumentsAndThrow(L, 0, "lua::getGeoPositionForCamera"); - GlobeBrowsingModule* module = global::moduleEngine.module(); + GlobeBrowsingModule* module = global::moduleEngine->module(); const RenderableGlobe* globe = module->castFocusNodeRenderableToGlobe(); if (!globe) { return ghoul::lua::luaError(L, "Focus node must be a RenderableGlobe"); } - const glm::dvec3 cameraPosition = global::navigationHandler.camera()->positionVec3(); + const glm::dvec3 cameraPosition = global::navigationHandler->camera()->positionVec3(); const SceneGraphNode* anchor = - global::navigationHandler.orbitalNavigator().anchorNode(); + global::navigationHandler->orbitalNavigator().anchorNode(); const glm::dmat4 inverseModelTransform = glm::inverse(anchor->modelTransform()); const glm::dvec3 cameraPositionModelSpace = glm::dvec3(inverseModelTransform * glm::dvec4(cameraPosition, 1.0)); @@ -357,7 +357,7 @@ int loadWMSCapabilities(lua_State* L) { std::string globe = ghoul::lua::value(L, 2); std::string url = ghoul::lua::value(L, 3); - global::moduleEngine.module()->loadWMSCapabilities( + global::moduleEngine->module()->loadWMSCapabilities( std::move(name), std::move(globe), std::move(url) @@ -378,7 +378,7 @@ int removeWMSServer(lua_State* L) { ghoul::lua::PopValue::Yes ); - global::moduleEngine.module()->removeWMSServer(name); + global::moduleEngine->module()->removeWMSServer(name); ghoul_assert(lua_gettop(L) == 0, "Incorrect number of items left on stack"); return 0; @@ -393,7 +393,7 @@ int capabilities(lua_State* L) { ghoul::lua::PopValue::Yes ); GlobeBrowsingModule::Capabilities cap = - global::moduleEngine.module()->capabilities(name); + global::moduleEngine->module()->capabilities(name); lua_newtable(L); for (unsigned long i = 0; i < cap.size(); ++i) { diff --git a/modules/globebrowsing/src/asynctiledataprovider.cpp b/modules/globebrowsing/src/asynctiledataprovider.cpp index 0f1a949ee8..98f0e35161 100644 --- a/modules/globebrowsing/src/asynctiledataprovider.cpp +++ b/modules/globebrowsing/src/asynctiledataprovider.cpp @@ -48,7 +48,7 @@ AsyncTileDataProvider::AsyncTileDataProvider(std::string name, { ZoneScoped - _globeBrowsingModule = global::moduleEngine.module(); + _globeBrowsingModule = global::moduleEngine->module(); performReset(ResetRawTileDataReader::No); } diff --git a/modules/globebrowsing/src/dashboarditemglobelocation.cpp b/modules/globebrowsing/src/dashboarditemglobelocation.cpp index a696958163..cd19cfb440 100644 --- a/modules/globebrowsing/src/dashboarditemglobelocation.cpp +++ b/modules/globebrowsing/src/dashboarditemglobelocation.cpp @@ -105,7 +105,7 @@ DashboardItemGlobeLocation::DashboardItemGlobeLocation( , _fontName(FontNameInfo, KeyFontMono) , _fontSize(FontSizeInfo, DefaultFontSize, 10.f, 144.f, 1.f) , _significantDigits(SignificantDigitsInfo, 4, 1, 12) - , _font(global::fontManager.font(KeyFontMono, 10)) + , _font(global::fontManager->font(KeyFontMono, 10)) { documentation::testSpecificationAndThrow( Documentation(), @@ -127,12 +127,12 @@ DashboardItemGlobeLocation::DashboardItemGlobeLocation( _fontName.onChange([this]() { - _font = global::fontManager.font(_fontName, _fontSize); + _font = global::fontManager->font(_fontName, _fontSize); }); addProperty(_fontName); _fontSize.onChange([this]() { - _font = global::fontManager.font(_fontName, _fontSize); + _font = global::fontManager->font(_fontName, _fontSize); }); addProperty(_fontSize); @@ -148,7 +148,7 @@ DashboardItemGlobeLocation::DashboardItemGlobeLocation( addProperty(_significantDigits); updateFormatString(); - _font = global::fontManager.font(_fontName, _fontSize); + _font = global::fontManager->font(_fontName, _fontSize); _buffer.resize(128); } @@ -157,7 +157,7 @@ void DashboardItemGlobeLocation::render(glm::vec2& penPosition) { using namespace globebrowsing; - const SceneGraphNode* n = global::navigationHandler.orbitalNavigator().anchorNode(); + const SceneGraphNode* n = global::navigationHandler->orbitalNavigator().anchorNode(); if (!n) { return; } @@ -166,7 +166,7 @@ void DashboardItemGlobeLocation::render(glm::vec2& penPosition) { return; } - const glm::dvec3 cameraPosition = global::navigationHandler.camera()->positionVec3(); + const glm::dvec3 cameraPosition = global::navigationHandler->camera()->positionVec3(); const glm::dmat4 inverseModelTransform = glm::inverse(n->modelTransform()); const glm::dvec3 cameraPositionModelSpace = glm::dvec3(inverseModelTransform * glm::dvec4(cameraPosition, 1.0)); diff --git a/modules/globebrowsing/src/gdalwrapper.cpp b/modules/globebrowsing/src/gdalwrapper.cpp index f8992d84d1..054f3786fe 100644 --- a/modules/globebrowsing/src/gdalwrapper.cpp +++ b/modules/globebrowsing/src/gdalwrapper.cpp @@ -132,12 +132,12 @@ GdalWrapper::GdalWrapper(size_t maximumCacheSize, size_t maximumMaximumCacheSize } void GdalWrapper::setGdalProxyConfiguration() { - if (global::configuration.httpProxy.usingHttpProxy) { - const std::string address = global::configuration.httpProxy.address; - const unsigned int port = global::configuration.httpProxy.port; - const std::string user = global::configuration.httpProxy.user; - const std::string password = global::configuration.httpProxy.password; - std::string auth = global::configuration.httpProxy.authentication; + if (global::configuration->httpProxy.usingHttpProxy) { + const std::string address = global::configuration->httpProxy.address; + const unsigned int port = global::configuration->httpProxy.port; + const std::string user = global::configuration->httpProxy.user; + const std::string password = global::configuration->httpProxy.password; + std::string auth = global::configuration->httpProxy.authentication; std::transform( auth.begin(), auth.end(), diff --git a/modules/globebrowsing/src/globelabelscomponent.cpp b/modules/globebrowsing/src/globelabelscomponent.cpp index a603733eaf..2eb2e0f97e 100644 --- a/modules/globebrowsing/src/globelabelscomponent.cpp +++ b/modules/globebrowsing/src/globelabelscomponent.cpp @@ -444,7 +444,7 @@ void GlobeLabelsComponent::initialize(const ghoul::Dictionary& dictionary, } void GlobeLabelsComponent::initializeFonts() { - _font = openspace::global::fontManager.font( + _font = openspace::global::fontManager->font( "Mono", static_cast(_labelsFontSize), ghoul::fontrendering::FontManager::Outline::Yes, @@ -562,7 +562,7 @@ bool GlobeLabelsComponent::readLabelsFile(const std::string& file) { strncpy(lEntry.feature, token.c_str(), 256); GlobeBrowsingModule* _globeBrowsingModule = - global::moduleEngine.module(); + global::moduleEngine->module(); lEntry.geoPosition = _globeBrowsingModule->cartesianCoordinatesFromGeo( *_globe, lEntry.latitude, diff --git a/modules/globebrowsing/src/globetranslation.cpp b/modules/globebrowsing/src/globetranslation.cpp index 708f3ed0b1..8317d7c65a 100644 --- a/modules/globebrowsing/src/globetranslation.cpp +++ b/modules/globebrowsing/src/globetranslation.cpp @@ -205,7 +205,7 @@ glm::dvec3 GlobeTranslation::position(const UpdateData&) const { return _position; } - GlobeBrowsingModule& mod = *(global::moduleEngine.module()); + GlobeBrowsingModule& mod = *(global::moduleEngine->module()); if (_useHeightmap) { glm::vec3 groundPos = mod.cartesianCoordinatesFromGeo( diff --git a/modules/globebrowsing/src/rawtiledatareader.cpp b/modules/globebrowsing/src/rawtiledatareader.cpp index 4463afb88b..bbbee1d771 100644 --- a/modules/globebrowsing/src/rawtiledatareader.cpp +++ b/modules/globebrowsing/src/rawtiledatareader.cpp @@ -444,7 +444,7 @@ void RawTileDataReader::initialize() { throw ghoul::RuntimeError("File path must not be empty"); } - GlobeBrowsingModule& module = *global::moduleEngine.module(); + GlobeBrowsingModule& module = *global::moduleEngine->module(); std::string content = _datasetFilePath; if (module.isWMSCachingEnabled()) { diff --git a/modules/globebrowsing/src/renderableglobe.cpp b/modules/globebrowsing/src/renderableglobe.cpp index 4ea6fb38e7..0c774885df 100644 --- a/modules/globebrowsing/src/renderableglobe.cpp +++ b/modules/globebrowsing/src/renderableglobe.cpp @@ -284,7 +284,7 @@ ChunkTileVector tilesAndSettingsUnsorted(const LayerGroup& layerGroup, #if defined(__APPLE__) || (defined(__linux__) && defined(__clang__)) ChunkTileVector tilesAndSettings; #else - ChunkTileVector tilesAndSettings(&global::memoryManager.TemporaryMemory); + ChunkTileVector tilesAndSettings(&global::memoryManager->TemporaryMemory); #endif for (Layer* layer : layerGroup.activeLayers()) { if (layer->tileProvider()) { @@ -764,12 +764,12 @@ void RenderableGlobe::deinitialize() { void RenderableGlobe::deinitializeGL() { if (_localRenderer.program) { - global::renderEngine.removeRenderProgram(_localRenderer.program.get()); + global::renderEngine->removeRenderProgram(_localRenderer.program.get()); _localRenderer.program = nullptr; } if (_globalRenderer.program) { - global::renderEngine.removeRenderProgram(_globalRenderer.program.get()); + global::renderEngine->removeRenderProgram(_globalRenderer.program.get()); _globalRenderer.program = nullptr; } @@ -1813,8 +1813,8 @@ void RenderableGlobe::recompileShaders() { // // Create local shader // - global::renderEngine.removeRenderProgram(_localRenderer.program.get()); - _localRenderer.program = global::renderEngine.buildRenderProgram( + global::renderEngine->removeRenderProgram(_localRenderer.program.get()); + _localRenderer.program = global::renderEngine->buildRenderProgram( "LocalChunkedLodPatch", absPath("${MODULE_GLOBEBROWSING}/shaders/localrenderer_vs.glsl"), absPath("${MODULE_GLOBEBROWSING}/shaders/renderer_fs.glsl"), @@ -1842,8 +1842,8 @@ void RenderableGlobe::recompileShaders() { // // Create global shader // - global::renderEngine.removeRenderProgram(_globalRenderer.program.get()); - _globalRenderer.program = global::renderEngine.buildRenderProgram( + global::renderEngine->removeRenderProgram(_globalRenderer.program.get()); + _globalRenderer.program = global::renderEngine->buildRenderProgram( "GlobalChunkedLodPatch", absPath("${MODULE_GLOBEBROWSING}/shaders/globalrenderer_vs.glsl"), absPath("${MODULE_GLOBEBROWSING}/shaders/renderer_fs.glsl"), @@ -2128,9 +2128,11 @@ void RenderableGlobe::calculateEclipseShadows(ghoul::opengl::ProgramObject& prog casterPos *= KM_TO_M; // converting to meters const std::string source = shadowConf.source.first; - SceneGraphNode* sourceNode = global::renderEngine.scene()->sceneGraphNode(source); + SceneGraphNode* sourceNode = + global::renderEngine->scene()->sceneGraphNode(source); const std::string caster = shadowConf.caster.first; - SceneGraphNode* casterNode = global::renderEngine.scene()->sceneGraphNode(caster); + SceneGraphNode* casterNode = + global::renderEngine->scene()->sceneGraphNode(caster); const double sourceRadiusScale = std::max( glm::compMax(sourceNode->scale()), diff --git a/modules/globebrowsing/src/ringscomponent.cpp b/modules/globebrowsing/src/ringscomponent.cpp index 6cec19f313..53f0e08ec9 100644 --- a/modules/globebrowsing/src/ringscomponent.cpp +++ b/modules/globebrowsing/src/ringscomponent.cpp @@ -265,7 +265,7 @@ void RingsComponent::initializeGL() { try { //global::renderEngine.removeRenderProgram(_geometryOnlyShader.get()); - _geometryOnlyShader = global::renderEngine.buildRenderProgram( + _geometryOnlyShader = global::renderEngine->buildRenderProgram( "RingsGeomOnlyProgram", absPath("${MODULE_GLOBEBROWSING}/shaders/rings_geom_vs.glsl"), absPath("${MODULE_GLOBEBROWSING}/shaders/rings_geom_fs.glsl") @@ -298,10 +298,10 @@ void RingsComponent::deinitializeGL() { _textureFile = nullptr; _texture = nullptr; - global::renderEngine.removeRenderProgram(_shader.get()); + global::renderEngine->removeRenderProgram(_shader.get()); _shader = nullptr; - global::renderEngine.removeRenderProgram(_geometryOnlyShader.get()); + global::renderEngine->removeRenderProgram(_geometryOnlyShader.get()); _geometryOnlyShader = nullptr; } @@ -410,7 +410,7 @@ void RingsComponent::update(const UpdateData& data) { } _sunPosition = glm::normalize( - global::renderEngine.scene()->sceneGraphNode("Sun")->worldPosition() - + global::renderEngine->scene()->sceneGraphNode("Sun")->worldPosition() - data.modelTransform.translation ); } @@ -488,8 +488,8 @@ void RingsComponent::compileShadowShader() { dict.setValue("nShadowSamples", std::to_string(_nShadowSamples - 1)); try { - global::renderEngine.removeRenderProgram(_shader.get()); - _shader = global::renderEngine.buildRenderProgram( + global::renderEngine->removeRenderProgram(_shader.get()); + _shader = global::renderEngine->buildRenderProgram( "RingsProgram", absPath("${MODULE_GLOBEBROWSING}/shaders/rings_vs.glsl"), absPath("${MODULE_GLOBEBROWSING}/shaders/rings_fs.glsl"), diff --git a/modules/globebrowsing/src/shadowcomponent.cpp b/modules/globebrowsing/src/shadowcomponent.cpp index 598cf1fc3a..b9615037cb 100644 --- a/modules/globebrowsing/src/shadowcomponent.cpp +++ b/modules/globebrowsing/src/shadowcomponent.cpp @@ -205,7 +205,7 @@ ShadowComponent::ShadowComponent(const ghoul::Dictionary& dictionary) _dynamicDepthTextureRes = false; } else { - glm::ivec2 renderingResolution = global::renderEngine.renderingResolution(); + glm::ivec2 renderingResolution = global::renderEngine->renderingResolution(); _shadowDepthTextureWidth = renderingResolution.x * 2; _shadowDepthTextureHeight = renderingResolution.y * 2; _dynamicDepthTextureRes = true; @@ -413,7 +413,7 @@ void ShadowComponent::end() { if (_viewDepthMap) { if (!_renderDMProgram) { - _renderDMProgram = global::renderEngine.buildRenderProgram( + _renderDMProgram = global::renderEngine->buildRenderProgram( "ShadowMappingDebuggingProgram", absPath("${MODULE_GLOBEBROWSING}/shaders/smviewer_vs.glsl"), absPath("${MODULE_GLOBEBROWSING}/shaders/smviewer_fs.glsl") @@ -442,9 +442,9 @@ void ShadowComponent::end() { void ShadowComponent::update(const UpdateData&) { ZoneScoped - _sunPosition = global::renderEngine.scene()->sceneGraphNode("Sun")->worldPosition(); + _sunPosition = global::renderEngine->scene()->sceneGraphNode("Sun")->worldPosition(); - glm::ivec2 renderingResolution = global::renderEngine.renderingResolution(); + glm::ivec2 renderingResolution = global::renderEngine->renderingResolution(); if (_dynamicDepthTextureRes && ((_shadowDepthTextureWidth != renderingResolution.x) || (_shadowDepthTextureHeight != renderingResolution.y))) { diff --git a/modules/globebrowsing/src/tileprovider.cpp b/modules/globebrowsing/src/tileprovider.cpp index 2c2cde681b..a8fa393b0e 100644 --- a/modules/globebrowsing/src/tileprovider.cpp +++ b/modules/globebrowsing/src/tileprovider.cpp @@ -191,7 +191,7 @@ bool initTexturesFromLoadedData(DefaultTileProvider& t) { void initialize(TextTileProvider& t) { ZoneScoped - t.font = global::fontManager.font("Mono", static_cast(t.fontSize)); + t.font = global::fontManager->font("Mono", static_cast(t.fontSize)); t.fontRenderer = ghoul::fontrendering::FontRenderer::createDefault(); t.fontRenderer->setFramebufferSize(glm::vec2(t.initData.dimensions)); glGenFramebuffers(1, &t.fbo); @@ -235,7 +235,7 @@ Tile tile(TextTileProvider& t, const TileIndex& tileIndex) { t.fontRenderer->render(*t.font, t.textPosition, t.text, t.textColor); glBindFramebuffer(GL_FRAMEBUFFER, defaultFBO); - global::renderEngine.openglStateCache().resetViewportState(); + global::renderEngine->openglStateCache().resetViewportState(); //glViewport(viewport[0], viewport[1], viewport[2], viewport[3]); tile = Tile{ texture, std::nullopt, Tile::Status::OK }; @@ -556,7 +556,7 @@ DefaultTileProvider::DefaultTileProvider(const ghoul::Dictionary& dictionary) type = Type::DefaultTileProvider; - tileCache = global::moduleEngine.module()->tileCache(); + tileCache = global::moduleEngine->module()->tileCache(); name = "Name unspecified"; if (dictionary.hasKeyAndValue("Name")) { name = dictionary.value("Name"); @@ -635,7 +635,7 @@ TextTileProvider::TextTileProvider(TileTextureInitData initData, size_t fontSize { ZoneScoped - tileCache = global::moduleEngine.module()->tileCache(); + tileCache = global::moduleEngine->module()->tileCache(); } @@ -649,7 +649,7 @@ SizeReferenceTileProvider::SizeReferenceTileProvider(const ghoul::Dictionary& di type = Type::SizeReferenceTileProvider; - font = global::fontManager.font("Mono", static_cast(fontSize)); + font = global::fontManager->font("Mono", static_cast(fontSize)); if (dictionary.hasKeyAndValue(sizereferenceprovider::KeyRadii)) { ellipsoid = dictionary.value(sizereferenceprovider::KeyRadii); @@ -1220,9 +1220,9 @@ int update(TileProvider& tp) { case Type::TemporalTileProvider: { TemporalTileProvider& t = static_cast(tp); if (t.successfulInitialization) { - TileProvider* newCurrent = getTileProvider(t, global::timeManager.time()); - if (newCurrent) { - t.currentTileProvider = newCurrent; + TileProvider* newCurr = getTileProvider(t, global::timeManager->time()); + if (newCurr) { + t.currentTileProvider = newCurr; } if (t.currentTileProvider) { update(*t.currentTileProvider); diff --git a/modules/imgui/imguimodule.cpp b/modules/imgui/imguimodule.cpp index 7cc9fd6fab..50bc8dbe78 100644 --- a/modules/imgui/imguimodule.cpp +++ b/modules/imgui/imguimodule.cpp @@ -51,13 +51,13 @@ ImGUIModule::ImGUIModule() : OpenSpaceModule(Name) { gui._globalProperty.setSource( []() { std::vector res = { - &global::navigationHandler, - &global::sessionRecording, - &global::timeManager, - &global::renderEngine, - &global::parallelPeer, - &global::luaConsole, - &global::dashboard + global::navigationHandler, + global::sessionRecording, + global::timeManager, + global::renderEngine, + global::parallelPeer, + global::luaConsole, + global::dashboard }; return res; } @@ -65,21 +65,21 @@ ImGUIModule::ImGUIModule() : OpenSpaceModule(Name) { gui._screenSpaceProperty.setSource( []() { - return global::screenSpaceRootPropertyOwner.propertySubOwners(); + return global::screenSpaceRootPropertyOwner->propertySubOwners(); } ); gui._moduleProperty.setSource( []() { std::vector v; - v.push_back(&(global::moduleEngine)); + v.push_back(global::moduleEngine); return v; } ); gui._sceneProperty.setSource( []() { - const Scene* scene = global::renderEngine.scene(); + const Scene* scene = global::renderEngine->scene(); const std::vector& nodes = scene ? scene->allSceneGraphNodes() : std::vector(); @@ -94,7 +94,7 @@ ImGUIModule::ImGUIModule() : OpenSpaceModule(Name) { gui._virtualProperty.setSource( []() { std::vector res = { - &global::virtualPropertyManager + global::virtualPropertyManager }; return res; @@ -104,7 +104,7 @@ ImGUIModule::ImGUIModule() : OpenSpaceModule(Name) { gui._featuredProperties.setSource( []() { std::vector nodes = - global::renderEngine.scene()->allSceneGraphNodes(); + global::renderEngine->scene()->allSceneGraphNodes(); nodes.erase( std::remove_if( @@ -154,7 +154,7 @@ ImGUIModule::ImGUIModule() : OpenSpaceModule(Name) { global::callback::draw2D.emplace_back([&]() { ZoneScopedN("ImGUI") - WindowDelegate& delegate = global::windowDelegate; + WindowDelegate& delegate = *global::windowDelegate; const bool showGui = delegate.hasGuiWindow() ? delegate.isGuiWindow() : true; if (delegate.isMaster() && showGui) { const glm::ivec2 windowSize = delegate.currentSubwindowSize(); diff --git a/modules/imgui/src/gui.cpp b/modules/imgui/src/gui.cpp index d9b4ed4bc2..85868ef5c3 100644 --- a/modules/imgui/src/gui.cpp +++ b/modules/imgui/src/gui.cpp @@ -82,7 +82,7 @@ namespace { ); } - openspace::global::scriptEngine.queueScript( + openspace::global::scriptEngine->queueScript( script, openspace::scripting::ScriptEngine::RemoteScripting::Yes ); @@ -113,7 +113,7 @@ namespace { ); } - openspace::global::scriptEngine.queueScript( + openspace::global::scriptEngine->queueScript( script, openspace::scripting::ScriptEngine::RemoteScripting::Yes ); @@ -222,7 +222,7 @@ void GUI::initializeGL() { strcpy(iniFileBuffer, cachedFile.c_str()); #endif - int nWindows = global::windowDelegate.nWindows(); + int nWindows = global::windowDelegate->nWindows(); _contexts.resize(nWindows); for (int i = 0; i < nWindows; ++i) { @@ -420,7 +420,7 @@ void GUI::startFrame(float deltaTime, const glm::vec2& windowSize, const glm::vec2& dpiScaling, const glm::vec2& mousePos, uint32_t mouseButtonsPressed) { - const int iWindow = global::windowDelegate.currentWindowId(); + const int iWindow = global::windowDelegate->currentWindowId(); ImGui::SetCurrentContext(_contexts[iWindow]); ImGuiIO& io = ImGui::GetIO(); @@ -752,7 +752,7 @@ void GUI::render() { bool addDashboard = ImGui::Button("Add New Dashboard"); if (addDashboard) { - global::scriptEngine.queueScript( + global::scriptEngine->queueScript( "openspace.addScreenSpaceRenderable({ Type = 'ScreenSpaceDashboard' });", openspace::scripting::ScriptEngine::RemoteScripting::Yes ); @@ -760,7 +760,7 @@ void GUI::render() { bool addDashboardCopy = ImGui::Button("Add Copy of Main Dashboard"); if (addDashboardCopy) { - global::scriptEngine.queueScript( + global::scriptEngine->queueScript( "openspace.addScreenSpaceRenderable({ " "Type = 'ScreenSpaceDashboard', UseMainDashboard = true " "});", diff --git a/modules/imgui/src/guiassetcomponent.cpp b/modules/imgui/src/guiassetcomponent.cpp index 0ccf5fa399..7ab2c37365 100644 --- a/modules/imgui/src/guiassetcomponent.cpp +++ b/modules/imgui/src/guiassetcomponent.cpp @@ -74,7 +74,7 @@ void GuiAssetComponent::render() { ImGui::Begin("Assets", &e); _isEnabled = e; - AssetManager& assetManager = global::openSpaceEngine.assetManager(); + AssetManager& assetManager = global::openSpaceEngine->assetManager(); std::string rootPath; diff --git a/modules/imgui/src/guigibscomponent.cpp b/modules/imgui/src/guigibscomponent.cpp index acdde9ea70..779cf00de6 100644 --- a/modules/imgui/src/guigibscomponent.cpp +++ b/modules/imgui/src/guigibscomponent.cpp @@ -122,7 +122,7 @@ void GuiGIBSComponent::render() { "FilePath = {} }})", layer, xmlFunc ); - global::scriptEngine.queueScript( + global::scriptEngine->queueScript( script, scripting::ScriptEngine::RemoteScripting::Yes ); diff --git a/modules/imgui/src/guiglobebrowsingcomponent.cpp b/modules/imgui/src/guiglobebrowsingcomponent.cpp index 5f77d49496..70a712a4f5 100644 --- a/modules/imgui/src/guiglobebrowsingcomponent.cpp +++ b/modules/imgui/src/guiglobebrowsingcomponent.cpp @@ -50,7 +50,7 @@ GuiGlobeBrowsingComponent::GuiGlobeBrowsingComponent() {} void GuiGlobeBrowsingComponent::render() { - GlobeBrowsingModule* module = global::moduleEngine.module(); + GlobeBrowsingModule* module = global::moduleEngine->module(); using UrlInfo = GlobeBrowsingModule::UrlInfo; using Capabilities = GlobeBrowsingModule::Capabilities; using Layer = GlobeBrowsingModule::Layer; @@ -66,7 +66,7 @@ void GuiGlobeBrowsingComponent::render() { // Render the list of planets std::vector nodes = - global::renderEngine.scene()->allSceneGraphNodes(); + global::renderEngine->scene()->allSceneGraphNodes(); nodes.erase( std::remove_if( @@ -127,7 +127,7 @@ void GuiGlobeBrowsingComponent::render() { // Check if the focus node is a RenderableGlobe const SceneGraphNode* const focus = - global::navigationHandler.orbitalNavigator().anchorNode(); + global::navigationHandler->orbitalNavigator().anchorNode(); const auto it = std::find(nodes.cbegin(), nodes.cend(), focus); if (it != nodes.end()) { @@ -152,7 +152,7 @@ void GuiGlobeBrowsingComponent::render() { bool selectFocusNode = ImGui::Button("From Focus"); if (selectFocusNode) { const SceneGraphNode* const focus = - global::navigationHandler.orbitalNavigator().anchorNode(); + global::navigationHandler->orbitalNavigator().anchorNode(); const auto it = std::find(nodes.cbegin(), nodes.cend(), focus); if (it != nodes.end()) { @@ -330,7 +330,7 @@ void GuiGlobeBrowsingComponent::render() { std::remove(layerName.begin(), layerName.end(), ' '), layerName.end() ); - global::scriptEngine.queueScript( + global::scriptEngine->queueScript( fmt::format( "openspace.globebrowsing.addLayer(\ '{}', \ diff --git a/modules/imgui/src/guiiswacomponent.cpp b/modules/imgui/src/guiiswacomponent.cpp index 468968de69..21a7d366c1 100644 --- a/modules/imgui/src/guiiswacomponent.cpp +++ b/modules/imgui/src/guiiswacomponent.cpp @@ -70,7 +70,7 @@ void GuiIswaComponent::render() { ImGui::InputText("addCynget", addCygnetBuffer, AddCygnetBufferSize); if (ImGui::SmallButton("Add Cygnet")) { - global::scriptEngine.queueScript( + global::scriptEngine->queueScript( "openspace.iswa.addCygnet(" + std::string(addCygnetBuffer) + ");", scripting::ScriptEngine::RemoteScripting::Yes ); @@ -83,13 +83,13 @@ void GuiIswaComponent::render() { openspace.iswa.addCygnet(-5, 'Data', 'GMData'); openspace.iswa.addCygnet(-6, 'Data', 'GMData'); )"; - global::scriptEngine.queueScript( + global::scriptEngine->queueScript( script, scripting::ScriptEngine::RemoteScripting::Yes ); } else { - global::scriptEngine.queueScript( + global::scriptEngine->queueScript( "openspace.iswa.removeGroup('GMData');", scripting::ScriptEngine::RemoteScripting::Yes ); @@ -103,13 +103,13 @@ void GuiIswaComponent::render() { openspace.iswa.addCygnet(-5, 'Texture', 'GMImage'); openspace.iswa.addCygnet(-6, 'Texture', 'GMImage'); )"; - global::scriptEngine.queueScript( + global::scriptEngine->queueScript( script, scripting::ScriptEngine::RemoteScripting::Yes ); } else { - global::scriptEngine.queueScript( + global::scriptEngine->queueScript( "openspace.iswa.removeGroup('GMImage');", scripting::ScriptEngine::RemoteScripting::Yes ); @@ -118,13 +118,13 @@ void GuiIswaComponent::render() { if (_ionData != oldIonDataValue) { if (_ionData) { - global::scriptEngine.queueScript( + global::scriptEngine->queueScript( "openspace.iswa.addCygnet(-10, 'Data', 'Ionosphere');", scripting::ScriptEngine::RemoteScripting::Yes ); } else { - global::scriptEngine.queueScript( + global::scriptEngine->queueScript( "openspace.iswa.removeGroup('Ionosphere');", scripting::ScriptEngine::RemoteScripting::Yes ); @@ -158,7 +158,7 @@ void GuiIswaComponent::render() { const int cdfOption = _cdfOptionsMap[groupName]; if (cdfOptionValue != cdfOption) { const std::string& date = cdfs[cdfOption].date; - global::scriptEngine.queueScript( + global::scriptEngine->queueScript( "openspace.iswa.addKameleonPlanes('" + cdfs[cdfOption].group + "'," + @@ -166,11 +166,11 @@ void GuiIswaComponent::render() { ");", scripting::ScriptEngine::RemoteScripting::Yes ); - global::scriptEngine.queueScript( + global::scriptEngine->queueScript( "openspace.time.setTime('" + date + "');", scripting::ScriptEngine::RemoteScripting::Yes ); - global::scriptEngine.queueScript( + global::scriptEngine->queueScript( "openspace.time.setDeltaTime(0);", scripting::ScriptEngine::RemoteScripting::Yes ); @@ -201,13 +201,13 @@ void GuiIswaComponent::render() { if (selected != info.selected) { const std::string idStr = std::to_string(id); if (info.selected) { - global::scriptEngine.queueScript( + global::scriptEngine->queueScript( "openspace.iswa.addScreenSpaceCygnet({CygnetId=" + idStr + "});", scripting::ScriptEngine::RemoteScripting::Yes ); } else { - global::scriptEngine.queueScript( + global::scriptEngine->queueScript( "openspace.iswa.removeScreenSpaceCygnet(" + idStr + ");", scripting::ScriptEngine::RemoteScripting::Yes ); diff --git a/modules/imgui/src/guijoystickcomponent.cpp b/modules/imgui/src/guijoystickcomponent.cpp index 1eb350bd22..3b4609d406 100644 --- a/modules/imgui/src/guijoystickcomponent.cpp +++ b/modules/imgui/src/guijoystickcomponent.cpp @@ -50,8 +50,8 @@ void GuiJoystickComponent::render() { _isEnabled = v; _isCollapsed = ImGui::IsWindowCollapsed(); - for (size_t i = 0; i < global::joystickInputStates.size(); ++i) { - const JoystickInputState& state = global::joystickInputStates[i]; + for (size_t i = 0; i < global::joystickInputStates->size(); ++i) { + const JoystickInputState& state = global::joystickInputStates->at(i); if (!state.isConnected) { continue; } @@ -85,7 +85,7 @@ void GuiJoystickComponent::render() { ImGui::Text("%s", "Summed contributions"); ImGui::Text("%s", "Axes"); for (int i = 0; i < JoystickInputState::MaxAxes; ++i) { - float f = global::joystickInputStates.axis(i); + float f = global::joystickInputStates->axis(i); ImGui::SliderFloat( std::to_string(i).c_str(), &f, @@ -97,8 +97,8 @@ void GuiJoystickComponent::render() { for (int i = 0; i < JoystickInputState::MaxButtons; ++i) { ImGui::RadioButton( std::to_string(i).c_str(), - global::joystickInputStates.button(i, JoystickAction::Press) || - global::joystickInputStates.button(i, JoystickAction::Repeat) + global::joystickInputStates->button(i, JoystickAction::Press) || + global::joystickInputStates->button(i, JoystickAction::Repeat) ); } diff --git a/modules/imgui/src/guimemorycomponent.cpp b/modules/imgui/src/guimemorycomponent.cpp index c1d267a4d1..04a6e6f6a4 100644 --- a/modules/imgui/src/guimemorycomponent.cpp +++ b/modules/imgui/src/guimemorycomponent.cpp @@ -64,7 +64,7 @@ void GuiMemoryComponent::render() { _isCollapsed = ImGui::IsWindowCollapsed(); ImGui::Text("%s", "Persistent Memory Pool"); - renderMemoryPoolInformation(global::memoryManager.PersistentMemory); + renderMemoryPoolInformation(global::memoryManager->PersistentMemory); //ImGui::Text("%s", "Temporary Memory Pool"); //renderMemoryPoolInformation(global::memoryManager.TemporaryMemory); diff --git a/modules/imgui/src/guimissioncomponent.cpp b/modules/imgui/src/guimissioncomponent.cpp index 49a7c9e3b4..a91eb86dbc 100644 --- a/modules/imgui/src/guimissioncomponent.cpp +++ b/modules/imgui/src/guimissioncomponent.cpp @@ -42,7 +42,7 @@ namespace { std::string missionHashname = "##" + mission.name(); - const double currentTime = openspace::global::timeManager.time().j2000Seconds(); + const double currentTime = openspace::global::timeManager->time().j2000Seconds(); openspace::MissionPhase::Trace t = mission.phaseTrace(currentTime, 0); int treeOption = t.empty() ? 0 : ImGuiTreeNodeFlags_DefaultOpen; @@ -74,7 +74,7 @@ namespace { &v, s, e, - std::string(openspace::global::timeManager.time().UTC()).c_str() + std::string(openspace::global::timeManager->time().UTC()).c_str() ); ImGui::SameLine(); ImGui::Text("%s", std::string(endTime.UTC()).c_str()); @@ -98,7 +98,7 @@ GuiMissionComponent::GuiMissionComponent() {} void GuiMissionComponent::render() { - if (!global::missionManager.hasCurrentMission()) { + if (!global::missionManager->hasCurrentMission()) { return; } @@ -109,7 +109,7 @@ void GuiMissionComponent::render() { _isCollapsed = ImGui::IsWindowCollapsed(); - const Mission& currentMission = global::missionManager.currentMission(); + const Mission& currentMission = global::missionManager->currentMission(); renderMission(currentMission); ImGui::End(); diff --git a/modules/imgui/src/guiparallelcomponent.cpp b/modules/imgui/src/guiparallelcomponent.cpp index 60527364bc..b854f05697 100644 --- a/modules/imgui/src/guiparallelcomponent.cpp +++ b/modules/imgui/src/guiparallelcomponent.cpp @@ -50,7 +50,7 @@ void GuiParallelComponent::renderDisconnected() { const bool connect = ImGui::Button("Connect"); if (connect) { - global::parallelPeer.connect(); + global::parallelPeer->connect(); } } @@ -59,12 +59,12 @@ void GuiParallelComponent::renderConnecting() { const bool cancel = ImGui::Button("Cancel connection"); if (cancel) { - global::parallelPeer.disconnect(); + global::parallelPeer->disconnect(); } } void GuiParallelComponent::renderClientWithHost() { - ParallelPeer& parallel = global::parallelPeer; + ParallelPeer& parallel = *global::parallelPeer; std::string connectionInfo = "Session hosted by \"" + parallel.hostName() + "\"\n"; const size_t nConnections = parallel.nConnections(); @@ -85,9 +85,9 @@ void GuiParallelComponent::renderClientWithHost() { ImGui::Text("%s", connectionInfo.c_str()); renderClientCommon(); - const size_t nTimeKeyframes = global::timeManager.nKeyframes(); + const size_t nTimeKeyframes = global::timeManager->nKeyframes(); const size_t nCameraKeyframes = - global::navigationHandler.keyframeNavigator().nKeyframes(); + global::navigationHandler->keyframeNavigator().nKeyframes(); std::string timeKeyframeInfo = "TimeKeyframes : " + std::to_string(nTimeKeyframes); std::string cameraKeyframeInfo = "CameraKeyframes : " + @@ -108,7 +108,7 @@ void GuiParallelComponent::renderClientWithHost() { void GuiParallelComponent::renderClientWithoutHost() { std::string connectionInfo = "Connected to parallel session with no host\n"; - const size_t nConnections = global::parallelPeer.nConnections(); + const size_t nConnections = global::parallelPeer->nConnections(); if (nConnections > 2) { std::string c = std::to_string(nConnections - 1); @@ -130,17 +130,17 @@ void GuiParallelComponent::renderClientWithoutHost() { void GuiParallelComponent::renderClientCommon() { const bool requestHostship = ImGui::Button("Request hostship"); if (requestHostship) { - global::parallelPeer.requestHostship(); + global::parallelPeer->requestHostship(); } const bool disconnect = ImGui::Button("Disconnect"); if (disconnect) { - global::parallelPeer.disconnect(); + global::parallelPeer->disconnect(); } } void GuiParallelComponent::renderHost() { - const size_t nConnections = global::parallelPeer.nConnections(); + const size_t nConnections = global::parallelPeer->nConnections(); std::string connectionInfo; const size_t nClients = nConnections - 1; @@ -155,7 +155,7 @@ void GuiParallelComponent::renderHost() { const bool resignHostship = ImGui::Button("Resign hostship"); if (resignHostship) { - global::parallelPeer.resignHostship(); + global::parallelPeer->resignHostship(); } } @@ -167,7 +167,7 @@ void GuiParallelComponent::render() { _isEnabled = v; _isCollapsed = ImGui::IsWindowCollapsed(); - ParallelConnection::Status status = global::parallelPeer.status(); + ParallelConnection::Status status = global::parallelPeer->status(); switch (status) { case ParallelConnection::Status::Disconnected: @@ -187,7 +187,7 @@ void GuiParallelComponent::render() { break; } - GuiPropertyComponent::renderPropertyOwner(&global::parallelPeer); + GuiPropertyComponent::renderPropertyOwner(global::parallelPeer); ImGui::End(); } diff --git a/modules/imgui/src/guishortcutscomponent.cpp b/modules/imgui/src/guishortcutscomponent.cpp index 7379408e3b..17e0aaca94 100644 --- a/modules/imgui/src/guishortcutscomponent.cpp +++ b/modules/imgui/src/guishortcutscomponent.cpp @@ -52,13 +52,13 @@ void GuiShortcutsComponent::render() { // First the actual shortcuts CaptionText("Shortcuts"); const std::vector& shortcuts = - global::shortcutManager.shortcuts(); + global::shortcutManager->shortcuts(); for (size_t i = 0; i < shortcuts.size(); ++i) { const interaction::ShortcutManager::ShortcutInformation& info = shortcuts[i]; if (ImGui::Button(info.name.c_str())) { - global::scriptEngine.queueScript( + global::scriptEngine->queueScript( info.script, scripting::ScriptEngine::RemoteScripting(info.synchronization) ); @@ -83,11 +83,11 @@ void GuiShortcutsComponent::render() { CaptionText("Keybindings"); using K = KeyWithModifier; using V = interaction::KeybindingManager::KeyInformation; - const std::multimap& binds = global::keybindingManager.keyBindings(); + const std::multimap& binds = global::keybindingManager->keyBindings(); for (const std::pair& p : binds) { if (ImGui::Button(ghoul::to_string(p.first).c_str())) { - global::scriptEngine.queueScript( + global::scriptEngine->queueScript( p.second.command, scripting::ScriptEngine::RemoteScripting(p.second.synchronization) ); diff --git a/modules/imgui/src/guispacetimecomponent.cpp b/modules/imgui/src/guispacetimecomponent.cpp index 132d52f466..2508abef96 100644 --- a/modules/imgui/src/guispacetimecomponent.cpp +++ b/modules/imgui/src/guispacetimecomponent.cpp @@ -85,7 +85,7 @@ void GuiSpaceTimeComponent::render() { _isCollapsed = ImGui::IsWindowCollapsed(); std::vector nodes = - global::renderEngine.scene()->allSceneGraphNodes(); + global::renderEngine->scene()->allSceneGraphNodes(); std::sort( nodes.begin(), @@ -107,13 +107,13 @@ void GuiSpaceTimeComponent::render() { const bool pressed = ImGui::Button(n->guiName().c_str()); ImGui::SameLine(); if (pressed) { - global::scriptEngine.queueScript( + global::scriptEngine->queueScript( "openspace.setPropertyValue('" + std::string(AnchorProperty) + "', '" + n->identifier() + "');", scripting::ScriptEngine::RemoteScripting::Yes ); - global::scriptEngine.queueScript( + global::scriptEngine->queueScript( "openspace.setPropertyValue('" + std::string(RetargetAnchorProperty) + "', nil);", scripting::ScriptEngine::RemoteScripting::Yes @@ -126,7 +126,7 @@ void GuiSpaceTimeComponent::render() { ImGui::SetCursorPosY(ImGui::GetCursorPosY() + 10.f); const SceneGraphNode* currentFocus = - global::navigationHandler.orbitalNavigator().anchorNode(); + global::navigationHandler->orbitalNavigator().anchorNode(); std::string nodeNames; for (SceneGraphNode* n : nodes) { @@ -143,12 +143,12 @@ void GuiSpaceTimeComponent::render() { const bool hasChanged = ImGui::Combo("", ¤tPosition, nodeNames.c_str()); if (hasChanged) { - global::scriptEngine.queueScript( + global::scriptEngine->queueScript( "openspace.setPropertyValue('" + std::string(AnchorProperty) + "', '" + nodes[currentPosition]->identifier() + "');", scripting::ScriptEngine::RemoteScripting::Yes ); - global::scriptEngine.queueScript( + global::scriptEngine->queueScript( "openspace.setPropertyValue('" + std::string(RetargetAnchorProperty) + "', nil);", scripting::ScriptEngine::RemoteScripting::Yes @@ -158,14 +158,14 @@ void GuiSpaceTimeComponent::render() { ImGui::SameLine(); const bool pressed = ImGui::Button("Refocus"); if (pressed) { - global::scriptEngine.queueScript( + global::scriptEngine->queueScript( "openspace.setPropertyValue('" + std::string(RetargetAnchorProperty) + "', nil);", scripting::ScriptEngine::RemoteScripting::Yes ); } - float interpolationTime = global::navigationHandler.interpolationTime(); + float interpolationTime = global::navigationHandler->interpolationTime(); const bool interpolationTimeChanged = ImGui::SliderFloat( "Interpolation Time", &interpolationTime, @@ -175,7 +175,7 @@ void GuiSpaceTimeComponent::render() { ); if (interpolationTimeChanged) { - global::navigationHandler.setInterpolationTime(interpolationTime); + global::navigationHandler->setInterpolationTime(interpolationTime); } ImGui::SetCursorPosY(ImGui::GetCursorPosY() + 20.f); @@ -190,14 +190,14 @@ void GuiSpaceTimeComponent::render() { ImGui::SetCursorPosY(ImGui::GetCursorPosY() + 10.f); const std::vector& interestingTimes = - global::renderEngine.scene()->interestingTimes(); + global::renderEngine->scene()->interestingTimes(); if (!interestingTimes.empty()) { ImGui::Text("%s", "Interesting Times"); for (size_t i = 0; i < interestingTimes.size(); ++i) { const Scene::InterestingTime& t = interestingTimes[i]; if (ImGui::Button(t.name.c_str())) { - global::scriptEngine.queueScript( + global::scriptEngine->queueScript( "openspace.time.setTime(\"" + t.time + "\")", scripting::ScriptEngine::RemoteScripting::No ); @@ -213,7 +213,7 @@ void GuiSpaceTimeComponent::render() { ImGui::Text( "Current Date: %s", - std::string(global::timeManager.time().UTC()).c_str() + std::string(global::timeManager->time().UTC()).c_str() ); constexpr int BufferSize = 256; @@ -225,7 +225,7 @@ void GuiSpaceTimeComponent::render() { ImGuiInputTextFlags_EnterReturnsTrue ); if (dateChanged) { - global::scriptEngine.queueScript( + global::scriptEngine->queueScript( "openspace.time.setTime(\"" + std::string(Buffer) + "\")", scripting::ScriptEngine::RemoteScripting::No ); @@ -242,10 +242,10 @@ void GuiSpaceTimeComponent::render() { auto incrementTime = [shift = ImGui::GetIO().KeyShift](float days) { using namespace std::chrono; - const float duration = global::timeManager.defaultTimeInterpolationDuration(); + const float duration = global::timeManager->defaultTimeInterpolationDuration(); - const TimeKeyframeData predictedTime = global::timeManager.interpolate( - global::windowDelegate.applicationTime() + duration + const TimeKeyframeData predictedTime = global::timeManager->interpolate( + global::windowDelegate->applicationTime() + duration ); const double j2000 = predictedTime.time.j2000Seconds(); const long long seconds = duration_cast( @@ -258,13 +258,13 @@ void GuiSpaceTimeComponent::render() { if (shift) { // If any shift key is pressed we want to always jump to the time - global::scriptEngine.queueScript( + global::scriptEngine->queueScript( "openspace.time.setTime(" + std::to_string(newTime) + ")", scripting::ScriptEngine::RemoteScripting::No ); } else { - global::scriptEngine.queueScript( + global::scriptEngine->queueScript( "openspace.time.interpolateTime(" + std::to_string(newTime) + ", " + std::to_string(duration) + ")", scripting::ScriptEngine::RemoteScripting::No @@ -304,7 +304,7 @@ void GuiSpaceTimeComponent::render() { // setTime doesn't like the T in it and wants a space instead nowTime[11] = ' '; - global::scriptEngine.queueScript( + global::scriptEngine->queueScript( "openspace.time.setTime(\"" + nowTime + "\")", scripting::ScriptEngine::RemoteScripting::No ); @@ -339,7 +339,7 @@ void GuiSpaceTimeComponent::render() { ImGui::SetCursorPosY(ImGui::GetCursorPosY() + 20.f); // { - const float dt = static_cast(global::timeManager.targetDeltaTime()); + const float dt = static_cast(global::timeManager->targetDeltaTime()); if (_firstFrame) { const std::pair& dtInfo = simplifyTime(dt); _deltaTime = static_cast(dtInfo.first); @@ -383,7 +383,7 @@ void GuiSpaceTimeComponent::render() { // If the value changed, we want to change the delta time to the new value double newDt = convertTime(_deltaTime, _deltaTimeUnit, TimeUnit::Second); - global::scriptEngine.queueScript( + global::scriptEngine->queueScript( "openspace.time.interpolateDeltaTime(" + std::to_string(newDt) + ")", scripting::ScriptEngine::RemoteScripting::No ); @@ -431,14 +431,14 @@ void GuiSpaceTimeComponent::render() { TimeUnit::Second ); - global::scriptEngine.queueScript( + global::scriptEngine->queueScript( "openspace.time.setDeltaTime(" + std::to_string(newDeltaTime) + ")", scripting::ScriptEngine::RemoteScripting::No ); } if (!ImGui::IsItemActive() && !ImGui::IsItemClicked()) { if (_slidingDelta != 0.f) { - global::scriptEngine.queueScript( + global::scriptEngine->queueScript( "openspace.time.setDeltaTime(" + std::to_string(_oldDeltaTime) + ")", scripting::ScriptEngine::RemoteScripting::No ); @@ -459,12 +459,13 @@ void GuiSpaceTimeComponent::render() { if (accelerationDeltaChanged || ImGui::IsItemActive() || ImGui::IsItemClicked()) { // We want the value to change by _accelerationDelta every 100 real world ms const double newDeltaTime = convertTime( - _deltaTime + _accelerationDelta * global::windowDelegate.deltaTime() * 10, + _deltaTime + + _accelerationDelta * global::windowDelegate->deltaTime() * 10, static_cast(_deltaTimeUnit), TimeUnit::Second ); - global::scriptEngine.queueScript( + global::scriptEngine->queueScript( "openspace.time.setDeltaTime(" + std::to_string(newDeltaTime) + ")", scripting::ScriptEngine::RemoteScripting::No ); @@ -476,13 +477,13 @@ void GuiSpaceTimeComponent::render() { _deltaTime -= _slidingDelta; } - const bool isPaused = global::timeManager.isPaused(); + const bool isPaused = global::timeManager->isPaused(); const bool pauseChanged = ImGui::Button( isPaused ? "Resume" : "Pause", { ImGui::GetWindowWidth() / 2 - 7.5f, 0.f } ); if (pauseChanged) { - global::scriptEngine.queueScript( + global::scriptEngine->queueScript( "openspace.time.interpolateTogglePause()", scripting::ScriptEngine::RemoteScripting::No ); @@ -493,7 +494,7 @@ void GuiSpaceTimeComponent::render() { { ImGui::GetWindowWidth() / 2 - 7.5f, 0.f } ); if (invert) { - global::scriptEngine.queueScript( + global::scriptEngine->queueScript( "openspace.time.interpolateDeltaTime(-1 * openspace.time.deltaTime());", scripting::ScriptEngine::RemoteScripting::No ); @@ -501,7 +502,7 @@ void GuiSpaceTimeComponent::render() { const bool minusDs = ImGui::Button("-1d/s"); if (minusDs) { - global::scriptEngine.queueScript( + global::scriptEngine->queueScript( "openspace.time.interpolateDeltaTime(" + std::to_string(-24 * 60 * 60) + ")", scripting::ScriptEngine::RemoteScripting::No ); @@ -510,7 +511,7 @@ void GuiSpaceTimeComponent::render() { const bool minusHs = ImGui::Button("-1h/s"); if (minusHs) { - global::scriptEngine.queueScript( + global::scriptEngine->queueScript( "openspace.time.interpolateDeltaTime(" + std::to_string(-60 * 60) + ")", scripting::ScriptEngine::RemoteScripting::No ); @@ -519,7 +520,7 @@ void GuiSpaceTimeComponent::render() { const bool minusMs = ImGui::Button("-1min/s"); if (minusMs) { - global::scriptEngine.queueScript( + global::scriptEngine->queueScript( "openspace.time.interpolateDeltaTime(" + std::to_string(-60) + ")", scripting::ScriptEngine::RemoteScripting::No ); @@ -528,7 +529,7 @@ void GuiSpaceTimeComponent::render() { const bool minusSs = ImGui::Button("-1s/s"); if (minusSs) { - global::scriptEngine.queueScript( + global::scriptEngine->queueScript( "openspace.time.interpolateDeltaTime(" + std::to_string(-1) + ")", scripting::ScriptEngine::RemoteScripting::No ); @@ -537,7 +538,7 @@ void GuiSpaceTimeComponent::render() { const bool zero = ImGui::Button("0"); if (zero) { - global::scriptEngine.queueScript( + global::scriptEngine->queueScript( "openspace.time.interpolateDeltaTime(" + std::to_string(0) + ")", scripting::ScriptEngine::RemoteScripting::No ); @@ -547,7 +548,7 @@ void GuiSpaceTimeComponent::render() { const bool plusSs = ImGui::Button("+1s/s"); if (plusSs) { - global::scriptEngine.queueScript( + global::scriptEngine->queueScript( "openspace.time.interpolateDeltaTime(" + std::to_string(1) + ")", scripting::ScriptEngine::RemoteScripting::No ); @@ -556,7 +557,7 @@ void GuiSpaceTimeComponent::render() { const bool plusMs = ImGui::Button("1min/s"); if (plusMs) { - global::scriptEngine.queueScript( + global::scriptEngine->queueScript( "openspace.time.interpolateDeltaTime(" + std::to_string(60) + ")", scripting::ScriptEngine::RemoteScripting::No ); @@ -565,7 +566,7 @@ void GuiSpaceTimeComponent::render() { const bool plusHs = ImGui::Button("1h/s"); if (plusHs) { - global::scriptEngine.queueScript( + global::scriptEngine->queueScript( "openspace.time.interpolateDeltaTime(" + std::to_string(60 * 60) + ")", scripting::ScriptEngine::RemoteScripting::No ); @@ -574,7 +575,7 @@ void GuiSpaceTimeComponent::render() { const bool plusDs = ImGui::Button("1d/s"); if (plusDs) { - global::scriptEngine.queueScript( + global::scriptEngine->queueScript( "openspace.time.interpolateDeltaTime(" + std::to_string(24 * 60 * 60) + ")", scripting::ScriptEngine::RemoteScripting::No ); diff --git a/modules/imgui/src/renderproperties.cpp b/modules/imgui/src/renderproperties.cpp index 6621461ad7..4d20ef70f0 100644 --- a/modules/imgui/src/renderproperties.cpp +++ b/modules/imgui/src/renderproperties.cpp @@ -69,14 +69,14 @@ void renderTooltip(Property* prop, double delay) { } void executeScriptSingle(const std::string& id, const std::string& value) { - global::scriptEngine.queueScript( + global::scriptEngine->queueScript( "openspace.setPropertyValueSingle('" + id + "', " + value + ");", scripting::ScriptEngine::RemoteScripting::Yes ); } void executeScriptGroup(const std::string& id, const std::string& value) { - global::scriptEngine.queueScript( + global::scriptEngine->queueScript( "openspace.setPropertyValue('" + id + "', " + value + ");", scripting::ScriptEngine::RemoteScripting::Yes ); diff --git a/modules/iswa/rendering/dataplane.cpp b/modules/iswa/rendering/dataplane.cpp index a4dcc8ce83..5128c9606b 100644 --- a/modules/iswa/rendering/dataplane.cpp +++ b/modules/iswa/rendering/dataplane.cpp @@ -39,7 +39,7 @@ void DataPlane::initializeGL() { IswaCygnet::initialize(); if (!_shader) { - _shader = global::renderEngine.buildRenderProgram( + _shader = global::renderEngine->buildRenderProgram( "DataPlaneProgram", absPath("${MODULE_ISWA}/shaders/dataplane_vs.glsl"), absPath("${MODULE_ISWA}/shaders/dataplane_fs.glsl") diff --git a/modules/iswa/rendering/datasphere.cpp b/modules/iswa/rendering/datasphere.cpp index 318b9d8a19..208e3af6ef 100644 --- a/modules/iswa/rendering/datasphere.cpp +++ b/modules/iswa/rendering/datasphere.cpp @@ -47,7 +47,7 @@ void DataSphere::initializeGL() { IswaCygnet::initializeGL(); if (!_shader) { - _shader = global::renderEngine.buildRenderProgram( + _shader = global::renderEngine->buildRenderProgram( "DataSphereProgram", absPath("${MODULE_ISWA}/shaders/datasphere_vs.glsl"), absPath("${MODULE_ISWA}/shaders/datasphere_fs.glsl") diff --git a/modules/iswa/rendering/iswacygnet.cpp b/modules/iswa/rendering/iswacygnet.cpp index 2482037464..651ff8561b 100644 --- a/modules/iswa/rendering/iswacygnet.cpp +++ b/modules/iswa/rendering/iswacygnet.cpp @@ -114,7 +114,7 @@ void IswaCygnet::initializeGL() { else { _delete.onChange([this]() { deinitialize(); - global::scriptEngine.queueScript( + global::scriptEngine->queueScript( "openspace.removeSceneGraphNode('" + identifier() + "')", scripting::ScriptEngine::RemoteScripting::Yes ); @@ -123,7 +123,7 @@ void IswaCygnet::initializeGL() { initializeTime(); createGeometry(); - downloadTextureResource(global::timeManager.time().j2000Seconds()); + downloadTextureResource(global::timeManager->time().j2000Seconds()); } void IswaCygnet::deinitializeGL() { @@ -135,7 +135,7 @@ void IswaCygnet::deinitializeGL() { destroyGeometry(); if (_shader) { - global::renderEngine.removeRenderProgram(_shader.get()); + global::renderEngine->removeRenderProgram(_shader.get()); _shader = nullptr; } } @@ -193,7 +193,7 @@ void IswaCygnet::update(const UpdateData&) { // the texture resource is downloaded ahead of time, so we need to // now if we are going backwards or forwards - _openSpaceTime = global::timeManager.time().j2000Seconds(); + _openSpaceTime = global::timeManager->time().j2000Seconds(); _realTime = std::chrono::duration_cast( std::chrono::system_clock::now().time_since_epoch() ); @@ -218,7 +218,7 @@ void IswaCygnet::update(const UpdateData&) { updateTexture(); _textureDirty = false; - double clockwiseSign = (global::timeManager.deltaTime() > 0) ? 1.0 : -1.0; + double clockwiseSign = (global::timeManager->deltaTime() > 0) ? 1.0 : -1.0; downloadTextureResource(_openSpaceTime + clockwiseSign * _data.updateTime); _lastUpdateRealTime = _realTime; _lastUpdateOpenSpaceTime = _openSpaceTime; @@ -240,7 +240,7 @@ void IswaCygnet::registerProperties() {} void IswaCygnet::unregisterProperties() {} void IswaCygnet::initializeTime() { - _openSpaceTime = global::timeManager.time().j2000Seconds(); + _openSpaceTime = global::timeManager->time().j2000Seconds(); _lastUpdateOpenSpaceTime = 0.0; _realTime = std::chrono::duration_cast( @@ -277,7 +277,7 @@ void IswaCygnet::initializeGroup() { groupEvent.subscribe(identifier(), "clearGroup", [&](ghoul::Dictionary) { LDEBUG(identifier() + " Event clearGroup"); - global::scriptEngine.queueScript( + global::scriptEngine->queueScript( "openspace.removeSceneGraphNode('" + identifier() + "')", scripting::ScriptEngine::RemoteScripting::Yes ); diff --git a/modules/iswa/rendering/iswakameleongroup.cpp b/modules/iswa/rendering/iswakameleongroup.cpp index df227ff0b5..8d6928ba93 100644 --- a/modules/iswa/rendering/iswakameleongroup.cpp +++ b/modules/iswa/rendering/iswakameleongroup.cpp @@ -149,7 +149,7 @@ void IswaKameleonGroup::updateFieldlineSeeds() { if (it == options.end() && std::get<2>(seedPath.second)) { LDEBUG("Removed fieldlines: " + std::get<0>(seedPath.second)); - global::scriptEngine.queueScript( + global::scriptEngine->queueScript( "openspace.removeSceneGraphNode('" + std::get<0>(seedPath.second) + "')", scripting::ScriptEngine::RemoteScripting::Yes ); @@ -176,7 +176,7 @@ void IswaKameleonGroup::clearFieldlines() { if (std::get<2>(seedPath.second)) { LDEBUG("Removed fieldlines: " + std::get<0>(seedPath.second)); - global::scriptEngine.queueScript( + global::scriptEngine->queueScript( "openspace.removeSceneGraphNode('" + std::get<0>(seedPath.second) + "')", scripting::ScriptEngine::RemoteScripting::Yes ); diff --git a/modules/iswa/rendering/kameleonplane.cpp b/modules/iswa/rendering/kameleonplane.cpp index bfc889e835..93a42400d8 100644 --- a/modules/iswa/rendering/kameleonplane.cpp +++ b/modules/iswa/rendering/kameleonplane.cpp @@ -112,7 +112,7 @@ void KameleonPlane::deinitializeGL() { void KameleonPlane::initializeGL() { if (!_shader) { - _shader = global::renderEngine.buildRenderProgram( + _shader = global::renderEngine->buildRenderProgram( "DataPlaneProgram", absPath("${MODULE_ISWA}/shaders/dataplane_vs.glsl"), absPath("${MODULE_ISWA}/shaders/dataplane_fs.glsl") @@ -274,7 +274,7 @@ void KameleonPlane::updateFieldlineSeeds() { seedPath.first ); if (it == selectedOptions.end() && std::get<2>(seedPath.second)) { - SceneGraphNode* n = global::renderEngine.scene()->sceneGraphNode( + SceneGraphNode* n = global::renderEngine->scene()->sceneGraphNode( std::get<0>(seedPath.second) ); if (!n) { @@ -282,7 +282,7 @@ void KameleonPlane::updateFieldlineSeeds() { } LDEBUG("Removed fieldlines: " + std::get<0>(seedPath.second)); - global::scriptEngine.queueScript( + global::scriptEngine->queueScript( "openspace.removeSceneGraphNode('" + std::get<0>(seedPath.second) + "')", scripting::ScriptEngine::RemoteScripting::Yes ); @@ -290,7 +290,7 @@ void KameleonPlane::updateFieldlineSeeds() { // if this option was turned on } else if (it != selectedOptions.end() && !std::get<2>(seedPath.second)) { - SceneGraphNode* n = global::renderEngine.scene()->sceneGraphNode( + SceneGraphNode* n = global::renderEngine->scene()->sceneGraphNode( std::get<0>(seedPath.second) ); if (n) { diff --git a/modules/iswa/rendering/screenspacecygnet.cpp b/modules/iswa/rendering/screenspacecygnet.cpp index 4148ad3fc7..fc378db93b 100644 --- a/modules/iswa/rendering/screenspacecygnet.cpp +++ b/modules/iswa/rendering/screenspacecygnet.cpp @@ -40,10 +40,10 @@ ScreenSpaceCygnet::ScreenSpaceCygnet(const ghoul::Dictionary& dictionary) _downloadImage = true; _texturePath = IswaManager::ref().iswaUrl( _cygnetId, - global::timeManager.time().j2000Seconds() + global::timeManager->time().j2000Seconds() ); - _openSpaceTime = global::timeManager.time().j2000Seconds(); + _openSpaceTime = global::timeManager->time().j2000Seconds(); _lastUpdateOpenSpaceTime = _openSpaceTime; _realTime = std::chrono::duration_cast( @@ -53,7 +53,7 @@ ScreenSpaceCygnet::ScreenSpaceCygnet(const ghoul::Dictionary& dictionary) _minRealTimeUpdateInterval = 100; _delete.onChange([this]() { - global::scriptEngine.queueScript( + global::scriptEngine->queueScript( "openspace.iswa.removeScreenSpaceCygnet("+std::to_string(_cygnetId)+");", scripting::ScriptEngine::RemoteScripting::Yes ); @@ -61,7 +61,7 @@ ScreenSpaceCygnet::ScreenSpaceCygnet(const ghoul::Dictionary& dictionary) } void ScreenSpaceCygnet::update() { - _openSpaceTime = global::timeManager.time().j2000Seconds(); + _openSpaceTime = global::timeManager->time().j2000Seconds(); _realTime = std::chrono::duration_cast( std::chrono::system_clock::now().time_since_epoch() ); @@ -72,7 +72,7 @@ void ScreenSpaceCygnet::update() { if (timeToUpdate) { _texturePath = IswaManager::ref().iswaUrl( _cygnetId, - global::timeManager.time().j2000Seconds() + global::timeManager->time().j2000Seconds() ); _lastUpdateRealTime = _realTime; _lastUpdateOpenSpaceTime = _openSpaceTime; diff --git a/modules/iswa/rendering/textureplane.cpp b/modules/iswa/rendering/textureplane.cpp index 7dfc0bf0c4..57d1ef7cf9 100644 --- a/modules/iswa/rendering/textureplane.cpp +++ b/modules/iswa/rendering/textureplane.cpp @@ -39,7 +39,7 @@ TexturePlane::TexturePlane(const ghoul::Dictionary& dictionary) void TexturePlane::initializeGL() { if (!_shader) { - _shader = global::renderEngine.buildRenderProgram( + _shader = global::renderEngine->buildRenderProgram( "PlaneProgram", absPath("${MODULE_ISWA}/shaders/textureplane_vs.glsl"), absPath("${MODULE_ISWA}/shaders/textureplane_fs.glsl") diff --git a/modules/iswa/util/iswamanager.cpp b/modules/iswa/util/iswamanager.cpp index 7d0eb666b9..2d5cec6064 100644 --- a/modules/iswa/util/iswamanager.cpp +++ b/modules/iswa/util/iswamanager.cpp @@ -84,7 +84,7 @@ namespace { void createScreenSpace(int id) { std::string idStr = std::to_string(id); - openspace::global::scriptEngine.queueScript( + openspace::global::scriptEngine->queueScript( "openspace.iswa.addScreenSpaceCygnet({CygnetId =" + idStr + "});", openspace::scripting::ScriptEngine::RemoteScripting::Yes ); @@ -190,7 +190,7 @@ void IswaManager::addIswaCygnet(int id, const std::string& type, std::string gro }; // Download metadata - global::downloadManager.fetchFile( + global::downloadManager->fetchFile( _baseUrl + std::to_string(-id), metadataCallback, [id](const std::string& err) { @@ -221,7 +221,7 @@ void IswaManager::addKameleonCdf(std::string groupName, int pos) { std::future IswaManager::fetchImageCygnet(int id, double timestamp) { - return global::downloadManager.fetchFile( + return global::downloadManager->fetchFile( iswaUrl(id, timestamp, "image"), [id](const DownloadManager::MemoryFile&) { LDEBUG( @@ -241,7 +241,7 @@ std::future IswaManager::fetchImageCygnet(int id, std::future IswaManager::fetchDataCygnet(int id, double timestamp) { - return global::downloadManager.fetchFile( + return global::downloadManager->fetchFile( iswaUrl(id, timestamp, "data"), [id](const DownloadManager::MemoryFile&) { LDEBUG( @@ -340,7 +340,7 @@ std::shared_ptr IswaManager::downloadMetadata(int id) { std::shared_ptr metaFuture = std::make_shared(); metaFuture->id = id; - global::downloadManager.fetchFile( + global::downloadManager->fetchFile( _baseUrl + std::to_string(-id), [&metaFuture](const DownloadManager::MemoryFile& file) { metaFuture->json = std::string(file.buffer, file.buffer + file.size); @@ -542,7 +542,7 @@ void IswaManager::createPlane(MetadataFuture& data) { data.name = name; - if (global::renderEngine.scene()->sceneGraphNode(name)) { + if (global::renderEngine->scene()->sceneGraphNode(name)) { LERROR("A node with name \"" + name + "\" already exist"); return; } @@ -550,7 +550,7 @@ void IswaManager::createPlane(MetadataFuture& data) { std::string luaTable = jsonPlaneToLuaTable(data); if (!luaTable.empty()) { std::string script = "openspace.addSceneGraphNode(" + luaTable + ");"; - global::scriptEngine.queueScript( + global::scriptEngine->queueScript( script, scripting::ScriptEngine::RemoteScripting::Yes ); @@ -576,14 +576,14 @@ void IswaManager::createSphere(MetadataFuture& data) { data.name = name; - if (global::renderEngine.scene()->sceneGraphNode(name)) { + if (global::renderEngine->scene()->sceneGraphNode(name)) { LERROR("A node with name \"" + name +"\" already exist"); return; } std::string luaTable = jsonSphereToLuaTable(data); if (luaTable != "") { std::string script = "openspace.addSceneGraphNode(" + luaTable + ");"; - global::scriptEngine.queueScript( + global::scriptEngine->queueScript( script, scripting::ScriptEngine::RemoteScripting::Yes ); @@ -610,7 +610,7 @@ void IswaManager::createKameleonPlane(CdfInfo info, std::string cut) { info.name = info.name + "-" + cut; - if (global::renderEngine.scene()->sceneGraphNode(info.name)) { + if (global::renderEngine->scene()->sceneGraphNode(info.name)) { LERROR("A node with name \"" + info.name +"\" already exist"); return; } @@ -618,7 +618,7 @@ void IswaManager::createKameleonPlane(CdfInfo info, std::string cut) { std::string luaTable = parseKWToLuaTable(info, cut); if (!luaTable.empty()) { std::string script = "openspace.addSceneGraphNode(" + luaTable + ");"; - global::scriptEngine.queueScript( + global::scriptEngine->queueScript( script, scripting::ScriptEngine::RemoteScripting::Yes ); @@ -658,14 +658,14 @@ void IswaManager::createFieldline(std::string name, std::string cdfPath, "}"; if (!luaTable.empty()) { std::string script = "openspace.addSceneGraphNode(" + luaTable + ");"; - global::scriptEngine.queueScript( + global::scriptEngine->queueScript( script, scripting::ScriptEngine::RemoteScripting::Yes ); } } else { - LWARNING( cdfPath + " is not a cdf file or can't be found."); + LWARNING(cdfPath + " is not a cdf file or can't be found"); } } diff --git a/modules/iswa/util/iswamanager_lua.inl b/modules/iswa/util/iswamanager_lua.inl index b2f609ad3c..b5e8dbbc70 100644 --- a/modules/iswa/util/iswamanager_lua.inl +++ b/modules/iswa/util/iswamanager_lua.inl @@ -85,7 +85,7 @@ int iswa_addScreenSpaceCygnet(lua_State* L) { int updateInterval = info->updateInterval; info->selected = true; - if (global::renderEngine.screenSpaceRenderable(name)) { + if (global::renderEngine->screenSpaceRenderable(name)) { LERROR("A cygnet with the name \"" + name +"\" already exist"); return 0; } @@ -97,7 +97,7 @@ int iswa_addScreenSpaceCygnet(lua_State* L) { std::unique_ptr s( ScreenSpaceRenderable::createFromDictionary(d) ); - global::renderEngine.addScreenSpaceRenderable(std::move(s)); + global::renderEngine->addScreenSpaceRenderable(std::move(s)); } return 0; } @@ -127,7 +127,7 @@ int iswa_addScreenSpaceCygnet(lua_State* L) { int iswa_removeCygnet(lua_State* L) { std::string name = luaL_checkstring(L, -1); - global::scriptEngine.queueScript( + global::scriptEngine->queueScript( "openspace.removeSceneGraphNode('" + name + "')", scripting::ScriptEngine::RemoteScripting::Yes ); @@ -153,7 +153,7 @@ int iswa_removeScrenSpaceCygnet(lua_State* L) { "openspace.unregisterScreenSpaceRenderable('" + cygnetInformation[id]->name + "');"; - global::scriptEngine.queueScript( + global::scriptEngine->queueScript( script, scripting::ScriptEngine::RemoteScripting::Yes ); diff --git a/modules/kameleonvolume/rendering/renderablekameleonvolume.cpp b/modules/kameleonvolume/rendering/renderablekameleonvolume.cpp index 7daeed8749..76af40a5d4 100644 --- a/modules/kameleonvolume/rendering/renderablekameleonvolume.cpp +++ b/modules/kameleonvolume/rendering/renderablekameleonvolume.cpp @@ -264,14 +264,14 @@ void RenderableKameleonVolume::initializeGL() { _raycaster->initialize(); - global::raycasterManager.attachRaycaster(*_raycaster.get()); + global::raycasterManager->attachRaycaster(*_raycaster.get()); auto onChange = [&](bool enabled) { if (enabled) { - global::raycasterManager.attachRaycaster(*_raycaster.get()); + global::raycasterManager->attachRaycaster(*_raycaster.get()); } else { - global::raycasterManager.detachRaycaster(*_raycaster.get()); + global::raycasterManager->detachRaycaster(*_raycaster.get()); } }; @@ -438,7 +438,7 @@ void RenderableKameleonVolume::storeRaw(const std::string& path) { void RenderableKameleonVolume::deinitializeGL() { if (_raycaster) { - global::raycasterManager.detachRaycaster(*_raycaster.get()); + global::raycasterManager->detachRaycaster(*_raycaster.get()); _raycaster = nullptr; } } diff --git a/modules/multiresvolume/rendering/renderablemultiresvolume.cpp b/modules/multiresvolume/rendering/renderablemultiresvolume.cpp index 02cfcaaf74..b35de6e4ee 100644 --- a/modules/multiresvolume/rendering/renderablemultiresvolume.cpp +++ b/modules/multiresvolume/rendering/renderablemultiresvolume.cpp @@ -428,14 +428,14 @@ void RenderableMultiresVolume::initializeGL() { ); _raycaster->initialize(); - global::raycasterManager.attachRaycaster(*_raycaster); + global::raycasterManager->attachRaycaster(*_raycaster); auto onChange = [&](bool enabled) { if (enabled) { - global::raycasterManager.attachRaycaster(*_raycaster); + global::raycasterManager->attachRaycaster(*_raycaster); } else { - global::raycasterManager.detachRaycaster(*_raycaster); + global::raycasterManager->detachRaycaster(*_raycaster); } }; diff --git a/modules/server/include/topics/topic.h b/modules/server/include/topics/topic.h index 1ce3d11004..64f3387a89 100644 --- a/modules/server/include/topics/topic.h +++ b/modules/server/include/topics/topic.h @@ -44,7 +44,7 @@ public: virtual bool isDone() const = 0; protected: - size_t _topicId; + size_t _topicId = 0; Connection* _connection; }; diff --git a/modules/server/servermodule.cpp b/modules/server/servermodule.cpp index 6d527b60b4..84910594da 100644 --- a/modules/server/servermodule.cpp +++ b/modules/server/servermodule.cpp @@ -100,7 +100,7 @@ void ServerModule::internalInitialize(const ghoul::Dictionary& configuration) { ServerInterface::createFromDictionary(interfaceDictionary); - if (global::windowDelegate.isMaster()) { + if (global::windowDelegate->isMaster()) { serverInterface->initialize(); } @@ -113,7 +113,7 @@ void ServerModule::internalInitialize(const ghoul::Dictionary& configuration) { } void ServerModule::preSync() { - if (!global::windowDelegate.isMaster()) { + if (!global::windowDelegate->isMaster()) { return; } @@ -185,7 +185,7 @@ void ServerModule::disconnectAll() { ZoneScoped for (std::unique_ptr& serverInterface : _interfaces) { - if (global::windowDelegate.isMaster()) { + if (global::windowDelegate->isMaster()) { serverInterface->deinitialize(); } } diff --git a/modules/server/src/topics/documentationtopic.cpp b/modules/server/src/topics/documentationtopic.cpp index c4fbfc3d29..d7dfb7c7c9 100644 --- a/modules/server/src/topics/documentationtopic.cpp +++ b/modules/server/src/topics/documentationtopic.cpp @@ -57,16 +57,16 @@ void DocumentationTopic::handleJson(const nlohmann::json& json) { // Do not parse generated json. Instead implement ability to get // ghoul::Dictionary objects from ScriptEngine, FactoryManager, and KeybindingManager. if (requestedType == TypeLua) { - response = json::parse(global::scriptEngine.generateJson()); + response = json::parse(global::scriptEngine->generateJson()); } else if (requestedType == TypeFactories) { response = json::parse(FactoryManager::ref().generateJson()); } else if (requestedType == TypeKeyboard) { - response = json::parse(global::keybindingManager.generateJson()); + response = json::parse(global::keybindingManager->generateJson()); } else if (requestedType == TypeAsset) { - response = json::parse(global::keybindingManager.generateJson()); + response = json::parse(global::keybindingManager->generateJson()); } else if (requestedType == TypeMeta) { std::string docs = SceneLicenseWriter().generateJson(); diff --git a/modules/server/src/topics/flightcontrollertopic.cpp b/modules/server/src/topics/flightcontrollertopic.cpp index 372c5c43ff..ed95e9df7b 100644 --- a/modules/server/src/topics/flightcontrollertopic.cpp +++ b/modules/server/src/topics/flightcontrollertopic.cpp @@ -159,20 +159,20 @@ namespace openspace { FlightControllerTopic::FlightControllerTopic() { for (auto it = AxisIndexMap.begin(); it != AxisIndexMap.end(); ++it) { - global::navigationHandler.setWebsocketAxisMapping( + global::navigationHandler->setWebsocketAxisMapping( int(std::distance(AxisIndexMap.begin(), it)), it->second ); } // Add WebsocketInputState to global states - global::websocketInputStates[_topicId] = &_inputState; + (*global::websocketInputStates)[_topicId] = &_inputState; } FlightControllerTopic::~FlightControllerTopic() { // Reset global websocketInputStates - global::websocketInputStates.erase(_topicId); - global::websocketInputStates = interaction::WebsocketInputStates(); + global::websocketInputStates->erase(_topicId); + *global::websocketInputStates = interaction::WebsocketInputStates(); } bool FlightControllerTopic::isDone() const { @@ -234,7 +234,7 @@ void FlightControllerTopic::connect() { void FlightControllerTopic::setFocusNodes() { // Get all scene nodes std::vector nodes = - global::renderEngine.scene()->allSceneGraphNodes(); + global::renderEngine->scene()->allSceneGraphNodes(); // Remove all nodes with no renderable nodes.erase( @@ -271,7 +271,7 @@ void FlightControllerTopic::setFocusNodes() { void FlightControllerTopic::setInterestingTimes() { std::vector times = - global::renderEngine.scene()->interestingTimes(); + global::renderEngine->scene()->interestingTimes(); std::sort( times.begin(), @@ -323,30 +323,30 @@ void FlightControllerTopic::changeFocus(const nlohmann::json& json) const { const bool retargetAnchor = json[RetargetAnchorKey]; const bool retargetAim = json[RetargetAimKey]; - Scene* scene = global::renderEngine.scene(); + Scene* scene = global::renderEngine->scene(); const SceneGraphNode* focusNode = scene->sceneGraphNode(focus); const SceneGraphNode* aimNode = scene->sceneGraphNode(aim); const SceneGraphNode* anchorNode = scene->sceneGraphNode(anchor); if (focusNode) { - global::navigationHandler.orbitalNavigator().setFocusNode( + global::navigationHandler->orbitalNavigator().setFocusNode( focusNode, resetVelocities ); } else { if (aimNode) { - global::navigationHandler.orbitalNavigator().setAimNode(aim); + global::navigationHandler->orbitalNavigator().setAimNode(aim); } if (anchorNode) { - global::navigationHandler.orbitalNavigator().setAnchorNode(anchor); + global::navigationHandler->orbitalNavigator().setAnchorNode(anchor); } } if (retargetAnchor) { - global::navigationHandler.orbitalNavigator().startRetargetAnchor(); + global::navigationHandler->orbitalNavigator().startRetargetAnchor(); } if (retargetAim) { - global::navigationHandler.orbitalNavigator().startRetargetAim(); + global::navigationHandler->orbitalNavigator().startRetargetAim(); } } @@ -362,7 +362,7 @@ void FlightControllerTopic::setRenderableEnabled(const nlohmann::json& json) con const std::string name = json[RenderableKey][SceneNodeName]; const bool enabled = json[RenderableKey][SceneNodeEnabled]; - const SceneGraphNode* node = global::renderEngine.scene()->sceneGraphNode(name); + const SceneGraphNode* node = global::renderEngine->scene()->sceneGraphNode(name); if (node && node->renderable() != nullptr) { node->renderable()->property(RenderableEnabled)->set(enabled); } @@ -370,8 +370,8 @@ void FlightControllerTopic::setRenderableEnabled(const nlohmann::json& json) con void FlightControllerTopic::disconnect() { // Reset global websocketInputStates - global::websocketInputStates.erase(_topicId); - global::websocketInputStates = interaction::WebsocketInputStates(); + global::websocketInputStates->erase(_topicId); + *global::websocketInputStates = interaction::WebsocketInputStates(); // Update FlightController nlohmann::json j; @@ -388,7 +388,7 @@ void FlightControllerTopic::setFriction(bool all) const { void FlightControllerTopic::setFriction(bool roll, bool rotation, bool zoom) const { const interaction::OrbitalNavigator& navigator = - global::navigationHandler.orbitalNavigator(); + global::navigationHandler->orbitalNavigator(); navigator.property(RollFriction)->set(roll); navigator.property(RotationalFriction)->set(rotation); @@ -476,7 +476,7 @@ void FlightControllerTopic::processInputState(const nlohmann::json& json) { void FlightControllerTopic::processLua(const nlohmann::json &json) { const std::string script = json[LuaScript]; - global::scriptEngine.queueScript( + global::scriptEngine->queueScript( script, openspace::scripting::ScriptEngine::RemoteScripting::Yes ); diff --git a/modules/server/src/topics/getpropertytopic.cpp b/modules/server/src/topics/getpropertytopic.cpp index d2669cc143..4c5cab7aec 100644 --- a/modules/server/src/topics/getpropertytopic.cpp +++ b/modules/server/src/topics/getpropertytopic.cpp @@ -64,7 +64,7 @@ void GetPropertyTopic::handleJson(const nlohmann::json& json) { } else if (requestedKey == AllScreenSpaceRenderablesValue) { response = wrappedPayload({ - { "value", global::renderEngine.screenSpaceRenderables() } + { "value", global::renderEngine->screenSpaceRenderables() } }); } else if (requestedKey == RootPropertyOwner) { diff --git a/modules/server/src/topics/luascripttopic.cpp b/modules/server/src/topics/luascripttopic.cpp index e340ccbbea..b059f15a51 100644 --- a/modules/server/src/topics/luascripttopic.cpp +++ b/modules/server/src/topics/luascripttopic.cpp @@ -190,7 +190,7 @@ void LuaScriptTopic::runScript(const std::string& script, bool shouldReturn) { _waitingForReturnValue = false; } - global::scriptEngine.queueScript( + global::scriptEngine->queueScript( std::move(script), scripting::ScriptEngine::RemoteScripting::No, callback diff --git a/modules/server/src/topics/sessionrecordingtopic.cpp b/modules/server/src/topics/sessionrecordingtopic.cpp index eeb6e32b79..e16cda6d3f 100644 --- a/modules/server/src/topics/sessionrecordingtopic.cpp +++ b/modules/server/src/topics/sessionrecordingtopic.cpp @@ -51,7 +51,7 @@ SessionRecordingTopic::SessionRecordingTopic() { SessionRecordingTopic::~SessionRecordingTopic() { if (_stateCallbackHandle != UnsetOnChangeHandle) { - global::sessionRecording.removeStateChangeCallback(_stateCallbackHandle); + global::sessionRecording->removeStateChangeCallback(_stateCallbackHandle); } } @@ -98,10 +98,10 @@ void SessionRecordingTopic::handleJson(const nlohmann::json& json) { sendJsonData(); if (event == SubscribeEvent && _sendState) { - _stateCallbackHandle = global::sessionRecording.addStateChangeCallback( + _stateCallbackHandle = global::sessionRecording->addStateChangeCallback( [this]() { interaction::SessionRecording::SessionState currentState = - global::sessionRecording.state(); + global::sessionRecording->state(); if (currentState != _lastState) { sendJsonData(); _lastState = currentState; @@ -115,7 +115,7 @@ void SessionRecordingTopic::sendJsonData() { json stateJson; using SessionRecording = openspace::interaction::SessionRecording; if (_sendState) { - SessionRecording::SessionState state = global::sessionRecording.state(); + SessionRecording::SessionState state = global::sessionRecording->state(); std::string stateString; switch (state) { case SessionRecording::SessionState::Recording: @@ -131,7 +131,7 @@ void SessionRecordingTopic::sendJsonData() { stateJson[StateKey] = stateString; }; if (_sendFiles) { - stateJson[FilesKey] = global::sessionRecording.playbackList(); + stateJson[FilesKey] = global::sessionRecording->playbackList(); } if (!stateJson.empty()) { _connection->sendJson(wrappedPayload(stateJson)); diff --git a/modules/server/src/topics/setpropertytopic.cpp b/modules/server/src/topics/setpropertytopic.cpp index 76b05f1c37..a3cb994ab4 100644 --- a/modules/server/src/topics/setpropertytopic.cpp +++ b/modules/server/src/topics/setpropertytopic.cpp @@ -110,13 +110,13 @@ void SetPropertyTopic::handleJson(const nlohmann::json& json) { if (propertyKey == SpecialKeyTime) { Time newTime; newTime.setTime(json.at(ValueKey).get()); - global::timeManager.setTimeNextFrame(newTime); + global::timeManager->setTimeNextFrame(newTime); } else { nlohmann::json value = json.at(ValueKey); std::string literal = luaLiteralFromJson(value); - global::scriptEngine.queueScript( + global::scriptEngine->queueScript( fmt::format( "openspace.setPropertyValueSingle(\"{}\", {})", propertyKey, literal ), diff --git a/modules/server/src/topics/shortcuttopic.cpp b/modules/server/src/topics/shortcuttopic.cpp index 34376e0c69..b215054583 100644 --- a/modules/server/src/topics/shortcuttopic.cpp +++ b/modules/server/src/topics/shortcuttopic.cpp @@ -47,7 +47,7 @@ std::vector ShortcutTopic::shortcutsJson() const { using ShortcutInformation = interaction::ShortcutManager::ShortcutInformation; const std::vector& shortcuts = - global::shortcutManager.shortcuts(); + global::shortcutManager->shortcuts(); std::vector json; for (const ShortcutInformation& shortcut : shortcuts) { @@ -64,7 +64,7 @@ std::vector ShortcutTopic::shortcutsJson() const { using KeyInformation = interaction::KeybindingManager::KeyInformation; const std::multimap& keyBindings = - global::keybindingManager.keyBindings(); + global::keybindingManager->keyBindings(); for (const std::pair& keyBinding : keyBindings) { diff --git a/modules/server/src/topics/timetopic.cpp b/modules/server/src/topics/timetopic.cpp index 507f9b6904..57d61adb9b 100644 --- a/modules/server/src/topics/timetopic.cpp +++ b/modules/server/src/topics/timetopic.cpp @@ -48,13 +48,15 @@ TimeTopic::TimeTopic() TimeTopic::~TimeTopic() { if (_timeCallbackHandle != UnsetOnChangeHandle) { - global::timeManager.removeTimeChangeCallback(_timeCallbackHandle); + global::timeManager->removeTimeChangeCallback(_timeCallbackHandle); } if (_deltaTimeCallbackHandle != UnsetOnChangeHandle) { - global::timeManager.removeDeltaTimeChangeCallback(_deltaTimeCallbackHandle); + global::timeManager->removeDeltaTimeChangeCallback(_deltaTimeCallbackHandle); } if (_deltaTimeStepsCallbackHandle != UnsetOnChangeHandle) { - global::timeManager.removeDeltaTimeStepsChangeCallback(_deltaTimeStepsCallbackHandle); + global::timeManager->removeDeltaTimeStepsChangeCallback( + _deltaTimeStepsCallbackHandle + ); } } @@ -77,20 +79,20 @@ void TimeTopic::handleJson(const nlohmann::json& json) { return; } - _timeCallbackHandle = global::timeManager.addTimeChangeCallback([this]() { + _timeCallbackHandle = global::timeManager->addTimeChangeCallback([this]() { std::chrono::system_clock::time_point now = std::chrono::system_clock::now(); if (now - _lastUpdateTime > TimeUpdateInterval) { sendCurrentTime(); } }); - _deltaTimeCallbackHandle = global::timeManager.addDeltaTimeChangeCallback([this]() { + _deltaTimeCallbackHandle = global::timeManager->addDeltaTimeChangeCallback([this]() { // Throttle by last update, // but force update if pause state or target delta changes. std::chrono::system_clock::time_point now = std::chrono::system_clock::now(); - const double targetDeltaTime = global::timeManager.targetDeltaTime(); - const bool isPaused = global::timeManager.isPaused(); + const double targetDeltaTime = global::timeManager->targetDeltaTime(); + const bool isPaused = global::timeManager->isPaused(); const bool forceUpdate = isPaused != _lastPauseState || targetDeltaTime != _lastTargetDeltaTime; @@ -99,9 +101,9 @@ void TimeTopic::handleJson(const nlohmann::json& json) { } }); - _deltaTimeStepsCallbackHandle = global::timeManager.addDeltaTimeStepsChangeCallback( + _deltaTimeStepsCallbackHandle = global::timeManager->addDeltaTimeStepsChangeCallback( [this]() { - const std::vector steps = global::timeManager.deltaTimeSteps(); + const std::vector steps = global::timeManager->deltaTimeSteps(); if (steps != _lastDeltaTimeSteps) { sendDeltaTimeSteps(); } @@ -110,8 +112,8 @@ void TimeTopic::handleJson(const nlohmann::json& json) { } const json TimeTopic::getNextPrevDeltaTimeStepJson() { - const std::optional nextStep = global::timeManager.nextDeltaTimeStep(); - const std::optional prevStep = global::timeManager.previousDeltaTimeStep(); + const std::optional nextStep = global::timeManager->nextDeltaTimeStep(); + const std::optional prevStep = global::timeManager->previousDeltaTimeStep(); const bool hasNext = nextStep.has_value(); const bool hasPrev = prevStep.has_value(); @@ -135,7 +137,7 @@ void TimeTopic::sendCurrentTime() { ZoneScoped const json timeJson = { - { "time", global::timeManager.time().ISO8601() } + { "time", global::timeManager->time().ISO8601() } }; const json payload = wrappedPayload(timeJson); _connection->sendJson(payload); @@ -143,10 +145,10 @@ void TimeTopic::sendCurrentTime() { } void TimeTopic::sendFullTimeData() { - std::string_view currentTime = global::timeManager.time().ISO8601(); - const double deltaTime = global::timeManager.deltaTime(); - const double targetDeltaTime = global::timeManager.targetDeltaTime(); - const bool isPaused = global::timeManager.isPaused(); + std::string_view currentTime = global::timeManager->time().ISO8601(); + const double deltaTime = global::timeManager->deltaTime(); + const double targetDeltaTime = global::timeManager->targetDeltaTime(); + const bool isPaused = global::timeManager->isPaused(); json timeJson = { { "time", currentTime }, @@ -165,7 +167,7 @@ void TimeTopic::sendFullTimeData() { } void TimeTopic::sendDeltaTimeSteps() { - const std::vector& steps = global::timeManager.deltaTimeSteps(); + const std::vector& steps = global::timeManager->deltaTimeSteps(); json deltaTimeStepsJson = { { "deltaTimeSteps", steps } diff --git a/modules/server/src/topics/triggerpropertytopic.cpp b/modules/server/src/topics/triggerpropertytopic.cpp index 8310e9346b..c489abbf5a 100644 --- a/modules/server/src/topics/triggerpropertytopic.cpp +++ b/modules/server/src/topics/triggerpropertytopic.cpp @@ -42,7 +42,7 @@ namespace openspace { void TriggerPropertyTopic::handleJson(const nlohmann::json& json) { try { const std::string& propertyKey = json.at(PropertyKey).get(); - global::scriptEngine.queueScript( + global::scriptEngine->queueScript( fmt::format( "openspace.setPropertyValueSingle(\"{}\", nil)", propertyKey ), diff --git a/modules/server/src/topics/versiontopic.cpp b/modules/server/src/topics/versiontopic.cpp index 033de54683..6dea1c8d5b 100644 --- a/modules/server/src/topics/versiontopic.cpp +++ b/modules/server/src/topics/versiontopic.cpp @@ -56,9 +56,9 @@ void VersionTopic::handleJson(const nlohmann::json&) { } }; - if (global::versionChecker.hasLatestVersionInfo()) { + if (global::versionChecker->hasLatestVersionInfo()) { VersionChecker::SemanticVersion latestVersion = - global::versionChecker.latestVersion(); + global::versionChecker->latestVersion(); versionJson["latestOpenSpaceVersion"] = { { "major", latestVersion.major }, diff --git a/modules/space/rendering/renderableconstellationbounds.cpp b/modules/space/rendering/renderableconstellationbounds.cpp index ed1b59373a..4e2ca10e91 100644 --- a/modules/space/rendering/renderableconstellationbounds.cpp +++ b/modules/space/rendering/renderableconstellationbounds.cpp @@ -205,7 +205,7 @@ RenderableConstellationBounds::RenderableConstellationBounds( } void RenderableConstellationBounds::initializeGL() { - _program = global::renderEngine.buildRenderProgram( + _program = global::renderEngine->buildRenderProgram( "ConstellationBounds", absPath("${MODULE_SPACE}/shaders/constellationbounds_vs.glsl"), absPath("${MODULE_SPACE}/shaders/constellationbounds_fs.glsl") @@ -237,7 +237,7 @@ void RenderableConstellationBounds::deinitializeGL() { _vao = 0; if (_program) { - global::renderEngine.removeRenderProgram(_program.get()); + global::renderEngine->removeRenderProgram(_program.get()); _program = nullptr; } } diff --git a/modules/space/rendering/renderableorbitalkepler.cpp b/modules/space/rendering/renderableorbitalkepler.cpp index 5e902942d2..0afe86fc94 100644 --- a/modules/space/rendering/renderableorbitalkepler.cpp +++ b/modules/space/rendering/renderableorbitalkepler.cpp @@ -432,7 +432,7 @@ void RenderableOrbitalKepler::initializeGL() { _programObject = SpaceModule::ProgramObjectManager.request( ProgramName, []() -> std::unique_ptr { - return global::renderEngine.buildRenderProgram( + return global::renderEngine->buildRenderProgram( ProgramName, absPath("${MODULE_SPACE}/shaders/debrisViz_vs.glsl"), absPath("${MODULE_SPACE}/shaders/debrisViz_fs.glsl") @@ -457,7 +457,7 @@ void RenderableOrbitalKepler::deinitializeGL() { SpaceModule::ProgramObjectManager.release( ProgramName, [](ghoul::opengl::ProgramObject* p) { - global::renderEngine.removeRenderProgram(p); + global::renderEngine->removeRenderProgram(p); } ); _programObject = nullptr; diff --git a/modules/space/rendering/renderablerings.cpp b/modules/space/rendering/renderablerings.cpp index 1291ccbe4d..4e882de4a0 100644 --- a/modules/space/rendering/renderablerings.cpp +++ b/modules/space/rendering/renderablerings.cpp @@ -182,7 +182,7 @@ bool RenderableRings::isReady() const { } void RenderableRings::initializeGL() { - _shader = global::renderEngine.buildRenderProgram( + _shader = global::renderEngine->buildRenderProgram( "RingProgram", absPath("${MODULE_SPACE}/shaders/rings_vs.glsl"), absPath("${MODULE_SPACE}/shaders/rings_fs.glsl") @@ -207,7 +207,7 @@ void RenderableRings::deinitializeGL() { _textureFile = nullptr; _texture = nullptr; - global::renderEngine.removeRenderProgram(_shader.get()); + global::renderEngine->removeRenderProgram(_shader.get()); _shader = nullptr; } @@ -261,7 +261,7 @@ void RenderableRings::update(const UpdateData& data) { _textureIsDirty = false; } - _sunPosition = global::renderEngine.scene()->sceneGraphNode("Sun")->worldPosition() - + _sunPosition = global::renderEngine->scene()->sceneGraphNode("Sun")->worldPosition() - data.modelTransform.translation; } diff --git a/modules/space/rendering/renderablestars.cpp b/modules/space/rendering/renderablestars.cpp index d39e55b22b..e51bfefd51 100644 --- a/modules/space/rendering/renderablestars.cpp +++ b/modules/space/rendering/renderablestars.cpp @@ -693,7 +693,7 @@ bool RenderableStars::isReady() const { } void RenderableStars::initializeGL() { - _program = global::renderEngine.buildRenderProgram( + _program = global::renderEngine->buildRenderProgram( "Star", absPath("${MODULE_SPACE}/shaders/star_vs.glsl"), absPath("${MODULE_SPACE}/shaders/star_fs.glsl"), @@ -803,7 +803,7 @@ void RenderableStars::deinitializeGL() { //_shapeTexture = nullptr; if (_program) { - global::renderEngine.removeRenderProgram(_program.get()); + global::renderEngine->removeRenderProgram(_program.get()); _program = nullptr; } } @@ -916,7 +916,7 @@ void RenderableStars::renderPSFToTexture() { //glDeleteFramebuffers(1, &convolveFBO); // Restores OpenGL blending state - global::renderEngine.openglStateCache().resetBlendState(); + global::renderEngine->openglStateCache().resetBlendState(); } void RenderableStars::render(const RenderData& data, RendererTasks&) { diff --git a/modules/spacecraftinstruments/dashboard/dashboarditeminstruments.cpp b/modules/spacecraftinstruments/dashboard/dashboarditeminstruments.cpp index 02831af39a..e3a8f2d171 100644 --- a/modules/spacecraftinstruments/dashboard/dashboarditeminstruments.cpp +++ b/modules/spacecraftinstruments/dashboard/dashboarditeminstruments.cpp @@ -145,7 +145,7 @@ DashboardItemInstruments::DashboardItemInstruments(const ghoul::Dictionary& dict glm::vec3(0.f), glm::vec3(1.f) ) - , _font(global::fontManager.font(KeyFontMono, 10)) + , _font(global::fontManager->font(KeyFontMono, 10)) { documentation::testSpecificationAndThrow( Documentation(), @@ -161,12 +161,12 @@ DashboardItemInstruments::DashboardItemInstruments(const ghoul::Dictionary& dict } _fontName.onChange([this]() { - _font = global::fontManager.font(_fontName, _fontSize); + _font = global::fontManager->font(_fontName, _fontSize); }); addProperty(_fontName); _fontSize.onChange([this]() { - _font = global::fontManager.font(_fontName, _fontSize); + _font = global::fontManager->font(_fontName, _fontSize); }); addProperty(_fontSize); @@ -175,13 +175,13 @@ DashboardItemInstruments::DashboardItemInstruments(const ghoul::Dictionary& dict _activeFlash.setViewOption(properties::Property::ViewOptions::Color); addProperty(_activeFlash); - _font = global::fontManager.font(_fontName, _fontSize); + _font = global::fontManager->font(_fontName, _fontSize); } void DashboardItemInstruments::render(glm::vec2& penPosition) { ZoneScoped - double currentTime = global::timeManager.time().j2000Seconds(); + double currentTime = global::timeManager->time().j2000Seconds(); if (!ImageSequencer::ref().isReady()) { return; @@ -231,7 +231,7 @@ void DashboardItemInstruments::render(glm::vec2& penPosition) { ); std::string str = SpiceManager::ref().dateFromEphemerisTime( - sequencer.nextCaptureTime(global::timeManager.time().j2000Seconds()), + sequencer.nextCaptureTime(global::timeManager->time().j2000Seconds()), "YYYY MON DD HR:MN:SC" ); @@ -315,7 +315,7 @@ void DashboardItemInstruments::render(glm::vec2& penPosition) { glm::vec2 DashboardItemInstruments::size() const { glm::vec2 size = glm::vec2(0.f); //return ghoul::fontrendering::FontRenderer::defaultRenderer().boundingBox( - double currentTime = global::timeManager.time().j2000Seconds(); + double currentTime = global::timeManager->time().j2000Seconds(); if (!ImageSequencer::ref().isReady()) { return glm::vec2(0.f); diff --git a/modules/spacecraftinstruments/rendering/renderablecrawlingline.cpp b/modules/spacecraftinstruments/rendering/renderablecrawlingline.cpp index 2ba4d88f6c..425538476a 100644 --- a/modules/spacecraftinstruments/rendering/renderablecrawlingline.cpp +++ b/modules/spacecraftinstruments/rendering/renderablecrawlingline.cpp @@ -133,7 +133,7 @@ bool RenderableCrawlingLine::isReady() const { } void RenderableCrawlingLine::initializeGL() { - _program = global::renderEngine.buildRenderProgram( + _program = global::renderEngine->buildRenderProgram( "RenderableCrawlingLine", absPath("${MODULE_SPACECRAFTINSTRUMENTS}/shaders/crawlingline_vs.glsl"), absPath("${MODULE_SPACECRAFTINSTRUMENTS}/shaders/crawlingline_fs.glsl") @@ -169,7 +169,7 @@ void RenderableCrawlingLine::deinitializeGL() { _vbo = 0; if (_program) { - global::renderEngine.removeRenderProgram(_program.get()); + global::renderEngine->removeRenderProgram(_program.get()); _program = nullptr; } } diff --git a/modules/spacecraftinstruments/rendering/renderablefov.cpp b/modules/spacecraftinstruments/rendering/renderablefov.cpp index 9da17a57b1..a8ea7682e0 100644 --- a/modules/spacecraftinstruments/rendering/renderablefov.cpp +++ b/modules/spacecraftinstruments/rendering/renderablefov.cpp @@ -329,7 +329,7 @@ RenderableFov::RenderableFov(const ghoul::Dictionary& dictionary) if (dictionary.hasKey(KeyFrameConversions)) { ghoul::Dictionary fc = dictionary.value(KeyFrameConversions); for (const std::string& key : fc.keys()) { - global::moduleEngine.module()->addFrame( + global::moduleEngine->module()->addFrame( key, fc.value(key) ); @@ -370,7 +370,7 @@ void RenderableFov::initializeGL() { SpacecraftInstrumentsModule::ProgramObjectManager.request( ProgramName, []() -> std::unique_ptr { - return global::renderEngine.buildRenderProgram( + return global::renderEngine->buildRenderProgram( ProgramName, absPath("${MODULE_SPACECRAFTINSTRUMENTS}/shaders/fov_vs.glsl"), absPath("${MODULE_SPACECRAFTINSTRUMENTS}/shaders/fov_fs.glsl") @@ -518,7 +518,7 @@ void RenderableFov::deinitializeGL() { SpacecraftInstrumentsModule::ProgramObjectManager.release( ProgramName, [](ghoul::opengl::ProgramObject* p) { - global::renderEngine.removeRenderProgram(p); + global::renderEngine->removeRenderProgram(p); } ); _program = nullptr; @@ -562,10 +562,10 @@ void RenderableFov::computeIntercepts(const UpdateData& data, const std::string& { const bool convert = (ref.find("IAU_") == std::string::npos); if (convert) { + SpacecraftInstrumentsModule* m = + global::moduleEngine->module(); return { - global::moduleEngine.module()->frameFromBody( - target - ), + m->frameFromBody(target), true }; } @@ -960,7 +960,9 @@ std::pair RenderableFov::determineTarget(double time) { bool inFOV = SpiceManager::ref().isTargetInFieldOfView( pt, _instrument.spacecraft, - global::moduleEngine.module()->frameFromBody(pt), + global::moduleEngine->module()->frameFromBody( + pt + ), _instrument.name, SpiceManager::FieldOfViewMethod::Ellipsoid, _instrument.aberrationCorrection, diff --git a/modules/spacecraftinstruments/rendering/renderablemodelprojection.cpp b/modules/spacecraftinstruments/rendering/renderablemodelprojection.cpp index 083bd06bc4..8d5c76a77e 100644 --- a/modules/spacecraftinstruments/rendering/renderablemodelprojection.cpp +++ b/modules/spacecraftinstruments/rendering/renderablemodelprojection.cpp @@ -157,7 +157,7 @@ bool RenderableModelProjection::isReady() const { } void RenderableModelProjection::initializeGL() { - _programObject = global::renderEngine.buildRenderProgram( + _programObject = global::renderEngine->buildRenderProgram( "ModelShader", absPath("${MODULE_SPACECRAFTINSTRUMENTS}/shaders/renderableModel_vs.glsl"), absPath("${MODULE_SPACECRAFTINSTRUMENTS}/shaders/renderableModel_fs.glsl") @@ -213,7 +213,7 @@ void RenderableModelProjection::deinitializeGL() { _projectionComponent.deinitialize(); - global::renderEngine.removeRenderProgram(_programObject.get()); + global::renderEngine->removeRenderProgram(_programObject.get()); _programObject = nullptr; } @@ -347,9 +347,8 @@ void RenderableModelProjection::update(const UpdateData& data) { } } - // @TODO: Change this to remove PSC glm::dvec3 p = - global::renderEngine.scene()->sceneGraphNode("Sun")->worldPosition() - + global::renderEngine->scene()->sceneGraphNode("Sun")->worldPosition() - data.modelTransform.translation; _sunPosition = static_cast(p); diff --git a/modules/spacecraftinstruments/rendering/renderableplaneprojection.cpp b/modules/spacecraftinstruments/rendering/renderableplaneprojection.cpp index 45882270f9..29e1768614 100644 --- a/modules/spacecraftinstruments/rendering/renderableplaneprojection.cpp +++ b/modules/spacecraftinstruments/rendering/renderableplaneprojection.cpp @@ -80,7 +80,7 @@ void RenderablePlaneProjection::initializeGL() { glGenVertexArrays(1, &_quad); glGenBuffers(1, &_vertexPositionBuffer); - _shader = global::renderEngine.buildRenderProgram( + _shader = global::renderEngine->buildRenderProgram( "Image Plane", absPath("${MODULE_BASE}/shaders/imageplane_vs.glsl"), absPath("${MODULE_BASE}/shaders/imageplane_fs.glsl") @@ -92,7 +92,7 @@ void RenderablePlaneProjection::initializeGL() { void RenderablePlaneProjection::deinitializeGL() { if (_shader) { - global::renderEngine.removeRenderProgram(_shader.get()); + global::renderEngine->removeRenderProgram(_shader.get()); _shader = nullptr; } @@ -253,8 +253,8 @@ void RenderablePlaneProjection::updatePlane(const Image& img, double currentTime } if (!_moving) { - SceneGraphNode* thisNode = global::renderEngine.scene()->sceneGraphNode(_name); - SceneGraphNode* newParent = global::renderEngine.scene()->sceneGraphNode( + SceneGraphNode* thisNode = global::renderEngine->scene()->sceneGraphNode(_name); + SceneGraphNode* newParent = global::renderEngine->scene()->sceneGraphNode( _target.node ); if (thisNode && newParent) { @@ -313,7 +313,7 @@ void RenderablePlaneProjection::setTarget(std::string body) { } _target.frame = - global::moduleEngine.module()->frameFromBody(body); + global::moduleEngine->module()->frameFromBody(body); _target.body = std::move(body); } diff --git a/modules/spacecraftinstruments/rendering/renderableplanetprojection.cpp b/modules/spacecraftinstruments/rendering/renderableplanetprojection.cpp index 238ad1cd11..e7adc0985c 100644 --- a/modules/spacecraftinstruments/rendering/renderableplanetprojection.cpp +++ b/modules/spacecraftinstruments/rendering/renderableplanetprojection.cpp @@ -360,7 +360,7 @@ void RenderablePlanetProjection::initializeGL() { SpacecraftInstrumentsModule::ProgramObjectManager.request( ProjectiveProgramName, []() -> std::unique_ptr { - return global::renderEngine.buildRenderProgram( + return global::renderEngine->buildRenderProgram( ProjectiveProgramName, absPath("${MODULE_SPACECRAFTINSTRUMENTS}/shaders/" "renderablePlanet_vs.glsl" @@ -450,7 +450,7 @@ void RenderablePlanetProjection::deinitializeGL() { SpacecraftInstrumentsModule::ProgramObjectManager.release( ProjectiveProgramName, [](ghoul::opengl::ProgramObject* p) { - global::renderEngine.removeRenderProgram(p); + global::renderEngine->removeRenderProgram(p); } ); _programObject = nullptr; diff --git a/modules/spacecraftinstruments/rendering/renderableshadowcylinder.cpp b/modules/spacecraftinstruments/rendering/renderableshadowcylinder.cpp index df97458c92..76e3159a78 100644 --- a/modules/spacecraftinstruments/rendering/renderableshadowcylinder.cpp +++ b/modules/spacecraftinstruments/rendering/renderableshadowcylinder.cpp @@ -269,7 +269,7 @@ void RenderableShadowCylinder::initializeGL() { _shader = SpacecraftInstrumentsModule::ProgramObjectManager.request( ProgramName, []() -> std::unique_ptr { - return global::renderEngine.buildRenderProgram( + return global::renderEngine->buildRenderProgram( ProgramName, absPath( "${MODULE_SPACECRAFTINSTRUMENTS}/shaders/terminatorshadow_vs.glsl" @@ -288,7 +288,7 @@ void RenderableShadowCylinder::deinitializeGL() { SpacecraftInstrumentsModule::ProgramObjectManager.release( ProgramName, [](ghoul::opengl::ProgramObject* p) { - global::renderEngine.removeRenderProgram(p); + global::renderEngine->removeRenderProgram(p); } ); _shader = nullptr; diff --git a/modules/sync/tasks/syncassettask.cpp b/modules/sync/tasks/syncassettask.cpp index 5ea8a551b1..5b69d7df55 100644 --- a/modules/sync/tasks/syncassettask.cpp +++ b/modules/sync/tasks/syncassettask.cpp @@ -94,7 +94,7 @@ void SyncAssetTask::perform(const Task::ProgressCallback& progressCallback) { registerCoreClasses(scriptEngine); - for (OpenSpaceModule* m : global::moduleEngine.modules()) { + for (OpenSpaceModule* m : global::moduleEngine->modules()) { scriptEngine.addLibrary(m->luaLibrary()); for (scripting::LuaLibrary& l : m->luaLibraries()) { diff --git a/modules/touch/src/touchinteraction.cpp b/modules/touch/src/touchinteraction.cpp index c31ac046ea..2d0a8b0802 100644 --- a/modules/touch/src/touchinteraction.cpp +++ b/modules/touch/src/touchinteraction.cpp @@ -376,7 +376,7 @@ void TouchInteraction::updateStateFromInput(const std::vector& _time = timestamp; } // Code for lower-right corner double-tap to zoom-out - const glm::vec2 res = global::windowDelegate.currentWindowSize(); + const glm::vec2 res = global::windowDelegate->currentWindowSize(); const glm::vec2 pos = list[0].latestInput().screenCoordinates(res); const float bottomCornerSizeForZoomTap_fraction = 0.08f; @@ -482,7 +482,7 @@ void TouchInteraction::findSelectedNode(const std::vector& lis "Kerberos", "Hydra", "Charon", "Tethys", "OsirisRex", "Bennu" }; std::vector selectableNodes; - for (SceneGraphNode* node : global::renderEngine.scene()->allSceneGraphNodes()) { + for (SceneGraphNode* node : global::renderEngine->scene()->allSceneGraphNodes()) { for (const std::string& name : selectables) { if (node->identifier() == name) { selectableNodes.push_back(node); @@ -755,7 +755,7 @@ void TouchInteraction::computeVelocities(const std::vector& li { const int action = interpretInteraction(list, lastProcessed); const SceneGraphNode* anchor = - global::navigationHandler.orbitalNavigator().anchorNode(); + global::navigationHandler->orbitalNavigator().anchorNode(); if (!anchor) { return; } @@ -784,7 +784,7 @@ void TouchInteraction::computeVelocities(const std::vector& li #endif const TouchInputHolder& inputHolder = list.at(0); - const glm::ivec2 windowSize = global::windowDelegate.currentWindowSize(); + const glm::ivec2 windowSize = global::windowDelegate->currentWindowSize(); const float aspectRatio = static_cast(windowSize.x) / static_cast(windowSize.y); switch (action) { @@ -917,14 +917,14 @@ double TouchInteraction::computeConstTimeDecayCoefficient(double velocity) { double TouchInteraction::computeTapZoomDistance(double zoomGain) { const SceneGraphNode* anchor = - global::navigationHandler.orbitalNavigator().anchorNode(); + global::navigationHandler->orbitalNavigator().anchorNode(); if (!anchor) { return 0.0; } double dist = glm::distance( _camera->positionVec3(), - global::navigationHandler.orbitalNavigator().anchorNode()->worldPosition() + global::navigationHandler->orbitalNavigator().anchorNode()->worldPosition() ); dist -= anchor->boundingSphere(); @@ -942,11 +942,11 @@ void TouchInteraction::step(double dt, bool directTouch) { using namespace glm; const SceneGraphNode* anchor = - global::navigationHandler.orbitalNavigator().anchorNode(); + global::navigationHandler->orbitalNavigator().anchorNode(); // since functions cant be called directly (TouchInteraction not a subclass of // InteractionMode) - setFocusNode(global::navigationHandler.orbitalNavigator().anchorNode()); + setFocusNode(global::navigationHandler->orbitalNavigator().anchorNode()); if (anchor && _camera) { // Create variables from current state dvec3 camPos = _camera->positionVec3(); @@ -1167,7 +1167,7 @@ void TouchInteraction::resetAfterInput() { _debugProperties.interactionMode = "None"; #endif if (_directTouchMode && !_selected.empty() && _lmSuccess) { - double spinDelta = _spinSensitivity / global::windowDelegate.averageDeltaTime(); + double spinDelta = _spinSensitivity / global::windowDelegate->averageDeltaTime(); if (glm::length(_lastVel.orbit) > _orbitSpeedThreshold) { // allow node to start "spinning" after direct-manipulation finger is let go _vel.orbit = _lastVel.orbit * spinDelta; @@ -1225,19 +1225,19 @@ Camera* TouchInteraction::getCamera() { } const SceneGraphNode* TouchInteraction::getFocusNode() { - return global::navigationHandler.orbitalNavigator().anchorNode(); + return global::navigationHandler->orbitalNavigator().anchorNode(); } void TouchInteraction::setCamera(Camera* camera) { _camera = camera; } void TouchInteraction::setFocusNode(const SceneGraphNode* focusNode) { if (focusNode) { - global::navigationHandler.orbitalNavigator().setAnchorNode( + global::navigationHandler->orbitalNavigator().setAnchorNode( focusNode->identifier() ); } else { - global::navigationHandler.orbitalNavigator().setAnchorNode(""); + global::navigationHandler->orbitalNavigator().setAnchorNode(""); } } diff --git a/modules/touch/src/touchmarker.cpp b/modules/touch/src/touchmarker.cpp index 8abd11e7e8..6ff732fb40 100644 --- a/modules/touch/src/touchmarker.cpp +++ b/modules/touch/src/touchmarker.cpp @@ -89,7 +89,7 @@ void TouchMarker::initialize() { glGenVertexArrays(1, &_quad); // generate array glGenBuffers(1, &_vertexPositionBuffer); // generate buffer - _shader = global::renderEngine.buildRenderProgram( + _shader = global::renderEngine->buildRenderProgram( "MarkerProgram", absPath("${MODULE_TOUCH}/shaders/marker_vs.glsl"), absPath("${MODULE_TOUCH}/shaders/marker_fs.glsl") @@ -106,7 +106,7 @@ void TouchMarker::deinitialize() { _vertexPositionBuffer = 0; if (_shader) { - global::renderEngine.removeRenderProgram(_shader.get()); + global::renderEngine->removeRenderProgram(_shader.get()); _shader = nullptr; } } diff --git a/modules/touch/src/win32_touch.cpp b/modules/touch/src/win32_touch.cpp index 7ac553205b..3e1640af86 100644 --- a/modules/touch/src/win32_touch.cpp +++ b/modules/touch/src/win32_touch.cpp @@ -121,7 +121,7 @@ LRESULT CALLBACK HookCallback(int nCode, WPARAM wParam, LPARAM lParam) { std::unique_ptr points = std::make_unique(touchInput); gTouchInputsMap.emplace(info.pointerId, std::move(points)); - global::openSpaceEngine.touchDetectionCallback(touchInput); + global::openSpaceEngine->touchDetectionCallback(touchInput); #endif #ifdef ENABLE_TUIOMESSAGES // Handle new touchpoint @@ -139,7 +139,7 @@ LRESULT CALLBACK HookCallback(int nCode, WPARAM wParam, LPARAM lParam) { TouchInputHolder* points = gTouchInputsMap[info.pointerId].get(); if (points->tryAddInput(touchInput)) { - global::openSpaceEngine.touchUpdateCallback(points->latestInput()); + global::openSpaceEngine->touchUpdateCallback(points->latestInput()); } #endif #ifdef ENABLE_TUIOMESSAGES @@ -155,7 +155,7 @@ LRESULT CALLBACK HookCallback(int nCode, WPARAM wParam, LPARAM lParam) { else if (info.pointerFlags & POINTER_FLAG_UP) { #ifdef ENABLE_DIRECTMSG gTouchInputsMap.erase(info.pointerId); - global::openSpaceEngine.touchExitCallback(touchInput); + global::openSpaceEngine->touchExitCallback(touchInput); #endif #ifdef ENABLE_TUIOMESSAGES // Handle removed touchpoint diff --git a/modules/touch/touchmodule.cpp b/modules/touch/touchmodule.cpp index 1672b2cf42..dc80b46fac 100644 --- a/modules/touch/touchmodule.cpp +++ b/modules/touch/touchmodule.cpp @@ -67,7 +67,7 @@ bool TouchModule::processNewInput() { _touch.touchActive(!_touchPoints.empty()); if (!_touchPoints.empty()) { - global::interactionMonitor.markInteraction(); + global::interactionMonitor->markInteraction(); } // Erase old input id's that no longer exists @@ -197,7 +197,7 @@ void TouchModule::internalInitialize(const ghoul::Dictionary& /*dictionary*/){ #ifdef WIN32 // We currently only support one window of touch input internally // so here we grab the first window-handle and use it. - void* nativeWindowHandle = global::windowDelegate.getNativeWindowHandle(0); + void* nativeWindowHandle = global::windowDelegate->getNativeWindowHandle(0); if (nativeWindowHandle) { _win32TouchHook = std::make_unique(nativeWindowHandle); } @@ -231,10 +231,10 @@ void TouchModule::internalInitialize(const ghoul::Dictionary& /*dictionary*/){ global::callback::preSync.push_back([&]() { - _touch.setCamera(global::navigationHandler.camera()); - _touch.setFocusNode(global::navigationHandler.orbitalNavigator().anchorNode()); + _touch.setCamera(global::navigationHandler->camera()); + _touch.setFocusNode(global::navigationHandler->orbitalNavigator().anchorNode()); - if (processNewInput() && global::windowDelegate.isMaster() && _touchActive) { + if (processNewInput() && global::windowDelegate->isMaster() && _touchActive) { _touch.updateStateFromInput(_touchPoints, _lastTouchInputs); } else if (_touchPoints.empty()) { @@ -247,7 +247,7 @@ void TouchModule::internalInitialize(const ghoul::Dictionary& /*dictionary*/){ _lastTouchInputs.emplace_back(points.latestInput()); } // calculate the new camera state for this frame - _touch.step(global::windowDelegate.deltaTime()); + _touch.step(global::windowDelegate->deltaTime()); clearInputs(); }); diff --git a/modules/toyvolume/rendering/renderabletoyvolume.cpp b/modules/toyvolume/rendering/renderabletoyvolume.cpp index 7a3d3b9479..be0ce3d6b4 100644 --- a/modules/toyvolume/rendering/renderabletoyvolume.cpp +++ b/modules/toyvolume/rendering/renderabletoyvolume.cpp @@ -145,14 +145,14 @@ void RenderableToyVolume::initializeGL() { _raycaster = std::make_unique(color); _raycaster->initialize(); - global::raycasterManager.attachRaycaster(*_raycaster.get()); + global::raycasterManager->attachRaycaster(*_raycaster.get()); std::function onChange = [&](bool enabled) { if (enabled) { - global::raycasterManager.attachRaycaster(*_raycaster.get()); + global::raycasterManager->attachRaycaster(*_raycaster.get()); } else { - global::raycasterManager.detachRaycaster(*_raycaster.get()); + global::raycasterManager->detachRaycaster(*_raycaster.get()); } }; @@ -170,7 +170,7 @@ void RenderableToyVolume::initializeGL() { void RenderableToyVolume::deinitializeGL() { if (_raycaster) { - global::raycasterManager.detachRaycaster(*_raycaster.get()); + global::raycasterManager->detachRaycaster(*_raycaster.get()); _raycaster = nullptr; } } diff --git a/modules/vislab/rendering/renderabledistancelabel.cpp b/modules/vislab/rendering/renderabledistancelabel.cpp index db6d3c0cef..4936e7dcc8 100644 --- a/modules/vislab/rendering/renderabledistancelabel.cpp +++ b/modules/vislab/rendering/renderabledistancelabel.cpp @@ -122,7 +122,7 @@ void RenderableDistanceLabel::update(const UpdateData&) { return; } - RenderEngine& RE = global::renderEngine; + RenderEngine& RE = *global::renderEngine; SceneGraphNode* nodelineNode = RE.scene()->sceneGraphNode(_nodelineId); if (nodelineNode) { diff --git a/modules/volume/rendering/renderabletimevaryingvolume.cpp b/modules/volume/rendering/renderabletimevaryingvolume.cpp index 0cad00ee51..61eac27267 100644 --- a/modules/volume/rendering/renderabletimevaryingvolume.cpp +++ b/modules/volume/rendering/renderabletimevaryingvolume.cpp @@ -298,13 +298,13 @@ void RenderableTimeVaryingVolume::initializeGL() { ); _raycaster->initialize(); - global::raycasterManager.attachRaycaster(*_raycaster.get()); + global::raycasterManager->attachRaycaster(*_raycaster.get()); onEnabledChange([&](bool enabled) { if (enabled) { - global::raycasterManager.attachRaycaster(*_raycaster.get()); + global::raycasterManager->attachRaycaster(*_raycaster.get()); } else { - global::raycasterManager.detachRaycaster(*_raycaster.get()); + global::raycasterManager->detachRaycaster(*_raycaster.get()); } }); @@ -366,7 +366,7 @@ RenderableTimeVaryingVolume::Timestep* RenderableTimeVaryingVolume::currentTimes if (_volumeTimesteps.empty()) { return nullptr; } - double currentTime = global::timeManager.time().j2000Seconds(); + double currentTime = global::timeManager->time().j2000Seconds(); // Get the first item with time > currentTime auto currentTimestepIt = _volumeTimesteps.upper_bound(currentTime); @@ -427,7 +427,7 @@ RenderableTimeVaryingVolume::Timestep* RenderableTimeVaryingVolume::timestepFrom void RenderableTimeVaryingVolume::jumpToTimestep(int target) { Timestep* t = timestepFromIndex(target); if (t) { - global::timeManager.setTimeNextFrame(Time(t->metadata.time)); + global::timeManager->setTimeNextFrame(Time(t->metadata.time)); } } @@ -487,7 +487,7 @@ bool RenderableTimeVaryingVolume::isReady() const { void RenderableTimeVaryingVolume::deinitializeGL() { if (_raycaster) { - global::raycasterManager.detachRaycaster(*_raycaster.get()); + global::raycasterManager->detachRaycaster(*_raycaster.get()); _raycaster = nullptr; } } diff --git a/modules/webbrowser/src/browserinstance.cpp b/modules/webbrowser/src/browserinstance.cpp index 14eaaef9b0..6899eb8e3f 100644 --- a/modules/webbrowser/src/browserinstance.cpp +++ b/modules/webbrowser/src/browserinstance.cpp @@ -75,8 +75,8 @@ BrowserInstance::~BrowserInstance() { void BrowserInstance::initialize() { reshape(static_cast( - static_cast(global::windowDelegate.currentSubwindowSize()) * - global::windowDelegate.dpiScaling() + static_cast(global::windowDelegate->currentSubwindowSize()) * + global::windowDelegate->dpiScaling() )); _isInitialized = true; _shouldReshape = true; @@ -170,7 +170,7 @@ bool BrowserInstance::sendMouseWheelEvent(const CefMouseEvent& event, } void BrowserInstance::setZoom(float ratio) { - const float dpiScaling = global::windowDelegate.dpiScaling().x; + const float dpiScaling = global::windowDelegate->dpiScaling().x; // Zooming in CEF is non-linear according to this: // https://www.magpcss.org/ceforum/viewtopic.php?f=6&t=11491 diff --git a/modules/webbrowser/src/eventhandler.cpp b/modules/webbrowser/src/eventhandler.cpp index 9607457a30..da9ca87185 100644 --- a/modules/webbrowser/src/eventhandler.cpp +++ b/modules/webbrowser/src/eventhandler.cpp @@ -332,7 +332,7 @@ bool EventHandler::mouseButtonCallback(MouseButton button, MouseAction action, return false; } - global::interactionMonitor.markInteraction(); + global::interactionMonitor->markInteraction(); MouseButtonState& state = (button == MouseButton::Left) ? _leftButton : _rightButton; int clickCount = BrowserInstance::SingleClick; @@ -381,11 +381,11 @@ bool EventHandler::isDoubleClick(const MouseButtonState& button) const { } bool EventHandler::mousePositionCallback(double x, double y) { - const glm::vec2 dpiScaling = global::windowDelegate.dpiScaling(); + const glm::vec2 dpiScaling = global::windowDelegate->dpiScaling(); _mousePosition.x = floor(static_cast(x) * dpiScaling.x); _mousePosition.y = floor(static_cast(y) * dpiScaling.y); _browserInstance->sendMouseMoveEvent(mouseEvent()); - global::interactionMonitor.markInteraction(); + global::interactionMonitor->markInteraction(); // Let the mouse event trickle on return false; @@ -476,7 +476,7 @@ CefTouchEvent EventHandler::touchEvent(const TouchInput& input, event.y = windowPos.y; event.type = eventType; const std::vector>& keyModVec = - global::navigationHandler.inputState().pressedKeys(); + global::navigationHandler->inputState().pressedKeys(); for (const std::pair& keyModPair : keyModVec) { const KeyModifier mods = keyModPair.second; event.modifiers |= static_cast(mapToCefModifiers(mods)); diff --git a/modules/webbrowser/src/screenspacebrowser.cpp b/modules/webbrowser/src/screenspacebrowser.cpp index 84ff5ce0cb..f1f3993294 100644 --- a/modules/webbrowser/src/screenspacebrowser.cpp +++ b/modules/webbrowser/src/screenspacebrowser.cpp @@ -87,7 +87,7 @@ ScreenSpaceBrowser::ScreenSpaceBrowser(const ghoul::Dictionary &dictionary) _url = dictionary.value(UrlInfo.identifier); } - glm::vec2 windowDimensions = global::windowDelegate.currentSubwindowSize(); + glm::vec2 windowDimensions = global::windowDelegate->currentSubwindowSize(); _dimensions = windowDimensions; _renderHandler = new ScreenSpaceRenderHandler(); @@ -105,7 +105,7 @@ ScreenSpaceBrowser::ScreenSpaceBrowser(const ghoul::Dictionary &dictionary) addProperty(_dimensions); addProperty(_reload); - WebBrowserModule* webBrowser = global::moduleEngine.module(); + WebBrowserModule* webBrowser = global::moduleEngine->module(); if (webBrowser) { webBrowser->addBrowser(_browserInstance.get()); } @@ -135,7 +135,7 @@ bool ScreenSpaceBrowser::deinitializeGL() { _browserInstance->close(true); - WebBrowserModule* webBrowser = global::moduleEngine.module(); + WebBrowserModule* webBrowser = global::moduleEngine->module(); if (webBrowser) { webBrowser->removeBrowser(_browserInstance.get()); _browserInstance.reset(); diff --git a/modules/webbrowser/webbrowsermodule.cpp b/modules/webbrowser/webbrowsermodule.cpp index d75ddf4959..33a5fe0f46 100644 --- a/modules/webbrowser/webbrowsermodule.cpp +++ b/modules/webbrowser/webbrowsermodule.cpp @@ -138,7 +138,7 @@ void WebBrowserModule::internalInitialize(const ghoul::Dictionary& dictionary) { _enabled = dictionary.value("Enabled"); } - const bool isMaster = global::windowDelegate.isMaster(); + const bool isMaster = global::windowDelegate->isMaster(); if (!_enabled || (!isMaster) ) { return; diff --git a/modules/webgui/webguimodule.cpp b/modules/webgui/webguimodule.cpp index ae0d3079fd..aa09e84e0b 100644 --- a/modules/webgui/webguimodule.cpp +++ b/modules/webgui/webguimodule.cpp @@ -231,7 +231,7 @@ void WebGuiModule::startProcess() { _endpoints.clear(); - ServerModule* serverModule = global::moduleEngine.module(); + ServerModule* serverModule = global::moduleEngine->module(); const ServerInterface* serverInterface = serverModule->serverInterfaceByIdentifier(_webSocketInterface); if (!serverInterface) { diff --git a/src/engine/globals.cpp b/src/engine/globals.cpp index 8a28ea5070..67f65513f9 100644 --- a/src/engine/globals.cpp +++ b/src/engine/globals.cpp @@ -58,188 +58,198 @@ #include #include #include +#include + +namespace openspace { +namespace { + constexpr const int TotalSize = + sizeof(ghoul::fontrendering::FontManager) + + sizeof(Dashboard) + + sizeof(DeferredcasterManager) + + sizeof(DownloadManager) + + sizeof(LuaConsole) + + sizeof(MemoryManager) + + sizeof(MissionManager) + + sizeof(ModuleEngine) + + sizeof(OpenSpaceEngine) + + sizeof(ParallelPeer) + + sizeof(RaycasterManager) + + sizeof(RenderEngine) + + sizeof(std::vector>) + + sizeof(SyncEngine) + + sizeof(TimeManager) + + sizeof(VersionChecker) + + sizeof(VirtualPropertyManager) + + sizeof(WindowDelegate) + + sizeof(configuration::Configuration) + + sizeof(interaction::InteractionMonitor) + + sizeof(interaction::WebsocketInputStates) + + sizeof(interaction::KeybindingManager) + + sizeof(interaction::NavigationHandler) + + sizeof(interaction::SessionRecording) + + sizeof(interaction::ShortcutManager) + + sizeof(properties::PropertyOwner) + + sizeof(properties::PropertyOwner) + + sizeof(scripting::ScriptEngine) + + sizeof(scripting::ScriptScheduler) + + sizeof(Profile); + + std::array DataStorage; +} // namespace +} // namespace openspace namespace openspace::global { -namespace detail { +void create() { + ZoneScoped -ghoul::fontrendering::FontManager& gFontManager() { - static ghoul::fontrendering::FontManager g({ 1536, 1536, 1 }); - return g; + std::byte* currentPos = DataStorage.data(); + + fontManager = new (currentPos) ghoul::fontrendering::FontManager({ 1536, 1536, 1 }); + assert(fontManager); + currentPos += sizeof(ghoul::fontrendering::FontManager); + + dashboard = new (currentPos) Dashboard; + assert(dashboard); + currentPos += sizeof(Dashboard); + + deferredcasterManager = new (currentPos) DeferredcasterManager; + assert(deferredcasterManager); + currentPos += sizeof(DeferredcasterManager); + + downloadManager = new (currentPos) DownloadManager; + assert(downloadManager); + currentPos += sizeof(DownloadManager); + + luaConsole = new (currentPos) LuaConsole; + assert(luaConsole); + currentPos += sizeof(LuaConsole); + + memoryManager = new (currentPos) MemoryManager; + assert(memoryManager); + currentPos += sizeof(MemoryManager); + + missionManager = new (currentPos) MissionManager; + assert(missionManager); + currentPos += sizeof(MissionManager); + + moduleEngine = new (currentPos) ModuleEngine; + assert(moduleEngine); + currentPos += sizeof(ModuleEngine); + + openSpaceEngine = new (currentPos) OpenSpaceEngine; + assert(openSpaceEngine); + currentPos += sizeof(OpenSpaceEngine); + + parallelPeer = new (currentPos) ParallelPeer; + assert(parallelPeer); + currentPos += sizeof(ParallelPeer); + + raycasterManager = new (currentPos) RaycasterManager; + assert(raycasterManager); + currentPos += sizeof(RaycasterManager); + + renderEngine = new (currentPos) RenderEngine; + assert(renderEngine); + currentPos += sizeof(RenderEngine); + + screenSpaceRenderables = new (currentPos) std::vector>; + assert(screenSpaceRenderables); + currentPos += sizeof(std::vector>); + + syncEngine = new (currentPos) SyncEngine(4096); + assert(syncEngine); + currentPos += sizeof(SyncEngine); + + timeManager = new (currentPos) TimeManager; + assert(timeManager); + currentPos += sizeof(TimeManager); + + versionChecker = new (currentPos) VersionChecker; + assert(versionChecker); + currentPos += sizeof(VersionChecker); + + virtualPropertyManager = new (currentPos) VirtualPropertyManager; + assert(virtualPropertyManager); + currentPos += sizeof(VirtualPropertyManager); + + windowDelegate = new (currentPos) WindowDelegate; + assert(windowDelegate); + currentPos += sizeof(WindowDelegate); + + configuration = new (currentPos) configuration::Configuration; + assert(configuration); + currentPos += sizeof(configuration::Configuration); + + interactionMonitor = new (currentPos) interaction::InteractionMonitor; + assert(interactionMonitor); + currentPos += sizeof(interaction::InteractionMonitor); + + joystickInputStates = new (currentPos) interaction::JoystickInputStates; + assert(joystickInputStates); + currentPos += sizeof(interaction::JoystickInputStates); + + websocketInputStates = new (currentPos) interaction::WebsocketInputStates; + assert(websocketInputStates); + currentPos += sizeof(interaction::WebsocketInputStates); + + keybindingManager = new (currentPos) interaction::KeybindingManager; + assert(keybindingManager); + currentPos += sizeof(interaction::KeybindingManager); + + navigationHandler = new (currentPos) interaction::NavigationHandler; + assert(navigationHandler); + currentPos += sizeof(interaction::NavigationHandler); + + sessionRecording = new (currentPos) interaction::SessionRecording; + assert(sessionRecording); + currentPos += sizeof(interaction::SessionRecording); + + shortcutManager = new (currentPos) interaction::ShortcutManager; + assert(shortcutManager); + currentPos += sizeof(interaction::ShortcutManager); + + rootPropertyOwner = new (currentPos) properties::PropertyOwner({ "" }); + assert(rootPropertyOwner); + currentPos += sizeof(properties::PropertyOwner); + + screenSpaceRootPropertyOwner = new (currentPos) properties::PropertyOwner({ "ScreenSpace" }); + assert(screenSpaceRootPropertyOwner); + currentPos += sizeof(properties::PropertyOwner); + + scriptEngine = new (currentPos) scripting::ScriptEngine; + assert(scriptEngine); + currentPos += sizeof(scripting::ScriptEngine); + + scriptScheduler = new (currentPos) scripting::ScriptScheduler; + assert(scriptScheduler); + currentPos += sizeof(scripting::ScriptScheduler); + + profile = new (currentPos) Profile; + assert(profile); + currentPos += sizeof(Profile); } -Dashboard& gDashboard() { - static Dashboard g; - return g; -} - -DeferredcasterManager& gDeferredcasterManager() { - static DeferredcasterManager g; - return g; -} - -DownloadManager& gDownloadManager() { - static DownloadManager g; - return g; -} - -LuaConsole& gLuaConsole() { - static LuaConsole g; - return g; -} - -MemoryManager& gMemoryManager() { - static MemoryManager g; - return g; -} - -MissionManager& gMissionManager() { - static MissionManager g; - return g; -} - -ModuleEngine& gModuleEngine() { - static ModuleEngine g; - return g; -} - -OpenSpaceEngine& gOpenSpaceEngine() { - static OpenSpaceEngine g; - return g; -} - -ParallelPeer& gParallelPeer() { - static ParallelPeer g; - return g; -} - -RaycasterManager& gRaycasterManager() { - static RaycasterManager g; - return g; -} - -RenderEngine& gRenderEngine() { - static RenderEngine g; - return g; -} - -std::vector>& gScreenspaceRenderables() { - static std::vector> g; - return g; -} - -SyncEngine& gSyncEngine() { - static SyncEngine g(4096); - return g; -} - -TimeManager& gTimeManager() { - static TimeManager g; - return g; -} - -VersionChecker& gVersionChecker() { - static VersionChecker g; - return g; -} - -VirtualPropertyManager& gVirtualPropertyManager() { - static VirtualPropertyManager g; - return g; -} - -WindowDelegate& gWindowDelegate() { - static WindowDelegate g; - return g; -} - -configuration::Configuration& gConfiguration() { - static configuration::Configuration g; - return g; -} - -interaction::InteractionMonitor& gInteractionMonitor() { - static interaction::InteractionMonitor g; - return g; -} - -interaction::JoystickInputStates& gJoystickInputStates() { - static interaction::JoystickInputStates g; - return g; -} - -interaction::WebsocketInputStates& gWebsocketInputStates() { - static interaction::WebsocketInputStates g; - return g; -} - -interaction::KeybindingManager& gKeybindingManager() { - static interaction::KeybindingManager g; - return g; -} - -interaction::NavigationHandler& gNavigationHandler() { - static interaction::NavigationHandler g; - return g; -} - -interaction::SessionRecording& gSessionRecording() { - static interaction::SessionRecording g; - return g; -} - -interaction::ShortcutManager& gShortcutManager() { - static interaction::ShortcutManager g; - return g; -} - -properties::PropertyOwner& gRootPropertyOwner() { - static properties::PropertyOwner g({ "" }); - return g; -} - -properties::PropertyOwner& gScreenSpaceRootPropertyOwner() { - static properties::PropertyOwner g({ "ScreenSpace" }); - return g; -} - -scripting::ScriptEngine& gScriptEngine() { - static scripting::ScriptEngine g; - return g; -} - -scripting::ScriptScheduler& gScriptScheduler() { - static scripting::ScriptScheduler g; - return g; -} - -Profile& gProfile() { - static Profile g; - return g; -} - -} // namespace detail - void initialize() { ZoneScoped - global::rootPropertyOwner.addPropertySubOwner(global::moduleEngine); + rootPropertyOwner->addPropertySubOwner(global::moduleEngine); - global::navigationHandler.setPropertyOwner(&global::rootPropertyOwner); + navigationHandler->setPropertyOwner(global::rootPropertyOwner); // New property subowners also have to be added to the ImGuiModule callback! - global::rootPropertyOwner.addPropertySubOwner(global::navigationHandler); - global::rootPropertyOwner.addPropertySubOwner(global::interactionMonitor); - global::rootPropertyOwner.addPropertySubOwner(global::sessionRecording); - global::rootPropertyOwner.addPropertySubOwner(global::timeManager); + rootPropertyOwner->addPropertySubOwner(global::navigationHandler); + rootPropertyOwner->addPropertySubOwner(global::interactionMonitor); + rootPropertyOwner->addPropertySubOwner(global::sessionRecording); + rootPropertyOwner->addPropertySubOwner(global::timeManager); - global::rootPropertyOwner.addPropertySubOwner(global::renderEngine); - global::rootPropertyOwner.addPropertySubOwner(global::screenSpaceRootPropertyOwner); + rootPropertyOwner->addPropertySubOwner(global::renderEngine); + rootPropertyOwner->addPropertySubOwner(global::screenSpaceRootPropertyOwner); - global::rootPropertyOwner.addPropertySubOwner(global::parallelPeer); - global::rootPropertyOwner.addPropertySubOwner(global::luaConsole); - global::rootPropertyOwner.addPropertySubOwner(global::dashboard); + rootPropertyOwner->addPropertySubOwner(global::parallelPeer); + rootPropertyOwner->addPropertySubOwner(global::luaConsole); + rootPropertyOwner->addPropertySubOwner(global::dashboard); - global::syncEngine.addSyncable(&global::scriptEngine); + syncEngine->addSyncable(global::scriptEngine); } void initializeGL() { @@ -247,30 +257,127 @@ void initializeGL() { } +void destroy() { + LDEBUGC("Globals", "Destroying 'Profile'"); + profile->~Profile(); + + LDEBUGC("Globals", "Destroying 'ScriptScheduler'"); + scriptScheduler->~ScriptScheduler(); + + LDEBUGC("Globals", "Destroying 'ScriptEngine'"); + scriptEngine->~ScriptEngine(); + + LDEBUGC("Globals", "Destroying 'ScreenSpace Root Owner'"); + screenSpaceRootPropertyOwner->~PropertyOwner(); + + LDEBUGC("Globals", "Destroying 'Root Owner'"); + rootPropertyOwner->~PropertyOwner(); + + LDEBUGC("Globals", "Destroying 'ShortcutManager'"); + shortcutManager->~ShortcutManager(); + + LDEBUGC("Globals", "Destroying 'SessionRecording'"); + sessionRecording->~SessionRecording(); + + LDEBUGC("Globals", "Destroying 'NavigationHandler'"); + navigationHandler->~NavigationHandler(); + + LDEBUGC("Globals", "Destroying 'KeybindingManager'"); + keybindingManager->~KeybindingManager(); + + LDEBUGC("Globals", "Destroying 'WebsocketInputStates'"); + websocketInputStates->~WebsocketInputStates(); + + LDEBUGC("Globals", "Destroying 'JoystickInputStates'"); + joystickInputStates->~JoystickInputStates(); + + LDEBUGC("Globals", "Destroying 'InteractionMonitor'"); + interactionMonitor->~InteractionMonitor(); + + LDEBUGC("Globals", "Destroying 'Configuration'"); + configuration->~Configuration(); + + LDEBUGC("Globals", "Destroying 'WindowDelegate'"); + windowDelegate->~WindowDelegate(); + + LDEBUGC("Globals", "Destroying 'VirtualPropertyManager'"); + virtualPropertyManager->~VirtualPropertyManager(); + + LDEBUGC("Globals", "Destroying 'VersionChecker'"); + versionChecker->~VersionChecker(); + + LDEBUGC("Globals", "Destroying 'TimeManager'"); + timeManager->~TimeManager(); + + LDEBUGC("Globals", "Destroying 'SyncEngine'"); + syncEngine->~SyncEngine(); + + LDEBUGC("Globals", "Destroying 'ScreenSpaceRenderables'"); + screenSpaceRenderables->~vector>(); + + LDEBUGC("Globals", "Destroying 'RenderEngine'"); + renderEngine->~RenderEngine(); + + LDEBUGC("Globals", "Destroying 'RaycasterManager'"); + raycasterManager->~RaycasterManager(); + + LDEBUGC("Globals", "Destroying 'ParallelPeer'"); + parallelPeer->~ParallelPeer(); + + LDEBUGC("Globals", "Destroying 'OpenSpaceEngine'"); + openSpaceEngine->~OpenSpaceEngine(); + + LDEBUGC("Globals", "Destroying 'ModuleEngine'"); + moduleEngine->~ModuleEngine(); + + LDEBUGC("Globals", "Destroying 'MissionManager'"); + missionManager->~MissionManager(); + + LDEBUGC("Globals", "Destroying 'MemoryManager'"); + memoryManager->~MemoryManager(); + + LDEBUGC("Globals", "Destroying 'LuaConsole'"); + luaConsole->~LuaConsole(); + + LDEBUGC("Globals", "Destroying 'DownloadManager'"); + downloadManager->~DownloadManager(); + + LDEBUGC("Globals", "Destroying 'DeferredcasterManager'"); + deferredcasterManager->~DeferredcasterManager(); + + LDEBUGC("Globals", "Destroying 'Dashboard'"); + dashboard->~Dashboard(); + + LDEBUGC("Globals", "Destroying 'FontManager'"); + fontManager->~FontManager(); + + std::fill(DataStorage.begin(), DataStorage.end(), std::byte(0)); +} + void deinitialize() { ZoneScoped - for (std::unique_ptr& ssr : global::screenSpaceRenderables) { + for (std::unique_ptr& ssr : *screenSpaceRenderables) { ssr->deinitialize(); } - global::syncEngine.removeSyncables(global::timeManager.getSyncables()); + syncEngine->removeSyncables(timeManager->getSyncables()); - global::moduleEngine.deinitialize(); - global::luaConsole.deinitialize(); - global::scriptEngine.deinitialize(); - global::fontManager.deinitialize(); + moduleEngine->deinitialize(); + luaConsole->deinitialize(); + scriptEngine->deinitialize(); + fontManager->deinitialize(); } void deinitializeGL() { ZoneScoped - for (std::unique_ptr& ssr : global::screenSpaceRenderables) { + for (std::unique_ptr& ssr : *screenSpaceRenderables) { ssr->deinitializeGL(); } - global::renderEngine.deinitializeGL(); - global::moduleEngine.deinitializeGL(); + renderEngine->deinitializeGL(); + moduleEngine->deinitializeGL(); } } // namespace openspace::global diff --git a/src/engine/moduleengine_lua.inl b/src/engine/moduleengine_lua.inl index 230ca92243..6a70dea095 100644 --- a/src/engine/moduleengine_lua.inl +++ b/src/engine/moduleengine_lua.inl @@ -45,7 +45,7 @@ int isLoaded(lua_State* L) { ghoul::lua::PopValue::Yes ); - const std::vector& modules = global::moduleEngine.modules(); + const std::vector& modules = global::moduleEngine->modules(); auto it = std::find_if( modules.begin(), diff --git a/src/engine/openspaceengine.cpp b/src/engine/openspaceengine.cpp index 44e83d17cd..61442d56c8 100644 --- a/src/engine/openspaceengine.cpp +++ b/src/engine/openspaceengine.cpp @@ -154,7 +154,7 @@ void OpenSpaceEngine::registerPathTokens() { // Registering Path tokens. If the BASE path is set, it is the only one that will // overwrite the default path of the cfg directory using T = std::string; - for (const std::pair& path : global::configuration.pathTokens) { + for (const std::pair& path : global::configuration->pathTokens) { std::string fullKey = ghoul::filesystem::FileSystem::TokenOpeningBraces + path.first + ghoul::filesystem::FileSystem::TokenClosingBraces; @@ -184,14 +184,14 @@ void OpenSpaceEngine::initialize() { global::initialize(); - const std::string versionCheckUrl = global::configuration.versionCheckUrl; + const std::string versionCheckUrl = global::configuration->versionCheckUrl; if (!versionCheckUrl.empty()) { - global::versionChecker.requestLatestVersion(versionCheckUrl); + global::versionChecker->requestLatestVersion(versionCheckUrl); } std::string cacheFolder = absPath("${CACHE}"); - if (global::configuration.usePerSceneCache) { - std::string scene = global::configuration.asset; + if (global::configuration->usePerSceneCache) { + std::string scene = global::configuration->asset; cacheFolder += "-" + ghoul::filesystem::File(scene).baseName(); LINFO(fmt::format("Old cache: {}", absPath("${CACHE}"))); @@ -228,15 +228,15 @@ void OpenSpaceEngine::initialize() { } ghoul::logging::LogLevel level = ghoul::from_string( - global::configuration.logging.level + global::configuration->logging.level ); - bool immediateFlush = global::configuration.logging.forceImmediateFlush; + bool immediateFlush = global::configuration->logging.forceImmediateFlush; using ImmediateFlush = ghoul::logging::LogManager::ImmediateFlush; ghoul::logging::LogManager::initialize(level, ImmediateFlush(immediateFlush)); LogMgr.addLog(std::make_unique()); - for (const ghoul::Dictionary& log : global::configuration.logging.logs) { + for (const ghoul::Dictionary& log : global::configuration->logging.logs) { try { LogMgr.addLog(createLog(log)); } @@ -273,11 +273,11 @@ void OpenSpaceEngine::initialize() { LINFOC("Commit", std::string(OPENSPACE_GIT_FULL)); // Register modules - global::moduleEngine.initialize(global::configuration.moduleConfigurations); + global::moduleEngine->initialize(global::configuration->moduleConfigurations); // After registering the modules, the documentations for the available classes // can be added as well - for (OpenSpaceModule* m : global::moduleEngine.modules()) { + for (OpenSpaceModule* m : global::moduleEngine->modules()) { for (const documentation::Documentation& doc : m->documentations()) { DocEng.addDocumentation(doc); } @@ -289,15 +289,15 @@ void OpenSpaceEngine::initialize() { // Register Lua script functions LDEBUG("Registering Lua libraries"); - registerCoreClasses(global::scriptEngine); + registerCoreClasses(*global::scriptEngine); // Convert profile to scene file (if was provided in configuration file) - if (!global::configuration.profile.empty()) { + if (!global::configuration->profile.empty()) { std::string inputProfilePath = absPath("${PROFILES}"); std::string outputScenePath = absPath("${TEMPORARY}"); - std::string inputProfile = inputProfilePath + "/" + global::configuration.profile + std::string inputProfile = inputProfilePath + "/" + global::configuration->profile + ".profile"; - std::string outputAsset = outputScenePath + "/" + global::configuration.profile + std::string outputAsset = outputScenePath + "/" + global::configuration->profile + ".asset"; if (!FileSys.fileExists(inputProfile)) { @@ -322,39 +322,41 @@ void OpenSpaceEngine::initialize() { (std::istreambuf_iterator(inFile)), std::istreambuf_iterator() ); - global::profile = Profile(content); + *global::profile = Profile(content); // Then save the profile to a scene so that we can load it with the // existing infrastructure std::ofstream scene(outputAsset); - std::string sceneContent = global::profile.convertToScene(); + std::string sceneContent = global::profile->convertToScene(); scene << sceneContent; // Set asset name to that of the profile because a new scene file will be // created with that name, and also because the profile name will override // an asset name if both are provided. - global::configuration.asset = outputAsset; - global::configuration.usingProfile = true; + global::configuration->asset = outputAsset; + global::configuration->usingProfile = true; } } // Set up asset loader - global::openSpaceEngine._assetManager = std::make_unique( - global::scriptEngine.luaState(), + global::openSpaceEngine->_assetManager = std::make_unique( + global::scriptEngine->luaState(), FileSys.absPath("${ASSETS}") ); - global::scriptEngine.addLibrary(global::openSpaceEngine._assetManager->luaLibrary()); + global::scriptEngine->addLibrary( + global::openSpaceEngine->_assetManager->luaLibrary() + ); - for (OpenSpaceModule* module : global::moduleEngine.modules()) { - global::scriptEngine.addLibrary(module->luaLibrary()); + for (OpenSpaceModule* module : global::moduleEngine->modules()) { + global::scriptEngine->addLibrary(module->luaLibrary()); for (scripting::LuaLibrary& l : module->luaLibraries()) { - global::scriptEngine.addLibrary(l); + global::scriptEngine->addLibrary(l); } } - global::scriptEngine.initialize(); + global::scriptEngine->initialize(); // To be concluded _documentationJson.clear(); @@ -362,11 +364,11 @@ void OpenSpaceEngine::initialize() { writeStaticDocumentation(); - _shutdown.waitTime = global::configuration.shutdownCountdown; + _shutdown.waitTime = global::configuration->shutdownCountdown; - global::navigationHandler.initialize(); + global::navigationHandler->initialize(); - global::renderEngine.initialize(); + global::renderEngine->initialize(); for (const std::function& func : global::callback::initialize) { ZoneScopedN("[Module] initialize") @@ -374,8 +376,8 @@ void OpenSpaceEngine::initialize() { func(); } - global::openSpaceEngine._assetManager->initialize(); - scheduleLoadSingleAsset(global::configuration.asset); + global::openSpaceEngine->_assetManager->initialize(); + scheduleLoadSingleAsset(global::configuration->asset); LTRACE("OpenSpaceEngine::initialize(end)"); } @@ -397,7 +399,7 @@ std::string OpenSpaceEngine::generateFilePath(std::string openspaceRelativePath) else { path.append("/"); } - return path.append(global::configuration.profile); + return path.append(global::configuration->profile); } void OpenSpaceEngine::initializeGL() { @@ -405,7 +407,7 @@ void OpenSpaceEngine::initializeGL() { LTRACE("OpenSpaceEngine::initializeGL(begin)"); - glbinding::Binding::initialize(global::windowDelegate.openGLProcedureAddress); + glbinding::Binding::initialize(global::windowDelegate->openGLProcedureAddress); //glbinding::Binding::useCurrentContext(); rendering::helper::initialize(); @@ -425,14 +427,14 @@ void OpenSpaceEngine::initializeGL() { using Verbosity = ghoul::systemcapabilities::SystemCapabilitiesComponent::Verbosity; Verbosity verbosity = ghoul::from_string( - global::configuration.logging.capabilitiesVerbosity - ); + global::configuration->logging.capabilitiesVerbosity + ); SysCap.logCapabilities(verbosity); // Check the required OpenGL versions of the registered modules ghoul::systemcapabilities::Version version = - global::moduleEngine.requiredOpenGLVersion(); + global::moduleEngine->requiredOpenGLVersion(); LINFO(fmt::format("Required OpenGL version: {}", ghoul::to_string(version))); if (OpenGLCap.openGLVersion() < version) { @@ -446,7 +448,7 @@ void OpenSpaceEngine::initializeGL() { { // Check the available OpenGL extensions against the required extensions using OCC = ghoul::systemcapabilities::OpenGLCapabilitiesComponent; - for (OpenSpaceModule* m : global::moduleEngine.modules()) { + for (OpenSpaceModule* m : global::moduleEngine->modules()) { for (const std::string& ext : m->requiredOpenGLExtensions()) { if (!SysCap.component().isExtensionSupported(ext)) { LFATAL(fmt::format( @@ -462,12 +464,14 @@ void OpenSpaceEngine::initializeGL() { loadFonts(); _loadingScreen = std::make_unique( - LoadingScreen::ShowMessage(global::configuration.loadingScreen.isShowingMessages), + LoadingScreen::ShowMessage( + global::configuration->loadingScreen.isShowingMessages + ), LoadingScreen::ShowNodeNames( - global::configuration.loadingScreen.isShowingNodeNames + global::configuration->loadingScreen.isShowingNodeNames ), LoadingScreen::ShowProgressbar( - global::configuration.loadingScreen.isShowingProgressbar + global::configuration->loadingScreen.isShowingProgressbar ) ); @@ -479,7 +483,7 @@ void OpenSpaceEngine::initializeGL() { LTRACE("OpenSpaceEngine::initializeGL::Console::initialize(begin)"); try { - global::luaConsole.initialize(); + global::luaConsole->initialize(); } catch (ghoul::RuntimeError& e) { LERROR("Error initializing Console with error:"); @@ -488,7 +492,7 @@ void OpenSpaceEngine::initializeGL() { LTRACE("OpenSpaceEngine::initializeGL::Console::initialize(end)"); LTRACE("OpenSpaceEngine::initializeGL::DebugContext(begin)"); - bool debugActive = global::configuration.openGLDebugContext.isActive; + bool debugActive = global::configuration->openGLDebugContext.isActive; // Debug output is not available before 4.3 const ghoul::systemcapabilities::Version minVersion = { 4, 3, 0 }; @@ -500,11 +504,11 @@ void OpenSpaceEngine::initializeGL() { if (debugActive) { using namespace ghoul::opengl::debug; - bool synchronous = global::configuration.openGLDebugContext.isSynchronous; + bool synchronous = global::configuration->openGLDebugContext.isSynchronous; setDebugOutput(DebugOutput(debugActive), SynchronousOutput(synchronous)); for (const configuration::Configuration::OpenGLDebugContext::IdentifierFilter&f : - global::configuration.openGLDebugContext.identifierFilters) + global::configuration->openGLDebugContext.identifierFilters) { setDebugMessageControl( ghoul::from_string(f.source), @@ -516,7 +520,7 @@ void OpenSpaceEngine::initializeGL() { } for (const std::string& sev : - global::configuration.openGLDebugContext.severityFilters) + global::configuration->openGLDebugContext.severityFilters) { setDebugMessageControl( Source::DontCare, @@ -559,7 +563,7 @@ void OpenSpaceEngine::initializeGL() { // the callback mask in glbinding is stateful for each context, and since // KeyLogEachOpenGLCall is more specific, we want it to be able to overwrite the // state from KeyCheckOpenGLState - if (global::configuration.isCheckingOpenGLState) { + if (global::configuration->isCheckingOpenGLState) { using namespace glbinding; // Infinite loop -- welcome to the danger zone @@ -612,9 +616,9 @@ void OpenSpaceEngine::initializeGL() { }); } - if (global::configuration.isLoggingOpenGLCalls) { + if (global::configuration->isLoggingOpenGLCalls) { using namespace ghoul::logging; - LogLevel lvl = ghoul::from_string(global::configuration.logging.level); + LogLevel lvl = ghoul::from_string(global::configuration->logging.level); if (lvl > LogLevel::Trace) { LWARNING( "Logging OpenGL calls is enabled, but the selected log level does " @@ -654,9 +658,9 @@ void OpenSpaceEngine::initializeGL() { } LDEBUG("Initializing Rendering Engine"); - global::renderEngine.initializeGL(); + global::renderEngine->initializeGL(); - global::moduleEngine.initializeGL(); + global::moduleEngine->initializeGL(); for (const std::function& func : global::callback::initializeGL) { @@ -679,11 +683,11 @@ void OpenSpaceEngine::loadSingleAsset(const std::string& assetPath) { LTRACE("OpenSpaceEngine::loadSingleAsset(begin)"); - global::windowDelegate.setBarrier(false); - global::windowDelegate.setSynchronization(false); + global::windowDelegate->setBarrier(false); + global::windowDelegate->setSynchronization(false); defer { - global::windowDelegate.setSynchronization(true); - global::windowDelegate.setBarrier(true); + global::windowDelegate->setSynchronization(true); + global::windowDelegate->setBarrier(true); }; if (assetPath.empty()) { @@ -692,19 +696,19 @@ void OpenSpaceEngine::loadSingleAsset(const std::string& assetPath) { if (_scene) { ZoneScopedN("Reset scene") - global::syncEngine.removeSyncables(global::timeManager.getSyncables()); + global::syncEngine->removeSyncables(global::timeManager->getSyncables()); if (_scene && _scene->camera()) { - global::syncEngine.removeSyncables(_scene->camera()->getSyncables()); + global::syncEngine->removeSyncables(_scene->camera()->getSyncables()); } - global::renderEngine.setScene(nullptr); - global::renderEngine.setCamera(nullptr); - global::navigationHandler.setCamera(nullptr); + global::renderEngine->setScene(nullptr); + global::renderEngine->setCamera(nullptr); + global::navigationHandler->setCamera(nullptr); _scene->clear(); - global::rootPropertyOwner.removePropertySubOwner(_scene.get()); + global::rootPropertyOwner->removePropertySubOwner(_scene.get()); } std::unique_ptr sceneInitializer; - if (global::configuration.useMultithreadedInitialization) { + if (global::configuration->useMultithreadedInitialization) { unsigned int nAvailableThreads = std::min( std::thread::hardware_concurrency() - 1, 4u @@ -717,21 +721,21 @@ void OpenSpaceEngine::loadSingleAsset(const std::string& assetPath) { } _scene = std::make_unique(std::move(sceneInitializer)); - global::renderEngine.setScene(_scene.get()); + global::renderEngine->setScene(_scene.get()); - global::rootPropertyOwner.addPropertySubOwner(_scene.get()); + global::rootPropertyOwner->addPropertySubOwner(_scene.get()); _scene->setCamera(std::make_unique()); Camera* camera = _scene->camera(); camera->setParent(_scene->root()); - global::renderEngine.setCamera(camera); - global::navigationHandler.setCamera(camera); + global::renderEngine->setCamera(camera); + global::navigationHandler->setCamera(camera); const SceneGraphNode* parent = camera->parent(); if (parent) { - global::navigationHandler.orbitalNavigator().setFocusNode(parent->identifier()); + global::navigationHandler->orbitalNavigator().setFocusNode(parent->identifier()); } else { - global::navigationHandler.orbitalNavigator().setFocusNode( + global::navigationHandler->orbitalNavigator().setFocusNode( _scene->root()->identifier() ); } @@ -775,7 +779,7 @@ void OpenSpaceEngine::loadSingleAsset(const std::string& assetPath) { bool loading = true; while (loading) { if (_shouldAbortLoading) { - global::windowDelegate.terminate(); + global::windowDelegate->terminate(); break; } _loadingScreen->render(); @@ -838,11 +842,11 @@ void OpenSpaceEngine::loadSingleAsset(const std::string& assetPath) { _loadingScreen = nullptr; - global::renderEngine.updateScene(); + global::renderEngine->updateScene(); - global::syncEngine.addSyncables(global::timeManager.getSyncables()); + global::syncEngine->addSyncables(global::timeManager->getSyncables()); if (_scene && _scene->camera()) { - global::syncEngine.addSyncables(_scene->camera()->getSyncables()); + global::syncEngine->addSyncables(_scene->camera()->getSyncables()); } #ifdef __APPLE__ @@ -865,19 +869,19 @@ void OpenSpaceEngine::deinitialize() { func(); } - global::navigationHandler.deinitialize(); + global::navigationHandler->deinitialize(); LTRACE("deinitialize(begin)"); - if (global::parallelPeer.status() != ParallelConnection::Status::Disconnected) { - global::parallelPeer.disconnect(); + if (global::parallelPeer->status() != ParallelConnection::Status::Disconnected) { + global::parallelPeer->disconnect(); } - if (global::renderEngine.scene() && global::renderEngine.scene()->camera()) { - global::syncEngine.removeSyncables( - global::renderEngine.scene()->camera()->getSyncables() + if (global::renderEngine->scene() && global::renderEngine->scene()->camera()) { + global::syncEngine->removeSyncables( + global::renderEngine->scene()->camera()->getSyncables() ); } - global::sessionRecording.deinitialize(); - global::versionChecker.cancel(); + global::sessionRecording->deinitialize(); + global::versionChecker->cancel(); _assetManager = nullptr; @@ -903,12 +907,12 @@ void OpenSpaceEngine::deinitializeGL() { LTRACE("OpenSpaceEngine::deinitializeGL(begin)"); // We want to render an image informing the user that we are shutting down - global::renderEngine.renderEndscreen(); - global::windowDelegate.swapBuffer(); + global::renderEngine->renderEndscreen(); + global::windowDelegate->swapBuffer(); - global::openSpaceEngine.assetManager().deinitialize(); - global::openSpaceEngine._scene = nullptr; - global::renderEngine.setScene(nullptr); + global::openSpaceEngine->assetManager().deinitialize(); + global::openSpaceEngine->_scene = nullptr; + global::renderEngine->setScene(nullptr); for (const std::function& func : global::callback::deinitializeGL) { func(); @@ -924,16 +928,16 @@ void OpenSpaceEngine::deinitializeGL() { } void OpenSpaceEngine::writeStaticDocumentation() { - std::string path = global::configuration.documentation.path; + std::string path = global::configuration->documentation.path; if (!path.empty()) { - DocEng.addHandlebarTemplates(global::scriptEngine.templatesToRegister()); + DocEng.addHandlebarTemplates(global::scriptEngine->templatesToRegister()); DocEng.addHandlebarTemplates(FactoryManager::ref().templatesToRegister()); DocEng.addHandlebarTemplates(DocEng.templatesToRegister()); _documentationJson += "{\"name\":\"Scripting\","; - _documentationJson += "\"identifier\":\"" + global::scriptEngine.jsonName(); - _documentationJson += "\",\"data\":" + global::scriptEngine.generateJson(); + _documentationJson += "\"identifier\":\"" + global::scriptEngine->jsonName(); + _documentationJson += "\",\"data\":" + global::scriptEngine->generateJson(); _documentationJson += "},"; _documentationJson += "{\"name\":\"Top Level\","; @@ -953,9 +957,9 @@ void OpenSpaceEngine::runGlobalCustomizationScripts() { LINFO("Running Global initialization scripts"); ghoul::lua::LuaState state; - global::scriptEngine.initializeLuaState(state); + global::scriptEngine->initializeLuaState(state); - for (const std::string& script : global::configuration.globalCustomizationScripts) { + for (const std::string& script : global::configuration->globalCustomizationScripts) { std::string s = absPath(script); if (FileSys.fileExists(s)) { try { @@ -972,10 +976,10 @@ void OpenSpaceEngine::runGlobalCustomizationScripts() { } void OpenSpaceEngine::loadFonts() { - global::fontManager.initialize(); + global::fontManager->initialize(); using T = std::string; - for (const std::pair& font : global::configuration.fonts) { + for (const std::pair& font : global::configuration->fonts) { std::string key = font.first; std::string fontName = absPath(font.second); @@ -985,7 +989,7 @@ void OpenSpaceEngine::loadFonts() { } LDEBUG(fmt::format("Registering font '{}' with key '{}'", fontName, key)); - bool success = global::fontManager.registerFontPath(key, fontName); + bool success = global::fontManager->registerFontPath(key, fontName); if (!success) { LERROR(fmt::format( @@ -1007,11 +1011,11 @@ void OpenSpaceEngine::writeSceneDocumentation() { // Write documentation to json files if config file supplies path for doc files - std::string path = global::configuration.documentation.path; + std::string path = global::configuration->documentation.path; if (!path.empty()) { std::future root = std::async( &properties::PropertyOwner::generateJson, - &global::rootPropertyOwner + global::rootPropertyOwner ); std::future scene = std::async( @@ -1023,9 +1027,9 @@ void OpenSpaceEngine::writeSceneDocumentation() { path = absPath(path) + "/"; _documentationJson += "{\"name\":\"Keybindings\",\"identifier\":\""; - _documentationJson += global::keybindingManager.jsonName() + "\","; + _documentationJson += global::keybindingManager->jsonName() + "\","; _documentationJson += "\"data\":"; - _documentationJson += global::keybindingManager.generateJson(); + _documentationJson += global::keybindingManager->generateJson(); _documentationJson += "},"; _documentationJson += "{\"name\":\"Scene License Information\","; _documentationJson += "\"identifier\":\"sceneLicense"; @@ -1042,12 +1046,12 @@ void OpenSpaceEngine::writeSceneDocumentation() { _documentationJson += "}"; //add templates for the jsons we just registered - DocEng.addHandlebarTemplates(global::keybindingManager.templatesToRegister()); + DocEng.addHandlebarTemplates(global::keybindingManager->templatesToRegister()); //TODO this is in efficaiant, here i am just instaning the class to get //at a member variable which is staticly defined. How do i just get that SceneLicenseWriter writer; DocEng.addHandlebarTemplates(writer.templatesToRegister()); - DocEng.addHandlebarTemplates(global::rootPropertyOwner.templatesToRegister()); + DocEng.addHandlebarTemplates(global::rootPropertyOwner->templatesToRegister()); //the static documentation shoudl be finished already //so now that we wrote the static and secene json files @@ -1068,57 +1072,57 @@ void OpenSpaceEngine::preSynchronization() { FileSys.triggerFilesystemEvents(); // Reset the temporary, frame-based storage - global::memoryManager.TemporaryMemory.reset(); + global::memoryManager->TemporaryMemory.reset(); if (_hasScheduledAssetLoading) { LINFO(fmt::format("Loading asset: {}", _scheduledAssetPathToLoad)); - global::profile.setIgnoreUpdates(true); + global::profile->setIgnoreUpdates(true); loadSingleAsset(_scheduledAssetPathToLoad); - global::profile.setIgnoreUpdates(false); - resetPropertyChangeFlagsOfSubowners(&global::rootPropertyOwner); + global::profile->setIgnoreUpdates(false); + resetPropertyChangeFlagsOfSubowners(global::rootPropertyOwner); _hasScheduledAssetLoading = false; _scheduledAssetPathToLoad.clear(); } if (_isFirstRenderingFirstFrame) { - global::windowDelegate.setSynchronization(false); + global::windowDelegate->setSynchronization(false); } - bool master = global::windowDelegate.isMaster(); + bool master = global::windowDelegate->isMaster(); - global::syncEngine.preSynchronization(SyncEngine::IsMaster(master)); + global::syncEngine->preSynchronization(SyncEngine::IsMaster(master)); if (master) { - double dt = global::windowDelegate.deltaTime(); + double dt = global::windowDelegate->deltaTime(); - if (global::sessionRecording.isSavingFramesDuringPlayback()) { - dt = global::sessionRecording.fixedDeltaTimeDuringFrameOutput(); + if (global::sessionRecording->isSavingFramesDuringPlayback()) { + dt = global::sessionRecording->fixedDeltaTimeDuringFrameOutput(); } - global::timeManager.preSynchronization(dt); + global::timeManager->preSynchronization(dt); using Iter = std::vector::const_iterator; - std::pair scheduledScripts = global::scriptScheduler.progressTo( - global::timeManager.time().j2000Seconds() + std::pair scheduledScripts = global::scriptScheduler->progressTo( + global::timeManager->time().j2000Seconds() ); for (Iter it = scheduledScripts.first; it != scheduledScripts.second; ++it) { - global::scriptEngine.queueScript( + global::scriptEngine->queueScript( *it, scripting::ScriptEngine::RemoteScripting::Yes ); } - global::renderEngine.updateScene(); + global::renderEngine->updateScene(); if (_scene) { Camera* camera = _scene->camera(); if (camera) { - global::navigationHandler.updateCamera(dt); + global::navigationHandler->updateCamera(dt); camera->invalidateCache(); } } - global::sessionRecording.preSynchronization(); - global::parallelPeer.preSynchronization(); - global::interactionMonitor.updateActivityState(); + global::sessionRecording->preSynchronization(); + global::parallelPeer->preSynchronization(); + global::interactionMonitor->updateActivityState(); } for (const std::function& func : global::callback::preSync) { @@ -1134,24 +1138,24 @@ void OpenSpaceEngine::postSynchronizationPreDraw() { TracyGpuZone("postSynchronizationPreDraw") LTRACE("OpenSpaceEngine::postSynchronizationPreDraw(begin)"); - bool master = global::windowDelegate.isMaster(); - global::syncEngine.postSynchronization(SyncEngine::IsMaster(master)); + bool master = global::windowDelegate->isMaster(); + global::syncEngine->postSynchronization(SyncEngine::IsMaster(master)); // This probably doesn't have to be done here every frame, but doing it earlier gives // weird results when using side_by_side stereo --- abock using FR = ghoul::fontrendering::FontRenderer; - FR::defaultRenderer().setFramebufferSize(global::renderEngine.fontResolution()); + FR::defaultRenderer().setFramebufferSize(global::renderEngine->fontResolution()); FR::defaultProjectionRenderer().setFramebufferSize( - global::renderEngine.renderingResolution() + global::renderEngine->renderingResolution() ); if (_shutdown.inShutdown) { if (_shutdown.timer <= 0.f) { - global::windowDelegate.terminate(); + global::windowDelegate->terminate(); return; } - _shutdown.timer -= static_cast(global::windowDelegate.averageDeltaTime()); + _shutdown.timer -= static_cast(global::windowDelegate->averageDeltaTime()); } @@ -1167,10 +1171,10 @@ void OpenSpaceEngine::postSynchronizationPreDraw() { ); } - global::renderEngine.updateScene(); - global::renderEngine.updateRenderer(); - global::renderEngine.updateScreenSpaceRenderables(); - global::renderEngine.updateShaderPrograms(); + global::renderEngine->updateScene(); + global::renderEngine->updateRenderer(); + global::renderEngine->updateScreenSpaceRenderables(); + global::renderEngine->updateShaderPrograms(); if (!master) { _scene->camera()->invalidateCache(); @@ -1212,15 +1216,15 @@ void OpenSpaceEngine::render(const glm::mat4& sceneMatrix, const glm::mat4& view LTRACE("OpenSpaceEngine::render(begin)"); const bool isGuiWindow = - global::windowDelegate.hasGuiWindow() ? - global::windowDelegate.isGuiWindow() : + global::windowDelegate->hasGuiWindow() ? + global::windowDelegate->isGuiWindow() : true; if (isGuiWindow) { - global::luaConsole.update(); + global::luaConsole->update(); } - global::renderEngine.render(sceneMatrix, viewMatrix, projectionMatrix); + global::renderEngine->render(sceneMatrix, viewMatrix, projectionMatrix); for (const std::function& func : global::callback::render) { ZoneScopedN("[Module] render") @@ -1237,14 +1241,14 @@ void OpenSpaceEngine::drawOverlays() { LTRACE("OpenSpaceEngine::drawOverlays(begin)"); const bool isGuiWindow = - global::windowDelegate.hasGuiWindow() ? - global::windowDelegate.isGuiWindow() : + global::windowDelegate->hasGuiWindow() ? + global::windowDelegate->isGuiWindow() : true; if (isGuiWindow) { - global::renderEngine.renderOverlays(_shutdown); - global::luaConsole.render(); - global::sessionRecording.render(); + global::renderEngine->renderOverlays(_shutdown); + global::luaConsole->render(); + global::sessionRecording->render(); } for (const std::function& func : global::callback::draw2D) { @@ -1261,7 +1265,7 @@ void OpenSpaceEngine::postDraw() { TracyGpuZone("postDraw") LTRACE("OpenSpaceEngine::postDraw(begin)"); - global::renderEngine.postDraw(); + global::renderEngine->postDraw(); for (const std::function& func : global::callback::postDraw) { ZoneScopedN("[Module] postDraw") @@ -1270,12 +1274,12 @@ void OpenSpaceEngine::postDraw() { } if (_isFirstRenderingFirstFrame) { - global::windowDelegate.setSynchronization(true); + global::windowDelegate->setSynchronization(true); resetPropertyChangeFlags(); _isFirstRenderingFirstFrame = false; } - global::memoryManager.PersistentMemory.housekeeping(); + global::memoryManager->PersistentMemory.housekeeping(); LTRACE("OpenSpaceEngine::postDraw(end)"); } @@ -1284,7 +1288,7 @@ void OpenSpaceEngine::resetPropertyChangeFlags() { ZoneScoped std::vector nodes = - global::renderEngine.scene()->allSceneGraphNodes(); + global::renderEngine->scene()->allSceneGraphNodes(); for (SceneGraphNode* n : nodes) { resetPropertyChangeFlagsOfSubowners(n); } @@ -1320,16 +1324,16 @@ void OpenSpaceEngine::keyboardCallback(Key key, KeyModifier mod, KeyAction actio } } - if (!global::configuration.isConsoleDisabled) { - bool isConsoleConsumed = global::luaConsole.keyboardCallback(key, mod, action); + if (!global::configuration->isConsoleDisabled) { + bool isConsoleConsumed = global::luaConsole->keyboardCallback(key, mod, action); if (isConsoleConsumed) { return; } } - global::navigationHandler.keyboardCallback(key, mod, action); - global::keybindingManager.keyboardCallback(key, mod, action); - global::interactionMonitor.markInteraction(); + global::navigationHandler->keyboardCallback(key, mod, action); + global::keybindingManager->keyboardCallback(key, mod, action); + global::interactionMonitor->markInteraction(); } void OpenSpaceEngine::charCallback(unsigned int codepoint, KeyModifier modifier) { @@ -1343,8 +1347,8 @@ void OpenSpaceEngine::charCallback(unsigned int codepoint, KeyModifier modifier) } } - global::luaConsole.charCallback(codepoint, modifier); - global::interactionMonitor.markInteraction(); + global::luaConsole->charCallback(codepoint, modifier); + global::interactionMonitor->markInteraction(); } void OpenSpaceEngine::mouseButtonCallback(MouseButton button, @@ -1372,14 +1376,14 @@ void OpenSpaceEngine::mouseButtonCallback(MouseButton button, // Check if the user clicked on one of the 'buttons' the RenderEngine is drawing if (action == MouseAction::Press) { - bool isConsumed = global::renderEngine.mouseActivationCallback(_mousePosition); + bool isConsumed = global::renderEngine->mouseActivationCallback(_mousePosition); if (isConsumed) { return; } } - global::navigationHandler.mouseButtonCallback(button, action); - global::interactionMonitor.markInteraction(); + global::navigationHandler->mouseButtonCallback(button, action); + global::interactionMonitor->markInteraction(); } void OpenSpaceEngine::mousePositionCallback(double x, double y) { @@ -1390,8 +1394,8 @@ void OpenSpaceEngine::mousePositionCallback(double x, double y) { func(x, y); } - global::navigationHandler.mousePositionCallback(x, y); - global::interactionMonitor.markInteraction(); + global::navigationHandler->mousePositionCallback(x, y); + global::interactionMonitor->markInteraction(); _mousePosition = glm::vec2(static_cast(x), static_cast(y)); } @@ -1407,8 +1411,8 @@ void OpenSpaceEngine::mouseScrollWheelCallback(double posX, double posY) { } } - global::navigationHandler.mouseScrollWheelCallback(posY); - global::interactionMonitor.markInteraction(); + global::navigationHandler->mouseScrollWheelCallback(posY); + global::interactionMonitor->markInteraction(); } void OpenSpaceEngine::touchDetectionCallback(TouchInput input) { @@ -1448,14 +1452,14 @@ void OpenSpaceEngine::touchExitCallback(TouchInput input) { std::vector OpenSpaceEngine::encode() { ZoneScoped - std::vector buffer = global::syncEngine.encodeSyncables(); + std::vector buffer = global::syncEngine->encodeSyncables(); return buffer; } void OpenSpaceEngine::decode(std::vector data) { ZoneScoped - global::syncEngine.decodeSyncables(std::move(data)); + global::syncEngine->decodeSyncables(std::move(data)); } void OpenSpaceEngine::toggleShutdownMode() { diff --git a/src/engine/openspaceengine_lua.inl b/src/engine/openspaceengine_lua.inl index db0a9a70fa..f92dad961b 100644 --- a/src/engine/openspaceengine_lua.inl +++ b/src/engine/openspaceengine_lua.inl @@ -39,7 +39,7 @@ namespace openspace::luascriptfunctions { int toggleShutdown(lua_State* L) { ghoul::lua::checkArgumentsAndThrow(L, 0, "lua::toggleShutdown"); - global::openSpaceEngine.toggleShutdownMode(); + global::openSpaceEngine->toggleShutdownMode(); ghoul_assert(lua_gettop(L) == 0, "Incorrect number of items left on stack"); return 0; @@ -53,8 +53,8 @@ int toggleShutdown(lua_State* L) { int writeDocumentation(lua_State* L) { ghoul::lua::checkArgumentsAndThrow(L, 0, "lua::writeDocumentation"); - global::openSpaceEngine.writeStaticDocumentation(); - global::openSpaceEngine.writeSceneDocumentation(); + global::openSpaceEngine->writeStaticDocumentation(); + global::openSpaceEngine->writeSceneDocumentation(); ghoul_assert(lua_gettop(L) == 0, "Incorrect number of items left on stack"); return 0; @@ -132,7 +132,7 @@ int addVirtualProperty(lua_State* L) { } lua_settop(L, 0); - global::virtualPropertyManager.addProperty(std::move(prop)); + global::virtualPropertyManager->addProperty(std::move(prop)); ghoul_assert(lua_gettop(L) == 0, "Incorrect number of items left on stack"); return 0; @@ -147,9 +147,9 @@ int removeVirtualProperty(lua_State* L) { ghoul::lua::checkArgumentsAndThrow(L, 1, "lua::removeVirtualProperty"); const std::string& name = ghoul::lua::value(L, 1); - properties::Property* p = global::virtualPropertyManager.property(name); + properties::Property* p = global::virtualPropertyManager->property(name); if (p) { - global::virtualPropertyManager.removeProperty(p); + global::virtualPropertyManager->removeProperty(p); } else { LWARNINGC( @@ -172,9 +172,9 @@ int removeAllVirtualProperties(lua_State* L) { ghoul::lua::checkArgumentsAndThrow(L, 0, "lua::removeAllVirtualProperties"); const std::vector& ps = - global::virtualPropertyManager.properties(); + global::virtualPropertyManager->properties(); for (properties::Property* p : ps) { - global::virtualPropertyManager.removeProperty(p); + global::virtualPropertyManager->removeProperty(p); delete p; } @@ -194,7 +194,7 @@ int addTag(lua_State* L) { std::string tag = ghoul::lua::value(L, 2); lua_settop(L, 0); - SceneGraphNode* node = global::renderEngine.scene()->sceneGraphNode(uri); + SceneGraphNode* node = global::renderEngine->scene()->sceneGraphNode(uri); if (!node) { return ghoul::lua::luaError( L, @@ -220,7 +220,7 @@ int removeTag(lua_State* L) { const std::string& tag = ghoul::lua::value(L, 2); lua_settop(L, 0); - SceneGraphNode* node = global::renderEngine.scene()->sceneGraphNode(uri); + SceneGraphNode* node = global::renderEngine->scene()->sceneGraphNode(uri); if (!node) { return ghoul::lua::luaError( L, @@ -248,7 +248,7 @@ int downloadFile(lua_State* L) { LINFOC("OpenSpaceEngine", fmt::format("Downloading file from {}", uri)); std::shared_ptr future = - global::downloadManager.downloadFile( + global::downloadManager->downloadFile( uri, savePath, DownloadManager::OverrideFile::Yes, @@ -268,7 +268,7 @@ int downloadFile(lua_State* L) { int isMaster(lua_State* L) { ghoul::lua::checkArgumentsAndThrow(L, 0, "lua::isMaster"); - ghoul::lua::push(L, global::windowDelegate.isMaster()); + ghoul::lua::push(L, global::windowDelegate->isMaster()); return 1; } diff --git a/src/interaction/externinteraction.cpp b/src/interaction/externinteraction.cpp index 7f40dae10e..bb4641017b 100644 --- a/src/interaction/externinteraction.cpp +++ b/src/interaction/externinteraction.cpp @@ -82,7 +82,7 @@ void ExternInteraction::cameraInteraction(datamessagestructures::CameraKeyframe pose.scale = std::move(kf._scale); pose.followFocusNodeRotation = std::move(kf._followNodeRotation); - global::navigationHandler.keyframeNavigator().addKeyframe(kf._timestamp, pose); + global::navigationHandler->keyframeNavigator().addKeyframe(kf._timestamp, pose); } void ExternInteraction::timeInteraction(datamessagestructures::TimeKeyframe kf) { @@ -91,18 +91,18 @@ void ExternInteraction::timeInteraction(datamessagestructures::TimeKeyframe kf) timeKfData.pause = std::move(kf._paused); timeKfData.jump = std::move(kf._requiresTimeJump); - global::timeManager.addKeyframe(kf._timestamp, timeKfData); + global::timeManager->addKeyframe(kf._timestamp, timeKfData); } void ExternInteraction::scriptInteraction(datamessagestructures::ScriptMessage sm) { - global::scriptEngine.queueScript( + global::scriptEngine->queueScript( std::move(sm._script), scripting::ScriptEngine::RemoteScripting::No ); } datamessagestructures::CameraKeyframe ExternInteraction::generateCameraKeyframe() { - interaction::NavigationHandler& navHandler = global::navigationHandler; + interaction::NavigationHandler& navHandler = *global::navigationHandler; datamessagestructures::CameraKeyframe kf; const SceneGraphNode* focusNode = navHandler.orbitalNavigator().anchorNode(); @@ -126,21 +126,21 @@ datamessagestructures::CameraKeyframe ExternInteraction::generateCameraKeyframe( kf._scale = navHandler.camera()->scaling(); // Timestamp as current runtime of OpenSpace instance - kf._timestamp = global::windowDelegate.applicationTime(); + kf._timestamp = global::windowDelegate->applicationTime(); return kf; } datamessagestructures::TimeKeyframe ExternInteraction::generateTimeKeyframe() { datamessagestructures::TimeKeyframe kf; - const Time& time = global::timeManager.time(); + const Time& time = global::timeManager->time(); - kf._dt = global::timeManager.deltaTime(); - kf._paused = global::timeManager.isPaused(); + kf._dt = global::timeManager->deltaTime(); + kf._paused = global::timeManager->isPaused(); kf._time = time.j2000Seconds(); // Timestamp as current runtime of OpenSpace instance - kf._timestamp = global::windowDelegate.applicationTime(); + kf._timestamp = global::windowDelegate->applicationTime(); return kf; } @@ -150,7 +150,7 @@ datamessagestructures::ScriptMessage ExternInteraction::generateScriptMessage( datamessagestructures::ScriptMessage sm; sm._script = std::move(script); // Timestamp as current runtime of OpenSpace instance - sm._timestamp = global::windowDelegate.applicationTime(); + sm._timestamp = global::windowDelegate->applicationTime(); return sm; } diff --git a/src/interaction/inputstate.cpp b/src/interaction/inputstate.cpp index 3eea2e6716..c603937722 100644 --- a/src/interaction/inputstate.cpp +++ b/src/interaction/inputstate.cpp @@ -108,31 +108,31 @@ bool InputState::isMouseButtonPressed(MouseButton mouseButton) const { } float InputState::joystickAxis(int i) const { - return global::joystickInputStates.axis(i); + return global::joystickInputStates->axis(i); } bool InputState::joystickButton(int i) const { - return global::joystickInputStates.button(i, JoystickAction::Press); + return global::joystickInputStates->button(i, JoystickAction::Press); } float InputState::websocketAxis(int i) const { - return global::websocketInputStates.axis(i); + return global::websocketInputStates->axis(i); } bool InputState::websocketButton(int i) const { - return global::websocketInputStates.button(i, WebsocketAction::Press); + return global::websocketInputStates->button(i, WebsocketAction::Press); } void InputState::resetWebsockets() { using K = size_t; using V = WebsocketInputState*; - for (const std::pair& p : global::websocketInputStates) { + for (const std::pair& p : *global::websocketInputStates) { p.second->isConnected = false; } } bool InputState::hasWebsocketStates() const { - return !global::websocketInputStates.empty(); + return !global::websocketInputStates->empty(); } } // namespace openspace::interaction diff --git a/src/interaction/interactionmonitor.cpp b/src/interaction/interactionmonitor.cpp index 78333fe620..2b88c7bcc0 100644 --- a/src/interaction/interactionmonitor.cpp +++ b/src/interaction/interactionmonitor.cpp @@ -65,7 +65,7 @@ void InteractionMonitor::setIdleTime(float time) { } void InteractionMonitor::updateActivityState() { - const double currentApplicationTime = global::windowDelegate.applicationTime(); + const double currentApplicationTime = global::windowDelegate->applicationTime(); const double timeDiff = currentApplicationTime - _lastInteractionTime; if (timeDiff >= _idleTime && _isInActiveState) { @@ -74,7 +74,7 @@ void InteractionMonitor::updateActivityState() { } void InteractionMonitor::markInteraction() { - _lastInteractionTime = global::windowDelegate.applicationTime(); + _lastInteractionTime = global::windowDelegate->applicationTime(); _isInActiveState = true; } diff --git a/src/interaction/joystickcamerastates.cpp b/src/interaction/joystickcamerastates.cpp index bb0a73514d..6f38580fdd 100644 --- a/src/interaction/joystickcamerastates.cpp +++ b/src/interaction/joystickcamerastates.cpp @@ -154,10 +154,10 @@ void JoystickCameraStates::updateStateFromInput(const InputState& inputState, for (int i = 0; i < JoystickInputState::MaxButtons; ++i) { auto itRange = _buttonMapping.equal_range(i); for (auto it = itRange.first; it != itRange.second; ++it) { - bool active = global::joystickInputStates.button(i, it->second.action); + bool active = global::joystickInputStates->button(i, it->second.action); if (active) { - global::scriptEngine.queueScript( + global::scriptEngine->queueScript( it->second.command, scripting::ScriptEngine::RemoteScripting(it->second.synchronization) ); diff --git a/src/interaction/keybindingmanager.cpp b/src/interaction/keybindingmanager.cpp index d74b78efc8..aabe3c3c0c 100644 --- a/src/interaction/keybindingmanager.cpp +++ b/src/interaction/keybindingmanager.cpp @@ -53,7 +53,7 @@ void KeybindingManager::keyboardCallback(Key key, KeyModifier modifier, KeyActio for (auto it = ret.first; it != ret.second; ++it) { using RS = scripting::ScriptEngine::RemoteScripting; - global::scriptEngine.queueScript( + global::scriptEngine->queueScript( it->second.command, it->second.synchronization ? RS::Yes : RS::No ); diff --git a/src/interaction/keybindingmanager_lua.inl b/src/interaction/keybindingmanager_lua.inl index 8f01b04d58..9b4db7fd33 100644 --- a/src/interaction/keybindingmanager_lua.inl +++ b/src/interaction/keybindingmanager_lua.inl @@ -60,7 +60,7 @@ int bindKey(lua_State* L) { std::string name = (nArguments >= 4) ? ghoul::lua::value(L, 4) : ""; std::string guiPath = (nArguments == 5) ? ghoul::lua::value(L, 5) : ""; - global::keybindingManager.bindKey( + global::keybindingManager->bindKey( iKey.key, iKey.modifier, std::move(command), @@ -107,7 +107,7 @@ int bindKeyLocal(lua_State* L) { ghoul::lua::value(L, 5) : ""; - global::keybindingManager.bindKeyLocal( + global::keybindingManager->bindKeyLocal( iKey.key, iKey.modifier, std::move(command), @@ -139,7 +139,7 @@ int getKeyBindings(lua_State* L) { using K = KeyWithModifier; using V = interaction::KeybindingManager::KeyInformation; - const std::vector>& info = global::keybindingManager.keyBinding(key); + const std::vector>& info = global::keybindingManager->keyBinding(key); lua_createtable(L, static_cast(info.size()), 0); int i = 1; @@ -174,7 +174,7 @@ int clearKey(lua_State* L) { if (t == LUA_TSTRING) { // The user provided a single key const std::string& key = ghoul::lua::value(L, 1); - global::keybindingManager.removeKeyBinding(key); + global::keybindingManager->removeKeyBinding(key); } else { // The user provided a list of keys @@ -182,7 +182,7 @@ int clearKey(lua_State* L) { ghoul::lua::luaDictionaryFromState(L, d); for (size_t i = 1; i <= d.size(); ++i) { const std::string& k = d.value(std::to_string(i)); - global::keybindingManager.removeKeyBinding(k); + global::keybindingManager->removeKeyBinding(k); } lua_pop(L, 1); } @@ -200,7 +200,7 @@ int clearKey(lua_State* L) { int clearKeys(lua_State* L) { ghoul::lua::checkArgumentsAndThrow(L, 0, "lua::clearKeys"); - global::keybindingManager.resetKeyBindings(); + global::keybindingManager->resetKeyBindings(); ghoul_assert(lua_gettop(L) == 0, "Incorrect number of items left on stack"); return 0; diff --git a/src/interaction/keyframenavigator.cpp b/src/interaction/keyframenavigator.cpp index ba9c2a7e4b..c7de51ac17 100644 --- a/src/interaction/keyframenavigator.cpp +++ b/src/interaction/keyframenavigator.cpp @@ -189,13 +189,13 @@ bool KeyframeNavigator::updateCamera(Camera* camera, const CameraPose prevPose, double KeyframeNavigator::currentTime() const { if (_timeframeMode == KeyframeTimeRef::Relative_recordedStart) { - return (global::windowDelegate.applicationTime() - _referenceTimestamp); + return (global::windowDelegate->applicationTime() - _referenceTimestamp); } else if (_timeframeMode == KeyframeTimeRef::Absolute_simTimeJ2000) { - return global::timeManager.time().j2000Seconds(); + return global::timeManager->time().j2000Seconds(); } else { - return global::windowDelegate.applicationTime(); + return global::windowDelegate->applicationTime(); } } diff --git a/src/interaction/navigationhandler.cpp b/src/interaction/navigationhandler.cpp index e8d6094b0d..548a0b9c3b 100644 --- a/src/interaction/navigationhandler.cpp +++ b/src/interaction/navigationhandler.cpp @@ -162,11 +162,11 @@ NavigationHandler::~NavigationHandler() {} // NOLINT void NavigationHandler::initialize() { ZoneScoped - global::parallelPeer.connectionEvent().subscribe( + global::parallelPeer->connectionEvent().subscribe( "NavigationHandler", "statusChanged", [this]() { - _useKeyFrameInteraction = (global::parallelPeer.status() == + _useKeyFrameInteraction = (global::parallelPeer->status() == ParallelConnection::Status::ClientWithHost); } ); @@ -175,7 +175,7 @@ void NavigationHandler::initialize() { void NavigationHandler::deinitialize() { ZoneScoped - global::parallelPeer.connectionEvent().unsubscribe("NavigationHandler"); + global::parallelPeer->connectionEvent().unsubscribe("NavigationHandler"); } void NavigationHandler::setFocusNode(SceneGraphNode* node) { diff --git a/src/interaction/navigationhandler_lua.inl b/src/interaction/navigationhandler_lua.inl index f29fdb7a11..4ccb59d75c 100644 --- a/src/interaction/navigationhandler_lua.inl +++ b/src/interaction/navigationhandler_lua.inl @@ -40,7 +40,7 @@ int loadNavigationState(lua_State* L) { return ghoul::lua::luaError(L, "filepath string is empty"); } - global::navigationHandler.loadNavigationState(cameraStateFilePath); + global::navigationHandler->loadNavigationState(cameraStateFilePath); ghoul_assert(lua_gettop(L) == 0, "Incorrect number of items left on stack"); return 0; @@ -65,10 +65,10 @@ int getNavigationState(lua_State* L) { lua_settop(L, 0); return 0; } - state = global::navigationHandler.navigationState(*referenceFrame); + state = global::navigationHandler->navigationState(*referenceFrame); } else { - state = global::navigationHandler.navigationState(); + state = global::navigationHandler->navigationState(); } lua_settop(L, 0); @@ -135,7 +135,7 @@ int setNavigationState(lua_State* L) { ); } - global::navigationHandler.setNavigationStateNextFrame(navigationStateDictionary); + global::navigationHandler->setNavigationStateNextFrame(navigationStateDictionary); // @CLEANUP: When luaDictionaryFromState doesn't leak space anymore, remove the next // line ---abock(2018-02-15) @@ -162,7 +162,7 @@ int saveNavigationState(lua_State* L) { return ghoul::lua::luaError(L, "filepath string is empty"); } - global::navigationHandler.saveNavigationState(cameraStateFilePath, referenceFrame); + global::navigationHandler->saveNavigationState(cameraStateFilePath, referenceFrame); lua_settop(L, 0); ghoul_assert(lua_gettop(L) == 0, "Incorrect number of items left on stack"); @@ -172,7 +172,7 @@ int saveNavigationState(lua_State* L) { int retargetAnchor(lua_State* L) { ghoul::lua::checkArgumentsAndThrow(L, 0, "lua::retargetAnchor"); - global::navigationHandler.orbitalNavigator().startRetargetAnchor(); + global::navigationHandler->orbitalNavigator().startRetargetAnchor(); ghoul_assert(lua_gettop(L) == 0, "Incorrect number of items left on stack"); return 0; @@ -181,7 +181,7 @@ int retargetAnchor(lua_State* L) { int retargetAim(lua_State* L) { ghoul::lua::checkArgumentsAndThrow(L, 0, "lua::retargetAim"); - global::navigationHandler.orbitalNavigator().startRetargetAim(); + global::navigationHandler->orbitalNavigator().startRetargetAim(); ghoul_assert(lua_gettop(L) == 0, "Incorrect number of items left on stack"); return 0; @@ -200,7 +200,7 @@ int bindJoystickAxis(lua_State* L) { const bool shouldInvert = n > 2 ? ghoul::lua::value(L, 3) : false; const bool shouldNormalize = n > 3 ? ghoul::lua::value(L, 4) : false; - global::navigationHandler.setJoystickAxisMapping( + global::navigationHandler->setJoystickAxisMapping( axis, ghoul::from_string(axisType), interaction::JoystickCameraStates::AxisInvert(shouldInvert), @@ -218,7 +218,7 @@ int joystickAxis(lua_State* L) { const int axis = ghoul::lua::value(L, 1); using AI = interaction::JoystickCameraStates::AxisInformation; - AI info = global::navigationHandler.joystickAxisMapping(axis); + AI info = global::navigationHandler->joystickAxisMapping(axis); lua_settop(L, 0); const bool invert = info.invert; @@ -236,7 +236,7 @@ int setJoystickAxisDeadzone(lua_State* L) { const float deadzone = ghoul::lua::value(L, 2); lua_settop(L, 0); - global::navigationHandler.setJoystickAxisDeadzone(axis, deadzone); + global::navigationHandler->setJoystickAxisDeadzone(axis, deadzone); ghoul_assert(lua_gettop(L) == 0, "Incorrect number of items left on stack"); return 0; @@ -247,7 +247,7 @@ int joystickAxisDeadzone(lua_State* L) { const int axis = ghoul::lua::value(L, 1, ghoul::lua::PopValue::Yes); - const float deadzone = global::navigationHandler.joystickAxisDeadzone(axis); + const float deadzone = global::navigationHandler->joystickAxisDeadzone(axis); ghoul::lua::push(L, deadzone); ghoul_assert(lua_gettop(L) == 1, "Incorrect number of items left on stack"); @@ -274,7 +274,7 @@ int bindJoystickButton(lua_State* L) { const bool isRemote = n == 5 ? ghoul::lua::value(L, 5) : true; lua_settop(L, 0); - global::navigationHandler.bindJoystickButtonCommand( + global::navigationHandler->bindJoystickButtonCommand( button, std::move(command), action, @@ -291,7 +291,7 @@ int clearJoystickButton(lua_State* L) { const int button = ghoul::lua::value(L, 1, ghoul::lua::PopValue::Yes); - global::navigationHandler.clearJoystickButtonCommand(button); + global::navigationHandler->clearJoystickButtonCommand(button); ghoul_assert(lua_gettop(L) == 0, "Incorrect number of items left on stack"); return 0; @@ -303,7 +303,7 @@ int joystickButton(lua_State* L) { const int button = ghoul::lua::value(L, 1, ghoul::lua::PopValue::Yes); const std::vector& cmds = - global::navigationHandler.joystickButtonCommand(button); + global::navigationHandler->joystickButtonCommand(button); std::string cmd = std::accumulate( cmds.begin(), @@ -325,7 +325,7 @@ int addGlobalRotation(lua_State* L) { const double v1 = ghoul::lua::value(L, 1, ghoul::lua::PopValue::No); const double v2 = ghoul::lua::value(L, 2, ghoul::lua::PopValue::No); - global::navigationHandler.orbitalNavigator().scriptStates().addGlobalRotation( + global::navigationHandler->orbitalNavigator().scriptStates().addGlobalRotation( glm::dvec2(v1, v2) ); @@ -339,7 +339,7 @@ int addLocalRotation(lua_State* L) { const double v1 = ghoul::lua::value(L, 1, ghoul::lua::PopValue::No); const double v2 = ghoul::lua::value(L, 2, ghoul::lua::PopValue::No); - global::navigationHandler.orbitalNavigator().scriptStates().addLocalRotation( + global::navigationHandler->orbitalNavigator().scriptStates().addLocalRotation( glm::dvec2(v1, v2) ); @@ -353,7 +353,7 @@ int addTruckMovement(lua_State* L) { const double v1 = ghoul::lua::value(L, 1, ghoul::lua::PopValue::No); const double v2 = ghoul::lua::value(L, 2, ghoul::lua::PopValue::No); - global::navigationHandler.orbitalNavigator().scriptStates().addTruckMovement( + global::navigationHandler->orbitalNavigator().scriptStates().addTruckMovement( glm::dvec2(v1, v2) ); @@ -367,7 +367,7 @@ int addLocalRoll(lua_State* L) { const double v1 = ghoul::lua::value(L, 1, ghoul::lua::PopValue::No); const double v2 = ghoul::lua::value(L, 2, ghoul::lua::PopValue::No); - global::navigationHandler.orbitalNavigator().scriptStates().addLocalRoll( + global::navigationHandler->orbitalNavigator().scriptStates().addLocalRoll( glm::dvec2(v1, v2) ); @@ -381,7 +381,7 @@ int addGlobalRoll(lua_State* L) { const double v1 = ghoul::lua::value(L, 1, ghoul::lua::PopValue::No); const double v2 = ghoul::lua::value(L, 2, ghoul::lua::PopValue::No); - global::navigationHandler.orbitalNavigator().scriptStates().addGlobalRoll( + global::navigationHandler->orbitalNavigator().scriptStates().addGlobalRoll( glm::dvec2(v1, v2) ); diff --git a/src/interaction/sessionrecording.cpp b/src/interaction/sessionrecording.cpp index 56a5f3a462..9425204fe9 100644 --- a/src/interaction/sessionrecording.cpp +++ b/src/interaction/sessionrecording.cpp @@ -180,10 +180,10 @@ bool SessionRecording::startRecording(const std::string& filename) { } _recordFile << '\n'; - _timestampRecordStarted = global::windowDelegate.applicationTime(); + _timestampRecordStarted = global::windowDelegate->applicationTime(); //Record the current delta time so this is preserved in recording - double currentDeltaTime = global::timeManager.deltaTime(); + double currentDeltaTime = global::timeManager->deltaTime(); std::string scriptCommandForInitializingDeltaTime = "openspace.time.setDeltaTime(" + std::to_string(currentDeltaTime) + ")"; saveScriptKeyframe(scriptCommandForInitializingDeltaTime); @@ -277,9 +277,9 @@ bool SessionRecording::startPlayback(const std::string& filename, return false; } //Set time reference mode - double now = global::windowDelegate.applicationTime(); + double now = global::windowDelegate->applicationTime(); _timestampPlaybackStarted_application = now; - _timestampPlaybackStarted_simulation = global::timeManager.time().j2000Seconds(); + _timestampPlaybackStarted_simulation = global::timeManager->time().j2000Seconds(); _timestampApplicationStarted_simulation = _timestampPlaybackStarted_simulation - now; _playbackTimeReferenceMode = timeMode; @@ -290,8 +290,8 @@ bool SessionRecording::startPlayback(const std::string& filename, _playbackActive_time = true; } - global::navigationHandler.keyframeNavigator().setTimeReferenceMode(timeMode, now); - global::scriptScheduler.setTimeReferenceMode(timeMode); + global::navigationHandler->keyframeNavigator().setTimeReferenceMode(timeMode, now); + global::scriptScheduler->setTimeReferenceMode(timeMode); _setSimulationTimeWithNextCameraKeyframe = forceSimTimeAtStart; if (!playbackAddEntriesToTimeline()) { @@ -309,9 +309,9 @@ bool SessionRecording::startPlayback(const std::string& filename, _keyframesTime.size(), _keyframesScript.size(), (forceSimTimeAtStart ? 1 : 0) )); - global::navigationHandler.triggerPlaybackStart(); - global::scriptScheduler.triggerPlaybackStart(); - global::timeManager.triggerPlaybackStart(); + global::navigationHandler->triggerPlaybackStart(); + global::scriptScheduler->triggerPlaybackStart(); + global::timeManager->triggerPlaybackStart(); _state = SessionState::Playback; return true; @@ -375,20 +375,20 @@ void SessionRecording::stopPlayback() { } void SessionRecording::cleanUpPlayback() { - global::navigationHandler.stopPlayback(); - global::timeManager.stopPlayback(); + global::navigationHandler->stopPlayback(); + global::timeManager->stopPlayback(); - Camera* camera = global::navigationHandler.camera(); + Camera* camera = global::navigationHandler->camera(); ghoul_assert(camera != nullptr, "Camera must not be nullptr"); Scene* scene = camera->parent()->scene(); if (!_timeline.empty()) { unsigned int p = _timeline[_idxTimeline_cameraPtrPrev].idxIntoKeyframeTypeArray; - const SceneGraphNode* node = scene->sceneGraphNode(_keyframesCamera[p].focusNode); - if (node) { - global::navigationHandler.orbitalNavigator().setFocusNode(node->identifier()); + const SceneGraphNode* n = scene->sceneGraphNode(_keyframesCamera[p].focusNode); + if (n) { + global::navigationHandler->orbitalNavigator().setFocusNode(n->identifier()); } } - global::scriptScheduler.stopPlayback(); + global::scriptScheduler->stopPlayback(); _playbackFile.close(); @@ -486,7 +486,7 @@ void SessionRecording::saveCameraKeyframe() { return; } - const SceneGraphNode* an = global::navigationHandler.orbitalNavigator().anchorNode(); + const SceneGraphNode* an = global::navigationHandler->orbitalNavigator().anchorNode(); if (!an) { return; } @@ -498,7 +498,7 @@ void SessionRecording::saveCameraKeyframe() { Timestamps times = { kf._timestamp, kf._timestamp - _timestampRecordStarted, - global::timeManager.time().j2000Seconds() + global::timeManager->time().j2000Seconds() }; if (_recordingDataMode == DataMode::Binary) { saveCameraKeyframeBinary(times, kf, _keyframeBuffer, _recordFile); @@ -565,7 +565,7 @@ void SessionRecording::saveTimeKeyframe() { Timestamps times = { kf._timestamp, kf._timestamp - _timestampRecordStarted, - global::timeManager.time().j2000Seconds() + global::timeManager->time().j2000Seconds() }; if (_recordingDataMode == DataMode::Binary) { saveTimeKeyframeBinary(times, kf, _keyframeBuffer, _recordFile); @@ -608,7 +608,7 @@ void SessionRecording::saveScriptKeyframe(std::string scriptToSave) { Timestamps times = { sm._timestamp, sm._timestamp - _timestampRecordStarted, - global::timeManager.time().j2000Seconds() + global::timeManager->time().j2000Seconds() }; if (_recordingDataMode == DataMode::Binary) { @@ -682,9 +682,9 @@ void SessionRecording::render() { constexpr const char* FontName = "Mono"; constexpr const float FontSizeFrameinfo = 32.f; std::shared_ptr font = - global::fontManager.font(FontName, FontSizeFrameinfo); + global::fontManager->font(FontName, FontSizeFrameinfo); - glm::vec2 res = global::renderEngine.fontResolution(); + glm::vec2 res = global::renderEngine->fontResolution(); glm::vec2 penPosition = glm::vec2( res.x / 2 - 150.f, res.y / 4 @@ -842,14 +842,14 @@ double SessionRecording::currentTime() const { return _saveRenderingCurrentRecordedTime; } else if (_playbackTimeReferenceMode == KeyframeTimeRef::Relative_recordedStart) { - return (global::windowDelegate.applicationTime() - + return (global::windowDelegate->applicationTime() - _timestampPlaybackStarted_application); } else if (_playbackTimeReferenceMode == KeyframeTimeRef::Absolute_simTimeJ2000) { - return global::timeManager.time().j2000Seconds(); + return global::timeManager->time().j2000Seconds(); } else { - return global::windowDelegate.applicationTime(); + return global::windowDelegate->applicationTime(); } } @@ -857,7 +857,7 @@ double SessionRecording::fixedDeltaTimeDuringFrameOutput() const { // Check if renderable in focus is still resolving tile loading // do not adjust time while we are doing this const SceneGraphNode* focusNode = - global::navigationHandler.orbitalNavigator().anchorNode(); + global::navigationHandler->orbitalNavigator().anchorNode(); const Renderable* focusRenderable = focusNode->renderable(); if (!focusRenderable || focusRenderable->renderedWithDesiredData()) { return _saveRenderingDeltaTime; @@ -879,7 +879,7 @@ bool SessionRecording::playbackCamera() { } if (_setSimulationTimeWithNextCameraKeyframe) { - global::timeManager.setTimeNextFrame(Time(times.timeSim)); + global::timeManager->setTimeNextFrame(Time(times.timeSim)); _setSimulationTimeWithNextCameraKeyframe = false; _saveRenderingCurrentRecordedTime = times.timeRec; } @@ -1169,11 +1169,11 @@ void SessionRecording::moveAheadInTime() { // Check if renderable in focus is still resolving tile loading // do not adjust time while we are doing this, or take screenshot const SceneGraphNode* focusNode = - global::navigationHandler.orbitalNavigator().anchorNode(); + global::navigationHandler->orbitalNavigator().anchorNode(); const Renderable* focusRenderable = focusNode->renderable(); if (!focusRenderable || focusRenderable->renderedWithDesiredData()) { _saveRenderingCurrentRecordedTime += _saveRenderingDeltaTime; - global::renderEngine.takeScreenshot(); + global::renderEngine->takeScreenshot(); } } } @@ -1348,17 +1348,17 @@ bool SessionRecording::processCameraKeyframe(double now) { // Need to activly update the focusNode position of the camera in relation to // the rendered objects will be unstable and actually incorrect - Camera* camera = global::navigationHandler.camera(); + Camera* camera = global::navigationHandler->camera(); Scene* scene = camera->parent()->scene(); const SceneGraphNode* n = scene->sceneGraphNode(_keyframesCamera[prevIdx].focusNode); if (n) { - global::navigationHandler.orbitalNavigator().setFocusNode(n->identifier()); + global::navigationHandler->orbitalNavigator().setFocusNode(n->identifier()); } return interaction::KeyframeNavigator::updateCamera( - global::navigationHandler.camera(), + global::navigationHandler->camera(), prevPose, nextPose, t, @@ -1379,7 +1379,7 @@ bool SessionRecording::processScriptKeyframe() { _keyframesScript, ([this]() { signalPlaybackFinishedForComponent(RecordedType::Script); }) ); - global::scriptEngine.queueScript( + global::scriptEngine->queueScript( nextScript, scripting::ScriptEngine::RemoteScripting::Yes ); diff --git a/src/interaction/sessionrecording_lua.inl b/src/interaction/sessionrecording_lua.inl index 303e647326..e2b47d8bd8 100644 --- a/src/interaction/sessionrecording_lua.inl +++ b/src/interaction/sessionrecording_lua.inl @@ -39,10 +39,10 @@ int startRecording(lua_State* L) { if (recordFilePath.empty()) { return luaL_error(L, "filepath string is empty"); } - global::sessionRecording.setRecordDataFormat( + global::sessionRecording->setRecordDataFormat( interaction::SessionRecording::DataMode::Binary ); - global::sessionRecording.startRecording(recordFilePath); + global::sessionRecording->startRecording(recordFilePath); ghoul_assert(lua_gettop(L) == 0, "Incorrect number of items left on stack"); return 0; @@ -62,10 +62,10 @@ int startRecordingAscii(lua_State* L) { if (recordFilePath.empty()) { return luaL_error(L, "filepath string is empty"); } - global::sessionRecording.setRecordDataFormat( + global::sessionRecording->setRecordDataFormat( interaction::SessionRecording::DataMode::Ascii ); - global::sessionRecording.startRecording(recordFilePath); + global::sessionRecording->startRecording(recordFilePath); ghoul_assert(lua_gettop(L) == 0, "Incorrect number of items left on stack"); return 0; @@ -74,7 +74,7 @@ int startRecordingAscii(lua_State* L) { int stopRecording(lua_State* L) { ghoul::lua::checkArgumentsAndThrow(L, 0, "lua::stopRecording"); - global::sessionRecording.stopRecording(); + global::sessionRecording->stopRecording(); ghoul_assert(lua_gettop(L) == 0, "Incorrect number of items left on stack"); return 0; @@ -95,7 +95,7 @@ int startPlayback(lua_State* L, interaction::KeyframeTimeRef timeMode, return luaL_error(L, "filepath string is empty"); } - global::sessionRecording.startPlayback( + global::sessionRecording->startPlayback( playbackFilePath, timeMode, forceSimTimeAtStart @@ -136,7 +136,7 @@ int startPlaybackSimulationTime(lua_State* L) { int stopPlayback(lua_State* L) { ghoul::lua::checkArgumentsAndThrow(L, 0, "lua::stopPlayback"); - global::sessionRecording.stopPlayback(); + global::sessionRecording->stopPlayback(); ghoul_assert(lua_gettop(L) == 0, "Incorrect number of items left on stack"); return 0; @@ -151,7 +151,7 @@ int enableTakeScreenShotDuringPlayback(lua_State* L) { const int fps = nArguments == 0 ? 60 : ghoul::lua::value(L, 1); - global::sessionRecording.enableTakeScreenShotDuringPlayback(fps); + global::sessionRecording->enableTakeScreenShotDuringPlayback(fps); lua_settop(L, 0); ghoul_assert(lua_gettop(L) == 0, "Incorrect number of items left on stack"); @@ -161,7 +161,7 @@ int enableTakeScreenShotDuringPlayback(lua_State* L) { int disableTakeScreenShotDuringPlayback(lua_State* L) { ghoul::lua::checkArgumentsAndThrow(L, 0, "lua::disableTakeScreenShotDuringPlayback"); - global::sessionRecording.disableTakeScreenShotDuringPlayback(); + global::sessionRecording->disableTakeScreenShotDuringPlayback(); ghoul_assert(lua_gettop(L) == 0, "Incorrect number of items left on stack"); return 0; diff --git a/src/interaction/shortcutmanager_lua.inl b/src/interaction/shortcutmanager_lua.inl index 106bb0321f..fcce0b314a 100644 --- a/src/interaction/shortcutmanager_lua.inl +++ b/src/interaction/shortcutmanager_lua.inl @@ -52,7 +52,7 @@ namespace openspace::luascriptfunctions { int clearShortcuts(lua_State* L) { ghoul::lua::checkArgumentsAndThrow(L, 0, "lua::clearShortcuts"); - global::shortcutManager.resetShortcuts(); + global::shortcutManager->resetShortcuts(); return 0; } @@ -60,7 +60,7 @@ int bindShortcut(lua_State* L) { int n = ghoul::lua::checkArgumentsAndThrow(L, { 2, 4 }, "lua::bindShortcut"); interaction::ShortcutManager::ShortcutInformation info = extractInfo(L, n, true); - global::shortcutManager.addShortcut(std::move(info)); + global::shortcutManager->addShortcut(std::move(info)); ghoul_assert(lua_gettop(L) == 0, "Incorrect number of items left on stack"); return 0; @@ -70,7 +70,7 @@ int bindShortcutLocal(lua_State* L) { int n = ghoul::lua::checkArgumentsAndThrow(L, { 2, 4 }, "lua::bindShortcutLocal"); interaction::ShortcutManager::ShortcutInformation info = extractInfo(L, n, false); - global::shortcutManager.addShortcut(std::move(info)); + global::shortcutManager->addShortcut(std::move(info)); ghoul_assert(lua_gettop(L) == 0, "Incorrect number of items left on stack"); return 0; diff --git a/src/mission/missionmanager_lua.inl b/src/mission/missionmanager_lua.inl index ca3269fcca..283e5c46cc 100644 --- a/src/mission/missionmanager_lua.inl +++ b/src/mission/missionmanager_lua.inl @@ -38,7 +38,7 @@ int loadMission(lua_State* L) { return ghoul::lua::luaError(L, "Filepath is empty"); } - std::string name = global::missionManager.loadMission(absPath(missionFileName)); + std::string name = global::missionManager->loadMission(absPath(missionFileName)); ghoul::lua::push(L, name); ghoul_assert(lua_gettop(L) == 1, "Incorrect number of items left on stack"); @@ -57,11 +57,11 @@ int unloadMission(lua_State* L) { return ghoul::lua::luaError(L, "Mission name is empty"); } - if (!global::missionManager.hasMission(missionName)) { + if (!global::missionManager->hasMission(missionName)) { return ghoul::lua::luaError(L, "Mission was not previously loaded"); } - global::missionManager.unloadMission(missionName); + global::missionManager->unloadMission(missionName); ghoul_assert(lua_gettop(L) == 0, "Incorrect number of items left on stack"); return 0; @@ -79,7 +79,7 @@ int hasMission(lua_State* L) { return ghoul::lua::luaError(L, "Missing name is empty"); } - const bool hasMission = global::missionManager.hasMission(missionName); + const bool hasMission = global::missionManager->hasMission(missionName); ghoul::lua::push(L, hasMission); @@ -99,7 +99,7 @@ int setCurrentMission(lua_State* L) { return ghoul::lua::luaError(L, "Mission name is empty"); } - global::missionManager.setCurrentMission(missionName); + global::missionManager->setCurrentMission(missionName); ghoul_assert(lua_gettop(L) == 0, "Incorrect number of items left on stack"); return 0; diff --git a/src/network/parallelpeer.cpp b/src/network/parallelpeer.cpp index 7a6de5c9de..184ac07c1f 100644 --- a/src/network/parallelpeer.cpp +++ b/src/network/parallelpeer.cpp @@ -127,10 +127,10 @@ ParallelPeer::ParallelPeer() ParallelPeer::~ParallelPeer() { disconnect(); if (_timeJumpCallback != -1) { - global::timeManager.removeTimeJumpCallback(_timeJumpCallback); + global::timeManager->removeTimeJumpCallback(_timeJumpCallback); } if (_timeJumpCallback != -1) { - global::timeManager.removeTimeJumpCallback(_timeJumpCallback); + global::timeManager->removeTimeJumpCallback(_timeJumpCallback); } } @@ -227,7 +227,7 @@ void ParallelPeer::handleMessage(const ParallelConnection::Message& message) { void ParallelPeer::analyzeTimeDifference(double messageTimestamp) { std::lock_guard latencyLock(_latencyMutex); - const double timeDiff = global::windowDelegate.applicationTime() - messageTimestamp; + const double timeDiff = global::windowDelegate->applicationTime() - messageTimestamp; if (_latencyDiffs.empty()) { _initialTimeDiff = timeDiff; } @@ -283,7 +283,7 @@ void ParallelPeer::dataMessageReceived(const std::vector& message) datamessagestructures::CameraKeyframe kf(buffer); const double convertedTimestamp = convertTimestamp(kf._timestamp); - global::navigationHandler.keyframeNavigator().removeKeyframesAfter( + global::navigationHandler->keyframeNavigator().removeKeyframesAfter( convertedTimestamp ); @@ -294,16 +294,16 @@ void ParallelPeer::dataMessageReceived(const std::vector& message) pose.scale = kf._scale; pose.followFocusNodeRotation = kf._followNodeRotation; - global::navigationHandler.keyframeNavigator().addKeyframe(convertedTimestamp, + global::navigationHandler->keyframeNavigator().addKeyframe(convertedTimestamp, pose); break; } case datamessagestructures::Type::TimelineData: { - const double now = global::windowDelegate.applicationTime(); + const double now = global::windowDelegate->applicationTime(); datamessagestructures::TimeTimeline timelineMessage(buffer); if (timelineMessage._clear) { - global::timeManager.removeKeyframesAfter( + global::timeManager->removeKeyframesAfter( convertTimestamp(timestamp), true ); @@ -318,7 +318,7 @@ void ParallelPeer::dataMessageReceived(const std::vector& message) const double convertedTimestamp = convertTimestamp(keyframesMessage[0]._timestamp); - global::timeManager.removeKeyframesAfter(convertedTimestamp, true); + global::timeManager->removeKeyframesAfter(convertedTimestamp, true); } for (const datamessagestructures::TimeKeyframe& kfMessage : keyframesMessage) @@ -334,9 +334,9 @@ void ParallelPeer::dataMessageReceived(const std::vector& message) // We only need at least one keyframe before the current timestamp, // so we can remove any other previous ones if (kfTimestamp < now) { - global::timeManager.removeKeyframesBefore(kfTimestamp, true); + global::timeManager->removeKeyframesBefore(kfTimestamp, true); } - global::timeManager.addKeyframe( + global::timeManager->addKeyframe( kfTimestamp, timeKeyframeData ); @@ -347,7 +347,7 @@ void ParallelPeer::dataMessageReceived(const std::vector& message) datamessagestructures::ScriptMessage sm; sm.deserialize(buffer); - global::scriptEngine.queueScript( + global::scriptEngine->queueScript( sm._script, scripting::ScriptEngine::RemoteScripting::No ); @@ -407,8 +407,8 @@ void ParallelPeer::connectionStatusMessageReceived(const std::vector& mess setStatus(status); - global::navigationHandler.keyframeNavigator().clearKeyframes(); - global::timeManager.clearKeyframes(); + global::navigationHandler->keyframeNavigator().clearKeyframes(); + global::timeManager->clearKeyframes(); } void ParallelPeer::nConnectionsMessageReceived(const std::vector& message) @@ -487,7 +487,7 @@ void ParallelPeer::sendScript(std::string script) { std::vector buffer; sm.serialize(buffer); - double timestamp = global::windowDelegate.applicationTime(); + double timestamp = global::windowDelegate->applicationTime(); ParallelConnection::DataMessage message( datamessagestructures::Type::ScriptData, timestamp, @@ -497,8 +497,8 @@ void ParallelPeer::sendScript(std::string script) { } void ParallelPeer::resetTimeOffset() { - global::navigationHandler.keyframeNavigator().clearKeyframes(); - global::timeManager.clearKeyframes(); + global::navigationHandler->keyframeNavigator().clearKeyframes(); + global::timeManager->clearKeyframes(); std::lock_guard latencyLock(_latencyMutex); _latencyDiffs.clear(); } @@ -514,7 +514,7 @@ void ParallelPeer::preSynchronization() { } if (isHost()) { - double now = global::windowDelegate.applicationTime(); + double now = global::windowDelegate->applicationTime(); if (_lastCameraKeyframeTimestamp + _cameraKeyframeInterval < now) { sendCameraKeyframe(); @@ -541,19 +541,21 @@ void ParallelPeer::setStatus(ParallelConnection::Status status) { _connectionEvent->publish("statusChanged"); } if (isHost()) { - global::timeManager.addTimeJumpCallback([this]() { + global::timeManager->addTimeJumpCallback([this]() { _timeJumped = true; }); - global::timeManager.addTimelineChangeCallback([this]() { + global::timeManager->addTimelineChangeCallback([this]() { _timeTimelineChanged = true; }); } else { if (_timeJumpCallback != -1) { - global::timeManager.removeTimeJumpCallback(_timeJumpCallback); + global::timeManager->removeTimeJumpCallback(_timeJumpCallback); } if (_timeTimelineChangeCallback != -1) { - global::timeManager.removeTimelineChangeCallback(_timeTimelineChangeCallback); + global::timeManager->removeTimelineChangeCallback( + _timeTimelineChangeCallback + ); } } } @@ -589,7 +591,7 @@ const std::string& ParallelPeer::hostName() { } void ParallelPeer::sendCameraKeyframe() { - interaction::NavigationHandler& navHandler = global::navigationHandler; + interaction::NavigationHandler& navHandler = *global::navigationHandler; const SceneGraphNode* focusNode = navHandler.orbitalNavigator().anchorNode(); @@ -614,7 +616,7 @@ void ParallelPeer::sendCameraKeyframe() { kf._scale = navHandler.camera()->scaling(); // Timestamp as current runtime of OpenSpace instance - kf._timestamp = global::windowDelegate.applicationTime(); + kf._timestamp = global::windowDelegate->applicationTime(); // Create a buffer for the keyframe std::vector buffer; @@ -622,7 +624,7 @@ void ParallelPeer::sendCameraKeyframe() { // Fill the keyframe buffer kf.serialize(buffer); - const double timestamp = global::windowDelegate.applicationTime(); + const double timestamp = global::windowDelegate->applicationTime(); // Send message _connection.sendDataMessage(ParallelConnection::DataMessage( datamessagestructures::Type::CameraData, @@ -633,7 +635,7 @@ void ParallelPeer::sendCameraKeyframe() { void ParallelPeer::sendTimeTimeline() { // Create a keyframe with current position and orientation of camera - const Timeline& timeline = global::timeManager.timeline(); + const Timeline& timeline = global::timeManager->timeline(); std::deque> keyframes = timeline.keyframes(); datamessagestructures::TimeTimeline timelineMessage; @@ -658,10 +660,10 @@ void ParallelPeer::sendTimeTimeline() { // If time jumped this frame, this is represented in the keyframe. if (timeline.nKeyframes() == 0) { datamessagestructures::TimeKeyframe kfMessage; - kfMessage._time = global::timeManager.time().j2000Seconds(); - kfMessage._dt = global::timeManager.targetDeltaTime(); - kfMessage._paused = global::timeManager.isPaused(); - kfMessage._timestamp = global::windowDelegate.applicationTime(); + kfMessage._time = global::timeManager->time().j2000Seconds(); + kfMessage._dt = global::timeManager->targetDeltaTime(); + kfMessage._paused = global::timeManager->isPaused(); + kfMessage._timestamp = global::windowDelegate->applicationTime(); kfMessage._requiresTimeJump = _timeJumped; timelineMessage._keyframes.push_back(kfMessage); } @@ -671,7 +673,7 @@ void ParallelPeer::sendTimeTimeline() { // Fill the timeline buffer timelineMessage.serialize(buffer); - double timestamp = global::windowDelegate.applicationTime(); + double timestamp = global::windowDelegate->applicationTime(); // Send message _connection.sendDataMessage(ParallelConnection::DataMessage( datamessagestructures::Type::TimelineData, diff --git a/src/network/parallelpeer_lua.inl b/src/network/parallelpeer_lua.inl index 583e3eea07..b48c81337f 100644 --- a/src/network/parallelpeer_lua.inl +++ b/src/network/parallelpeer_lua.inl @@ -27,8 +27,8 @@ namespace openspace::luascriptfunctions { int connect(lua_State* L) { ghoul::lua::checkArgumentsAndThrow(L, 0, "lua::connect"); - if (global::windowDelegate.isMaster()) { - global::parallelPeer.connect(); + if (global::windowDelegate->isMaster()) { + global::parallelPeer->connect(); } ghoul_assert(lua_gettop(L) == 0, "Incorrect number of items left on stack"); @@ -38,8 +38,8 @@ int connect(lua_State* L) { int disconnect(lua_State* L) { ghoul::lua::checkArgumentsAndThrow(L, 0, "lua::disconnect"); - if (global::windowDelegate.isMaster()) { - global::parallelPeer.connect(); + if (global::windowDelegate->isMaster()) { + global::parallelPeer->connect(); } ghoul_assert(lua_gettop(L) == 0, "Incorrect number of items left on stack"); @@ -49,8 +49,8 @@ int disconnect(lua_State* L) { int requestHostship(lua_State* L) { ghoul::lua::checkArgumentsAndThrow(L, 0, "lua::requestHostship"); - if (global::windowDelegate.isMaster()) { - global::parallelPeer.requestHostship(); + if (global::windowDelegate->isMaster()) { + global::parallelPeer->requestHostship(); } ghoul_assert(lua_gettop(L) == 0, "Incorrect number of items left on stack"); @@ -60,8 +60,8 @@ int requestHostship(lua_State* L) { int resignHostship(lua_State* L) { ghoul::lua::checkArgumentsAndThrow(L, 0, "lua::resignHostship"); - if (global::windowDelegate.isMaster()) { - global::parallelPeer.resignHostship(); + if (global::windowDelegate->isMaster()) { + global::parallelPeer->resignHostship(); } ghoul_assert(lua_gettop(L) == 0, "Incorrect number of items left on stack"); diff --git a/src/query/query.cpp b/src/query/query.cpp index b4a0fc490a..76da802137 100644 --- a/src/query/query.cpp +++ b/src/query/query.cpp @@ -32,7 +32,7 @@ namespace openspace { Scene* sceneGraph() { - return global::renderEngine.scene(); + return global::renderEngine->scene(); } SceneGraphNode* sceneGraphNode(const std::string& name) { @@ -49,7 +49,7 @@ const Renderable* renderable(const std::string& name) { } properties::Property* property(const std::string& uri) { - properties::Property* property = global::rootPropertyOwner.property(uri); + properties::Property* property = global::rootPropertyOwner->property(uri); return property; } @@ -57,14 +57,14 @@ std::vector allProperties() { std::vector properties; std::vector p = - global::rootPropertyOwner.propertiesRecursive(); + global::rootPropertyOwner->propertiesRecursive(); properties.insert(properties.end(), p.begin(), p.end()); // The virtual property manager is not part of the rootProperty owner since it cannot // have an identifier or the "regex as identifier" trick would not work std::vector p2 = - global::virtualPropertyManager.propertiesRecursive(); + global::virtualPropertyManager->propertiesRecursive(); properties.insert(properties.end(), p2.begin(), p2.end()); diff --git a/src/rendering/dashboard_lua.inl b/src/rendering/dashboard_lua.inl index 7b61ff47ab..40ac6930f1 100644 --- a/src/rendering/dashboard_lua.inl +++ b/src/rendering/dashboard_lua.inl @@ -49,7 +49,7 @@ int addDashboardItem(lua_State* L) { lua_settop(L, 0); try { - global::dashboard.addDashboardItem(DashboardItem::createFromDictionary(d)); + global::dashboard->addDashboardItem(DashboardItem::createFromDictionary(d)); } catch (const ghoul::RuntimeError& e) { LERRORC("addDashboardItem", e.what()); @@ -75,7 +75,7 @@ int removeDashboardItem(lua_State* L) { std::string identifier = luaL_checkstring(L, -1); - global::dashboard.removeDashboardItem(identifier); + global::dashboard->removeDashboardItem(identifier); lua_settop(L, 0); ghoul_assert(lua_gettop(L) == 0, "Incorrect number of items left on stack"); @@ -90,7 +90,7 @@ int removeDashboardItem(lua_State* L) { int clearDashboardItems(lua_State* L) { ghoul::lua::checkArgumentsAndThrow(L, 0, "lua::clearDashboardItems"); - global::dashboard.clearDashboardItems(); + global::dashboard->clearDashboardItems(); ghoul_assert(lua_gettop(L) == 0, "Incorrect number of items left on stack"); return 0; diff --git a/src/rendering/framebufferrenderer.cpp b/src/rendering/framebufferrenderer.cpp index 93d54d6f43..aae263a0a5 100644 --- a/src/rendering/framebufferrenderer.cpp +++ b/src/rendering/framebufferrenderer.cpp @@ -401,8 +401,8 @@ void FramebufferRenderer::initialize() { DownscaledVolumeUniformNames ); - global::raycasterManager.addListener(*this); - global::deferredcasterManager.addListener(*this); + global::raycasterManager->addListener(*this); + global::deferredcasterManager->addListener(*this); // Set Default Rendering OpenGL State glGetIntegerv(GL_FRAMEBUFFER_BINDING, &_defaultFBO); @@ -418,7 +418,7 @@ void FramebufferRenderer::initialize() { glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); // Save State in Cache - global::renderEngine.openglStateCache().loadCurrentGLState(); + global::renderEngine->openglStateCache().loadCurrentGLState(); } void FramebufferRenderer::deinitialize() { @@ -452,8 +452,8 @@ void FramebufferRenderer::deinitialize() { glDeleteBuffers(1, &_vertexPositionBuffer); glDeleteVertexArrays(1, &_screenQuad); - global::raycasterManager.removeListener(*this); - global::deferredcasterManager.removeListener(*this); + global::raycasterManager->removeListener(*this); + global::deferredcasterManager->removeListener(*this); } void FramebufferRenderer::raycastersChanged(VolumeRaycaster&, @@ -992,7 +992,7 @@ void FramebufferRenderer::updateRaycastData() { _insideRaycastPrograms.clear(); const std::vector& raycasters = - global::raycasterManager.raycasters(); + global::raycasterManager->raycasters(); int nextId = 0; for (VolumeRaycaster* raycaster : raycasters) { @@ -1064,7 +1064,7 @@ void FramebufferRenderer::updateDeferredcastData() { _deferredcastPrograms.clear(); const std::vector& deferredcasters = - global::deferredcasterManager.deferredcasters(); + global::deferredcasterManager->deferredcasters(); int nextId = 0; for (Deferredcaster* caster : deferredcasters) { DeferredcastData data = { nextId++, "HELPER" }; @@ -1148,10 +1148,10 @@ void FramebufferRenderer::render(Scene* scene, Camera* camera, float blackoutFac glGetIntegerv(GL_FRAMEBUFFER_BINDING, &_defaultFBO); GLint viewport[4] = { 0 }; - global::renderEngine.openglStateCache().viewport(viewport); + global::renderEngine->openglStateCache().viewport(viewport); // Reset Render Pipeline State - global::renderEngine.openglStateCache().resetCachedStates(); + global::renderEngine->openglStateCache().resetCachedStates(); _pingPongIndex = 0; @@ -1165,13 +1165,13 @@ void FramebufferRenderer::render(Scene* scene, Camera* camera, float blackoutFac TracyGpuZone("Deferred G-Buffer") GLint vp[4] = {viewport[0], viewport[1], _resolution.x, _resolution.y}; - global::renderEngine.openglStateCache().setViewportState(vp); + global::renderEngine->openglStateCache().setViewportState(vp); glBindFramebuffer(GL_FRAMEBUFFER, _gBuffers.framebuffer); glDrawBuffers(3, ColorAttachmentArray); glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); } - Time time = global::timeManager.time(); + Time time = global::timeManager->time(); RenderData data = { *camera, @@ -1287,7 +1287,7 @@ void FramebufferRenderer::performRaycasterTasks(const std::vector glBindFramebuffer(GL_FRAMEBUFFER, _exitFramebuffer); glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); GLint viewport[4] = { 0 }; - global::renderEngine.openglStateCache().viewport(viewport); + global::renderEngine->openglStateCache().viewport(viewport); ghoul::opengl::ProgramObject* exitProgram = _exitPrograms[raycaster].get(); if (exitProgram) { @@ -1305,7 +1305,7 @@ void FramebufferRenderer::performRaycasterTasks(const std::vector static_cast(viewport[2] * s), static_cast(viewport[3] * s) }; - global::renderEngine.openglStateCache().setViewportState(newVP); + global::renderEngine->openglStateCache().setViewportState(newVP); if (_downscaleVolumeRendering.currentDownscaleFactor != s) { _downscaleVolumeRendering.currentDownscaleFactor = s; @@ -1402,7 +1402,7 @@ void FramebufferRenderer::performRaycasterTasks(const std::vector } if (raycaster->downscaleRender() < 1.f) { - global::renderEngine.openglStateCache().setViewportState(viewport); + global::renderEngine->openglStateCache().setViewportState(viewport); glBindFramebuffer(GL_DRAW_FRAMEBUFFER, _gBuffers.framebuffer); writeDownscaledVolume(); } @@ -1540,7 +1540,7 @@ void FramebufferRenderer::updateRendererData() { dict.setValue("hdrExposure", std::to_string(_hdrExposure)); dict.setValue("disableHDR", std::to_string(_disableHDR)); _rendererData = dict; - global::renderEngine.setRendererData(dict); + global::renderEngine->setRendererData(dict); } } // namespace openspace diff --git a/src/rendering/loadingscreen.cpp b/src/rendering/loadingscreen.cpp index 8f7fb9fc0e..7b1d63f491 100644 --- a/src/rendering/loadingscreen.cpp +++ b/src/rendering/loadingscreen.cpp @@ -112,7 +112,7 @@ LoadingScreen::LoadingScreen(ShowMessage showMessage, ShowNodeNames showNodeName , _showProgressbar(showProgressbar) , _randomEngine(_randomDevice()) { - _loadingFont = global::fontManager.font( + _loadingFont = global::fontManager->font( "Loading", LoadingFontSize, ghoul::fontrendering::FontManager::Outline::No, @@ -120,7 +120,7 @@ LoadingScreen::LoadingScreen(ShowMessage showMessage, ShowNodeNames showNodeName ); if (_showMessage) { - _messageFont = global::fontManager.font( + _messageFont = global::fontManager->font( "Loading", MessageFontSize, ghoul::fontrendering::FontManager::Outline::No, @@ -129,7 +129,7 @@ LoadingScreen::LoadingScreen(ShowMessage showMessage, ShowNodeNames showNodeName } if (_showNodeNames) { - _itemFont = global::fontManager.font( + _itemFont = global::fontManager->font( "Loading", ItemFontSize, ghoul::fontrendering::FontManager::Outline::No, @@ -165,9 +165,9 @@ void LoadingScreen::render() { // We have to recalculate the positions here because we will not be informed about a // window size change - const glm::vec2 dpiScaling = global::windowDelegate.dpiScaling(); + const glm::vec2 dpiScaling = global::windowDelegate->dpiScaling(); const glm::ivec2 res = - glm::vec2(global::windowDelegate.currentSubwindowSize()) * dpiScaling; + glm::vec2(global::windowDelegate->currentSubwindowSize()) * dpiScaling; float screenAspectRatio = static_cast(res.x) / static_cast(res.y); @@ -485,7 +485,7 @@ void LoadingScreen::render() { glEnable(GL_DEPTH_TEST); std::this_thread::sleep_for(RefreshRate); - global::windowDelegate.swapBuffer(); + global::windowDelegate->swapBuffer(); FrameMarkEnd("Loading") } diff --git a/src/rendering/luaconsole.cpp b/src/rendering/luaconsole.cpp index 97eee2f20e..104f637218 100644 --- a/src/rendering/luaconsole.cpp +++ b/src/rendering/luaconsole.cpp @@ -209,23 +209,23 @@ void LuaConsole::initialize() { _commands.emplace_back(""); _activeCommand = _commands.size() - 1; - _font = global::fontManager.font( + _font = global::fontManager->font( FontName, EntryFontSize, ghoul::fontrendering::FontManager::Outline::No ); - _historyFont = global::fontManager.font( + _historyFont = global::fontManager->font( FontName, HistoryFontSize, ghoul::fontrendering::FontManager::Outline::No ); - global::parallelPeer.connectionEvent().subscribe( + global::parallelPeer->connectionEvent().subscribe( "luaConsole", "statusChanged", [this]() { - ParallelConnection::Status status = global::parallelPeer.status(); + ParallelConnection::Status status = global::parallelPeer->status(); parallelConnectionChanged(status); } ); @@ -265,7 +265,7 @@ void LuaConsole::deinitialize() { } } - global::parallelPeer.connectionEvent().unsubscribe("luaConsole"); + global::parallelPeer->connectionEvent().unsubscribe("luaConsole"); } bool LuaConsole::keyboardCallback(Key key, KeyModifier modifier, KeyAction action) { @@ -288,7 +288,7 @@ bool LuaConsole::keyboardCallback(Key key, KeyModifier modifier, KeyAction actio } else { _isVisible = true; - if (global::parallelPeer.status() == ParallelConnection::Status::Host) { + if (global::parallelPeer->status() == ParallelConnection::Status::Host) { _remoteScripting = true; } } @@ -428,7 +428,7 @@ bool LuaConsole::keyboardCallback(Key key, KeyModifier modifier, KeyAction actio std::string cmd = _commands.at(_activeCommand); if (!cmd.empty()) { using RemoteScripting = scripting::ScriptEngine::RemoteScripting; - global::scriptEngine.queueScript(cmd, RemoteScripting(_remoteScripting)); + global::scriptEngine->queueScript(cmd, RemoteScripting(_remoteScripting)); // Only add the current command to the history if it hasn't been // executed before. We don't want two of the same commands in a row @@ -457,7 +457,7 @@ bool LuaConsole::keyboardCallback(Key key, KeyModifier modifier, KeyAction actio if (_autoCompleteInfo.lastIndex != NoAutoComplete && modifierShift) { _autoCompleteInfo.lastIndex -= 2; } - std::vector allCommands = global::scriptEngine.allLuaFunctions(); + std::vector allCommands = global::scriptEngine->allLuaFunctions(); std::sort(allCommands.begin(), allCommands.end()); std::string currentCommand = _commands.at(_activeCommand); @@ -610,13 +610,13 @@ void LuaConsole::update() { // The first frame is going to be finished in approx 10 us, which causes a floating // point overflow when computing dHeight constexpr double Epsilon = 1e-4; - const double frametime = std::max(global::windowDelegate.deltaTime(), Epsilon); + const double frametime = std::max(global::windowDelegate->deltaTime(), Epsilon); // Update the current height. // The current height is the offset that is used to slide // the console in from the top. - const glm::ivec2 res = global::windowDelegate.currentSubwindowSize(); - const glm::vec2 dpiScaling = global::windowDelegate.dpiScaling(); + const glm::ivec2 res = global::windowDelegate->currentSubwindowSize(); + const glm::vec2 dpiScaling = global::windowDelegate->dpiScaling(); const double dHeight = (_targetHeight - _currentHeight) * std::pow(0.98, 1.0 / (ConsoleOpenSpeed / dpiScaling.y * frametime)); @@ -636,9 +636,9 @@ void LuaConsole::render() { return; } - const glm::vec2 dpiScaling = global::windowDelegate.dpiScaling(); + const glm::vec2 dpiScaling = global::windowDelegate->dpiScaling(); const glm::ivec2 res = - glm::vec2(global::windowDelegate.currentSubwindowSize()) / dpiScaling; + glm::vec2(global::windowDelegate->currentSubwindowSize()) / dpiScaling; // Render background @@ -790,10 +790,10 @@ void LuaConsole::render() { if (_remoteScripting) { const glm::vec4 Red(1.f, 0.f, 0.f, 1.f); - ParallelConnection::Status status = global::parallelPeer.status(); + ParallelConnection::Status status = global::parallelPeer->status(); const int nClients = status != ParallelConnection::Status::Disconnected ? - global::parallelPeer.nConnections() - 1 : + global::parallelPeer->nConnections() - 1 : 0; const std::string nClientsText = @@ -804,7 +804,7 @@ void LuaConsole::render() { const glm::vec2 loc = locationForRightJustifiedText(nClientsText); RenderFont(*_font, loc, nClientsText, Red); } - else if (global::parallelPeer.isHost()) { + else if (global::parallelPeer->isHost()) { const glm::vec4 LightBlue(0.4f, 0.4f, 1.f, 1.f); const std::string localExecutionText = "Local script execution"; diff --git a/src/rendering/renderable.cpp b/src/rendering/renderable.cpp index beae4048a4..6ed258b7e7 100644 --- a/src/rendering/renderable.cpp +++ b/src/rendering/renderable.cpp @@ -112,7 +112,7 @@ ghoul::mm_unique_ptr Renderable::createFromDictionary( Renderable* result = factory->create( renderableType, dictionary, - &global::memoryManager.PersistentMemory + &global::memoryManager->PersistentMemory ); return ghoul::mm_unique_ptr(result); } diff --git a/src/rendering/renderengine.cpp b/src/rendering/renderengine.cpp index 6c2c1a5965..b1ca205edc 100644 --- a/src/rendering/renderengine.cpp +++ b/src/rendering/renderengine.cpp @@ -365,8 +365,8 @@ RenderEngine::RenderEngine() addProperty(_applyWarping); _horizFieldOfView.onChange([this]() { - if (global::windowDelegate.isMaster()) { - global::windowDelegate.setHorizFieldOfView(_horizFieldOfView); + if (global::windowDelegate->isMaster()) { + global::windowDelegate->setHorizFieldOfView(_horizFieldOfView); } }); addProperty(_horizFieldOfView); @@ -417,11 +417,11 @@ void RenderEngine::initialize() { // We have to perform these initializations here as the OsEng has not been initialized // in our constructor - _globalRotation = static_cast(global::configuration.globalRotation); + _globalRotation = static_cast(global::configuration->globalRotation); _screenSpaceRotation = - static_cast(global::configuration.screenSpaceRotation); - _masterRotation = static_cast(global::configuration.masterRotation); - _disableMasterRendering = global::configuration.isRenderingOnMasterDisabled; + static_cast(global::configuration->screenSpaceRotation); + _masterRotation = static_cast(global::configuration->masterRotation); + _disableMasterRendering = global::configuration->isRenderingOnMasterDisabled; #ifdef GHOUL_USE_DEVIL ghoul::io::TextureReader::ref().addReader( @@ -452,8 +452,8 @@ void RenderEngine::initialize() { ); _versionString = OPENSPACE_VERSION_STRING_FULL; - if (global::versionChecker.hasLatestVersionInfo()) { - VersionChecker::SemanticVersion latest = global::versionChecker.latestVersion(); + if (global::versionChecker->hasLatestVersionInfo()) { + VersionChecker::SemanticVersion latest = global::versionChecker->latestVersion(); VersionChecker::SemanticVersion current{ OPENSPACE_VERSION_MAJOR, @@ -473,7 +473,7 @@ void RenderEngine::initializeGL() { LTRACE("RenderEngine::initializeGL(begin)"); - std::string renderingMethod = global::configuration.renderingMethod; + std::string renderingMethod = global::configuration->renderingMethod; if (renderingMethod == "ABuffer") { using Version = ghoul::systemcapabilities::Version; @@ -491,35 +491,35 @@ void RenderEngine::initializeGL() { // set the close clip plane and the far clip plane to extreme values while in // development - global::windowDelegate.setNearFarClippingPlane(0.001f, 1000.f); + global::windowDelegate->setNearFarClippingPlane(0.001f, 1000.f); // Set horizontal FOV value with whatever the field of view (in degrees) is of the // initialized window - _horizFieldOfView = static_cast(global::windowDelegate.getHorizFieldOfView()); + _horizFieldOfView = static_cast(global::windowDelegate->getHorizFieldOfView()); { ZoneScopedN("Font: Mono") TracyGpuZone("Font: Mono") constexpr const float FontSizeFrameinfo = 32.f; - _fontFrameInfo = global::fontManager.font(KeyFontMono, FontSizeFrameinfo); + _fontFrameInfo = global::fontManager->font(KeyFontMono, FontSizeFrameinfo); } { ZoneScopedN("Font: Date") TracyGpuZone("Font: Date") constexpr const float FontSizeTime = 15.f; - _fontDate = global::fontManager.font(KeyFontMono, FontSizeTime); + _fontDate = global::fontManager->font(KeyFontMono, FontSizeTime); } { ZoneScopedN("Font: Info") TracyGpuZone("Font: Info") constexpr const float FontSizeMono = 10.f; - _fontInfo = global::fontManager.font(KeyFontMono, FontSizeMono); + _fontInfo = global::fontManager->font(KeyFontMono, FontSizeMono); } { ZoneScopedN("Font: Log") TracyGpuZone("Font: Log") constexpr const float FontSizeLight = 8.f; - _fontLog = global::fontManager.font(KeyFontLight, FontSizeLight); + _fontLog = global::fontManager->font(KeyFontLight, FontSizeLight); } { @@ -549,8 +549,8 @@ void RenderEngine::updateScene() { _scene->updateInterpolations(); - const Time& currentTime = global::timeManager.time(); - const Time& integrateFromTime = global::timeManager.integrateFromTime(); + const Time& currentTime = global::timeManager->time(); + const Time& integrateFromTime = global::timeManager->integrateFromTime(); _scene->update({ TransformData{ glm::dvec3(0.0), glm::dmat3(1.0), glm::dvec3(1.0) }, @@ -579,7 +579,7 @@ void RenderEngine::updateShaderPrograms() { void RenderEngine::updateRenderer() { ZoneScoped - const bool windowResized = global::windowDelegate.windowHasResized(); + const bool windowResized = global::windowDelegate->windowHasResized(); if (windowResized) { _renderer->setResolution(renderingResolution()); @@ -589,7 +589,7 @@ void RenderEngine::updateRenderer() { FR::defaultProjectionRenderer().setFramebufferSize(renderingResolution()); //Override the aspect ratio property value to match that of resized window _horizFieldOfView = - static_cast(global::windowDelegate.getHorizFieldOfView()); + static_cast(global::windowDelegate->getHorizFieldOfView()); } _renderer->update(); @@ -598,22 +598,22 @@ void RenderEngine::updateRenderer() { void RenderEngine::updateScreenSpaceRenderables() { ZoneScoped - for (std::unique_ptr& ssr : global::screenSpaceRenderables) { + for (std::unique_ptr& ssr : *global::screenSpaceRenderables) { ssr->update(); } } glm::ivec2 RenderEngine::renderingResolution() const { - return global::windowDelegate.currentDrawBufferResolution(); + return global::windowDelegate->currentDrawBufferResolution(); } glm::ivec2 RenderEngine::fontResolution() const { - const std::string& value = global::configuration.onScreenTextScaling; + const std::string& value = global::configuration->onScreenTextScaling; if (value == "framebuffer") { - return global::windowDelegate.currentViewportSize(); + return global::windowDelegate->currentViewportSize(); } else { - return global::windowDelegate.currentSubwindowSize(); + return global::windowDelegate->currentSubwindowSize(); } } @@ -638,7 +638,7 @@ glm::mat4 RenderEngine::screenSpaceRotation() const { } glm::mat4 RenderEngine::nodeRotation() const { - if (!global::windowDelegate.isMaster()) { + if (!global::windowDelegate->isMaster()) { return glm::mat4(1.f); } glm::vec3 rot = _masterRotation; @@ -661,7 +661,7 @@ void RenderEngine::render(const glm::mat4& sceneMatrix, const glm::mat4& viewMat LTRACE("RenderEngine::render(begin)"); - const WindowDelegate& delegate = global::windowDelegate; + const WindowDelegate& delegate = *global::windowDelegate; const glm::mat4 globalRot = globalRotation(); const glm::mat4 nodeRot = nodeRotation(); @@ -694,7 +694,7 @@ void RenderEngine::render(const glm::mat4& sceneMatrix, const glm::mat4& viewMat ); std::string fn = std::to_string(_frameNumber); - WindowDelegate::Frustum frustum = global::windowDelegate.frustumMode(); + WindowDelegate::Frustum frustum = global::windowDelegate->frustumMode(); std::string fr = [](WindowDelegate::Frustum frustum) -> std::string { switch (frustum) { case WindowDelegate::Frustum::Mono: return ""; @@ -704,9 +704,9 @@ void RenderEngine::render(const glm::mat4& sceneMatrix, const glm::mat4& viewMat } }(frustum); - std::string sgFn = std::to_string(global::windowDelegate.swapGroupFrameNumber()); - std::string dt = std::to_string(global::windowDelegate.deltaTime()); - std::string avgDt = std::to_string(global::windowDelegate.averageDeltaTime()); + std::string sgFn = std::to_string(global::windowDelegate->swapGroupFrameNumber()); + std::string dt = std::to_string(global::windowDelegate->deltaTime()); + std::string avgDt = std::to_string(global::windowDelegate->averageDeltaTime()); std::string res = "Frame: " + fn + ' ' + fr + '\n' + "Swap group frame: " + sgFn + '\n' + @@ -718,9 +718,9 @@ void RenderEngine::render(const glm::mat4& sceneMatrix, const glm::mat4& viewMat ZoneScopedN("Render Screenspace Renderable") std::vector ssrs; - ssrs.reserve(global::screenSpaceRenderables.size()); + ssrs.reserve(global::screenSpaceRenderables->size()); for (const std::unique_ptr& ssr : - global::screenSpaceRenderables) + *global::screenSpaceRenderables) { if (ssr->isEnabled() && ssr->isReady()) { ssrs.push_back(ssr.get()); @@ -760,7 +760,7 @@ bool RenderEngine::mouseActivationCallback(const glm::dvec2& mousePosition) cons local f = 'NavigationHandler.OrbitalNavigator.Friction.RotationalFriction'; openspace.setPropertyValueSingle(f, not openspace.getPropertyValue(f));)"; - global::scriptEngine.queueScript( + global::scriptEngine->queueScript( ToggleRotationFrictionScript, scripting::ScriptEngine::RemoteScripting::Yes ); @@ -772,7 +772,7 @@ bool RenderEngine::mouseActivationCallback(const glm::dvec2& mousePosition) cons local f = 'NavigationHandler.OrbitalNavigator.Friction.ZoomFriction'; openspace.setPropertyValueSingle(f, not openspace.getPropertyValue(f));)"; - global::scriptEngine.queueScript( + global::scriptEngine->queueScript( ToggleZoomFrictionScript, scripting::ScriptEngine::RemoteScripting::Yes ); @@ -784,7 +784,7 @@ bool RenderEngine::mouseActivationCallback(const glm::dvec2& mousePosition) cons local f = 'NavigationHandler.OrbitalNavigator.Friction.RollFriction'; openspace.setPropertyValueSingle(f, not openspace.getPropertyValue(f));)"; - global::scriptEngine.queueScript( + global::scriptEngine->queueScript( ToggleRollFrictionScript, scripting::ScriptEngine::RemoteScripting::Yes ); @@ -797,7 +797,7 @@ bool RenderEngine::mouseActivationCallback(const glm::dvec2& mousePosition) cons void RenderEngine::renderOverlays(const ShutdownInformation& shutdownInfo) { ZoneScoped - const bool isMaster = global::windowDelegate.isMaster(); + const bool isMaster = global::windowDelegate->isMaster(); if (isMaster || _showOverlayOnSlaves) { renderScreenLog(); renderVersionInformation(); @@ -824,9 +824,9 @@ void RenderEngine::renderEndscreen() { glm::vec4(0.f, 0.f, 0.f, 0.5f) ); - const glm::vec2 dpiScaling = global::windowDelegate.dpiScaling(); + const glm::vec2 dpiScaling = global::windowDelegate->dpiScaling(); const glm::ivec2 res = - glm::vec2(global::windowDelegate.currentSubwindowSize()) / dpiScaling; + glm::vec2(global::windowDelegate->currentSubwindowSize()) / dpiScaling; glViewport(0, 0, res.x, res.y); using FR = ghoul::fontrendering::FontRenderer; @@ -872,13 +872,13 @@ void RenderEngine::renderShutdownInformation(float timer, float fullTime) { void RenderEngine::renderDashboard() { ZoneScoped - glm::vec2 dashboardStart = global::dashboard.getStartPositionOffset(); + glm::vec2 dashboardStart = global::dashboard->getStartPositionOffset(); glm::vec2 penPosition = glm::vec2( dashboardStart.x, - dashboardStart.y + fontResolution().y - global::luaConsole.currentHeight() + dashboardStart.y + fontResolution().y - global::luaConsole->currentHeight() ); - global::dashboard.render(penPosition); + global::dashboard->render(penPosition); #ifdef REALTIME_CAMERA_POS_DISPLAY penPosition += glm::vec2(0.f, -50.f); @@ -1098,7 +1098,7 @@ void RenderEngine::takeScreenshot() { ); } - _latestScreenshotNumber = global::windowDelegate.takeScreenshot(_applyWarping); + _latestScreenshotNumber = global::windowDelegate->takeScreenshot(_applyWarping); } /** @@ -1183,11 +1183,11 @@ void RenderEngine::addScreenSpaceRenderable(std::unique_ptridentifier(); if (std::find_if( - global::screenSpaceRenderables.begin(), - global::screenSpaceRenderables.end(), + global::screenSpaceRenderables->begin(), + global::screenSpaceRenderables->end(), [&identifier](const std::unique_ptr& ssr) { return ssr->identifier() == identifier; - }) != global::screenSpaceRenderables.end() + }) != global::screenSpaceRenderables->end() ) { LERROR(fmt::format( "Cannot add scene space renderable. " @@ -1200,22 +1200,22 @@ void RenderEngine::addScreenSpaceRenderable(std::unique_ptrinitialize(); s->initializeGL(); - global::screenSpaceRootPropertyOwner.addPropertySubOwner(s.get()); - global::screenSpaceRenderables.push_back(std::move(s)); + global::screenSpaceRootPropertyOwner->addPropertySubOwner(s.get()); + global::screenSpaceRenderables->push_back(std::move(s)); } void RenderEngine::removeScreenSpaceRenderable(ScreenSpaceRenderable* s) { const auto it = std::find_if( - global::screenSpaceRenderables.begin(), - global::screenSpaceRenderables.end(), + global::screenSpaceRenderables->begin(), + global::screenSpaceRenderables->end(), [s](const std::unique_ptr& r) { return r.get() == s; } ); - if (it != global::screenSpaceRenderables.end()) { + if (it != global::screenSpaceRenderables->end()) { s->deinitialize(); - global::screenSpaceRootPropertyOwner.removePropertySubOwner(s); + global::screenSpaceRootPropertyOwner->removePropertySubOwner(s); - global::screenSpaceRenderables.erase(it); + global::screenSpaceRenderables->erase(it); } } @@ -1230,14 +1230,14 @@ ScreenSpaceRenderable* RenderEngine::screenSpaceRenderable( const std::string& identifier) { const auto it = std::find_if( - global::screenSpaceRenderables.begin(), - global::screenSpaceRenderables.end(), + global::screenSpaceRenderables->begin(), + global::screenSpaceRenderables->end(), [&identifier](const std::unique_ptr& s) { return s->identifier() == identifier; } ); - if (it != global::screenSpaceRenderables.end()) { + if (it != global::screenSpaceRenderables->end()) { return it->get(); } else { @@ -1246,10 +1246,10 @@ ScreenSpaceRenderable* RenderEngine::screenSpaceRenderable( } std::vector RenderEngine::screenSpaceRenderables() const { - std::vector res(global::screenSpaceRenderables.size()); + std::vector res(global::screenSpaceRenderables->size()); std::transform( - global::screenSpaceRenderables.begin(), - global::screenSpaceRenderables.end(), + global::screenSpaceRenderables->begin(), + global::screenSpaceRenderables->end(), res.begin(), [](const std::unique_ptr& p) { return p.get(); } ); @@ -1292,7 +1292,7 @@ void RenderEngine::renderCameraInformation() { constexpr const float XSeparation = 5.f; const interaction::OrbitalNavigator& nav = - global::navigationHandler.orbitalNavigator(); + global::navigationHandler->orbitalNavigator(); using FR = ghoul::fontrendering::FontRenderer; diff --git a/src/rendering/renderengine_lua.inl b/src/rendering/renderengine_lua.inl index 8a5e933f43..f671ab7213 100644 --- a/src/rendering/renderengine_lua.inl +++ b/src/rendering/renderengine_lua.inl @@ -44,7 +44,7 @@ int setRenderer(lua_State* L) { 1, ghoul::lua::PopValue::Yes ); - global::renderEngine.setRendererFromString(renderer); + global::renderEngine->setRendererFromString(renderer); ghoul_assert(lua_gettop(L) == 0, "Incorrect number of items left on stack"); return 0; @@ -69,7 +69,7 @@ int addScreenSpaceRenderable(lua_State* L) { std::unique_ptr s = ScreenSpaceRenderable::createFromDictionary(d); - global::renderEngine.addScreenSpaceRenderable(std::move(s)); + global::renderEngine->addScreenSpaceRenderable(std::move(s)); ghoul_assert(lua_gettop(L) == 0, "Incorrect number of items left on stack"); return 0; @@ -83,7 +83,7 @@ int removeScreenSpaceRenderable(lua_State* L) { 1, ghoul::lua::PopValue::Yes ); - global::renderEngine.removeScreenSpaceRenderable(name); + global::renderEngine->removeScreenSpaceRenderable(name); ghoul_assert(lua_gettop(L) == 0, "Incorrect number of items left on stack"); return 0; @@ -92,8 +92,8 @@ int removeScreenSpaceRenderable(lua_State* L) { int takeScreenshot(lua_State* L) { ghoul::lua::checkArgumentsAndThrow(L, 0, "lua::takeScreenshot"); - global::renderEngine.takeScreenshot(); - const unsigned int screenshotNumber = global::renderEngine.latestScreenshotNumber(); + global::renderEngine->takeScreenshot(); + const unsigned int screenshotNumber = global::renderEngine->latestScreenshotNumber(); lua_pushinteger(L, screenshotNumber); return 1; diff --git a/src/rendering/screenspacerenderable.cpp b/src/rendering/screenspacerenderable.cpp index 49df254322..8b0f561038 100644 --- a/src/rendering/screenspacerenderable.cpp +++ b/src/rendering/screenspacerenderable.cpp @@ -316,7 +316,8 @@ std::unique_ptr ScreenSpaceRenderable::createFromDictiona } std::string ScreenSpaceRenderable::makeUniqueIdentifier(std::string name) { - std::vector r = global::renderEngine.screenSpaceRenderables(); + std::vector r = + global::renderEngine->screenSpaceRenderables(); auto nameTaken = [&r](const std::string& name) { bool nameTaken = std::any_of( @@ -459,7 +460,7 @@ ScreenSpaceRenderable::ScreenSpaceRenderable(const ghoul::Dictionary& dictionary _delete.onChange([this](){ std::string script = "openspace.removeScreenSpaceRenderable('" + identifier() + "');"; - global::scriptEngine.queueScript( + global::scriptEngine->queueScript( script, scripting::ScriptEngine::RemoteScripting::No ); @@ -484,7 +485,7 @@ bool ScreenSpaceRenderable::deinitialize() { bool ScreenSpaceRenderable::deinitializeGL() { if (_shader) { - global::renderEngine.removeRenderProgram(_shader.get()); + global::renderEngine->removeRenderProgram(_shader.get()); _shader = nullptr; } @@ -521,13 +522,13 @@ float ScreenSpaceRenderable::depth() { void ScreenSpaceRenderable::createShaders() { ghoul::Dictionary dict = ghoul::Dictionary(); - auto res = global::windowDelegate.currentDrawBufferResolution(); + auto res = global::windowDelegate->currentDrawBufferResolution(); ghoul::Dictionary rendererData = { { "fragmentRendererPath", "${SHADERS}/framebuffer/renderframebuffer.frag" }, { "windowWidth" , res.x }, { "windowHeight" , res.y }, - { "hdrExposure", global::renderEngine.hdrExposure() }, - { "disableHDR", global::renderEngine.isHdrDisabled() } + { "hdrExposure", global::renderEngine->hdrExposure() }, + { "disableHDR", global::renderEngine->isHdrDisabled() } }; dict.setValue("rendererData", rendererData); @@ -543,7 +544,7 @@ void ScreenSpaceRenderable::createShaders() { } glm::mat4 ScreenSpaceRenderable::scaleMatrix() { - glm::vec2 resolution = global::windowDelegate.currentDrawBufferResolution(); + glm::vec2 resolution = global::windowDelegate->currentDrawBufferResolution(); //to scale the plane float textureRatio = @@ -571,12 +572,12 @@ glm::mat4 ScreenSpaceRenderable::globalRotationMatrix() { // 2) sgct's scene matrix (also called model matrix by sgct) glm::mat4 inverseRotation = glm::inverse( - global::renderEngine.globalRotation() * - global::windowDelegate.modelMatrix() + global::renderEngine->globalRotation() * + global::windowDelegate->modelMatrix() ); // The rotation of all screen space renderables is adjustable in the render engine: - return global::renderEngine.screenSpaceRotation() * inverseRotation; + return global::renderEngine->screenSpaceRotation() * inverseRotation; } glm::mat4 ScreenSpaceRenderable::localRotationMatrix() { @@ -617,7 +618,7 @@ void ScreenSpaceRenderable::draw(glm::mat4 modelTransform) { _shader->setUniform( _uniformCache.viewProj, - global::renderEngine.scene()->camera()->viewProjectionMatrix() + global::renderEngine->scene()->camera()->viewProjectionMatrix() ); ghoul::opengl::TextureUnit unit; diff --git a/src/scene/assetmanager.cpp b/src/scene/assetmanager.cpp index 80e892309f..de1809110f 100644 --- a/src/scene/assetmanager.cpp +++ b/src/scene/assetmanager.cpp @@ -65,7 +65,7 @@ bool AssetManager::update() { const bool add = c.second; if (add) { _assetLoader.add(path); - global::profile.addAsset(path); + global::profile->addAsset(path); } } // Remove assets @@ -75,7 +75,7 @@ bool AssetManager::update() { const bool remove = !c.second; if (remove && _assetLoader.has(path)) { _assetLoader.remove(path); - global::profile.removeAsset(path); + global::profile->removeAsset(path); } } _pendingStateChangeCommands.clear(); diff --git a/src/scene/assetmanager_lua.inl b/src/scene/assetmanager_lua.inl index 6458165b58..b6e2705da1 100644 --- a/src/scene/assetmanager_lua.inl +++ b/src/scene/assetmanager_lua.inl @@ -40,13 +40,13 @@ int add(lua_State* state) { ghoul::lua::PopValue::Yes ); - if (global::renderEngine.scene()) { + if (global::renderEngine->scene()) { assetManager->add(assetName); } else { // The scene might not exist yet if OpenSpace was started without specifying an // initial asset - global::openSpaceEngine.scheduleLoadSingleAsset(assetName); + global::openSpaceEngine->scheduleLoadSingleAsset(assetName); } diff --git a/src/scene/profile.cpp b/src/scene/profile.cpp index 14308a08b8..5f8b389c45 100644 --- a/src/scene/profile.cpp +++ b/src/scene/profile.cpp @@ -473,7 +473,7 @@ void Profile::saveCurrentSettingsToProfile(const properties::PropertyOwner& root _time = t; // Delta times - std::vector dts = global::timeManager.deltaTimeSteps(); + std::vector dts = global::timeManager->deltaTimeSteps(); _deltaTimes = std::move(dts); // Camera diff --git a/src/scene/profile_lua.inl b/src/scene/profile_lua.inl index 970eb5ac45..a009f1d07d 100644 --- a/src/scene/profile_lua.inl +++ b/src/scene/profile_lua.inl @@ -35,7 +35,7 @@ namespace openspace::luascriptfunctions { int saveSettingsToProfile(lua_State* L) { - if (!global::configuration.usingProfile) { + if (!global::configuration->usingProfile) { return luaL_error( L, "Program was not started with a profile, so cannot use this " @@ -51,7 +51,7 @@ int saveSettingsToProfile(lua_State* L) { std::string saveFilePath; if (n == 0) { - const ghoul::filesystem::File f = global::configuration.profile; + const ghoul::filesystem::File f = global::configuration->profile; std::time_t t = std::time(nullptr); std::tm* utcTime = std::gmtime(&t); @@ -68,13 +68,13 @@ int saveSettingsToProfile(lua_State* L) { ); std::string newFile = fmt::format("{}_{}", f.fullBaseName(), time); std::string sourcePath = - absPath("${PROFILES}") + '/' + global::configuration.profile + ".profile"; + absPath("${PROFILES}") + '/' + global::configuration->profile + ".profile"; std::string destPath = absPath("${PROFILES}") + '/' + newFile + ".profile"; LINFOC("Profile", fmt::format("Saving a copy of the old profile as {}", newFile)); std::filesystem::copy(sourcePath, destPath); - saveFilePath = global::configuration.profile; + saveFilePath = global::configuration->profile; } else { saveFilePath = ghoul::lua::value(L, 1); @@ -83,12 +83,12 @@ int saveSettingsToProfile(lua_State* L) { } } - const properties::PropertyOwner& root = global::rootPropertyOwner; - std::string currentTime = std::string(global::timeManager.time().ISO8601()); + const properties::PropertyOwner& root = *global::rootPropertyOwner; + std::string currentTime = std::string(global::timeManager->time().ISO8601()); interaction::NavigationHandler::NavigationState navState = - global::navigationHandler.navigationState(); - global::profile.saveCurrentSettingsToProfile(root, currentTime, navState); - global::configuration.profile = saveFilePath; + global::navigationHandler->navigationState(); + global::profile->saveCurrentSettingsToProfile(root, currentTime, navState); + global::configuration->profile = saveFilePath; if (saveFilePath.find('/') != std::string::npos) { return luaL_error(L, "Profile filename must not contain path (/) elements"); @@ -128,7 +128,7 @@ int saveSettingsToProfile(lua_State* L) { } try { - outFile << global::profile.serialize(); + outFile << global::profile->serialize(); } catch (const std::ofstream::failure& e) { return luaL_error( diff --git a/src/scene/rotation.cpp b/src/scene/rotation.cpp index 9c26296f87..05266dc4ab 100644 --- a/src/scene/rotation.cpp +++ b/src/scene/rotation.cpp @@ -71,7 +71,7 @@ ghoul::mm_unique_ptr Rotation::createFromDictionary( Rotation* result = factory->create( rotationType, dictionary, - &global::memoryManager.PersistentMemory + &global::memoryManager->PersistentMemory ); return ghoul::mm_unique_ptr(result); } diff --git a/src/scene/scale.cpp b/src/scene/scale.cpp index 2083dcb172..3035a22884 100644 --- a/src/scene/scale.cpp +++ b/src/scene/scale.cpp @@ -69,7 +69,7 @@ ghoul::mm_unique_ptr Scale::createFromDictionary(const ghoul::Dictionary& Scale* result = factory->create( scaleType, dictionary, - &global::memoryManager.PersistentMemory + &global::memoryManager->PersistentMemory ); result->setIdentifier("Scale"); return ghoul::mm_unique_ptr(result); diff --git a/src/scene/scene_lua.inl b/src/scene/scene_lua.inl index 9af3720b5a..a822d94dd4 100644 --- a/src/scene/scene_lua.inl +++ b/src/scene/scene_lua.inl @@ -110,12 +110,12 @@ void applyRegularExpression(lua_State* L, const std::string& regex, foundMatching = true; if (interpolationDuration == 0.0) { - global::renderEngine.scene()->removePropertyInterpolation(prop); + global::renderEngine->scene()->removePropertyInterpolation(prop); prop->setLuaValue(L); } else { prop->setLuaInterpolationTarget(L); - global::renderEngine.scene()->addPropertyInterpolation( + global::renderEngine->scene()->addPropertyInterpolation( prop, static_cast(interpolationDuration), easingFunction @@ -188,12 +188,12 @@ int setPropertyCall_single(properties::Property& prop, const std::string& uri, } else { if (duration == 0.0) { - global::renderEngine.scene()->removePropertyInterpolation(&prop); + global::renderEngine->scene()->removePropertyInterpolation(&prop); prop.setLuaValue(L); } else { prop.setLuaInterpolationTarget(L); - global::renderEngine.scene()->addPropertyInterpolation( + global::renderEngine->scene()->addPropertyInterpolation( &prop, static_cast(duration), easingFunction @@ -499,7 +499,7 @@ int loadScene(lua_State* L) { ghoul::lua::checkArgumentsAndThrow(L, 1, "lua::loadScene"); const std::string& sceneFile = ghoul::lua::value(L, 1); - global::openSpaceEngine.scheduleLoadSingleAsset(sceneFile); + global::openSpaceEngine->scheduleLoadSingleAsset(sceneFile); ghoul_assert(lua_gettop(L) == 0, "Incorrect number of items left on stack"); return 0; @@ -518,13 +518,13 @@ int addSceneGraphNode(lua_State* L) { } try { - SceneGraphNode* node = global::renderEngine.scene()->loadNode(d); + SceneGraphNode* node = global::renderEngine->scene()->loadNode(d); if (!node) { LERRORC("Scene", "Could not load scene graph node"); return ghoul::lua::luaError(L, "Error loading scene graph node"); } - global::renderEngine.scene()->initializeNode(node); + global::renderEngine->scene()->initializeNode(node); } catch (const documentation::SpecificationError& e) { return ghoul::lua::luaError( @@ -599,7 +599,7 @@ int removeSceneGraphNodesFromRegex(lua_State* L) { std::string name = ghoul::lua::value(L, 1, ghoul::lua::PopValue::Yes); const std::vector& nodes = - global::renderEngine.scene()->allSceneGraphNodes(); + global::renderEngine->scene()->allSceneGraphNodes(); // Replace all wildcards * with the correct regex (.*) size_t startPos = name.find("*"); @@ -697,7 +697,7 @@ int hasSceneGraphNode(lua_State* L) { 1, ghoul::lua::PopValue::Yes ); - SceneGraphNode* node = global::renderEngine.scene()->sceneGraphNode(nodeName); + SceneGraphNode* node = global::renderEngine->scene()->sceneGraphNode(nodeName); ghoul::lua::push(L, node != nullptr); @@ -712,7 +712,7 @@ int addInterestingTime(lua_State* L) { std::string time = ghoul::lua::value(L, 2, ghoul::lua::PopValue::No); lua_pop(L, 2); - global::renderEngine.scene()->addInterestingTime( + global::renderEngine->scene()->addInterestingTime( { std::move(name), std::move(time) } ); diff --git a/src/scene/scenegraphnode.cpp b/src/scene/scenegraphnode.cpp index 1492495241..aebb135f3c 100644 --- a/src/scene/scenegraphnode.cpp +++ b/src/scene/scenegraphnode.cpp @@ -154,7 +154,7 @@ ghoul::mm_unique_ptr SceneGraphNode::createFromDictionary( "SceneGraphNode" ); - SceneGraphNode* n = global::memoryManager.PersistentMemory.alloc(); + SceneGraphNode* n = global::memoryManager->PersistentMemory.alloc(); ghoul::mm_unique_ptr result = ghoul::mm_unique_ptr(n); #ifdef Debugging_Core_SceneGraphNode_Indices @@ -332,13 +332,13 @@ SceneGraphNode::SceneGraphNode() , _guiDescription(GuiDescriptionInfo) , _transform { ghoul::mm_unique_ptr( - global::memoryManager.PersistentMemory.alloc() + global::memoryManager->PersistentMemory.alloc() ), ghoul::mm_unique_ptr( - global::memoryManager.PersistentMemory.alloc() + global::memoryManager->PersistentMemory.alloc() ), ghoul::mm_unique_ptr( - global::memoryManager.PersistentMemory.alloc() + global::memoryManager->PersistentMemory.alloc() ) } , _boundingSphere(properties::FloatProperty(BoundingSphereInfo, 0.f)) @@ -689,7 +689,7 @@ void SceneGraphNode::computeScreenSpaceData(RenderData& newData) { return; } - glm::ivec2 res = global::windowDelegate.currentSubwindowSize(); + glm::ivec2 res = global::windowDelegate->currentSubwindowSize(); // Get the radius of node double nodeRadius = static_cast(this->boundingSphere()); diff --git a/src/scene/sceneinitializer.cpp b/src/scene/sceneinitializer.cpp index 06d166d7ff..b03039c5ac 100644 --- a/src/scene/sceneinitializer.cpp +++ b/src/scene/sceneinitializer.cpp @@ -52,7 +52,7 @@ MultiThreadedSceneInitializer::MultiThreadedSceneInitializer(unsigned int nThrea void MultiThreadedSceneInitializer::initializeNode(SceneGraphNode* node) { auto initFunction = [this, node]() { - LoadingScreen* loadingScreen = global::openSpaceEngine.loadingScreen(); + LoadingScreen* loadingScreen = global::openSpaceEngine->loadingScreen(); LoadingScreen::ProgressInfo progressInfo; progressInfo.progress = 1.f; @@ -83,7 +83,7 @@ void MultiThreadedSceneInitializer::initializeNode(SceneGraphNode* node) { LoadingScreen::ProgressInfo progressInfo; progressInfo.progress = 0.f; - LoadingScreen* loadingScreen = global::openSpaceEngine.loadingScreen(); + LoadingScreen* loadingScreen = global::openSpaceEngine->loadingScreen(); if (loadingScreen) { loadingScreen->setItemNumber(loadingScreen->itemNumber() + 1); loadingScreen->updateItem( diff --git a/src/scene/scenelicensewriter.cpp b/src/scene/scenelicensewriter.cpp index 38297042ab..42dd91f544 100644 --- a/src/scene/scenelicensewriter.cpp +++ b/src/scene/scenelicensewriter.cpp @@ -51,7 +51,7 @@ std::string SceneLicenseWriter::generateJson() const { json << "["; std::vector assets = - global::openSpaceEngine.assetManager().rootAsset().subTreeAssets(); + global::openSpaceEngine->assetManager().rootAsset().subTreeAssets(); int metaTotal = 0; for (const Asset* asset : assets) { diff --git a/src/scene/translation.cpp b/src/scene/translation.cpp index 44fea72bfc..a7491cfef2 100644 --- a/src/scene/translation.cpp +++ b/src/scene/translation.cpp @@ -70,7 +70,7 @@ ghoul::mm_unique_ptr Translation::createFromDictionary( Translation* result = factory->create( translationType, dictionary, - &global::memoryManager.PersistentMemory + &global::memoryManager->PersistentMemory ); result->setIdentifier("Translation"); return ghoul::mm_unique_ptr(result); diff --git a/src/scripting/scriptengine.cpp b/src/scripting/scriptengine.cpp index 8ff0a2e935..05260f7de1 100644 --- a/src/scripting/scriptengine.cpp +++ b/src/scripting/scriptengine.cpp @@ -54,7 +54,7 @@ ScriptEngine::ScriptEngine() } ) { - tracy::LuaRegister(_state); + //tracy::LuaRegister(_state); } void ScriptEngine::initialize() { @@ -634,8 +634,8 @@ bool ScriptEngine::writeLog(const std::string& script) { // Check that logging is enabled and initialize if necessary if (!_logFileExists) { // If a ScriptLogFile was specified, generate it now - if (!global::configuration.scriptLog.empty()) { - _logFilename = absPath(global::configuration.scriptLog); + if (!global::configuration->scriptLog.empty()) { + _logFilename = absPath(global::configuration->scriptLog); _logFileExists = true; LDEBUG(fmt::format( @@ -690,11 +690,11 @@ void ScriptEngine::preSync(bool isMaster) { // Not really a received script but the master also needs to run the script... _masterScriptQueue.push(item); - if (global::parallelPeer.isHost() && remoteScripting) { - global::parallelPeer.sendScript(item.script); + if (global::parallelPeer->isHost() && remoteScripting) { + global::parallelPeer->sendScript(item.script); } - if (global::sessionRecording.isRecording()) { - global::sessionRecording.saveScriptKeyframe(item.script); + if (global::sessionRecording->isRecording()) { + global::sessionRecording->saveScriptKeyframe(item.script); } } } diff --git a/src/scripting/scriptengine_lua.inl b/src/scripting/scriptengine_lua.inl index 562d8c9600..e27ddeb283 100644 --- a/src/scripting/scriptengine_lua.inl +++ b/src/scripting/scriptengine_lua.inl @@ -383,8 +383,8 @@ int unzipFile(lua_State* L) { * Saves the last entry from the script log to the current profile */ int saveLastChangeToProfile(lua_State* L) { - std::string asset = global::configuration.asset; - std::string logFilePath = absPath(global::configuration.scriptLog); + std::string asset = global::configuration->asset; + std::string logFilePath = absPath(global::configuration->scriptLog); std::ifstream logfile(logFilePath); std::string actualLastLine; std::string lastLine; diff --git a/src/scripting/scriptscheduler_lua.inl b/src/scripting/scriptscheduler_lua.inl index 699e2c2f0d..0d8bbe44cb 100644 --- a/src/scripting/scriptscheduler_lua.inl +++ b/src/scripting/scriptscheduler_lua.inl @@ -38,7 +38,7 @@ int loadFile(lua_State* L) { return ghoul::lua::luaError(L, "filepath string is empty"); } - global::scriptScheduler.loadScripts( + global::scriptScheduler->loadScripts( ghoul::lua::loadDictionaryFromFile(missionFileName, L) ); @@ -57,7 +57,7 @@ int loadScheduledScript(lua_State* L) { std::string forwardScript = ghoul::lua::value(L, 2); if (nArguments == 2) { - global::scriptScheduler.loadScripts({ + global::scriptScheduler->loadScripts({ { "1", ghoul::Dictionary { @@ -69,7 +69,7 @@ int loadScheduledScript(lua_State* L) { } else if (nArguments == 3) { std::string backwardScript = ghoul::lua::value(L, 3); - global::scriptScheduler.loadScripts({ + global::scriptScheduler->loadScripts({ { "1", ghoul::Dictionary { @@ -84,7 +84,7 @@ int loadScheduledScript(lua_State* L) { std::string backwardScript = ghoul::lua::value(L, 3); std::string universalScript = ghoul::lua::value(L, 4); - global::scriptScheduler.loadScripts({ + global::scriptScheduler->loadScripts({ { "1", ghoul::Dictionary { @@ -106,7 +106,7 @@ int loadScheduledScript(lua_State* L) { int setModeApplicationTime(lua_State* L) { ghoul::lua::checkArgumentsAndThrow(L, 0, "lua::setModeApplicationTime"); - global::scriptScheduler.setModeApplicationTime(); + global::scriptScheduler->setModeApplicationTime(); ghoul_assert(lua_gettop(L) == 0, "Incorrect number of items left on stack"); return 0; @@ -115,7 +115,7 @@ int setModeApplicationTime(lua_State* L) { int setModeRecordedTime(lua_State* L) { ghoul::lua::checkArgumentsAndThrow(L, 0, "lua::setModeRecordedTime"); - global::scriptScheduler.setModeRecordedTime(); + global::scriptScheduler->setModeRecordedTime(); ghoul_assert(lua_gettop(L) == 0, "Incorrect number of items left on stack"); return 0; @@ -124,7 +124,7 @@ int setModeRecordedTime(lua_State* L) { int setModeSimulationTime(lua_State* L) { ghoul::lua::checkArgumentsAndThrow(L, 0, "lua::setModeSimulationTime"); - global::scriptScheduler.setModeSimulationTime(); + global::scriptScheduler->setModeSimulationTime(); ghoul_assert(lua_gettop(L) == 0, "Incorrect number of items left on stack"); return 0; @@ -133,7 +133,7 @@ int setModeSimulationTime(lua_State* L) { int clear(lua_State* L) { ghoul::lua::checkArgumentsAndThrow(L, 0, "lua::clear"); - global::scriptScheduler.clearSchedule(); + global::scriptScheduler->clearSchedule(); ghoul_assert(lua_gettop(L) == 0, "Incorrect number of items left on stack"); return 0; diff --git a/src/util/time.cpp b/src/util/time.cpp index 9c0820aaf5..a448438b19 100644 --- a/src/util/time.cpp +++ b/src/util/time.cpp @@ -91,7 +91,9 @@ void Time::setTime(const char* time) { std::string_view Time::UTC() const { constexpr const char Format[] = "YYYY MON DDTHR:MN:SC.### ::RND"; - char* b = reinterpret_cast(global::memoryManager.TemporaryMemory.allocate(32)); + char* b = reinterpret_cast( + global::memoryManager->TemporaryMemory.allocate(32) + ); std::memset(b, 0, 32); SpiceManager::ref().dateFromEphemerisTime(_time, b, 32, Format); @@ -104,7 +106,9 @@ std::string_view Time::ISO8601() const { constexpr const char Format[] = "YYYY-MM-DDTHR:MN:SC.###"; constexpr const int S = sizeof(Format); - char* b = reinterpret_cast(global::memoryManager.TemporaryMemory.allocate(S)); + char* b = reinterpret_cast( + global::memoryManager->TemporaryMemory.allocate(S) + ); std::memset(b, 0, S); SpiceManager::ref().dateFromEphemerisTime(_time, b, S, Format); diff --git a/src/util/time_lua.inl b/src/util/time_lua.inl index 59fa6dc04b..fe5cc9fadd 100644 --- a/src/util/time_lua.inl +++ b/src/util/time_lua.inl @@ -55,7 +55,7 @@ int time_setDeltaTime(lua_State* L) { return luaL_error(L, "bad argument #%d (%s)", 2, msg); } const double newDeltaTime = lua_tonumber(L, 1); - global::timeManager.setDeltaTime(newDeltaTime); + global::timeManager->setDeltaTime(newDeltaTime); } else { lua_settop(L, 0); @@ -98,7 +98,7 @@ int time_setDeltaTimeSteps(lua_State* L) { } lua_pop(L, 1); - global::timeManager.setDeltaTimeSteps(inputDeltaTimes); + global::timeManager->setDeltaTimeSteps(inputDeltaTimes); lua_settop(L, 0); ghoul_assert(lua_gettop(L) == 0, "Incorrect number of items left on stack"); @@ -114,7 +114,7 @@ int time_setDeltaTimeSteps(lua_State* L) { int time_setNextDeltaTimeStep(lua_State* L) { ghoul::lua::checkArgumentsAndThrow(L, 0, "lua::time_setNextDeltaTimeStep"); - global::timeManager.setNextDeltaTimeStep(); + global::timeManager->setNextDeltaTimeStep(); lua_settop(L, 0); ghoul_assert(lua_gettop(L) == 0, "Incorrect number of items left on stack"); @@ -130,7 +130,7 @@ int time_setNextDeltaTimeStep(lua_State* L) { int time_setPreviousDeltaTimeStep(lua_State* L) { ghoul::lua::checkArgumentsAndThrow(L, 0, "lua::time_setPreviousDeltaTimeStep"); - global::timeManager.setPreviousDeltaTimeStep(); + global::timeManager->setPreviousDeltaTimeStep(); lua_settop(L, 0); ghoul_assert(lua_gettop(L) == 0, "Incorrect number of items left on stack"); @@ -153,7 +153,7 @@ int time_interpolateNextDeltaTimeStep(lua_State* L) { ); double interpolationDuration = - global::timeManager.defaultDeltaTimeInterpolationDuration(); + global::timeManager->defaultDeltaTimeInterpolationDuration(); const int nArguments = lua_gettop(L); if (nArguments == 1) { @@ -171,7 +171,7 @@ int time_interpolateNextDeltaTimeStep(lua_State* L) { interpolationDuration = lua_tonumber(L, 1); } - global::timeManager.interpolateNextDeltaTimeStep(interpolationDuration); + global::timeManager->interpolateNextDeltaTimeStep(interpolationDuration); lua_settop(L, 0); ghoul_assert(lua_gettop(L) == 0, "Incorrect number of items left on stack"); @@ -194,7 +194,7 @@ int time_interpolatePreviousDeltaTimeStep(lua_State* L) { ); double interpolationDuration = - global::timeManager.defaultDeltaTimeInterpolationDuration(); + global::timeManager->defaultDeltaTimeInterpolationDuration(); const int nArguments = lua_gettop(L); if (nArguments == 1) { @@ -212,7 +212,7 @@ int time_interpolatePreviousDeltaTimeStep(lua_State* L) { interpolationDuration = lua_tonumber(L, 1); } - global::timeManager.interpolatePreviousDeltaTimeStep(interpolationDuration); + global::timeManager->interpolatePreviousDeltaTimeStep(interpolationDuration); lua_settop(L, 0); ghoul_assert(lua_gettop(L) == 0, "Incorrect number of items left on stack"); @@ -256,7 +256,7 @@ int time_interpolateDeltaTime(lua_State* L) { const double interpolationDuration = lua_tonumber(L, 2); const double newDeltaTime = lua_tonumber(L, 1); - global::timeManager.interpolateDeltaTime(newDeltaTime, interpolationDuration); + global::timeManager->interpolateDeltaTime(newDeltaTime, interpolationDuration); } else if (nArguments == 1) { const bool isNumber = (lua_isnumber(L, 1) != 0); @@ -271,9 +271,9 @@ int time_interpolateDeltaTime(lua_State* L) { return luaL_error(L, "bad argument #%d (%s)", 2, msg); } const double newDeltaTime = lua_tonumber(L, 1); - global::timeManager.interpolateDeltaTime( + global::timeManager->interpolateDeltaTime( newDeltaTime, - global::timeManager.defaultDeltaTimeInterpolationDuration() + global::timeManager->defaultDeltaTimeInterpolationDuration() ); } else { @@ -295,7 +295,7 @@ int time_interpolateDeltaTime(lua_State* L) { * Returns the delta time by calling the Time::deltaTime method */ int time_deltaTime(lua_State* L) { - lua_pushnumber(L, global::timeManager.deltaTime()); + lua_pushnumber(L, global::timeManager->deltaTime()); ghoul_assert(lua_gettop(L) == 1, "Incorrect number of items left on stack"); return 1; } @@ -309,7 +309,7 @@ int time_togglePause(lua_State* L) { const int nArguments = lua_gettop(L); if (nArguments == 0) { - global::timeManager.setPause(!global::timeManager.isPaused()); + global::timeManager->setPause(!global::timeManager->isPaused()); } else { lua_settop(L, 0); @@ -350,17 +350,17 @@ int time_interpolateTogglePause(lua_State* L) { const double interpolationDuration = lua_tonumber(L, 1); - global::timeManager.interpolatePause( - !global::timeManager.isPaused(), + global::timeManager->interpolatePause( + !global::timeManager->isPaused(), interpolationDuration ); } else if (nArguments == 0) { - const bool pause = !global::timeManager.isPaused(); - global::timeManager.interpolatePause(pause, + const bool pause = !global::timeManager->isPaused(); + global::timeManager->interpolatePause(pause, pause ? - global::timeManager.defaultPauseInterpolationDuration() : - global::timeManager.defaultUnpauseInterpolationDuration() + global::timeManager->defaultPauseInterpolationDuration() : + global::timeManager->defaultUnpauseInterpolationDuration() ); } else { @@ -388,7 +388,7 @@ int time_setPause(lua_State* L) { if (nArguments == 1) { const bool pause = lua_toboolean(L, 1) == 1; - global::timeManager.setPause(pause); + global::timeManager->setPause(pause); } else { lua_settop(L, 0); @@ -429,14 +429,14 @@ int time_interpolatePause(lua_State* L) { } const double interpolationDuration = lua_tonumber(L, 2); const bool pause = lua_toboolean(L, 1) == 1; - global::timeManager.interpolatePause(pause, interpolationDuration); + global::timeManager->interpolatePause(pause, interpolationDuration); } else if (nArguments == 1) { const bool pause = lua_toboolean(L, 1) == 1; - global::timeManager.interpolatePause(pause, + global::timeManager->interpolatePause(pause, pause ? - global::timeManager.defaultPauseInterpolationDuration() : - global::timeManager.defaultUnpauseInterpolationDuration() + global::timeManager->defaultPauseInterpolationDuration() : + global::timeManager->defaultUnpauseInterpolationDuration() ); } else { @@ -488,12 +488,12 @@ int time_setTime(lua_State* L) { if (nArguments == 1) { if (isNumber) { double value = lua_tonumber(L, 1); - global::timeManager.setTimeNextFrame(Time(value)); + global::timeManager->setTimeNextFrame(Time(value)); return 0; } if (isString) { const char* time = lua_tostring(L, 1); - global::timeManager.setTimeNextFrame(Time(Time::convertTime(time))); + global::timeManager->setTimeNextFrame(Time(Time::convertTime(time))); return 0; } ghoul_assert(lua_gettop(L) == 0, "Incorrect number of items left on stack"); @@ -541,17 +541,17 @@ int time_interpolateTime(lua_State* L) { if (lua_gettop(L) == 1) { if (isNumber) { double value = lua_tonumber(L, 1); - global::timeManager.interpolateTime( + global::timeManager->interpolateTime( value, - global::timeManager.defaultTimeInterpolationDuration() + global::timeManager->defaultTimeInterpolationDuration() ); return 0; } if (isString) { const char* time = lua_tostring(L, 1); - global::timeManager.interpolateTime( + global::timeManager->interpolateTime( Time::convertTime(time), - global::timeManager.defaultTimeInterpolationDuration() + global::timeManager->defaultTimeInterpolationDuration() ); return 0; } @@ -577,10 +577,10 @@ int time_interpolateTime(lua_State* L) { const double duration = lua_tonumber(L, 2); if (duration > 0) { - global::timeManager.interpolateTime(targetTime, duration); + global::timeManager->interpolateTime(targetTime, duration); } else { - global::timeManager.setTimeNextFrame(Time(targetTime)); + global::timeManager->setTimeNextFrame(Time(targetTime)); } } return 0; @@ -615,9 +615,9 @@ int time_interpolateTimeRelative(lua_State* L) { if (lua_gettop(L) == 1 && isNumber) { double delta = lua_tonumber(L, 1); - global::timeManager.interpolateTimeRelative( + global::timeManager->interpolateTimeRelative( delta, - global::timeManager.defaultTimeInterpolationDuration() + global::timeManager->defaultTimeInterpolationDuration() ); ghoul_assert(lua_gettop(L) == 0, "Incorrect number of items left on stack"); @@ -638,11 +638,11 @@ int time_interpolateTimeRelative(lua_State* L) { const double duration = lua_tonumber(L, 2); if (duration > 0) { - global::timeManager.interpolateTimeRelative(delta, duration); + global::timeManager->interpolateTimeRelative(delta, duration); } else { - global::timeManager.setTimeNextFrame( - Time(global::timeManager.time().j2000Seconds() + delta) + global::timeManager->setTimeNextFrame( + Time(global::timeManager->time().j2000Seconds() + delta) ); } } @@ -656,7 +656,7 @@ int time_interpolateTimeRelative(lua_State* L) { * It is returned by calling the Time::currentTime method. */ int time_currentTime(lua_State* L) { - ghoul::lua::push(L, global::timeManager.time().j2000Seconds()); + ghoul::lua::push(L, global::timeManager->time().j2000Seconds()); ghoul_assert(lua_gettop(L) == 1, "Incorrect number of items left on stack"); return 1; } @@ -668,7 +668,7 @@ int time_currentTime(lua_State* L) { * timezone by calling the Time::UTC method */ int time_currentTimeUTC(lua_State* L) { - ghoul::lua::push(L, global::timeManager.time().UTC()); + ghoul::lua::push(L, global::timeManager->time().UTC()); ghoul_assert(lua_gettop(L) == 1, "Incorrect number of items left on stack"); return 1; } diff --git a/src/util/timemanager.cpp b/src/util/timemanager.cpp index 67beb6c0ca..d9a9b526c8 100644 --- a/src/util/timemanager.cpp +++ b/src/util/timemanager.cpp @@ -112,7 +112,7 @@ TimeManager::TimeManager() void TimeManager::interpolateTime(double targetTime, double durationSeconds) { ghoul_precondition(durationSeconds > 0.f, "durationSeconds must be positive"); - const double now = global::windowDelegate.applicationTime(); + const double now = global::windowDelegate->applicationTime(); const bool pause = isPaused(); const TimeKeyframeData current = { time(), deltaTime(), false, false }; @@ -126,10 +126,10 @@ void TimeManager::interpolateTime(double targetTime, double durationSeconds) { void TimeManager::interpolateTimeRelative(double delta, double durationSeconds) { ghoul_precondition(durationSeconds > 0.f, "durationSeconds must be positive"); - const float duration = global::timeManager.defaultTimeInterpolationDuration(); + const float duration = global::timeManager->defaultTimeInterpolationDuration(); const TimeKeyframeData predictedTime = interpolate( - global::windowDelegate.applicationTime() + duration + global::windowDelegate->applicationTime() + duration ); const double targetTime = predictedTime.time.j2000Seconds() + delta; interpolateTime(targetTime, durationSeconds); @@ -262,7 +262,7 @@ void TimeManager::progressTime(double dt) { return; } - const double now = global::windowDelegate.applicationTime(); + const double now = global::windowDelegate->applicationTime(); const std::deque>& keyframes = _timeline.keyframes(); auto firstFutureKeyframe = std::lower_bound( @@ -455,7 +455,7 @@ void TimeManager::addDeltaTimesKeybindings() { auto addDeltaTimeKeybind = [this](Key key, KeyModifier mod, double step) { const std::string s = fmt::format("{:.0f}", step); - global::keybindingManager.bindKeyLocal( + global::keybindingManager->bindKeyLocal( key, mod, fmt::format("openspace.time.interpolateDeltaTime({})", s), @@ -507,7 +507,7 @@ void TimeManager::addDeltaTimesKeybindings() { void TimeManager::clearDeltaTimesKeybindings() { for (const KeyWithModifier& kb : _deltaTimeStepKeybindings) { // Check if there are multiple keys bound to the same key - auto bindings = global::keybindingManager.keyBinding(kb); + auto bindings = global::keybindingManager->keyBinding(kb); if (bindings.size() > 1) { std::string names; for (auto& b : bindings) { @@ -519,7 +519,7 @@ void TimeManager::clearDeltaTimesKeybindings() { ghoul::to_string(kb), names )); } - global::keybindingManager.removeKeyBinding(kb); + global::keybindingManager->removeKeyBinding(kb); } _deltaTimeStepKeybindings.clear(); } @@ -716,7 +716,7 @@ void TimeManager::interpolateDeltaTime(double newDeltaTime, double interpolation return; } - const double now = global::windowDelegate.applicationTime(); + const double now = global::windowDelegate->applicationTime(); Time newTime( time().j2000Seconds() + (_deltaTime + newDeltaTime) * 0.5 * interpolationDuration ); @@ -812,7 +812,7 @@ void TimeManager::interpolatePause(bool pause, double interpolationDuration) { return; } - const double now = global::windowDelegate.applicationTime(); + const double now = global::windowDelegate->applicationTime(); double targetDelta = pause ? 0.0 : _targetDeltaTime; Time newTime( time().j2000Seconds() + (_deltaTime + targetDelta) * 0.5 * interpolationDuration diff --git a/src/util/touch.cpp b/src/util/touch.cpp index f08c5cab03..0c3d7ce7c1 100644 --- a/src/util/touch.cpp +++ b/src/util/touch.cpp @@ -44,7 +44,7 @@ glm::vec2 TouchInput::screenCoordinates(glm::vec2 resolution) const { } glm::vec2 TouchInput::currentWindowCoordinates() const { - glm::vec2 res = global::windowDelegate.currentSubwindowSize(); + glm::vec2 res = global::windowDelegate->currentSubwindowSize(); return { std::floor(x * res.x + 0.5f), std::floor(y * res.y + 0.5f) }; } diff --git a/support/cmake/handle_modules.cmake b/support/cmake/handle_modules.cmake index fc0178d699..b6258833f8 100644 --- a/support/cmake/handle_modules.cmake +++ b/support/cmake/handle_modules.cmake @@ -80,6 +80,10 @@ function (handle_modules internal_module_path external_modules_paths) # set(dependencies "") list(LENGTH enabled_module_names enabled_module_count) + if (${enabled_module_count} EQUAL 0) + message(STATUS "No modules selected") + return() + endif () math(EXPR enabled_module_count "${enabled_module_count} - 1") foreach (val RANGE ${enabled_module_count}) list(GET enabled_module_names ${val} name) diff --git a/tests/main.cpp b/tests/main.cpp index 69319043d3..11e7afe2d8 100644 --- a/tests/main.cpp +++ b/tests/main.cpp @@ -53,9 +53,9 @@ int main(int argc, char** argv) { ); std::string configFile = configuration::findConfiguration(); - global::configuration = configuration::loadConfigurationFromFile(configFile); - global::openSpaceEngine.registerPathTokens(); - global::openSpaceEngine.initialize(); + *global::configuration = configuration::loadConfigurationFromFile(configFile); + global::openSpaceEngine->registerPathTokens(); + global::openSpaceEngine->initialize(); FileSys.registerPathToken("${TESTDIR}", "${BASE}/tests"); @@ -66,6 +66,6 @@ int main(int argc, char** argv) { // And the deinitialization needs the SpiceManager to be initialized openspace::SpiceManager::initialize(); - global::openSpaceEngine.deinitialize(); + global::openSpaceEngine->deinitialize(); return result; } diff --git a/tests/test_assetloader.cpp b/tests/test_assetloader.cpp index 59aa57da43..097d7694cd 100644 --- a/tests/test_assetloader.cpp +++ b/tests/test_assetloader.cpp @@ -52,7 +52,7 @@ namespace { TEST_CASE("AssetLoader: Assertion", "[assetloader]") { openspace::Scene scene(std::make_unique()); - ghoul::lua::LuaState* state = openspace::global::scriptEngine.luaState(); + ghoul::lua::LuaState* state = openspace::global::scriptEngine->luaState(); openspace::SynchronizationWatcher syncWatcher; openspace::AssetLoader assetLoader( state, @@ -66,7 +66,7 @@ TEST_CASE("AssetLoader: Assertion", "[assetloader]") { TEST_CASE("AssetLoader: Basic Export Import", "[assetloader]") { openspace::Scene scene(std::make_unique()); - ghoul::lua::LuaState* state = openspace::global::scriptEngine.luaState(); + ghoul::lua::LuaState* state = openspace::global::scriptEngine->luaState(); openspace::SynchronizationWatcher syncWatcher; openspace::AssetLoader assetLoader( state, @@ -79,7 +79,7 @@ TEST_CASE("AssetLoader: Basic Export Import", "[assetloader]") { TEST_CASE("AssetLoader: Asset Functions", "[assetloader]") { openspace::Scene scene(std::make_unique()); - ghoul::lua::LuaState* state = openspace::global::scriptEngine.luaState(); + ghoul::lua::LuaState* state = openspace::global::scriptEngine->luaState(); openspace::SynchronizationWatcher syncWatcher; openspace::AssetLoader assetLoader( state, @@ -92,7 +92,7 @@ TEST_CASE("AssetLoader: Asset Functions", "[assetloader]") { TEST_CASE("AssetLoader: Asset Initialization", "[assetloader]") { openspace::Scene scene(std::make_unique()); - ghoul::lua::LuaState* state = openspace::global::scriptEngine.luaState(); + ghoul::lua::LuaState* state = openspace::global::scriptEngine->luaState(); openspace::SynchronizationWatcher syncWatcher; openspace::AssetLoader assetLoader( state, From b2f655ee7559ae07fc5b1bef7774aea8b8375d3d Mon Sep 17 00:00:00 2001 From: Micah Date: Mon, 26 Oct 2020 13:32:30 -0400 Subject: [PATCH 03/28] fix for saturn sync issue --- .../assets/scene/solarsystem/planets/saturn/saturn.asset | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/data/assets/scene/solarsystem/planets/saturn/saturn.asset b/data/assets/scene/solarsystem/planets/saturn/saturn.asset index eadd772084..d6bb4c47f2 100644 --- a/data/assets/scene/solarsystem/planets/saturn/saturn.asset +++ b/data/assets/scene/solarsystem/planets/saturn/saturn.asset @@ -3,12 +3,7 @@ local assetHelper = asset.require('util/asset_helper') asset.require("spice/base") asset.require('./trail') -local textures = asset.syncedResource({ - Type = "HttpSynchronization", - Name = "Saturn textures", - Identifier = "saturn_textures", - Version = 3 -}) +local texturesPath = asset.require("./saturn_textures").TexturesPath local Saturn = { Identifier = "Saturn", @@ -26,7 +21,7 @@ local Saturn = { SegmentsPerPatch = 64, Layers = {}, Rings = { - Texture = textures .. "/saturn_rings.png", + Texture = texturesPath .. "/saturn_rings.png", Size = 140445000, Offset = { 74500 / 140445.100671159, 1.0 }, -- min / max extend }, From d7f799da637d0519d4fdfd5df449f53e33dcc33f Mon Sep 17 00:00:00 2001 From: Micah Acinapura Date: Wed, 28 Oct 2020 09:24:37 -0400 Subject: [PATCH 04/28] Load psf texture on init so its readey for rendertime (#1356) --- modules/space/rendering/renderablestars.cpp | 65 +++++++++++---------- modules/space/rendering/renderablestars.h | 1 + 2 files changed, 36 insertions(+), 30 deletions(-) diff --git a/modules/space/rendering/renderablestars.cpp b/modules/space/rendering/renderablestars.cpp index e51bfefd51..e3a5987a08 100644 --- a/modules/space/rendering/renderablestars.cpp +++ b/modules/space/rendering/renderablestars.cpp @@ -789,7 +789,7 @@ void RenderableStars::initializeGL() { ); //loadShapeTexture(); - + loadPSFTexture(); renderPSFToTexture(); } @@ -808,6 +808,39 @@ void RenderableStars::deinitializeGL() { } } +void RenderableStars::loadPSFTexture() { + _pointSpreadFunctionTexture = nullptr; + if (!_pointSpreadFunctionTexturePath.value().empty() && + std::filesystem::exists(_pointSpreadFunctionTexturePath.value())) + { + _pointSpreadFunctionTexture = ghoul::io::TextureReader::ref().loadTexture( + absPath(_pointSpreadFunctionTexturePath) + ); + + if (_pointSpreadFunctionTexture) { + LDEBUG(fmt::format( + "Loaded texture from '{}'", + absPath(_pointSpreadFunctionTexturePath) + )); + _pointSpreadFunctionTexture->uploadTexture(); + } + _pointSpreadFunctionTexture->setFilter( + ghoul::opengl::Texture::FilterMode::AnisotropicMipMap + ); + + _pointSpreadFunctionFile = std::make_unique( + _pointSpreadFunctionTexturePath + ); + _pointSpreadFunctionFile->setCallback( + [&](const ghoul::filesystem::File&) { + _pointSpreadFunctionTextureIsDirty = true; + } + ); + } + _pointSpreadFunctionTextureIsDirty = false; + +} + void RenderableStars::renderPSFToTexture() { // Saves current FBO first GLint defaultFBO; @@ -1214,35 +1247,7 @@ void RenderableStars::update(const UpdateData&) { if (_pointSpreadFunctionTextureIsDirty) { LDEBUG("Reloading Point Spread Function texture"); - _pointSpreadFunctionTexture = nullptr; - if (!_pointSpreadFunctionTexturePath.value().empty() && - std::filesystem::exists(_pointSpreadFunctionTexturePath.value())) - { - _pointSpreadFunctionTexture = ghoul::io::TextureReader::ref().loadTexture( - absPath(_pointSpreadFunctionTexturePath) - ); - - if (_pointSpreadFunctionTexture) { - LDEBUG(fmt::format( - "Loaded texture from '{}'", - absPath(_pointSpreadFunctionTexturePath) - )); - _pointSpreadFunctionTexture->uploadTexture(); - } - _pointSpreadFunctionTexture->setFilter( - ghoul::opengl::Texture::FilterMode::AnisotropicMipMap - ); - - _pointSpreadFunctionFile = std::make_unique( - _pointSpreadFunctionTexturePath - ); - _pointSpreadFunctionFile->setCallback( - [&](const ghoul::filesystem::File&) { - _pointSpreadFunctionTextureIsDirty = true; - } - ); - } - _pointSpreadFunctionTextureIsDirty = false; + loadPSFTexture(); } if (_colorTextureIsDirty) { diff --git a/modules/space/rendering/renderablestars.h b/modules/space/rendering/renderablestars.h index 946f9b917b..0ab79f66cc 100644 --- a/modules/space/rendering/renderablestars.h +++ b/modules/space/rendering/renderablestars.h @@ -58,6 +58,7 @@ public: bool isReady() const override; + void loadPSFTexture(); void renderPSFToTexture(); void render(const RenderData& data, RendererTasks& rendererTask) override; void update(const UpdateData& data) override; From cc7c0092a3dec61e3ff72bf13a362787852d8635 Mon Sep 17 00:00:00 2001 From: Micah Acinapura Date: Wed, 28 Oct 2020 09:25:34 -0400 Subject: [PATCH 05/28] Feature/meta identifier list (#1357) Updating asset.meta.identifiers to be dictionary/list instead of string --- data/assets/scene/digitaluniverse/2dF.asset | 2 +- data/assets/scene/digitaluniverse/2mass.asset | 2 +- data/assets/scene/digitaluniverse/6dF.asset | 2 +- data/assets/scene/digitaluniverse/abell.asset | 2 +- .../digitaluniverse/alternatestarlabels.asset | 2 +- .../digitaluniverse/backgroundradiation.asset | 4 +-- .../scene/digitaluniverse/clusters.asset | 2 +- .../digitaluniverse/constellationbounds.asset | 2 +- .../digitaluniverse/constellations.asset | 2 +- .../scene/digitaluniverse/deepsky.asset | 2 +- .../assets/scene/digitaluniverse/dwarfs.asset | 2 +- .../scene/digitaluniverse/exoplanets.asset | 2 +- .../digitaluniverse/globularclusters.asset | 2 +- data/assets/scene/digitaluniverse/grids.asset | 8 ++--- .../assets/scene/digitaluniverse/groups.asset | 2 +- .../scene/digitaluniverse/h2regions.asset | 2 +- .../assets/scene/digitaluniverse/kepler.asset | 2 +- .../scene/digitaluniverse/localdwarfs.asset | 2 +- .../scene/digitaluniverse/milkyway.asset | 2 +- .../digitaluniverse/milkyway_arm_labels.asset | 2 +- .../digitaluniverse/milkyway_label.asset | 2 +- .../digitaluniverse/milkyway_sphere.asset | 2 +- .../digitaluniverse/obassociations.asset | 2 +- .../scene/digitaluniverse/openclusters.asset | 2 +- .../digitaluniverse/planetarynebulae.asset | 2 +- .../scene/digitaluniverse/pulsars.asset | 2 +- .../scene/digitaluniverse/quasars.asset | 2 +- data/assets/scene/digitaluniverse/sdss.asset | 2 +- .../scene/digitaluniverse/starlabels.asset | 2 +- .../scene/digitaluniverse/starorbits.asset | 4 +-- data/assets/scene/digitaluniverse/stars.asset | 2 +- .../scene/digitaluniverse/superclusters.asset | 2 +- .../digitaluniverse/supernovaremnants.asset | 2 +- data/assets/scene/digitaluniverse/tully.asset | 2 +- data/assets/scene/digitaluniverse/voids.asset | 2 +- .../scene/milkyway/milkyway/volume.asset | 2 +- .../objects/orionnebula/cluster.asset | 2 +- .../milkyway/objects/orionnebula/nebula.asset | 4 +-- .../planets/earth/atmosphere.asset | 2 +- .../solarsystem/planets/earth/earth.asset | 2 +- ...om_w1_sea_ice_concentration_temporal.asset | 2 +- .../colorlayers/aqua_modis_temporal.asset | 2 +- .../layers/colorlayers/bmng_sweden.asset | 2 +- .../earth/layers/colorlayers/bmng_utah.asset | 2 +- .../colorlayers/esri_imagery_world_2D.asset | 2 +- .../layers/colorlayers/esri_viirs_combo.asset | 2 +- .../colorlayers/esri_world_imagery.asset | 2 +- .../colorlayers/fallbacks/blue_marble.asset | 2 +- ...sst_sea_surface_temperature_temporal.asset | 2 +- ...mur_sea_surface_temperature_temporal.asset | 2 +- .../modis_terra_chlorophyll_a_temporal.asset | 2 +- .../colorlayers/terra_modis_temporal.asset | 2 +- .../colorlayers/viirs_snpp_temporal.asset | 2 +- .../fallbacks/blue_marble_height.asset | 2 +- .../layers/heightlayers/terrain_tileset.asset | 2 +- .../nightlayers/earth_at_night_2012.asset | 2 +- .../nightlayers/earth_at_night_temporal.asset | 2 +- .../fallbacks/earth_night_texture.asset | 2 +- .../solarsystem/planets/earth/markers.asset | 2 +- .../solarsystem/planets/earth/moon/moon.asset | 2 +- .../planets/earth/moon/trail.asset | 2 +- .../solarsystem/planets/earth/trail.asset | 2 +- .../planets/earth/transforms.asset | 2 +- .../planets/jupiter/callisto/callisto.asset | 2 +- .../planets/jupiter/callisto/trail.asset | 2 +- .../planets/jupiter/europa/europa.asset | 2 +- .../colorlayers/voyager_global_mosaic.asset | 2 +- .../planets/jupiter/europa/trail.asset | 2 +- .../planets/jupiter/ganymede/ganymede.asset | 2 +- .../planets/jupiter/ganymede/trail.asset | 2 +- .../solarsystem/planets/jupiter/io/io.asset | 2 +- .../planets/jupiter/io/trail.asset | 2 +- .../solarsystem/planets/jupiter/jupiter.asset | 2 +- .../solarsystem/planets/jupiter/trail.asset | 2 +- .../planets/jupiter/trail_earth.asset | 2 +- .../planets/jupiter/transforms.asset | 2 +- .../solarsystem/planets/mars/atmosphere.asset | 2 +- .../mars/layers/colorlayers/HiRISE.asset | 2 +- .../layers/colorlayers/ctx_blended_01.asset | 2 +- .../mars/layers/colorlayers/hirisels.asset | 2 +- .../layers/colorlayers/moc_wa_color_liu.asset | 2 +- .../colorlayers/moc_wa_color_utah.asset | 2 +- .../layers/colorlayers/mola_hrsc_sweden.asset | 2 +- .../layers/colorlayers/mola_hrsc_utah.asset | 2 +- .../mola_pseudo_color_sweden.asset | 2 +- .../colorlayers/mola_pseudo_color_utah.asset | 2 +- .../colorlayers/themis_ir_day_sweden.asset | 2 +- .../colorlayers/themis_ir_day_utah.asset | 2 +- .../colorlayers/themis_ir_night_sweden.asset | 2 +- .../colorlayers/themis_ir_night_utah.asset | 2 +- .../colorlayers/viking_mdim_sweden.asset | 2 +- .../layers/colorlayers/viking_mdim_utah.asset | 2 +- .../mars/layers/heightlayers/hirisels.asset | 2 +- .../layers/heightlayers/mola_europe.asset | 2 +- .../mars/layers/heightlayers/mola_utah.asset | 2 +- .../scene/solarsystem/planets/mars/mars.asset | 2 +- .../planets/mars/moons/deimos.asset | 2 +- .../planets/mars/moons/phobos.asset | 2 +- .../solarsystem/planets/mars/trail.asset | 2 +- .../planets/mars/trail_earth.asset | 2 +- .../solarsystem/planets/mars/transforms.asset | 2 +- .../solarsystem/planets/mercury/mercury.asset | 2 +- .../solarsystem/planets/mercury/trail.asset | 2 +- .../planets/mercury/trail_earth.asset | 2 +- .../planets/mercury/transforms.asset | 2 +- .../solarsystem/planets/neptune/neptune.asset | 2 +- .../solarsystem/planets/neptune/trail.asset | 2 +- .../planets/neptune/trail_earth.asset | 2 +- .../planets/neptune/transforms.asset | 2 +- .../solarsystem/planets/neptune/triton.asset | 2 +- .../planets/saturn/enceladus/enceladus.asset | 2 +- .../colorlayers/global_mosaic_100m_hpf.asset | 2 +- .../planets/saturn/enceladus/trail.asset | 2 +- .../planets/saturn/hyperion/hyperion.asset | 2 +- .../planets/saturn/hyperion/trail.asset | 2 +- .../planets/saturn/iapetus/iapetus.asset | 2 +- .../planets/saturn/iapetus/trail.asset | 2 +- .../planets/saturn/mimas/mimas.asset | 2 +- .../planets/saturn/mimas/trail.asset | 2 +- .../solarsystem/planets/saturn/saturn.asset | 3 +- .../cassini_iss_global_mosaic_4km_liu.asset | 2 +- .../planets/saturn/titan/titan.asset | 2 +- .../planets/saturn/titan/trail.asset | 2 +- .../solarsystem/planets/saturn/trail.asset | 2 +- .../planets/saturn/trail_earth.asset | 2 +- .../planets/saturn/transforms.asset | 2 +- .../solarsystem/planets/uranus/trail.asset | 2 +- .../planets/uranus/trail_earth.asset | 2 +- .../solarsystem/planets/uranus/uranus.asset | 2 +- .../planets/venus/atmosphere.asset | 2 +- .../colorlayers/magellan_mosaic_utah.asset | 2 +- .../venus/layers/heightlayers/magellan.asset | 2 +- .../solarsystem/planets/venus/trail.asset | 2 +- .../planets/venus/trail_earth.asset | 2 +- .../planets/venus/transforms.asset | 2 +- .../solarsystem/planets/venus/venus.asset | 2 +- .../solarsystem/sssb/amor_asteroid.asset | 2 +- .../solarsystem/sssb/apollo_asteroid.asset | 2 +- .../solarsystem/sssb/aten_asteroid.asset | 2 +- .../solarsystem/sssb/atira_asteroid.asset | 2 +- .../scene/solarsystem/sssb/c2019y4atlas.asset | 2 +- .../solarsystem/sssb/centaur_asteroid.asset | 2 +- .../solarsystem/sssb/chiron-type_comet.asset | 2 +- .../solarsystem/sssb/encke-type_comet.asset | 2 +- .../solarsystem/sssb/halley-type_comet.asset | 2 +- .../sssb/inner_main_belt_asteroid.asset | 2 +- .../sssb/jupiter-family_comet.asset | 2 +- .../sssb/jupiter_trojan_asteroid.asset | 2 +- .../solarsystem/sssb/main_belt_asteroid.asset | 2 +- .../sssb/mars-crossing_asteroid.asset | 2 +- .../sssb/outer_main_belt_asteroid.asset | 2 +- data/assets/scene/solarsystem/sssb/pha.asset | 2 +- .../scene/solarsystem/sssb/swifttuttle.asset | 2 +- .../solarsystem/sssb/tesla_roadster.asset | 2 +- .../sssb/transneptunian_object_asteroid.asset | 2 +- data/assets/scene/solarsystem/sun/glare.asset | 2 +- .../assets/scene/solarsystem/sun/marker.asset | 2 +- data/assets/scene/solarsystem/sun/sun.asset | 2 +- .../scene/solarsystem/sun/transforms.asset | 2 +- data/assets/util/webgui.asset | 2 +- data/profiles/mars.profile | 6 ++-- .../documentation/documentationgenerator.h | 10 ++++++ include/openspace/scene/asset.h | 2 +- src/documentation/documentationgenerator.cpp | 36 +++++++++++++++++++ src/scene/assetloader.cpp | 9 ++++- 165 files changed, 225 insertions(+), 171 deletions(-) diff --git a/data/assets/scene/digitaluniverse/2dF.asset b/data/assets/scene/digitaluniverse/2dF.asset index bf848bcde3..0e8c025a53 100644 --- a/data/assets/scene/digitaluniverse/2dF.asset +++ b/data/assets/scene/digitaluniverse/2dF.asset @@ -64,5 +64,5 @@ asset.meta = { Author = "Brian Abbott (AMNH), Eric Gawiser (Rutgers U)", URL = "https://www.amnh.org/research/hayden-planetarium/digital-universe", License = "AMNH Digital Universe", - Identifiers = "2dF" + Identifiers = {"2dF"} } diff --git a/data/assets/scene/digitaluniverse/2mass.asset b/data/assets/scene/digitaluniverse/2mass.asset index f852f3a707..d2a0b53a42 100644 --- a/data/assets/scene/digitaluniverse/2mass.asset +++ b/data/assets/scene/digitaluniverse/2mass.asset @@ -60,5 +60,5 @@ asset.meta = { Author = "Brian Abbott (AMNH)", URL = "https://www.amnh.org/research/hayden-planetarium/digital-universe", License = "AMNH Digital Universe", - Identifiers = "2MASS" + Identifiers = {"2MASS"} } diff --git a/data/assets/scene/digitaluniverse/6dF.asset b/data/assets/scene/digitaluniverse/6dF.asset index 5ae38458bb..a77c03fd11 100644 --- a/data/assets/scene/digitaluniverse/6dF.asset +++ b/data/assets/scene/digitaluniverse/6dF.asset @@ -61,5 +61,5 @@ asset.meta = { Author = "Brian Abbott (AMNH)", URL = "https://www.amnh.org/research/hayden-planetarium/digital-universe", License = "AMNH Digital Universe", - Identifiers = "6dF" + Identifiers = {"6dF"} } diff --git a/data/assets/scene/digitaluniverse/abell.asset b/data/assets/scene/digitaluniverse/abell.asset index 2f19ff5ff8..a40bf8e1f9 100644 --- a/data/assets/scene/digitaluniverse/abell.asset +++ b/data/assets/scene/digitaluniverse/abell.asset @@ -70,5 +70,5 @@ asset.meta = { Author = "Stuart Levy (NCSA/UIUC), Brian Abbott (AMNH)", URL = "https://www.amnh.org/research/hayden-planetarium/digital-universe", License = "AMNH Digital Universe", - Identifiers = "Abell" + Identifiers = {"Abell"} } diff --git a/data/assets/scene/digitaluniverse/alternatestarlabels.asset b/data/assets/scene/digitaluniverse/alternatestarlabels.asset index 7adb9ca9b9..2ba0ff4eb9 100644 --- a/data/assets/scene/digitaluniverse/alternatestarlabels.asset +++ b/data/assets/scene/digitaluniverse/alternatestarlabels.asset @@ -44,7 +44,7 @@ asset.meta = { Author = "Brian Abbott (AMNH)", URL = "https://www.amnh.org/research/hayden-planetarium/digital-universe", License = "AMNH Digital Universe", - Identifiers = "StarLabelsAlternate" + Identifiers = {"StarLabelsAlternate"} } assetHelper.registerSceneGraphNodesAndExport(asset, { object }) diff --git a/data/assets/scene/digitaluniverse/backgroundradiation.asset b/data/assets/scene/digitaluniverse/backgroundradiation.asset index a59f4d9374..1a7e4d7d44 100644 --- a/data/assets/scene/digitaluniverse/backgroundradiation.asset +++ b/data/assets/scene/digitaluniverse/backgroundradiation.asset @@ -260,6 +260,6 @@ asset.meta = { Author = "Brian Abbott (AMNH), OpenSpace Team", URL = "https://www.amnh.org/research/hayden-planetarium/digital-universe", License = "AMNH Digital Universe", - Identifiers = "WMAP,CBE,Planck,PlanckMultiverse1,PlanckMultiverse2" .. - "PlanckMultiverse3,PlanckMultiverse4,HAlpha" + Identifiers = {"WMAP", "CBE", "Planck", "PlanckMultiverse1", "PlanckMultiverse2", + "PlanckMultiverse3", "PlanckMultiverse4", "HAlpha"} } diff --git a/data/assets/scene/digitaluniverse/clusters.asset b/data/assets/scene/digitaluniverse/clusters.asset index 7525c55978..e4f0121334 100644 --- a/data/assets/scene/digitaluniverse/clusters.asset +++ b/data/assets/scene/digitaluniverse/clusters.asset @@ -50,5 +50,5 @@ asset.meta = { Author = "Brian Abbott (AMNH)", URL = "https://www.amnh.org/research/hayden-planetarium/digital-universe", License = "AMNH Digital Universe", - Identifiers = "GalaxyClusterLabels" + Identifiers = {"GalaxyClusterLabels"} } diff --git a/data/assets/scene/digitaluniverse/constellationbounds.asset b/data/assets/scene/digitaluniverse/constellationbounds.asset index 6c64402132..6da4fce20b 100644 --- a/data/assets/scene/digitaluniverse/constellationbounds.asset +++ b/data/assets/scene/digitaluniverse/constellationbounds.asset @@ -53,5 +53,5 @@ asset.meta = { Author = "Brian Abbott (AMNH)", URL = "https://www.amnh.org/research/hayden-planetarium/digital-universe", License = "AMNH Digital Universe", - Identifiers = "ConstellationBounds" + Identifiers = {"ConstellationBounds"} } diff --git a/data/assets/scene/digitaluniverse/constellations.asset b/data/assets/scene/digitaluniverse/constellations.asset index 93a522bbe9..52add17d18 100644 --- a/data/assets/scene/digitaluniverse/constellations.asset +++ b/data/assets/scene/digitaluniverse/constellations.asset @@ -72,5 +72,5 @@ asset.meta = { Author = "Brian Abbott (AMNH)", URL = "https://www.amnh.org/research/hayden-planetarium/digital-universe", License = "AMNH Digital Universe", - Identifiers = "Constellations,ConstellationsExtragalactic" + Identifiers = {"Constellations", "ConstellationsExtragalactic"} } diff --git a/data/assets/scene/digitaluniverse/deepsky.asset b/data/assets/scene/digitaluniverse/deepsky.asset index 00b3f1f180..8d858cc663 100644 --- a/data/assets/scene/digitaluniverse/deepsky.asset +++ b/data/assets/scene/digitaluniverse/deepsky.asset @@ -105,6 +105,6 @@ asset.meta = { Author = "Nate Greenstein, Matt Everhart, Brian Abbott (AMNH)", URL = "https://www.amnh.org/research/hayden-planetarium/digital-universe", License = "AMNH Digital Universe", - Identifiers = "DeepSkyObjects,DeepSkyObjectsImages" + Identifiers = {"DeepSkyObjects", "DeepSkyObjectsImages"} } diff --git a/data/assets/scene/digitaluniverse/dwarfs.asset b/data/assets/scene/digitaluniverse/dwarfs.asset index 2135911fe8..1efccea999 100644 --- a/data/assets/scene/digitaluniverse/dwarfs.asset +++ b/data/assets/scene/digitaluniverse/dwarfs.asset @@ -72,5 +72,5 @@ asset.meta = { Author = "Brian Abbott (AMNH)", URL = "https://www.amnh.org/research/hayden-planetarium/digital-universe", License = "AMNH Digital Universe", - Identifiers = "Dwarfs" + Identifiers = {"Dwarfs"} } diff --git a/data/assets/scene/digitaluniverse/exoplanets.asset b/data/assets/scene/digitaluniverse/exoplanets.asset index 81ea3477ca..027f5de52e 100644 --- a/data/assets/scene/digitaluniverse/exoplanets.asset +++ b/data/assets/scene/digitaluniverse/exoplanets.asset @@ -61,5 +61,5 @@ asset.meta = { Author = "Brian Abbott (AMNH)", URL = "https://www.amnh.org/research/hayden-planetarium/digital-universe", License = "AMNH Digital Universe", - Identifiers = "Exoplanets" + Identifiers = {"Exoplanets"} } diff --git a/data/assets/scene/digitaluniverse/globularclusters.asset b/data/assets/scene/digitaluniverse/globularclusters.asset index 9b0f95ebb3..ea516aac13 100644 --- a/data/assets/scene/digitaluniverse/globularclusters.asset +++ b/data/assets/scene/digitaluniverse/globularclusters.asset @@ -75,5 +75,5 @@ asset.meta = { Author = "Brian Abbott (AMNH)", URL = "https://www.amnh.org/research/hayden-planetarium/digital-universe", License = "AMNH Digital Universe", - Identifiers = "GlobularClusters" + Identifiers = {"GlobularClusters"} } diff --git a/data/assets/scene/digitaluniverse/grids.asset b/data/assets/scene/digitaluniverse/grids.asset index 31483f3243..2699247df4 100644 --- a/data/assets/scene/digitaluniverse/grids.asset +++ b/data/assets/scene/digitaluniverse/grids.asset @@ -548,8 +548,8 @@ asset.meta = { Author = "Brian Abbott (AMNH)", URL = "https://www.amnh.org/research/hayden-planetarium/digital-universe", License = "AMNH Digital Universe", - Identifiers = "RadioSphere,OortSphere,EclipticSphere,EclipticSphereLabels,Equatorial," - .. "EquatorialSphereLabels,GalacticSphere,GalacticSphereLabels,1ldGrid,1lmGrid," - .. "1lyGrid,10lyGrid,100lyGrid,1klyGrid,10klyGrid,100klyGrid,1MlyGrid,10MlyGrid," - .. "100MlyGrid,20GlyGrid" + Identifiers = {"RadioSphere", "OortSphere", "EclipticSphere", "EclipticSphereLabels", + "Equatorial", "EquatorialSphereLabels", "GalacticSphere", "GalacticSphereLabels", + "1ldGrid", "1lmGrid", "1lyGrid", "10lyGrid", "100lyGrid", "1klyGrid" "10klyGrid", + "100klyGrid", "1MlyGrid", "10MlyGrid", "100MlyGrid", "20GlyGrid"} } diff --git a/data/assets/scene/digitaluniverse/groups.asset b/data/assets/scene/digitaluniverse/groups.asset index 1f324cef43..5d9586e3ce 100644 --- a/data/assets/scene/digitaluniverse/groups.asset +++ b/data/assets/scene/digitaluniverse/groups.asset @@ -50,5 +50,5 @@ asset.meta = { Description = [[Digital Universe asset for Galaxy Groups]], URL = "https://www.amnh.org/research/hayden-planetarium/digital-universe", License = "AMNH Digital Universe", - Identifiers = "NearbyGalaxyGroups" + Identifiers = {"NearbyGalaxyGroups"} } diff --git a/data/assets/scene/digitaluniverse/h2regions.asset b/data/assets/scene/digitaluniverse/h2regions.asset index a54f40fe2f..470c5e7146 100644 --- a/data/assets/scene/digitaluniverse/h2regions.asset +++ b/data/assets/scene/digitaluniverse/h2regions.asset @@ -63,5 +63,5 @@ asset.meta = { Author = "Carter Emmart, Brian Abbott (AMNH)", URL = "https://www.amnh.org/research/hayden-planetarium/digital-universe", License = "AMNH Digital Universe", - Identifiers = "HIIRegions" + Identifiers = {"HIIRegions"} } diff --git a/data/assets/scene/digitaluniverse/kepler.asset b/data/assets/scene/digitaluniverse/kepler.asset index 8480f925a1..212071b5fe 100644 --- a/data/assets/scene/digitaluniverse/kepler.asset +++ b/data/assets/scene/digitaluniverse/kepler.asset @@ -58,5 +58,5 @@ asset.meta = { Author = "Brian Abbott, Emily Rice, and Jason No (AMNH)", URL = "https://www.amnh.org/research/hayden-planetarium/digital-universe", License = "AMNH Digital Universe", - Identifiers = "KeplerPlanetaryCandidates" + Identifiers = {"KeplerPlanetaryCandidates"} } diff --git a/data/assets/scene/digitaluniverse/localdwarfs.asset b/data/assets/scene/digitaluniverse/localdwarfs.asset index 41fb19c836..034d27a491 100644 --- a/data/assets/scene/digitaluniverse/localdwarfs.asset +++ b/data/assets/scene/digitaluniverse/localdwarfs.asset @@ -64,5 +64,5 @@ asset.meta = { Author = "Brian Abbott (AMNH)", URL = "https://www.amnh.org/research/hayden-planetarium/digital-universe", License = "AMNH Digital Universe", - Identifiers = "LocalDwarfGalaxies" + Identifiers = {"LocalDwarfGalaxies"} } diff --git a/data/assets/scene/digitaluniverse/milkyway.asset b/data/assets/scene/digitaluniverse/milkyway.asset index 058a333f2c..168fbf61ad 100644 --- a/data/assets/scene/digitaluniverse/milkyway.asset +++ b/data/assets/scene/digitaluniverse/milkyway.asset @@ -44,5 +44,5 @@ asset.meta = { Author = "Brian Abbott, Carter Emmart (AMNH)", URL = "https://www.amnh.org/research/hayden-planetarium/digital-universe", License = "AMNH Digital Universe", - Identifiers = "MilkyWayGalaxyImage" + Identifiers = {"MilkyWayGalaxyImage"} } diff --git a/data/assets/scene/digitaluniverse/milkyway_arm_labels.asset b/data/assets/scene/digitaluniverse/milkyway_arm_labels.asset index c973b8bb9d..8228de7a36 100644 --- a/data/assets/scene/digitaluniverse/milkyway_arm_labels.asset +++ b/data/assets/scene/digitaluniverse/milkyway_arm_labels.asset @@ -59,5 +59,5 @@ asset.meta = { any damage resulting from the use of this Atlas. The entire risk as to the quality and performance of this product is with the user.

For more information, please visit http://www.haydenplanetarium.org/universe]], - Identifiers = "MilkyWayGalaxyArmLabelsImage" + Identifiers = {"MilkyWayGalaxyArmLabelsImage"} } diff --git a/data/assets/scene/digitaluniverse/milkyway_label.asset b/data/assets/scene/digitaluniverse/milkyway_label.asset index aca337344c..f2e2046717 100644 --- a/data/assets/scene/digitaluniverse/milkyway_label.asset +++ b/data/assets/scene/digitaluniverse/milkyway_label.asset @@ -53,5 +53,5 @@ asset.meta = { Author = "OpenSpace Team", URL = "http://openspaceproject.com", License = "MIT license", - Identifiers = "HomeLabel" + Identifiers = {"HomeLabel"} } diff --git a/data/assets/scene/digitaluniverse/milkyway_sphere.asset b/data/assets/scene/digitaluniverse/milkyway_sphere.asset index 28b14ded2a..e3843e8faa 100644 --- a/data/assets/scene/digitaluniverse/milkyway_sphere.asset +++ b/data/assets/scene/digitaluniverse/milkyway_sphere.asset @@ -48,5 +48,5 @@ asset.meta = { Author = "OpenSpace Team", URL = "http://openspaceproject.com", License = "MIT license", - Identifiers = "MilkyWay" + Identifiers = {"MilkyWay"} } diff --git a/data/assets/scene/digitaluniverse/obassociations.asset b/data/assets/scene/digitaluniverse/obassociations.asset index 93d0c4d316..e357d498e9 100644 --- a/data/assets/scene/digitaluniverse/obassociations.asset +++ b/data/assets/scene/digitaluniverse/obassociations.asset @@ -67,5 +67,5 @@ asset.meta = { Author = "Brian Abbott (AMNH)", URL = "https://www.amnh.org/research/hayden-planetarium/digital-universe", License = "AMNH Digital Universe", - Identifiers = "OBAssociations" + Identifiers = {"OBAssociations"} } diff --git a/data/assets/scene/digitaluniverse/openclusters.asset b/data/assets/scene/digitaluniverse/openclusters.asset index 4da9e44a02..1a40b4834b 100644 --- a/data/assets/scene/digitaluniverse/openclusters.asset +++ b/data/assets/scene/digitaluniverse/openclusters.asset @@ -63,5 +63,5 @@ asset.meta = { Author = "Brian Abbott (AMNH)", URL = "https://www.amnh.org/research/hayden-planetarium/digital-universe", License = "AMNH Digital Universe", - Identifiers = "OpenStarClusters" + Identifiers = {"OpenStarClusters"} } diff --git a/data/assets/scene/digitaluniverse/planetarynebulae.asset b/data/assets/scene/digitaluniverse/planetarynebulae.asset index 3c56a24762..7415c85657 100644 --- a/data/assets/scene/digitaluniverse/planetarynebulae.asset +++ b/data/assets/scene/digitaluniverse/planetarynebulae.asset @@ -60,5 +60,5 @@ asset.meta = { Author = "Brian Abbott (AMNH)", URL = "https://www.amnh.org/research/hayden-planetarium/digital-universe", License = "AMNH Digital Universe", - Identifiers = "PlanetaryNebulae" + Identifiers = {"PlanetaryNebulae"} } diff --git a/data/assets/scene/digitaluniverse/pulsars.asset b/data/assets/scene/digitaluniverse/pulsars.asset index 8b572b9391..ad2bd6a438 100644 --- a/data/assets/scene/digitaluniverse/pulsars.asset +++ b/data/assets/scene/digitaluniverse/pulsars.asset @@ -64,5 +64,5 @@ asset.meta = { Author = "Brian Abbott (AMNH)", URL = "https://www.amnh.org/research/hayden-planetarium/digital-universe", License = "AMNH Digital Universe", - Identifiers = "Pulsars" + Identifiers = {"Pulsars"} } diff --git a/data/assets/scene/digitaluniverse/quasars.asset b/data/assets/scene/digitaluniverse/quasars.asset index c1363977d8..cf880b62fa 100644 --- a/data/assets/scene/digitaluniverse/quasars.asset +++ b/data/assets/scene/digitaluniverse/quasars.asset @@ -58,5 +58,5 @@ asset.meta = { Author = "Brian Abbott (AMNH)", URL = "https://www.amnh.org/research/hayden-planetarium/digital-universe", License = "AMNH Digital Universe", - Identifiers = "Quasars" + Identifiers = {"Quasars"} } diff --git a/data/assets/scene/digitaluniverse/sdss.asset b/data/assets/scene/digitaluniverse/sdss.asset index aea7142560..b0bc956351 100644 --- a/data/assets/scene/digitaluniverse/sdss.asset +++ b/data/assets/scene/digitaluniverse/sdss.asset @@ -73,5 +73,5 @@ asset.meta = { Author = "Brian Abbott (AMNH)", URL = "https://www.amnh.org/research/hayden-planetarium/digital-universe", License = "AMNH Digital Universe", - Identifiers = "SloanDigitalSkySurvey" + Identifiers = {"SloanDigitalSkySurvey"} } diff --git a/data/assets/scene/digitaluniverse/starlabels.asset b/data/assets/scene/digitaluniverse/starlabels.asset index 62fda28888..5b68512e81 100644 --- a/data/assets/scene/digitaluniverse/starlabels.asset +++ b/data/assets/scene/digitaluniverse/starlabels.asset @@ -42,5 +42,5 @@ asset.meta = { Author = "Brian Abbott (AMNH)", URL = "https://www.amnh.org/research/hayden-planetarium/digital-universe", License = "AMNH Digital Universe", - Identifiers = "StarsLabels" + Identifiers = {"StarsLabels"} } diff --git a/data/assets/scene/digitaluniverse/starorbits.asset b/data/assets/scene/digitaluniverse/starorbits.asset index fad2c66b5e..46e4ec8018 100644 --- a/data/assets/scene/digitaluniverse/starorbits.asset +++ b/data/assets/scene/digitaluniverse/starorbits.asset @@ -187,6 +187,6 @@ asset.meta = { Author = "Brian Abbott (AMNH)", URL = "https://www.amnh.org/research/hayden-planetarium/digital-universe", License = "AMNH Digital Universe", - Identifiers = "SunOrbit,BarnardsOrbit,KapteynsOrbit,pM_J13420Orbit,LSR1826Orbit," .. - "LSRJ0822Orbit,lacaille9352Orbit" + Identifiers = {"SunOrbit", "BarnardsOrbit", "KapteynsOrbit", "pM_J13420Orbit", + "LSR1826Orbit", "LSRJ0822Orbit", "lacaille9352Orbit"} } diff --git a/data/assets/scene/digitaluniverse/stars.asset b/data/assets/scene/digitaluniverse/stars.asset index 3978780626..7328d0fae4 100644 --- a/data/assets/scene/digitaluniverse/stars.asset +++ b/data/assets/scene/digitaluniverse/stars.asset @@ -86,5 +86,5 @@ asset.meta = { Author = "Brian Abbott (AMNH)", URL = "https://www.amnh.org/research/hayden-planetarium/digital-universe", License = "AMNH Digital Universe", - Identifiers = "Stars" + Identifiers = {"Stars"} } diff --git a/data/assets/scene/digitaluniverse/superclusters.asset b/data/assets/scene/digitaluniverse/superclusters.asset index 9e2f74d287..c5c688640d 100644 --- a/data/assets/scene/digitaluniverse/superclusters.asset +++ b/data/assets/scene/digitaluniverse/superclusters.asset @@ -58,5 +58,5 @@ asset.meta = { Author = "Brian Abbott (AMNH)", URL = "https://www.amnh.org/research/hayden-planetarium/digital-universe", License = "AMNH Digital Universe", - Identifiers = "GalaxySuperclusters" + Identifiers = {"GalaxySuperclusters"} } diff --git a/data/assets/scene/digitaluniverse/supernovaremnants.asset b/data/assets/scene/digitaluniverse/supernovaremnants.asset index 29b0f6bc3e..d3b19093a3 100644 --- a/data/assets/scene/digitaluniverse/supernovaremnants.asset +++ b/data/assets/scene/digitaluniverse/supernovaremnants.asset @@ -59,5 +59,5 @@ asset.meta = { Author = "Brian Abbott (AMNH)", URL = "https://www.amnh.org/research/hayden-planetarium/digital-universe", License = "AMNH Digital Universe", - Identifiers = "SupernovaRemnants" + Identifiers = {"SupernovaRemnants"} } diff --git a/data/assets/scene/digitaluniverse/tully.asset b/data/assets/scene/digitaluniverse/tully.asset index 31cc4cb3ab..2bc40a8ac4 100644 --- a/data/assets/scene/digitaluniverse/tully.asset +++ b/data/assets/scene/digitaluniverse/tully.asset @@ -124,5 +124,5 @@ asset.meta = { Author = "Stuart Levy (NCSA/UIUC), Brian Abbott (AMNH)", URL = "https://www.amnh.org/research/hayden-planetarium/digital-universe", License = "AMNH Digital Universe", - Identifiers = "TullyGalaxies,TullyGalaxiesImages" + Identifiers = {"TullyGalaxies" , "TullyGalaxiesImages"} } diff --git a/data/assets/scene/digitaluniverse/voids.asset b/data/assets/scene/digitaluniverse/voids.asset index 8156708b9e..dbc7eac25a 100644 --- a/data/assets/scene/digitaluniverse/voids.asset +++ b/data/assets/scene/digitaluniverse/voids.asset @@ -50,5 +50,5 @@ asset.meta = { Description = [[Digital Universe asset for Cosmic voids.]], URL = "https://www.amnh.org/research/hayden-planetarium/digital-universe", License = "AMNH Digital Universe", - Identifiers = "Voids" + Identifiers = {"Voids"} } diff --git a/data/assets/scene/milkyway/milkyway/volume.asset b/data/assets/scene/milkyway/milkyway/volume.asset index 4f87af5456..aaf3aa3fec 100644 --- a/data/assets/scene/milkyway/milkyway/volume.asset +++ b/data/assets/scene/milkyway/milkyway/volume.asset @@ -62,5 +62,5 @@ asset.meta = { Author = "OpenSpace Team", URL = "http://openspaceproject.com", License = "MIT License", - Identifiers = "MilkyWayVolume" + Identifiers = {"MilkyWayVolume"} } diff --git a/data/assets/scene/milkyway/objects/orionnebula/cluster.asset b/data/assets/scene/milkyway/objects/orionnebula/cluster.asset index d2c3ff1727..910aca0673 100644 --- a/data/assets/scene/milkyway/objects/orionnebula/cluster.asset +++ b/data/assets/scene/milkyway/objects/orionnebula/cluster.asset @@ -49,5 +49,5 @@ cluster distribution. ]], Author = "AMNH Digital Universe", URL = "https://www.amnh.org/research/hayden-planetarium/digital-universe", License = "AMNH Digital Universe", - Identifiers = "OrionClusterStars" + Identifiers = {"OrionClusterStars"} } diff --git a/data/assets/scene/milkyway/objects/orionnebula/nebula.asset b/data/assets/scene/milkyway/objects/orionnebula/nebula.asset index 0eaf64e257..dc99a09a4f 100644 --- a/data/assets/scene/milkyway/objects/orionnebula/nebula.asset +++ b/data/assets/scene/milkyway/objects/orionnebula/nebula.asset @@ -155,6 +155,6 @@ and the bow shocks are part of the outward rush of material. ]], Author = "AMNH Digital Universe", URL = "https://www.amnh.org/research/hayden-planetarium/digital-universe", License = "AMNH Digital Universe", - Identifiers = "OrionNebulaModel,OrionNebulaModel,OrionNebulaProplydsModel,".. - "OrionNebulaShocksModel" + Identifiers = {"OrionNebulaModel", "OrionNebulaModel", "OrionNebulaProplydsModel", + "OrionNebulaShocksModel"} } diff --git a/data/assets/scene/solarsystem/planets/earth/atmosphere.asset b/data/assets/scene/solarsystem/planets/earth/atmosphere.asset index c46df1f9b4..9bb7b5cadd 100644 --- a/data/assets/scene/solarsystem/planets/earth/atmosphere.asset +++ b/data/assets/scene/solarsystem/planets/earth/atmosphere.asset @@ -111,5 +111,5 @@ asset.meta = { Author = "OpenSpace Team", URL = "http://openspaceproject.com", License = "MIT license", - Identifiers = "EarthAtmosphere" + Identifiers = {"EarthAtmosphere"} } diff --git a/data/assets/scene/solarsystem/planets/earth/earth.asset b/data/assets/scene/solarsystem/planets/earth/earth.asset index 73d63828c9..476414303f 100644 --- a/data/assets/scene/solarsystem/planets/earth/earth.asset +++ b/data/assets/scene/solarsystem/planets/earth/earth.asset @@ -91,5 +91,5 @@ asset.meta = { Author = "OpenSpace Team", URL = "http://openspaceproject.com", License = "MIT license", - Identifiers = "Earth,EarthLabel" + Identifiers = {"Earth", "EarthLabel"} } diff --git a/data/assets/scene/solarsystem/planets/earth/layers/colorlayers/amsr2_gcom_w1_sea_ice_concentration_temporal.asset b/data/assets/scene/solarsystem/planets/earth/layers/colorlayers/amsr2_gcom_w1_sea_ice_concentration_temporal.asset index cbca713bac..d4c110e9fc 100644 --- a/data/assets/scene/solarsystem/planets/earth/layers/colorlayers/amsr2_gcom_w1_sea_ice_concentration_temporal.asset +++ b/data/assets/scene/solarsystem/planets/earth/layers/colorlayers/amsr2_gcom_w1_sea_ice_concentration_temporal.asset @@ -35,5 +35,5 @@ asset.meta = { Author = "NASA EOSDIS Global Imagery Browse Services", URL = "https://earthdata.nasa.gov/eosdis/science-system-description/eosdis-components/gibs", License = "NASA", - Identifiers = "AMSR2_GCOM_W1_Sea_Ice_Concentration_Temporal" + Identifiers = {"AMSR2_GCOM_W1_Sea_Ice_Concentration_Temporal"} } diff --git a/data/assets/scene/solarsystem/planets/earth/layers/colorlayers/aqua_modis_temporal.asset b/data/assets/scene/solarsystem/planets/earth/layers/colorlayers/aqua_modis_temporal.asset index 503d014e93..fa0b103440 100644 --- a/data/assets/scene/solarsystem/planets/earth/layers/colorlayers/aqua_modis_temporal.asset +++ b/data/assets/scene/solarsystem/planets/earth/layers/colorlayers/aqua_modis_temporal.asset @@ -40,5 +40,5 @@ asset.meta = { Author = "NASA EOSDIS Global Imagery Browse Services", URL = "https://earthdata.nasa.gov/eosdis/science-system-description/eosdis-components/gibs", License = "NASA", - Identifiers = "Aqua_Modis_Temporal" + Identifiers = {"Aqua_Modis_Temporal"} } diff --git a/data/assets/scene/solarsystem/planets/earth/layers/colorlayers/bmng_sweden.asset b/data/assets/scene/solarsystem/planets/earth/layers/colorlayers/bmng_sweden.asset index 64314513ab..ad786b1301 100644 --- a/data/assets/scene/solarsystem/planets/earth/layers/colorlayers/bmng_sweden.asset +++ b/data/assets/scene/solarsystem/planets/earth/layers/colorlayers/bmng_sweden.asset @@ -24,5 +24,5 @@ asset.meta = { Author = "OpenSpace Team", URL = "https://visibleearth.nasa.gov/collection/1484/blue-marble", License = "NASA", - Identifiers = "BMNG_Sweden" + Identifiers = {"BMNG_Sweden"} } diff --git a/data/assets/scene/solarsystem/planets/earth/layers/colorlayers/bmng_utah.asset b/data/assets/scene/solarsystem/planets/earth/layers/colorlayers/bmng_utah.asset index 7f115b2db3..fca8d5e4c5 100644 --- a/data/assets/scene/solarsystem/planets/earth/layers/colorlayers/bmng_utah.asset +++ b/data/assets/scene/solarsystem/planets/earth/layers/colorlayers/bmng_utah.asset @@ -24,5 +24,5 @@ asset.meta = { Author = "OpenSpace Team", URL = "https://visibleearth.nasa.gov/collection/1484/blue-marble", License = "NASA", - Identifiers = "BMNG_Utah" + Identifiers = {"BMNG_Utah"} } diff --git a/data/assets/scene/solarsystem/planets/earth/layers/colorlayers/esri_imagery_world_2D.asset b/data/assets/scene/solarsystem/planets/earth/layers/colorlayers/esri_imagery_world_2D.asset index cfd621fbae..284eebb05c 100644 --- a/data/assets/scene/solarsystem/planets/earth/layers/colorlayers/esri_imagery_world_2D.asset +++ b/data/assets/scene/solarsystem/planets/earth/layers/colorlayers/esri_imagery_world_2D.asset @@ -30,5 +30,5 @@ asset.meta = { Author = "ESRI", URL = "https://www.arcgis.com/home/item.html?id=21b4ba14d9e5472d97afcbb819f7368e", License = "Esri Master License Agreement", - Identifiers = "ESRI_Imagery_World_2D" + Identifiers = {"ESRI_Imagery_World_2D"} } diff --git a/data/assets/scene/solarsystem/planets/earth/layers/colorlayers/esri_viirs_combo.asset b/data/assets/scene/solarsystem/planets/earth/layers/colorlayers/esri_viirs_combo.asset index 10522fae95..5ced647f2f 100644 --- a/data/assets/scene/solarsystem/planets/earth/layers/colorlayers/esri_viirs_combo.asset +++ b/data/assets/scene/solarsystem/planets/earth/layers/colorlayers/esri_viirs_combo.asset @@ -56,5 +56,5 @@ asset.meta = { Author = "OpenSpace Tem", URL = "http://www.openspaceproject.com", License = "MIT License", - Identifiers = "ESRI_VIIRS_Combo" + Identifiers = {"ESRI_VIIRS_Combo"} } diff --git a/data/assets/scene/solarsystem/planets/earth/layers/colorlayers/esri_world_imagery.asset b/data/assets/scene/solarsystem/planets/earth/layers/colorlayers/esri_world_imagery.asset index 7f9e511ee7..f583a8e8bb 100644 --- a/data/assets/scene/solarsystem/planets/earth/layers/colorlayers/esri_world_imagery.asset +++ b/data/assets/scene/solarsystem/planets/earth/layers/colorlayers/esri_world_imagery.asset @@ -31,5 +31,5 @@ asset.meta = { Author = "ESRI", URL = "https://www.arcgis.com/home/item.html?id=10df2279f9684e4a9f6a7f08febac2a9", License = "Esri Master License Agreement", - Identifiers = "ESRI_World_Imagery" + Identifiers = {"ESRI_World_Imagery"} } diff --git a/data/assets/scene/solarsystem/planets/earth/layers/colorlayers/fallbacks/blue_marble.asset b/data/assets/scene/solarsystem/planets/earth/layers/colorlayers/fallbacks/blue_marble.asset index 59cbafb1cc..548f57c33c 100644 --- a/data/assets/scene/solarsystem/planets/earth/layers/colorlayers/fallbacks/blue_marble.asset +++ b/data/assets/scene/solarsystem/planets/earth/layers/colorlayers/fallbacks/blue_marble.asset @@ -19,5 +19,5 @@ asset.meta = { Author = "OpenSpace Team", URL = "https://visibleearth.nasa.gov/collection/1484/blue-marble", License = "NASA", - Identifiers = "Blue_Marble" + Identifiers = {"Blue_Marble"} } diff --git a/data/assets/scene/solarsystem/planets/earth/layers/colorlayers/ghrsst_l4_g1sst_sea_surface_temperature_temporal.asset b/data/assets/scene/solarsystem/planets/earth/layers/colorlayers/ghrsst_l4_g1sst_sea_surface_temperature_temporal.asset index 0e4d577f5e..eaf1a5b5ea 100644 --- a/data/assets/scene/solarsystem/planets/earth/layers/colorlayers/ghrsst_l4_g1sst_sea_surface_temperature_temporal.asset +++ b/data/assets/scene/solarsystem/planets/earth/layers/colorlayers/ghrsst_l4_g1sst_sea_surface_temperature_temporal.asset @@ -34,5 +34,5 @@ asset.meta = { URL = "https://earthdata.nasa.gov/eosdis/science-system-description/" .. "eosdis-components/gibs", License = "NASA", - Identifiers = "GHRSST_L4_G1SST_Sea_Surface_Temperature_Temporal" + Identifiers = {"GHRSST_L4_G1SST_Sea_Surface_Temperature_Temporal"} } diff --git a/data/assets/scene/solarsystem/planets/earth/layers/colorlayers/ghrsst_l4_mur_sea_surface_temperature_temporal.asset b/data/assets/scene/solarsystem/planets/earth/layers/colorlayers/ghrsst_l4_mur_sea_surface_temperature_temporal.asset index c1e0ba9f84..0371007fd9 100644 --- a/data/assets/scene/solarsystem/planets/earth/layers/colorlayers/ghrsst_l4_mur_sea_surface_temperature_temporal.asset +++ b/data/assets/scene/solarsystem/planets/earth/layers/colorlayers/ghrsst_l4_mur_sea_surface_temperature_temporal.asset @@ -32,5 +32,5 @@ asset.meta = { URL = "https://earthdata.nasa.gov/eosdis/science-system-description/".. "eosdis-components/gibs", License = "NASA", - Identifiers = "GHRSST_L4_MUR_Sea_Surface_Temperature_Temporal" + Identifiers = {"GHRSST_L4_MUR_Sea_Surface_Temperature_Temporal"} } diff --git a/data/assets/scene/solarsystem/planets/earth/layers/colorlayers/modis_terra_chlorophyll_a_temporal.asset b/data/assets/scene/solarsystem/planets/earth/layers/colorlayers/modis_terra_chlorophyll_a_temporal.asset index 32cea1a7e7..64d5ddfabe 100644 --- a/data/assets/scene/solarsystem/planets/earth/layers/colorlayers/modis_terra_chlorophyll_a_temporal.asset +++ b/data/assets/scene/solarsystem/planets/earth/layers/colorlayers/modis_terra_chlorophyll_a_temporal.asset @@ -32,5 +32,5 @@ asset.meta = { URL = "https://earthdata.nasa.gov/eosdis/science-system-description/" .. "eosdis-components/gibs", License = "NASA", - Identifiers = "MODIS_Terra_Chlorophyll_A_Temporal" + Identifiers = {"MODIS_Terra_Chlorophyll_A_Temporal"} } diff --git a/data/assets/scene/solarsystem/planets/earth/layers/colorlayers/terra_modis_temporal.asset b/data/assets/scene/solarsystem/planets/earth/layers/colorlayers/terra_modis_temporal.asset index b114f114b6..de489171d6 100644 --- a/data/assets/scene/solarsystem/planets/earth/layers/colorlayers/terra_modis_temporal.asset +++ b/data/assets/scene/solarsystem/planets/earth/layers/colorlayers/terra_modis_temporal.asset @@ -32,5 +32,5 @@ asset.meta = { URL = "https://earthdata.nasa.gov/eosdis/science-system-description/".. "eosdis-components/gibs", License = "NASA", - Identifiers = "Terra_Modis_Temporal" + Identifiers = {"Terra_Modis_Temporal"} } diff --git a/data/assets/scene/solarsystem/planets/earth/layers/colorlayers/viirs_snpp_temporal.asset b/data/assets/scene/solarsystem/planets/earth/layers/colorlayers/viirs_snpp_temporal.asset index 1a8982274f..4730e990a7 100644 --- a/data/assets/scene/solarsystem/planets/earth/layers/colorlayers/viirs_snpp_temporal.asset +++ b/data/assets/scene/solarsystem/planets/earth/layers/colorlayers/viirs_snpp_temporal.asset @@ -32,5 +32,5 @@ asset.meta = { URL = "https://earthdata.nasa.gov/eosdis/science-system-description/" .. "eosdis-components/gibs", License = "NASA", - Identifiers = "VIIRS_SNPP_Temporal" + Identifiers = {"VIIRS_SNPP_Temporal"} } diff --git a/data/assets/scene/solarsystem/planets/earth/layers/heightlayers/fallbacks/blue_marble_height.asset b/data/assets/scene/solarsystem/planets/earth/layers/heightlayers/fallbacks/blue_marble_height.asset index c896d37583..6cfd7a680e 100644 --- a/data/assets/scene/solarsystem/planets/earth/layers/heightlayers/fallbacks/blue_marble_height.asset +++ b/data/assets/scene/solarsystem/planets/earth/layers/heightlayers/fallbacks/blue_marble_height.asset @@ -18,5 +18,5 @@ asset.meta = { Author = "NASA", URL = "https://visibleearth.nasa.gov/collection/1484/blue-marble", License = "NASA", - Identifiers = "Earth_Bluemarble_Height" + Identifiers = {"Earth_Bluemarble_Height"} } diff --git a/data/assets/scene/solarsystem/planets/earth/layers/heightlayers/terrain_tileset.asset b/data/assets/scene/solarsystem/planets/earth/layers/heightlayers/terrain_tileset.asset index 19c40c9b84..ad574bb9b2 100644 --- a/data/assets/scene/solarsystem/planets/earth/layers/heightlayers/terrain_tileset.asset +++ b/data/assets/scene/solarsystem/planets/earth/layers/heightlayers/terrain_tileset.asset @@ -31,5 +31,5 @@ asset.meta = { Author = "ESRI", URL = "https://www.arcgis.com/home/item.html?id=1b48cd3b6276416784fe90a68c580a89", License = "Esri Master License Agreement", - Identifiers = "Terrain_tileset" + Identifiers = {"Terrain_tileset"} } diff --git a/data/assets/scene/solarsystem/planets/earth/layers/nightlayers/earth_at_night_2012.asset b/data/assets/scene/solarsystem/planets/earth/layers/nightlayers/earth_at_night_2012.asset index 659125449e..103ae90770 100644 --- a/data/assets/scene/solarsystem/planets/earth/layers/nightlayers/earth_at_night_2012.asset +++ b/data/assets/scene/solarsystem/planets/earth/layers/nightlayers/earth_at_night_2012.asset @@ -26,5 +26,5 @@ asset.meta = { Author = "OpenSpace Team", URL = "https://visibleearth.nasa.gov/images/79765/night-lights-2012-map", License = "NASA", - Identifiers = "Earth_at_Night_2012" + Identifiers = {"Earth_at_Night_2012"} } diff --git a/data/assets/scene/solarsystem/planets/earth/layers/nightlayers/earth_at_night_temporal.asset b/data/assets/scene/solarsystem/planets/earth/layers/nightlayers/earth_at_night_temporal.asset index 8effe06be3..6b126d25b7 100644 --- a/data/assets/scene/solarsystem/planets/earth/layers/nightlayers/earth_at_night_temporal.asset +++ b/data/assets/scene/solarsystem/planets/earth/layers/nightlayers/earth_at_night_temporal.asset @@ -47,5 +47,5 @@ asset.meta = { Author = "OpenSpace Team", URL = "https://worldview.earthdata.nasa.gov/?l=VIIRS_SNPP_DayNightBand_ENCC", License = "NASA", - Identifiers = "Earth_at_Night_Temporal" + Identifiers = {"Earth_at_Night_Temporal"} } diff --git a/data/assets/scene/solarsystem/planets/earth/layers/nightlayers/fallbacks/earth_night_texture.asset b/data/assets/scene/solarsystem/planets/earth/layers/nightlayers/fallbacks/earth_night_texture.asset index 38b8a630fe..25d092b60d 100644 --- a/data/assets/scene/solarsystem/planets/earth/layers/nightlayers/fallbacks/earth_night_texture.asset +++ b/data/assets/scene/solarsystem/planets/earth/layers/nightlayers/fallbacks/earth_night_texture.asset @@ -17,5 +17,5 @@ asset.meta = { Author = "OpenSpace Team", URL = "https://visibleearth.nasa.gov/collection/1484/blue-marble", License = "NASA", - Identifiers = "Earth_Night_Texture" + Identifiers = {"Earth_Night_Texture"} } diff --git a/data/assets/scene/solarsystem/planets/earth/markers.asset b/data/assets/scene/solarsystem/planets/earth/markers.asset index 29e0dd8f73..d6acac5b23 100644 --- a/data/assets/scene/solarsystem/planets/earth/markers.asset +++ b/data/assets/scene/solarsystem/planets/earth/markers.asset @@ -32,5 +32,5 @@ asset.meta = { Author = "OpenSpace Team", URL = "http://openspaceproject.com", License = "MIT license", - Identifiers = "EarthMarker" + Identifiers = {"EarthMarker"} } diff --git a/data/assets/scene/solarsystem/planets/earth/moon/moon.asset b/data/assets/scene/solarsystem/planets/earth/moon/moon.asset index b3daa4d330..c6079124a9 100644 --- a/data/assets/scene/solarsystem/planets/earth/moon/moon.asset +++ b/data/assets/scene/solarsystem/planets/earth/moon/moon.asset @@ -67,5 +67,5 @@ asset.meta = { Author = "OpenSpace Team", URL = "http://openspaceproject.com", License = "MIT license", - Identifiers = "Moon" + Identifiers = {"Moon"} } diff --git a/data/assets/scene/solarsystem/planets/earth/moon/trail.asset b/data/assets/scene/solarsystem/planets/earth/moon/trail.asset index e1e17c44dc..d60140bda5 100644 --- a/data/assets/scene/solarsystem/planets/earth/moon/trail.asset +++ b/data/assets/scene/solarsystem/planets/earth/moon/trail.asset @@ -36,5 +36,5 @@ asset.meta = { Author = "OpenSpace Team", URL = "http://openspaceproject.com", License = "MIT license", - Identifiers = "MoonTrail" + Identifiers = {"MoonTrail"} } diff --git a/data/assets/scene/solarsystem/planets/earth/trail.asset b/data/assets/scene/solarsystem/planets/earth/trail.asset index f750fa6103..87dc7806fa 100644 --- a/data/assets/scene/solarsystem/planets/earth/trail.asset +++ b/data/assets/scene/solarsystem/planets/earth/trail.asset @@ -36,5 +36,5 @@ asset.meta = { Author = "OpenSpace Team", URL = "http://openspaceproject.com", License = "MIT license", - Identifiers = "EarthTrail" + Identifiers = {"EarthTrail"} } diff --git a/data/assets/scene/solarsystem/planets/earth/transforms.asset b/data/assets/scene/solarsystem/planets/earth/transforms.asset index 067bce9c88..a5b066b7fc 100644 --- a/data/assets/scene/solarsystem/planets/earth/transforms.asset +++ b/data/assets/scene/solarsystem/planets/earth/transforms.asset @@ -89,5 +89,5 @@ asset.meta = { Author = "OpenSpace Team", URL = "http://openspaceproject.com", License = "MIT license", - Identifiers = "EarthBarycenter,EarthCenter,EarthInertial,EarthIAU" + Identifiers = {"EarthBarycenter", "EarthCenter", "EarthInertial", "EarthIAU"} } diff --git a/data/assets/scene/solarsystem/planets/jupiter/callisto/callisto.asset b/data/assets/scene/solarsystem/planets/jupiter/callisto/callisto.asset index 254e335c2e..09c2888303 100644 --- a/data/assets/scene/solarsystem/planets/jupiter/callisto/callisto.asset +++ b/data/assets/scene/solarsystem/planets/jupiter/callisto/callisto.asset @@ -60,5 +60,5 @@ asset.meta = { Author = "OpenSpace Team", URL = "http://openspaceproject.com", License = "MIT license", - Identifiers = "Callisto" + Identifiers = {"Callisto"} } diff --git a/data/assets/scene/solarsystem/planets/jupiter/callisto/trail.asset b/data/assets/scene/solarsystem/planets/jupiter/callisto/trail.asset index 8a6b20b932..847ae5e43e 100644 --- a/data/assets/scene/solarsystem/planets/jupiter/callisto/trail.asset +++ b/data/assets/scene/solarsystem/planets/jupiter/callisto/trail.asset @@ -38,5 +38,5 @@ asset.meta = { Author = "OpenSpace Team", URL = "http://openspaceproject.com", License = "MIT license", - Identifiers = "CallistoTrail" + Identifiers = {"CallistoTrail"} } diff --git a/data/assets/scene/solarsystem/planets/jupiter/europa/europa.asset b/data/assets/scene/solarsystem/planets/jupiter/europa/europa.asset index 866fe6d973..6be8e60814 100644 --- a/data/assets/scene/solarsystem/planets/jupiter/europa/europa.asset +++ b/data/assets/scene/solarsystem/planets/jupiter/europa/europa.asset @@ -60,5 +60,5 @@ asset.meta = { Author = "OpenSpace Team", URL = "http://openspaceproject.com", License = "MIT license", - Identifiers = "Europa" + Identifiers = {"Europa"} } diff --git a/data/assets/scene/solarsystem/planets/jupiter/europa/layers/colorlayers/voyager_global_mosaic.asset b/data/assets/scene/solarsystem/planets/jupiter/europa/layers/colorlayers/voyager_global_mosaic.asset index 30de152eb3..6438fe1b5b 100644 --- a/data/assets/scene/solarsystem/planets/jupiter/europa/layers/colorlayers/voyager_global_mosaic.asset +++ b/data/assets/scene/solarsystem/planets/jupiter/europa/layers/colorlayers/voyager_global_mosaic.asset @@ -31,5 +31,5 @@ asset.meta = { URL = "https://astrogeology.usgs.gov/search/map/Europa/Voyager-Galileo/" .. "Europa_Voyager_GalileoSSI_global_mosaic_500m", License = "NASA/PDS", - Identifiers = "Voyager_Global_Mosaic" + Identifiers = {"Voyager_Global_Mosaic"} } diff --git a/data/assets/scene/solarsystem/planets/jupiter/europa/trail.asset b/data/assets/scene/solarsystem/planets/jupiter/europa/trail.asset index b046be6929..7ed601c78a 100644 --- a/data/assets/scene/solarsystem/planets/jupiter/europa/trail.asset +++ b/data/assets/scene/solarsystem/planets/jupiter/europa/trail.asset @@ -38,5 +38,5 @@ asset.meta = { Author = "OpenSpace Team", URL = "http://openspaceproject.com", License = "MIT license", - Identifiers = "EuropaTrail" + Identifiers = {"EuropaTrail"} } diff --git a/data/assets/scene/solarsystem/planets/jupiter/ganymede/ganymede.asset b/data/assets/scene/solarsystem/planets/jupiter/ganymede/ganymede.asset index 265bd4b4fa..c93b359f3e 100644 --- a/data/assets/scene/solarsystem/planets/jupiter/ganymede/ganymede.asset +++ b/data/assets/scene/solarsystem/planets/jupiter/ganymede/ganymede.asset @@ -60,5 +60,5 @@ asset.meta = { Author = "OpenSpace Team", URL = "http://openspaceproject.com", License = "MIT license", - Identifiers = "Ganymede" + Identifiers = {"Ganymede"} } diff --git a/data/assets/scene/solarsystem/planets/jupiter/ganymede/trail.asset b/data/assets/scene/solarsystem/planets/jupiter/ganymede/trail.asset index ffd26252e8..e0b7a0eefd 100644 --- a/data/assets/scene/solarsystem/planets/jupiter/ganymede/trail.asset +++ b/data/assets/scene/solarsystem/planets/jupiter/ganymede/trail.asset @@ -38,5 +38,5 @@ asset.meta = { Author = "OpenSpace Team", URL = "http://openspaceproject.com", License = "MIT license", - Identifiers = "GanymedeTrail" + Identifiers = {"GanymedeTrail"} } diff --git a/data/assets/scene/solarsystem/planets/jupiter/io/io.asset b/data/assets/scene/solarsystem/planets/jupiter/io/io.asset index 43f6786cc6..e64cbfe431 100644 --- a/data/assets/scene/solarsystem/planets/jupiter/io/io.asset +++ b/data/assets/scene/solarsystem/planets/jupiter/io/io.asset @@ -60,5 +60,5 @@ asset.meta = { Author = "OpenSpace Team", URL = "http://openspaceproject.com", License = "MIT license", - Identifiers = "Io" + Identifiers = {"Io"} } diff --git a/data/assets/scene/solarsystem/planets/jupiter/io/trail.asset b/data/assets/scene/solarsystem/planets/jupiter/io/trail.asset index 9752f31aa7..b05d0b488e 100644 --- a/data/assets/scene/solarsystem/planets/jupiter/io/trail.asset +++ b/data/assets/scene/solarsystem/planets/jupiter/io/trail.asset @@ -38,5 +38,5 @@ asset.meta = { Author = "OpenSpace Team", URL = "http://openspaceproject.com", License = "MIT license", - Identifiers = "IoTrail" + Identifiers = {"IoTrail"} } diff --git a/data/assets/scene/solarsystem/planets/jupiter/jupiter.asset b/data/assets/scene/solarsystem/planets/jupiter/jupiter.asset index 824c99a8c9..520a72d840 100644 --- a/data/assets/scene/solarsystem/planets/jupiter/jupiter.asset +++ b/data/assets/scene/solarsystem/planets/jupiter/jupiter.asset @@ -56,5 +56,5 @@ asset.meta = { Author = "OpenSpace Team", URL = "http://openspaceproject.com", License = "MIT license", - Identifiers = "Jupiter,JupiterLabel" + Identifiers = {"Jupiter", "JupiterLabel"} } diff --git a/data/assets/scene/solarsystem/planets/jupiter/trail.asset b/data/assets/scene/solarsystem/planets/jupiter/trail.asset index 7d3afaaebd..5e8830cbc7 100644 --- a/data/assets/scene/solarsystem/planets/jupiter/trail.asset +++ b/data/assets/scene/solarsystem/planets/jupiter/trail.asset @@ -36,5 +36,5 @@ asset.meta = { Author = "OpenSpace Team", URL = "http://openspaceproject.com", License = "MIT license", - Identifiers = "JupiterTrail" + Identifiers = {"JupiterTrail"} } diff --git a/data/assets/scene/solarsystem/planets/jupiter/trail_earth.asset b/data/assets/scene/solarsystem/planets/jupiter/trail_earth.asset index 3abeef018a..64c2d7798f 100644 --- a/data/assets/scene/solarsystem/planets/jupiter/trail_earth.asset +++ b/data/assets/scene/solarsystem/planets/jupiter/trail_earth.asset @@ -36,7 +36,7 @@ asset.meta = { Author = "OpenSpace Team", URL = "http://openspaceproject.com", License = "MIT license", - Identifiers = "VenusTrailEarth" + Identifiers = {"VenusTrailEarth"} } assetHelper.registerSceneGraphNodesAndExport(asset, { JupiterTrailEarth }) diff --git a/data/assets/scene/solarsystem/planets/jupiter/transforms.asset b/data/assets/scene/solarsystem/planets/jupiter/transforms.asset index dde80c565a..e4795f3afc 100644 --- a/data/assets/scene/solarsystem/planets/jupiter/transforms.asset +++ b/data/assets/scene/solarsystem/planets/jupiter/transforms.asset @@ -31,5 +31,5 @@ asset.meta = { Author = "OpenSpace Team", URL = "http://openspaceproject.com", License = "MIT license", - Identifiers = "JupiterBarycenter" + Identifiers = {"JupiterBarycenter"} } diff --git a/data/assets/scene/solarsystem/planets/mars/atmosphere.asset b/data/assets/scene/solarsystem/planets/mars/atmosphere.asset index 06b1d7a1c8..9f45e9804b 100644 --- a/data/assets/scene/solarsystem/planets/mars/atmosphere.asset +++ b/data/assets/scene/solarsystem/planets/mars/atmosphere.asset @@ -74,5 +74,5 @@ asset.meta = { Author = "OpenSpace Team", URL = "http://openspaceproject.com", License = "MIT license", - Identifiers = "MarsAtmosphere" + Identifiers = {"MarsAtmosphere"} } diff --git a/data/assets/scene/solarsystem/planets/mars/layers/colorlayers/HiRISE.asset b/data/assets/scene/solarsystem/planets/mars/layers/colorlayers/HiRISE.asset index 3e67eea5eb..716e504cca 100644 --- a/data/assets/scene/solarsystem/planets/mars/layers/colorlayers/HiRISE.asset +++ b/data/assets/scene/solarsystem/planets/mars/layers/colorlayers/HiRISE.asset @@ -38,5 +38,5 @@ asset.meta = { Author = "esri_astro", URL = "https://www.arcgis.com/home/item.html?id=c1c4c750a2154842ae523c984cc14fa5", License = "Esri Master License Agreement", - Identifiers = "HiRISE-PSP" + Identifiers = {"HiRISE-PSP"} } diff --git a/data/assets/scene/solarsystem/planets/mars/layers/colorlayers/ctx_blended_01.asset b/data/assets/scene/solarsystem/planets/mars/layers/colorlayers/ctx_blended_01.asset index f6ae50ead9..2ced7b9bcb 100644 --- a/data/assets/scene/solarsystem/planets/mars/layers/colorlayers/ctx_blended_01.asset +++ b/data/assets/scene/solarsystem/planets/mars/layers/colorlayers/ctx_blended_01.asset @@ -42,5 +42,5 @@ asset.meta = { Author = "Caltech Murray Lab", URL = "http://murray-lab.caltech.edu/CTX/", License = "Esri Master License Agreement", - Identifiers = "CTX_blended_01" + Identifiers = {"CTX_blended_01"} } diff --git a/data/assets/scene/solarsystem/planets/mars/layers/colorlayers/hirisels.asset b/data/assets/scene/solarsystem/planets/mars/layers/colorlayers/hirisels.asset index 216cb86b5c..1ce80e2d49 100644 --- a/data/assets/scene/solarsystem/planets/mars/layers/colorlayers/hirisels.asset +++ b/data/assets/scene/solarsystem/planets/mars/layers/colorlayers/hirisels.asset @@ -35,7 +35,7 @@ asset.meta = { Author = "USGS", URL = "https://www.uahirise.org", License = "Esri Master License Agreement", - Identifiers = "HiRISE-LS" + Identifiers = {"HiRISE-LS"} } diff --git a/data/assets/scene/solarsystem/planets/mars/layers/colorlayers/moc_wa_color_liu.asset b/data/assets/scene/solarsystem/planets/mars/layers/colorlayers/moc_wa_color_liu.asset index e9f44a9537..f55aa9264b 100644 --- a/data/assets/scene/solarsystem/planets/mars/layers/colorlayers/moc_wa_color_liu.asset +++ b/data/assets/scene/solarsystem/planets/mars/layers/colorlayers/moc_wa_color_liu.asset @@ -33,5 +33,5 @@ asset.meta = { Author = "OpenSpace Team", URL = "http://www.openspaceproject.com", License = "NASA/PDS", - Identifiers = "MOLA_HRSC_Sweden" + Identifiers = {"MOLA_HRSC_Sweden"} } diff --git a/data/assets/scene/solarsystem/planets/mars/layers/colorlayers/moc_wa_color_utah.asset b/data/assets/scene/solarsystem/planets/mars/layers/colorlayers/moc_wa_color_utah.asset index 54a3dab794..36f5f9778e 100644 --- a/data/assets/scene/solarsystem/planets/mars/layers/colorlayers/moc_wa_color_utah.asset +++ b/data/assets/scene/solarsystem/planets/mars/layers/colorlayers/moc_wa_color_utah.asset @@ -33,5 +33,5 @@ asset.meta = { Author = "OpenSpace Team", URL = "http://www.openspaceproject.com", License = "NASA/PDS", - Identifiers = "MOC_WA_Color_Utah" + Identifiers = {"MOC_WA_Color_Utah"} } diff --git a/data/assets/scene/solarsystem/planets/mars/layers/colorlayers/mola_hrsc_sweden.asset b/data/assets/scene/solarsystem/planets/mars/layers/colorlayers/mola_hrsc_sweden.asset index a5862618ff..07bd5a83f4 100644 --- a/data/assets/scene/solarsystem/planets/mars/layers/colorlayers/mola_hrsc_sweden.asset +++ b/data/assets/scene/solarsystem/planets/mars/layers/colorlayers/mola_hrsc_sweden.asset @@ -26,5 +26,5 @@ asset.meta = { Author = "OpenSpace Team", URL = "http://www.openspaceproject.com", License = "NASA/PDS", - Identifiers = "MOLA_HRSC_Sweden" + Identifiers = {"MOLA_HRSC_Sweden"} } diff --git a/data/assets/scene/solarsystem/planets/mars/layers/colorlayers/mola_hrsc_utah.asset b/data/assets/scene/solarsystem/planets/mars/layers/colorlayers/mola_hrsc_utah.asset index 87a1e1cf94..8a65c5510f 100644 --- a/data/assets/scene/solarsystem/planets/mars/layers/colorlayers/mola_hrsc_utah.asset +++ b/data/assets/scene/solarsystem/planets/mars/layers/colorlayers/mola_hrsc_utah.asset @@ -26,5 +26,5 @@ asset.meta = { Author = "OpenSpace Team", URL = "http://www.openspaceproject.com", License = "NASA/PDS", - Identifiers = "MOLA_HRSC_Sweden" + Identifiers = {"MOLA_HRSC_Sweden"} } diff --git a/data/assets/scene/solarsystem/planets/mars/layers/colorlayers/mola_pseudo_color_sweden.asset b/data/assets/scene/solarsystem/planets/mars/layers/colorlayers/mola_pseudo_color_sweden.asset index 73920dac15..5420bbcad2 100644 --- a/data/assets/scene/solarsystem/planets/mars/layers/colorlayers/mola_pseudo_color_sweden.asset +++ b/data/assets/scene/solarsystem/planets/mars/layers/colorlayers/mola_pseudo_color_sweden.asset @@ -37,5 +37,5 @@ asset.meta = { URL = "https://astrogeology.usgs.gov/search/map/Mars/GlobalSurveyor/MOLA/" .. "Mars_MGS_MOLA_ClrShade_merge_global_463m", License = "NASA/PDS", - Identifiers = "MOLA_Pseudo_Color_Sweden" + Identifiers = {"MOLA_Pseudo_Color_Sweden"} } diff --git a/data/assets/scene/solarsystem/planets/mars/layers/colorlayers/mola_pseudo_color_utah.asset b/data/assets/scene/solarsystem/planets/mars/layers/colorlayers/mola_pseudo_color_utah.asset index 3844cc5f09..4057051c9b 100644 --- a/data/assets/scene/solarsystem/planets/mars/layers/colorlayers/mola_pseudo_color_utah.asset +++ b/data/assets/scene/solarsystem/planets/mars/layers/colorlayers/mola_pseudo_color_utah.asset @@ -37,5 +37,5 @@ asset.meta = { URL = "https://astrogeology.usgs.gov/search/map/Mars/GlobalSurveyor/MOLA/" .. "Mars_MGS_MOLA_ClrShade_merge_global_463m", License = "NASA/PDS", - Identifiers = "MOLA_Pseudo_Color_Utah" + Identifiers = {"MOLA_Pseudo_Color_Utah"} } diff --git a/data/assets/scene/solarsystem/planets/mars/layers/colorlayers/themis_ir_day_sweden.asset b/data/assets/scene/solarsystem/planets/mars/layers/colorlayers/themis_ir_day_sweden.asset index 5a8b2847e7..cb18e6a17f 100644 --- a/data/assets/scene/solarsystem/planets/mars/layers/colorlayers/themis_ir_day_sweden.asset +++ b/data/assets/scene/solarsystem/planets/mars/layers/colorlayers/themis_ir_day_sweden.asset @@ -34,5 +34,5 @@ asset.meta = { URL = "https://astrogeology.usgs.gov/search/map/Mars/Odyssey/THEMIS-IR-Mosaic-ASU/" .. "Mars_MO_THEMIS-IR-Day_mosaic_global_100m_v12", License = "NASA/PDS", - Identifiers = "Themis_IR_Day_Sweden" + Identifiers = {"Themis_IR_Day_Sweden"} } diff --git a/data/assets/scene/solarsystem/planets/mars/layers/colorlayers/themis_ir_day_utah.asset b/data/assets/scene/solarsystem/planets/mars/layers/colorlayers/themis_ir_day_utah.asset index 0226af185d..1063556825 100644 --- a/data/assets/scene/solarsystem/planets/mars/layers/colorlayers/themis_ir_day_utah.asset +++ b/data/assets/scene/solarsystem/planets/mars/layers/colorlayers/themis_ir_day_utah.asset @@ -34,5 +34,5 @@ asset.meta = { URL = "https://astrogeology.usgs.gov/search/map/Mars/Odyssey/THEMIS-IR-Mosaic-ASU/" .. "Mars_MO_THEMIS-IR-Day_mosaic_global_100m_v12", License = "NASA/PDS", - Identifiers = "Themis_IR_Day_Utah" + Identifiers = {"Themis_IR_Day_Utah"} } diff --git a/data/assets/scene/solarsystem/planets/mars/layers/colorlayers/themis_ir_night_sweden.asset b/data/assets/scene/solarsystem/planets/mars/layers/colorlayers/themis_ir_night_sweden.asset index fab55ffd4a..04977ad8a2 100644 --- a/data/assets/scene/solarsystem/planets/mars/layers/colorlayers/themis_ir_night_sweden.asset +++ b/data/assets/scene/solarsystem/planets/mars/layers/colorlayers/themis_ir_night_sweden.asset @@ -35,5 +35,5 @@ asset.meta = { URL = "https://astrogeology.usgs.gov/search/map/Mars/Odyssey/THEMIS-IR-Mosaic-ASU/" .. "Mars_MO_THEMIS-IR-Night_mosaic_60N60S_100m_v14", License = "NASA/PDS", - Identifiers = "Themis_IR_Night_Sweden" + Identifiers = {"Themis_IR_Night_Sweden"} } diff --git a/data/assets/scene/solarsystem/planets/mars/layers/colorlayers/themis_ir_night_utah.asset b/data/assets/scene/solarsystem/planets/mars/layers/colorlayers/themis_ir_night_utah.asset index fdb5cc593e..c6dd7fca7c 100644 --- a/data/assets/scene/solarsystem/planets/mars/layers/colorlayers/themis_ir_night_utah.asset +++ b/data/assets/scene/solarsystem/planets/mars/layers/colorlayers/themis_ir_night_utah.asset @@ -35,5 +35,5 @@ asset.meta = { URL = "https://astrogeology.usgs.gov/search/map/Mars/Odyssey/THEMIS-IR-Mosaic-ASU/" .. "Mars_MO_THEMIS-IR-Night_mosaic_60N60S_100m_v14", License = "NASA/PDS", - Identifiers = "Themis_IR_Night_Utah" + Identifiers = {"Themis_IR_Night_Utah"} } diff --git a/data/assets/scene/solarsystem/planets/mars/layers/colorlayers/viking_mdim_sweden.asset b/data/assets/scene/solarsystem/planets/mars/layers/colorlayers/viking_mdim_sweden.asset index e43878ff1f..e0fd344b2f 100644 --- a/data/assets/scene/solarsystem/planets/mars/layers/colorlayers/viking_mdim_sweden.asset +++ b/data/assets/scene/solarsystem/planets/mars/layers/colorlayers/viking_mdim_sweden.asset @@ -42,5 +42,5 @@ asset.meta = { URL = "https://astrogeology.usgs.gov/search/map/Mars/Viking/MDIM21/" .. "Mars_Viking_MDIM21_ClrMosaic_global_232m", License = "NASA/PDS", - Identifiers = "Viking_MDIM_Sweden" + Identifiers = {"Viking_MDIM_Sweden"} } diff --git a/data/assets/scene/solarsystem/planets/mars/layers/colorlayers/viking_mdim_utah.asset b/data/assets/scene/solarsystem/planets/mars/layers/colorlayers/viking_mdim_utah.asset index 550069100e..5cf52c5fc1 100644 --- a/data/assets/scene/solarsystem/planets/mars/layers/colorlayers/viking_mdim_utah.asset +++ b/data/assets/scene/solarsystem/planets/mars/layers/colorlayers/viking_mdim_utah.asset @@ -42,5 +42,5 @@ asset.meta = { URL = "https://astrogeology.usgs.gov/search/map/Mars/Viking/MDIM21/" .. "Mars_Viking_MDIM21_ClrMosaic_global_232m", License = "NASA/PDS", - Identifiers = "Viking_MDIM_Utah" + Identifiers = {"Viking_MDIM_Utah"} } diff --git a/data/assets/scene/solarsystem/planets/mars/layers/heightlayers/hirisels.asset b/data/assets/scene/solarsystem/planets/mars/layers/heightlayers/hirisels.asset index 41ab3634d0..0fa9c56943 100644 --- a/data/assets/scene/solarsystem/planets/mars/layers/heightlayers/hirisels.asset +++ b/data/assets/scene/solarsystem/planets/mars/layers/heightlayers/hirisels.asset @@ -33,7 +33,7 @@ asset.meta = { Author = "USGS", URL = "https://www.uahirise.org", License = "Esri Master License Agreement", - Identifiers = "HiRISE-LS-DEM" + Identifiers = {"HiRISE-LS-DEM"} } diff --git a/data/assets/scene/solarsystem/planets/mars/layers/heightlayers/mola_europe.asset b/data/assets/scene/solarsystem/planets/mars/layers/heightlayers/mola_europe.asset index a46993113c..0be40ea886 100644 --- a/data/assets/scene/solarsystem/planets/mars/layers/heightlayers/mola_europe.asset +++ b/data/assets/scene/solarsystem/planets/mars/layers/heightlayers/mola_europe.asset @@ -38,5 +38,5 @@ asset.meta = { URL = "https://astrogeology.usgs.gov/search/map/Mars/GlobalSurveyor/MOLA/" .. "Mars_MGS_MOLA_DEM_mosaic_global_463m", License = "NASA/PDS", - Identifiers = "Mola_Europe" + Identifiers = {"Mola_Europe"} } diff --git a/data/assets/scene/solarsystem/planets/mars/layers/heightlayers/mola_utah.asset b/data/assets/scene/solarsystem/planets/mars/layers/heightlayers/mola_utah.asset index c433db084a..e934a7c26d 100644 --- a/data/assets/scene/solarsystem/planets/mars/layers/heightlayers/mola_utah.asset +++ b/data/assets/scene/solarsystem/planets/mars/layers/heightlayers/mola_utah.asset @@ -38,5 +38,5 @@ asset.meta = { URL = "https://astrogeology.usgs.gov/search/map/Mars/GlobalSurveyor/MOLA/" .. "Mars_MGS_MOLA_DEM_mosaic_global_463m", License = "NASA/PDS", - Identifiers = "Mola_Utah" + Identifiers = {"Mola_Utah"} } diff --git a/data/assets/scene/solarsystem/planets/mars/mars.asset b/data/assets/scene/solarsystem/planets/mars/mars.asset index 97d7a0d453..8bdd08008d 100644 --- a/data/assets/scene/solarsystem/planets/mars/mars.asset +++ b/data/assets/scene/solarsystem/planets/mars/mars.asset @@ -85,5 +85,5 @@ asset.meta = { Author = "OpenSpace Team", URL = "http://openspaceproject.com", License = "MIT license", - Identifiers = "Mars,MarsLabel" + Identifiers = {"Mars", "MarsLabel"} } diff --git a/data/assets/scene/solarsystem/planets/mars/moons/deimos.asset b/data/assets/scene/solarsystem/planets/mars/moons/deimos.asset index 621d9252f0..b200cef599 100644 --- a/data/assets/scene/solarsystem/planets/mars/moons/deimos.asset +++ b/data/assets/scene/solarsystem/planets/mars/moons/deimos.asset @@ -67,5 +67,5 @@ asset.meta = { Author = "OpenSpace Team", URL = "http://openspaceproject.com", License = "MIT license", - Identifiers = "Deimos,DeimosTrail" + Identifiers = {"Deimos", "DeimosTrail"} } diff --git a/data/assets/scene/solarsystem/planets/mars/moons/phobos.asset b/data/assets/scene/solarsystem/planets/mars/moons/phobos.asset index cbd9353046..99bcf87cc6 100644 --- a/data/assets/scene/solarsystem/planets/mars/moons/phobos.asset +++ b/data/assets/scene/solarsystem/planets/mars/moons/phobos.asset @@ -67,5 +67,5 @@ asset.meta = { Author = "OpenSpace Team", URL = "http://openspaceproject.com", License = "MIT license", - Identifiers = "Phobos,PhobosTrail" + Identifiers = {"Phobos", "PhobosTrail"} } diff --git a/data/assets/scene/solarsystem/planets/mars/trail.asset b/data/assets/scene/solarsystem/planets/mars/trail.asset index 04c64c8b92..a92011e04e 100644 --- a/data/assets/scene/solarsystem/planets/mars/trail.asset +++ b/data/assets/scene/solarsystem/planets/mars/trail.asset @@ -37,5 +37,5 @@ asset.meta = { Author = "OpenSpace Team", URL = "http://openspaceproject.com", License = "MIT license", - Identifiers = "MarsTrail" + Identifiers = {"MarsTrail"} } diff --git a/data/assets/scene/solarsystem/planets/mars/trail_earth.asset b/data/assets/scene/solarsystem/planets/mars/trail_earth.asset index e24f49a1fe..4565a8d6a7 100644 --- a/data/assets/scene/solarsystem/planets/mars/trail_earth.asset +++ b/data/assets/scene/solarsystem/planets/mars/trail_earth.asset @@ -40,5 +40,5 @@ asset.meta = { Author = "OpenSpace Team", URL = "http://openspaceproject.com", License = "MIT license", - Identifiers = "MarsTrailEarth" + Identifiers = {"MarsTrailEarth"} } diff --git a/data/assets/scene/solarsystem/planets/mars/transforms.asset b/data/assets/scene/solarsystem/planets/mars/transforms.asset index e499f1204e..a7d410d5c1 100644 --- a/data/assets/scene/solarsystem/planets/mars/transforms.asset +++ b/data/assets/scene/solarsystem/planets/mars/transforms.asset @@ -30,5 +30,5 @@ asset.meta = { Author = "OpenSpace Team", URL = "http://openspaceproject.com", License = "MIT license", - Identifiers = "MarsBarycenter" + Identifiers = {"MarsBarycenter"} } diff --git a/data/assets/scene/solarsystem/planets/mercury/mercury.asset b/data/assets/scene/solarsystem/planets/mercury/mercury.asset index a2d8f3e0e2..c2a9ca1584 100644 --- a/data/assets/scene/solarsystem/planets/mercury/mercury.asset +++ b/data/assets/scene/solarsystem/planets/mercury/mercury.asset @@ -76,5 +76,5 @@ asset.meta = { Author = "OpenSpace Team", URL = "http://openspaceproject.com", License = "MIT license", - Identifiers = "Mercury,MercuryLabel" + Identifiers = {"Mercury" , "MercuryLabel"} } diff --git a/data/assets/scene/solarsystem/planets/mercury/trail.asset b/data/assets/scene/solarsystem/planets/mercury/trail.asset index f73d6417e2..c13026c14b 100644 --- a/data/assets/scene/solarsystem/planets/mercury/trail.asset +++ b/data/assets/scene/solarsystem/planets/mercury/trail.asset @@ -37,5 +37,5 @@ asset.meta = { Author = "OpenSpace Team", URL = "http://openspaceproject.com", License = "MIT license", - Identifiers = "MercuryTrail" + Identifiers = {"MercuryTrail"} } diff --git a/data/assets/scene/solarsystem/planets/mercury/trail_earth.asset b/data/assets/scene/solarsystem/planets/mercury/trail_earth.asset index 979e9a6abd..6f9c702a2a 100644 --- a/data/assets/scene/solarsystem/planets/mercury/trail_earth.asset +++ b/data/assets/scene/solarsystem/planets/mercury/trail_earth.asset @@ -40,5 +40,5 @@ asset.meta = { Author = "OpenSpace Team", URL = "http://openspaceproject.com", License = "MIT license", - Identifiers = "MercuryTrailEarth" + Identifiers = {"MercuryTrailEarth"} } diff --git a/data/assets/scene/solarsystem/planets/mercury/transforms.asset b/data/assets/scene/solarsystem/planets/mercury/transforms.asset index 1e4f43bbe3..8cb25558bf 100644 --- a/data/assets/scene/solarsystem/planets/mercury/transforms.asset +++ b/data/assets/scene/solarsystem/planets/mercury/transforms.asset @@ -30,5 +30,5 @@ asset.meta = { Author = "OpenSpace Team", URL = "http://openspaceproject.com", License = "MIT license", - Identifiers = "MercuryBarycenter" + Identifiers = {"MercuryBarycenter"} } diff --git a/data/assets/scene/solarsystem/planets/neptune/neptune.asset b/data/assets/scene/solarsystem/planets/neptune/neptune.asset index a4fc70ae9a..5a3fa3df6b 100644 --- a/data/assets/scene/solarsystem/planets/neptune/neptune.asset +++ b/data/assets/scene/solarsystem/planets/neptune/neptune.asset @@ -59,5 +59,5 @@ asset.meta = { Author = "OpenSpace Team", URL = "http://openspaceproject.com", License = "MIT license", - Identifiers = "Neptune" + Identifiers = {"Neptune"} } diff --git a/data/assets/scene/solarsystem/planets/neptune/trail.asset b/data/assets/scene/solarsystem/planets/neptune/trail.asset index 7faf40750a..cc0a2d7eb4 100644 --- a/data/assets/scene/solarsystem/planets/neptune/trail.asset +++ b/data/assets/scene/solarsystem/planets/neptune/trail.asset @@ -47,5 +47,5 @@ asset.meta = { Author = "OpenSpace Team", URL = "http://openspaceproject.com", License = "MIT license", - Identifiers = "NeptuneTrail" + Identifiers = {"NeptuneTrail"} } diff --git a/data/assets/scene/solarsystem/planets/neptune/trail_earth.asset b/data/assets/scene/solarsystem/planets/neptune/trail_earth.asset index 1fd86c1337..9757c78023 100644 --- a/data/assets/scene/solarsystem/planets/neptune/trail_earth.asset +++ b/data/assets/scene/solarsystem/planets/neptune/trail_earth.asset @@ -40,5 +40,5 @@ asset.meta = { Author = "OpenSpace Team", URL = "http://openspaceproject.com", License = "MIT license", - Identifiers = "VenusTrailEarth" + Identifiers = {"VenusTrailEarth"} } diff --git a/data/assets/scene/solarsystem/planets/neptune/transforms.asset b/data/assets/scene/solarsystem/planets/neptune/transforms.asset index 19a99b6b61..be9a959e1a 100644 --- a/data/assets/scene/solarsystem/planets/neptune/transforms.asset +++ b/data/assets/scene/solarsystem/planets/neptune/transforms.asset @@ -30,5 +30,5 @@ asset.meta = { Author = "OpenSpace Team", URL = "http://openspaceproject.com", License = "MIT license", - Identifiers = "NeptuneBarycenter" + Identifiers = {"NeptuneBarycenter"} } diff --git a/data/assets/scene/solarsystem/planets/neptune/triton.asset b/data/assets/scene/solarsystem/planets/neptune/triton.asset index 9aba0c9518..3b796b74ad 100644 --- a/data/assets/scene/solarsystem/planets/neptune/triton.asset +++ b/data/assets/scene/solarsystem/planets/neptune/triton.asset @@ -37,5 +37,5 @@ asset.meta = { Author = "OpenSpace Team", URL = "http://openspaceproject.com", License = "MIT license", - Identifiers = "Triton" + Identifiers = {"Triton"} } diff --git a/data/assets/scene/solarsystem/planets/saturn/enceladus/enceladus.asset b/data/assets/scene/solarsystem/planets/saturn/enceladus/enceladus.asset index 9285f80cd1..bb66e85ba2 100644 --- a/data/assets/scene/solarsystem/planets/saturn/enceladus/enceladus.asset +++ b/data/assets/scene/solarsystem/planets/saturn/enceladus/enceladus.asset @@ -60,5 +60,5 @@ asset.meta = { Author = "OpenSpace Team", URL = "http://openspaceproject.com", License = "MIT license", - Identifiers = "Enceladus" + Identifiers = {"Enceladus"} } diff --git a/data/assets/scene/solarsystem/planets/saturn/enceladus/layers/colorlayers/global_mosaic_100m_hpf.asset b/data/assets/scene/solarsystem/planets/saturn/enceladus/layers/colorlayers/global_mosaic_100m_hpf.asset index cbb634c0fa..d8a3e6dc5d 100644 --- a/data/assets/scene/solarsystem/planets/saturn/enceladus/layers/colorlayers/global_mosaic_100m_hpf.asset +++ b/data/assets/scene/solarsystem/planets/saturn/enceladus/layers/colorlayers/global_mosaic_100m_hpf.asset @@ -29,5 +29,5 @@ asset.meta = { URL = "https://astrogeology.usgs.gov/search/map/Enceladus/Cassini/" .. "Enceladus_Cassini_ISS_Global_Mosaic_100m_HPF", License = "NASA/PDS", - Identifiers = "Global_Mosaic_100m_HPF" + Identifiers = {"Global_Mosaic_100m_HPF"} } diff --git a/data/assets/scene/solarsystem/planets/saturn/enceladus/trail.asset b/data/assets/scene/solarsystem/planets/saturn/enceladus/trail.asset index 647228d2e1..df92c063be 100644 --- a/data/assets/scene/solarsystem/planets/saturn/enceladus/trail.asset +++ b/data/assets/scene/solarsystem/planets/saturn/enceladus/trail.asset @@ -37,5 +37,5 @@ asset.meta = { Author = "OpenSpace Team", URL = "http://openspaceproject.com", License = "MIT license", - Identifiers = "EnceladusTrail" + Identifiers = {"EnceladusTrail"} } diff --git a/data/assets/scene/solarsystem/planets/saturn/hyperion/hyperion.asset b/data/assets/scene/solarsystem/planets/saturn/hyperion/hyperion.asset index 3103501c3e..14dcdd94e2 100644 --- a/data/assets/scene/solarsystem/planets/saturn/hyperion/hyperion.asset +++ b/data/assets/scene/solarsystem/planets/saturn/hyperion/hyperion.asset @@ -59,5 +59,5 @@ asset.meta = { Author = "OpenSpace Team", URL = "http://openspaceproject.com", License = "MIT license", - Identifiers = "Hyperion" + Identifiers = {"Hyperion"} } diff --git a/data/assets/scene/solarsystem/planets/saturn/hyperion/trail.asset b/data/assets/scene/solarsystem/planets/saturn/hyperion/trail.asset index bf16f431d2..42ef03180e 100644 --- a/data/assets/scene/solarsystem/planets/saturn/hyperion/trail.asset +++ b/data/assets/scene/solarsystem/planets/saturn/hyperion/trail.asset @@ -37,5 +37,5 @@ asset.meta = { Author = "OpenSpace Team", URL = "http://openspaceproject.com", License = "MIT license", - Identifiers = "HyperionTrail" + Identifiers = {"HyperionTrail"} } diff --git a/data/assets/scene/solarsystem/planets/saturn/iapetus/iapetus.asset b/data/assets/scene/solarsystem/planets/saturn/iapetus/iapetus.asset index 63132da3ad..ec01d7b69a 100644 --- a/data/assets/scene/solarsystem/planets/saturn/iapetus/iapetus.asset +++ b/data/assets/scene/solarsystem/planets/saturn/iapetus/iapetus.asset @@ -60,5 +60,5 @@ asset.meta = { Author = "OpenSpace Team", URL = "http://openspaceproject.com", License = "MIT license", - Identifiers = "Iapetus" + Identifiers = {"Iapetus"} } diff --git a/data/assets/scene/solarsystem/planets/saturn/iapetus/trail.asset b/data/assets/scene/solarsystem/planets/saturn/iapetus/trail.asset index c8c089970b..21e5681294 100644 --- a/data/assets/scene/solarsystem/planets/saturn/iapetus/trail.asset +++ b/data/assets/scene/solarsystem/planets/saturn/iapetus/trail.asset @@ -37,5 +37,5 @@ asset.meta = { Author = "OpenSpace Team", URL = "http://openspaceproject.com", License = "MIT license", - Identifiers = "IapetusTrail" + Identifiers = {"IapetusTrail"} } diff --git a/data/assets/scene/solarsystem/planets/saturn/mimas/mimas.asset b/data/assets/scene/solarsystem/planets/saturn/mimas/mimas.asset index e56c74a28d..1ba8d19d3f 100644 --- a/data/assets/scene/solarsystem/planets/saturn/mimas/mimas.asset +++ b/data/assets/scene/solarsystem/planets/saturn/mimas/mimas.asset @@ -60,5 +60,5 @@ asset.meta = { Author = "OpenSpace Team", URL = "http://openspaceproject.com", License = "MIT license", - Identifiers = "Mimas" + Identifiers = {"Mimas"} } diff --git a/data/assets/scene/solarsystem/planets/saturn/mimas/trail.asset b/data/assets/scene/solarsystem/planets/saturn/mimas/trail.asset index 32355adc85..9777b2c2f6 100644 --- a/data/assets/scene/solarsystem/planets/saturn/mimas/trail.asset +++ b/data/assets/scene/solarsystem/planets/saturn/mimas/trail.asset @@ -37,5 +37,5 @@ asset.meta = { Author = "OpenSpace Team", URL = "http://openspaceproject.com", License = "MIT license", - Identifiers = "MimasTrail" + Identifiers = {"MimasTrail"} } diff --git a/data/assets/scene/solarsystem/planets/saturn/saturn.asset b/data/assets/scene/solarsystem/planets/saturn/saturn.asset index d6bb4c47f2..8cfb39f883 100644 --- a/data/assets/scene/solarsystem/planets/saturn/saturn.asset +++ b/data/assets/scene/solarsystem/planets/saturn/saturn.asset @@ -69,5 +69,6 @@ asset.meta = { Description = [[ Saturn globe, and main planet label.]], Author = "OpenSpace Team", URL = "http://openspaceproject.com", - License = "MIT license" + License = "MIT license", + Identifiers = {"Saturn", "SaturnLabel"} } diff --git a/data/assets/scene/solarsystem/planets/saturn/titan/layers/colorlayers/cassini_iss_global_mosaic_4km_liu.asset b/data/assets/scene/solarsystem/planets/saturn/titan/layers/colorlayers/cassini_iss_global_mosaic_4km_liu.asset index 93aed7e860..e59abc51d2 100644 --- a/data/assets/scene/solarsystem/planets/saturn/titan/layers/colorlayers/cassini_iss_global_mosaic_4km_liu.asset +++ b/data/assets/scene/solarsystem/planets/saturn/titan/layers/colorlayers/cassini_iss_global_mosaic_4km_liu.asset @@ -31,5 +31,5 @@ asset.meta = { URL = "https://astrogeology.usgs.gov/search/map/Titan/Cassini/Global-Mosaic/" .. "Titan_ISS_P19658_Mosaic_Global_4km", License = "NASA/PDS", - Identifiers = "Cassini_ISS_Global_Mosaic_4km_LiU" + Identifiers = {"Cassini_ISS_Global_Mosaic_4km_LiU"} } diff --git a/data/assets/scene/solarsystem/planets/saturn/titan/titan.asset b/data/assets/scene/solarsystem/planets/saturn/titan/titan.asset index e60c2042eb..dd947f3214 100644 --- a/data/assets/scene/solarsystem/planets/saturn/titan/titan.asset +++ b/data/assets/scene/solarsystem/planets/saturn/titan/titan.asset @@ -60,5 +60,5 @@ asset.meta = { Author = "OpenSpace Team", URL = "http://openspaceproject.com", License = "MIT license", - Identifiers = "Titan" + Identifiers = {"Titan"} } diff --git a/data/assets/scene/solarsystem/planets/saturn/titan/trail.asset b/data/assets/scene/solarsystem/planets/saturn/titan/trail.asset index 64176c0c3e..642a32b306 100644 --- a/data/assets/scene/solarsystem/planets/saturn/titan/trail.asset +++ b/data/assets/scene/solarsystem/planets/saturn/titan/trail.asset @@ -37,5 +37,5 @@ asset.meta = { Author = "OpenSpace Team", URL = "http://openspaceproject.com", License = "MIT license", - Identifiers = "TitanTrail" + Identifiers = {"TitanTrail"} } diff --git a/data/assets/scene/solarsystem/planets/saturn/trail.asset b/data/assets/scene/solarsystem/planets/saturn/trail.asset index 05d35198cd..5f11ff9c71 100644 --- a/data/assets/scene/solarsystem/planets/saturn/trail.asset +++ b/data/assets/scene/solarsystem/planets/saturn/trail.asset @@ -35,5 +35,5 @@ asset.meta = { Author = "OpenSpace Team", URL = "http://openspaceproject.com", License = "MIT license", - Identifiers = "SaturnTrail" + Identifiers = {"SaturnTrail"} } diff --git a/data/assets/scene/solarsystem/planets/saturn/trail_earth.asset b/data/assets/scene/solarsystem/planets/saturn/trail_earth.asset index cae480d1b4..d62a830e25 100644 --- a/data/assets/scene/solarsystem/planets/saturn/trail_earth.asset +++ b/data/assets/scene/solarsystem/planets/saturn/trail_earth.asset @@ -37,7 +37,7 @@ asset.meta = { Author = "OpenSpace Team", URL = "http://openspaceproject.com", License = "MIT license", - Identifiers = "VenusTrailEarth" + Identifiers = {"VenusTrailEarth"} } diff --git a/data/assets/scene/solarsystem/planets/saturn/transforms.asset b/data/assets/scene/solarsystem/planets/saturn/transforms.asset index 0edc4e247c..486b23469b 100644 --- a/data/assets/scene/solarsystem/planets/saturn/transforms.asset +++ b/data/assets/scene/solarsystem/planets/saturn/transforms.asset @@ -30,5 +30,5 @@ asset.meta = { Author = "OpenSpace Team", URL = "http://openspaceproject.com", License = "MIT license", - Identifiers = "SaturnBarycenter" + Identifiers = {"SaturnBarycenter"} } diff --git a/data/assets/scene/solarsystem/planets/uranus/trail.asset b/data/assets/scene/solarsystem/planets/uranus/trail.asset index d1101204bf..d853a80c7c 100644 --- a/data/assets/scene/solarsystem/planets/uranus/trail.asset +++ b/data/assets/scene/solarsystem/planets/uranus/trail.asset @@ -35,5 +35,5 @@ asset.meta = { Author = "OpenSpace Team", URL = "http://openspaceproject.com", License = "MIT license", - Identifiers = "UranusTrail" + Identifiers = {"UranusTrail"} } diff --git a/data/assets/scene/solarsystem/planets/uranus/trail_earth.asset b/data/assets/scene/solarsystem/planets/uranus/trail_earth.asset index 2390b5cb48..0b98567560 100644 --- a/data/assets/scene/solarsystem/planets/uranus/trail_earth.asset +++ b/data/assets/scene/solarsystem/planets/uranus/trail_earth.asset @@ -40,5 +40,5 @@ asset.meta = { Author = "OpenSpace Team", URL = "http://openspaceproject.com", License = "MIT license", - Identifiers = "VenusTrailEarth" + Identifiers = {"VenusTrailEarth"} } diff --git a/data/assets/scene/solarsystem/planets/uranus/uranus.asset b/data/assets/scene/solarsystem/planets/uranus/uranus.asset index fd8a081fa6..be3566e994 100644 --- a/data/assets/scene/solarsystem/planets/uranus/uranus.asset +++ b/data/assets/scene/solarsystem/planets/uranus/uranus.asset @@ -59,5 +59,5 @@ asset.meta = { Author = "OpenSpace Team", URL = "http://openspaceproject.com", License = "MIT license", - Identifiers = "Uranus,UranusLabel" + Identifiers = {"Uranus" , "UranusLabel"} } diff --git a/data/assets/scene/solarsystem/planets/venus/atmosphere.asset b/data/assets/scene/solarsystem/planets/venus/atmosphere.asset index ca97a2cbd7..5742ade4a8 100644 --- a/data/assets/scene/solarsystem/planets/venus/atmosphere.asset +++ b/data/assets/scene/solarsystem/planets/venus/atmosphere.asset @@ -71,5 +71,5 @@ asset.meta = { Author = "OpenSpace Team", URL = "http://openspaceproject.com", License = "MIT license", - Identifiers = "VenusAtmosphere" + Identifiers = {"VenusAtmosphere"} } diff --git a/data/assets/scene/solarsystem/planets/venus/layers/colorlayers/magellan_mosaic_utah.asset b/data/assets/scene/solarsystem/planets/venus/layers/colorlayers/magellan_mosaic_utah.asset index c54eca68d3..867ca8b10e 100644 --- a/data/assets/scene/solarsystem/planets/venus/layers/colorlayers/magellan_mosaic_utah.asset +++ b/data/assets/scene/solarsystem/planets/venus/layers/colorlayers/magellan_mosaic_utah.asset @@ -43,5 +43,5 @@ asset.meta = { URL = "https://astrogeology.usgs.gov/search/map/Venus/Magellan/" .. "Venus_Magellan_LeftLook_mosaic_global_75m", License = "NASA/PDS", - Identifiers = "Magellan_Mosaic_Utah" + Identifiers = {"Magellan_Mosaic_Utah"} } diff --git a/data/assets/scene/solarsystem/planets/venus/layers/heightlayers/magellan.asset b/data/assets/scene/solarsystem/planets/venus/layers/heightlayers/magellan.asset index 8ffd0677b1..95bf17d62a 100644 --- a/data/assets/scene/solarsystem/planets/venus/layers/heightlayers/magellan.asset +++ b/data/assets/scene/solarsystem/planets/venus/layers/heightlayers/magellan.asset @@ -38,5 +38,5 @@ asset.meta = { URL = "https://astrogeology.usgs.gov/search/map/Venus/Magellan/RadarProperties" .. "/Venus_Magellan_Topography_Global_4641m_v02", License = "NASA/PDS", - Identifiers = "Magellan" + Identifiers = {"Magellan"} } diff --git a/data/assets/scene/solarsystem/planets/venus/trail.asset b/data/assets/scene/solarsystem/planets/venus/trail.asset index e683a11ee7..6172f6b66c 100644 --- a/data/assets/scene/solarsystem/planets/venus/trail.asset +++ b/data/assets/scene/solarsystem/planets/venus/trail.asset @@ -38,5 +38,5 @@ asset.meta = { Author = "OpenSpace Team", URL = "http://openspaceproject.com", License = "MIT license", - Identifiers = "VenusTrail" + Identifiers = {"VenusTrail"} } diff --git a/data/assets/scene/solarsystem/planets/venus/trail_earth.asset b/data/assets/scene/solarsystem/planets/venus/trail_earth.asset index a9cc3633d9..a96a8990db 100644 --- a/data/assets/scene/solarsystem/planets/venus/trail_earth.asset +++ b/data/assets/scene/solarsystem/planets/venus/trail_earth.asset @@ -39,5 +39,5 @@ asset.meta = { Author = "OpenSpace Team", URL = "http://openspaceproject.com", License = "MIT license", - Identifiers = "VenusTrailEarth" + Identifiers = {"VenusTrailEarth"} } diff --git a/data/assets/scene/solarsystem/planets/venus/transforms.asset b/data/assets/scene/solarsystem/planets/venus/transforms.asset index 1f84882347..83349ef680 100644 --- a/data/assets/scene/solarsystem/planets/venus/transforms.asset +++ b/data/assets/scene/solarsystem/planets/venus/transforms.asset @@ -30,5 +30,5 @@ asset.meta = { Author = "OpenSpace Team", URL = "http://openspaceproject.com", License = "MIT license", - Identifiers = "VenusBarycenter" + Identifiers = {"VenusBarycenter"} } diff --git a/data/assets/scene/solarsystem/planets/venus/venus.asset b/data/assets/scene/solarsystem/planets/venus/venus.asset index 0b2871f033..0f4c1cbe9f 100644 --- a/data/assets/scene/solarsystem/planets/venus/venus.asset +++ b/data/assets/scene/solarsystem/planets/venus/venus.asset @@ -82,5 +82,5 @@ asset.meta = { Author = "OpenSpace Team", URL = "http://openspaceproject.com", License = "MIT license", - Identifiers = "Venus,VenusLabel" + Identifiers = {"Venus", "VenusLabel"} } diff --git a/data/assets/scene/solarsystem/sssb/amor_asteroid.asset b/data/assets/scene/solarsystem/sssb/amor_asteroid.asset index bf980397b7..de5fa442e5 100644 --- a/data/assets/scene/solarsystem/sssb/amor_asteroid.asset +++ b/data/assets/scene/solarsystem/sssb/amor_asteroid.asset @@ -25,5 +25,5 @@ asset.meta = { License = [[JPL-authored documents are sponsored by NASA under Contract NAS7-030010. All documents available from this server may be protected under the U.S. and Foreign Copyright Laws."]], - Identifiers = "sssb_sssb_data_amor_asteroid" + Identifiers = {"sssb_sssb_data_amor_asteroid"} } diff --git a/data/assets/scene/solarsystem/sssb/apollo_asteroid.asset b/data/assets/scene/solarsystem/sssb/apollo_asteroid.asset index ba7fe9c9e6..67c043019a 100644 --- a/data/assets/scene/solarsystem/sssb/apollo_asteroid.asset +++ b/data/assets/scene/solarsystem/sssb/apollo_asteroid.asset @@ -25,5 +25,5 @@ asset.meta = { License = [[JPL-authored documents are sponsored by NASA under Contract NAS7-030010. All documents available from this server may be protected under the U.S. and Foreign Copyright Laws.]], - Identifiers = "sssb_sssb_data_apollo_asteroid" + Identifiers = {"sssb_sssb_data_apollo_asteroid"} } diff --git a/data/assets/scene/solarsystem/sssb/aten_asteroid.asset b/data/assets/scene/solarsystem/sssb/aten_asteroid.asset index cba5c40e93..c522abe149 100644 --- a/data/assets/scene/solarsystem/sssb/aten_asteroid.asset +++ b/data/assets/scene/solarsystem/sssb/aten_asteroid.asset @@ -26,5 +26,5 @@ asset.meta = { License = [[JPL-authored documents are sponsored by NASA under Contract NAS7-030010. All documents available from this server may be protected under the U.S. and Foreign Copyright Laws.]], - Identifiers = "sssb_sssb_data_aten_asteroid" + Identifiers = {"sssb_sssb_data_aten_asteroid"} } diff --git a/data/assets/scene/solarsystem/sssb/atira_asteroid.asset b/data/assets/scene/solarsystem/sssb/atira_asteroid.asset index bc7cd92e66..b06b0850de 100644 --- a/data/assets/scene/solarsystem/sssb/atira_asteroid.asset +++ b/data/assets/scene/solarsystem/sssb/atira_asteroid.asset @@ -26,5 +26,5 @@ asset.meta = { License = [[JPL-authored documents are sponsored by NASA under Contract NAS7-030010. All documents available from this server may be protected under the U.S. and Foreign Copyright Laws."]], - Identifiers = "sssb_sssb_data_atira_asteroid" + Identifiers = {"sssb_sssb_data_atira_asteroid"} } diff --git a/data/assets/scene/solarsystem/sssb/c2019y4atlas.asset b/data/assets/scene/solarsystem/sssb/c2019y4atlas.asset index 2ad536f7fb..912db8d30b 100644 --- a/data/assets/scene/solarsystem/sssb/c2019y4atlas.asset +++ b/data/assets/scene/solarsystem/sssb/c2019y4atlas.asset @@ -59,5 +59,5 @@ asset.meta = { Author = "OpenSpace Team", URL = "https://ssd.jpl.nasa.gov/horizons.cgi", License = "NASA", - Identifiers = "C2019Y4AtlasPosition,C2019Y4AtlasTrail" + Identifiers = {"C2019Y4AtlasPosition", "C2019Y4AtlasTrail"} } diff --git a/data/assets/scene/solarsystem/sssb/centaur_asteroid.asset b/data/assets/scene/solarsystem/sssb/centaur_asteroid.asset index ab7d80067d..baa3d5469f 100644 --- a/data/assets/scene/solarsystem/sssb/centaur_asteroid.asset +++ b/data/assets/scene/solarsystem/sssb/centaur_asteroid.asset @@ -26,5 +26,5 @@ asset.meta = { License = [[JPL-authored documents are sponsored by NASA under Contract NAS7-030010. All documents available from this server may be protected under the U.S. and Foreign Copyright Laws.]], - Identifiers = "sssb_sssb_data_centaur_asteroid" + Identifiers = {"sssb_sssb_data_centaur_asteroid"} } diff --git a/data/assets/scene/solarsystem/sssb/chiron-type_comet.asset b/data/assets/scene/solarsystem/sssb/chiron-type_comet.asset index dd1aa61d3a..81f1523ac6 100644 --- a/data/assets/scene/solarsystem/sssb/chiron-type_comet.asset +++ b/data/assets/scene/solarsystem/sssb/chiron-type_comet.asset @@ -26,5 +26,5 @@ asset.meta = { License = [[JPL-authored documents are sponsored by NASA under Contract NAS7-030010. All documents available from this server may be protected under the U.S. and Foreign Copyright Laws.]], - Identifiers = "sssb_sssb_data_chiron-type_comet" + Identifiers = {"sssb_sssb_data_chiron-type_comet"} } diff --git a/data/assets/scene/solarsystem/sssb/encke-type_comet.asset b/data/assets/scene/solarsystem/sssb/encke-type_comet.asset index b3516e4e91..c3af524bb2 100644 --- a/data/assets/scene/solarsystem/sssb/encke-type_comet.asset +++ b/data/assets/scene/solarsystem/sssb/encke-type_comet.asset @@ -26,5 +26,5 @@ asset.meta = { License = [[JPL-authored documents are sponsored by NASA under Contract NAS7-030010. All documents available from this server may be protected under the U.S. and Foreign Copyright Laws.]], - Identifiers = "sssb_sssb_data_encke-type_comet" + Identifiers = {"sssb_sssb_data_encke-type_comet"} } diff --git a/data/assets/scene/solarsystem/sssb/halley-type_comet.asset b/data/assets/scene/solarsystem/sssb/halley-type_comet.asset index cfbe090cbe..ebc84f9e0d 100644 --- a/data/assets/scene/solarsystem/sssb/halley-type_comet.asset +++ b/data/assets/scene/solarsystem/sssb/halley-type_comet.asset @@ -25,5 +25,5 @@ asset.meta = { License = [[JPL-authored documents are sponsored by NASA under Contract NAS7-030010. All documents available from this server may be protected under the U.S. and Foreign Copyright Laws.]], - Identifiers = "sssb_sssb_data_halley-type_comet" + Identifiers = {"sssb_sssb_data_halley-type_comet"} } diff --git a/data/assets/scene/solarsystem/sssb/inner_main_belt_asteroid.asset b/data/assets/scene/solarsystem/sssb/inner_main_belt_asteroid.asset index c28f479795..bd63087c9b 100644 --- a/data/assets/scene/solarsystem/sssb/inner_main_belt_asteroid.asset +++ b/data/assets/scene/solarsystem/sssb/inner_main_belt_asteroid.asset @@ -26,5 +26,5 @@ asset.meta = { License = [[JPL-authored documents are sponsored by NASA under Contract NAS7-030010. All documents available from this server may be protected under the U.S. and Foreign Copyright Laws.]], - Identifiers = "sssb_sssb_data_inner_main_belt_asteroid" + Identifiers = {"sssb_sssb_data_inner_main_belt_asteroid"} } diff --git a/data/assets/scene/solarsystem/sssb/jupiter-family_comet.asset b/data/assets/scene/solarsystem/sssb/jupiter-family_comet.asset index a2bbe595ff..ecbf215d8e 100644 --- a/data/assets/scene/solarsystem/sssb/jupiter-family_comet.asset +++ b/data/assets/scene/solarsystem/sssb/jupiter-family_comet.asset @@ -26,5 +26,5 @@ asset.meta = { License = [[JPL-authored documents are sponsored by NASA under Contract NAS7-030010. All documents available from this server may be protected under the U.S. and Foreign Copyright Laws.]], - Identifiers = "sssb_sssb_data_jupiter-family_comet" + Identifiers = {"sssb_sssb_data_jupiter-family_comet"} } diff --git a/data/assets/scene/solarsystem/sssb/jupiter_trojan_asteroid.asset b/data/assets/scene/solarsystem/sssb/jupiter_trojan_asteroid.asset index f272d92e68..6663cd38a2 100644 --- a/data/assets/scene/solarsystem/sssb/jupiter_trojan_asteroid.asset +++ b/data/assets/scene/solarsystem/sssb/jupiter_trojan_asteroid.asset @@ -26,5 +26,5 @@ asset.meta = { License = [[JPL-authored documents are sponsored by NASA under Contract NAS7-030010. All documents available from this server may be protected under the U.S. and Foreign Copyright Laws.]], - Identifiers = "sssb_sssb_data_jupiter_trojan_asteroid" + Identifiers = {"sssb_sssb_data_jupiter_trojan_asteroid"} } diff --git a/data/assets/scene/solarsystem/sssb/main_belt_asteroid.asset b/data/assets/scene/solarsystem/sssb/main_belt_asteroid.asset index 4535fb686b..580b7b5fbb 100644 --- a/data/assets/scene/solarsystem/sssb/main_belt_asteroid.asset +++ b/data/assets/scene/solarsystem/sssb/main_belt_asteroid.asset @@ -27,5 +27,5 @@ asset.meta = { License = [[JPL-authored documents are sponsored by NASA under Contract NAS7-030010. All documents available from this server may be protected under the U.S. and Foreign Copyright Laws.]], - Identifiers = "sssb_sssb_data_main_belt_asteroid" + Identifiers = {"sssb_sssb_data_main_belt_asteroid"} } diff --git a/data/assets/scene/solarsystem/sssb/mars-crossing_asteroid.asset b/data/assets/scene/solarsystem/sssb/mars-crossing_asteroid.asset index 7da4f37d64..dd3252f7c2 100644 --- a/data/assets/scene/solarsystem/sssb/mars-crossing_asteroid.asset +++ b/data/assets/scene/solarsystem/sssb/mars-crossing_asteroid.asset @@ -26,5 +26,5 @@ asset.meta = { License = [[JPL-authored documents are sponsored by NASA under Contract NAS7-030010. All documents available from this server may be protected under the U.S. and Foreign Copyright Laws.]], - Identifiers = "sssb_sssb_data_mars-crossing_asteroid" + Identifiers = {"sssb_sssb_data_mars-crossing_asteroid"} } diff --git a/data/assets/scene/solarsystem/sssb/outer_main_belt_asteroid.asset b/data/assets/scene/solarsystem/sssb/outer_main_belt_asteroid.asset index f98a8db61b..e792b3d556 100644 --- a/data/assets/scene/solarsystem/sssb/outer_main_belt_asteroid.asset +++ b/data/assets/scene/solarsystem/sssb/outer_main_belt_asteroid.asset @@ -31,5 +31,5 @@ asset.meta = { License = [[JPL-authored documents are sponsored by NASA under Contract NAS7-030010. All documents available from this server may be protected under the U.S. and Foreign Copyright Laws.]], - Identifiers = "sssb_sssb_data_outer_main_belt_asteroid" + Identifiers = {"sssb_sssb_data_outer_main_belt_asteroid"} } diff --git a/data/assets/scene/solarsystem/sssb/pha.asset b/data/assets/scene/solarsystem/sssb/pha.asset index fec3d582b9..514396b4b2 100644 --- a/data/assets/scene/solarsystem/sssb/pha.asset +++ b/data/assets/scene/solarsystem/sssb/pha.asset @@ -31,5 +31,5 @@ asset.meta = { License = [[JPL-authored documents are sponsored by NASA under Contract NAS7-030010. All documents available from this server may be protected under the U.S. and Foreign Copyright Laws.]], - Identifiers = "sssb_sssb_data_pha" + Identifiers = {"sssb_sssb_data_pha"} } diff --git a/data/assets/scene/solarsystem/sssb/swifttuttle.asset b/data/assets/scene/solarsystem/sssb/swifttuttle.asset index 142f26b84e..971c822bb2 100644 --- a/data/assets/scene/solarsystem/sssb/swifttuttle.asset +++ b/data/assets/scene/solarsystem/sssb/swifttuttle.asset @@ -58,5 +58,5 @@ asset.meta = { License = [[ JPL-authored documents are sponsored by NASA under Contract NAS7-030010. All documents available from this server may be protected under the U.S. and Foreign Copyright Laws."]], - Identifiers = "SwiftTuttlePosition,SwiftTuttleTrail" + Identifiers = {"SwiftTuttlePosition", "SwiftTuttleTrail"} } diff --git a/data/assets/scene/solarsystem/sssb/tesla_roadster.asset b/data/assets/scene/solarsystem/sssb/tesla_roadster.asset index caa5f90f2c..105a489659 100644 --- a/data/assets/scene/solarsystem/sssb/tesla_roadster.asset +++ b/data/assets/scene/solarsystem/sssb/tesla_roadster.asset @@ -59,5 +59,5 @@ asset.meta = { License = [[ JPL-authored documents are sponsored by NASA under Contract NAS7-030010. All documents available from this server may be protected under the U.S. and Foreign Copyright Laws.]], - Identifiers = "TeslaPosition,TeslaRoadsterTrail" + Identifiers = {"TeslaPosition", "TeslaRoadsterTrail"} } diff --git a/data/assets/scene/solarsystem/sssb/transneptunian_object_asteroid.asset b/data/assets/scene/solarsystem/sssb/transneptunian_object_asteroid.asset index d458ca2591..50a9dc8959 100644 --- a/data/assets/scene/solarsystem/sssb/transneptunian_object_asteroid.asset +++ b/data/assets/scene/solarsystem/sssb/transneptunian_object_asteroid.asset @@ -34,5 +34,5 @@ asset.meta = { License = [[ JPL-authored documents are sponsored by NASA under Contract NAS7-030010. All documents available from this server may be protected under the U.S. and Foreign Copyright Laws."]], - Identifiers = "sssb_sssb_data_transneptunian_object_asteroid" + Identifiers = {"sssb_sssb_data_transneptunian_object_asteroid"} } diff --git a/data/assets/scene/solarsystem/sun/glare.asset b/data/assets/scene/solarsystem/sun/glare.asset index 4f2aa4e267..3d817fe120 100644 --- a/data/assets/scene/solarsystem/sun/glare.asset +++ b/data/assets/scene/solarsystem/sun/glare.asset @@ -42,5 +42,5 @@ asset.meta = { Author = "OpenSpace Team", URL = "http://openspaceproject.com", License = "MIT license", - Identifiers = "SunGlare" + Identifiers = {"SunGlare"} } diff --git a/data/assets/scene/solarsystem/sun/marker.asset b/data/assets/scene/solarsystem/sun/marker.asset index 191ee0073c..f392f82ad9 100644 --- a/data/assets/scene/solarsystem/sun/marker.asset +++ b/data/assets/scene/solarsystem/sun/marker.asset @@ -34,5 +34,5 @@ asset.meta = { Author = "OpenSpace Team", URL = "http://openspaceproject.com", License = "MIT license", - Identifiers = "SunMarker" + Identifiers = {"SunMarker"} } diff --git a/data/assets/scene/solarsystem/sun/sun.asset b/data/assets/scene/solarsystem/sun/sun.asset index be58afe588..36569f6092 100644 --- a/data/assets/scene/solarsystem/sun/sun.asset +++ b/data/assets/scene/solarsystem/sun/sun.asset @@ -59,5 +59,5 @@ asset.meta = { Author = "OpenSpace Team", URL = "http://openspaceproject.com", License = "MIT license", - Identifiers = "Sun,SunLabel" + Identifiers = {"Sun" , "SunLabel"} } diff --git a/data/assets/scene/solarsystem/sun/transforms.asset b/data/assets/scene/solarsystem/sun/transforms.asset index e05b46acf4..fe661015d9 100644 --- a/data/assets/scene/solarsystem/sun/transforms.asset +++ b/data/assets/scene/solarsystem/sun/transforms.asset @@ -78,5 +78,5 @@ asset.meta = { Author = "OpenSpace Team", URL = "http://openspaceproject.com", License = "MIT license", - Identifiers = "SolarSystemBarycenter,SunIAU,SunECLIPJ2000" + Identifiers = {"SolarSystemBarycenter", "SunIAU", "SunECLIPJ2000"} } diff --git a/data/assets/util/webgui.asset b/data/assets/util/webgui.asset index f72e690643..66fddec5ad 100644 --- a/data/assets/util/webgui.asset +++ b/data/assets/util/webgui.asset @@ -3,7 +3,7 @@ asset.require('./static_server') local guiCustomization = asset.require('customization/gui') -- Select which commit hashes to use for the frontend and backend -local frontendHash = "5d9b8d52e43260c71f641e73e44e4c90bc9f5d6a" +local frontendHash = "da6b14e4f2f40a8e6340de3251839ff09970b005" local dataProvider = "data.openspaceproject.com/files/webgui" local frontend = asset.syncedResource({ diff --git a/data/profiles/mars.profile b/data/profiles/mars.profile index 44b0fb44bd..56d2dd82a6 100644 --- a/data/profiles/mars.profile +++ b/data/profiles/mars.profile @@ -39,7 +39,7 @@ "is_local": false, "key": "I", "name": "Setup scene for insight EDL", - "script": "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.HeightLayers.OnMarsHiRISELS.Enabled', true);openspace.setPropertyValueSingle('Scene.Mars.Renderable.Layers.ColorLayers.OnMarsHiRISELS.Enabled', true);openspace.time.setPause(true);openspace.time.setTime('2018 NOV 26 19:39:03.68');openspace.navigation.setNavigationState({Anchor = 'Insight',Pitch = 0.567457E-4,Position = { 1.240506E1,-1.369270E1,-2.423553E0 },ReferenceFrame = 'Root',Up = { 0.441211E0,0.247019E0,0.862737E0 },Yaw = -0.446853E-4});" + "script": "openspace.setPropertyValueSingle('Scene.Mars.Renderable.Layers.HeightLayers.Mola_Utah.Settings.Offset', -469.300000);openspace.setPropertyValueSingle('Scene.Mars.Renderable.Layers.HeightLayers.OnMarsHiRISE-LS-DEM.Settings.Offset', -470.800006);openspace.setPropertyValueSingle('Scene.Mars.Renderable.Layers.HeightLayers.OnMarsHiRISE-LS-DEM.Enabled', true);openspace.setPropertyValueSingle('Scene.Mars.Renderable.Layers.ColorLayers.OnMarsHiRISE-LS.Enabled', true);openspace.time.setPause(true);openspace.time.setTime('2018 NOV 26 19:39:03.68');openspace.navigation.setNavigationState({Anchor = 'Insight',Pitch = 0.567457E-4,Position = { 1.240506E1,-1.369270E1,-2.423553E0 },ReferenceFrame = 'Root',Up = { 0.441211E0,0.247019E0,0.862737E0 },Yaw = -0.446853E-4});" }, { "documentation": "Disable Mars layer settings used for insight EDL", @@ -47,7 +47,7 @@ "is_local": false, "key": "SHIFT+I", "name": "Unset Insight Landing", - "script": "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.HeightLayers.OnMarsHiRISELS.Enabled', false);openspace.setPropertyValueSingle('Scene.Mars.Renderable.Layers.ColorLayers.OnMarsHiRISELS.Enabled', false);" + "script": "openspace.setPropertyValueSingle('Scene.Mars.Renderable.Layers.HeightLayers.Mola_Utah.Settings.Offset', 0);openspace.setPropertyValueSingle('Scene.Mars.Renderable.Layers.HeightLayers.OnMarsHiRISE-LS-DEM.Settings.Offset', 0);openspace.setPropertyValueSingle('Scene.Mars.Renderable.Layers.HeightLayers.OnMarsHiRISE-LS-DEM.Enabled', false);openspace.setPropertyValueSingle('Scene.Mars.Renderable.Layers.ColorLayers.OnMarsHiRISE-LS.Enabled', false);" }, { "documentation": "Sets time and layers for Perseverance landing", @@ -55,7 +55,7 @@ "is_local": false, "key": "P", "name": "Setup and Goto Perseverance", - "script": "openspace.setPropertyValueSingle('Scene.Mars.Renderable.Layers.HeightLayers.Mola_Utah.Settings.Offset', -1677.088867);openspace.setPropertyValueSingle('Scene.Mars.Renderable.Layers.HeightLayers.OnMarsHiRISELS.Settings.Offset', -1677.088867);openspace.time.setPause(true);openspace.time.setTime('2021 FEB 18 20:32:16');openspace.setPropertyValueSingle('Scene.Mars.Renderable.Layers.HeightLayers.OnMarsHiRISELS.Enabled', true);openspace.setPropertyValueSingle('Scene.Mars.Renderable.Layers.ColorLayers.OnMarsHiRISELS.Enabled', true);openspace.navigation.setNavigationState({Anchor = 'Perseverance',Pitch = 0.567457E-4,Position = { 1.240506E1,-1.369270E1,-2.423553E0 },ReferenceFrame = 'Root',Up = { 0.441211E0,0.247019E0,0.862737E0 },Yaw = -0.446853E-4});" + "script": "openspace.setPropertyValueSingle('Scene.Mars.Renderable.Layers.HeightLayers.Mola_Utah.Settings.Offset', -1677.088867);openspace.setPropertyValueSingle('Scene.Mars.Renderable.Layers.HeightLayers.OnMarsHiRISE-LS-DEM.Settings.Offset', -1677.088867);openspace.time.setPause(true);openspace.time.setTime('2021 FEB 18 20:32:16');openspace.setPropertyValueSingle('Scene.Mars.Renderable.Layers.HeightLayers.OnMarsHiRISE-LS-DEM.Enabled', true);openspace.setPropertyValueSingle('Scene.Mars.Renderable.Layers.ColorLayers.OnMarsHiRISE-LS.Enabled', true);openspace.navigation.setNavigationState({Anchor = 'Perseverance',Pitch = 0.567457E-4,Position = { 1.240506E1,-1.369270E1,-2.423553E0 },ReferenceFrame = 'Root',Up = { 0.441211E0,0.247019E0,0.862737E0 },Yaw = -0.446853E-4});" } ], "mark_nodes": [ diff --git a/include/openspace/documentation/documentationgenerator.h b/include/openspace/documentation/documentationgenerator.h index 41c3f21508..8b5a165880 100644 --- a/include/openspace/documentation/documentationgenerator.h +++ b/include/openspace/documentation/documentationgenerator.h @@ -102,6 +102,16 @@ private: */ std::string escapedJson(const std::string& text); + +/** + * This function takes a \p list of text and escapes all necessary characters () that JSON + * does not want in its strings. + * \param text The list text that is to be escaped + * \return The same text will all required characteres escaped + */ +std::string escapedJson(const std::vector& list); + + } // namespace openspace #endif // __OPENSPACE_CORE___DOCUMENTATIONGENERATOR___H__ diff --git a/include/openspace/scene/asset.h b/include/openspace/scene/asset.h index 9b08c84e40..7fd8afd13f 100644 --- a/include/openspace/scene/asset.h +++ b/include/openspace/scene/asset.h @@ -56,7 +56,7 @@ public: std::string author; std::string url; std::string license; - std::string identifiers; + std::vector identifiers; }; /** diff --git a/src/documentation/documentationgenerator.cpp b/src/documentation/documentationgenerator.cpp index 384c46ab96..b81cd02bd1 100644 --- a/src/documentation/documentationgenerator.cpp +++ b/src/documentation/documentationgenerator.cpp @@ -58,6 +58,42 @@ std::string DocumentationGenerator::jsonName() { return _jsonName; } +std::string escapedJson(const std::vector& list) { + std::string jsonString; + jsonString += "["; + for (const std::string& text : list) { + jsonString += "\\\""; + for (const char& c : text) { + switch (c) { + case '\t': + jsonString += "\\t"; // Replace tab with \t. + break; + case '"': + jsonString += "\\\""; // Replace " with \". + break; + case '\\': + jsonString += "\\\\"; // Replace \ with \\. + break; + case '\n': + jsonString += "\\\\n"; // Replace newline with \n. + break; + case '\r': + jsonString += "\\r"; // Replace carriage return with \r. + break; + default: + jsonString += c; + } + } + jsonString += "\\\","; + } + if (jsonString.length() > 1) { + jsonString.pop_back(); + } + jsonString += "]"; + + return jsonString; +} + std::string escapedJson(const std::string& text) { std::string jsonString; for (const char& c : text) { diff --git a/src/scene/assetloader.cpp b/src/scene/assetloader.cpp index 828a3faf99..06804dbf08 100644 --- a/src/scene/assetloader.cpp +++ b/src/scene/assetloader.cpp @@ -305,7 +305,14 @@ bool AssetLoader::loadAsset(Asset* asset) { metaDict.getValue(MetaInformationAuthor, meta.author); metaDict.getValue(MetaInformationURL, meta.url); metaDict.getValue(MetaInformationLicense, meta.license); - metaDict.getValue(MetaInformationIdentifiers, meta.identifiers); + if (metaDict.hasKey(MetaInformationIdentifiers)) { + ghoul::Dictionary iddict = metaDict.value(MetaInformationIdentifiers); + for (int i = 1; i <= iddict.size(); ++i) { + std::string key = std::to_string(i); + std::string identifier = iddict.value(key); + meta.identifiers.push_back(identifier); + } + } asset->setMetaInformation(std::move(meta)); } } From b5df4fcb37ff5b75c18bb778123ec162ad13050b Mon Sep 17 00:00:00 2001 From: Malin Ejdbo Date: Wed, 4 Nov 2020 08:35:02 +0100 Subject: [PATCH 06/28] General cleanup --- .../space/translation/horizonstranslation.cpp | 87 +++++++++---------- 1 file changed, 42 insertions(+), 45 deletions(-) diff --git a/modules/space/translation/horizonstranslation.cpp b/modules/space/translation/horizonstranslation.cpp index 1bac1a179b..ee0171c866 100644 --- a/modules/space/translation/horizonstranslation.cpp +++ b/modules/space/translation/horizonstranslation.cpp @@ -129,36 +129,34 @@ glm::dvec3 HorizonsTranslation::position(const UpdateData& data) const { } void HorizonsTranslation::loadData() { - std::string _file = _horizonsTextFile; - if (!FileSys.fileExists(absPath(_file))) { + std::string file = _horizonsTextFile; + if (!FileSys.fileExists(absPath(file))) { return; } std::string cachedFile = FileSys.cacheManager()->cachedFilename( - _file, + file, ghoul::filesystem::CacheManager::Persistent::Yes ); bool hasCachedFile = FileSys.fileExists(cachedFile); if (hasCachedFile) { - LINFO(fmt::format("Cached file '{}' used for Horizon file '{}'", - cachedFile, _file - )); + LINFO(fmt::format("Cached file '{}' used for Horizon file '{}'", cachedFile, file)); bool success = loadCachedFile(cachedFile); if (success) { return; } else { - FileSys.cacheManager()->removeCacheFile(_file); + FileSys.cacheManager()->removeCacheFile(file); // Intentional fall-through to the 'else' computation to generate the cache // file for the next run } } else { - LINFO(fmt::format("Cache for Horizon file '{}' not found", _file)); + LINFO(fmt::format("Cache for Horizon file '{}' not found", file)); } - LINFO(fmt::format("Loading Horizon file '{}'", _file)); + LINFO(fmt::format("Loading Horizon file '{}'", file)); readHorizonsTextFile(); @@ -171,8 +169,7 @@ void HorizonsTranslation::readHorizonsTextFile() { if (!fileStream.good()) { LERROR(fmt::format( - "Failed to open Horizons text file '{}'", _horizonsTextFile - )); + "Failed to open Horizons text file '{}'", _horizonsTextFile)); return; } @@ -224,41 +221,41 @@ void HorizonsTranslation::readHorizonsTextFile() { bool HorizonsTranslation::loadCachedFile(const std::string& file) { std::ifstream fileStream(file, std::ifstream::binary); - if (fileStream.good()) { - // Read how many values to read - int32_t nKeyframes = 0; - fileStream.read(reinterpret_cast(&nKeyframes), sizeof(int32_t)); - if (nKeyframes == 0) { - throw ghoul::RuntimeError("Error reading cache: No values were loaded"); - } - - // Read the values in same order as they were written - double timestamp, x, y, z; - glm::dvec3 gPos; - for (int i = 0; i < nKeyframes; ++i) { - // Timestamp - fileStream.read(reinterpret_cast(×tamp), sizeof(double)); - - // Position vector components - fileStream.read(reinterpret_cast(&x), sizeof(glm::f64)); - fileStream.read(reinterpret_cast(&y), sizeof(glm::f64)); - fileStream.read(reinterpret_cast(&z), sizeof(glm::f64)); - - // Recreate the position vector - gPos = glm::dvec3(x, y, z); - - // Add keyframe in timeline - _timeline.addKeyframe(timestamp, std::move(gPos)); - } - - bool success = fileStream.good(); - return success; - } - else { + if (!fileStream.good()) { LERROR(fmt::format("Error opening file '{}' for loading cache file", file)); return false; } + + // Read how many values to read + int32_t nKeyframes = 0; + + fileStream.read(reinterpret_cast(&nKeyframes), sizeof(int32_t)); + if (nKeyframes == 0) { + throw ghoul::RuntimeError("Error reading cache: No values were loaded"); + } + + // Read the values in same order as they were written + for (int i = 0; i < nKeyframes; ++i) { + double timestamp, x, y, z; + glm::dvec3 gPos; + + // Timestamp + fileStream.read(reinterpret_cast(×tamp), sizeof(double)); + + // Position vector components + fileStream.read(reinterpret_cast(&x), sizeof(double)); + fileStream.read(reinterpret_cast(&y), sizeof(double)); + fileStream.read(reinterpret_cast(&z), sizeof(double)); + + // Recreate the position vector + gPos = glm::dvec3(x, y, z); + + // Add keyframe in timeline + _timeline.addKeyframe(timestamp, std::move(gPos)); + } + + return fileStream.good(); } void HorizonsTranslation::saveCachedFile(const std::string& file) const { @@ -285,13 +282,13 @@ void HorizonsTranslation::saveCachedFile(const std::string& file) const { // and then the components of the position vector one by one fileStream.write(reinterpret_cast(&keyframes[i].data.x), - sizeof(glm::f64) + sizeof(double) ); fileStream.write(reinterpret_cast(&keyframes[i].data.y), - sizeof(glm::f64) + sizeof(double) ); fileStream.write(reinterpret_cast(&keyframes[i].data.z), - sizeof(glm::f64) + sizeof(double) ); } } From db4f16f75f069061a147c3196cc504cdd80744b8 Mon Sep 17 00:00:00 2001 From: Jonathas Costa Date: Wed, 4 Nov 2020 06:59:42 -0500 Subject: [PATCH 07/28] Issue/1223 (#1358) --- modules/base/lightsource/scenegraphlightsource.cpp | 7 +++---- modules/base/rendering/renderablemodel.cpp | 10 ++++------ modules/base/rendering/renderablemodel.h | 2 +- modules/base/shaders/model_fs.glsl | 2 +- modules/base/shaders/model_vs.glsl | 5 ++--- 5 files changed, 11 insertions(+), 15 deletions(-) diff --git a/modules/base/lightsource/scenegraphlightsource.cpp b/modules/base/lightsource/scenegraphlightsource.cpp index 50f6695d5b..ef59e739e7 100644 --- a/modules/base/lightsource/scenegraphlightsource.cpp +++ b/modules/base/lightsource/scenegraphlightsource.cpp @@ -137,11 +137,10 @@ glm::vec3 SceneGraphLightSource::directionViewSpace(const RenderData& renderData const glm::dvec3 renderNodePosition = renderData.modelTransform.translation; - const glm::dvec3 lightDirectionViewSpace = renderData.camera.viewRotationMatrix() * - glm::dvec4((lightPosition - renderNodePosition), 1.0); + const glm::dvec3 viewSpace = glm::dvec3(renderData.camera.combinedViewMatrix() * + glm::dvec4((lightPosition - renderNodePosition), 1.0)); - return glm::normalize(lightDirectionViewSpace); + return glm::normalize(viewSpace); } - } // namespace openspace diff --git a/modules/base/rendering/renderablemodel.cpp b/modules/base/rendering/renderablemodel.cpp index 0aa9bb2273..ab58a5a148 100644 --- a/modules/base/rendering/renderablemodel.cpp +++ b/modules/base/rendering/renderablemodel.cpp @@ -48,7 +48,7 @@ namespace { constexpr const std::array UniformNames = { "opacity", "nLightSources", "lightDirectionsViewSpace", "lightIntensities", - "modelViewTransform", "crippedModelViewTransform", "projectionTransform", + "modelViewTransform", "normalTransform", "projectionTransform", "performShading", "texture1", "ambientIntensity", "diffuseIntensity", "specularIntensity" }; @@ -369,13 +369,11 @@ void RenderableModel::render(const RenderData& data, RendererTasks&) { glm::mat4(modelViewTransform) ); - glm::dmat4 crippedModelViewTransform = glm::transpose(glm::inverse( - glm::dmat4(glm::inverse(data.camera.sgctInternal.viewMatrix())) * modelViewTransform - )); + glm::dmat4 normalTransform = glm::transpose(glm::inverse(modelViewTransform)); _program->setUniform( - _uniformCache.crippedModelViewTransform, - glm::mat4(crippedModelViewTransform) + _uniformCache.normalTransform, + glm::mat4(normalTransform) ); _program->setUniform( diff --git a/modules/base/rendering/renderablemodel.h b/modules/base/rendering/renderablemodel.h index 721de33f44..ff382e5ecc 100644 --- a/modules/base/rendering/renderablemodel.h +++ b/modules/base/rendering/renderablemodel.h @@ -81,7 +81,7 @@ private: ghoul::opengl::ProgramObject* _program = nullptr; UniformCache(opacity, nLightSources, lightDirectionsViewSpace, lightIntensities, - modelViewTransform, crippedModelViewTransform, projectionTransform, + modelViewTransform, normalTransform, projectionTransform, performShading, texture, ambientIntensity, diffuseIntensity, specularIntensity) _uniformCache; diff --git a/modules/base/shaders/model_fs.glsl b/modules/base/shaders/model_fs.glsl index 628c87b2d4..8ea1340660 100644 --- a/modules/base/shaders/model_fs.glsl +++ b/modules/base/shaders/model_fs.glsl @@ -92,4 +92,4 @@ Fragment getFragment() { return frag; -} +} \ No newline at end of file diff --git a/modules/base/shaders/model_vs.glsl b/modules/base/shaders/model_vs.glsl index 8b55a1a7ba..51350b218d 100644 --- a/modules/base/shaders/model_vs.glsl +++ b/modules/base/shaders/model_vs.glsl @@ -37,7 +37,7 @@ out vec4 vs_positionCameraSpace; uniform mat4 modelViewTransform; uniform mat4 projectionTransform; -uniform mat4 crippedModelViewTransform; +uniform mat4 normalTransform; void main() { vs_positionCameraSpace = modelViewTransform * in_position; @@ -48,6 +48,5 @@ void main() { vs_st = in_st; vs_screenSpaceDepth = positionScreenSpace.w; - //vs_normalViewSpace = normalize(transpose(inverse(mat3(crippedModelViewTransform))) * in_normal); - vs_normalViewSpace = normalize(mat3(crippedModelViewTransform) * in_normal); + vs_normalViewSpace = normalize(mat3(normalTransform) * in_normal); } From 3fbefa5324962c3bf7166d1d364da87c8fd2591d Mon Sep 17 00:00:00 2001 From: Jonathas Costa Date: Wed, 4 Nov 2020 07:11:25 -0500 Subject: [PATCH 08/28] Feature/orion changes (#1359) * Changed RenderableModel to allow user-control depth and blending. * Updated RenderableModel to correctly handle the Orion Nebula model. Co-authored-by: Alexander Bock --- data/assets/base.asset | 1 + .../objects/orionnebula/cluster.asset | 2 +- .../milkyway/objects/orionnebula/nebula.asset | 13 +- modules/base/rendering/renderablemodel.cpp | 124 +++++++++++++++++- modules/base/rendering/renderablemodel.h | 9 +- modules/base/shaders/model_fs.glsl | 19 ++- 6 files changed, 152 insertions(+), 16 deletions(-) diff --git a/data/assets/base.asset b/data/assets/base.asset index ee94a61231..d857183682 100644 --- a/data/assets/base.asset +++ b/data/assets/base.asset @@ -18,6 +18,7 @@ asset.require('scene/solarsystem/dwarf_planets/pluto/charon/default_layers') asset.require('scene/milkyway/milkyway/volume') asset.require('scene/milkyway/constellations/constellation_art') asset.require('scene/milkyway/constellations/constellation_keybinds') +asset.require('scene/milkyway/objects/orionnebula/orionnebula') asset.require('util/launcher_images') local assetHelper = asset.require('util/asset_helper') diff --git a/data/assets/scene/milkyway/objects/orionnebula/cluster.asset b/data/assets/scene/milkyway/objects/orionnebula/cluster.asset index 910aca0673..8a49c4bc33 100644 --- a/data/assets/scene/milkyway/objects/orionnebula/cluster.asset +++ b/data/assets/scene/milkyway/objects/orionnebula/cluster.asset @@ -16,7 +16,7 @@ local OrionClusterStars = { Type = "RenderableStars", File = sync .. "/oricluster.speck", Texture = sync .. "/halo.png", - Texture = sync .. "/colorbv.cmap", + ColorMap = sync .. "/colorbv.cmap", MagnitudeExponent = 5.02, SizeComposition = "Distance Modulus", RenderMethod = "Texture Based" diff --git a/data/assets/scene/milkyway/objects/orionnebula/nebula.asset b/data/assets/scene/milkyway/objects/orionnebula/nebula.asset index dc99a09a4f..46a2303a5f 100644 --- a/data/assets/scene/milkyway/objects/orionnebula/nebula.asset +++ b/data/assets/scene/milkyway/objects/orionnebula/nebula.asset @@ -54,8 +54,9 @@ local OrionNebulaModel = { Opacity = 1.0, DisableFaceCulling = false, SpecularIntensity = 0.0, - AmbientIntensity = 0.45, - DiffuseIntensity = 0.0, + AmbientIntensity = 0.0, + DiffuseIntensity = 1.0, + --PerformShading = false, RotationVector = { 0.000000, 22.300000, 0.000000 }, LightSources = LIGHTS; }, @@ -85,8 +86,9 @@ local OrionNebulaShocksModel = { Opacity = 1.0, DisableFaceCulling = false, SpecularIntensity = 0.0, - AmbientIntensity = 0.19, - DiffuseIntensity = 0.4, + AmbientIntensity = 0.0, + DiffuseIntensity = 1.0, + --PerformShading = false, RotationVector = { 0.000000, 22.300000, 0.000000 }, LightSources = LIGHTS; }, @@ -116,8 +118,9 @@ local OrionNebulaProplydsModel = { Opacity = 1.0, DisableFaceCulling = false, SpecularIntensity = 0.0, - AmbientIntensity = 1.0, + AmbientIntensity = 0.0, DiffuseIntensity = 1.0, + --PerformShading = false, RotationVector = { 0.000000, 22.300000, 0.000000 }, LightSources = LIGHTS; }, diff --git a/modules/base/rendering/renderablemodel.cpp b/modules/base/rendering/renderablemodel.cpp index ab58a5a148..39c920ded5 100644 --- a/modules/base/rendering/renderablemodel.cpp +++ b/modules/base/rendering/renderablemodel.cpp @@ -34,11 +34,11 @@ #include #include #include - #include #include #include #include +#include #include #include @@ -46,11 +46,25 @@ namespace { constexpr const char* ProgramName = "ModelProgram"; constexpr const char* KeyGeometry = "Geometry"; - constexpr const std::array UniformNames = { + constexpr const int DefaultBlending = 0; + constexpr const int AdditiveBlending = 1; + constexpr const int PointsAndLinesBlending = 2; + constexpr const int PolygonBlending = 3; + constexpr const int ColorAddingBlending = 4; + + std::map BlendingMapping = { + { "Default", DefaultBlending }, + { "Additive", AdditiveBlending }, + { "Points and Lines", PointsAndLinesBlending }, + { "Polygon", PolygonBlending }, + { "Color Adding", ColorAddingBlending } + }; + + constexpr const std::array UniformNames = { "opacity", "nLightSources", "lightDirectionsViewSpace", "lightIntensities", "modelViewTransform", "normalTransform", "projectionTransform", "performShading", "texture1", "ambientIntensity", "diffuseIntensity", - "specularIntensity" + "specularIntensity", "opacityBlending" }; constexpr openspace::properties::Property::PropertyInfo AmbientIntensityInfo = { @@ -102,6 +116,24 @@ namespace { "Light Sources", "A list of light sources that this model should accept light from." }; + + constexpr openspace::properties::Property::PropertyInfo DisableDepthTestInfo = { + "DisableDepthTest", + "Disable Depth Test", + "Disable Depth Testing for the Model." + }; + + constexpr openspace::properties::Property::PropertyInfo BlendingOptionInfo = { + "BledingOption", + "Blending Options", + "Debug option for blending colors." + }; + + constexpr openspace::properties::Property::PropertyInfo EnableOpacityBlendingInfo = { + "EnableOpacityBlending", + "Enable Opacity Blending", + "Enable Opacity Blending." + }; } // namespace namespace openspace { @@ -177,7 +209,25 @@ documentation::Documentation RenderableModel::Documentation() { }), Optional::Yes, LightSourcesInfo.description - } + }, + { + DisableDepthTestInfo.identifier, + new BoolVerifier, + Optional::Yes, + DisableDepthTestInfo.description + }, + { + BlendingOptionInfo.identifier, + new StringVerifier, + Optional::Yes, + BlendingOptionInfo.description + }, + { + EnableOpacityBlendingInfo.identifier, + new BoolVerifier, + Optional::Yes, + EnableOpacityBlendingInfo.description + }, } }; } @@ -196,6 +246,12 @@ RenderableModel::RenderableModel(const ghoul::Dictionary& dictionary) glm::dmat3(1.0) ) , _rotationVec(RotationVecInfo, glm::dvec3(0.0), glm::dvec3(0.0), glm::dvec3(360.0)) + , _enableOpacityBlending(EnableOpacityBlendingInfo, false) + , _disableDepthTest(DisableDepthTestInfo, false) + , _blendingFuncOption( + BlendingOptionInfo, + properties::OptionProperty::DisplayType::Dropdown + ) , _lightSourcePropertyOwner({ "LightSources", "Light Sources" }) { documentation::testSpecificationAndThrow( @@ -235,6 +291,10 @@ RenderableModel::RenderableModel(const ghoul::Dictionary& dictionary) _performShading = dictionary.value(ShadingInfo.identifier); } + if (dictionary.hasKey(DisableDepthTestInfo.identifier)) { + _disableDepthTest = dictionary.value(DisableDepthTestInfo.identifier); + } + if (dictionary.hasKey(DisableFaceCullingInfo.identifier)) { _disableFaceCulling = dictionary.value(DisableFaceCullingInfo.identifier); } @@ -252,14 +312,13 @@ RenderableModel::RenderableModel(const ghoul::Dictionary& dictionary) } } - addPropertySubOwner(_lightSourcePropertyOwner); - addProperty(_ambientIntensity); addProperty(_diffuseIntensity); addProperty(_specularIntensity); addProperty(_performShading); addProperty(_disableFaceCulling); + addProperty(_disableDepthTest); addProperty(_modelTransform); addProperty(_rotationVec); @@ -271,6 +330,29 @@ RenderableModel::RenderableModel(const ghoul::Dictionary& dictionary) if (dictionary.hasKey(RotationVecInfo.identifier)) { _rotationVec = dictionary.value(RotationVecInfo.identifier); } + + _blendingFuncOption.addOption(DefaultBlending, "Default"); + _blendingFuncOption.addOption(AdditiveBlending, "Additive"); + _blendingFuncOption.addOption(PointsAndLinesBlending, "Points and Lines"); + _blendingFuncOption.addOption(PolygonBlending, "Polygon"); + _blendingFuncOption.addOption(ColorAddingBlending, "Color Adding"); + + addProperty(_blendingFuncOption); + + if (dictionary.hasKey(BlendingOptionInfo.identifier)) { + const std::string blendingOpt = dictionary.value( + BlendingOptionInfo.identifier + ); + _blendingFuncOption.set(BlendingMapping[blendingOpt]); + } + + if (dictionary.hasKey(DisableDepthTestInfo.identifier)) { + _enableOpacityBlending = dictionary.value( + EnableOpacityBlendingInfo.identifier + ); + } + + addProperty(_enableOpacityBlending); } bool RenderableModel::isReady() const { @@ -384,11 +466,35 @@ void RenderableModel::render(const RenderData& data, RendererTasks&) { _program->setUniform(_uniformCache.diffuseIntensity, _diffuseIntensity); _program->setUniform(_uniformCache.specularIntensity, _specularIntensity); _program->setUniform(_uniformCache.performShading, _performShading); + _program->setUniform(_uniformCache.opacityBlending, _enableOpacityBlending); if (_disableFaceCulling) { glDisable(GL_CULL_FACE); } + glEnablei(GL_BLEND, 0); + switch (_blendingFuncOption) { + case DefaultBlending: + glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); + break; + case AdditiveBlending: + glBlendFunc(GL_ONE, GL_ONE); + break; + case PointsAndLinesBlending: + glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); + break; + case PolygonBlending: + glBlendFunc(GL_SRC_ALPHA_SATURATE, GL_ONE); + break; + case ColorAddingBlending: + glBlendFunc(GL_SRC_COLOR, GL_DST_COLOR); + break; + }; + + if (_disableDepthTest) { + glDisable(GL_DEPTH_TEST); + } + ghoul::opengl::TextureUnit unit; unit.activate(); _program->setUniform(_uniformCache.texture, unit); @@ -401,6 +507,12 @@ void RenderableModel::render(const RenderData& data, RendererTasks&) { glEnable(GL_CULL_FACE); } + global::renderEngine->openglStateCache().resetBlendState(); + + if (_disableDepthTest) { + glEnable(GL_DEPTH_TEST); + } + _program->deactivate(); } diff --git a/modules/base/rendering/renderablemodel.h b/modules/base/rendering/renderablemodel.h index ff382e5ecc..23beb352cc 100644 --- a/modules/base/rendering/renderablemodel.h +++ b/modules/base/rendering/renderablemodel.h @@ -26,7 +26,8 @@ #define __OPENSPACE_MODULE_BASE___RENDERABLEMODEL___H__ #include - +#include +#include #include #include #include @@ -79,11 +80,15 @@ private: properties::DMat4Property _modelTransform; properties::Vec3Property _rotationVec; + properties::BoolProperty _disableDepthTest; + properties::BoolProperty _enableOpacityBlending; + properties::OptionProperty _blendingFuncOption; + ghoul::opengl::ProgramObject* _program = nullptr; UniformCache(opacity, nLightSources, lightDirectionsViewSpace, lightIntensities, modelViewTransform, normalTransform, projectionTransform, performShading, texture, ambientIntensity, diffuseIntensity, - specularIntensity) _uniformCache; + specularIntensity, opacityBlending) _uniformCache; std::vector> _lightSources; diff --git a/modules/base/shaders/model_fs.glsl b/modules/base/shaders/model_fs.glsl index 8ea1340660..a26843ca2c 100644 --- a/modules/base/shaders/model_fs.glsl +++ b/modules/base/shaders/model_fs.glsl @@ -34,6 +34,7 @@ uniform float diffuseIntensity = 1.0; uniform float specularIntensity = 1.0; uniform bool performShading = true; +uniform bool opacityBlending = false; uniform sampler2D texture1; @@ -46,6 +47,10 @@ uniform float opacity = 1.0; const vec3 SpecularAlbedo = vec3(1.0); Fragment getFragment() { + if (opacity == 0.0) { + discard; + } + vec3 diffuseAlbedo = texture(texture1, vs_st).rgb; Fragment frag; @@ -84,12 +89,22 @@ Fragment getFragment() { frag.color.rgb = diffuseAlbedo; } - frag.color.a = opacity; + if (opacityBlending) { + // frag.color.a = opacity * (frag.color.r + frag.color.g + frag.color.b)/3.0; + frag.color.a = opacity * max(max(frag.color.r, frag.color.g), frag.color.b); + } + else { + frag.color.a = opacity; + } + + if (frag.color.a < 0.1) { + discard; + } + frag.depth = vs_screenSpaceDepth; frag.gPosition = vs_positionCameraSpace; frag.gNormal = vec4(vs_normalViewSpace, 0.0); frag.disableLDR2HDR = true; - return frag; } \ No newline at end of file From 9fa01165de0b8ae4aa76360cec52c09ff5ec99c5 Mon Sep 17 00:00:00 2001 From: Mikael Pettersson Date: Wed, 4 Nov 2020 13:28:50 +0100 Subject: [PATCH 09/28] Added Lowlevel mouse filtering in touch module (#1365) - This disables windows "injected" mouse events, which stem from touch - Only attaches if we are not debugging, as this is a global listener and would stall the OS if we put a breakpoint with touch module - note that this means that debugging behaviour is different with touch enabled --- modules/touch/src/win32_touch.cpp | 55 +++++++++++++++++-------------- 1 file changed, 31 insertions(+), 24 deletions(-) diff --git a/modules/touch/src/win32_touch.cpp b/modules/touch/src/win32_touch.cpp index 3e1640af86..bfd8b73aa9 100644 --- a/modules/touch/src/win32_touch.cpp +++ b/modules/touch/src/win32_touch.cpp @@ -35,6 +35,7 @@ #include #include #include +#include // #define ENABLE_TUIOMESSAGES #define ENABLE_DIRECTMSG @@ -230,25 +231,31 @@ Win32TouchHook::Win32TouchHook(void* nativeWindow) { GetCurrentThreadId() ); - // In theory, if our UI is pumped from a different thread, we can - // handle Low-level mouse events in that thread as well. - // this might help reduce mouse lag while running OpenSpace? - // gMouseHookThread = new std::thread([](){ - // gMouseHook = SetWindowsHookExW( - // WH_MOUSE_LL, - // LowLevelMouseProc, - // GetModuleHandleW(NULL), - // 0 //<- Global thread id (low-level mouse is global only) - // ); - // if (!gMouseHook) { - // LINFO("Could not setup mousehook!"); - // } + // Attach a lowlevel mouse hook. + // This mouse hook prevents injected mouse events (touch-to-mouse), + // since we cannot catch it in our messageloop. + // Since this is attached to windows global thread, this will block lowlevel mouse + // access to all running applications if we stall in this thread. + // Debug breakpoints typically freeze our application, in which case we simply don't + // create this if a debugger is attached. + if (!IsDebuggerPresent()) { + gMouseHookThread = new std::thread([](){ + gMouseHook = SetWindowsHookExW( + WH_MOUSE_LL, + LowLevelMouseProc, + GetModuleHandleW(NULL), + 0 //<- Global thread id (low-level mouse is global only) + ); + if (!gMouseHook) { + LINFO("Could not setup mousehook!"); + } - // MSG msg; - // while (GetMessage(&msg, NULL, 0, 0)) { - // DispatchMessage(&msg); - // } - // }); + MSG msg; + while (GetMessage(&msg, NULL, 0, 0)) { + DispatchMessage(&msg); + } + }); + } if (!gTouchHook) { LINFO(fmt::format("Failed to setup WindowsHook for touch input redirection")); @@ -272,13 +279,13 @@ Win32TouchHook::~Win32TouchHook() { } // Low-level mouse hook is "needed" if we want to stop mousecursor from moving -// when we get a touch-input on our window A negative effect is that this -// function is for global threads, meaning our application will cause Windows to -// stall the mouse cursor when this function can't be scheduled. This is not yet -// fail-proof...might be a race-condition on message pumping? +// when we get a touch-input on our window. +// A negative effect is that this function is for global threads, meaning our +// application will cause Windows to stall the mouse cursor when this +// function can't be scheduled (i.e. when debugger hits a breakpoint). +// This is not yet fail-proof...might be a race-condition on message pumping? // - Seems to move the cursor when we get two fingers as input.. -// - If we ourselves would pump windows for events, we can handle this in the -// pump-loop +// - If we ourselves would pump windows for events, we can handle this. LRESULT CALLBACK LowLevelMouseProc(int nCode, WPARAM wParam, LPARAM lParam) { constexpr const LONG_PTR SIGNATURE_MASK = 0xFFFFFF00; constexpr const LONG_PTR MOUSEEVENTF_FROMTOUCH = 0xFF515700; From 33191aafcbd541d2c8d2201e444e598731619f6e Mon Sep 17 00:00:00 2001 From: Malin Ejdbo Date: Wed, 4 Nov 2020 14:18:21 +0100 Subject: [PATCH 10/28] More cleanup --- .../space/translation/horizonstranslation.cpp | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/modules/space/translation/horizonstranslation.cpp b/modules/space/translation/horizonstranslation.cpp index ee0171c866..b931afd0e3 100644 --- a/modules/space/translation/horizonstranslation.cpp +++ b/modules/space/translation/horizonstranslation.cpp @@ -169,7 +169,8 @@ void HorizonsTranslation::readHorizonsTextFile() { if (!fileStream.good()) { LERROR(fmt::format( - "Failed to open Horizons text file '{}'", _horizonsTextFile)); + "Failed to open Horizons text file '{}'", _horizonsTextFile + )); return; } @@ -227,7 +228,7 @@ bool HorizonsTranslation::loadCachedFile(const std::string& file) { return false; } - // Read how many values to read + // Read how many keyframes to read int32_t nKeyframes = 0; fileStream.read(reinterpret_cast(&nKeyframes), sizeof(int32_t)); @@ -265,7 +266,7 @@ void HorizonsTranslation::saveCachedFile(const std::string& file) const { return; } - // Write how many values are to be written + // Write how many keyframes are to be written int32_t nKeyframes = static_cast(_timeline.nKeyframes()); if (nKeyframes == 0) { throw ghoul::RuntimeError("Error writing cache: No values were loaded"); @@ -276,18 +277,22 @@ void HorizonsTranslation::saveCachedFile(const std::string& file) const { std::deque> keyframes = _timeline.keyframes(); for (int i = 0; i < nKeyframes; i++) { // First write timestamp - fileStream.write(reinterpret_cast(&keyframes[i].timestamp), + fileStream.write(reinterpret_cast( + &keyframes[i].timestamp), sizeof(double) ); // and then the components of the position vector one by one - fileStream.write(reinterpret_cast(&keyframes[i].data.x), + fileStream.write(reinterpret_cast( + &keyframes[i].data.x), sizeof(double) ); - fileStream.write(reinterpret_cast(&keyframes[i].data.y), + fileStream.write(reinterpret_cast( + &keyframes[i].data.y), sizeof(double) ); - fileStream.write(reinterpret_cast(&keyframes[i].data.z), + fileStream.write(reinterpret_cast( + &keyframes[i].data.z), sizeof(double) ); } From a673ed9fbf8a96fd892e5330679ddf91850241d6 Mon Sep 17 00:00:00 2001 From: Micah Date: Wed, 4 Nov 2020 18:55:49 -0500 Subject: [PATCH 11/28] fix to grids asset; issue/1371 --- data/assets/scene/digitaluniverse/grids.asset | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/data/assets/scene/digitaluniverse/grids.asset b/data/assets/scene/digitaluniverse/grids.asset index 2699247df4..daf5d5fa20 100644 --- a/data/assets/scene/digitaluniverse/grids.asset +++ b/data/assets/scene/digitaluniverse/grids.asset @@ -550,6 +550,6 @@ asset.meta = { License = "AMNH Digital Universe", Identifiers = {"RadioSphere", "OortSphere", "EclipticSphere", "EclipticSphereLabels", "Equatorial", "EquatorialSphereLabels", "GalacticSphere", "GalacticSphereLabels", - "1ldGrid", "1lmGrid", "1lyGrid", "10lyGrid", "100lyGrid", "1klyGrid" "10klyGrid", + "1ldGrid", "1lmGrid", "1lyGrid", "10lyGrid", "100lyGrid", "1klyGrid", "10klyGrid", "100klyGrid", "1MlyGrid", "10MlyGrid", "100MlyGrid", "20GlyGrid"} } From 8ad757263f352ce5d68d2ec0ebc3a86b67cb04fe Mon Sep 17 00:00:00 2001 From: Jonathas Costa Date: Thu, 12 Nov 2020 16:10:01 -0500 Subject: [PATCH 12/28] Added initial position (far away) in the g-Buffer position. (#1360) * Added initial position (far away) in the g-Buffer position. * Fixed bug with Sun's star and atmosphere. --- data/assets/scene/digitaluniverse/stars.asset | 3 ++- modules/space/shaders/star_fs.glsl | 2 +- src/rendering/framebufferrenderer.cpp | 2 ++ 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/data/assets/scene/digitaluniverse/stars.asset b/data/assets/scene/digitaluniverse/stars.asset index 7328d0fae4..e269202667 100644 --- a/data/assets/scene/digitaluniverse/stars.asset +++ b/data/assets/scene/digitaluniverse/stars.asset @@ -66,7 +66,8 @@ local sunstar = { MagnitudeExponent = 6.2, SizeComposition = "Distance Modulus", RenderMethod = "Texture Based", -- or PSF - FadeInDistances = { 0.0001, 0.1 } + FadeInDistances = { 0.0001, 0.1 }, + RenderableType = "PostDeferredTransparent" }, GUI = { Name = "Sun", diff --git a/modules/space/shaders/star_fs.glsl b/modules/space/shaders/star_fs.glsl index 46c6ebb4a0..6b98775e7a 100644 --- a/modules/space/shaders/star_fs.glsl +++ b/modules/space/shaders/star_fs.glsl @@ -101,7 +101,7 @@ Fragment getFragment() { vec4 fullColor = vec4(color.rgb, textureColor.a); fullColor.a *= alphaValue; - if (fullColor.a == 0) { + if (fullColor.a < 0.001) { discard; } diff --git a/src/rendering/framebufferrenderer.cpp b/src/rendering/framebufferrenderer.cpp index aae263a0a5..028fd63fc7 100644 --- a/src/rendering/framebufferrenderer.cpp +++ b/src/rendering/framebufferrenderer.cpp @@ -73,6 +73,7 @@ namespace { } }; + constexpr const glm::vec4 PosBufferClearVal = { 1e32, 1e32, 1e32, 1.f }; constexpr const std::array HDRUniformNames = { "hdrFeedingTexture", "blackoutFactor", "hdrExposure", "gamma", @@ -1170,6 +1171,7 @@ void FramebufferRenderer::render(Scene* scene, Camera* camera, float blackoutFac glBindFramebuffer(GL_FRAMEBUFFER, _gBuffers.framebuffer); glDrawBuffers(3, ColorAttachmentArray); glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); + glClearBufferfv(GL_COLOR, 1, glm::value_ptr(PosBufferClearVal)); } Time time = global::timeManager->time(); From 997c65f7291f5a3f7dc89e7e7f9d87e904eba0ff Mon Sep 17 00:00:00 2001 From: Alexander Bock Date: Thu, 12 Nov 2020 23:02:18 +0100 Subject: [PATCH 13/28] Update kameleon repository --- modules/kameleon/ext/kameleon | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/kameleon/ext/kameleon b/modules/kameleon/ext/kameleon index 1b4549edc7..338d482c86 160000 --- a/modules/kameleon/ext/kameleon +++ b/modules/kameleon/ext/kameleon @@ -1 +1 @@ -Subproject commit 1b4549edc74ef371730ef9d39c1ffa0efe90a985 +Subproject commit 338d482c8617bfacda0a5af8f3f6bb23163d436f From b4951d6607819024e70b2908a5d53d8fa5b060dd Mon Sep 17 00:00:00 2001 From: Alexander Bock Date: Fri, 13 Nov 2020 17:12:12 +0100 Subject: [PATCH 14/28] Add some rudimentary soft FPS cap --- include/openspace/rendering/renderengine.h | 3 +++ src/rendering/renderengine.cpp | 19 +++++++++++++++++++ 2 files changed, 22 insertions(+) diff --git a/include/openspace/rendering/renderengine.h b/include/openspace/rendering/renderengine.h index 08209e3ac8..59b03d02b0 100644 --- a/include/openspace/rendering/renderengine.h +++ b/include/openspace/rendering/renderengine.h @@ -33,6 +33,7 @@ #include #include #include +#include namespace ghoul { namespace fontrendering { class Font; } @@ -229,6 +230,8 @@ private: properties::FloatProperty _saturation; properties::FloatProperty _value; + properties::IntProperty _framerateLimit; + std::chrono::high_resolution_clock::time_point _lastFrameTime; properties::FloatProperty _horizFieldOfView; properties::Vec3Property _globalRotation; diff --git a/src/rendering/renderengine.cpp b/src/rendering/renderengine.cpp index b1ca205edc..c784d1fda3 100644 --- a/src/rendering/renderengine.cpp +++ b/src/rendering/renderengine.cpp @@ -230,6 +230,13 @@ namespace { "Value" }; + constexpr openspace::properties::Property::PropertyInfo FramerateLimitInfo = { + "FramerateLimit", + "Framerate Limit", + "If set to a value bigger than 0, the framerate will be limited to that many " + "frames per second without using V-Sync" + }; + constexpr openspace::properties::Property::PropertyInfo HorizFieldOfViewInfo = { "HorizFieldOfView", "Horizontal Field of View", @@ -276,6 +283,7 @@ RenderEngine::RenderEngine() , _hue(HueInfo, 0.f, 0.f, 360.f) , _saturation(SaturationInfo, 1.f, 0.0f, 2.f) , _value(ValueInfo, 1.f, 0.f, 2.f) + , _framerateLimit(FramerateLimitInfo, 0.f, 0.f, 500.f) , _horizFieldOfView(HorizFieldOfViewInfo, 80.f, 1.f, 179.f) , _globalRotation( GlobalRotationInfo, @@ -381,6 +389,7 @@ RenderEngine::RenderEngine() addProperty(_saveFrameInformation); #endif // OPENSPACE_WITH_INSTRUMENTATION + addProperty(_framerateLimit); addProperty(_globalRotation); addProperty(_screenSpaceRotation); addProperty(_masterRotation); @@ -676,6 +685,16 @@ void RenderEngine::render(const glm::mat4& sceneMatrix, const glm::mat4& viewMat _camera->invalidateCache(); } + const int fpsLimit = _framerateLimit; + if (fpsLimit > 0) { + // Using a sleep here is not optimal, but we are not looking for FPS-perfect + // limiting + std::this_thread::sleep_until(_lastFrameTime); + const double delta = (1.0 / fpsLimit) * 1000.0 * 1000.0; + auto now = std::chrono::high_resolution_clock::now(); + _lastFrameTime = now + std::chrono::microseconds(static_cast(delta)); + } + const bool masterEnabled = delegate.isMaster() ? !_disableMasterRendering : true; if (masterEnabled && !delegate.isGuiWindow() && _globalBlackOutFactor > 0.f) { _renderer->render( From ef081d27aa1b34ce7bee69cb1e845423f626ff4a Mon Sep 17 00:00:00 2001 From: Alexander Bock Date: Mon, 16 Nov 2020 10:43:08 +0100 Subject: [PATCH 15/28] Try to get the location of the sync folder from the OPENSPACE_SYNC environment variable first, before using the ${BASE}/sync Update SGCT repository --- apps/OpenSpace/ext/sgct | 2 +- ext/ghoul | 2 +- openspace.cfg | 6 +++++- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/apps/OpenSpace/ext/sgct b/apps/OpenSpace/ext/sgct index cef10f55bd..6c351ebf2e 160000 --- a/apps/OpenSpace/ext/sgct +++ b/apps/OpenSpace/ext/sgct @@ -1 +1 @@ -Subproject commit cef10f55bda2c683a936159e97c43a9104c03fb1 +Subproject commit 6c351ebf2e7a1106982502f4050363f31ac3d0a3 diff --git a/ext/ghoul b/ext/ghoul index 7814e7d3be..68af9b6971 160000 --- a/ext/ghoul +++ b/ext/ghoul @@ -1 +1 @@ -Subproject commit 7814e7d3be623a229ce3fb95754f0e8d2923c958 +Subproject commit 68af9b6971e1e6447fa63afe3ea9918bb0e5c6d3 diff --git a/openspace.cfg b/openspace.cfg index 4410c6c261..ab32afd02f 100644 --- a/openspace.cfg +++ b/openspace.cfg @@ -95,7 +95,11 @@ Paths = { PROFILES = "${DATA}/profiles", FONTS = "${DATA}/fonts", TASKS = "${DATA}/tasks", - SYNC = "${BASE}/sync", + -- If the the 'OPENSPACE_SYNC' environment variable is defined on the system, use that + -- value. Otherwise, fall back to the ${BASE}/sync folder instead. This allows a + -- reuse of the sync folder between multiple OpenSpace installations by simply setting + -- that environment variable + SYNC = os.getenv("OPENSPACE_SYNC") or "${BASE}/sync2", SCREENSHOTS = "${BASE}/screenshots", WEB = "${DATA}/web", RECORDINGS = "${BASE}/recordings", From 8d6fc92cbc542222434f7600d3aef4871532fb0c Mon Sep 17 00:00:00 2001 From: Alexander Bock Date: Mon, 16 Nov 2020 11:02:43 +0100 Subject: [PATCH 16/28] Correctly set the height of the LuaConsole (closes #1375) --- src/rendering/luaconsole.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/rendering/luaconsole.cpp b/src/rendering/luaconsole.cpp index 104f637218..441abc583b 100644 --- a/src/rendering/luaconsole.cpp +++ b/src/rendering/luaconsole.cpp @@ -600,7 +600,9 @@ void LuaConsole::update() { // what the bounding box for that text would be. using namespace ghoul::fontrendering; - const float height = _historyFont->height() * (_commandsHistory.size() + 1); + const float height = + _historyFont->height() * + (std::min(static_cast(_commandsHistory.size()), _historyLength.value()) + 1); // Update the full height and the target height. // Add the height of the entry line and space for a separator. From 88f546ca7d0ece306960f9eaadf68ccbd816159d Mon Sep 17 00:00:00 2001 From: Alexander Bock Date: Mon, 16 Nov 2020 11:36:16 +0100 Subject: [PATCH 17/28] Add property to disable joystickinput Set that property to false by default to disable stray joystick input (closes #1370) --- .../openspace/interaction/navigationhandler.h | 3 +- src/interaction/navigationhandler.cpp | 38 +++++++++++++------ src/interaction/orbitalnavigator.cpp | 7 ++++ 3 files changed, 36 insertions(+), 12 deletions(-) diff --git a/include/openspace/interaction/navigationhandler.h b/include/openspace/interaction/navigationhandler.h index 24d3ef495b..600456a50d 100644 --- a/include/openspace/interaction/navigationhandler.h +++ b/include/openspace/interaction/navigationhandler.h @@ -166,7 +166,8 @@ private: std::optional _pendingNavigationState; - properties::BoolProperty _disableInputs; + properties::BoolProperty _disableMouseInputs; + properties::BoolProperty _disableJoystickInputs; properties::BoolProperty _useKeyFrameInteraction; }; diff --git a/src/interaction/navigationhandler.cpp b/src/interaction/navigationhandler.cpp index 548a0b9c3b..700dc8d06d 100644 --- a/src/interaction/navigationhandler.cpp +++ b/src/interaction/navigationhandler.cpp @@ -53,13 +53,20 @@ namespace { constexpr const char* KeyReferenceFrame = "ReferenceFrame"; const double Epsilon = 1E-7; - constexpr const openspace::properties::Property::PropertyInfo KeyDisableInputInfo = { - "DisableInputs", + using namespace openspace; + constexpr const properties::Property::PropertyInfo KeyDisableMouseInputInfo = { + "DisableMouseInputs", "Disable all mouse inputs", "Disables all mouse inputs and prevents them from affecting the camera" }; - constexpr const openspace::properties::Property::PropertyInfo KeyFrameInfo = { + constexpr const properties::Property::PropertyInfo KeyDisableJoystickInputInfo = { + "DisableJoystickInputs", + "Disable all joystick inputs", + "Disables all joystick inputs and prevents them from affecting the camera" + }; + + constexpr const properties::Property::PropertyInfo KeyFrameInfo = { "UseKeyFrameInteraction", "Use keyframe interaction", "If this is set to 'true' the entire interaction is based off key frames rather " @@ -148,12 +155,14 @@ NavigationHandler::NavigationState::NavigationState(std::string anchor, std::str NavigationHandler::NavigationHandler() : properties::PropertyOwner({ "NavigationHandler" }) - , _disableInputs(KeyDisableInputInfo, false) + , _disableMouseInputs(KeyDisableMouseInputInfo, false) + , _disableJoystickInputs(KeyDisableJoystickInputInfo, true) , _useKeyFrameInteraction(KeyFrameInfo, false) { addPropertySubOwner(_orbitalNavigator); - addProperty(_disableInputs); + addProperty(_disableMouseInputs); + addProperty(_disableJoystickInputs); addProperty(_useKeyFrameInteraction); } @@ -235,6 +244,13 @@ void NavigationHandler::updateCamera(double deltaTime) { _keyframeNavigator.updateCamera(*_camera, _playbackModeEnabled); } else { + if (_disableJoystickInputs) { + std::fill( + global::joystickInputStates->begin(), + global::joystickInputStates->end(), + JoystickInputState() + ); + } _orbitalNavigator.updateStatesFromInput(_inputState, deltaTime); _orbitalNavigator.updateCameraStateFromStates(deltaTime); } @@ -334,28 +350,28 @@ const InputState& NavigationHandler::inputState() const { } void NavigationHandler::mouseButtonCallback(MouseButton button, MouseAction action) { - if (!_disableInputs) { + if (!_disableMouseInputs) { _inputState.mouseButtonCallback(button, action); } } void NavigationHandler::mousePositionCallback(double x, double y) { - if (!_disableInputs) { + if (!_disableMouseInputs) { _inputState.mousePositionCallback(x, y); } } void NavigationHandler::mouseScrollWheelCallback(double pos) { - if (!_disableInputs) { + if (!_disableMouseInputs) { _inputState.mouseScrollWheelCallback(pos); } } void NavigationHandler::keyboardCallback(Key key, KeyModifier modifier, KeyAction action) { - if (!_disableInputs) { - _inputState.keyboardCallback(key, modifier, action); - } + // There is no need to disable the keyboard callback based on a property as the vast + // majority of input is coming through Lua scripts anyway which are not blocked here + _inputState.keyboardCallback(key, modifier, action); } NavigationHandler::NavigationState NavigationHandler::navigationState() const { diff --git a/src/interaction/orbitalnavigator.cpp b/src/interaction/orbitalnavigator.cpp index 3f923ac7e6..a85f2f1b1d 100644 --- a/src/interaction/orbitalnavigator.cpp +++ b/src/interaction/orbitalnavigator.cpp @@ -103,6 +103,13 @@ namespace { "the sensitivity is the less impact a mouse motion will have." }; + constexpr openspace::properties::Property::PropertyInfo JoystickEnabledInfo = { + "JoystickEnabled", + "Joystick Control Enabled", + "If this is selected, a connected joystick will be used as an optional input " + "device. If this is deselected, any joystick input will be ignored" + }; + constexpr openspace::properties::Property::PropertyInfo JoystickSensitivityInfo = { "JoystickSensitivity", "Joystick Sensitivity", From 6c088a56098f0358f02c20bc8768c27cc5744172 Mon Sep 17 00:00:00 2001 From: Alexander Bock Date: Mon, 16 Nov 2020 13:47:42 +0100 Subject: [PATCH 18/28] Handle it gracefully if one of hte required folders for the launcher does not exist or when trying to launch OpenSpace with an empty profile (closes #1377) --- .../ext/launcher/src/launcherwindow.cpp | 39 +++++++++++++++---- apps/OpenSpace/main.cpp | 5 +++ 2 files changed, 37 insertions(+), 7 deletions(-) diff --git a/apps/OpenSpace/ext/launcher/src/launcherwindow.cpp b/apps/OpenSpace/ext/launcher/src/launcherwindow.cpp index 6d1e775849..200affb7d7 100644 --- a/apps/OpenSpace/ext/launcher/src/launcherwindow.cpp +++ b/apps/OpenSpace/ext/launcher/src/launcherwindow.cpp @@ -28,6 +28,7 @@ #include #include +#include #include #include #include @@ -220,8 +221,17 @@ QWidget* LauncherWindow::createCentralWidget() { connect( startButton, &QPushButton::released, [this]() { - _shouldLaunch = true; - close(); + if (_profileBox->currentText().isEmpty()) { + QMessageBox::critical( + this, + "Empty Profile", + "Cannot launch with an empty profile" + ); + } + else { + _shouldLaunch = true; + close(); + } } ); startButton->setObjectName("large"); @@ -301,6 +311,13 @@ void LauncherWindow::populateProfilesList(std::string preset) { _profileBox->clear(); + if (!std::filesystem::exists(_profilePath)) { + LINFOC( + "LauncherWindow", + fmt::format("Could not find profile folder '{}'", _profilePath) + ); + return; + } // Add all the files with the .profile extension to the dropdown for (const fs::directory_entry& p : fs::directory_iterator(_profilePath)) { if (p.path().extension() != ".profile") { @@ -321,12 +338,20 @@ void LauncherWindow::populateWindowConfigsList(std::string preset) { namespace fs = std::filesystem; _windowConfigBox->clear(); - // Add all the files with the .xml extension to the dropdown - for (const fs::directory_entry& p : fs::directory_iterator(_configPath)) { - if (p.path().extension() != ".xml") { - continue; + if (std::filesystem::exists(_configPath)) { + // Add all the files with the .xml extension to the dropdown + for (const fs::directory_entry& p : fs::directory_iterator(_configPath)) { + if (p.path().extension() != ".xml") { + continue; + } + _windowConfigBox->addItem(QString::fromStdString(p.path().stem().string())); } - _windowConfigBox->addItem(QString::fromStdString(p.path().stem().string())); + } + else { + LINFOC( + "LauncherWindow", + fmt::format("Could not find config folder '{}'", _configPath) + ); } // Try to find the requested configuration file and set it as the current one. As we diff --git a/apps/OpenSpace/main.cpp b/apps/OpenSpace/main.cpp index c41a94245f..3f66512e83 100644 --- a/apps/OpenSpace/main.cpp +++ b/apps/OpenSpace/main.cpp @@ -1189,6 +1189,11 @@ int main(int argc, char** argv) { xmlExt ); } + if (global::configuration->profile.empty()) { + LFATAL("Cannot launch with an empty profile"); + exit(EXIT_FAILURE); + } + // Prepend the outgoing sgctArguments with the program name // as well as the configuration file that sgct is supposed to use From 73d920d40d1b285d068e7dbc40f2852214bc0f03 Mon Sep 17 00:00:00 2001 From: Alexander Bock Date: Mon, 16 Nov 2020 14:00:18 +0100 Subject: [PATCH 19/28] Make the linear speed dependent on the current framerate (closes #1369) --- include/openspace/interaction/orbitalnavigator.h | 2 +- src/interaction/orbitalnavigator.cpp | 10 ++++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/include/openspace/interaction/orbitalnavigator.h b/include/openspace/interaction/orbitalnavigator.h index e541ab23fd..eec6daf2fb 100644 --- a/include/openspace/interaction/orbitalnavigator.h +++ b/include/openspace/interaction/orbitalnavigator.h @@ -268,7 +268,7 @@ private: */ glm::dvec3 moveCameraAlongVector(const glm::dvec3& camPos, double distFromCameraToFocus, const glm::dvec3& camPosToCenterPosDiff, - double destination) const; + double destination, double deltaTime) const; /* * Adds rotation to the camera position so that it follows the rotation of the anchor diff --git a/src/interaction/orbitalnavigator.cpp b/src/interaction/orbitalnavigator.cpp index a85f2f1b1d..47ab0f642f 100644 --- a/src/interaction/orbitalnavigator.cpp +++ b/src/interaction/orbitalnavigator.cpp @@ -256,7 +256,7 @@ OrbitalNavigator::OrbitalNavigator() , _flightDestinationDistance(FlightDestinationDistInfo, 2e8f, 0.0f, 1e10f) , _flightDestinationFactor(FlightDestinationFactorInfo, 1E-4, 1E-6, 0.5) , _applyLinearFlight(ApplyLinearFlightInfo, false) - , _velocitySensitivity(VelocityZoomControlInfo, 0.02f, 0.01f, 0.15f) + , _velocitySensitivity(VelocityZoomControlInfo, 3.5f, 0.001f, 20.f) , _mouseSensitivity(MouseSensitivityInfo, 15.f, 1.f, 50.f) , _joystickSensitivity(JoystickSensitivityInfo, 10.f, 1.0f, 50.f) , _websocketSensitivity(WebsocketSensitivityInfo, 5.f, 1.0f, 50.f) @@ -481,7 +481,8 @@ void OrbitalNavigator::updateCameraStateFromStates(double deltaTime) { pose.position, distFromCameraToFocus, camPosToAnchorPosDiff, - _flightDestinationDistance + _flightDestinationDistance, + deltaTime ); } else { @@ -1268,7 +1269,8 @@ glm::dvec3 OrbitalNavigator::translateHorizontally(double deltaTime, glm::dvec3 OrbitalNavigator::moveCameraAlongVector(const glm::dvec3& camPos, double distFromCameraToFocus, const glm::dvec3& camPosToAnchorPosDiff, - double destination) const + double destination, + double deltaTime) const { // This factor adapts the velocity so it slows down when getting closer // to our final destination @@ -1285,7 +1287,7 @@ glm::dvec3 OrbitalNavigator::moveCameraAlongVector(const glm::dvec3& camPos, velocity = distFromCameraToFocus / destination - 1.0; } } - velocity *= _velocitySensitivity; + velocity *= _velocitySensitivity * deltaTime; // Return the updated camera position return camPos - velocity * camPosToAnchorPosDiff; From 8d7300a2428d5fa0cba13c9160504cf92f70c524 Mon Sep 17 00:00:00 2001 From: Alexander Bock Date: Mon, 16 Nov 2020 14:22:56 +0100 Subject: [PATCH 20/28] Add the ability to change the screenshot folder at runtime (#1172) --- apps/OpenSpace/main.cpp | 3 +++ include/openspace/engine/windowdelegate.h | 2 ++ src/engine/openspaceengine.cpp | 7 +++++++ src/engine/openspaceengine_lua.inl | 22 ++++++++++++++++++++++ 4 files changed, 34 insertions(+) diff --git a/apps/OpenSpace/main.cpp b/apps/OpenSpace/main.cpp index 3f66512e83..ec1d62ec3f 100644 --- a/apps/OpenSpace/main.cpp +++ b/apps/OpenSpace/main.cpp @@ -925,6 +925,9 @@ void setSgctDelegateFunctions() { return currentWindow->swapGroupFrameNumber(); }; + sgctDelegate.setScreenshotFolder = [](std::string path) { + Settings::instance().setCapturePath(std::move(path)); + }; } void checkCommandLineForSettings(int& argc, char** argv, bool& hasSGCT, bool& hasProfile, diff --git a/include/openspace/engine/windowdelegate.h b/include/openspace/engine/windowdelegate.h index 0fd27ba589..b5b978c8dc 100644 --- a/include/openspace/engine/windowdelegate.h +++ b/include/openspace/engine/windowdelegate.h @@ -100,6 +100,8 @@ struct WindowDelegate { Frustum (*frustumMode)() = []() { return Frustum::Mono; }; uint64_t (*swapGroupFrameNumber)() = []() { return uint64_t(0); }; + + void (*setScreenshotFolder)(std::string) = [](std::string) {}; }; } // namespace openspace diff --git a/src/engine/openspaceengine.cpp b/src/engine/openspaceengine.cpp index 61442d56c8..edb6de88f3 100644 --- a/src/engine/openspaceengine.cpp +++ b/src/engine/openspaceengine.cpp @@ -1522,6 +1522,13 @@ scripting::LuaLibrary OpenSpaceEngine::luaLibrary() { "", "Remove all registered virtual properties" }, + { + "setScreenshotFolder", + &luascriptfunctions::setScreenshotFolder, + {}, + "string", + "Sets the folder used for storing screenshots or session recording frames" + }, { "addTag", &luascriptfunctions::addTag, diff --git a/src/engine/openspaceengine_lua.inl b/src/engine/openspaceengine_lua.inl index f92dad961b..e9e647296c 100644 --- a/src/engine/openspaceengine_lua.inl +++ b/src/engine/openspaceengine_lua.inl @@ -27,6 +27,7 @@ #include #include #include +#include namespace openspace::luascriptfunctions { @@ -182,6 +183,27 @@ int removeAllVirtualProperties(lua_State* L) { return 0; } +int setScreenshotFolder(lua_State* L) { + ghoul::lua::checkArgumentsAndThrow(L, 1, "lua::setScreenshotFolder"); + + std::string arg = ghoul::lua::value(L); + lua_pop(L, 0); + + std::string folder = FileSys.absolutePath(arg); + if (!std::filesystem::exists(folder)) { + std::filesystem::create_directory(folder); + } + + FileSys.registerPathToken( + "${SCREENSHOTS}", + folder, + ghoul::filesystem::FileSystem::Override::Yes + ); + + global::windowDelegate->setScreenshotFolder(folder); + return 0; +} + /** * \ingroup LuaScripts * addTag() From 3f365d1b1ce7ce77eebbe94d86c4ba9584e440e9 Mon Sep 17 00:00:00 2001 From: Alexander Bock Date: Mon, 16 Nov 2020 15:09:21 +0100 Subject: [PATCH 21/28] Add Oumuamua and Borisov to the asteroids profile Add a check to the ssdb parser that checks for empty strings --- data/profiles/asteroids.profile | 2 ++ modules/space/rendering/renderablesmallbody.cpp | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/data/profiles/asteroids.profile b/data/profiles/asteroids.profile index 70bbb0af63..8e6cb40535 100644 --- a/data/profiles/asteroids.profile +++ b/data/profiles/asteroids.profile @@ -1,6 +1,8 @@ { "assets": [ "base", + "scene/solarsystem/interstellar/c-2019_q4_borisov", + "scene/solarsystem/interstellar/oumuamua", "scene/solarsystem/sssb/amor_asteroid", "scene/solarsystem/sssb/apollo_asteroid", "scene/solarsystem/sssb/aten_asteroid", diff --git a/modules/space/rendering/renderablesmallbody.cpp b/modules/space/rendering/renderablesmallbody.cpp index 1da9da54a7..24666a385f 100644 --- a/modules/space/rendering/renderablesmallbody.cpp +++ b/modules/space/rendering/renderablesmallbody.cpp @@ -399,6 +399,10 @@ void RenderableSmallBody::readOrbitalParamsFromThisLine(bool firstDataLine, } static double importAngleValue(const std::string& angle) { + if (angle.empty()) { + return 0.0; + } + double output = std::stod(angle); output = std::fmod(output, 360.0); if (output < 0.0) { From 4d8dff01f55418be395f60f7581d1de233fcb9e5 Mon Sep 17 00:00:00 2001 From: Alexander Bock Date: Mon, 16 Nov 2020 15:25:48 +0100 Subject: [PATCH 22/28] Oops --- openspace.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openspace.cfg b/openspace.cfg index ab32afd02f..534ae46f9f 100644 --- a/openspace.cfg +++ b/openspace.cfg @@ -99,7 +99,7 @@ Paths = { -- value. Otherwise, fall back to the ${BASE}/sync folder instead. This allows a -- reuse of the sync folder between multiple OpenSpace installations by simply setting -- that environment variable - SYNC = os.getenv("OPENSPACE_SYNC") or "${BASE}/sync2", + SYNC = os.getenv("OPENSPACE_SYNC") or "${BASE}/sync", SCREENSHOTS = "${BASE}/screenshots", WEB = "${DATA}/web", RECORDINGS = "${BASE}/recordings", From 33e7561122f343d36b0402133ba0958a46a012bf Mon Sep 17 00:00:00 2001 From: Alexander Bock Date: Mon, 16 Nov 2020 15:59:15 +0100 Subject: [PATCH 23/28] Updated Ghoul repository --- ext/ghoul | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ext/ghoul b/ext/ghoul index 68af9b6971..ae10aa2307 160000 --- a/ext/ghoul +++ b/ext/ghoul @@ -1 +1 @@ -Subproject commit 68af9b6971e1e6447fa63afe3ea9918bb0e5c6d3 +Subproject commit ae10aa23075d1f78407e9895a8ec2e91337e958d From f3b373d2491d872288b0149aa61a3796d4ca0d65 Mon Sep 17 00:00:00 2001 From: Alexander Bock Date: Tue, 17 Nov 2020 11:22:38 +0100 Subject: [PATCH 24/28] Enable OpenGL debug context by default for the time being to prevent the frame stuttering from occurring --- openspace.cfg | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/openspace.cfg b/openspace.cfg index 534ae46f9f..d94f164206 100644 --- a/openspace.cfg +++ b/openspace.cfg @@ -219,13 +219,18 @@ ScreenSpaceRotation = { 0.0, 0.0, 0.0 } RenderingMethod = "Framebuffer" OpenGLDebugContext = { - Activate = false, + Activate = true, FilterIdentifier = { { Type = "Other", Source = "API", Identifier = 131185 }, --- Buffer performance warning: "copied/moved from VIDEO memory to HOST memory" + -- Buffer performance warning: "copied/moved from VIDEO memory to HOST memory" { Type = "Performance", Source = "API", Identifier = 131186 }, --- API_ID_LINE_WIDTH deprecated behavior warning has been generated - { Type = "Deprecated", Source = "API", Identifier = 7 } + -- API_ID_LINE_WIDTH deprecated behavior warning has been generated + { Type = "Deprecated", Source = "API", Identifier = 7 }, + -- Program/shader state performance warning: Vertex shader in program %i is being recompiled based on GL state. + { Type = "Performance", Source = "API", Identifier = 131218 }, + -- This is getting a bit wordy + { Type = "Push group", Source = "Application", Identifier = 0 }, + { Type = "Pop group", Source = "Application", Identifier = 0 }, }, -- FilterSeverity = { } } From 929f5e65c6c0f3d1a147670d2273918f6ee7c022 Mon Sep 17 00:00:00 2001 From: Emma Broman Date: Wed, 18 Nov 2020 09:33:23 +0100 Subject: [PATCH 25/28] Avoid errors caused by dots in exoplanet identifiers --- modules/exoplanets/exoplanetshelper.cpp | 1 + modules/exoplanets/exoplanetsmodule_lua.inl | 12 ++++++------ 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/modules/exoplanets/exoplanetshelper.cpp b/modules/exoplanets/exoplanetshelper.cpp index ed624d67de..dfc821c7e2 100644 --- a/modules/exoplanets/exoplanetshelper.cpp +++ b/modules/exoplanets/exoplanetshelper.cpp @@ -177,6 +177,7 @@ glm::dmat3 computeSystemRotation(glm::dvec3 starPosition) { std::string createIdentifier(std::string name) { std::replace(name.begin(), name.end(), ' ', '_'); + std::replace(name.begin(), name.end(), '.', '-'); sanitizeNameString(name); return name; } diff --git a/modules/exoplanets/exoplanetsmodule_lua.inl b/modules/exoplanets/exoplanetsmodule_lua.inl index cd73664631..d2f6bc0ec1 100644 --- a/modules/exoplanets/exoplanetsmodule_lua.inl +++ b/modules/exoplanets/exoplanetsmodule_lua.inl @@ -275,11 +275,11 @@ void createExoplanetSystem(std::string_view starName) { const std::string planetKeplerTranslation = "{" "Type = 'KeplerTranslation'," - "Eccentricity = " + std::to_string(planet.ecc) + "," //ECC + "Eccentricity = " + std::to_string(planet.ecc) + "," "SemiMajorAxis = " + std::to_string(semiMajorAxisInKm) + "," - "Inclination = " + std::to_string(planet.i) + "," //I - "AscendingNode = " + std::to_string(planet.bigOmega) + "," //BIGOM - "ArgumentOfPeriapsis = " + std::to_string(planet.omega) + "," //OM + "Inclination = " + std::to_string(planet.i) + "," + "AscendingNode = " + std::to_string(planet.bigOmega) + "," + "ArgumentOfPeriapsis = " + std::to_string(planet.omega) + "," "MeanAnomaly = 0.0," "Epoch = '" + sEpoch + "'," //TT. JD to YYYY MM DD hh:mm:ss "Period = " + std::to_string(period) + "" @@ -292,7 +292,7 @@ void createExoplanetSystem(std::string_view starName) { "Renderable = {" "Type = 'RenderableGlobe'," "Enabled = " + enabled + "," - "Radii = " + std::to_string(planetRadius) + "," //R. in meters. + "Radii = " + std::to_string(planetRadius) + "," //R. in meters "SegmentsPerPatch = 64," "PerformShading = false," "Layers = {}" @@ -308,7 +308,7 @@ void createExoplanetSystem(std::string_view starName) { int trailResolution = 1000; - // increase the resolution for highly eccentric orbits + // Increase the resolution for highly eccentric orbits const float eccentricityThreshold = 0.85f; if (planet.ecc > eccentricityThreshold) { trailResolution *= 2; From 0a432473283db8d9b4746616958ac43d1885fe27 Mon Sep 17 00:00:00 2001 From: Alexander Bock Date: Wed, 18 Nov 2020 21:10:09 +0100 Subject: [PATCH 26/28] Add an explicit digitaluniverse asset (closes #1398) --- data/assets/base.asset | 5 +-- .../digitaluniverse/digitaluniverse.asset | 36 +++++++++++++++++++ 2 files changed, 39 insertions(+), 2 deletions(-) create mode 100644 data/assets/scene/digitaluniverse/digitaluniverse.asset diff --git a/data/assets/base.asset b/data/assets/base.asset index d857183682..ff0a537a19 100644 --- a/data/assets/base.asset +++ b/data/assets/base.asset @@ -22,8 +22,9 @@ asset.require('scene/milkyway/objects/orionnebula/orionnebula') asset.require('util/launcher_images') local assetHelper = asset.require('util/asset_helper') -assetHelper.requireAll(asset, 'scene/milkyway/exoplanets') -assetHelper.requireAll(asset, 'scene/digitaluniverse') +asset.require('scene/milkyway/exoplanets/exoplanets_data') +asset.require('scene/milkyway/exoplanets/exoplanets_textures') +asset.require('scene/digitaluniverse/digitaluniverse') asset.require('customization/globebrowsing') diff --git a/data/assets/scene/digitaluniverse/digitaluniverse.asset b/data/assets/scene/digitaluniverse/digitaluniverse.asset new file mode 100644 index 0000000000..9739bca03e --- /dev/null +++ b/data/assets/scene/digitaluniverse/digitaluniverse.asset @@ -0,0 +1,36 @@ +asset.require('./2dF') +asset.require('./2mass') +asset.require('./6dF') +asset.require('./abell') +asset.require('./alternatestarlabels') +asset.require('./backgroundradiation') +asset.require('./clusters') +asset.require('./constellationbounds') +asset.require('./constellations') +asset.require('./deepsky') +asset.require('./dwarfs') +asset.require('./exoplanets') +asset.require('./globularclusters') +asset.require('./grids') +asset.require('./groups') +asset.require('./h2regions') +asset.require('./kepler') +asset.require('./localdwarfs') +asset.require('./milkyway') +asset.require('./milkyway_arm_labels') +asset.require('./milkyway_data') +asset.require('./milkyway_label') +asset.require('./milkyway_sphere') +asset.require('./obassociations') +asset.require('./openclusters') +asset.require('./planetarynebulae') +asset.require('./pulsars') +asset.require('./quasars') +asset.require('./sdss') +asset.require('./starlabels') +asset.require('./starorbits') +asset.require('./stars') +asset.require('./superclusters') +asset.require('./supernovaremnants') +asset.require('./tully') +asset.require('./voids') From 88cab58f09d0d6e37eb4eb9b9117fa6b979c179e Mon Sep 17 00:00:00 2001 From: Alexander Bock Date: Wed, 18 Nov 2020 21:43:14 +0100 Subject: [PATCH 27/28] Add the ability to toggle planets in the customization/globebrowsing.asset (closes #1392) Improve the handling of reading info files that have error messages --- data/assets/customization/globebrowsing.asset | 43 ++++++++++++++----- .../globebrowsing/scripts/layer_support.lua | 13 +++++- 2 files changed, 44 insertions(+), 12 deletions(-) diff --git a/data/assets/customization/globebrowsing.asset b/data/assets/customization/globebrowsing.asset index f9ed7a949e..608a09cfe4 100644 --- a/data/assets/customization/globebrowsing.asset +++ b/data/assets/customization/globebrowsing.asset @@ -1,10 +1,13 @@ --- Add require statements for assets exporting the neccessary globes --- here we add Mars, Moon and Mercury: -asset.require('../scene/solarsystem/planets/mars/mars') -asset.require('../scene/solarsystem/planets/earth/moon/moon') -asset.require('../scene/solarsystem/planets/mercury/mercury') - +---------------------------------------- +-- Configuration options for this asset local CreateFocusNodes = false +local AddMarsLayers = true +local AddMoonLayers = true +local AddMercuryLayers = true +---------------------------------------- + +-- If you add layers for different planets than listed here, be sure to add an +-- asset.require(...) statement in here similar to the ones that are used below -- Add folders to this list that contain .info files describing patches -- OBS: Even on Windows, you have to use forward slashes (/) or double backslashes (\\) @@ -22,11 +25,11 @@ local vrt_folders = { -- example: 'C:/OpenSpace/GlobeBrowsingData/Mars/CTX' -- We recommend using this folder for CTX - openspace.absPath('${BASE}/../OpenSpaceData/Mars/CTX'), + openspace.absPath('G:/OpenSpaceData/Mars/CTX'), -- if not and you have a custom path for CTX layers, enter it below '', -- We recommend using this folder for HiRISE - openspace.absPath('${BASE}/../OpenSpaceData/Mars/HiRISE'), + openspace.absPath('G:/OpenSpaceData/Mars/HiRISE'), -- if not and you have a custom path for HiRISE layers, enter it below '' }, @@ -36,8 +39,8 @@ local vrt_folders = { -- if areas overlap, images from the lower results will overwrite the images from former -- results -- example: 'C:/OpenSpace/GlobeBrowsingData/Moon' - openspace.absPath('${BASE}/../OpenSpaceData/Moon'), - openspace.absPath('${BASE}/../OpenSpaceData/Apollo'), + openspace.absPath('G:/OpenSpaceData/Moon'), + openspace.absPath('G:/OpenSpaceData/Apollo'), '' }, Mercury = { @@ -46,11 +49,29 @@ local vrt_folders = { -- if areas overlap, images from the lower results will overwrite the images from former -- results -- example: 'C:/OpenSpace/GlobeBrowsingData/Mercury' - openspace.absPath('${BASE}/../OpenSpaceData/Mercury'), + openspace.absPath('G:/OpenSpaceData/Mercury'), '' } } +-- Add require statements for assets exporting the neccessary globes +-- here we add Mars, Moon and Mercury: +if AddMarsLayers then + asset.require('../scene/solarsystem/planets/mars/mars') +else + vrt_folders['Mars'] = nil +end +if AddMoonLayers then + asset.require('../scene/solarsystem/planets/earth/moon/moon') +else + vrt_folders['Moon'] = nil +end +if AddMercuryLayers then + asset.require('../scene/solarsystem/planets/mercury/mercury') +else + vrt_folders['Mercury'] = nil +end + asset.onInitialize(function () -- Add local patches described at the top of this file for obj, list in pairs(vrt_folders) do diff --git a/modules/globebrowsing/scripts/layer_support.lua b/modules/globebrowsing/scripts/layer_support.lua index 28b2447d00..9771fd8b3f 100644 --- a/modules/globebrowsing/scripts/layer_support.lua +++ b/modules/globebrowsing/scripts/layer_support.lua @@ -205,11 +205,22 @@ openspace.globebrowsing.parseInfoFile = function (file) HeightFile = nil local dir = openspace.directoryForPath(file) - dofile(file) + file_func, error = loadfile(file) + if file_func then + file_func() + else + openspace.printError('Error loading file "' .. file .. '": '.. error) + return nil, nil, nil, nil + end local name = Name or Identifier local identifier = Identifier or Name + if name == nil and identifier == nil then + openspace.printError('Error loading file "' .. file .. '": No "Name" or "Identifier" found') + return nil, nil, nil, nil + end + local color = nil if ColorFile then color = { From d3a2ea4a5f1357e10841a20865df80d5446aa025 Mon Sep 17 00:00:00 2001 From: Alexander Bock Date: Wed, 18 Nov 2020 21:50:10 +0100 Subject: [PATCH 28/28] Add units to the profile editor camera dialog (closes #1390) --- .../ext/launcher/src/profile/cameradialog.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/apps/OpenSpace/ext/launcher/src/profile/cameradialog.cpp b/apps/OpenSpace/ext/launcher/src/profile/cameradialog.cpp index 2137770c36..206549e1f3 100644 --- a/apps/OpenSpace/ext/launcher/src/profile/cameradialog.cpp +++ b/apps/OpenSpace/ext/launcher/src/profile/cameradialog.cpp @@ -191,22 +191,22 @@ QWidget* CameraDialog::createNavStateWidget() { QWidget* posBox = new QWidget; QBoxLayout* posLayout = new QHBoxLayout(posBox); posLayout->setContentsMargins(0, 0, 0, 0); - posLayout->addWidget(new QLabel("X")); + posLayout->addWidget(new QLabel("X [m]")); _navState.positionX = new QLineEdit; _navState.positionX->setValidator(new QDoubleValidator); - _navState.positionX->setToolTip("Camera position vector (x)"); + _navState.positionX->setToolTip("Camera position vector (x) [m]"); posLayout->addWidget(_navState.positionX); - posLayout->addWidget(new QLabel("Y")); + posLayout->addWidget(new QLabel("Y [m]")); _navState.positionY = new QLineEdit; _navState.positionY->setValidator(new QDoubleValidator); - _navState.positionY->setToolTip("Camera position vector (y)"); + _navState.positionY->setToolTip("Camera position vector (y) [m]"); posLayout->addWidget(_navState.positionY); - posLayout->addWidget(new QLabel("Z")); + posLayout->addWidget(new QLabel("Z [m]")); _navState.positionZ = new QLineEdit; _navState.positionZ->setValidator(new QDoubleValidator); - _navState.positionZ->setToolTip("Camera position vector (z)"); + _navState.positionZ->setToolTip("Camera position vector (z) [m]"); posLayout->addWidget(_navState.positionZ); layout->addWidget(posBox, 3, 1); } @@ -277,7 +277,7 @@ QWidget* CameraDialog::createGeoWidget() { _geoState.longitude->setToolTip("Longitude of camera focus point (+/- 180 degrees)"); layout->addWidget(_geoState.longitude, 2, 1); - layout->addWidget(new QLabel("Altitude"), 3, 0); + layout->addWidget(new QLabel("Altitude [m]"), 3, 0); _geoState.altitude = new QLineEdit; _geoState.altitude->setValidator(new QDoubleValidator); _geoState.altitude->setToolTip("Altitude of camera (meters)");