mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-04-28 14:59:31 -05:00
Merge commit '9f1c4e847d7c37e75f0e73d051c8f7c758f20147' into feature/websocketnavigation
* Update & cleanup WebsocketInputStates to be part of globals * Update fmt library calls to handle non-standard objects (json, enum, etc.) # Conflicts: # include/openspace/interaction/inputstate.h # src/interaction/inputstate.cpp
This commit is contained in:
+526
-339
File diff suppressed because it is too large
Load Diff
+9
-4
@@ -24,8 +24,10 @@
|
||||
|
||||
#include <openspace/engine/openspaceengine.h>
|
||||
#include <openspace/engine/moduleengine.h>
|
||||
#include <openspace/engine/wrapper/windowwrapper.h>
|
||||
#include <openspace/engine/windowdelegate.h>
|
||||
#include <openspace/engine/configuration.h>
|
||||
#include <openspace/util/factorymanager.h>
|
||||
#include <openspace/engine/globals.h>
|
||||
#include <openspace/util/progressbar.h>
|
||||
#include <openspace/util/resourcesynchronization.h>
|
||||
#include <openspace/util/task.h>
|
||||
@@ -40,9 +42,12 @@
|
||||
int main(int argc, char** argv) {
|
||||
using namespace openspace;
|
||||
|
||||
std::vector<std::string> unusedStringlist;
|
||||
bool unusedBool;
|
||||
OpenSpaceEngine::create(argc, argv, nullptr, unusedStringlist, unusedBool);
|
||||
ghoul::initialize();
|
||||
|
||||
std::string configFile = configuration::findConfiguration();
|
||||
global::configuration = configuration::loadConfigurationFromFile(configFile);
|
||||
global::openSpaceEngine.initialize();
|
||||
|
||||
|
||||
TaskLoader taskLoader;
|
||||
std::vector<std::unique_ptr<Task>> tasks = taskLoader.tasksFromFile(
|
||||
|
||||
@@ -38,7 +38,9 @@
|
||||
#include <ghoul/cmdparser/commandlineparser.h>
|
||||
#include <ghoul/cmdparser/singlecommand.h>
|
||||
|
||||
#include <openspace/engine/wrapper/windowwrapper.h>
|
||||
#include <openspace/engine/configuration.h>
|
||||
#include <openspace/engine/globals.h>
|
||||
#include <openspace/engine/windowdelegate.h>
|
||||
#include <openspace/scripting/scriptengine.h>
|
||||
#include <openspace/rendering/renderable.h>
|
||||
#include <openspace/rendering/dashboarditem.h>
|
||||
@@ -102,9 +104,12 @@ void performTasks(const std::string& path) {
|
||||
int main(int argc, char** argv) {
|
||||
using namespace openspace;
|
||||
|
||||
std::vector<std::string> remainingArguments;
|
||||
bool unusedBool;
|
||||
OpenSpaceEngine::create(argc, argv, nullptr, remainingArguments, unusedBool);
|
||||
ghoul::initialize();
|
||||
|
||||
std::string configFile = configuration::findConfiguration();
|
||||
global::configuration = configuration::loadConfigurationFromFile(configFile);
|
||||
global::openSpaceEngine.initialize();
|
||||
|
||||
|
||||
ghoul::cmdparser::CommandlineParser commandlineParser(
|
||||
"OpenSpace TaskRunner",
|
||||
@@ -118,10 +123,10 @@ int main(int argc, char** argv) {
|
||||
"--task",
|
||||
"-t",
|
||||
"Provides the path to a task file to execute"
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
commandlineParser.setCommandLine(remainingArguments);
|
||||
commandlineParser.setCommandLine({ argv, argv + argc });
|
||||
commandlineParser.execute();
|
||||
|
||||
//FileSys.setCurrentDirectory(launchDirectory);
|
||||
|
||||
@@ -33,7 +33,7 @@
|
||||
#include <ghoul/cmdparser/commandlineparser.h>
|
||||
#include <ghoul/cmdparser/singlecommand.h>
|
||||
|
||||
#include <openspace/engine/wrapper/windowwrapper.h>
|
||||
#include <openspace/engine/windowdelegate.h>
|
||||
#include <openspace/scripting/scriptengine.h>
|
||||
#include <openspace/rendering/renderable.h>
|
||||
|
||||
|
||||
@@ -12,6 +12,7 @@ assetHelper.requireAll(asset, 'scene/solarsystem/missions/juno')
|
||||
-- Load default key bindings applicable to most scenes
|
||||
asset.require('util/default_keybindings')
|
||||
asset.require('util/default_dashboard')
|
||||
asset.require('util/default_joystick')
|
||||
|
||||
local junoAsset = asset.require('scene/solarsystem/missions/juno/juno')
|
||||
|
||||
|
||||
@@ -14,6 +14,7 @@ asset.require('scene/solarsystem/missions/newhorizons/newhorizons')
|
||||
-- Load default key bindings applicable to most scenes
|
||||
asset.require('util/default_keybindings')
|
||||
asset.require('util/default_dashboard')
|
||||
asset.require('util/default_joystick')
|
||||
|
||||
-- Custom Keybindings
|
||||
local Keybindings = {
|
||||
|
||||
@@ -13,6 +13,7 @@ asset.require('scene/solarsystem/missions/osirisrex/osirisrex')
|
||||
-- Load default key bindings applicable to most scenes
|
||||
asset.require('util/default_keybindings')
|
||||
asset.require('util/default_dashboard')
|
||||
asset.require('util/default_joystick')
|
||||
|
||||
-- Custom Keybindings
|
||||
local Keybindings = {
|
||||
|
||||
@@ -15,6 +15,7 @@ asset.require('scene/solarsystem/missions/rosetta/rosetta')
|
||||
-- Load default key bindings applicable to most scenes
|
||||
asset.require('util/default_keybindings')
|
||||
asset.require('util/default_dashboard')
|
||||
asset.require('util/default_joystick')
|
||||
|
||||
-- Custom Keybindings
|
||||
local Keybindings = {
|
||||
|
||||
@@ -6,6 +6,7 @@ asset.require("spice/base")
|
||||
-- Barycenter of the solar system, expressed in the Galactic frame
|
||||
local SolarSystemBarycenter = {
|
||||
Identifier = "SolarSystemBarycenter",
|
||||
-- No parent; this node is attached to the scene graph root
|
||||
TimeFrame = { -- Using Spice kernels for 1850-2150
|
||||
Type = "TimeFrameInterval",
|
||||
Start = "1850-JAN-01",
|
||||
@@ -16,7 +17,6 @@ local SolarSystemBarycenter = {
|
||||
Path = "/Solar System",
|
||||
Hidden = true
|
||||
}
|
||||
-- No parent; this node is attached to the scene graph root
|
||||
}
|
||||
|
||||
-- Spice frame for the Sun
|
||||
|
||||
@@ -118,7 +118,7 @@ asset.onInitialize(function()
|
||||
openspace.navigation.bindJoystickAxis(controller.LeftThumbStick[1], "Orbit X");
|
||||
openspace.navigation.bindJoystickAxis(controller.LeftThumbStick[2], "Orbit Y", true);
|
||||
openspace.navigation.bindJoystickAxis(controller.RightThumbStick[1], "Pan X", true);
|
||||
openspace.navigation.bindJoystickAxis(controller.RightThumbStick[2], "Pan Y");
|
||||
openspace.navigation.bindJoystickAxis(controller.RightThumbStick[2], "Pan Y", true);
|
||||
openspace.navigation.bindJoystickAxis(controller.LeftTrigger, "Zoom Out", false, true);
|
||||
openspace.navigation.bindJoystickAxis(controller.RightTrigger, "Zoom In", false, true);
|
||||
|
||||
|
||||
@@ -19,6 +19,7 @@ asset.require('scene/solarsystem/missions/voyager/voyager2')
|
||||
-- Load default key bindings applicable to most scenes
|
||||
asset.require('util/default_keybindings')
|
||||
asset.require('util/default_dashboard')
|
||||
asset.require('util/default_joystick')
|
||||
|
||||
local VoyagerAsset = asset.require('scene/solarsystem/missions/voyager/voyager1')
|
||||
|
||||
|
||||
+1
-1
Submodule ext/ghoul updated: 12181ef500...d79383f035
+1
-1
Submodule ext/sgct updated: adde6768da...6a344742d7
@@ -31,9 +31,9 @@
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
namespace openspace {
|
||||
namespace openspace::documentation { struct Documentation; }
|
||||
|
||||
namespace documentation { struct Documentation; }
|
||||
namespace openspace::configuration {
|
||||
|
||||
struct Configuration {
|
||||
std::string windowConfiguration = "${CONFIG}/single.xml";
|
||||
@@ -46,8 +46,6 @@ struct Configuration {
|
||||
|
||||
struct Logging {
|
||||
std::string level = "Info";
|
||||
std::string directory = "${BASE}";
|
||||
std::string performancePrefix = "PM-";
|
||||
bool forceImmediateFlush = false;
|
||||
std::string capabilitiesVerbosity = "Default";
|
||||
std::vector<ghoul::Dictionary> logs;
|
||||
@@ -134,6 +132,6 @@ Configuration loadConfigurationFromFile(const std::string& filename);
|
||||
|
||||
void parseLuaState(Configuration& configuration);
|
||||
|
||||
} // namespace openspace
|
||||
} // namespace openspace::configuration
|
||||
|
||||
#endif // __OPENSPACE_CORE___CONFIGURATION___H__
|
||||
|
||||
@@ -0,0 +1,142 @@
|
||||
/*****************************************************************************************
|
||||
* *
|
||||
* OpenSpace *
|
||||
* *
|
||||
* Copyright (c) 2014-2018 *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy of this *
|
||||
* software and associated documentation files (the "Software"), to deal in the Software *
|
||||
* without restriction, including without limitation the rights to use, copy, modify, *
|
||||
* merge, publish, distribute, sublicense, and/or sell copies of the Software, and to *
|
||||
* permit persons to whom the Software is furnished to do so, subject to the following *
|
||||
* conditions: *
|
||||
* *
|
||||
* The above copyright notice and this permission notice shall be included in all copies *
|
||||
* or substantial portions of the Software. *
|
||||
* *
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, *
|
||||
* INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A *
|
||||
* PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT *
|
||||
* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF *
|
||||
* CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE *
|
||||
* OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. *
|
||||
****************************************************************************************/
|
||||
|
||||
#ifndef __OPENSPACE_CORE___GLOBALS___H__
|
||||
#define __OPENSPACE_CORE___GLOBALS___H__
|
||||
|
||||
#include <functional>
|
||||
#include <memory>
|
||||
#include <vector>
|
||||
|
||||
namespace ghoul::fontrendering { class FontManager; }
|
||||
|
||||
namespace openspace {
|
||||
|
||||
class Dashboard;
|
||||
class DeferredcasterManager;
|
||||
class DownloadManager;
|
||||
class LuaConsole;
|
||||
class MissionManager;
|
||||
class ModuleEngine;
|
||||
class NetworkEngine;
|
||||
class OpenSpaceEngine;
|
||||
class ParallelPeer;
|
||||
class RaycasterManager;
|
||||
class RenderEngine;
|
||||
class ScreenSpaceRenderable;
|
||||
class SyncEngine;
|
||||
class TimeManager;
|
||||
class VirtualPropertyManager;
|
||||
struct WindowDelegate;
|
||||
namespace configuration { struct Configuration; }
|
||||
namespace interaction {
|
||||
struct JoystickInputStates;
|
||||
struct WebsocketInputStates;
|
||||
class KeybindingManager;
|
||||
class NavigationHandler;
|
||||
} // namespace interaction
|
||||
namespace performance { class PerformanceManager; }
|
||||
namespace properties { class PropertyOwner; }
|
||||
namespace scripting {
|
||||
class ScriptEngine;
|
||||
class ScriptScheduler;
|
||||
} // namespace scripting
|
||||
|
||||
namespace global {
|
||||
|
||||
namespace detail {
|
||||
|
||||
ghoul::fontrendering::FontManager& gFontManager();
|
||||
Dashboard& gDashboard();
|
||||
DeferredcasterManager& gDeferredcasterManager();
|
||||
DownloadManager& gDownloadManager();
|
||||
LuaConsole& gLuaConsole();
|
||||
MissionManager& gMissionManager();
|
||||
ModuleEngine& gModuleEngine();
|
||||
NetworkEngine& gNetworkEngine();
|
||||
OpenSpaceEngine& gOpenSpaceEngine();
|
||||
ParallelPeer& gParallelPeer();
|
||||
RaycasterManager& gRaycasterManager();
|
||||
RenderEngine& gRenderEngine();
|
||||
std::vector<std::unique_ptr<ScreenSpaceRenderable>>& gScreenspaceRenderables();
|
||||
SyncEngine& gSyncEngine();
|
||||
TimeManager& gTimeManager();
|
||||
VirtualPropertyManager& gVirtualPropertyManager();
|
||||
WindowDelegate& gWindowDelegate();
|
||||
configuration::Configuration& gConfiguration();
|
||||
interaction::JoystickInputStates& gJoystickInputStates();
|
||||
interaction::WebsocketInputStates& gWebsocketInputStates();
|
||||
interaction::KeybindingManager& gKeybindingManager();
|
||||
interaction::NavigationHandler& gNavigationHandler();
|
||||
performance::PerformanceManager& gPerformanceManager();
|
||||
properties::PropertyOwner& gRootPropertyOwner();
|
||||
properties::PropertyOwner& gScreenSpaceRootPropertyOwner();
|
||||
scripting::ScriptEngine& gScriptEngine();
|
||||
scripting::ScriptScheduler& gScriptScheduler();
|
||||
|
||||
} // 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 MissionManager& missionManager = detail::gMissionManager();
|
||||
static ModuleEngine& moduleEngine = detail::gModuleEngine();
|
||||
static NetworkEngine& networkEngine = detail::gNetworkEngine();
|
||||
static OpenSpaceEngine& openSpaceEngine = detail::gOpenSpaceEngine();
|
||||
static ParallelPeer& parallelPeer = detail::gParallelPeer();
|
||||
static RaycasterManager& raycasterManager = detail::gRaycasterManager();
|
||||
static RenderEngine& renderEngine = detail::gRenderEngine();
|
||||
static std::vector<std::unique_ptr<ScreenSpaceRenderable>>& screenSpaceRenderables =
|
||||
detail::gScreenspaceRenderables();
|
||||
static SyncEngine& syncEngine = detail::gSyncEngine();
|
||||
static TimeManager& timeManager = detail::gTimeManager();
|
||||
static VirtualPropertyManager& virtualPropertyManager = detail::gVirtualPropertyManager();
|
||||
static WindowDelegate& windowDelegate = detail::gWindowDelegate();
|
||||
static configuration::Configuration& configuration = detail::gConfiguration();
|
||||
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 performance::PerformanceManager& performanceManager =
|
||||
detail::gPerformanceManager();
|
||||
static properties::PropertyOwner& rootPropertyOwner = detail::gRootPropertyOwner();
|
||||
static properties::PropertyOwner& screenSpaceRootPropertyOwner =
|
||||
detail::gScreenSpaceRootPropertyOwner();
|
||||
static scripting::ScriptEngine& scriptEngine = detail::gScriptEngine();
|
||||
static scripting::ScriptScheduler& scriptScheduler = detail::gScriptScheduler();
|
||||
|
||||
void initialize();
|
||||
void initializeGL();
|
||||
void deinitialize();
|
||||
void deinitializeGL();
|
||||
|
||||
} // namespace global
|
||||
|
||||
} // namespace openspace
|
||||
|
||||
#endif // __OPENSPACE_CORE___GLOBALS___H__
|
||||
@@ -0,0 +1,84 @@
|
||||
/*****************************************************************************************
|
||||
* *
|
||||
* OpenSpace *
|
||||
* *
|
||||
* Copyright (c) 2014-2018 *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy of this *
|
||||
* software and associated documentation files (the "Software"), to deal in the Software *
|
||||
* without restriction, including without limitation the rights to use, copy, modify, *
|
||||
* merge, publish, distribute, sublicense, and/or sell copies of the Software, and to *
|
||||
* permit persons to whom the Software is furnished to do so, subject to the following *
|
||||
* conditions: *
|
||||
* *
|
||||
* The above copyright notice and this permission notice shall be included in all copies *
|
||||
* or substantial portions of the Software. *
|
||||
* *
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, *
|
||||
* INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A *
|
||||
* PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT *
|
||||
* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF *
|
||||
* CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE *
|
||||
* OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. *
|
||||
****************************************************************************************/
|
||||
|
||||
#ifndef __OPENSPACE_CORE___GLOBALSCALLBACKS___H__
|
||||
#define __OPENSPACE_CORE___GLOBALSCALLBACKS___H__
|
||||
|
||||
#include <openspace/util/keys.h>
|
||||
#include <openspace/util/mouse.h>
|
||||
#include <functional>
|
||||
#include <vector>
|
||||
|
||||
namespace openspace::global {
|
||||
|
||||
namespace detail {
|
||||
|
||||
std::vector<std::function<void()>>& gInitialize();
|
||||
std::vector<std::function<void()>>& gDeinitialize();
|
||||
|
||||
std::vector<std::function<void()>>& gInitializeGL();
|
||||
std::vector<std::function<void()>>& gDeinitializeGL();
|
||||
|
||||
std::vector<std::function<void()>>& gPreSync();
|
||||
std::vector<std::function<void()>>& gPostSyncPreDraw();
|
||||
std::vector<std::function<void()>>& gRender();
|
||||
std::vector<std::function<void()>>& gDraw2D();
|
||||
std::vector<std::function<void()>>& gPostDraw();
|
||||
|
||||
std::vector<std::function<bool(Key, KeyModifier, KeyAction)>>& gKeyboard();
|
||||
std::vector<std::function<bool(unsigned int, KeyModifier)>>& gCharacter();
|
||||
|
||||
std::vector<std::function<bool(MouseButton, MouseAction)>>& gMouseButton();
|
||||
std::vector<std::function<void(double, double)>>& gMousePosition();
|
||||
std::vector<std::function<bool(double, double)>>& gMouseScrollWheel();
|
||||
|
||||
} // namespace detail
|
||||
|
||||
namespace callback {
|
||||
|
||||
static std::vector<std::function<void()>>& initialize = detail::gInitialize();
|
||||
static std::vector<std::function<void()>>& deinitialize = detail::gDeinitialize();
|
||||
static std::vector<std::function<void()>>& initializeGL = detail::gInitializeGL();
|
||||
static std::vector<std::function<void()>>& deinitializeGL = detail::gDeinitializeGL();
|
||||
static std::vector<std::function<void()>>& preSync = detail::gPreSync();
|
||||
static std::vector<std::function<void()>>& postSyncPreDraw = detail::gPostSyncPreDraw();
|
||||
static std::vector<std::function<void()>>& render = detail::gRender();
|
||||
static std::vector<std::function<void()>>& draw2D = detail::gDraw2D();
|
||||
static std::vector<std::function<void()>>& postDraw = detail::gPostDraw();
|
||||
static std::vector<std::function<bool(Key, KeyModifier, KeyAction)>>& keyboard =
|
||||
detail::gKeyboard();
|
||||
static std::vector<std::function<bool(unsigned int, KeyModifier)>>& character =
|
||||
detail::gCharacter();
|
||||
static std::vector<std::function<bool(MouseButton, MouseAction)>>& mouseButton =
|
||||
detail::gMouseButton();
|
||||
static std::vector<std::function<void(double, double)>>& mousePosition =
|
||||
detail::gMousePosition();
|
||||
static std::vector<std::function<bool(double, double)>>& mouseScrollWheel =
|
||||
detail::gMouseScrollWheel();
|
||||
|
||||
} // namespace callback
|
||||
|
||||
} // namespace openspace::global
|
||||
|
||||
#endif // __OPENSPACE_CORE___GLOBALSCALLBACKS___H__
|
||||
@@ -29,46 +29,17 @@
|
||||
#include <openspace/util/keys.h>
|
||||
#include <openspace/util/mouse.h>
|
||||
#include <ghoul/glm.h>
|
||||
#include <functional>
|
||||
#include <memory>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
namespace ghoul { class Dictionary; }
|
||||
namespace ghoul::cmdparser { class CommandlineParser; }
|
||||
namespace ghoul::fontrendering { class FontManager; }
|
||||
|
||||
namespace openspace {
|
||||
|
||||
class AssetManager;
|
||||
struct Configuration;
|
||||
class Dashboard;
|
||||
class DownloadManager;
|
||||
class GUI;
|
||||
class LoadingScreen;
|
||||
class LuaConsole;
|
||||
class ModuleEngine;
|
||||
class NetworkEngine;
|
||||
class ParallelPeer;
|
||||
class RenderEngine;
|
||||
class Scene;
|
||||
class SyncEngine;
|
||||
class TimeManager;
|
||||
class VirtualPropertyManager;
|
||||
class WindowWrapper;
|
||||
|
||||
namespace interaction {
|
||||
struct JoystickInputStates;
|
||||
class KeyBindingManager;
|
||||
class NavigationHandler;
|
||||
} // namespace interaction
|
||||
namespace gui { class GUI; }
|
||||
namespace properties { class PropertyOwner; }
|
||||
namespace scripting {
|
||||
struct LuaLibrary;
|
||||
class ScriptEngine;
|
||||
class ScriptScheduler;
|
||||
} // namespace scripting
|
||||
namespace scripting { struct LuaLibrary; }
|
||||
|
||||
// Structure that is responsible for the delayed shutdown of the application
|
||||
struct ShutdownInformation {
|
||||
@@ -82,23 +53,20 @@ struct ShutdownInformation {
|
||||
float timer = 0.f;
|
||||
};
|
||||
|
||||
struct CommandlineArguments {
|
||||
std::string configurationName;
|
||||
std::string configurationOverride;
|
||||
};
|
||||
|
||||
class OpenSpaceEngine {
|
||||
public:
|
||||
static void create(int argc, char** argv,
|
||||
std::unique_ptr<WindowWrapper> windowWrapper,
|
||||
std::vector<std::string>& sgctArguments, bool& requestClose,
|
||||
bool consoleLog = true);
|
||||
OpenSpaceEngine();
|
||||
~OpenSpaceEngine();
|
||||
|
||||
static void destroy();
|
||||
static OpenSpaceEngine& ref();
|
||||
static bool isCreated();
|
||||
|
||||
~OpenSpaceEngine() = default;
|
||||
|
||||
// callbacks
|
||||
void initialize();
|
||||
void initializeGL();
|
||||
void deinitialize();
|
||||
void deinitializeGL() {}
|
||||
void preSynchronization();
|
||||
void postSynchronizationPreDraw();
|
||||
void render(const glm::mat4& sceneMatrix, const glm::mat4& viewMatrix,
|
||||
@@ -110,78 +78,16 @@ public:
|
||||
void mouseButtonCallback(MouseButton button, MouseAction action);
|
||||
void mousePositionCallback(double x, double y);
|
||||
void mouseScrollWheelCallback(double posX, double posY);
|
||||
void setJoystickInputStates(interaction::JoystickInputStates& states);
|
||||
void externalControlCallback(const char* receivedChars, int size, int clientId);
|
||||
void encode();
|
||||
void decode();
|
||||
|
||||
|
||||
void scheduleLoadSingleAsset(std::string assetPath);
|
||||
void toggleShutdownMode();
|
||||
|
||||
// On purpose, there is no function that returns a non-const reference to
|
||||
// Configuration; that guards us against anyone in the program changing the
|
||||
// configuration values underneath our feet
|
||||
const Configuration& configuration() const;
|
||||
|
||||
// Guaranteed to return a valid pointer
|
||||
LuaConsole& console();
|
||||
AssetManager& assetManager();
|
||||
Dashboard& dashboard();
|
||||
DownloadManager& downloadManager();
|
||||
ModuleEngine& moduleEngine();
|
||||
LoadingScreen& loadingScreen();
|
||||
NetworkEngine& networkEngine();
|
||||
ParallelPeer& parallelPeer();
|
||||
RenderEngine& renderEngine();
|
||||
TimeManager& timeManager();
|
||||
WindowWrapper& windowWrapper();
|
||||
ghoul::fontrendering::FontManager& fontManager();
|
||||
interaction::NavigationHandler& navigationHandler();
|
||||
interaction::KeyBindingManager& keyBindingManager();
|
||||
properties::PropertyOwner& rootPropertyOwner();
|
||||
properties::PropertyOwner& globalPropertyOwner();
|
||||
scripting::ScriptEngine& scriptEngine();
|
||||
scripting::ScriptScheduler& scriptScheduler();
|
||||
VirtualPropertyManager& virtualPropertyManager();
|
||||
|
||||
|
||||
// This method is only to be called from Modules
|
||||
enum class CallbackOption {
|
||||
Initialize = 0, // Callback for the end of the initialization
|
||||
Deinitialize, // Callback for the end of the deinitialization
|
||||
InitializeGL, // Callback for the end of the OpenGL initialization
|
||||
DeinitializeGL, // Callback for the end of the OpenGL deinitialization
|
||||
PreSync, // Callback for the end of the pre-sync function
|
||||
PostSyncPreDraw, // Callback for the end of the post-sync-pre-draw function
|
||||
Render, // Callback for the end of the render function
|
||||
Draw2D, // Callback for the two-dimensional rendering functions
|
||||
PostDraw // Callback for the end of the post-draw function
|
||||
};
|
||||
|
||||
// Registers a callback for a specific CallbackOption
|
||||
void registerModuleCallback(CallbackOption option, std::function<void()> function);
|
||||
|
||||
// Registers a callback that is called when a new keyboard event is received
|
||||
void registerModuleKeyboardCallback(
|
||||
std::function<bool (Key, KeyModifier, KeyAction)> function);
|
||||
|
||||
// Registers a callback that is called when a new character event is received
|
||||
void registerModuleCharCallback(
|
||||
std::function<bool (unsigned int, KeyModifier)> function);
|
||||
|
||||
// Registers a callback that is called when a new mouse button is received
|
||||
void registerModuleMouseButtonCallback(
|
||||
std::function<bool (MouseButton, MouseAction)> function);
|
||||
|
||||
// Registers a callback that is called when a new mouse movement is received
|
||||
void registerModuleMousePositionCallback(
|
||||
std::function<void (double, double)> function);
|
||||
|
||||
// Registers a callback that is called when a scroll wheel change is received
|
||||
void registerModuleMouseScrollWheelCallback(
|
||||
std::function<bool (double, double)> function
|
||||
);
|
||||
|
||||
void writeSceneDocumentation();
|
||||
void writeStaticDocumentation();
|
||||
@@ -193,90 +99,26 @@ public:
|
||||
static scripting::LuaLibrary luaLibrary();
|
||||
|
||||
private:
|
||||
OpenSpaceEngine(std::string programName,
|
||||
std::unique_ptr<WindowWrapper> windowWrapper);
|
||||
|
||||
void loadSingleAsset(const std::string& assetPath);
|
||||
void gatherCommandlineArguments();
|
||||
void loadFonts();
|
||||
|
||||
void configureLogging(bool consoleLog);
|
||||
|
||||
void runGlobalCustomizationScripts();
|
||||
void configureLogging();
|
||||
|
||||
std::unique_ptr<Configuration> _configuration;
|
||||
|
||||
// Components
|
||||
std::unique_ptr<Scene> _scene;
|
||||
std::unique_ptr<AssetManager> _assetManager;
|
||||
std::unique_ptr<Dashboard> _dashboard;
|
||||
std::unique_ptr<DownloadManager> _downloadManager;
|
||||
std::unique_ptr<LuaConsole> _console;
|
||||
std::unique_ptr<ModuleEngine> _moduleEngine;
|
||||
std::unique_ptr<NetworkEngine> _networkEngine;
|
||||
std::unique_ptr<ParallelPeer> _parallelPeer;
|
||||
std::unique_ptr<RenderEngine> _renderEngine;
|
||||
std::unique_ptr<SyncEngine> _syncEngine;
|
||||
std::unique_ptr<TimeManager> _timeManager;
|
||||
std::unique_ptr<WindowWrapper> _windowWrapper;
|
||||
std::unique_ptr<ghoul::cmdparser::CommandlineParser> _commandlineParser;
|
||||
std::unique_ptr<ghoul::fontrendering::FontManager> _fontManager;
|
||||
std::unique_ptr<interaction::NavigationHandler> _navigationHandler;
|
||||
std::unique_ptr<interaction::KeyBindingManager> _keyBindingManager;
|
||||
|
||||
std::unique_ptr<scripting::ScriptEngine> _scriptEngine;
|
||||
std::unique_ptr<scripting::ScriptScheduler> _scriptScheduler;
|
||||
std::unique_ptr<VirtualPropertyManager> _virtualPropertyManager;
|
||||
|
||||
// Others
|
||||
std::unique_ptr<properties::PropertyOwner> _rootPropertyOwner;
|
||||
std::unique_ptr<properties::PropertyOwner> _globalPropertyOwner;
|
||||
|
||||
std::unique_ptr<LoadingScreen> _loadingScreen;
|
||||
|
||||
struct {
|
||||
properties::StringProperty versionString;
|
||||
properties::StringProperty sourceControlInformation;
|
||||
} _versionInformation;
|
||||
|
||||
bool _hasScheduledAssetLoading = false;
|
||||
std::string _scheduledAssetPathToLoad;
|
||||
|
||||
struct {
|
||||
std::vector<std::function<void()>> initialize;
|
||||
std::vector<std::function<void()>> deinitialize;
|
||||
|
||||
std::vector<std::function<void()>> initializeGL;
|
||||
std::vector<std::function<void()>> deinitializeGL;
|
||||
|
||||
std::vector<std::function<void()>> preSync;
|
||||
std::vector<std::function<void()>> postSyncPreDraw;
|
||||
std::vector<std::function<void()>> render;
|
||||
std::vector<std::function<void()>> draw2D;
|
||||
std::vector<std::function<void()>> postDraw;
|
||||
|
||||
std::vector<std::function<bool (Key, KeyModifier, KeyAction)>> keyboard;
|
||||
std::vector<std::function<bool (unsigned int, KeyModifier)>> character;
|
||||
|
||||
std::vector<std::function<bool (MouseButton, MouseAction)>> mouseButton;
|
||||
std::vector<std::function<void (double, double)>> mousePosition;
|
||||
std::vector<std::function<bool (double, double)>> mouseScrollWheel;
|
||||
} _moduleCallbacks;
|
||||
|
||||
ShutdownInformation _shutdown;
|
||||
|
||||
// The first frame might take some more time in the update loop, so we need to know to
|
||||
// disable the synchronization; otherwise a hardware sync will kill us after 1 minute
|
||||
bool _isFirstRenderingFirstFrame = true;
|
||||
|
||||
glm::dvec2 _mousePosition;
|
||||
|
||||
static OpenSpaceEngine* _engine;
|
||||
};
|
||||
|
||||
#define OsEng (openspace::OpenSpaceEngine::ref())
|
||||
|
||||
} // namespace openspace
|
||||
|
||||
#endif // __OPENSPACE_CORE___OPENSPACEENGINE___H__
|
||||
|
||||
@@ -0,0 +1,112 @@
|
||||
/*****************************************************************************************
|
||||
* *
|
||||
* OpenSpace *
|
||||
* *
|
||||
* Copyright (c) 2014-2018 *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy of this *
|
||||
* software and associated documentation files (the "Software"), to deal in the Software *
|
||||
* without restriction, including without limitation the rights to use, copy, modify, *
|
||||
* merge, publish, distribute, sublicense, and/or sell copies of the Software, and to *
|
||||
* permit persons to whom the Software is furnished to do so, subject to the following *
|
||||
* conditions: *
|
||||
* *
|
||||
* The above copyright notice and this permission notice shall be included in all copies *
|
||||
* or substantial portions of the Software. *
|
||||
* *
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, *
|
||||
* INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A *
|
||||
* PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT *
|
||||
* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF *
|
||||
* CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE *
|
||||
* OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. *
|
||||
****************************************************************************************/
|
||||
|
||||
#ifndef __OPENSPACE_CORE__WINDOWDELEGATE___H__
|
||||
#define __OPENSPACE_CORE__WINDOWDELEGATE___H__
|
||||
|
||||
#include <ghoul/glm.h>
|
||||
#include <vector>
|
||||
|
||||
namespace openspace {
|
||||
|
||||
struct WindowDelegate {
|
||||
void (*terminate)() = [](){};
|
||||
|
||||
void (*setBarrier)(bool enabled) = [](bool) {};
|
||||
|
||||
void (*setSynchronization)(bool enabled) = [](bool) {};
|
||||
|
||||
void (*clearAllWindows)(const glm::vec4& clearColor) = [](const glm::vec4&) {};
|
||||
|
||||
bool (*windowHasResized)() = []() { return false; };
|
||||
|
||||
double (*averageDeltaTime)() = []() { return 0.0; };
|
||||
|
||||
double (*deltaTime)() = []() { return 0.0; };
|
||||
|
||||
double (*applicationTime)() = []() { return 0.0; };
|
||||
|
||||
glm::vec2 (*mousePosition)() = []() { return glm::vec2(0.f); };
|
||||
|
||||
uint32_t (*mouseButtons)(int maxNumber) = [](int) { return uint32_t(0); };
|
||||
|
||||
glm::ivec2 (*currentWindowSize)() = []() { return glm::ivec2(0); };
|
||||
|
||||
glm::ivec2 (*currentSubwindowSize)() = []() { return glm::ivec2(0); };
|
||||
|
||||
glm::ivec2 (*currentWindowResolution)() = []() { return glm::ivec2(0); };
|
||||
|
||||
glm::ivec2 (*currentDrawBufferResolution)() = []() { return glm::ivec2(0); };
|
||||
|
||||
glm::ivec2 (*currentViewportSize)() = []() { return glm::ivec2(0); };
|
||||
|
||||
glm::vec2 (*dpiScaling)() = []() { return glm::vec2(1.f); };
|
||||
|
||||
int (*currentNumberOfAaSamples)() = []() { return 1; };
|
||||
|
||||
bool (*isRegularRendering)() = []() { return true; };
|
||||
|
||||
bool (*hasGuiWindow)() = []() { return false; };
|
||||
|
||||
bool (*isGuiWindow)() = []() { return false; };
|
||||
|
||||
bool (*isMaster)() = []() { return false; };
|
||||
|
||||
int (*clusterId)() = []() { return 0; };
|
||||
|
||||
bool (*isUsingSwapGroups)() = []() { return false; };
|
||||
|
||||
bool (*isSwapGroupMaster)() = []() { return false; };
|
||||
|
||||
glm::mat4 (*viewProjectionMatrix)() = []() { return glm::mat4(1.f); };
|
||||
|
||||
glm::mat4 (*modelMatrix)() = []() { return glm::mat4(1.f); };
|
||||
|
||||
void (*setNearFarClippingPlane)(float near, float far) = [](float, float) {};
|
||||
|
||||
void (*setEyeSeparationDistance)(float distance) = [](float) {};
|
||||
|
||||
glm::ivec4 (*viewportPixelCoordinates)() = []() { return glm::ivec4(0, 0, 0, 0); };
|
||||
|
||||
bool (*isExternalControlConnected)() = []() { return false; };
|
||||
|
||||
void (*sendMessageToExternalControl)(const std::vector<char>& message) =
|
||||
[](const std::vector<char>&) {};
|
||||
|
||||
bool (*isSimpleRendering)() = []() { return true; };
|
||||
|
||||
bool (*isFisheyeRendering)() = []() { return false; };
|
||||
|
||||
void (*takeScreenshot)(bool applyWarping) = [](bool) { };
|
||||
|
||||
void (*swapBuffer)() = []() {};
|
||||
|
||||
int (*nWindows)() = []() { return 0; };
|
||||
|
||||
int (*currentWindowId)() = []() { return 0; };
|
||||
};
|
||||
|
||||
} // namespace openspace
|
||||
|
||||
#endif // __OPENSPACE_CORE__WINDOWDELEGATE___H__
|
||||
@@ -1,99 +0,0 @@
|
||||
/*****************************************************************************************
|
||||
* *
|
||||
* OpenSpace *
|
||||
* *
|
||||
* Copyright (c) 2014-2018 *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy of this *
|
||||
* software and associated documentation files (the "Software"), to deal in the Software *
|
||||
* without restriction, including without limitation the rights to use, copy, modify, *
|
||||
* merge, publish, distribute, sublicense, and/or sell copies of the Software, and to *
|
||||
* permit persons to whom the Software is furnished to do so, subject to the following *
|
||||
* conditions: *
|
||||
* *
|
||||
* The above copyright notice and this permission notice shall be included in all copies *
|
||||
* or substantial portions of the Software. *
|
||||
* *
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, *
|
||||
* INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A *
|
||||
* PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT *
|
||||
* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF *
|
||||
* CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE *
|
||||
* OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. *
|
||||
****************************************************************************************/
|
||||
|
||||
#ifndef __OPENSPACE_CORE___SGCTWINDOWWRAPPER___H__
|
||||
#define __OPENSPACE_CORE___SGCTWINDOWWRAPPER___H__
|
||||
|
||||
#include <openspace/engine/wrapper/windowwrapper.h>
|
||||
|
||||
#include <openspace/properties/scalar/boolproperty.h>
|
||||
#include <openspace/properties/scalar/floatproperty.h>
|
||||
|
||||
namespace openspace {
|
||||
|
||||
/**
|
||||
* WindowWrapper subclass wrapping the Simple Graphics Cluster Toolkit, forwarding all
|
||||
* method calls to the specific functions in the Engine and SGCTWindow classes.
|
||||
*
|
||||
* \sa https://c-student.itn.liu.se/wiki/develop:sgct:sgct
|
||||
*/
|
||||
class SGCTWindowWrapper : public WindowWrapper {
|
||||
public:
|
||||
SGCTWindowWrapper();
|
||||
|
||||
void terminate() override;
|
||||
void setBarrier(bool enabled) override;
|
||||
void setSynchronization(bool enabled) override;
|
||||
void clearAllWindows(const glm::vec4& clearColor) override;
|
||||
bool windowHasResized() const override;
|
||||
|
||||
double averageDeltaTime() const override;
|
||||
double deltaTime() const override;
|
||||
double applicationTime() const override;
|
||||
glm::vec2 mousePosition() const override;
|
||||
uint32_t mouseButtons(int maxNumber) const override;
|
||||
glm::ivec2 currentWindowSize() const override;
|
||||
glm::ivec2 currentSubwindowSize() const override;
|
||||
glm::ivec2 currentWindowResolution() const override;
|
||||
glm::ivec2 currentDrawBufferResolution() const override;
|
||||
glm::ivec2 getCurrentViewportSize() const override;
|
||||
glm::vec2 dpiScaling() const override;
|
||||
int currentNumberOfAaSamples() const override;
|
||||
|
||||
bool isRegularRendering() const override;
|
||||
bool hasGuiWindow() const override;
|
||||
bool isGuiWindow() const override;
|
||||
bool isMaster() const override;
|
||||
int clusterId() const override;
|
||||
bool isUsingSwapGroups() const override;
|
||||
bool isSwapGroupMaster() const override;
|
||||
|
||||
glm::mat4 viewProjectionMatrix() const override;
|
||||
glm::mat4 modelMatrix() const override;
|
||||
void setNearFarClippingPlane(float nearPlane, float farPlane) override;
|
||||
void setEyeSeparationDistance(float distance) override;
|
||||
|
||||
glm::ivec4 viewportPixelCoordinates() const override;
|
||||
|
||||
bool isExternalControlConnected() const override;
|
||||
void sendMessageToExternalControl(const std::vector<char>& message) const override;
|
||||
|
||||
bool isSimpleRendering() const override;
|
||||
bool isFisheyeRendering() const override;
|
||||
|
||||
void takeScreenshot(bool applyWarping = false) const override;
|
||||
|
||||
void swapBuffer() const override;
|
||||
|
||||
int nWindows() const override;
|
||||
int currentWindowId() const override;
|
||||
|
||||
private:
|
||||
properties::FloatProperty _eyeSeparation;
|
||||
properties::BoolProperty _showStatsGraph;
|
||||
};
|
||||
|
||||
} // namespace openspace
|
||||
|
||||
#endif // __OPENSPACE_CORE___SGCTWINDOWWRAPPER___H__
|
||||
@@ -1,322 +0,0 @@
|
||||
/*****************************************************************************************
|
||||
* *
|
||||
* OpenSpace *
|
||||
* *
|
||||
* Copyright (c) 2014-2018 *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy of this *
|
||||
* software and associated documentation files (the "Software"), to deal in the Software *
|
||||
* without restriction, including without limitation the rights to use, copy, modify, *
|
||||
* merge, publish, distribute, sublicense, and/or sell copies of the Software, and to *
|
||||
* permit persons to whom the Software is furnished to do so, subject to the following *
|
||||
* conditions: *
|
||||
* *
|
||||
* The above copyright notice and this permission notice shall be included in all copies *
|
||||
* or substantial portions of the Software. *
|
||||
* *
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, *
|
||||
* INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A *
|
||||
* PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT *
|
||||
* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF *
|
||||
* CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE *
|
||||
* OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. *
|
||||
****************************************************************************************/
|
||||
|
||||
#ifndef __OPENSPACE_CORE___WINDOWWRAPPER___H__
|
||||
#define __OPENSPACE_CORE___WINDOWWRAPPER___H__
|
||||
|
||||
#include <openspace/properties/propertyowner.h>
|
||||
|
||||
#include <ghoul/glm.h>
|
||||
#include <ghoul/misc/exception.h>
|
||||
|
||||
namespace openspace {
|
||||
|
||||
namespace scripting { struct LuaLibrary; }
|
||||
|
||||
/**
|
||||
* A WindowWrapper is a class that handles the abstraction between OpenSpace and a
|
||||
* specific window creation framework.<br>
|
||||
* Every new windowing framework needs to have its own WindowWrapper subclass exposing the
|
||||
* required features.
|
||||
*/
|
||||
class WindowWrapper : public properties::PropertyOwner {
|
||||
public:
|
||||
/// Default constructor
|
||||
WindowWrapper();
|
||||
|
||||
/**
|
||||
* Returns the Lua library that contains all Lua functions available to affect the
|
||||
* windowing system.
|
||||
*/
|
||||
static scripting::LuaLibrary luaLibrary();
|
||||
|
||||
/**
|
||||
* This method closes the application by calling the necessary terminate function of
|
||||
* the window management system
|
||||
*/
|
||||
virtual void terminate();
|
||||
|
||||
/**
|
||||
* This method enables or disables a framelock barrier. If the specific windowing
|
||||
* framework does not provide a framelock, this method defaults to a no-op.
|
||||
* \param enabled If <code>true</code> the framelock is enabled, <code>false</code>
|
||||
* disables it
|
||||
*/
|
||||
virtual void setBarrier(bool enabled);
|
||||
|
||||
/**
|
||||
* This method enables or disables a framelock barrier. If the specific windowing
|
||||
* framework does not provide a framelock, this method defaults to a no-op.
|
||||
* \param enabled If <code>true</code> the framelock is enabled, <code>false</code>
|
||||
* disables it
|
||||
*/
|
||||
virtual void setSynchronization(bool enabled);
|
||||
|
||||
/**
|
||||
* This method clears all the rendering windows with the specified \p clearColor. In
|
||||
* most OpenGL cases, this will end up with one or mode <code>glClear</code> calls.
|
||||
* This method defaults to a no-op.
|
||||
* \param clearColor The color with which to clear all windows
|
||||
*/
|
||||
virtual void clearAllWindows(const glm::vec4& clearColor);
|
||||
|
||||
/**
|
||||
* Returns whether the current window has been resized recently. On default, this
|
||||
* method always returns <code>false</code>.
|
||||
* \return <code>true</code> if the current window has been resized recently,
|
||||
* <code>false</code> otherwise
|
||||
*/
|
||||
virtual bool windowHasResized() const;
|
||||
|
||||
/**
|
||||
* Returns the average frametime in seconds. On default, this method returns
|
||||
* <code>0.0</code>.
|
||||
* \return The average frametime in seconds
|
||||
*/
|
||||
virtual double averageDeltaTime() const;
|
||||
|
||||
/**
|
||||
* Returns the frametime in seconds. On default, this method returns <code>0.0</code>.
|
||||
* \return The frametime in seconds
|
||||
*/
|
||||
virtual double deltaTime() const;
|
||||
|
||||
/**
|
||||
* Returns the time that has passed (in seconds) since application start
|
||||
* \return The time that has passed (in seconds) since application start
|
||||
* @return [description]
|
||||
*/
|
||||
virtual double applicationTime() const;
|
||||
|
||||
/**
|
||||
* Returns the location of the mouse cursor in pixel screen coordinates. On default,
|
||||
* this method returns <code>0,0</code>.
|
||||
* \return The location of the mouse cursor in pixel screen coordinates
|
||||
*/
|
||||
virtual glm::vec2 mousePosition() const;
|
||||
|
||||
/**
|
||||
* Returns a bitmask of the status of all available mouse buttons. Bit <code>i</code>
|
||||
* is <code>1</code> if mouse button <code>i</code> is pressed down;
|
||||
* <code>false</code> otherwise. On default, this method returns that none of the
|
||||
* buttons is pressed.
|
||||
* \param maxNumber The maximum number of mouse buttons that should be queried
|
||||
* \return A bitmask showing the status of all mouse buttons (up to \p maxNumber)
|
||||
*/
|
||||
virtual uint32_t mouseButtons(int maxNumber = 8) const;
|
||||
|
||||
/**
|
||||
* Returns the size of the currently active window in pixel coordinates. On default,
|
||||
* this method returns a window size of <code>0,0</code>.
|
||||
* \return The size of the currently active window in pixel coordinates
|
||||
*/
|
||||
virtual glm::ivec2 currentWindowSize() const;
|
||||
|
||||
/**
|
||||
* Returns the size of the currently active subwindow in pixel coordinates. On default,
|
||||
* this method returns the same a currentWindowSize. A subwindow is the part of a
|
||||
* window that is used for one of the eyes in stereoscopic side-by-side/top-bottom
|
||||
* rendering.
|
||||
* \return The size of the currently active subwindow in pixel coordinates
|
||||
*/
|
||||
virtual glm::ivec2 currentSubwindowSize() const;
|
||||
|
||||
/**
|
||||
* Returns the resolution of the currently active window in pixel coordinates. On
|
||||
* default, this method returns the same size as #currentWindowSize.
|
||||
* \return The resolution of the currently active window in pixel coordinates
|
||||
*/
|
||||
virtual glm::ivec2 currentWindowResolution() const;
|
||||
|
||||
/**
|
||||
* Returns the resolution of the currently active framebuffer in pixel coordinates.
|
||||
* On default, this method returns the same size as #currentWindowSize.
|
||||
* \return The resolution of the currently active window in pixel coordinates
|
||||
*/
|
||||
virtual glm::ivec2 currentDrawBufferResolution() const;
|
||||
|
||||
/**
|
||||
* Returns the resolution of the currently viewport resolution in pixel
|
||||
* coordinates.
|
||||
* \return The resolution of the currently viewport in pixel coordinates
|
||||
*/
|
||||
virtual glm::ivec2 getCurrentViewportSize() const;
|
||||
|
||||
/**
|
||||
* Returns the DPI scaling factor for the current window. This is normally 1 on all
|
||||
* regular monitors and 2 on Retina screens.
|
||||
* \return The DPI scaling factor for the current window
|
||||
*/
|
||||
virtual glm::vec2 dpiScaling() const;
|
||||
|
||||
/**
|
||||
* Returns the number of anti-aliasing samples used in the current window.
|
||||
*/
|
||||
virtual int currentNumberOfAaSamples() const;
|
||||
|
||||
/**
|
||||
* Returns <code>true</code> if the current rendering method is regular, i.e., it is
|
||||
* a flat projection without non-linear distortions. Returns <code>false</code> in
|
||||
* other cases, for example fisheye projections. On default, this method will return
|
||||
* <code>true</code>.
|
||||
* \return Whether the current rendering method is a regular method
|
||||
*/
|
||||
virtual bool isRegularRendering() const;
|
||||
|
||||
/**
|
||||
* Returns <code>true</code> if there is a dedicated GUI window. In these cases, the
|
||||
* GUI elements will not be drawn on the non-GUI windows but only on the dedicated
|
||||
* windows.
|
||||
* \return Whether there are dedicated GUI windows
|
||||
*/
|
||||
virtual bool hasGuiWindow() const;
|
||||
|
||||
/**
|
||||
* Returns <code>true</code> if the current rendering window is a GUI-only window. In
|
||||
* these cases, the regular rendering is suppressed, but input is still possible in
|
||||
* the window
|
||||
* \return Whether the current rendering window is GUI-only
|
||||
*/
|
||||
virtual bool isGuiWindow() const;
|
||||
|
||||
/**
|
||||
* Returns <code>true</code> if this application is the master for a clustered
|
||||
* environment.
|
||||
* \return Whether this applicaiton is the master for a clustered environment.
|
||||
*/
|
||||
virtual bool isMaster() const;
|
||||
|
||||
/**
|
||||
* Returns the unique identifier of this OpenSpace instance within the current cluster
|
||||
* configuration. If this instance is not part of a cluster, this value is always 0.
|
||||
* \return The cluster identifier of this OpenSpace instance
|
||||
*/
|
||||
virtual int clusterId() const;
|
||||
|
||||
/**
|
||||
* Returns <code>true</code> if the current rendering window is using swap groups.
|
||||
*/
|
||||
virtual bool isUsingSwapGroups() const;
|
||||
|
||||
/**
|
||||
* Returns <code>true</code> if the current rendering window is master of the swap its
|
||||
* group.
|
||||
*/
|
||||
virtual bool isSwapGroupMaster() const;
|
||||
|
||||
/**
|
||||
* Returns the currently employed view-projection matrix. On default, this method will
|
||||
* return the identity matrix.
|
||||
* \return The currently employed view-projection matrix
|
||||
*/
|
||||
virtual glm::mat4 viewProjectionMatrix() const;
|
||||
|
||||
/**
|
||||
* Returns the currently employed model matrix. On default, this method will return
|
||||
* the identity matrix.
|
||||
* \return The currently employed model matrix
|
||||
*/
|
||||
virtual glm::mat4 modelMatrix() const;
|
||||
|
||||
/**
|
||||
* Sets the near and far clipping planes of the rendering window. This method defaults
|
||||
* to a no-op.
|
||||
* \param near The near clipping plane
|
||||
* \param far The far clipping plane
|
||||
*/
|
||||
virtual void setNearFarClippingPlane(float near, float far);
|
||||
|
||||
/**
|
||||
* Sets the stereo eye separation distance for the render engine.
|
||||
* \param distance The distance between eyes for stereo rendering.
|
||||
*/
|
||||
virtual void setEyeSeparationDistance(float distance);
|
||||
|
||||
/**
|
||||
* Returns the location and size of the current viewport (<code>x</code>,
|
||||
* <code>width</code>, <code>y</code>, and <code>height</code>). If there is only a
|
||||
* single viewport, <code>x</code> and <code>y</code> are <code>0</code> whereas
|
||||
* <code>width</code> and <code>height</code> are equal to #currentWindowResolution.
|
||||
* \return The location and size of the current viewport
|
||||
*/
|
||||
virtual glm::ivec4 viewportPixelCoordinates() const;
|
||||
|
||||
/**
|
||||
* Returns <code>true</code> if there is an external control connected, i.e., an
|
||||
* application that can receive control commands. On default, this method will return
|
||||
* <code>false</code>.
|
||||
* \return If there is an external control connected
|
||||
*/
|
||||
virtual bool isExternalControlConnected() const;
|
||||
|
||||
/**
|
||||
* Sends a \p message to an external control. This method defaults to a no-op.
|
||||
* \param message The message to be sent
|
||||
*/
|
||||
virtual void sendMessageToExternalControl(const std::vector<char>& message) const;
|
||||
|
||||
/**
|
||||
* Returns <code>true</code> if the rendering is a single viewport with an single
|
||||
* window; <code>false</code> otherwise. On default, this method returns
|
||||
* <code>true</code>
|
||||
* \returns <code>true</code> if the rendering is a single viewport with an single
|
||||
* widnow; <code>false</code> otherwise
|
||||
*/
|
||||
virtual bool isSimpleRendering() const;
|
||||
|
||||
/**
|
||||
* Returns <code>true</code> if the rendering is being done using a Fisheye lens;
|
||||
* <code>false</code> otherwise. On default, this method returns
|
||||
* <code>false</code>
|
||||
*/
|
||||
virtual bool isFisheyeRendering() const;
|
||||
|
||||
/**
|
||||
* Advises the windowing system to take a screenshot. This method defaults to a no-op.
|
||||
*/
|
||||
virtual void takeScreenshot(bool applyWarping = false) const;
|
||||
|
||||
/**
|
||||
* Encourages the windowing system to swap the back- and front buffers
|
||||
*/
|
||||
virtual void swapBuffer() const;
|
||||
|
||||
/**
|
||||
* Returns the number of windows that are currently instantiated
|
||||
*/
|
||||
virtual int nWindows() const;
|
||||
|
||||
/**
|
||||
* Returns the id of the current window (in the range [0, nWindows -1])
|
||||
*/
|
||||
virtual int currentWindowId() const;
|
||||
|
||||
struct WindowWrapperException : public ghoul::RuntimeError {
|
||||
explicit WindowWrapperException(const std::string& msg);
|
||||
};
|
||||
};
|
||||
|
||||
} // namespace openspace
|
||||
|
||||
#endif // __OPENSPACE_CORE___WINDOWWRAPPER___H__
|
||||
@@ -45,12 +45,6 @@ public:
|
||||
void mousePositionCallback(double mouseX, double mouseY);
|
||||
void mouseScrollWheelCallback(double mouseScrollDelta);
|
||||
|
||||
void setJoystickInputStates(JoystickInputStates& states);
|
||||
void setWebsocketInputStates(WebsocketInputStates& states);
|
||||
void addWebsocketInputState(size_t id, WebsocketInputState& states);
|
||||
void removeWebsocketInputState(size_t id);
|
||||
|
||||
|
||||
// Accessors
|
||||
const std::vector<std::pair<Key, KeyModifier>>& pressedKeys() const;
|
||||
bool isKeyPressed(std::pair<Key, KeyModifier> keyModPair) const;
|
||||
@@ -61,7 +55,6 @@ public:
|
||||
double mouseScrollDelta() const;
|
||||
bool isMouseButtonPressed(MouseButton mouseButton) const;
|
||||
|
||||
const JoystickInputStates& joystickInputStates() const;
|
||||
float joystickAxis(int i) const;
|
||||
bool joystickButton(int i) const;
|
||||
|
||||
@@ -79,14 +72,6 @@ private:
|
||||
std::vector<MouseButton> _mouseButtonsDown;
|
||||
glm::dvec2 _mousePosition;
|
||||
double _mouseScrollDelta;
|
||||
|
||||
// Input from joysticks
|
||||
// The memory is owned by the outer most main (apps/OpenSpace/main.cpp right now)
|
||||
JoystickInputStates* _joystickInputStates = nullptr;
|
||||
|
||||
// Input from websockets
|
||||
WebsocketInputStates* _websocketInputStates = nullptr;
|
||||
WebsocketInputStates _websocketInputs;
|
||||
};
|
||||
|
||||
} // namespace openspace::interaction
|
||||
|
||||
@@ -39,7 +39,7 @@ namespace openspace::scripting { struct LuaLibrary; }
|
||||
|
||||
namespace openspace::interaction {
|
||||
|
||||
class KeyBindingManager : public DocumentationGenerator {
|
||||
class KeybindingManager : public DocumentationGenerator {
|
||||
public:
|
||||
BooleanType(IsLocalBind);
|
||||
BooleanType(IsSynchronized);
|
||||
@@ -50,7 +50,7 @@ public:
|
||||
std::string documentation;
|
||||
};
|
||||
|
||||
KeyBindingManager();
|
||||
KeybindingManager();
|
||||
|
||||
void resetKeyBindings();
|
||||
|
||||
|
||||
@@ -82,8 +82,6 @@ public:
|
||||
void mousePositionCallback(double x, double y);
|
||||
void mouseScrollWheelCallback(double pos);
|
||||
|
||||
void setJoystickInputStates(JoystickInputStates& states);
|
||||
|
||||
void setJoystickAxisMapping(int axis, JoystickCameraStates::AxisType mapping,
|
||||
JoystickCameraStates::AxisInvert shouldInvert =
|
||||
JoystickCameraStates::AxisInvert::No,
|
||||
@@ -104,9 +102,6 @@ public:
|
||||
|
||||
|
||||
// Websockets
|
||||
void setWebsocketInputStates(WebsocketInputStates& states);
|
||||
void addWebsocketInputState(size_t id, WebsocketInputState& state);
|
||||
void removeWebsocketInputState(size_t id);
|
||||
void setWebsocketAxisMapping(int axis, WebsocketCameraStates::AxisType mapping,
|
||||
WebsocketCameraStates::AxisInvert shouldInvert =
|
||||
WebsocketCameraStates::AxisInvert::No,
|
||||
|
||||
@@ -37,9 +37,9 @@ namespace openspace {
|
||||
namespace scripting { struct LuaLibrary; }
|
||||
|
||||
/**
|
||||
* Singleton class keeping track of space missions.
|
||||
*/
|
||||
class MissionManager : public ghoul::Singleton<MissionManager> {
|
||||
* Class keeping track of space missions.
|
||||
*/
|
||||
class MissionManager {
|
||||
public:
|
||||
struct MissionManagerException : public ghoul::RuntimeError {
|
||||
explicit MissionManagerException(std::string error);
|
||||
|
||||
@@ -42,11 +42,11 @@ public:
|
||||
static void CreateGlobalSharedMemory();
|
||||
static void DestroyGlobalSharedMemory();
|
||||
|
||||
PerformanceManager(std::string loggingDirectory = "${BASE}",
|
||||
std::string prefix = "PM-");
|
||||
|
||||
~PerformanceManager();
|
||||
|
||||
void setEnabled(bool enabled);
|
||||
bool isEnabled() const;
|
||||
|
||||
void resetPerformanceMeasurements();
|
||||
|
||||
void storeIndividualPerformanceMeasurement(const std::string& identifier,
|
||||
@@ -74,6 +74,7 @@ public:
|
||||
PerformanceLayout* performanceData();
|
||||
|
||||
private:
|
||||
bool _performanceMeasurementEnabled = false;
|
||||
bool _loggingEnabled = false;
|
||||
|
||||
std::string _logDir;
|
||||
|
||||
@@ -25,8 +25,6 @@
|
||||
#ifndef __OPENSPACE_CORE___PERFORMANCEMEASUREMENT___H__
|
||||
#define __OPENSPACE_CORE___PERFORMANCEMEASUREMENT___H__
|
||||
|
||||
#include <openspace/engine/openspaceengine.h>
|
||||
#include <openspace/rendering/renderengine.h>
|
||||
#include <chrono>
|
||||
#include <string>
|
||||
|
||||
@@ -36,14 +34,11 @@ class PerformanceManager;
|
||||
|
||||
class PerformanceMeasurement {
|
||||
public:
|
||||
PerformanceMeasurement(std::string identifier,
|
||||
std::shared_ptr<performance::PerformanceManager> manager);
|
||||
PerformanceMeasurement(std::string identifier);
|
||||
~PerformanceMeasurement();
|
||||
|
||||
private:
|
||||
std::string _identifier;
|
||||
std::weak_ptr<performance::PerformanceManager> _manager;
|
||||
|
||||
std::chrono::high_resolution_clock::time_point _startTime;
|
||||
};
|
||||
|
||||
@@ -51,12 +46,9 @@ private:
|
||||
#define __LABEL_PerfMeasure(a) __MERGE_PerfMeasure(unique_name_, a)
|
||||
|
||||
/// Declare a new variable for measuring the performance of the current block
|
||||
#define PerfMeasure(name) \
|
||||
auto __LABEL_PerfMeasure(__LINE__) = \
|
||||
openspace::performance::PerformanceMeasurement(\
|
||||
(name), \
|
||||
OsEng.renderEngine().performanceManager() \
|
||||
)
|
||||
#define PerfMeasure(name) \
|
||||
auto __LABEL_PerfMeasure(__LINE__) = \
|
||||
openspace::performance::PerformanceMeasurement((name))
|
||||
|
||||
} // namespace openspace::performance
|
||||
|
||||
|
||||
@@ -76,8 +76,7 @@ public:
|
||||
void postRaycast(const RaycasterTask& raycasterTask);
|
||||
|
||||
void update() override;
|
||||
void render(Scene* scene, Camera* camera, float blackoutFactor,
|
||||
bool doPerformanceMeasurements) override;
|
||||
void render(Scene* scene, Camera* camera, float blackoutFactor) override;
|
||||
|
||||
/**
|
||||
* Update render data
|
||||
|
||||
@@ -41,6 +41,7 @@ class DashboardItem;
|
||||
class Dashboard : public properties::PropertyOwner {
|
||||
public:
|
||||
Dashboard();
|
||||
~Dashboard();
|
||||
|
||||
void render(glm::vec2& penPosition);
|
||||
|
||||
|
||||
@@ -92,8 +92,7 @@ public:
|
||||
void update() override;
|
||||
void performRaycasterTasks(const std::vector<RaycasterTask>& tasks);
|
||||
void performDeferredTasks(const std::vector<DeferredcasterTask>& tasks);
|
||||
void render(Scene* scene, Camera* camera, float blackoutFactor,
|
||||
bool doPerformanceMeasurements) override;
|
||||
void render(Scene* scene, Camera* camera, float blackoutFactor) override;
|
||||
|
||||
/**
|
||||
* Update render data
|
||||
|
||||
@@ -42,7 +42,6 @@ namespace ghoul::opengl { class ProgramObject; }
|
||||
|
||||
namespace openspace {
|
||||
|
||||
namespace performance { class PerformanceManager; }
|
||||
namespace scripting { struct LuaLibrary; }
|
||||
|
||||
class Camera;
|
||||
@@ -70,7 +69,6 @@ public:
|
||||
|
||||
void initialize();
|
||||
void initializeGL();
|
||||
void deinitialize();
|
||||
void deinitializeGL();
|
||||
|
||||
void setScene(Scene* scene);
|
||||
@@ -79,9 +77,6 @@ public:
|
||||
|
||||
const Renderer& renderer() const;
|
||||
RendererImplementation rendererImplementation() const;
|
||||
RaycasterManager& raycasterManager();
|
||||
DeferredcasterManager& deferredcasterManager();
|
||||
|
||||
|
||||
void updateShaderPrograms();
|
||||
void updateFade();
|
||||
@@ -96,10 +91,6 @@ public:
|
||||
void renderEndscreen();
|
||||
void postDraw();
|
||||
|
||||
// Performance measurements
|
||||
bool doesPerformanceMeasurements() const;
|
||||
std::shared_ptr<performance::PerformanceManager> performanceManager();
|
||||
|
||||
float globalBlackOutFactor();
|
||||
void setGlobalBlackOutFactor(float opacity);
|
||||
|
||||
@@ -161,8 +152,6 @@ public:
|
||||
glm::ivec2 renderingResolution() const;
|
||||
glm::ivec2 fontResolution() const;
|
||||
|
||||
properties::PropertyOwner& screenSpaceOwner();
|
||||
|
||||
private:
|
||||
void setRenderer(std::unique_ptr<Renderer> renderer);
|
||||
RendererImplementation rendererFromString(const std::string& renderingMethod) const;
|
||||
@@ -173,14 +162,10 @@ private:
|
||||
void renderShutdownInformation(float timer, float fullTime);
|
||||
void renderDashboard();
|
||||
|
||||
|
||||
Camera* _camera = nullptr;
|
||||
Scene* _scene = nullptr;
|
||||
std::unique_ptr<RaycasterManager> _raycasterManager;
|
||||
std::unique_ptr<DeferredcasterManager> _deferredcasterManager;
|
||||
|
||||
properties::BoolProperty _doPerformanceMeasurements;
|
||||
std::shared_ptr<performance::PerformanceManager> _performanceManager;
|
||||
|
||||
std::unique_ptr<Renderer> _renderer;
|
||||
RendererImplementation _rendererImplementation = RendererImplementation::Invalid;
|
||||
@@ -212,8 +197,6 @@ private:
|
||||
uint64_t _frameNumber = 0;
|
||||
|
||||
std::vector<ghoul::opengl::ProgramObject*> _programs;
|
||||
properties::PropertyOwner _screenSpaceOwner;
|
||||
std::vector<std::unique_ptr<ScreenSpaceRenderable>> _screenSpaceRenderables;
|
||||
|
||||
std::shared_ptr<ghoul::fontrendering::Font> _fontBig;
|
||||
std::shared_ptr<ghoul::fontrendering::Font> _fontInfo;
|
||||
|
||||
@@ -71,8 +71,7 @@ public:
|
||||
|
||||
virtual void update() = 0;
|
||||
|
||||
virtual void render(Scene* scene, Camera* camera, float blackoutFactor,
|
||||
bool doPerformanceMeasurements) = 0;
|
||||
virtual void render(Scene* scene, Camera* camera, float blackoutFactor) = 0;
|
||||
/**
|
||||
* Update render data
|
||||
* Responsible for calling renderEngine::setRenderData
|
||||
|
||||
@@ -60,7 +60,6 @@
|
||||
#include <modules/atmosphere/rendering/atmospheredeferredcaster.h>
|
||||
|
||||
#include <modules/atmosphere/rendering/renderableatmosphere.h>
|
||||
#include <openspace/engine/openspaceengine.h>
|
||||
#include <openspace/util/powerscaledcoordinate.h>
|
||||
#include <openspace/util/updatestructures.h>
|
||||
#include <openspace/util/spicemanager.h>
|
||||
|
||||
@@ -24,33 +24,28 @@
|
||||
|
||||
#include <modules/atmosphere/rendering/renderableatmosphere.h>
|
||||
|
||||
#include <modules/atmosphere/rendering/atmospheredeferredcaster.h>
|
||||
#include <modules/space/rendering/planetgeometry.h>
|
||||
#include <openspace/documentation/documentation.h>
|
||||
#include <openspace/documentation/verifier.h>
|
||||
|
||||
#include <modules/space/rendering/planetgeometry.h>
|
||||
#include <openspace/engine/globals.h>
|
||||
#include <openspace/rendering/deferredcastermanager.h>
|
||||
#include <openspace/rendering/renderengine.h>
|
||||
#include <openspace/rendering/renderer.h>
|
||||
#include <openspace/scene/scenegraphnode.h>
|
||||
#include <openspace/util/time.h>
|
||||
#include <openspace/util/spicemanager.h>
|
||||
#include <openspace/scene/scenegraphnode.h>
|
||||
|
||||
#include <ghoul/filesystem/filesystem.h>
|
||||
#include <ghoul/misc/assert.h>
|
||||
#include <ghoul/io/texture/texturereader.h>
|
||||
#include <ghoul/logging/logmanager.h>
|
||||
#include <ghoul/misc/assert.h>
|
||||
#include <ghoul/misc/invariants.h>
|
||||
#include <ghoul/opengl/programobject.h>
|
||||
#include <ghoul/opengl/texture.h>
|
||||
#include <ghoul/opengl/textureunit.h>
|
||||
#include <ghoul/misc/invariants.h>
|
||||
|
||||
#include <openspace/rendering/deferredcastermanager.h>
|
||||
#include <modules/atmosphere/rendering/atmospheredeferredcaster.h>
|
||||
#include <openspace/engine/openspaceengine.h>
|
||||
#include <openspace/rendering/renderengine.h>
|
||||
#include <openspace/rendering/renderer.h>
|
||||
|
||||
#include <glm/gtx/string_cast.hpp>
|
||||
|
||||
#include <memory>
|
||||
#include <fstream>
|
||||
#include <memory>
|
||||
|
||||
#ifdef WIN32
|
||||
#define _USE_MATH_DEFINES
|
||||
@@ -673,9 +668,7 @@ RenderableAtmosphere::RenderableAtmosphere(const ghoul::Dictionary& dictionary)
|
||||
|
||||
void RenderableAtmosphere::deinitialize() {
|
||||
if (_deferredcaster) {
|
||||
OsEng.renderEngine().deferredcasterManager().detachDeferredcaster(
|
||||
*_deferredcaster
|
||||
);
|
||||
global::deferredcasterManager.detachDeferredcaster(*_deferredcaster);
|
||||
_deferredcaster = nullptr;
|
||||
}
|
||||
}
|
||||
@@ -718,9 +711,7 @@ void RenderableAtmosphere::initializeGL() {
|
||||
_deferredcaster->initialize();
|
||||
}
|
||||
|
||||
OsEng.renderEngine().deferredcasterManager().attachDeferredcaster(
|
||||
*_deferredcaster
|
||||
);
|
||||
global::deferredcasterManager.attachDeferredcaster(*_deferredcaster);
|
||||
}
|
||||
|
||||
return;
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
|
||||
#include <openspace/documentation/documentation.h>
|
||||
#include <openspace/documentation/verifier.h>
|
||||
#include <openspace/engine/openspaceengine.h>
|
||||
#include <openspace/engine/globals.h>
|
||||
#include <openspace/interaction/navigationhandler.h>
|
||||
#include <openspace/rendering/renderengine.h>
|
||||
#include <openspace/scene/scene.h>
|
||||
@@ -219,12 +219,12 @@ DashboardItemAngle::DashboardItemAngle(const ghoul::Dictionary& dictionary)
|
||||
}
|
||||
|
||||
_fontName.onChange([this]() {
|
||||
_font = OsEng.fontManager().font(_fontName, _fontSize);
|
||||
_font = global::fontManager.font(_fontName, _fontSize);
|
||||
});
|
||||
addProperty(_fontName);
|
||||
|
||||
_fontSize.onChange([this]() {
|
||||
_font = OsEng.fontManager().font(_fontName, _fontSize);
|
||||
_font = global::fontManager.font(_fontName, _fontSize);
|
||||
});
|
||||
addProperty(_fontSize);
|
||||
|
||||
@@ -356,7 +356,7 @@ DashboardItemAngle::DashboardItemAngle(const ghoul::Dictionary& dictionary)
|
||||
}
|
||||
addProperty(_destination.nodeName);
|
||||
|
||||
_font = OsEng.fontManager().font(_fontName, _fontSize);
|
||||
_font = global::fontManager.font(_fontName, _fontSize);
|
||||
}
|
||||
|
||||
std::pair<glm::dvec3, std::string> DashboardItemAngle::positionAndLabel(
|
||||
@@ -364,7 +364,7 @@ std::pair<glm::dvec3, std::string> DashboardItemAngle::positionAndLabel(
|
||||
{
|
||||
if (comp.type == Type::Node) {
|
||||
if (!comp.node) {
|
||||
comp.node = OsEng.renderEngine().scene()->sceneGraphNode(comp.nodeName);
|
||||
comp.node = global::renderEngine.scene()->sceneGraphNode(comp.nodeName);
|
||||
|
||||
if (!comp.node) {
|
||||
LERRORC(
|
||||
@@ -380,9 +380,9 @@ std::pair<glm::dvec3, std::string> DashboardItemAngle::positionAndLabel(
|
||||
case Type::Node:
|
||||
return { comp.node->worldPosition(), comp.node->guiName() };
|
||||
case Type::Focus:
|
||||
return { OsEng.navigationHandler().focusNode()->worldPosition(), "focus" };
|
||||
return { global::navigationHandler.focusNode()->worldPosition(), "focus" };
|
||||
case Type::Camera:
|
||||
return { OsEng.renderEngine().scene()->camera()->positionVec3(), "camera" };
|
||||
return { global::renderEngine.scene()->camera()->positionVec3(), "camera" };
|
||||
default:
|
||||
return { glm::dvec3(0.0), "Unknown" };
|
||||
}
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
|
||||
#include <openspace/documentation/documentation.h>
|
||||
#include <openspace/documentation/verifier.h>
|
||||
#include <openspace/engine/openspaceengine.h>
|
||||
#include <openspace/engine/globals.h>
|
||||
#include <openspace/util/timemanager.h>
|
||||
#include <ghoul/font/font.h>
|
||||
#include <ghoul/font/fontmanager.h>
|
||||
@@ -94,7 +94,7 @@ DashboardItemDate::DashboardItemDate(const ghoul::Dictionary& dictionary)
|
||||
_fontName = dictionary.value<std::string>(FontNameInfo.identifier);
|
||||
}
|
||||
_fontName.onChange([this](){
|
||||
_font = OsEng.fontManager().font(_fontName, _fontSize);
|
||||
_font = global::fontManager.font(_fontName, _fontSize);
|
||||
});
|
||||
addProperty(_fontName);
|
||||
|
||||
@@ -104,11 +104,11 @@ DashboardItemDate::DashboardItemDate(const ghoul::Dictionary& dictionary)
|
||||
);
|
||||
}
|
||||
_fontSize.onChange([this](){
|
||||
_font = OsEng.fontManager().font(_fontName, _fontSize);
|
||||
_font = global::fontManager.font(_fontName, _fontSize);
|
||||
});
|
||||
addProperty(_fontSize);
|
||||
|
||||
_font = OsEng.fontManager().font(_fontName, _fontSize);
|
||||
_font = global::fontManager.font(_fontName, _fontSize);
|
||||
}
|
||||
|
||||
void DashboardItemDate::render(glm::vec2& penPosition) {
|
||||
@@ -116,14 +116,14 @@ void DashboardItemDate::render(glm::vec2& penPosition) {
|
||||
RenderFont(
|
||||
*_font,
|
||||
penPosition,
|
||||
fmt::format("Date: {} UTC", OsEng.timeManager().time().UTC())
|
||||
fmt::format("Date: {} UTC", global::timeManager.time().UTC())
|
||||
);
|
||||
}
|
||||
|
||||
glm::vec2 DashboardItemDate::size() const {
|
||||
return ghoul::fontrendering::FontRenderer::defaultRenderer().boundingBox(
|
||||
*_font,
|
||||
fmt::format("Date: {} UTC", OsEng.timeManager().time().UTC())
|
||||
fmt::format("Date: {} UTC", global::timeManager.time().UTC())
|
||||
).boundingBox;
|
||||
}
|
||||
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
|
||||
#include <openspace/documentation/documentation.h>
|
||||
#include <openspace/documentation/verifier.h>
|
||||
#include <openspace/engine/openspaceengine.h>
|
||||
#include <openspace/engine/globals.h>
|
||||
#include <openspace/interaction/navigationhandler.h>
|
||||
#include <openspace/rendering/renderengine.h>
|
||||
#include <openspace/scene/scene.h>
|
||||
@@ -219,12 +219,12 @@ DashboardItemDistance::DashboardItemDistance(const ghoul::Dictionary& dictionary
|
||||
}
|
||||
|
||||
_fontName.onChange([this]() {
|
||||
_font = OsEng.fontManager().font(_fontName, _fontSize);
|
||||
_font = global::fontManager.font(_fontName, _fontSize);
|
||||
});
|
||||
addProperty(_fontName);
|
||||
|
||||
_fontSize.onChange([this]() {
|
||||
_font = OsEng.fontManager().font(_fontName, _fontSize);
|
||||
_font = global::fontManager.font(_fontName, _fontSize);
|
||||
});
|
||||
addProperty(_fontSize);
|
||||
|
||||
@@ -356,7 +356,7 @@ DashboardItemDistance::DashboardItemDistance(const ghoul::Dictionary& dictionary
|
||||
_requestedUnit.setVisibility(properties::Property::Visibility::Hidden);
|
||||
addProperty(_requestedUnit);
|
||||
|
||||
_font = OsEng.fontManager().font(_fontName, _fontSize);
|
||||
_font = global::fontManager.font(_fontName, _fontSize);
|
||||
}
|
||||
|
||||
std::pair<glm::dvec3, std::string> DashboardItemDistance::positionAndLabel(
|
||||
@@ -365,7 +365,7 @@ std::pair<glm::dvec3, std::string> DashboardItemDistance::positionAndLabel(
|
||||
{
|
||||
if ((mainComp.type == Type::Node) || (mainComp.type == Type::NodeSurface)) {
|
||||
if (!mainComp.node) {
|
||||
mainComp.node = OsEng.renderEngine().scene()->sceneGraphNode(
|
||||
mainComp.node = global::renderEngine.scene()->sceneGraphNode(
|
||||
mainComp.nodeName
|
||||
);
|
||||
|
||||
@@ -402,11 +402,11 @@ std::pair<glm::dvec3, std::string> DashboardItemDistance::positionAndLabel(
|
||||
}
|
||||
case Type::Focus:
|
||||
return {
|
||||
OsEng.navigationHandler().focusNode()->worldPosition(),
|
||||
global::navigationHandler.focusNode()->worldPosition(),
|
||||
"focus"
|
||||
};
|
||||
case Type::Camera:
|
||||
return { OsEng.renderEngine().scene()->camera()->positionVec3(), "camera" };
|
||||
return { global::renderEngine.scene()->camera()->positionVec3(), "camera" };
|
||||
default:
|
||||
return { glm::dvec3(0.0), "Unknown" };
|
||||
}
|
||||
|
||||
@@ -26,8 +26,8 @@
|
||||
|
||||
#include <openspace/documentation/documentation.h>
|
||||
#include <openspace/documentation/verifier.h>
|
||||
#include <openspace/engine/openspaceengine.h>
|
||||
#include <openspace/engine/wrapper/windowwrapper.h>
|
||||
#include <openspace/engine/globals.h>
|
||||
#include <openspace/engine/windowdelegate.h>
|
||||
#include <ghoul/font/font.h>
|
||||
#include <ghoul/font/fontmanager.h>
|
||||
#include <ghoul/font/fontrenderer.h>
|
||||
@@ -111,7 +111,7 @@ DashboardItemFramerate::DashboardItemFramerate(const ghoul::Dictionary& dictiona
|
||||
_fontName = dictionary.value<std::string>(FontNameInfo.identifier);
|
||||
}
|
||||
_fontName.onChange([this]() {
|
||||
_font = OsEng.fontManager().font(_fontName, _fontSize);
|
||||
_font = global::fontManager.font(_fontName, _fontSize);
|
||||
});
|
||||
addProperty(_fontName);
|
||||
|
||||
@@ -121,7 +121,7 @@ DashboardItemFramerate::DashboardItemFramerate(const ghoul::Dictionary& dictiona
|
||||
);
|
||||
}
|
||||
_fontSize.onChange([this](){
|
||||
_font = OsEng.fontManager().font(_fontName, _fontSize);
|
||||
_font = global::fontManager.font(_fontName, _fontSize);
|
||||
});
|
||||
addProperty(_fontSize);
|
||||
|
||||
@@ -152,7 +152,7 @@ DashboardItemFramerate::DashboardItemFramerate(const ghoul::Dictionary& dictiona
|
||||
}
|
||||
addProperty(_frametimeType);
|
||||
|
||||
_font = OsEng.fontManager().font(_fontName, _fontSize);
|
||||
_font = global::fontManager.font(_fontName, _fontSize);
|
||||
}
|
||||
|
||||
void DashboardItemFramerate::render(glm::vec2& penPosition) {
|
||||
@@ -164,7 +164,7 @@ void DashboardItemFramerate::render(glm::vec2& penPosition) {
|
||||
*_font,
|
||||
penPosition,
|
||||
fmt::format(
|
||||
"Avg. Frametime: {:.5f}", OsEng.windowWrapper().averageDeltaTime()
|
||||
"Avg. Frametime: {:.5f}", global::windowDelegate.averageDeltaTime()
|
||||
)
|
||||
);
|
||||
break;
|
||||
@@ -173,7 +173,7 @@ void DashboardItemFramerate::render(glm::vec2& penPosition) {
|
||||
RenderFont(
|
||||
*_font,
|
||||
penPosition,
|
||||
fmt::format("FPS: {:3.2f}", 1.0 / OsEng.windowWrapper().deltaTime())
|
||||
fmt::format("FPS: {:3.2f}", 1.0 / global::windowDelegate.deltaTime())
|
||||
);
|
||||
break;
|
||||
case FrametimeType::FPSAvg:
|
||||
@@ -182,7 +182,7 @@ void DashboardItemFramerate::render(glm::vec2& penPosition) {
|
||||
*_font,
|
||||
penPosition,
|
||||
fmt::format(
|
||||
"Avg. FPS: {:3.2f}", 1.0 / OsEng.windowWrapper().averageDeltaTime()
|
||||
"Avg. FPS: {:3.2f}", 1.0 / global::windowDelegate.averageDeltaTime()
|
||||
)
|
||||
);
|
||||
break;
|
||||
@@ -198,21 +198,21 @@ glm::vec2 DashboardItemFramerate::size() const {
|
||||
return ghoul::fontrendering::FontRenderer::defaultRenderer().boundingBox(
|
||||
*_font,
|
||||
fmt::format(
|
||||
"Avg. Frametime: {:.5f}", OsEng.windowWrapper().averageDeltaTime()
|
||||
"Avg. Frametime: {:.5f}", global::windowDelegate.averageDeltaTime()
|
||||
)
|
||||
).boundingBox;
|
||||
case FrametimeType::FPS:
|
||||
return ghoul::fontrendering::FontRenderer::defaultRenderer().boundingBox(
|
||||
*_font,
|
||||
fmt::format(
|
||||
"FPS: {:3.2f}", 1.0 / OsEng.windowWrapper().deltaTime()
|
||||
"FPS: {:3.2f}", 1.0 / global::windowDelegate.deltaTime()
|
||||
)
|
||||
).boundingBox;
|
||||
case FrametimeType::FPSAvg:
|
||||
return ghoul::fontrendering::FontRenderer::defaultRenderer().boundingBox(
|
||||
*_font,
|
||||
fmt::format(
|
||||
"Avg. FPS: %3.2f", 1.0 / OsEng.windowWrapper().averageDeltaTime()
|
||||
"Avg. FPS: %3.2f", 1.0 / global::windowDelegate.averageDeltaTime()
|
||||
)
|
||||
).boundingBox;
|
||||
case FrametimeType::None:
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
|
||||
#include <openspace/documentation/documentation.h>
|
||||
#include <openspace/documentation/verifier.h>
|
||||
#include <openspace/engine/openspaceengine.h>
|
||||
#include <openspace/engine/globals.h>
|
||||
#include <openspace/mission/mission.h>
|
||||
#include <openspace/mission/missionmanager.h>
|
||||
#include <openspace/util/timemanager.h>
|
||||
@@ -113,7 +113,7 @@ DashboardItemMission::DashboardItemMission(const ghoul::Dictionary& dictionary)
|
||||
_fontName = dictionary.value<std::string>(FontNameInfo.identifier);
|
||||
}
|
||||
_fontName.onChange([this](){
|
||||
_font = OsEng.fontManager().font(_fontName, _fontSize);
|
||||
_font = global::fontManager.font(_fontName, _fontSize);
|
||||
});
|
||||
addProperty(_fontName);
|
||||
|
||||
@@ -123,17 +123,17 @@ DashboardItemMission::DashboardItemMission(const ghoul::Dictionary& dictionary)
|
||||
);
|
||||
}
|
||||
_fontSize.onChange([this](){
|
||||
_font = OsEng.fontManager().font(_fontName, _fontSize);
|
||||
_font = global::fontManager.font(_fontName, _fontSize);
|
||||
});
|
||||
addProperty(_fontSize);
|
||||
|
||||
_font = OsEng.fontManager().font(_fontName, _fontSize);
|
||||
_font = global::fontManager.font(_fontName, _fontSize);
|
||||
}
|
||||
|
||||
void DashboardItemMission::render(glm::vec2& penPosition) {
|
||||
if (MissionManager::ref().hasCurrentMission()) {
|
||||
double currentTime = OsEng.timeManager().time().j2000Seconds();
|
||||
const Mission& mission = MissionManager::ref().currentMission();
|
||||
if (global::missionManager.hasCurrentMission()) {
|
||||
double currentTime = global::timeManager.time().j2000Seconds();
|
||||
const Mission& mission = global::missionManager.currentMission();
|
||||
|
||||
if (!mission.phases().empty()) {
|
||||
static const glm::vec4 nextMissionColor(0.7f, 0.3f, 0.3f, 1.f);
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
|
||||
#include <openspace/documentation/documentation.h>
|
||||
#include <openspace/documentation/verifier.h>
|
||||
#include <openspace/engine/openspaceengine.h>
|
||||
#include <openspace/engine/globals.h>
|
||||
#include <openspace/network/parallelconnection.h>
|
||||
#include <openspace/network/parallelpeer.h>
|
||||
#include <openspace/scene/scenegraphnode.h>
|
||||
@@ -98,7 +98,7 @@ DashboardItemParallelConnection::DashboardItemParallelConnection(
|
||||
_fontName = dictionary.value<std::string>(FontNameInfo.identifier);
|
||||
}
|
||||
_fontName.onChange([this](){
|
||||
_font = OsEng.fontManager().font(_fontName, _fontSize);
|
||||
_font = global::fontManager.font(_fontName, _fontSize);
|
||||
});
|
||||
addProperty(_fontName);
|
||||
|
||||
@@ -108,17 +108,17 @@ DashboardItemParallelConnection::DashboardItemParallelConnection(
|
||||
);
|
||||
}
|
||||
_fontSize.onChange([this](){
|
||||
_font = OsEng.fontManager().font(_fontName, _fontSize);
|
||||
_font = global::fontManager.font(_fontName, _fontSize);
|
||||
});
|
||||
addProperty(_fontSize);
|
||||
|
||||
_font = OsEng.fontManager().font(_fontName, _fontSize);
|
||||
_font = global::fontManager.font(_fontName, _fontSize);
|
||||
}
|
||||
|
||||
void DashboardItemParallelConnection::render(glm::vec2& penPosition) {
|
||||
const ParallelConnection::Status status = OsEng.parallelPeer().status();
|
||||
const size_t nConnections = OsEng.parallelPeer().nConnections();
|
||||
const std::string& hostName = OsEng.parallelPeer().hostName();
|
||||
const ParallelConnection::Status status = global::parallelPeer.status();
|
||||
const size_t nConnections = global::parallelPeer.nConnections();
|
||||
const std::string& hostName = global::parallelPeer.hostName();
|
||||
|
||||
std::string connectionInfo;
|
||||
int nClients = static_cast<int>(nConnections);
|
||||
@@ -166,9 +166,9 @@ void DashboardItemParallelConnection::render(glm::vec2& penPosition) {
|
||||
}
|
||||
|
||||
glm::vec2 DashboardItemParallelConnection::size() const {
|
||||
ParallelConnection::Status status = OsEng.parallelPeer().status();
|
||||
size_t nConnections = OsEng.parallelPeer().nConnections();
|
||||
const std::string& hostName = OsEng.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<int>(nConnections);
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
|
||||
#include <openspace/documentation/documentation.h>
|
||||
#include <openspace/documentation/verifier.h>
|
||||
#include <openspace/engine/openspaceengine.h>
|
||||
#include <openspace/engine/globals.h>
|
||||
#include <openspace/util/timemanager.h>
|
||||
#include <openspace/query/query.h>
|
||||
#include <ghoul/font/font.h>
|
||||
@@ -124,7 +124,7 @@ DashboardItemPropertyValue::DashboardItemPropertyValue(
|
||||
_fontName = dictionary.value<std::string>(FontNameInfo.identifier);
|
||||
}
|
||||
_fontName.onChange([this](){
|
||||
_font = OsEng.fontManager().font(_fontName, _fontSize);
|
||||
_font = global::fontManager.font(_fontName, _fontSize);
|
||||
});
|
||||
addProperty(_fontName);
|
||||
|
||||
@@ -134,7 +134,7 @@ DashboardItemPropertyValue::DashboardItemPropertyValue(
|
||||
);
|
||||
}
|
||||
_fontSize.onChange([this](){
|
||||
_font = OsEng.fontManager().font(_fontName, _fontSize);
|
||||
_font = global::fontManager.font(_fontName, _fontSize);
|
||||
});
|
||||
addProperty(_fontSize);
|
||||
|
||||
@@ -151,7 +151,7 @@ DashboardItemPropertyValue::DashboardItemPropertyValue(
|
||||
}
|
||||
addProperty(_displayString);
|
||||
|
||||
_font = OsEng.fontManager().font(_fontName, _fontSize);
|
||||
_font = global::fontManager.font(_fontName, _fontSize);
|
||||
}
|
||||
|
||||
void DashboardItemPropertyValue::render(glm::vec2& penPosition) {
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
|
||||
#include <openspace/documentation/documentation.h>
|
||||
#include <openspace/documentation/verifier.h>
|
||||
#include <openspace/engine/openspaceengine.h>
|
||||
#include <openspace/engine/globals.h>
|
||||
#include <openspace/util/timeconversion.h>
|
||||
#include <openspace/util/timemanager.h>
|
||||
#include <ghoul/font/font.h>
|
||||
@@ -136,7 +136,7 @@ DashboardItemSimulationIncrement::DashboardItemSimulationIncrement(
|
||||
_fontName = dictionary.value<std::string>(FontNameInfo.identifier);
|
||||
}
|
||||
_fontName.onChange([this](){
|
||||
_font = OsEng.fontManager().font(_fontName, _fontSize);
|
||||
_font = global::fontManager.font(_fontName, _fontSize);
|
||||
});
|
||||
addProperty(_fontName);
|
||||
|
||||
@@ -144,7 +144,7 @@ DashboardItemSimulationIncrement::DashboardItemSimulationIncrement(
|
||||
_fontSize = static_cast<float>(dictionary.value<double>(FontSizeInfo.identifier));
|
||||
}
|
||||
_fontSize.onChange([this](){
|
||||
_font = OsEng.fontManager().font(_fontName, _fontSize);
|
||||
_font = global::fontManager.font(_fontName, _fontSize);
|
||||
});
|
||||
addProperty(_fontSize);
|
||||
|
||||
@@ -173,12 +173,12 @@ DashboardItemSimulationIncrement::DashboardItemSimulationIncrement(
|
||||
_requestedUnit.setVisibility(properties::Property::Visibility::Hidden);
|
||||
addProperty(_requestedUnit);
|
||||
|
||||
_font = OsEng.fontManager().font(_fontName, _fontSize);
|
||||
_font = global::fontManager.font(_fontName, _fontSize);
|
||||
}
|
||||
|
||||
void DashboardItemSimulationIncrement::render(glm::vec2& penPosition) {
|
||||
const double targetDt = OsEng.timeManager().targetDeltaTime();
|
||||
const double currentDt = OsEng.timeManager().deltaTime();
|
||||
const double targetDt = global::timeManager.targetDeltaTime();
|
||||
const double currentDt = global::timeManager.deltaTime();
|
||||
std::pair<double, std::string> targetDeltaTime;
|
||||
std::pair<double, std::string> currentDeltaTime;
|
||||
if (_doSimplification) {
|
||||
@@ -199,10 +199,10 @@ void DashboardItemSimulationIncrement::render(glm::vec2& penPosition) {
|
||||
}
|
||||
}
|
||||
|
||||
std::string pauseText = OsEng.timeManager().isPaused() ? " (Paused)" : "";
|
||||
std::string pauseText = global::timeManager.isPaused() ? " (Paused)" : "";
|
||||
|
||||
penPosition.y -= _font->height();
|
||||
if (targetDt != currentDt && !OsEng.timeManager().isPaused()) {
|
||||
if (targetDt != currentDt && !global::timeManager.isPaused()) {
|
||||
// We are in the middle of a transition
|
||||
RenderFont(
|
||||
*_font,
|
||||
@@ -229,7 +229,7 @@ void DashboardItemSimulationIncrement::render(glm::vec2& penPosition) {
|
||||
}
|
||||
|
||||
glm::vec2 DashboardItemSimulationIncrement::size() const {
|
||||
double t = OsEng.timeManager().targetDeltaTime();
|
||||
double t = global::timeManager.targetDeltaTime();
|
||||
std::pair<double, std::string> deltaTime;
|
||||
if (_doSimplification) {
|
||||
deltaTime = simplifyTime(t);
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
|
||||
#include <openspace/documentation/documentation.h>
|
||||
#include <openspace/documentation/verifier.h>
|
||||
#include <openspace/engine/openspaceengine.h>
|
||||
#include <openspace/engine/globals.h>
|
||||
#include <openspace/rendering/renderengine.h>
|
||||
#include <openspace/scene/scene.h>
|
||||
#include <openspace/util/updatestructures.h>
|
||||
@@ -110,14 +110,14 @@ SceneGraphLightSource::SceneGraphLightSource(const ghoul::Dictionary& dictionary
|
||||
|
||||
_sceneGraphNodeReference.onChange([this]() {
|
||||
_sceneGraphNode =
|
||||
OsEng.renderEngine().scene()->sceneGraphNode(_sceneGraphNodeReference);
|
||||
global::renderEngine.scene()->sceneGraphNode(_sceneGraphNodeReference);
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
bool SceneGraphLightSource::initialize() {
|
||||
_sceneGraphNode =
|
||||
OsEng.renderEngine().scene()->sceneGraphNode(_sceneGraphNodeReference);
|
||||
global::renderEngine.scene()->sceneGraphNode(_sceneGraphNodeReference);
|
||||
return _sceneGraphNode != nullptr;
|
||||
}
|
||||
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
#include <modules/base/rendering/modelgeometry.h>
|
||||
#include <openspace/documentation/documentation.h>
|
||||
#include <openspace/documentation/verifier.h>
|
||||
#include <openspace/engine/openspaceengine.h>
|
||||
#include <openspace/engine/globals.h>
|
||||
#include <openspace/rendering/renderengine.h>
|
||||
#include <openspace/util/time.h>
|
||||
#include <openspace/util/updatestructures.h>
|
||||
@@ -256,7 +256,7 @@ void RenderableModel::initializeGL() {
|
||||
_program = BaseModule::ProgramObjectManager.request(
|
||||
ProgramName,
|
||||
[]() -> std::unique_ptr<ghoul::opengl::ProgramObject> {
|
||||
return OsEng.renderEngine().buildRenderProgram(
|
||||
return global::renderEngine.buildRenderProgram(
|
||||
ProgramName,
|
||||
absPath("${MODULE_BASE}/shaders/model_vs.glsl"),
|
||||
absPath("${MODULE_BASE}/shaders/model_fs.glsl")
|
||||
@@ -281,7 +281,7 @@ void RenderableModel::deinitializeGL() {
|
||||
BaseModule::ProgramObjectManager.release(
|
||||
ProgramName,
|
||||
[](ghoul::opengl::ProgramObject* p) {
|
||||
OsEng.renderEngine().removeRenderProgram(p);
|
||||
global::renderEngine.removeRenderProgram(p);
|
||||
}
|
||||
);
|
||||
_program = nullptr;
|
||||
|
||||
@@ -27,11 +27,10 @@
|
||||
#include <modules/base/basemodule.h>
|
||||
#include <openspace/documentation/documentation.h>
|
||||
#include <openspace/documentation/verifier.h>
|
||||
#include <openspace/engine/openspaceengine.h>
|
||||
#include <openspace/engine/globals.h>
|
||||
#include <openspace/rendering/renderengine.h>
|
||||
#include <openspace/scene/scenegraphnode.h>
|
||||
#include <openspace/util/updatestructures.h>
|
||||
|
||||
#include <ghoul/filesystem/filesystem.h>
|
||||
#include <ghoul/io/texture/texturereader.h>
|
||||
#include <ghoul/misc/defer.h>
|
||||
@@ -168,7 +167,7 @@ void RenderablePlane::initializeGL() {
|
||||
_shader = BaseModule::ProgramObjectManager.request(
|
||||
ProgramName,
|
||||
[]() -> std::unique_ptr<ghoul::opengl::ProgramObject> {
|
||||
return OsEng.renderEngine().buildRenderProgram(
|
||||
return global::renderEngine.buildRenderProgram(
|
||||
ProgramName,
|
||||
absPath("${MODULE_BASE}/shaders/plane_vs.glsl"),
|
||||
absPath("${MODULE_BASE}/shaders/plane_fs.glsl")
|
||||
@@ -187,7 +186,7 @@ void RenderablePlane::deinitializeGL() {
|
||||
BaseModule::ProgramObjectManager.release(
|
||||
ProgramName,
|
||||
[](ghoul::opengl::ProgramObject* p) {
|
||||
OsEng.renderEngine().removeRenderProgram(p);
|
||||
global::renderEngine.removeRenderProgram(p);
|
||||
}
|
||||
);
|
||||
_shader = nullptr;
|
||||
@@ -240,10 +239,10 @@ void RenderablePlane::render(const RenderData& data, RendererTasks&) {
|
||||
|
||||
_shader->setUniform("texture1", unit);
|
||||
|
||||
bool usingFramebufferRenderer = OsEng.renderEngine().rendererImplementation() ==
|
||||
bool usingFramebufferRenderer = global::renderEngine.rendererImplementation() ==
|
||||
RenderEngine::RendererImplementation::Framebuffer;
|
||||
|
||||
bool usingABufferRenderer = OsEng.renderEngine().rendererImplementation() ==
|
||||
bool usingABufferRenderer = global::renderEngine.rendererImplementation() ==
|
||||
RenderEngine::RendererImplementation::ABuffer;
|
||||
|
||||
if (usingABufferRenderer) {
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
|
||||
#include <openspace/documentation/documentation.h>
|
||||
#include <openspace/documentation/verifier.h>
|
||||
#include <openspace/engine/openspaceengine.h>
|
||||
#include <openspace/engine/globals.h>
|
||||
#include <ghoul/filesystem/filesystem.h>
|
||||
#include <ghoul/io/texture/texturereader.h>
|
||||
#include <ghoul/logging/logmanager.h>
|
||||
@@ -148,7 +148,7 @@ void RenderablePlaneImageOnline::update(const UpdateData&) {
|
||||
std::future<DownloadManager::MemoryFile>
|
||||
RenderablePlaneImageOnline::downloadImageToMemory(const std::string& url)
|
||||
{
|
||||
return OsEng.downloadManager().fetchFile(
|
||||
return global::downloadManager.fetchFile(
|
||||
url,
|
||||
[url](const DownloadManager::MemoryFile&) {
|
||||
LDEBUGC(
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
#include <modules/base/basemodule.h>
|
||||
#include <openspace/documentation/documentation.h>
|
||||
#include <openspace/documentation/verifier.h>
|
||||
#include <openspace/engine/openspaceengine.h>
|
||||
#include <openspace/engine/globals.h>
|
||||
#include <openspace/rendering/renderengine.h>
|
||||
#include <openspace/util/powerscaledscalar.h>
|
||||
#include <openspace/util/powerscaledsphere.h>
|
||||
@@ -244,7 +244,7 @@ void RenderableSphere::initializeGL() {
|
||||
_shader = BaseModule::ProgramObjectManager.request(
|
||||
ProgramName,
|
||||
[]() -> std::unique_ptr<ghoul::opengl::ProgramObject> {
|
||||
return OsEng.renderEngine().buildRenderProgram(
|
||||
return global::renderEngine.buildRenderProgram(
|
||||
ProgramName,
|
||||
absPath("${MODULE_BASE}/shaders/sphere_vs.glsl"),
|
||||
absPath("${MODULE_BASE}/shaders/sphere_fs.glsl")
|
||||
@@ -263,7 +263,7 @@ void RenderableSphere::deinitializeGL() {
|
||||
BaseModule::ProgramObjectManager.release(
|
||||
ProgramName,
|
||||
[](ghoul::opengl::ProgramObject* p) {
|
||||
OsEng.renderEngine().removeRenderProgram(p);
|
||||
global::renderEngine.removeRenderProgram(p);
|
||||
}
|
||||
);
|
||||
_shader = nullptr;
|
||||
@@ -322,10 +322,10 @@ void RenderableSphere::render(const RenderData& data, RendererTasks&) {
|
||||
glEnable(GL_CULL_FACE);
|
||||
glCullFace(GL_BACK);
|
||||
|
||||
bool usingFramebufferRenderer = OsEng.renderEngine().rendererImplementation() ==
|
||||
bool usingFramebufferRenderer = global::renderEngine.rendererImplementation() ==
|
||||
RenderEngine::RendererImplementation::Framebuffer;
|
||||
|
||||
bool usingABufferRenderer = OsEng.renderEngine().rendererImplementation() ==
|
||||
bool usingABufferRenderer = global::renderEngine.rendererImplementation() ==
|
||||
RenderEngine::RendererImplementation::ABuffer;
|
||||
|
||||
if (usingABufferRenderer) {
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
#include <modules/base/rendering/renderablesphericalgrid.h>
|
||||
|
||||
#include <modules/base/basemodule.h>
|
||||
#include <openspace/engine/openspaceengine.h>
|
||||
#include <openspace/engine/globals.h>
|
||||
#include <openspace/rendering/renderengine.h>
|
||||
#include <openspace/util/spicemanager.h>
|
||||
#include <openspace/util/updatestructures.h>
|
||||
@@ -179,7 +179,7 @@ void RenderableSphericalGrid::initializeGL() {
|
||||
_gridProgram = BaseModule::ProgramObjectManager.request(
|
||||
ProgramName,
|
||||
[]() -> std::unique_ptr<ghoul::opengl::ProgramObject> {
|
||||
return OsEng.renderEngine().buildRenderProgram(
|
||||
return global::renderEngine.buildRenderProgram(
|
||||
ProgramName,
|
||||
absPath("${MODULE_BASE}/shaders/grid_vs.glsl"),
|
||||
absPath("${MODULE_BASE}/shaders/grid_fs.glsl")
|
||||
@@ -211,7 +211,7 @@ void RenderableSphericalGrid::deinitializeGL() {
|
||||
BaseModule::ProgramObjectManager.release(
|
||||
ProgramName,
|
||||
[](ghoul::opengl::ProgramObject* p) {
|
||||
OsEng.renderEngine().removeRenderProgram(p);
|
||||
global::renderEngine.removeRenderProgram(p);
|
||||
}
|
||||
);
|
||||
_gridProgram = nullptr;
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
#include <modules/base/basemodule.h>
|
||||
#include <openspace/documentation/documentation.h>
|
||||
#include <openspace/documentation/verifier.h>
|
||||
#include <openspace/engine/openspaceengine.h>
|
||||
#include <openspace/engine/globals.h>
|
||||
#include <openspace/rendering/renderengine.h>
|
||||
#include <openspace/scene/translation.h>
|
||||
#include <openspace/util/updatestructures.h>
|
||||
@@ -234,7 +234,7 @@ void RenderableTrail::initializeGL() {
|
||||
_programObject = BaseModule::ProgramObjectManager.request(
|
||||
ProgramName,
|
||||
[]() -> std::unique_ptr<ghoul::opengl::ProgramObject> {
|
||||
return OsEng.renderEngine().buildRenderProgram(
|
||||
return global::renderEngine.buildRenderProgram(
|
||||
ProgramName,
|
||||
absPath("${MODULE_BASE}/shaders/renderabletrail_vs.glsl"),
|
||||
absPath("${MODULE_BASE}/shaders/renderabletrail_fs.glsl")
|
||||
@@ -251,7 +251,7 @@ void RenderableTrail::deinitializeGL() {
|
||||
BaseModule::ProgramObjectManager.release(
|
||||
ProgramName,
|
||||
[](ghoul::opengl::ProgramObject* p) {
|
||||
OsEng.renderEngine().removeRenderProgram(p);
|
||||
global::renderEngine.removeRenderProgram(p);
|
||||
}
|
||||
);
|
||||
_programObject = nullptr;
|
||||
@@ -286,7 +286,7 @@ void RenderableTrail::render(const RenderData& data, RendererTasks&) {
|
||||
};
|
||||
|
||||
const bool usingFramebufferRenderer =
|
||||
OsEng.renderEngine().rendererImplementation() ==
|
||||
global::renderEngine.rendererImplementation() ==
|
||||
RenderEngine::RendererImplementation::Framebuffer;
|
||||
|
||||
if (usingFramebufferRenderer) {
|
||||
|
||||
@@ -26,8 +26,8 @@
|
||||
|
||||
#include <openspace/documentation/documentation.h>
|
||||
#include <openspace/documentation/verifier.h>
|
||||
#include <openspace/engine/openspaceengine.h>
|
||||
#include <openspace/engine/wrapper/windowwrapper.h>
|
||||
#include <openspace/engine/globals.h>
|
||||
#include <openspace/engine/windowdelegate.h>
|
||||
#include <openspace/rendering/renderengine.h>
|
||||
#include <openspace/rendering/dashboarditem.h>
|
||||
#include <openspace/scripting/lualibrary.h>
|
||||
@@ -70,7 +70,7 @@ int addDashboardItemToScreenSpace(lua_State* L) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
ScreenSpaceRenderable* ssr = OsEng.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<std::string>(L, 1);
|
||||
ScreenSpaceRenderable* ssr = OsEng.renderEngine().screenSpaceRenderable(name);
|
||||
ScreenSpaceRenderable* ssr = global::renderEngine.screenSpaceRenderable(name);
|
||||
|
||||
if (!ssr) {
|
||||
return ghoul::lua::luaError(L, "Provided name is not a ScreenSpace item");
|
||||
@@ -186,7 +186,7 @@ bool ScreenSpaceDashboard::initializeGL() {
|
||||
glm::vec2 penPosition = glm::vec2(10.f, _size.value().w );
|
||||
|
||||
if (_useMainDashboard) {
|
||||
OsEng.dashboard().render(penPosition);
|
||||
global::dashboard.render(penPosition);
|
||||
}
|
||||
else {
|
||||
_dashboard.render(penPosition);
|
||||
@@ -209,8 +209,8 @@ bool ScreenSpaceDashboard::isReady() const {
|
||||
}
|
||||
|
||||
void ScreenSpaceDashboard::update() {
|
||||
if (OsEng.windowWrapper().windowHasResized()) {
|
||||
const glm::ivec2 size = OsEng.windowWrapper().currentWindowResolution();
|
||||
if (global::windowDelegate.windowHasResized()) {
|
||||
const glm::ivec2 size = global::windowDelegate.currentWindowResolution();
|
||||
_size = { 0.f, 0.f, size.x, size.y };
|
||||
_originalViewportSize = size;
|
||||
createFramebuffer();
|
||||
|
||||
@@ -25,8 +25,8 @@
|
||||
#include <modules/base/rendering/screenspaceframebuffer.h>
|
||||
|
||||
#include <openspace/documentation/documentation.h>
|
||||
#include <openspace/engine/openspaceengine.h>
|
||||
#include <openspace/engine/wrapper/windowwrapper.h>
|
||||
#include <openspace/engine/globals.h>
|
||||
#include <openspace/engine/windowdelegate.h>
|
||||
#include <openspace/rendering/renderengine.h>
|
||||
#include <ghoul/opengl/framebufferobject.h>
|
||||
#include <ghoul/opengl/textureunit.h>
|
||||
@@ -77,7 +77,7 @@ ScreenSpaceFramebuffer::ScreenSpaceFramebuffer(const ghoul::Dictionary& dictiona
|
||||
setGuiName("ScreenSpaceFramebuffer " + std::to_string(iIdentifier));
|
||||
}
|
||||
|
||||
glm::vec2 resolution = OsEng.windowWrapper().currentWindowResolution();
|
||||
glm::vec2 resolution = global::windowDelegate.currentWindowResolution();
|
||||
addProperty(_size);
|
||||
_size.set(glm::vec4(0, 0, resolution.x,resolution.y));
|
||||
}
|
||||
@@ -103,7 +103,7 @@ bool ScreenSpaceFramebuffer::deinitializeGL() {
|
||||
}
|
||||
|
||||
void ScreenSpaceFramebuffer::render() {
|
||||
const glm::vec2& resolution = OsEng.windowWrapper().currentWindowResolution();
|
||||
const glm::vec2& resolution = global::windowDelegate.currentWindowResolution();
|
||||
const glm::vec4& size = _size.value();
|
||||
|
||||
const float xratio = _originalViewportSize.x / (size.z - size.x);
|
||||
|
||||
@@ -104,6 +104,12 @@ ScreenSpaceImageLocal::ScreenSpaceImageLocal(const ghoul::Dictionary& dictionary
|
||||
}
|
||||
}
|
||||
|
||||
bool ScreenSpaceImageLocal::deinitializeGL() {
|
||||
_texture = nullptr;
|
||||
|
||||
return ScreenSpaceRenderable::deinitializeGL();
|
||||
}
|
||||
|
||||
void ScreenSpaceImageLocal::update() {
|
||||
if (_textureIsDirty && !_texturePath.value().empty()) {
|
||||
std::unique_ptr<ghoul::opengl::Texture> texture =
|
||||
|
||||
@@ -39,6 +39,8 @@ class ScreenSpaceImageLocal : public ScreenSpaceRenderable {
|
||||
public:
|
||||
ScreenSpaceImageLocal(const ghoul::Dictionary& dictionary);
|
||||
|
||||
bool deinitializeGL() override;
|
||||
|
||||
void update() override;
|
||||
|
||||
static documentation::Documentation Documentation();
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
|
||||
#include <openspace/documentation/documentation.h>
|
||||
#include <openspace/documentation/verifier.h>
|
||||
#include <openspace/engine/openspaceengine.h>
|
||||
#include <openspace/engine/globals.h>
|
||||
#include <openspace/engine/downloadmanager.h>
|
||||
#include <ghoul/filesystem/filesystem.h>
|
||||
#include <ghoul/io/texture/texturereader.h>
|
||||
@@ -110,6 +110,12 @@ ScreenSpaceImageOnline::ScreenSpaceImageOnline(const ghoul::Dictionary& dictiona
|
||||
|
||||
ScreenSpaceImageOnline::~ScreenSpaceImageOnline() {} // NOLINT
|
||||
|
||||
bool ScreenSpaceImageOnline::deinitializeGL() {
|
||||
_texture = nullptr;
|
||||
|
||||
return ScreenSpaceRenderable::deinitializeGL();
|
||||
}
|
||||
|
||||
void ScreenSpaceImageOnline::update() {
|
||||
if (_textureIsDirty) {
|
||||
if (!_imageFuture.valid()) {
|
||||
@@ -161,7 +167,7 @@ void ScreenSpaceImageOnline::update() {
|
||||
std::future<DownloadManager::MemoryFile> ScreenSpaceImageOnline::downloadImageToMemory(
|
||||
const std::string& url)
|
||||
{
|
||||
return OsEng.downloadManager().fetchFile(
|
||||
return global::downloadManager.fetchFile(
|
||||
url,
|
||||
[url](const DownloadManager::MemoryFile&) {
|
||||
LDEBUGC(
|
||||
|
||||
@@ -41,6 +41,8 @@ public:
|
||||
ScreenSpaceImageOnline(const ghoul::Dictionary& dictionary);
|
||||
~ScreenSpaceImageOnline();
|
||||
|
||||
bool deinitializeGL() override;
|
||||
|
||||
void update() override;
|
||||
|
||||
static documentation::Documentation Documentation();
|
||||
|
||||
@@ -26,6 +26,7 @@
|
||||
#include "cefwebguimodule.h"
|
||||
|
||||
#include <openspace/engine/configuration.h>
|
||||
#include <openspace/engine/globalscallbacks.h>
|
||||
#include <openspace/engine/openspaceengine.h>
|
||||
#include <openspace/engine/moduleengine.h>
|
||||
#include <openspace/engine/wrapper/windowwrapper.h>
|
||||
@@ -48,46 +49,39 @@ void CefWebGuiModule::internalInitialize(const ghoul::Dictionary&) {
|
||||
_guiInstance = std::make_shared<BrowserInstance>(new GUIRenderHandler);
|
||||
_guiLocation = OsEng.configuration().cefWebGuiUrl;
|
||||
|
||||
OsEng.registerModuleCallback(
|
||||
OpenSpaceEngine::CallbackOption::Initialize,
|
||||
[this]() {
|
||||
LDEBUGC("WebBrowser", fmt::format("Loading GUI from {}", _guiLocation));
|
||||
_guiInstance->loadUrl(_guiLocation);
|
||||
WebBrowserModule* webBrowserModule =
|
||||
OsEng.moduleEngine().module<WebBrowserModule>();
|
||||
global::callback::initialize.push_back([this]() {
|
||||
LDEBUGC("WebBrowser", fmt::format("Loading GUI from {}", _guiLocation));
|
||||
_guiInstance->loadUrl(_guiLocation);
|
||||
WebBrowserModule* webBrowserModule =
|
||||
OsEng.moduleEngine().module<WebBrowserModule>();
|
||||
|
||||
if (webBrowserModule) {
|
||||
webBrowserModule->attachEventHandler(_guiInstance);
|
||||
webBrowserModule->addBrowser(_guiInstance);
|
||||
}
|
||||
if (webBrowserModule) {
|
||||
webBrowserModule->attachEventHandler(_guiInstance);
|
||||
webBrowserModule->addBrowser(_guiInstance);
|
||||
}
|
||||
);
|
||||
OsEng.registerModuleCallback(
|
||||
OpenSpaceEngine::CallbackOption::Render,
|
||||
[this](){
|
||||
WindowWrapper& wrapper = OsEng.windowWrapper();
|
||||
if (wrapper.isMaster()) {
|
||||
if (wrapper.windowHasResized()) {
|
||||
_guiInstance->reshape(wrapper.currentWindowSize());
|
||||
}
|
||||
});
|
||||
|
||||
_guiInstance->draw();
|
||||
global::callback::render.push_back([this](){
|
||||
WindowWrapper& wrapper = OsEng.windowWrapper();
|
||||
if (wrapper.isMaster()) {
|
||||
if (wrapper.windowHasResized()) {
|
||||
_guiInstance->reshape(wrapper.currentWindowSize());
|
||||
}
|
||||
}
|
||||
);
|
||||
OsEng.registerModuleCallback(
|
||||
OpenSpaceEngine::CallbackOption::Deinitialize,
|
||||
[this]() {
|
||||
_guiInstance->close(true);
|
||||
WebBrowserModule* webBrowserModule =
|
||||
OsEng.moduleEngine().module<WebBrowserModule>();
|
||||
|
||||
if (webBrowserModule) {
|
||||
webBrowserModule->removeBrowser(_guiInstance);
|
||||
}
|
||||
_guiInstance.reset();
|
||||
_guiInstance->draw();
|
||||
}
|
||||
);
|
||||
});
|
||||
|
||||
global::callback::deinitialize.push_back()[this]() {
|
||||
_guiInstance->close(true);
|
||||
WebBrowserModule* webBrowserModule =
|
||||
OsEng.moduleEngine().module<WebBrowserModule>();
|
||||
|
||||
if (webBrowserModule) {
|
||||
webBrowserModule->removeBrowser(_guiInstance);
|
||||
}
|
||||
_guiInstance.reset();
|
||||
});
|
||||
}
|
||||
|
||||
} // namespace openspace
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
|
||||
#include <modules/debugging/rendering/debugrenderer.h>
|
||||
|
||||
#include <openspace/engine/openspaceengine.h>
|
||||
#include <openspace/engine/globals.h>
|
||||
#include <openspace/rendering/renderengine.h>
|
||||
#include <ghoul/filesystem/filesystem.h>
|
||||
#include <ghoul/logging/logmanager.h>
|
||||
@@ -42,7 +42,7 @@ namespace openspace {
|
||||
DebugRenderer* DebugRenderer::_reference = nullptr;
|
||||
|
||||
DebugRenderer::DebugRenderer() {
|
||||
_programObject = OsEng.renderEngine().buildRenderProgram(
|
||||
_programObject = global::renderEngine.buildRenderProgram(
|
||||
"BasicDebugShader",
|
||||
absPath("${MODULE_DEBUGGING}/rendering/debugshader_vs.glsl"),
|
||||
absPath("${MODULE_DEBUGGING}/rendering/debugshader_fs.glsl")
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
#include <modules/spacecraftinstruments/rendering/renderableplanetprojection.h>
|
||||
#include <openspace/documentation/documentation.h>
|
||||
#include <openspace/documentation/verifier.h>
|
||||
#include <openspace/engine/openspaceengine.h>
|
||||
#include <openspace/engine/globals.h>
|
||||
#include <openspace/rendering/renderengine.h>
|
||||
#include <openspace/util/updatestructures.h>
|
||||
#include <ghoul/filesystem/filesystem.h>
|
||||
@@ -189,8 +189,7 @@ void RenderableDebugPlane::initializeGL() {
|
||||
createPlane();
|
||||
|
||||
if (!_shader) {
|
||||
RenderEngine& renderEngine = OsEng.renderEngine();
|
||||
_shader = renderEngine.buildRenderProgram("PlaneProgram",
|
||||
_shader = global::renderEngine.buildRenderProgram("PlaneProgram",
|
||||
absPath("${MODULE_BASE}/shaders/plane_vs.glsl"),
|
||||
absPath("${MODULE_BASE}/shaders/plane_fs.glsl")
|
||||
);
|
||||
@@ -204,9 +203,8 @@ void RenderableDebugPlane::deinitializeGL() {
|
||||
glDeleteBuffers(1, &_vertexPositionBuffer);
|
||||
_vertexPositionBuffer = 0;
|
||||
|
||||
RenderEngine& renderEngine = OsEng.renderEngine();
|
||||
if (_shader) {
|
||||
renderEngine.removeRenderProgram(_shader.get());
|
||||
global::renderEngine.removeRenderProgram(_shader.get());
|
||||
_shader = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -27,9 +27,9 @@
|
||||
#include <modules/digitaluniverse/digitaluniversemodule.h>
|
||||
#include <openspace/documentation/documentation.h>
|
||||
#include <openspace/documentation/verifier.h>
|
||||
#include <openspace/engine/globals.h>
|
||||
#include <openspace/engine/windowdelegate.h>
|
||||
#include <openspace/util/updatestructures.h>
|
||||
#include <openspace/engine/openspaceengine.h>
|
||||
#include <openspace/engine/wrapper/windowwrapper.h>
|
||||
#include <openspace/rendering/renderengine.h>
|
||||
#include <ghoul/filesystem/cachemanager.h>
|
||||
#include <ghoul/filesystem/filesystem.h>
|
||||
@@ -432,7 +432,7 @@ RenderableBillboardsCloud::RenderableBillboardsCloud(const ghoul::Dictionary& di
|
||||
_renderOption.addOption(0, "Camera View Direction");
|
||||
_renderOption.addOption(1, "Camera Position Normal");
|
||||
_renderOption.set(1);
|
||||
if (OsEng.windowWrapper().isFisheyeRendering()) {
|
||||
if (global::windowDelegate.isFisheyeRendering()) {
|
||||
_renderOption.set(1);
|
||||
}
|
||||
else {
|
||||
@@ -645,7 +645,7 @@ void RenderableBillboardsCloud::initializeGL() {
|
||||
_program = DigitalUniverseModule::ProgramObjectManager.request(
|
||||
ProgramObjectName,
|
||||
[]() -> std::unique_ptr<ghoul::opengl::ProgramObject> {
|
||||
return OsEng.renderEngine().buildRenderProgram(
|
||||
return global::renderEngine.buildRenderProgram(
|
||||
ProgramObjectName,
|
||||
absPath("${MODULE_DIGITALUNIVERSE}/shaders/billboard_vs.glsl"),
|
||||
absPath("${MODULE_DIGITALUNIVERSE}/shaders/billboard_fs.glsl"),
|
||||
@@ -675,7 +675,7 @@ void RenderableBillboardsCloud::initializeGL() {
|
||||
if (_hasLabel) {
|
||||
if (_font == nullptr) {
|
||||
size_t _fontSize = 50;
|
||||
_font = OsEng.fontManager().font(
|
||||
_font = global::fontManager.font(
|
||||
"Mono",
|
||||
static_cast<float>(_fontSize),
|
||||
ghoul::fontrendering::FontManager::Outline::Yes,
|
||||
@@ -694,7 +694,7 @@ void RenderableBillboardsCloud::deinitializeGL() {
|
||||
DigitalUniverseModule::ProgramObjectManager.release(
|
||||
ProgramObjectName,
|
||||
[](ghoul::opengl::ProgramObject* p) {
|
||||
OsEng.renderEngine().removeRenderProgram(p);
|
||||
global::renderEngine.removeRenderProgram(p);
|
||||
}
|
||||
);
|
||||
_program = nullptr;
|
||||
@@ -749,7 +749,7 @@ void RenderableBillboardsCloud::renderBillboards(const RenderData& data,
|
||||
const glm::dmat4 projMatrix = glm::dmat4(data.camera.projectionMatrix());
|
||||
_program->setUniform(
|
||||
"screenSize",
|
||||
glm::vec2(OsEng.renderEngine().renderingResolution())
|
||||
glm::vec2(global::renderEngine.renderingResolution())
|
||||
);
|
||||
|
||||
_program->setUniform(_uniformCache.cameraPos, data.camera.positionVec3());
|
||||
|
||||
@@ -28,8 +28,8 @@
|
||||
#include <openspace/documentation/documentation.h>
|
||||
#include <openspace/documentation/verifier.h>
|
||||
#include <openspace/util/updatestructures.h>
|
||||
#include <openspace/engine/openspaceengine.h>
|
||||
#include <openspace/engine/wrapper/windowwrapper.h>
|
||||
#include <openspace/engine/globals.h>
|
||||
#include <openspace/engine/windowdelegate.h>
|
||||
#include <openspace/rendering/renderengine.h>
|
||||
#include <ghoul/glm.h>
|
||||
#include <ghoul/filesystem/filesystem.h>
|
||||
@@ -275,7 +275,7 @@ RenderableDUMeshes::RenderableDUMeshes(const ghoul::Dictionary& dictionary)
|
||||
|
||||
_renderOption.addOption(0, "Camera View Direction");
|
||||
_renderOption.addOption(1, "Camera Position Normal");
|
||||
if (OsEng.windowWrapper().isFisheyeRendering()) {
|
||||
if (global::windowDelegate.isFisheyeRendering()) {
|
||||
_renderOption.set(1);
|
||||
}
|
||||
else {
|
||||
@@ -399,7 +399,7 @@ void RenderableDUMeshes::initializeGL() {
|
||||
_program = DigitalUniverseModule::ProgramObjectManager.request(
|
||||
ProgramObjectName,
|
||||
[]() -> std::unique_ptr<ghoul::opengl::ProgramObject> {
|
||||
return OsEng.renderEngine().buildRenderProgram(
|
||||
return global::renderEngine.buildRenderProgram(
|
||||
"RenderableDUMeshes",
|
||||
absPath("${MODULE_DIGITALUNIVERSE}/shaders/dumesh_vs.glsl"),
|
||||
absPath("${MODULE_DIGITALUNIVERSE}/shaders/dumesh_fs.glsl")
|
||||
@@ -419,7 +419,7 @@ void RenderableDUMeshes::initializeGL() {
|
||||
if (_hasLabel) {
|
||||
if (!_font) {
|
||||
constexpr const int FontSize = 50;
|
||||
_font = OsEng.fontManager().font(
|
||||
_font = global::fontManager.font(
|
||||
"Mono",
|
||||
static_cast<float>(FontSize),
|
||||
ghoul::fontrendering::FontManager::Outline::Yes,
|
||||
@@ -440,7 +440,7 @@ void RenderableDUMeshes::deinitializeGL() {
|
||||
DigitalUniverseModule::ProgramObjectManager.release(
|
||||
ProgramObjectName,
|
||||
[](ghoul::opengl::ProgramObject* p) {
|
||||
OsEng.renderEngine().removeRenderProgram(p);
|
||||
global::renderEngine.removeRenderProgram(p);
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
@@ -27,9 +27,9 @@
|
||||
#include <modules/digitaluniverse/digitaluniversemodule.h>
|
||||
#include <openspace/documentation/documentation.h>
|
||||
#include <openspace/documentation/verifier.h>
|
||||
#include <openspace/util/updatestructures.h>
|
||||
#include <openspace/engine/openspaceengine.h>
|
||||
#include <openspace/engine/globals.h>
|
||||
#include <openspace/rendering/renderengine.h>
|
||||
#include <openspace/util/updatestructures.h>
|
||||
#include <ghoul/filesystem/filesystem.h>
|
||||
#include <ghoul/font/fontmanager.h>
|
||||
#include <ghoul/font/fontrenderer.h>
|
||||
@@ -494,7 +494,7 @@ void RenderablePlanesCloud::initializeGL() {
|
||||
_program = DigitalUniverseModule::ProgramObjectManager.request(
|
||||
ProgramObjectName,
|
||||
[]() -> std::unique_ptr<ghoul::opengl::ProgramObject> {
|
||||
return OsEng.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 = OsEng.fontManager().font(
|
||||
_font = global::fontManager.font(
|
||||
"Mono",
|
||||
static_cast<float>(FontSize),
|
||||
ghoul::fontrendering::FontManager::Outline::Yes,
|
||||
@@ -537,7 +537,7 @@ void RenderablePlanesCloud::deinitializeGL() {
|
||||
DigitalUniverseModule::ProgramObjectManager.release(
|
||||
ProgramObjectName,
|
||||
[](ghoul::opengl::ProgramObject* p) {
|
||||
OsEng.renderEngine().removeRenderProgram(p);
|
||||
global::renderEngine.removeRenderProgram(p);
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
@@ -27,21 +27,21 @@
|
||||
#include <modules/digitaluniverse/digitaluniversemodule.h>
|
||||
#include <openspace/documentation/documentation.h>
|
||||
#include <openspace/documentation/verifier.h>
|
||||
#include <openspace/util/updatestructures.h>
|
||||
#include <openspace/engine/openspaceengine.h>
|
||||
#include <openspace/engine/globals.h>
|
||||
#include <openspace/rendering/renderengine.h>
|
||||
#include <openspace/util/updatestructures.h>
|
||||
#include <ghoul/filesystem/cachemanager.h>
|
||||
#include <ghoul/filesystem/filesystem.h>
|
||||
#include <ghoul/misc/templatefactory.h>
|
||||
#include <ghoul/io/texture/texturereader.h>
|
||||
#include <ghoul/logging/logmanager.h>
|
||||
#include <ghoul/misc/templatefactory.h>
|
||||
#include <ghoul/opengl/programobject.h>
|
||||
#include <ghoul/opengl/texture.h>
|
||||
#include <ghoul/opengl/textureunit.h>
|
||||
#include <array>
|
||||
#include <fstream>
|
||||
#include <stdint.h>
|
||||
#include <locale>
|
||||
#include <stdint.h>
|
||||
#include <string>
|
||||
|
||||
namespace {
|
||||
@@ -269,7 +269,7 @@ void RenderablePoints::initializeGL() {
|
||||
_program = DigitalUniverseModule::ProgramObjectManager.request(
|
||||
"RenderablePoints Sprite",
|
||||
[]() -> std::unique_ptr<ghoul::opengl::ProgramObject> {
|
||||
return OsEng.renderEngine().buildRenderProgram(
|
||||
return global::renderEngine.buildRenderProgram(
|
||||
"RenderablePoints Sprite",
|
||||
absPath("${MODULE_DIGITALUNIVERSE}/shaders/points_vs.glsl"),
|
||||
absPath("${MODULE_DIGITALUNIVERSE}/shaders/points_sprite_fs.glsl")
|
||||
@@ -281,7 +281,7 @@ void RenderablePoints::initializeGL() {
|
||||
_program = DigitalUniverseModule::ProgramObjectManager.request(
|
||||
"RenderablePoints",
|
||||
[]() -> std::unique_ptr<ghoul::opengl::ProgramObject> {
|
||||
return OsEng.renderEngine().buildRenderProgram(
|
||||
return global::renderEngine.buildRenderProgram(
|
||||
"RenderablePoints",
|
||||
absPath("${MODULE_DIGITALUNIVERSE}/shaders/points_vs.glsl"),
|
||||
absPath("${MODULE_DIGITALUNIVERSE}/shaders/points_sprite_fs.glsl")
|
||||
@@ -301,7 +301,7 @@ void RenderablePoints::deinitializeGL() {
|
||||
DigitalUniverseModule::ProgramObjectManager.release(
|
||||
_program->name(),
|
||||
[](ghoul::opengl::ProgramObject* p) {
|
||||
OsEng.renderEngine().removeRenderProgram(p);
|
||||
global::renderEngine.removeRenderProgram(p);
|
||||
}
|
||||
);
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
|
||||
#include <modules/fieldlines/rendering/renderablefieldlines.h>
|
||||
|
||||
#include <openspace/engine/openspaceengine.h>
|
||||
#include <openspace/engine/globals.h>
|
||||
#include <openspace/rendering/renderengine.h>
|
||||
#include <modules/kameleon/include/kameleonwrapper.h>
|
||||
#include <openspace/scene/scenegraphnode.h>
|
||||
@@ -200,7 +200,7 @@ void RenderableFieldlines::initializeGL() {
|
||||
throw ghoul::RuntimeError("Error initializing");
|
||||
}
|
||||
|
||||
_program = OsEng.renderEngine().buildRenderProgram(
|
||||
_program = global::renderEngine.buildRenderProgram(
|
||||
"Fieldline",
|
||||
absPath("${MODULE_FIELDLINES}/shaders/fieldline_vs.glsl"),
|
||||
absPath("${MODULE_FIELDLINES}/shaders/fieldline_fs.glsl"),
|
||||
@@ -214,9 +214,8 @@ void RenderableFieldlines::deinitializeGL() {
|
||||
glDeleteBuffers(1, &_vertexPositionBuffer);
|
||||
_vertexPositionBuffer = 0;
|
||||
|
||||
RenderEngine& renderEngine = OsEng.renderEngine();
|
||||
if (_program) {
|
||||
renderEngine.removeRenderProgram(_program.get());
|
||||
global::renderEngine.removeRenderProgram(_program.get());
|
||||
_program = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -26,8 +26,8 @@
|
||||
|
||||
#include <modules/fieldlinessequence/fieldlinessequencemodule.h>
|
||||
#include <modules/fieldlinessequence/util/kameleonfieldlinehelper.h>
|
||||
#include <openspace/engine/openspaceengine.h>
|
||||
#include <openspace/engine/wrapper/windowwrapper.h>
|
||||
#include <openspace/engine/globals.h>
|
||||
#include <openspace/engine/windowdelegate.h>
|
||||
#include <openspace/interaction/navigationhandler.h>
|
||||
#include <openspace/rendering/renderengine.h>
|
||||
#include <openspace/scene/scene.h>
|
||||
@@ -347,7 +347,7 @@ void RenderableFieldlinesSequence::initializeGL() {
|
||||
setupProperties();
|
||||
|
||||
// Setup shader program
|
||||
_shaderProgram = OsEng.renderEngine().buildRenderProgram(
|
||||
_shaderProgram = global::renderEngine.buildRenderProgram(
|
||||
"FieldlinesSequence",
|
||||
absPath("${MODULE_FIELDLINESSEQUENCE}/shaders/fieldlinessequence_vs.glsl"),
|
||||
absPath("${MODULE_FIELDLINESSEQUENCE}/shaders/fieldlinessequence_fs.glsl")
|
||||
@@ -756,19 +756,19 @@ void RenderableFieldlinesSequence::definePropertyCallbackFunctions() {
|
||||
}
|
||||
|
||||
_pFocusOnOriginBtn.onChange([this] {
|
||||
SceneGraphNode* node = OsEng.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;
|
||||
}
|
||||
OsEng.navigationHandler().setFocusNode(node->parent());
|
||||
OsEng.navigationHandler().resetCameraDirection();
|
||||
global::navigationHandler.setFocusNode(node->parent());
|
||||
global::navigationHandler.resetCameraDirection();
|
||||
});
|
||||
|
||||
_pJumpToStartBtn.onChange([this] {
|
||||
OsEng.timeManager().setTimeNextFrame(_startTimes[0]);
|
||||
global::timeManager.setTimeNextFrame(_startTimes[0]);
|
||||
});
|
||||
}
|
||||
|
||||
@@ -1023,9 +1023,8 @@ void RenderableFieldlinesSequence::deinitializeGL() {
|
||||
glDeleteBuffers(1, &_vertexMaskingBuffer);
|
||||
_vertexMaskingBuffer = 0;
|
||||
|
||||
RenderEngine& renderEngine = OsEng.renderEngine();
|
||||
if (_shaderProgram) {
|
||||
renderEngine.removeRenderProgram(_shaderProgram.get());
|
||||
global::renderEngine.removeRenderProgram(_shaderProgram.get());
|
||||
_shaderProgram = nullptr;
|
||||
}
|
||||
|
||||
@@ -1090,12 +1089,12 @@ void RenderableFieldlinesSequence::render(const RenderData& data, RendererTasks&
|
||||
_shaderProgram->setUniform("particleSpeed", _pFlowSpeed);
|
||||
_shaderProgram->setUniform(
|
||||
"time",
|
||||
OsEng.windowWrapper().applicationTime() * (_pFlowReversed ? -1 : 1)
|
||||
global::windowDelegate.applicationTime() * (_pFlowReversed ? -1 : 1)
|
||||
);
|
||||
|
||||
bool additiveBlending = false;
|
||||
if (_pColorABlendEnabled) {
|
||||
const auto renderer = OsEng.renderEngine().rendererImplementation();
|
||||
const auto renderer = global::renderEngine.rendererImplementation();
|
||||
const bool usingFBufferRenderer = renderer ==
|
||||
RenderEngine::RendererImplementation::Framebuffer;
|
||||
|
||||
|
||||
@@ -25,33 +25,25 @@
|
||||
#include <modules/galaxy/rendering/renderablegalaxy.h>
|
||||
|
||||
#include <modules/galaxy/rendering/galaxyraycaster.h>
|
||||
|
||||
#include <ghoul/io/texture/texturereader.h>
|
||||
|
||||
#include <modules/galaxy/rendering/galaxyraycaster.h>
|
||||
#include <openspace/util/boxgeometry.h>
|
||||
#include <modules/volume/rawvolume.h>
|
||||
#include <openspace/util/updatestructures.h>
|
||||
|
||||
#include <openspace/rendering/renderable.h>
|
||||
#include <openspace/engine/openspaceengine.h>
|
||||
#include <openspace/rendering/renderengine.h>
|
||||
#include <openspace/rendering/raycastermanager.h>
|
||||
#include <ghoul/glm.h>
|
||||
#include <glm/gtc/matrix_transform.hpp>
|
||||
#include <ghoul/opengl/ghoul_gl.h>
|
||||
|
||||
#include <modules/volume/rawvolumereader.h>
|
||||
#include <openspace/engine/globals.h>
|
||||
#include <openspace/rendering/raycastermanager.h>
|
||||
#include <openspace/rendering/renderable.h>
|
||||
#include <openspace/rendering/renderengine.h>
|
||||
#include <openspace/util/boxgeometry.h>
|
||||
#include <openspace/util/updatestructures.h>
|
||||
#include <ghoul/glm.h>
|
||||
#include <ghoul/filesystem/filesystem.h>
|
||||
#include <ghoul/io/texture/texturereader.h>
|
||||
#include <ghoul/logging/logmanager.h>
|
||||
#include <ghoul/opengl/ghoul_gl.h>
|
||||
#include <ghoul/opengl/programobject.h>
|
||||
#include <ghoul/opengl/texture.h>
|
||||
#include <ghoul/opengl/textureunit.h>
|
||||
|
||||
#include <ghoul/opengl/programobject.h>
|
||||
|
||||
#include <glm/gtc/matrix_transform.hpp>
|
||||
#include <fstream>
|
||||
|
||||
|
||||
namespace {
|
||||
constexpr const char* GlslRayCastPath = "${MODULES}/toyvolume/shaders/rayCast.glsl";
|
||||
constexpr const char* GlslBoundsVsPath = "${MODULES}/toyvolume/shaders/boundsVs.glsl";
|
||||
@@ -175,14 +167,14 @@ void RenderableGalaxy::initializeGL() {
|
||||
_raycaster = std::make_unique<GalaxyRaycaster>(*_texture);
|
||||
_raycaster->initialize();
|
||||
|
||||
OsEng.renderEngine().raycasterManager().attachRaycaster(*_raycaster.get());
|
||||
global::raycasterManager.attachRaycaster(*_raycaster.get());
|
||||
|
||||
auto onChange = [&](bool enabled) {
|
||||
if (enabled) {
|
||||
OsEng.renderEngine().raycasterManager().attachRaycaster(*_raycaster.get());
|
||||
global::raycasterManager.attachRaycaster(*_raycaster.get());
|
||||
}
|
||||
else {
|
||||
OsEng.renderEngine().raycasterManager().detachRaycaster(*_raycaster.get());
|
||||
global::raycasterManager.detachRaycaster(*_raycaster.get());
|
||||
}
|
||||
};
|
||||
|
||||
@@ -250,8 +242,7 @@ void RenderableGalaxy::initializeGL() {
|
||||
GL_STATIC_DRAW
|
||||
);
|
||||
|
||||
RenderEngine& renderEngine = OsEng.renderEngine();
|
||||
_pointsProgram = renderEngine.buildRenderProgram(
|
||||
_pointsProgram = global::renderEngine.buildRenderProgram(
|
||||
"Galaxy points",
|
||||
absPath("${MODULE_GALAXY}/shaders/points.vs"),
|
||||
absPath("${MODULE_GALAXY}/shaders/points.fs")
|
||||
@@ -278,7 +269,7 @@ void RenderableGalaxy::initializeGL() {
|
||||
|
||||
void RenderableGalaxy::deinitializeGL() {
|
||||
if (_raycaster) {
|
||||
OsEng.renderEngine().raycasterManager().detachRaycaster(*_raycaster.get());
|
||||
global::raycasterManager.detachRaycaster(*_raycaster.get());
|
||||
_raycaster = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
#include <modules/globebrowsing/globes/renderableglobe.h>
|
||||
#include <openspace/documentation/documentation.h>
|
||||
#include <openspace/documentation/verifier.h>
|
||||
#include <openspace/engine/openspaceengine.h>
|
||||
#include <openspace/engine/globals.h>
|
||||
#include <openspace/interaction/navigationhandler.h>
|
||||
#include <openspace/scene/scenegraphnode.h>
|
||||
#include <openspace/util/distanceconversion.h>
|
||||
@@ -116,7 +116,7 @@ DashboardItemGlobeLocation::DashboardItemGlobeLocation(
|
||||
: DashboardItem(dictionary)
|
||||
, _fontName(FontNameInfo, KeyFontMono)
|
||||
, _fontSize(FontSizeInfo, DefaultFontSize, 6.f, 144.f, 1.f)
|
||||
, _font(OsEng.fontManager().font(KeyFontMono, 10))
|
||||
, _font(global::fontManager.font(KeyFontMono, 10))
|
||||
{
|
||||
documentation::testSpecificationAndThrow(
|
||||
Documentation(),
|
||||
@@ -132,30 +132,30 @@ DashboardItemGlobeLocation::DashboardItemGlobeLocation(
|
||||
}
|
||||
|
||||
_fontName.onChange([this]() {
|
||||
_font = OsEng.fontManager().font(_fontName, _fontSize);
|
||||
_font = global::fontManager.font(_fontName, _fontSize);
|
||||
});
|
||||
addProperty(_fontName);
|
||||
|
||||
_fontSize.onChange([this]() {
|
||||
_font = OsEng.fontManager().font(_fontName, _fontSize);
|
||||
_font = global::fontManager.font(_fontName, _fontSize);
|
||||
});
|
||||
addProperty(_fontSize);
|
||||
|
||||
_font = OsEng.fontManager().font(_fontName, _fontSize);
|
||||
_font = global::fontManager.font(_fontName, _fontSize);
|
||||
}
|
||||
|
||||
void DashboardItemGlobeLocation::render(glm::vec2& penPosition) {
|
||||
using namespace globebrowsing;
|
||||
|
||||
SceneGraphNode* n = OsEng.navigationHandler().focusNode();
|
||||
SceneGraphNode* n = global::navigationHandler.focusNode();
|
||||
const RenderableGlobe* globe = dynamic_cast<const RenderableGlobe*>(n->renderable());
|
||||
if (!globe) {
|
||||
return;
|
||||
}
|
||||
|
||||
const glm::dvec3 cameraPosition = OsEng.navigationHandler().camera()->positionVec3();
|
||||
const glm::dvec3 cameraPosition = global::navigationHandler.camera()->positionVec3();
|
||||
const glm::dmat4 inverseModelTransform =
|
||||
OsEng.navigationHandler().focusNode()->inverseModelTransform();
|
||||
global::navigationHandler.focusNode()->inverseModelTransform();
|
||||
const glm::dvec3 cameraPositionModelSpace =
|
||||
glm::dvec3(inverseModelTransform * glm::dvec4(cameraPosition, 1.0));
|
||||
const SurfacePositionHandle posHandle = globe->calculateSurfacePositionHandle(
|
||||
|
||||
@@ -38,6 +38,7 @@
|
||||
#include <modules/globebrowsing/tile/tileprovider/tileprovider.h>
|
||||
#include <modules/globebrowsing/tile/tileprovider/tileproviderbylevel.h>
|
||||
#include <modules/globebrowsing/tile/tileprovider/tileproviderbyindex.h>
|
||||
#include <openspace/engine/globalscallbacks.h>
|
||||
#include <openspace/scripting/lualibrary.h>
|
||||
#include <openspace/util/factorymanager.h>
|
||||
#include <ghoul/filesystem/filesystem.h>
|
||||
@@ -130,49 +131,31 @@ namespace openspace {
|
||||
GlobeBrowsingModule::GlobeBrowsingModule() : OpenSpaceModule(Name) {}
|
||||
|
||||
void GlobeBrowsingModule::internalInitialize(const ghoul::Dictionary&) {
|
||||
// TODO: Remove dependency on OsEng.
|
||||
// Instead, make this class implement an interface that OsEng depends on.
|
||||
// Do not try to register module callbacks if OsEng does not exist,
|
||||
// for example in the TaskRunner.
|
||||
|
||||
if (!OpenSpaceEngine::isCreated()) {
|
||||
return;
|
||||
}
|
||||
|
||||
using namespace globebrowsing;
|
||||
|
||||
// Initialize
|
||||
OsEng.registerModuleCallback(
|
||||
OpenSpaceEngine::CallbackOption::Initialize,
|
||||
[&]() {
|
||||
_tileCache = std::make_unique<globebrowsing::cache::MemoryAwareTileCache>();
|
||||
addPropertySubOwner(*_tileCache);
|
||||
global::callback::initializeGL.push_back([&]() {
|
||||
_tileCache = std::make_unique<globebrowsing::cache::MemoryAwareTileCache>();
|
||||
addPropertySubOwner(*_tileCache);
|
||||
|
||||
#ifdef GLOBEBROWSING_USE_GDAL
|
||||
// Convert from MB to Bytes
|
||||
GdalWrapper::create(
|
||||
16ULL * 1024ULL * 1024ULL, // 16 MB
|
||||
static_cast<size_t>(CpuCap.installedMainMemory() * 0.25 * 1024 * 1024)
|
||||
);
|
||||
addPropertySubOwner(GdalWrapper::ref());
|
||||
// Convert from MB to Bytes
|
||||
GdalWrapper::create(
|
||||
16ULL * 1024ULL * 1024ULL, // 16 MB
|
||||
static_cast<size_t>(CpuCap.installedMainMemory() * 0.25 * 1024 * 1024)
|
||||
);
|
||||
addPropertySubOwner(GdalWrapper::ref());
|
||||
#endif // GLOBEBROWSING_USE_GDAL
|
||||
}
|
||||
);
|
||||
});
|
||||
|
||||
|
||||
// Render
|
||||
OsEng.registerModuleCallback(
|
||||
OpenSpaceEngine::CallbackOption::Render,
|
||||
[&]() { _tileCache->update(); }
|
||||
);
|
||||
global::callback::render.push_back([&]() { _tileCache->update(); });
|
||||
|
||||
// Deinitialize
|
||||
OsEng.registerModuleCallback(
|
||||
OpenSpaceEngine::CallbackOption::Deinitialize,
|
||||
[&]() {
|
||||
#ifdef GLOBEBROWSING_USE_GDAL
|
||||
GdalWrapper::ref().destroy();
|
||||
global::callback::deinitialize.push_back([&]() { GdalWrapper::ref().destroy(); });
|
||||
#endif // GLOBEBROWSING_USE_GDAL
|
||||
}
|
||||
);
|
||||
|
||||
// Get factories
|
||||
auto fRenderable = FactoryManager::ref().factory<Renderable>();
|
||||
@@ -331,13 +314,13 @@ scripting::LuaLibrary GlobeBrowsingModule::luaLibrary() const {
|
||||
}
|
||||
|
||||
void GlobeBrowsingModule::goToChunk(int x, int y, int level) {
|
||||
Camera* cam = OsEng.navigationHandler().camera();
|
||||
Camera* cam = global::navigationHandler.camera();
|
||||
goToChunk(*cam, globebrowsing::TileIndex(x,y,level), glm::vec2(0.5f, 0.5f), true);
|
||||
}
|
||||
|
||||
void GlobeBrowsingModule::goToGeo(double latitude, double longitude) {
|
||||
using namespace globebrowsing;
|
||||
Camera* cam = OsEng.navigationHandler().camera();
|
||||
Camera* cam = global::navigationHandler.camera();
|
||||
goToGeodetic2(*cam, Geodetic2(
|
||||
Angle<double>::fromDegrees(latitude).asRadians(),
|
||||
Angle<double>::fromDegrees(longitude).asRadians()), true);
|
||||
@@ -348,7 +331,7 @@ void GlobeBrowsingModule::goToGeo(double latitude, double longitude,
|
||||
{
|
||||
using namespace globebrowsing;
|
||||
|
||||
Camera* cam = OsEng.navigationHandler().camera();
|
||||
Camera* cam = global::navigationHandler.camera();
|
||||
goToGeodetic3(
|
||||
*cam,
|
||||
{
|
||||
@@ -427,9 +410,9 @@ void GlobeBrowsingModule::goToGeodetic2(Camera& camera, globebrowsing::Geodetic2
|
||||
return;
|
||||
}
|
||||
|
||||
const glm::dvec3 cameraPosition = OsEng.navigationHandler().camera()->positionVec3();
|
||||
const glm::dvec3 cameraPosition = global::navigationHandler.camera()->positionVec3();
|
||||
const glm::dmat4 inverseModelTransform =
|
||||
OsEng.navigationHandler().focusNode()->inverseModelTransform();
|
||||
global::navigationHandler.focusNode()->inverseModelTransform();
|
||||
const glm::dvec3 cameraPositionModelSpace =
|
||||
glm::dvec3(inverseModelTransform * glm::dvec4(cameraPosition, 1.0));
|
||||
const SurfacePositionHandle posHandle = globe->calculateSurfacePositionHandle(
|
||||
@@ -512,7 +495,7 @@ GlobeBrowsingModule::castFocusNodeRenderableToGlobe()
|
||||
{
|
||||
using namespace globebrowsing;
|
||||
|
||||
const Renderable* renderable = OsEng.navigationHandler().focusNode()->renderable();
|
||||
const Renderable* renderable = global::navigationHandler.focusNode()->renderable();
|
||||
if (!renderable) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
@@ -28,8 +28,8 @@
|
||||
#include <modules/globebrowsing/rendering/layer/layermanager.h>
|
||||
#include <modules/globebrowsing/rendering/layer/layer.h>
|
||||
|
||||
#include <openspace/engine/openspaceengine.h>
|
||||
#include <openspace/interaction/navigationhandler.h>
|
||||
#include <openspace/engine/globals.h>
|
||||
#include <openspace/engine/moduleengine.h>
|
||||
#include <openspace/rendering/renderengine.h>
|
||||
#include <openspace/rendering/renderable.h>
|
||||
@@ -52,7 +52,7 @@ int addLayer(lua_State* L) {
|
||||
const std::string& layerGroupName = ghoul::lua::value<std::string>(L, 2);
|
||||
|
||||
// Get the node and make sure it exists
|
||||
SceneGraphNode* n = OsEng.renderEngine().scene()->sceneGraphNode(globeName);
|
||||
SceneGraphNode* n = global::renderEngine.scene()->sceneGraphNode(globeName);
|
||||
if (!n) {
|
||||
return ghoul::lua::luaError(L, "Unknown globe name: " + globeName);
|
||||
}
|
||||
@@ -102,7 +102,7 @@ int deleteLayer(lua_State* L) {
|
||||
lua_pop(L, 3);
|
||||
|
||||
// Get the node and make sure it exists
|
||||
SceneGraphNode* n = OsEng.renderEngine().scene()->sceneGraphNode(globeName);
|
||||
SceneGraphNode* n = global::renderEngine.scene()->sceneGraphNode(globeName);
|
||||
if (!n) {
|
||||
return ghoul::lua::luaError(L, "Unknown globe name: " + globeName);
|
||||
}
|
||||
@@ -133,7 +133,7 @@ int goToChunk(lua_State* L) {
|
||||
const int level = ghoul::lua::value<int>(L, 3);
|
||||
lua_pop(L, 3);
|
||||
|
||||
OsEng.moduleEngine().module<GlobeBrowsingModule>()->goToChunk(x, y, level);
|
||||
global::moduleEngine.module<GlobeBrowsingModule>()->goToChunk(x, y, level);
|
||||
|
||||
ghoul_assert(lua_gettop(L) == 0, "Incorrect number of items left on stack");
|
||||
return 0;
|
||||
@@ -146,11 +146,11 @@ int goToGeo(lua_State* L) {
|
||||
const double longitude = ghoul::lua::value<double>(L, 2);
|
||||
|
||||
if (nArguments == 2) {
|
||||
OsEng.moduleEngine().module<GlobeBrowsingModule>()->goToGeo(latitude, longitude);
|
||||
global::moduleEngine.module<GlobeBrowsingModule>()->goToGeo(latitude, longitude);
|
||||
}
|
||||
else if (nArguments == 3) {
|
||||
const double altitude = ghoul::lua::value<double>(L, 3);
|
||||
OsEng.moduleEngine().module<GlobeBrowsingModule>()->goToGeo(
|
||||
global::moduleEngine.module<GlobeBrowsingModule>()->goToGeo(
|
||||
latitude,
|
||||
longitude,
|
||||
altitude
|
||||
@@ -181,7 +181,7 @@ int getGeoPosition(lua_State* L) {
|
||||
return ghoul::lua::luaError(L, "Name must be a RenderableGlobe");
|
||||
}
|
||||
|
||||
GlobeBrowsingModule& mod = *(OsEng.moduleEngine().module<GlobeBrowsingModule>());
|
||||
GlobeBrowsingModule& mod = *(global::moduleEngine.module<GlobeBrowsingModule>());
|
||||
glm::vec3 pos = mod.cartesianCoordinatesFromGeo(
|
||||
*globe,
|
||||
latitude,
|
||||
@@ -198,15 +198,15 @@ int getGeoPosition(lua_State* L) {
|
||||
int getGeoPositionForCamera(lua_State* L) {
|
||||
ghoul::lua::checkArgumentsAndThrow(L, 0, "lua::getGeoPositionForCamera");
|
||||
|
||||
GlobeBrowsingModule* module = OsEng.moduleEngine().module<GlobeBrowsingModule>();
|
||||
GlobeBrowsingModule* module = global::moduleEngine.module<GlobeBrowsingModule>();
|
||||
const RenderableGlobe* globe = module->castFocusNodeRenderableToGlobe();
|
||||
if (!globe) {
|
||||
return ghoul::lua::luaError(L, "Focus node must be a RenderableGlobe");
|
||||
}
|
||||
|
||||
const glm::dvec3 cameraPosition = OsEng.navigationHandler().camera()->positionVec3();
|
||||
const glm::dvec3 cameraPosition = global::navigationHandler.camera()->positionVec3();
|
||||
const glm::dmat4 inverseModelTransform =
|
||||
OsEng.navigationHandler().focusNode()->inverseModelTransform();
|
||||
global::navigationHandler.focusNode()->inverseModelTransform();
|
||||
const glm::dvec3 cameraPositionModelSpace =
|
||||
glm::dvec3(inverseModelTransform * glm::dvec4(cameraPosition, 1.0));
|
||||
const SurfacePositionHandle posHandle = globe->calculateSurfacePositionHandle(
|
||||
@@ -238,7 +238,7 @@ int loadWMSCapabilities(lua_State* L) {
|
||||
std::string globe = ghoul::lua::value<std::string>(L, 2);
|
||||
std::string url = ghoul::lua::value<std::string>(L, 3);
|
||||
|
||||
OsEng.moduleEngine().module<GlobeBrowsingModule>()->loadWMSCapabilities(
|
||||
global::moduleEngine.module<GlobeBrowsingModule>()->loadWMSCapabilities(
|
||||
std::move(name),
|
||||
std::move(globe),
|
||||
std::move(url)
|
||||
@@ -259,7 +259,7 @@ int removeWMSServer(lua_State* L) {
|
||||
ghoul::lua::PopValue::Yes
|
||||
);
|
||||
|
||||
OsEng.moduleEngine().module<GlobeBrowsingModule>()->removeWMSServer(name);
|
||||
global::moduleEngine.module<GlobeBrowsingModule>()->removeWMSServer(name);
|
||||
|
||||
ghoul_assert(lua_gettop(L) == 0, "Incorrect number of items left on stack");
|
||||
return 0;
|
||||
@@ -274,7 +274,7 @@ int capabilities(lua_State* L) {
|
||||
ghoul::lua::PopValue::Yes
|
||||
);
|
||||
GlobeBrowsingModule::Capabilities cap =
|
||||
OsEng.moduleEngine().module<GlobeBrowsingModule>()->capabilities(name);
|
||||
global::moduleEngine.module<GlobeBrowsingModule>()->capabilities(name);
|
||||
|
||||
lua_newtable(L);
|
||||
for (unsigned long i = 0; i < cap.size(); ++i) {
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
#include <modules/globebrowsing/globes/pointglobe.h>
|
||||
|
||||
#include <modules/globebrowsing/globes/renderableglobe.h>
|
||||
#include <openspace/engine/openspaceengine.h>
|
||||
#include <openspace/engine/globals.h>
|
||||
#include <openspace/rendering/renderengine.h>
|
||||
#include <openspace/util/updatestructures.h>
|
||||
#include <ghoul/filesystem/filesystem.h>
|
||||
@@ -67,7 +67,7 @@ PointGlobe::~PointGlobe() {
|
||||
}
|
||||
|
||||
void PointGlobe::initialize() {
|
||||
_programObject = OsEng.renderEngine().buildRenderProgram(
|
||||
_programObject = global::renderEngine.buildRenderProgram(
|
||||
"PointGlobe",
|
||||
absPath("${MODULE_GLOBEBROWSING}/shaders/pointglobe_vs.glsl"),
|
||||
absPath("${MODULE_GLOBEBROWSING}/shaders/pointglobe_fs.glsl")
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
#include <modules/globebrowsing/rendering/layer/layer.h>
|
||||
#include <modules/globebrowsing/rendering/layer/layergroup.h>
|
||||
#include <modules/globebrowsing/rendering/layer/layermanager.h>
|
||||
#include <openspace/engine/openspaceengine.h>
|
||||
#include <openspace/engine/globals.h>
|
||||
#include <openspace/rendering/renderengine.h>
|
||||
#include <ghoul/filesystem/filesystem.h>
|
||||
#include <ghoul/opengl/programobject.h>
|
||||
@@ -141,8 +141,7 @@ LayerShaderManager::LayerShaderManager(std::string shaderName, std::string vsPat
|
||||
|
||||
LayerShaderManager::~LayerShaderManager() {
|
||||
if (_programObject) {
|
||||
RenderEngine& renderEngine = OsEng.renderEngine();
|
||||
renderEngine.removeRenderProgram(_programObject.get());
|
||||
global::renderEngine.removeRenderProgram(_programObject.get());
|
||||
_programObject = nullptr;
|
||||
}
|
||||
}
|
||||
@@ -231,9 +230,9 @@ void LayerShaderManager::recompileShaderProgram(
|
||||
}
|
||||
|
||||
// Remove old program
|
||||
OsEng.renderEngine().removeRenderProgram(_programObject.get());
|
||||
global::renderEngine.removeRenderProgram(_programObject.get());
|
||||
|
||||
_programObject = OsEng.renderEngine().buildRenderProgram(
|
||||
_programObject = global::renderEngine.buildRenderProgram(
|
||||
_shaderName,
|
||||
absPath(_vsPath),
|
||||
absPath(_fsPath),
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
#include <modules/globebrowsing/tile/tileloadjob.h>
|
||||
#include <modules/globebrowsing/tile/rawtiledatareader/rawtiledatareader.h>
|
||||
#include <openspace/engine/moduleengine.h>
|
||||
#include <openspace/engine/openspaceengine.h>
|
||||
#include <openspace/engine/globals.h>
|
||||
#include <ghoul/logging/logmanager.h>
|
||||
#include <ghoul/opengl/ghoul_gl.h>
|
||||
|
||||
@@ -46,7 +46,7 @@ AsyncTileDataProvider::AsyncTileDataProvider(std::string name,
|
||||
, _rawTileDataReader(std::move(rawTileDataReader))
|
||||
, _concurrentJobManager(LRUThreadPool<TileIndex::TileHashKey>(1, 10))
|
||||
{
|
||||
_globeBrowsingModule = OsEng.moduleEngine().module<GlobeBrowsingModule>();
|
||||
_globeBrowsingModule = global::moduleEngine.module<GlobeBrowsingModule>();
|
||||
performReset(ResetRawTileDataReader::No);
|
||||
}
|
||||
|
||||
|
||||
@@ -26,8 +26,8 @@
|
||||
|
||||
#include <modules/globebrowsing/tile/rawtiledatareader/gdalwrapper.h>
|
||||
|
||||
#include <openspace/engine/openspaceengine.h>
|
||||
#include <openspace/engine/configuration.h>
|
||||
#include <openspace/engine/globals.h>
|
||||
|
||||
#include <ghoul/filesystem/filesystem.h>
|
||||
#include <ghoul/ghoul.h>
|
||||
@@ -131,12 +131,12 @@ GdalWrapper::GdalWrapper(size_t maximumCacheSize, size_t maximumMaximumCacheSize
|
||||
}
|
||||
|
||||
void GdalWrapper::setGdalProxyConfiguration() {
|
||||
if (OsEng.configuration().httpProxy.usingHttpProxy) {
|
||||
const std::string address = OsEng.configuration().httpProxy.address;
|
||||
const unsigned int port = OsEng.configuration().httpProxy.port;
|
||||
const std::string user = OsEng.configuration().httpProxy.user;
|
||||
const std::string password = OsEng.configuration().httpProxy.password;
|
||||
std::string auth = OsEng.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(),
|
||||
|
||||
@@ -417,7 +417,9 @@ GDALDataType getGdalDataType(GLenum glType) {
|
||||
case GL_DOUBLE:
|
||||
return GDT_Float64;
|
||||
default:
|
||||
LERROR(fmt::format("OpenGL data type unknown to GDAL: {}", glType));
|
||||
LERROR(fmt::format(
|
||||
"OpenGL data type unknown to GDAL: {}", static_cast<int>(glType)
|
||||
));
|
||||
throw ghoul::MissingCaseException();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
#include <modules/globebrowsing/rendering/layer/layermanager.h>
|
||||
#include <modules/globebrowsing/tile/asynctiledataprovider.h>
|
||||
#include <modules/globebrowsing/tile/rawtiledatareader/gdalrawtiledatareader.h>
|
||||
#include <openspace/engine/openspaceengine.h>
|
||||
#include <openspace/engine/globals.h>
|
||||
#include <openspace/engine/moduleengine.h>
|
||||
#include <ghoul/logging/logmanager.h>
|
||||
|
||||
@@ -64,7 +64,7 @@ DefaultTileProvider::DefaultTileProvider(const ghoul::Dictionary& dictionary)
|
||||
, _filePath(FilePathInfo, "")
|
||||
, _tilePixelSize(TilePixelSizeInfo, 32, 32, 2048)
|
||||
{
|
||||
_tileCache = OsEng.moduleEngine().module<GlobeBrowsingModule>()->tileCache();
|
||||
_tileCache = global::moduleEngine.module<GlobeBrowsingModule>()->tileCache();
|
||||
_name = "Name unspecified";
|
||||
dictionary.getValue("Name", _name);
|
||||
std::string _loggerCat = "DefaultTileProvider : " + _name;
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
|
||||
#include <modules/globebrowsing/geometry/geodeticpatch.h>
|
||||
#include <modules/globebrowsing/rendering/layer/layermanager.h>
|
||||
#include <openspace/engine/openspaceengine.h>
|
||||
#include <openspace/engine/globals.h>
|
||||
#include <ghoul/fmt.h>
|
||||
#include <ghoul/font/fontmanager.h>
|
||||
#include <ghoul/font/fontrenderer.h>
|
||||
@@ -48,7 +48,7 @@ SizeReferenceTileProvider::SizeReferenceTileProvider(const ghoul::Dictionary& di
|
||||
)
|
||||
{
|
||||
_fontSize = 50;
|
||||
_font = OsEng.fontManager().font("Mono", static_cast<float>(_fontSize));
|
||||
_font = global::fontManager.font("Mono", static_cast<float>(_fontSize));
|
||||
|
||||
if (dictionary.hasKeyAndValue<glm::dvec3>(KeyRadii)) {
|
||||
_ellipsoid = dictionary.value<glm::dvec3>(KeyRadii);
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
|
||||
#include <modules/globebrowsing/tile/tiledepthtransform.h>
|
||||
#include <modules/globebrowsing/tile/tileprovider/defaulttileprovider.h>
|
||||
#include <openspace/engine/openspaceengine.h>
|
||||
#include <openspace/engine/globals.h>
|
||||
#include <openspace/util/timemanager.h>
|
||||
#include <ghoul/filesystem/file.h>
|
||||
#include <ghoul/filesystem/filesystem.h>
|
||||
@@ -302,7 +302,7 @@ void TemporalTileProvider::ensureUpdated() {
|
||||
void TemporalTileProvider::update() {
|
||||
if (_successfulInitialization) {
|
||||
std::shared_ptr<TileProvider> newCurrent = getTileProvider(
|
||||
OsEng.timeManager().time()
|
||||
global::timeManager.time()
|
||||
);
|
||||
if (newCurrent) {
|
||||
_currentTileProvider = newCurrent;
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
#include <modules/globebrowsing/geometry/geodeticpatch.h>
|
||||
#include <modules/globebrowsing/cache/memoryawaretilecache.h>
|
||||
#include <modules/globebrowsing/tile/tiledepthtransform.h>
|
||||
#include <openspace/engine/openspaceengine.h>
|
||||
#include <openspace/engine/globals.h>
|
||||
#include <openspace/engine/moduleengine.h>
|
||||
|
||||
#include <ghoul/filesystem/filesystem.h>
|
||||
@@ -45,7 +45,7 @@ TextTileProvider::TextTileProvider(const TileTextureInitData& initData, size_t f
|
||||
: _initData(initData)
|
||||
, _fontSize(fontSize)
|
||||
{
|
||||
_tileCache = OsEng.moduleEngine().module<GlobeBrowsingModule>()->tileCache();
|
||||
_tileCache = global::moduleEngine.module<GlobeBrowsingModule>()->tileCache();
|
||||
}
|
||||
|
||||
TextTileProvider::~TextTileProvider() {} // NOLINT
|
||||
@@ -53,7 +53,7 @@ TextTileProvider::~TextTileProvider() {} // NOLINT
|
||||
bool TextTileProvider::initialize() {
|
||||
bool res = TileProvider::initialize();
|
||||
|
||||
_font = OsEng.fontManager().font("Mono", static_cast<float>(_fontSize));
|
||||
_font = global::fontManager.font("Mono", static_cast<float>(_fontSize));
|
||||
|
||||
_fontRenderer = FontRenderer::createDefault();
|
||||
_fontRenderer->setFramebufferSize(glm::vec2(_initData.dimensions()));
|
||||
|
||||
+128
-152
@@ -24,9 +24,10 @@
|
||||
|
||||
#include <modules/imgui/imguimodule.h>
|
||||
|
||||
#include <openspace/engine/openspaceengine.h>
|
||||
#include <openspace/engine/globals.h>
|
||||
#include <openspace/engine/globalscallbacks.h>
|
||||
#include <openspace/engine/virtualpropertymanager.h>
|
||||
#include <openspace/engine/wrapper/windowwrapper.h>
|
||||
#include <openspace/engine/windowdelegate.h>
|
||||
#include <openspace/engine/moduleengine.h>
|
||||
#include <openspace/interaction/navigationhandler.h>
|
||||
#include <openspace/network/parallelpeer.h>
|
||||
@@ -41,164 +42,139 @@ namespace openspace {
|
||||
ImGUIModule::ImGUIModule() : OpenSpaceModule(Name) {
|
||||
addPropertySubOwner(gui);
|
||||
|
||||
// TODO: Remove dependency on OsEng.
|
||||
// Instead, make this class implement an interface that OsEng depends on.
|
||||
// Do not try to register module callbacks if OsEng does not exist,
|
||||
// for example in the TaskRunner.
|
||||
global::callback::initialize.push_back([&]() {
|
||||
LDEBUGC("ImGUIModule", "Initializing GUI");
|
||||
gui.initialize();
|
||||
|
||||
if (!OpenSpaceEngine::isCreated()) {
|
||||
return;
|
||||
}
|
||||
|
||||
OsEng.registerModuleCallback(
|
||||
OpenSpaceEngine::CallbackOption::Initialize,
|
||||
[&](){
|
||||
LDEBUGC("ImGUIModule", "Initializing GUI");
|
||||
gui.initialize();
|
||||
|
||||
gui._globalProperty.setSource(
|
||||
[]() {
|
||||
std::vector<properties::PropertyOwner*> res = {
|
||||
&(OsEng.windowWrapper()),
|
||||
&(OsEng.navigationHandler()),
|
||||
&(OsEng.timeManager()),
|
||||
&(OsEng.renderEngine()),
|
||||
&(OsEng.parallelPeer()),
|
||||
&(OsEng.console()),
|
||||
&(OsEng.dashboard())
|
||||
};
|
||||
return res;
|
||||
}
|
||||
);
|
||||
|
||||
gui._screenSpaceProperty.setSource(
|
||||
[]() {
|
||||
return OsEng.renderEngine().screenSpaceOwner().propertySubOwners();
|
||||
}
|
||||
);
|
||||
|
||||
gui._moduleProperty.setSource(
|
||||
[]() {
|
||||
std::vector<properties::PropertyOwner*> v;
|
||||
v.push_back(&(OsEng.moduleEngine()));
|
||||
return v;
|
||||
}
|
||||
);
|
||||
|
||||
gui._sceneProperty.setSource(
|
||||
[]() {
|
||||
const Scene* scene = OsEng.renderEngine().scene();
|
||||
const std::vector<SceneGraphNode*>& nodes = scene ?
|
||||
scene->allSceneGraphNodes() :
|
||||
std::vector<SceneGraphNode*>();
|
||||
|
||||
return std::vector<properties::PropertyOwner*>(
|
||||
nodes.begin(),
|
||||
nodes.end()
|
||||
);
|
||||
}
|
||||
);
|
||||
|
||||
gui._virtualProperty.setSource(
|
||||
[]() {
|
||||
std::vector<properties::PropertyOwner*> res = {
|
||||
&(OsEng.virtualPropertyManager())
|
||||
};
|
||||
|
||||
return res;
|
||||
}
|
||||
);
|
||||
|
||||
gui._featuredProperties.setSource(
|
||||
[](){
|
||||
std::vector<SceneGraphNode*> nodes =
|
||||
OsEng.renderEngine().scene()->allSceneGraphNodes();
|
||||
|
||||
nodes.erase(
|
||||
std::remove_if(
|
||||
nodes.begin(),
|
||||
nodes.end(),
|
||||
[](SceneGraphNode* n) {
|
||||
const std::vector<std::string>& tags = n->tags();
|
||||
const auto it = std::find(
|
||||
tags.begin(),
|
||||
tags.end(),
|
||||
"GUI.Interesting"
|
||||
);
|
||||
return it == tags.end();
|
||||
}
|
||||
),
|
||||
nodes.end()
|
||||
);
|
||||
return std::vector<properties::PropertyOwner*>(
|
||||
nodes.begin(),
|
||||
nodes.end()
|
||||
);
|
||||
}
|
||||
);
|
||||
gui._globalProperty.setSource(
|
||||
[]() {
|
||||
std::vector<properties::PropertyOwner*> res = {
|
||||
&global::navigationHandler,
|
||||
&global::timeManager,
|
||||
&global::renderEngine,
|
||||
&global::parallelPeer,
|
||||
&global::luaConsole,
|
||||
&global::dashboard
|
||||
};
|
||||
return res;
|
||||
}
|
||||
);
|
||||
);
|
||||
|
||||
OsEng.registerModuleCallback(
|
||||
OpenSpaceEngine::CallbackOption::Deinitialize,
|
||||
[&](){
|
||||
LDEBUGC("ImGui", "Deinitialize GUI");
|
||||
gui.deinitialize();
|
||||
gui._screenSpaceProperty.setSource(
|
||||
[]() {
|
||||
return global::screenSpaceRootPropertyOwner.propertySubOwners();
|
||||
}
|
||||
);
|
||||
);
|
||||
|
||||
OsEng.registerModuleCallback(
|
||||
OpenSpaceEngine::CallbackOption::InitializeGL,
|
||||
[&](){
|
||||
LDEBUGC("ImGui", "Initializing GUI OpenGL");
|
||||
gui.initializeGL();
|
||||
gui._moduleProperty.setSource(
|
||||
[]() {
|
||||
std::vector<properties::PropertyOwner*> v;
|
||||
v.push_back(&(global::moduleEngine));
|
||||
return v;
|
||||
}
|
||||
);
|
||||
);
|
||||
|
||||
OsEng.registerModuleCallback(
|
||||
OpenSpaceEngine::CallbackOption::DeinitializeGL,
|
||||
[&](){
|
||||
LDEBUGC("ImGui", "Deinitialize GUI OpenGL");
|
||||
gui.deinitializeGL();
|
||||
}
|
||||
);
|
||||
gui._sceneProperty.setSource(
|
||||
[]() {
|
||||
const Scene* scene = global::renderEngine.scene();
|
||||
const std::vector<SceneGraphNode*>& nodes = scene ?
|
||||
scene->allSceneGraphNodes() :
|
||||
std::vector<SceneGraphNode*>();
|
||||
|
||||
OsEng.registerModuleCallback(
|
||||
OpenSpaceEngine::CallbackOption::Draw2D,
|
||||
[&]() {
|
||||
// TODO emiax: Make sure this is only called for one of the eyes, in the case
|
||||
// of side-by-side / top-bottom stereo.
|
||||
|
||||
WindowWrapper& wrapper = OsEng.windowWrapper();
|
||||
const bool showGui = wrapper.hasGuiWindow() ? wrapper.isGuiWindow() : true;
|
||||
if (wrapper.isMaster() && showGui) {
|
||||
const glm::ivec2 windowSize = wrapper.currentWindowSize();
|
||||
const glm::ivec2 resolution = wrapper.currentWindowResolution();
|
||||
|
||||
glm::vec2 mousePosition = wrapper.mousePosition();
|
||||
uint32_t mouseButtons = wrapper.mouseButtons(2);
|
||||
|
||||
const double dt = std::max(wrapper.averageDeltaTime(), 0.0);
|
||||
if (touchInput.active && mouseButtons == 0) {
|
||||
mouseButtons = touchInput.action;
|
||||
mousePosition = touchInput.pos;
|
||||
}
|
||||
// We don't do any collection of immediate mode user interface, so it
|
||||
// is fine to open and close a frame immediately
|
||||
gui.startFrame(
|
||||
static_cast<float>(dt),
|
||||
glm::vec2(windowSize),
|
||||
resolution / windowSize,
|
||||
mousePosition,
|
||||
mouseButtons
|
||||
return std::vector<properties::PropertyOwner*>(
|
||||
nodes.begin(),
|
||||
nodes.end()
|
||||
);
|
||||
|
||||
gui.endFrame();
|
||||
}
|
||||
}
|
||||
);
|
||||
);
|
||||
|
||||
OsEng.registerModuleKeyboardCallback(
|
||||
gui._virtualProperty.setSource(
|
||||
[]() {
|
||||
std::vector<properties::PropertyOwner*> res = {
|
||||
&global::virtualPropertyManager
|
||||
};
|
||||
|
||||
return res;
|
||||
}
|
||||
);
|
||||
|
||||
gui._featuredProperties.setSource(
|
||||
[]() {
|
||||
std::vector<SceneGraphNode*> nodes =
|
||||
global::renderEngine.scene()->allSceneGraphNodes();
|
||||
|
||||
nodes.erase(
|
||||
std::remove_if(
|
||||
nodes.begin(),
|
||||
nodes.end(),
|
||||
[](SceneGraphNode* n) {
|
||||
const std::vector<std::string>& tags = n->tags();
|
||||
const auto it = std::find(
|
||||
tags.begin(),
|
||||
tags.end(),
|
||||
"GUI.Interesting"
|
||||
);
|
||||
return it == tags.end();
|
||||
}
|
||||
),
|
||||
nodes.end()
|
||||
);
|
||||
return std::vector<properties::PropertyOwner*>(
|
||||
nodes.begin(),
|
||||
nodes.end()
|
||||
);
|
||||
}
|
||||
);
|
||||
});
|
||||
|
||||
global::callback::deinitialize.push_back([&]() {
|
||||
LDEBUGC("ImGui", "Deinitialize GUI");
|
||||
gui.deinitialize();
|
||||
});
|
||||
|
||||
global::callback::initializeGL.push_back([&]() {
|
||||
LDEBUGC("ImGui", "Initializing GUI OpenGL");
|
||||
gui.initializeGL();
|
||||
});
|
||||
|
||||
global::callback::deinitializeGL.push_back([&]() {
|
||||
LDEBUGC("ImGui", "Deinitialize GUI OpenGL");
|
||||
gui.deinitializeGL();
|
||||
});
|
||||
|
||||
global::callback::draw2D.push_back([&]() {
|
||||
// TODO emiax: Make sure this is only called for one of the eyes, in the case
|
||||
// of side-by-side / top-bottom stereo.
|
||||
|
||||
WindowDelegate& delegate = global::windowDelegate;
|
||||
const bool showGui = delegate.hasGuiWindow() ? delegate.isGuiWindow() : true;
|
||||
if (delegate.isMaster() && showGui) {
|
||||
const glm::ivec2 windowSize = delegate.currentWindowSize();
|
||||
const glm::ivec2 resolution = delegate.currentWindowResolution();
|
||||
|
||||
glm::vec2 mousePosition = delegate.mousePosition();
|
||||
uint32_t mouseButtons = delegate.mouseButtons(2);
|
||||
|
||||
const double dt = std::max(delegate.averageDeltaTime(), 0.0);
|
||||
if (touchInput.active && mouseButtons == 0) {
|
||||
mouseButtons = touchInput.action;
|
||||
mousePosition = touchInput.pos;
|
||||
}
|
||||
// We don't do any collection of immediate mode user interface, so it
|
||||
// is fine to open and close a frame immediately
|
||||
gui.startFrame(
|
||||
static_cast<float>(dt),
|
||||
glm::vec2(windowSize),
|
||||
resolution / windowSize,
|
||||
mousePosition,
|
||||
mouseButtons
|
||||
);
|
||||
|
||||
gui.endFrame();
|
||||
}
|
||||
});
|
||||
|
||||
global::callback::keyboard.push_back(
|
||||
[&](Key key, KeyModifier mod, KeyAction action) -> bool {
|
||||
// A list of all the windows that can show up by themselves
|
||||
if (gui.isEnabled() || gui._performance.isEnabled() ||
|
||||
@@ -212,7 +188,7 @@ ImGUIModule::ImGUIModule() : OpenSpaceModule(Name) {
|
||||
}
|
||||
);
|
||||
|
||||
OsEng.registerModuleCharCallback(
|
||||
global::callback::character.push_back(
|
||||
[&](unsigned int codepoint, KeyModifier modifier) -> bool {
|
||||
// A list of all the windows that can show up by themselves
|
||||
if (gui.isEnabled() || gui._performance.isEnabled() ||
|
||||
@@ -226,7 +202,7 @@ ImGUIModule::ImGUIModule() : OpenSpaceModule(Name) {
|
||||
}
|
||||
);
|
||||
|
||||
OsEng.registerModuleMouseButtonCallback(
|
||||
global::callback::mouseButton.push_back(
|
||||
[&](MouseButton button, MouseAction action) -> bool {
|
||||
// A list of all the windows that can show up by themselves
|
||||
if (gui.isEnabled() || gui._performance.isEnabled() ||
|
||||
@@ -240,7 +216,7 @@ ImGUIModule::ImGUIModule() : OpenSpaceModule(Name) {
|
||||
}
|
||||
);
|
||||
|
||||
OsEng.registerModuleMouseScrollWheelCallback(
|
||||
global::callback::mouseScrollWheel.push_back(
|
||||
[&](double, double posY) -> bool {
|
||||
// A list of all the windows that can show up by themselves
|
||||
if (gui.isEnabled() || gui._performance.isEnabled() ||
|
||||
|
||||
+14
-15
@@ -26,16 +26,15 @@
|
||||
|
||||
#include <modules/imgui/imguimodule.h>
|
||||
#include <modules/imgui/include/imgui_include.h>
|
||||
#include <openspace/engine/openspaceengine.h>
|
||||
#include <openspace/engine/wrapper/windowwrapper.h>
|
||||
#include <openspace/engine/globals.h>
|
||||
#include <openspace/engine/windowdelegate.h>
|
||||
#include <openspace/mission/missionmanager.h>
|
||||
#include <openspace/rendering/renderengine.h>
|
||||
#include <openspace/performance/performancemanager.h>
|
||||
#include <openspace/scripting/scriptengine.h>
|
||||
#include <ghoul/fmt.h>
|
||||
#include <ghoul/filesystem/cachemanager.h>
|
||||
#include <ghoul/filesystem/filesystem.h>
|
||||
#include <ghoul/logging/logmanager.h>
|
||||
#include <ghoul/logging/logmanager.h>
|
||||
#include <ghoul/opengl/ghoul_gl.h>
|
||||
#include <ghoul/opengl/programobject.h>
|
||||
#include <ghoul/opengl/texture.h>
|
||||
@@ -47,7 +46,7 @@ namespace {
|
||||
constexpr const char* configurationFile = "imgui.ini";
|
||||
constexpr const char* GuiFont = "${FONTS}/arimo/Arimo-Regular.ttf";
|
||||
constexpr const float FontSize = 14.f;
|
||||
const ImVec2 Size = ImVec2(500, 500);
|
||||
const glm::vec2 Size = { 500.f, 500.f };
|
||||
|
||||
char* iniFileBuffer = nullptr;
|
||||
|
||||
@@ -61,7 +60,7 @@ namespace {
|
||||
return;
|
||||
}
|
||||
|
||||
OsEng.scriptEngine().queueScript(
|
||||
openspace::global::scriptEngine.queueScript(
|
||||
fmt::format(
|
||||
"openspace.addScreenSpaceRenderable({{\
|
||||
Type = 'ScreenSpaceImageLocal',\
|
||||
@@ -74,7 +73,7 @@ namespace {
|
||||
}
|
||||
|
||||
void addScreenSpaceRenderableOnline(std::string texturePath) {
|
||||
OsEng.scriptEngine().queueScript(
|
||||
openspace::global::scriptEngine.queueScript(
|
||||
fmt::format(
|
||||
"openspace.addScreenSpaceRenderable({{\
|
||||
Type = 'ScreenSpaceImageOnline', URL = '{}'\
|
||||
@@ -184,7 +183,7 @@ void GUI::initialize() {
|
||||
strcpy(iniFileBuffer, cachedFile.c_str());
|
||||
#endif
|
||||
|
||||
int nWindows = OsEng.windowWrapper().nWindows();
|
||||
int nWindows = global::windowDelegate.nWindows();
|
||||
_contexts.resize(nWindows);
|
||||
|
||||
for (int i = 0; i < nWindows; ++i) {
|
||||
@@ -192,7 +191,7 @@ void GUI::initialize() {
|
||||
ImGui::SetCurrentContext(_contexts[i]);
|
||||
|
||||
ImGuiIO& io = ImGui::GetIO();
|
||||
io.IniFilename = cachedFile.c_str();
|
||||
io.IniFilename = iniFileBuffer;
|
||||
io.DeltaTime = 1.f / 60.f;
|
||||
io.KeyMap[ImGuiKey_Tab] = static_cast<int>(Key::Tab);
|
||||
io.KeyMap[ImGuiKey_LeftArrow] = static_cast<int>(Key::Left);
|
||||
@@ -290,7 +289,7 @@ void GUI::initialize() {
|
||||
void GUI::deinitialize() {
|
||||
ImGui::Shutdown();
|
||||
|
||||
int nWindows = OsEng.windowWrapper().nWindows();
|
||||
int nWindows = global::windowDelegate.nWindows();
|
||||
for (int i = 0; i < nWindows; ++i) {
|
||||
ImGui::DestroyContext(_contexts[i]);
|
||||
}
|
||||
@@ -311,7 +310,7 @@ void GUI::initializeGL() {
|
||||
|
||||
ghoul::opengl::updateUniformLocations(*_program, _uniformCache, UniformNames);
|
||||
|
||||
int nWindows = OsEng.windowWrapper().nWindows();
|
||||
int nWindows = global::windowDelegate.nWindows();
|
||||
{
|
||||
unsigned char* texData;
|
||||
glm::ivec2 texSize;
|
||||
@@ -400,7 +399,7 @@ void GUI::startFrame(float deltaTime, const glm::vec2& windowSize,
|
||||
const glm::vec2& dpiScaling, const glm::vec2& mousePos,
|
||||
uint32_t mouseButtonsPressed)
|
||||
{
|
||||
const int iWindow = OsEng.windowWrapper().currentWindowId();
|
||||
const int iWindow = global::windowDelegate.currentWindowId();
|
||||
ImGui::SetCurrentContext(_contexts[iWindow]);
|
||||
|
||||
ImGuiIO& io = ImGui::GetIO();
|
||||
@@ -422,7 +421,7 @@ void GUI::endFrame() {
|
||||
ghoul::opengl::updateUniformLocations(*_program, _uniformCache, UniformNames);
|
||||
}
|
||||
|
||||
_performance.setEnabled(OsEng.renderEngine().doesPerformanceMeasurements());
|
||||
_performance.setEnabled(global::performanceManager.isEnabled());
|
||||
|
||||
if (_performance.isEnabled()) {
|
||||
_performance.render();
|
||||
@@ -653,7 +652,7 @@ void GUI::render() {
|
||||
|
||||
bool addDashboard = ImGui::Button("Add New Dashboard");
|
||||
if (addDashboard) {
|
||||
OsEng.scriptEngine().queueScript(
|
||||
global::scriptEngine.queueScript(
|
||||
"openspace.addScreenSpaceRenderable({ Type = 'ScreenSpaceDashboard' });",
|
||||
openspace::scripting::ScriptEngine::RemoteScripting::Yes
|
||||
);
|
||||
@@ -661,7 +660,7 @@ void GUI::render() {
|
||||
|
||||
bool addDashboardCopy = ImGui::Button("Add Copy of Main Dashboard");
|
||||
if (addDashboardCopy) {
|
||||
OsEng.scriptEngine().queueScript(
|
||||
global::scriptEngine.queueScript(
|
||||
"openspace.addScreenSpaceRenderable({ "
|
||||
"Type = 'ScreenSpaceDashboard', UseMainDashboard = true "
|
||||
"});",
|
||||
|
||||
@@ -26,6 +26,7 @@
|
||||
|
||||
#include <modules/imgui/include/imgui_include.h>
|
||||
|
||||
#include <openspace/engine/globals.h>
|
||||
#include <openspace/engine/openspaceengine.h>
|
||||
#include <openspace/scene/assetmanager.h>
|
||||
#include <openspace/scene/asset.h>
|
||||
@@ -74,7 +75,7 @@ void GuiAssetComponent::render() {
|
||||
ImGui::Begin("Assets", &e);
|
||||
_isEnabled = e;
|
||||
|
||||
AssetManager& assetManager = OsEng.assetManager();
|
||||
AssetManager& assetManager = global::openSpaceEngine.assetManager();
|
||||
|
||||
std::string rootPath;
|
||||
|
||||
|
||||
@@ -28,8 +28,8 @@
|
||||
|
||||
#include <modules/globebrowsing/globebrowsingmodule.h>
|
||||
#include <modules/imgui/include/imgui_include.h>
|
||||
#include <openspace/engine/globals.h>
|
||||
#include <openspace/engine/moduleengine.h>
|
||||
#include <openspace/engine/openspaceengine.h>
|
||||
#include <openspace/interaction/navigationhandler.h>
|
||||
#include <openspace/rendering/renderable.h>
|
||||
#include <openspace/rendering/renderengine.h>
|
||||
@@ -50,7 +50,7 @@ GuiGlobeBrowsingComponent::GuiGlobeBrowsingComponent()
|
||||
{}
|
||||
|
||||
void GuiGlobeBrowsingComponent::render() {
|
||||
GlobeBrowsingModule* module = OsEng.moduleEngine().module<GlobeBrowsingModule>();
|
||||
GlobeBrowsingModule* module = global::moduleEngine.module<GlobeBrowsingModule>();
|
||||
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<SceneGraphNode*> nodes =
|
||||
OsEng.renderEngine().scene()->allSceneGraphNodes();
|
||||
global::renderEngine.scene()->allSceneGraphNodes();
|
||||
|
||||
nodes.erase(
|
||||
std::remove_if(
|
||||
@@ -124,7 +124,7 @@ void GuiGlobeBrowsingComponent::render() {
|
||||
// node
|
||||
|
||||
// Check if the focus node is a RenderableGlobe
|
||||
const SceneGraphNode* const focus = OsEng.navigationHandler().focusNode();
|
||||
const SceneGraphNode* const focus = global::navigationHandler.focusNode();
|
||||
const auto it = std::find(nodes.cbegin(), nodes.cend(), focus);
|
||||
if (it != nodes.end()) {
|
||||
_currentNode = focus->identifier();
|
||||
@@ -147,7 +147,7 @@ void GuiGlobeBrowsingComponent::render() {
|
||||
ImGui::SameLine();
|
||||
bool selectFocusNode = ImGui::Button("From Focus");
|
||||
if (selectFocusNode) {
|
||||
const SceneGraphNode* const focus = OsEng.navigationHandler().focusNode();
|
||||
const SceneGraphNode* const focus = global::navigationHandler.focusNode();
|
||||
const auto it = std::find(nodes.cbegin(), nodes.cend(), focus);
|
||||
if (it != nodes.end()) {
|
||||
_currentNode = focus->identifier();
|
||||
@@ -324,7 +324,7 @@ void GuiGlobeBrowsingComponent::render() {
|
||||
std::remove(layerName.begin(), layerName.end(), ' '),
|
||||
layerName.end()
|
||||
);
|
||||
OsEng.scriptEngine().queueScript(
|
||||
global::scriptEngine.queueScript(
|
||||
fmt::format(
|
||||
"openspace.globebrowsing.addLayer(\
|
||||
'{}', \
|
||||
|
||||
@@ -31,7 +31,7 @@
|
||||
#include <openspace/json.h>
|
||||
#include <ghoul/filesystem/filesystem.h>
|
||||
|
||||
#include <openspace/engine/openspaceengine.h>
|
||||
#include <openspace/engine/globals.h>
|
||||
#include <openspace/scripting/scriptengine.h>
|
||||
|
||||
namespace {
|
||||
@@ -70,7 +70,7 @@ void GuiIswaComponent::render() {
|
||||
ImGui::InputText("addCynget", addCygnetBuffer, AddCygnetBufferSize);
|
||||
|
||||
if (ImGui::SmallButton("Add Cygnet")) {
|
||||
OsEng.scriptEngine().queueScript(
|
||||
global::scriptEngine.queueScript(
|
||||
"openspace.iswa.addCygnet(" + std::string(addCygnetBuffer) + ");",
|
||||
scripting::ScriptEngine::RemoteScripting::Yes
|
||||
);
|
||||
@@ -83,12 +83,12 @@ void GuiIswaComponent::render() {
|
||||
openspace.iswa.addCygnet(-5, 'Data', 'GMData');
|
||||
openspace.iswa.addCygnet(-6, 'Data', 'GMData');
|
||||
)";
|
||||
OsEng.scriptEngine().queueScript(
|
||||
global::scriptEngine.queueScript(
|
||||
script,
|
||||
scripting::ScriptEngine::RemoteScripting::Yes
|
||||
);
|
||||
} else {
|
||||
OsEng.scriptEngine().queueScript(
|
||||
global::scriptEngine.queueScript(
|
||||
"openspace.iswa.removeGroup('GMData');",
|
||||
scripting::ScriptEngine::RemoteScripting::Yes
|
||||
);
|
||||
@@ -102,12 +102,12 @@ void GuiIswaComponent::render() {
|
||||
openspace.iswa.addCygnet(-5, 'Texture', 'GMImage');
|
||||
openspace.iswa.addCygnet(-6, 'Texture', 'GMImage');
|
||||
)";
|
||||
OsEng.scriptEngine().queueScript(
|
||||
global::scriptEngine.queueScript(
|
||||
script,
|
||||
scripting::ScriptEngine::RemoteScripting::Yes
|
||||
);
|
||||
} else {
|
||||
OsEng.scriptEngine().queueScript(
|
||||
global::scriptEngine.queueScript(
|
||||
"openspace.iswa.removeGroup('GMImage');",
|
||||
scripting::ScriptEngine::RemoteScripting::Yes
|
||||
);
|
||||
@@ -116,12 +116,12 @@ void GuiIswaComponent::render() {
|
||||
|
||||
if(_ionData != oldIonDataValue) {
|
||||
if(_ionData) {
|
||||
OsEng.scriptEngine().queueScript(
|
||||
global::scriptEngine.queueScript(
|
||||
"openspace.iswa.addCygnet(-10, 'Data', 'Ionosphere');",
|
||||
scripting::ScriptEngine::RemoteScripting::Yes
|
||||
);
|
||||
} else {
|
||||
OsEng.scriptEngine().queueScript(
|
||||
global::scriptEngine.queueScript(
|
||||
"openspace.iswa.removeGroup('Ionosphere');",
|
||||
scripting::ScriptEngine::RemoteScripting::Yes
|
||||
);
|
||||
@@ -155,7 +155,7 @@ void GuiIswaComponent::render() {
|
||||
const int cdfOption = _cdfOptionsMap[groupName];
|
||||
if (cdfOptionValue != cdfOption) {
|
||||
const std::string& date = cdfs[cdfOption].date;
|
||||
OsEng.scriptEngine().queueScript(
|
||||
global::scriptEngine.queueScript(
|
||||
"openspace.iswa.addKameleonPlanes('" +
|
||||
cdfs[cdfOption].group +
|
||||
"'," +
|
||||
@@ -163,11 +163,11 @@ void GuiIswaComponent::render() {
|
||||
");",
|
||||
scripting::ScriptEngine::RemoteScripting::Yes
|
||||
);
|
||||
OsEng.scriptEngine().queueScript(
|
||||
global::scriptEngine.queueScript(
|
||||
"openspace.time.setTime('" + date + "');",
|
||||
scripting::ScriptEngine::RemoteScripting::Yes
|
||||
);
|
||||
OsEng.scriptEngine().queueScript(
|
||||
global::scriptEngine.queueScript(
|
||||
"openspace.time.setDeltaTime(0);",
|
||||
scripting::ScriptEngine::RemoteScripting::Yes
|
||||
);
|
||||
@@ -198,12 +198,12 @@ void GuiIswaComponent::render() {
|
||||
if (selected != info.selected) {
|
||||
const std::string idStr = std::to_string(id);
|
||||
if (info.selected) {
|
||||
OsEng.scriptEngine().queueScript(
|
||||
global::scriptEngine.queueScript(
|
||||
"openspace.iswa.addScreenSpaceCygnet({CygnetId=" + idStr + "});",
|
||||
scripting::ScriptEngine::RemoteScripting::Yes
|
||||
);
|
||||
} else {
|
||||
OsEng.scriptEngine().queueScript(
|
||||
global::scriptEngine.queueScript(
|
||||
"openspace.iswa.removeScreenSpaceCygnet(" + idStr + ");",
|
||||
scripting::ScriptEngine::RemoteScripting::Yes
|
||||
);
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
#include <modules/imgui/include/guijoystickcomponent.h>
|
||||
|
||||
#include <modules/imgui/include/imgui_include.h>
|
||||
#include <openspace/engine/openspaceengine.h>
|
||||
#include <openspace/engine/globals.h>
|
||||
#include <openspace/interaction/navigationhandler.h>
|
||||
#include <openspace/interaction/inputstate.h>
|
||||
#include <openspace/interaction/joystickinputstate.h>
|
||||
@@ -50,11 +50,8 @@ void GuiJoystickComponent::render() {
|
||||
_isEnabled = v;
|
||||
_isCollapsed = ImGui::IsWindowCollapsed();
|
||||
|
||||
const JoystickInputStates& states =
|
||||
OsEng.navigationHandler().inputState().joystickInputStates();
|
||||
|
||||
for (size_t i = 0; i < states.size(); ++i) {
|
||||
const JoystickInputState& state = states[i];
|
||||
for (size_t i = 0; i < global::joystickInputStates.size(); ++i) {
|
||||
const JoystickInputState& state = global::joystickInputStates[i];
|
||||
if (!state.isConnected) {
|
||||
continue;
|
||||
}
|
||||
@@ -88,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 = states.axis(i);
|
||||
float f = global::joystickInputStates.axis(i);
|
||||
ImGui::SliderFloat(
|
||||
std::to_string(i).c_str(),
|
||||
&f,
|
||||
@@ -100,8 +97,8 @@ void GuiJoystickComponent::render() {
|
||||
for (int i = 0; i < JoystickInputState::MaxButtons; ++i) {
|
||||
ImGui::RadioButton(
|
||||
std::to_string(i).c_str(),
|
||||
states.button(i, JoystickAction::Press) ||
|
||||
states.button(i, JoystickAction::Repeat)
|
||||
global::joystickInputStates.button(i, JoystickAction::Press) ||
|
||||
global::joystickInputStates.button(i, JoystickAction::Repeat)
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
|
||||
#include <modules/imgui/include/gui.h>
|
||||
#include <modules/imgui/include/imgui_include.h>
|
||||
#include <openspace/engine/openspaceengine.h>
|
||||
#include <openspace/engine/globals.h>
|
||||
#include <openspace/mission/mission.h>
|
||||
#include <openspace/mission/missionmanager.h>
|
||||
#include <openspace/util/timerange.h>
|
||||
@@ -42,7 +42,7 @@ namespace {
|
||||
std::string missionHashname = "##" + mission.name();
|
||||
|
||||
|
||||
const double currentTime = OsEng.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,
|
||||
OsEng.timeManager().time().UTC().c_str()
|
||||
openspace::global::timeManager.time().UTC().c_str()
|
||||
);
|
||||
ImGui::SameLine();
|
||||
ImGui::Text("%s", endTime.UTC().c_str());
|
||||
@@ -98,7 +98,7 @@ GuiMissionComponent::GuiMissionComponent()
|
||||
{}
|
||||
|
||||
void GuiMissionComponent::render() {
|
||||
if (!MissionManager::ref().hasCurrentMission()) {
|
||||
if (!global::missionManager.hasCurrentMission()) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -109,7 +109,7 @@ void GuiMissionComponent::render() {
|
||||
|
||||
_isCollapsed = ImGui::IsWindowCollapsed();
|
||||
|
||||
const Mission& currentMission = MissionManager::ref().currentMission();
|
||||
const Mission& currentMission = global::missionManager.currentMission();
|
||||
renderMission(currentMission);
|
||||
|
||||
ImGui::End();
|
||||
|
||||
@@ -25,8 +25,7 @@
|
||||
#include <modules/imgui/include/guiparallelcomponent.h>
|
||||
|
||||
#include <modules/imgui/include/imgui_include.h>
|
||||
|
||||
#include <openspace/engine/openspaceengine.h>
|
||||
#include <openspace/engine/globals.h>
|
||||
#include <openspace/util/timemanager.h>
|
||||
#include <openspace/interaction/keyframenavigator.h>
|
||||
#include <openspace/interaction/navigationhandler.h>
|
||||
@@ -51,7 +50,7 @@ void GuiParallelComponent::renderDisconnected() {
|
||||
|
||||
const bool connect = ImGui::Button("Connect");
|
||||
if (connect) {
|
||||
OsEng.parallelPeer().connect();
|
||||
global::parallelPeer.connect();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -60,12 +59,12 @@ void GuiParallelComponent::renderConnecting() {
|
||||
|
||||
const bool cancel = ImGui::Button("Cancel connection");
|
||||
if (cancel) {
|
||||
OsEng.parallelPeer().disconnect();
|
||||
global::parallelPeer.disconnect();
|
||||
}
|
||||
}
|
||||
|
||||
void GuiParallelComponent::renderClientWithHost() {
|
||||
ParallelPeer& parallel = OsEng.parallelPeer();
|
||||
ParallelPeer& parallel = global::parallelPeer;
|
||||
|
||||
std::string connectionInfo = "Session hosted by \"" + parallel.hostName() + "\"\n";
|
||||
const size_t nConnections = parallel.nConnections();
|
||||
@@ -86,9 +85,9 @@ void GuiParallelComponent::renderClientWithHost() {
|
||||
ImGui::Text("%s", connectionInfo.c_str());
|
||||
renderClientCommon();
|
||||
|
||||
const size_t nTimeKeyframes = OsEng.timeManager().nKeyframes();
|
||||
const size_t nTimeKeyframes = global::timeManager.nKeyframes();
|
||||
const size_t nCameraKeyframes =
|
||||
OsEng.navigationHandler().keyframeNavigator().nKeyframes();
|
||||
global::navigationHandler.keyframeNavigator().nKeyframes();
|
||||
|
||||
std::string timeKeyframeInfo = "TimeKeyframes : " + std::to_string(nTimeKeyframes);
|
||||
std::string cameraKeyframeInfo = "CameraKeyframes : " +
|
||||
@@ -108,10 +107,8 @@ void GuiParallelComponent::renderClientWithHost() {
|
||||
}
|
||||
|
||||
void GuiParallelComponent::renderClientWithoutHost() {
|
||||
ParallelPeer& parallel = OsEng.parallelPeer();
|
||||
|
||||
std::string connectionInfo = "Connected to parallel session with no host\n";
|
||||
const size_t nConnections = parallel.nConnections();
|
||||
const size_t nConnections = global::parallelPeer.nConnections();
|
||||
|
||||
if (nConnections > 2) {
|
||||
std::string c = std::to_string(nConnections - 1);
|
||||
@@ -131,23 +128,19 @@ void GuiParallelComponent::renderClientWithoutHost() {
|
||||
}
|
||||
|
||||
void GuiParallelComponent::renderClientCommon() {
|
||||
ParallelPeer& parallel = OsEng.parallelPeer();
|
||||
|
||||
|
||||
const bool requestHostship = ImGui::Button("Request hostship");
|
||||
if (requestHostship) {
|
||||
parallel.requestHostship();
|
||||
global::parallelPeer.requestHostship();
|
||||
}
|
||||
|
||||
const bool disconnect = ImGui::Button("Disconnect");
|
||||
if (disconnect) {
|
||||
parallel.disconnect();
|
||||
global::parallelPeer.disconnect();
|
||||
}
|
||||
}
|
||||
|
||||
void GuiParallelComponent::renderHost() {
|
||||
ParallelPeer& parallel = OsEng.parallelPeer();
|
||||
const size_t nConnections = parallel.nConnections();
|
||||
const size_t nConnections = global::parallelPeer.nConnections();
|
||||
|
||||
std::string connectionInfo;
|
||||
const size_t nClients = nConnections - 1;
|
||||
@@ -161,7 +154,7 @@ void GuiParallelComponent::renderHost() {
|
||||
|
||||
const bool resignHostship = ImGui::Button("Resign hostship");
|
||||
if (resignHostship) {
|
||||
parallel.resignHostship();
|
||||
global::parallelPeer.resignHostship();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -173,7 +166,7 @@ void GuiParallelComponent::render() {
|
||||
_isEnabled = v;
|
||||
_isCollapsed = ImGui::IsWindowCollapsed();
|
||||
|
||||
ParallelConnection::Status status = OsEng.parallelPeer().status();
|
||||
ParallelConnection::Status status = global::parallelPeer.status();
|
||||
|
||||
switch (status) {
|
||||
case ParallelConnection::Status::Disconnected:
|
||||
@@ -193,7 +186,7 @@ void GuiParallelComponent::render() {
|
||||
break;
|
||||
}
|
||||
|
||||
GuiPropertyComponent::renderPropertyOwner(&OsEng.parallelPeer());
|
||||
GuiPropertyComponent::renderPropertyOwner(&global::parallelPeer);
|
||||
ImGui::End();
|
||||
}
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
#include <modules/imgui/include/guiperformancecomponent.h>
|
||||
|
||||
#include <modules/imgui/include/imgui_include.h>
|
||||
#include <openspace/engine/openspaceengine.h>
|
||||
#include <openspace/engine/globals.h>
|
||||
#include <openspace/performance/performancelayout.h>
|
||||
#include <openspace/performance/performancemanager.h>
|
||||
#include <openspace/rendering/renderengine.h>
|
||||
@@ -91,7 +91,7 @@ GuiPerformanceComponent::GuiPerformanceComponent()
|
||||
GuiPerformanceComponent::~GuiPerformanceComponent() {} // NOLINT
|
||||
|
||||
void GuiPerformanceComponent::render() {
|
||||
if (!OsEng.renderEngine().doesPerformanceMeasurements()) {
|
||||
if (!global::performanceManager.isEnabled()) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -104,8 +104,7 @@ void GuiPerformanceComponent::render() {
|
||||
_isEnabled = v;
|
||||
_isCollapsed = ImGui::IsWindowCollapsed();
|
||||
|
||||
PerformanceLayout* layout =
|
||||
OsEng.renderEngine().performanceManager()->performanceData();
|
||||
PerformanceLayout* layout = global::performanceManager.performanceData();
|
||||
|
||||
v = _sceneGraphIsEnabled;
|
||||
ImGui::Checkbox("SceneGraph", &v);
|
||||
@@ -115,15 +114,15 @@ void GuiPerformanceComponent::render() {
|
||||
_functionsIsEnabled = v;
|
||||
v = _outputLogs;
|
||||
ImGui::Checkbox("Output Logs", &v);
|
||||
OsEng.renderEngine().performanceManager()->setLogging(v);
|
||||
global::performanceManager.setLogging(v);
|
||||
// Need to catch if it's unsuccessful
|
||||
v = OsEng.renderEngine().performanceManager()->loggingEnabled();
|
||||
v = global::performanceManager.loggingEnabled();
|
||||
_outputLogs = v;
|
||||
|
||||
ImGui::Spacing();
|
||||
|
||||
if (ImGui::Button("Reset measurements")) {
|
||||
OsEng.renderEngine().performanceManager()->resetPerformanceMeasurements();
|
||||
global::performanceManager.resetPerformanceMeasurements();
|
||||
}
|
||||
|
||||
if (_sceneGraphIsEnabled) {
|
||||
|
||||
@@ -26,9 +26,8 @@
|
||||
|
||||
#include <modules/imgui/include/gui.h>
|
||||
#include <modules/imgui/include/imgui_include.h>
|
||||
|
||||
#include <openspace/engine/openspaceengine.h>
|
||||
#include <openspace/engine/wrapper/windowwrapper.h>
|
||||
#include <openspace/engine/globals.h>
|
||||
#include <openspace/engine/windowdelegate.h>
|
||||
#include <openspace/interaction/navigationhandler.h>
|
||||
#include <openspace/rendering/renderengine.h>
|
||||
#include <openspace/scene/scenegraphnode.h>
|
||||
@@ -80,7 +79,7 @@ void GuiSpaceTimeComponent::render() {
|
||||
_isCollapsed = ImGui::IsWindowCollapsed();
|
||||
|
||||
std::vector<SceneGraphNode*> nodes =
|
||||
OsEng.renderEngine().scene()->allSceneGraphNodes();
|
||||
global::renderEngine.scene()->allSceneGraphNodes();
|
||||
|
||||
std::sort(
|
||||
nodes.begin(),
|
||||
@@ -102,7 +101,7 @@ void GuiSpaceTimeComponent::render() {
|
||||
const bool pressed = ImGui::Button(n->guiName().c_str());
|
||||
ImGui::SameLine();
|
||||
if (pressed) {
|
||||
OsEng.scriptEngine().queueScript(
|
||||
global::scriptEngine.queueScript(
|
||||
"openspace.setPropertyValue('NavigationHandler.Origin', '" +
|
||||
n->identifier() + "');",
|
||||
scripting::ScriptEngine::RemoteScripting::Yes
|
||||
@@ -114,7 +113,7 @@ void GuiSpaceTimeComponent::render() {
|
||||
ImGui::NewLine();
|
||||
ImGui::SetCursorPosY(ImGui::GetCursorPosY() + 10.f);
|
||||
|
||||
SceneGraphNode* currentFocus = OsEng.navigationHandler().focusNode();
|
||||
SceneGraphNode* currentFocus = global::navigationHandler.focusNode();
|
||||
|
||||
std::string nodeNames;
|
||||
for (SceneGraphNode* n : nodes) {
|
||||
@@ -131,7 +130,7 @@ void GuiSpaceTimeComponent::render() {
|
||||
|
||||
const bool hasChanged = ImGui::Combo("", ¤tPosition, nodeNames.c_str());
|
||||
if (hasChanged) {
|
||||
OsEng.scriptEngine().queueScript(
|
||||
global::scriptEngine.queueScript(
|
||||
"openspace.setPropertyValue('NavigationHandler.Origin', '" +
|
||||
nodes[currentPosition]->identifier() + "');",
|
||||
scripting::ScriptEngine::RemoteScripting::Yes
|
||||
@@ -144,7 +143,7 @@ void GuiSpaceTimeComponent::render() {
|
||||
// To refocus, we are first clearing the origin property before setting it back
|
||||
// to its old value. The property mechanism's onChange does not fire if the same
|
||||
// value is set again, hence the need for the clearing
|
||||
OsEng.scriptEngine().queueScript(
|
||||
global::scriptEngine.queueScript(
|
||||
R"(
|
||||
local o = openspace.getPropertyValue('NavigationHandler.Origin');
|
||||
openspace.setPropertyValue('NavigationHandler.Origin', '');
|
||||
@@ -165,7 +164,7 @@ void GuiSpaceTimeComponent::render() {
|
||||
CaptionText("Time Controls");
|
||||
ImGui::SetCursorPosY(ImGui::GetCursorPosY() + 10.f);
|
||||
|
||||
ImGui::Text("Current Date: %s", OsEng.timeManager().time().UTC().c_str());
|
||||
ImGui::Text("Current Date: %s", global::timeManager.time().UTC().c_str());
|
||||
|
||||
constexpr int BufferSize = 256;
|
||||
static char Buffer[BufferSize];
|
||||
@@ -176,7 +175,7 @@ void GuiSpaceTimeComponent::render() {
|
||||
ImGuiInputTextFlags_EnterReturnsTrue
|
||||
);
|
||||
if (dateChanged) {
|
||||
OsEng.scriptEngine().queueScript(
|
||||
global::scriptEngine.queueScript(
|
||||
"openspace.time.setTime(\"" + std::string(Buffer) + "\")",
|
||||
scripting::ScriptEngine::RemoteScripting::No
|
||||
);
|
||||
@@ -193,10 +192,10 @@ void GuiSpaceTimeComponent::render() {
|
||||
auto incrementTime = [](float days) {
|
||||
using namespace std::chrono;
|
||||
|
||||
const float duration = OsEng.timeManager().defaultTimeInterpolationDuration();
|
||||
const float duration = global::timeManager.defaultTimeInterpolationDuration();
|
||||
|
||||
const TimeKeyframeData predictedTime = OsEng.timeManager().interpolate(
|
||||
OsEng.windowWrapper().applicationTime() + duration
|
||||
const TimeKeyframeData predictedTime = global::timeManager.interpolate(
|
||||
global::windowDelegate.applicationTime() + duration
|
||||
);
|
||||
const double j2000 = predictedTime.time.j2000Seconds();
|
||||
const long long seconds = duration_cast<std::chrono::seconds>(
|
||||
@@ -207,7 +206,7 @@ void GuiSpaceTimeComponent::render() {
|
||||
j2000 - seconds :
|
||||
j2000 + seconds;
|
||||
|
||||
OsEng.scriptEngine().queueScript(
|
||||
global::scriptEngine.queueScript(
|
||||
"openspace.time.interpolateTime(" + std::to_string(newTime) + ", " +
|
||||
std::to_string(duration) + ")",
|
||||
scripting::ScriptEngine::RemoteScripting::No
|
||||
@@ -246,7 +245,7 @@ void GuiSpaceTimeComponent::render() {
|
||||
// setTime doesn't like the T in it and wants a space instead
|
||||
nowTime[11] = ' ';
|
||||
|
||||
OsEng.scriptEngine().queueScript(
|
||||
global::scriptEngine.queueScript(
|
||||
"openspace.time.setTime(\"" + nowTime + "\")",
|
||||
scripting::ScriptEngine::RemoteScripting::No
|
||||
);
|
||||
@@ -281,7 +280,7 @@ void GuiSpaceTimeComponent::render() {
|
||||
ImGui::SetCursorPosY(ImGui::GetCursorPosY() + 20.f);
|
||||
//
|
||||
{
|
||||
const float dt = static_cast<float>(OsEng.timeManager().targetDeltaTime());
|
||||
const float dt = static_cast<float>(global::timeManager.targetDeltaTime());
|
||||
if (_firstFrame) {
|
||||
const std::pair<double, std::string>& dtInfo = simplifyTime(dt);
|
||||
_deltaTime = static_cast<float>(dtInfo.first);
|
||||
@@ -325,7 +324,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);
|
||||
OsEng.scriptEngine().queueScript(
|
||||
global::scriptEngine.queueScript(
|
||||
"openspace.time.interpolateDeltaTime(" + std::to_string(newDt) + ")",
|
||||
scripting::ScriptEngine::RemoteScripting::No
|
||||
);
|
||||
@@ -374,14 +373,14 @@ void GuiSpaceTimeComponent::render() {
|
||||
TimeUnit::Second
|
||||
);
|
||||
|
||||
OsEng.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) {
|
||||
OsEng.scriptEngine().queueScript(
|
||||
global::scriptEngine.queueScript(
|
||||
"openspace.time.setDeltaTime(" + std::to_string(_oldDeltaTime) + ")",
|
||||
scripting::ScriptEngine::RemoteScripting::No
|
||||
);
|
||||
@@ -402,12 +401,12 @@ 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 * OsEng.windowWrapper().deltaTime() * 10,
|
||||
_deltaTime + _accelerationDelta * global::windowDelegate.deltaTime() * 10,
|
||||
static_cast<TimeUnit>(_deltaTimeUnit),
|
||||
TimeUnit::Second
|
||||
);
|
||||
|
||||
OsEng.scriptEngine().queueScript(
|
||||
global::scriptEngine.queueScript(
|
||||
"openspace.time.setDeltaTime(" + std::to_string(newDeltaTime) + ")",
|
||||
scripting::ScriptEngine::RemoteScripting::No
|
||||
);
|
||||
@@ -419,13 +418,13 @@ void GuiSpaceTimeComponent::render() {
|
||||
_deltaTime -= _slidingDelta;
|
||||
}
|
||||
|
||||
const bool isPaused = OsEng.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) {
|
||||
OsEng.scriptEngine().queueScript(
|
||||
global::scriptEngine.queueScript(
|
||||
"openspace.time.interpolateTogglePause()",
|
||||
scripting::ScriptEngine::RemoteScripting::No
|
||||
);
|
||||
@@ -436,7 +435,7 @@ void GuiSpaceTimeComponent::render() {
|
||||
{ ImGui::GetWindowWidth() / 2 - 7.5f, 0.f }
|
||||
);
|
||||
if (invert) {
|
||||
OsEng.scriptEngine().queueScript(
|
||||
global::scriptEngine.queueScript(
|
||||
"openspace.time.interpolateDeltaTime(-1 * openspace.time.deltaTime());",
|
||||
scripting::ScriptEngine::RemoteScripting::No
|
||||
);
|
||||
@@ -444,7 +443,7 @@ void GuiSpaceTimeComponent::render() {
|
||||
|
||||
const bool minusDs = ImGui::Button("-1d/s");
|
||||
if (minusDs) {
|
||||
OsEng.scriptEngine().queueScript(
|
||||
global::scriptEngine.queueScript(
|
||||
"openspace.time.interpolateDeltaTime(" + std::to_string(-24 * 60 * 60) + ")",
|
||||
scripting::ScriptEngine::RemoteScripting::No
|
||||
);
|
||||
@@ -453,7 +452,7 @@ void GuiSpaceTimeComponent::render() {
|
||||
|
||||
const bool minusHs = ImGui::Button("-1h/s");
|
||||
if (minusHs) {
|
||||
OsEng.scriptEngine().queueScript(
|
||||
global::scriptEngine.queueScript(
|
||||
"openspace.time.interpolateDeltaTime(" + std::to_string(-60 * 60) + ")",
|
||||
scripting::ScriptEngine::RemoteScripting::No
|
||||
);
|
||||
@@ -462,7 +461,7 @@ void GuiSpaceTimeComponent::render() {
|
||||
|
||||
const bool minusMs = ImGui::Button("-1min/s");
|
||||
if (minusMs) {
|
||||
OsEng.scriptEngine().queueScript(
|
||||
global::scriptEngine.queueScript(
|
||||
"openspace.time.interpolateDeltaTime(" + std::to_string(-60) + ")",
|
||||
scripting::ScriptEngine::RemoteScripting::No
|
||||
);
|
||||
@@ -471,7 +470,7 @@ void GuiSpaceTimeComponent::render() {
|
||||
|
||||
const bool minusSs = ImGui::Button("-1s/s");
|
||||
if (minusSs) {
|
||||
OsEng.scriptEngine().queueScript(
|
||||
global::scriptEngine.queueScript(
|
||||
"openspace.time.interpolateDeltaTime(" + std::to_string(-1) + ")",
|
||||
scripting::ScriptEngine::RemoteScripting::No
|
||||
);
|
||||
@@ -480,7 +479,7 @@ void GuiSpaceTimeComponent::render() {
|
||||
|
||||
const bool zero = ImGui::Button("0");
|
||||
if (zero) {
|
||||
OsEng.scriptEngine().queueScript(
|
||||
global::scriptEngine.queueScript(
|
||||
"openspace.time.interpolateDeltaTime(" + std::to_string(0) + ")",
|
||||
scripting::ScriptEngine::RemoteScripting::No
|
||||
);
|
||||
@@ -490,7 +489,7 @@ void GuiSpaceTimeComponent::render() {
|
||||
|
||||
const bool plusSs = ImGui::Button("+1s/s");
|
||||
if (plusSs) {
|
||||
OsEng.scriptEngine().queueScript(
|
||||
global::scriptEngine.queueScript(
|
||||
"openspace.time.interpolateDeltaTime(" + std::to_string(1) + ")",
|
||||
scripting::ScriptEngine::RemoteScripting::No
|
||||
);
|
||||
@@ -499,7 +498,7 @@ void GuiSpaceTimeComponent::render() {
|
||||
|
||||
const bool plusMs = ImGui::Button("1min/s");
|
||||
if (plusMs) {
|
||||
OsEng.scriptEngine().queueScript(
|
||||
global::scriptEngine.queueScript(
|
||||
"openspace.time.interpolateDeltaTime(" + std::to_string(60) + ")",
|
||||
scripting::ScriptEngine::RemoteScripting::No
|
||||
);
|
||||
@@ -508,7 +507,7 @@ void GuiSpaceTimeComponent::render() {
|
||||
|
||||
const bool plusHs = ImGui::Button("1h/s");
|
||||
if (plusHs) {
|
||||
OsEng.scriptEngine().queueScript(
|
||||
global::scriptEngine.queueScript(
|
||||
"openspace.time.interpolateDeltaTime(" + std::to_string(60 * 60) + ")",
|
||||
scripting::ScriptEngine::RemoteScripting::No
|
||||
);
|
||||
@@ -517,7 +516,7 @@ void GuiSpaceTimeComponent::render() {
|
||||
|
||||
const bool plusDs = ImGui::Button("1d/s");
|
||||
if (plusDs) {
|
||||
OsEng.scriptEngine().queueScript(
|
||||
global::scriptEngine.queueScript(
|
||||
"openspace.time.interpolateDeltaTime(" + std::to_string(24 * 60 * 60) + ")",
|
||||
scripting::ScriptEngine::RemoteScripting::No
|
||||
);
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
#include <modules/imgui/include/renderproperties.h>
|
||||
|
||||
#include <modules/imgui/include/imgui_include.h>
|
||||
#include <openspace/engine/openspaceengine.h>
|
||||
#include <openspace/engine/globals.h>
|
||||
#include <openspace/properties/optionproperty.h>
|
||||
#include <openspace/properties/selectionproperty.h>
|
||||
#include <openspace/properties/stringproperty.h>
|
||||
@@ -69,14 +69,14 @@ void renderTooltip(Property* prop, double delay) {
|
||||
}
|
||||
|
||||
void executeScriptSingle(const std::string& id, const std::string& value) {
|
||||
OsEng.scriptEngine().queueScript(
|
||||
global::scriptEngine.queueScript(
|
||||
"openspace.setPropertyValueSingle('" + id + "', " + value + ");",
|
||||
scripting::ScriptEngine::RemoteScripting::Yes
|
||||
);
|
||||
}
|
||||
|
||||
void executeScriptGroup(const std::string& id, const std::string& value) {
|
||||
OsEng.scriptEngine().queueScript(
|
||||
global::scriptEngine.queueScript(
|
||||
"openspace.setPropertyValue('" + id + "', " + value + ");",
|
||||
scripting::ScriptEngine::RemoteScripting::Yes
|
||||
);
|
||||
|
||||
@@ -33,6 +33,8 @@
|
||||
|
||||
#include <openspace/engine/openspaceengine.h>
|
||||
|
||||
#include <openspace/engine/globalscallbacks.h>
|
||||
|
||||
#include <modules/iswa/rendering/textureplane.h>
|
||||
#include <modules/iswa/rendering/dataplane.h>
|
||||
#include <modules/iswa/rendering/kameleonplane.h>
|
||||
@@ -45,12 +47,7 @@
|
||||
namespace openspace {
|
||||
|
||||
IswaModule::IswaModule() : OpenSpaceModule(Name) {
|
||||
OsEng.registerModuleCallback(
|
||||
OpenSpaceEngine::CallbackOption::Initialize,
|
||||
[](){
|
||||
IswaManager::initialize();
|
||||
}
|
||||
);
|
||||
global::callback::initialize.push_back([]() { IswaManager::initialize(); });
|
||||
}
|
||||
|
||||
void IswaModule::internalInitialize(const ghoul::Dictionary&) {
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
|
||||
#include <modules/iswa/rendering/iswabasegroup.h>
|
||||
#include <modules/iswa/util/dataprocessortext.h>
|
||||
#include <openspace/engine/openspaceengine.h>
|
||||
#include <openspace/engine/globals.h>
|
||||
#include <openspace/rendering/renderengine.h>
|
||||
#include <ghoul/filesystem/filesystem.h>
|
||||
#include <ghoul/opengl/programobject.h>
|
||||
@@ -39,7 +39,7 @@ void DataPlane::initializeGL() {
|
||||
IswaCygnet::initialize();
|
||||
|
||||
if (!_shader) {
|
||||
_shader = OsEng.renderEngine().buildRenderProgram(
|
||||
_shader = global::renderEngine.buildRenderProgram(
|
||||
"DataPlaneProgram",
|
||||
absPath("${MODULE_ISWA}/shaders/dataplane_vs.glsl"),
|
||||
absPath("${MODULE_ISWA}/shaders/dataplane_fs.glsl")
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
|
||||
#include <modules/iswa/rendering/datasphere.h>
|
||||
|
||||
#include <openspace/engine/openspaceengine.h>
|
||||
#include <openspace/engine/globals.h>
|
||||
#include <openspace/rendering/renderengine.h>
|
||||
#include <openspace/util/powerscaledscalar.h>
|
||||
#include <openspace/util/powerscaledsphere.h>
|
||||
@@ -48,7 +48,7 @@ void DataSphere::initializeGL() {
|
||||
IswaCygnet::initializeGL();
|
||||
|
||||
if (!_shader) {
|
||||
_shader = OsEng.renderEngine().buildRenderProgram(
|
||||
_shader = global::renderEngine.buildRenderProgram(
|
||||
"DataSphereProgram",
|
||||
absPath("${MODULE_ISWA}/shaders/datasphere_vs.glsl"),
|
||||
absPath("${MODULE_ISWA}/shaders/datasphere_fs.glsl")
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
|
||||
#include <modules/iswa/rendering/iswabasegroup.h>
|
||||
#include <modules/iswa/util/iswamanager.h>
|
||||
#include <openspace/engine/openspaceengine.h>
|
||||
#include <openspace/engine/globals.h>
|
||||
#include <openspace/rendering/renderengine.h>
|
||||
#include <openspace/scripting/scriptengine.h>
|
||||
#include <openspace/util/powerscaledcoordinate.h>
|
||||
@@ -114,7 +114,7 @@ void IswaCygnet::initializeGL() {
|
||||
} else {
|
||||
_delete.onChange([this]() {
|
||||
deinitialize();
|
||||
OsEng.scriptEngine().queueScript(
|
||||
global::scriptEngine.queueScript(
|
||||
"openspace.removeSceneGraphNode('" + identifier() + "')",
|
||||
scripting::ScriptEngine::RemoteScripting::Yes
|
||||
);
|
||||
@@ -123,7 +123,7 @@ void IswaCygnet::initializeGL() {
|
||||
|
||||
initializeTime();
|
||||
createGeometry();
|
||||
downloadTextureResource(OsEng.timeManager().time().j2000Seconds());
|
||||
downloadTextureResource(global::timeManager.time().j2000Seconds());
|
||||
}
|
||||
|
||||
void IswaCygnet::deinitializeGL() {
|
||||
@@ -135,7 +135,7 @@ void IswaCygnet::deinitializeGL() {
|
||||
destroyGeometry();
|
||||
|
||||
if (_shader) {
|
||||
OsEng.renderEngine().removeRenderProgram(_shader.get());
|
||||
global::renderEngine.removeRenderProgram(_shader.get());
|
||||
_shader = nullptr;
|
||||
}
|
||||
}
|
||||
@@ -186,7 +186,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 = OsEng.timeManager().time().j2000Seconds();
|
||||
_openSpaceTime = global::timeManager.time().j2000Seconds();
|
||||
_realTime = std::chrono::duration_cast<std::chrono::milliseconds>(
|
||||
std::chrono::system_clock::now().time_since_epoch()
|
||||
);
|
||||
@@ -211,7 +211,7 @@ void IswaCygnet::update(const UpdateData&) {
|
||||
updateTexture();
|
||||
_textureDirty = false;
|
||||
|
||||
double clockwiseSign = (OsEng.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;
|
||||
@@ -233,7 +233,7 @@ void IswaCygnet::registerProperties() {}
|
||||
void IswaCygnet::unregisterProperties() {}
|
||||
|
||||
void IswaCygnet::initializeTime() {
|
||||
_openSpaceTime = OsEng.timeManager().time().j2000Seconds();
|
||||
_openSpaceTime = global::timeManager.time().j2000Seconds();
|
||||
_lastUpdateOpenSpaceTime = 0.0;
|
||||
|
||||
_realTime = std::chrono::duration_cast<std::chrono::milliseconds>(
|
||||
@@ -270,7 +270,7 @@ void IswaCygnet::initializeGroup() {
|
||||
|
||||
groupEvent.subscribe(identifier(), "clearGroup", [&](ghoul::Dictionary) {
|
||||
LDEBUG(identifier() + " Event clearGroup");
|
||||
OsEng.scriptEngine().queueScript(
|
||||
global::scriptEngine.queueScript(
|
||||
"openspace.removeSceneGraphNode('" + identifier() + "')",
|
||||
scripting::ScriptEngine::RemoteScripting::Yes
|
||||
);
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
|
||||
#include <modules/iswa/util/iswamanager.h>
|
||||
#include <openspace/json.h>
|
||||
#include <openspace/engine/openspaceengine.h>
|
||||
#include <openspace/engine/globals.h>
|
||||
#include <openspace/scripting/scriptengine.h>
|
||||
#include <ghoul/logging/logmanager.h>
|
||||
#include <fstream>
|
||||
@@ -149,7 +149,7 @@ void IswaKameleonGroup::updateFieldlineSeeds() {
|
||||
if (it == options.end() && std::get<2>(seedPath.second)) {
|
||||
LDEBUG("Removed fieldlines: " + std::get<0>(seedPath.second));
|
||||
|
||||
OsEng.scriptEngine().queueScript(
|
||||
global::scriptEngine.queueScript(
|
||||
"openspace.removeSceneGraphNode('" + std::get<0>(seedPath.second) + "')",
|
||||
scripting::ScriptEngine::RemoteScripting::Yes
|
||||
);
|
||||
@@ -175,7 +175,7 @@ void IswaKameleonGroup::clearFieldlines() {
|
||||
if (std::get<2>(seedPath.second)) {
|
||||
LDEBUG("Removed fieldlines: " + std::get<0>(seedPath.second));
|
||||
|
||||
OsEng.scriptEngine().queueScript(
|
||||
global::scriptEngine.queueScript(
|
||||
"openspace.removeSceneGraphNode('" + std::get<0>(seedPath.second) + "')",
|
||||
scripting::ScriptEngine::RemoteScripting::Yes
|
||||
);
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
#include <modules/iswa/util/dataprocessorkameleon.h>
|
||||
#include <modules/iswa/util/iswamanager.h>
|
||||
#include <openspace/json.h>
|
||||
#include <openspace/engine/openspaceengine.h>
|
||||
#include <openspace/engine/globals.h>
|
||||
#include <openspace/rendering/renderengine.h>
|
||||
#include <openspace/scene/scene.h>
|
||||
#include <openspace/scripting/scriptengine.h>
|
||||
@@ -112,7 +112,7 @@ void KameleonPlane::deinitializeGL() {
|
||||
|
||||
void KameleonPlane::initializeGL() {
|
||||
if (!_shader) {
|
||||
_shader = OsEng.renderEngine().buildRenderProgram(
|
||||
_shader = global::renderEngine.buildRenderProgram(
|
||||
"DataPlaneProgram",
|
||||
absPath("${MODULE_ISWA}/shaders/dataplane_vs.glsl"),
|
||||
absPath("${MODULE_ISWA}/shaders/dataplane_fs.glsl")
|
||||
@@ -272,7 +272,7 @@ void KameleonPlane::updateFieldlineSeeds() {
|
||||
seedPath.first
|
||||
);
|
||||
if (it == selectedOptions.end() && std::get<2>(seedPath.second)) {
|
||||
SceneGraphNode* n = OsEng.renderEngine().scene()->sceneGraphNode(
|
||||
SceneGraphNode* n = global::renderEngine.scene()->sceneGraphNode(
|
||||
std::get<0>(seedPath.second)
|
||||
);
|
||||
if (!n) {
|
||||
@@ -280,14 +280,14 @@ void KameleonPlane::updateFieldlineSeeds() {
|
||||
}
|
||||
|
||||
LDEBUG("Removed fieldlines: " + std::get<0>(seedPath.second));
|
||||
OsEng.scriptEngine().queueScript(
|
||||
global::scriptEngine.queueScript(
|
||||
"openspace.removeSceneGraphNode('" + std::get<0>(seedPath.second) + "')",
|
||||
scripting::ScriptEngine::RemoteScripting::Yes
|
||||
);
|
||||
std::get<2>(seedPath.second) = false;
|
||||
// if this option was turned on
|
||||
} else if (it != selectedOptions.end() && !std::get<2>(seedPath.second)) {
|
||||
SceneGraphNode* n = OsEng.renderEngine().scene()->sceneGraphNode(
|
||||
SceneGraphNode* n = global::renderEngine.scene()->sceneGraphNode(
|
||||
std::get<0>(seedPath.second)
|
||||
);
|
||||
if (n) {
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
#include <modules/iswa/rendering/screenspacecygnet.h>
|
||||
|
||||
#include <modules/iswa/util/iswamanager.h>
|
||||
#include <openspace/engine/openspaceengine.h>
|
||||
#include <openspace/engine/globals.h>
|
||||
#include <openspace/scripting/scriptengine.h>
|
||||
#include <openspace/util/timemanager.h>
|
||||
|
||||
@@ -40,10 +40,10 @@ ScreenSpaceCygnet::ScreenSpaceCygnet(const ghoul::Dictionary& dictionary)
|
||||
_downloadImage = true;
|
||||
_texturePath = IswaManager::ref().iswaUrl(
|
||||
_cygnetId,
|
||||
OsEng.timeManager().time().j2000Seconds()
|
||||
global::timeManager.time().j2000Seconds()
|
||||
);
|
||||
|
||||
_openSpaceTime = OsEng.timeManager().time().j2000Seconds();
|
||||
_openSpaceTime = global::timeManager.time().j2000Seconds();
|
||||
_lastUpdateOpenSpaceTime = _openSpaceTime;
|
||||
|
||||
_realTime = std::chrono::duration_cast<std::chrono::milliseconds>(
|
||||
@@ -53,7 +53,7 @@ ScreenSpaceCygnet::ScreenSpaceCygnet(const ghoul::Dictionary& dictionary)
|
||||
_minRealTimeUpdateInterval = 100;
|
||||
|
||||
_delete.onChange([this]() {
|
||||
OsEng.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 = OsEng.timeManager().time().j2000Seconds();
|
||||
_openSpaceTime = global::timeManager.time().j2000Seconds();
|
||||
_realTime = std::chrono::duration_cast<std::chrono::milliseconds>(
|
||||
std::chrono::system_clock::now().time_since_epoch()
|
||||
);
|
||||
@@ -72,7 +72,7 @@ void ScreenSpaceCygnet::update() {
|
||||
if (timeToUpdate) {
|
||||
_texturePath = IswaManager::ref().iswaUrl(
|
||||
_cygnetId,
|
||||
OsEng.timeManager().time().j2000Seconds()
|
||||
global::timeManager.time().j2000Seconds()
|
||||
);
|
||||
_lastUpdateRealTime = _realTime;
|
||||
_lastUpdateOpenSpaceTime = _openSpaceTime;
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
|
||||
#include <modules/iswa/rendering/textureplane.h>
|
||||
|
||||
#include <openspace/engine/openspaceengine.h>
|
||||
#include <openspace/engine/globals.h>
|
||||
#include <openspace/rendering/renderengine.h>
|
||||
#include <ghoul/filesystem/filesystem.h>
|
||||
#include <ghoul/opengl/texture.h>
|
||||
@@ -39,7 +39,7 @@ TexturePlane::TexturePlane(const ghoul::Dictionary& dictionary)
|
||||
|
||||
void TexturePlane::initializeGL() {
|
||||
if (!_shader) {
|
||||
_shader = OsEng.renderEngine().buildRenderProgram(
|
||||
_shader = global::renderEngine.buildRenderProgram(
|
||||
"PlaneProgram",
|
||||
absPath("${MODULE_ISWA}/shaders/textureplane_vs.glsl"),
|
||||
absPath("${MODULE_ISWA}/shaders/textureplane_fs.glsl")
|
||||
|
||||
@@ -34,7 +34,7 @@
|
||||
#include <modules/iswa/rendering/textureplane.h>
|
||||
#include <modules/kameleon/include/kameleonwrapper.h>
|
||||
#include <openspace/json.h>
|
||||
#include <openspace/engine/openspaceengine.h>
|
||||
#include <openspace/engine/globals.h>
|
||||
#include <openspace/scene/scene.h>
|
||||
#include <openspace/scripting/scriptengine.h>
|
||||
#include <openspace/util/spicemanager.h>
|
||||
@@ -84,7 +84,7 @@ namespace {
|
||||
|
||||
void createScreenSpace(int id) {
|
||||
std::string idStr = std::to_string(id);
|
||||
OsEng.scriptEngine().queueScript(
|
||||
openspace::global::scriptEngine.queueScript(
|
||||
"openspace.iswa.addScreenSpaceCygnet({CygnetId =" + idStr + "});",
|
||||
openspace::scripting::ScriptEngine::RemoteScripting::Yes
|
||||
);
|
||||
@@ -105,7 +105,7 @@ IswaManager::IswaManager()
|
||||
_geom[CygnetGeometry::Plane] = "Plane";
|
||||
_geom[CygnetGeometry::Sphere] = "Sphere";
|
||||
|
||||
OsEng.downloadManager().fetchFile(
|
||||
global::downloadManager.fetchFile(
|
||||
"http://iswa3.ccmc.gsfc.nasa.gov/IswaSystemWebApp/CygnetHealthServlet",
|
||||
[this](const DownloadManager::MemoryFile& file) {
|
||||
fillCygnetInfo(std::string(file.buffer));
|
||||
@@ -160,7 +160,7 @@ void IswaManager::addIswaCygnet(int id, const std::string& type, std::string gro
|
||||
};
|
||||
|
||||
// Download metadata
|
||||
OsEng.downloadManager().fetchFile(
|
||||
global::downloadManager.fetchFile(
|
||||
_baseUrl + std::to_string(-id),
|
||||
metadataCallback,
|
||||
[id](const std::string& err) {
|
||||
@@ -191,7 +191,7 @@ void IswaManager::addKameleonCdf(std::string groupName, int pos) {
|
||||
std::future<DownloadManager::MemoryFile> IswaManager::fetchImageCygnet(int id,
|
||||
double timestamp)
|
||||
{
|
||||
return OsEng.downloadManager().fetchFile(
|
||||
return global::downloadManager.fetchFile(
|
||||
iswaUrl(id, timestamp, "image"),
|
||||
[id](const DownloadManager::MemoryFile&) {
|
||||
LDEBUG(
|
||||
@@ -211,7 +211,7 @@ std::future<DownloadManager::MemoryFile> IswaManager::fetchImageCygnet(int id,
|
||||
std::future<DownloadManager::MemoryFile> IswaManager::fetchDataCygnet(int id,
|
||||
double timestamp)
|
||||
{
|
||||
return OsEng.downloadManager().fetchFile(
|
||||
return global::downloadManager.fetchFile(
|
||||
iswaUrl(id, timestamp, "data"),
|
||||
[id](const DownloadManager::MemoryFile&) {
|
||||
LDEBUG(
|
||||
@@ -305,7 +305,7 @@ std::shared_ptr<MetadataFuture> IswaManager::downloadMetadata(int id) {
|
||||
std::shared_ptr<MetadataFuture> metaFuture = std::make_shared<MetadataFuture>();
|
||||
|
||||
metaFuture->id = id;
|
||||
OsEng.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);
|
||||
@@ -504,7 +504,7 @@ void IswaManager::createPlane(MetadataFuture& data) {
|
||||
|
||||
data.name = name;
|
||||
|
||||
if (OsEng.renderEngine().scene()->sceneGraphNode(name)) {
|
||||
if (global::renderEngine.scene()->sceneGraphNode(name)) {
|
||||
LERROR("A node with name \"" + name + "\" already exist");
|
||||
return;
|
||||
}
|
||||
@@ -512,7 +512,7 @@ void IswaManager::createPlane(MetadataFuture& data) {
|
||||
std::string luaTable = jsonPlaneToLuaTable(data);
|
||||
if (!luaTable.empty()) {
|
||||
std::string script = "openspace.addSceneGraphNode(" + luaTable + ");";
|
||||
OsEng.scriptEngine().queueScript(
|
||||
global::scriptEngine.queueScript(
|
||||
script,
|
||||
scripting::ScriptEngine::RemoteScripting::Yes
|
||||
);
|
||||
@@ -537,14 +537,14 @@ void IswaManager::createSphere(MetadataFuture& data) {
|
||||
|
||||
data.name = name;
|
||||
|
||||
if (OsEng.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 + ");";
|
||||
OsEng.scriptEngine().queueScript(
|
||||
global::scriptEngine.queueScript(
|
||||
script,
|
||||
scripting::ScriptEngine::RemoteScripting::Yes
|
||||
);
|
||||
@@ -570,7 +570,7 @@ void IswaManager::createKameleonPlane(CdfInfo info, std::string cut) {
|
||||
|
||||
info.name = info.name + "-" + cut;
|
||||
|
||||
if (OsEng.renderEngine().scene()->sceneGraphNode(info.name)) {
|
||||
if (global::renderEngine.scene()->sceneGraphNode(info.name)) {
|
||||
LERROR("A node with name \"" + info.name +"\" already exist");
|
||||
return;
|
||||
}
|
||||
@@ -578,7 +578,7 @@ void IswaManager::createKameleonPlane(CdfInfo info, std::string cut) {
|
||||
std::string luaTable = parseKWToLuaTable(info, cut);
|
||||
if (!luaTable.empty()) {
|
||||
std::string script = "openspace.addSceneGraphNode(" + luaTable + ");";
|
||||
OsEng.scriptEngine().queueScript(
|
||||
global::scriptEngine.queueScript(
|
||||
script,
|
||||
scripting::ScriptEngine::RemoteScripting::Yes
|
||||
);
|
||||
@@ -617,7 +617,7 @@ void IswaManager::createFieldline(std::string name, std::string cdfPath,
|
||||
"}";
|
||||
if (!luaTable.empty()) {
|
||||
std::string script = "openspace.addSceneGraphNode(" + luaTable + ");";
|
||||
OsEng.scriptEngine().queueScript(
|
||||
global::scriptEngine.queueScript(
|
||||
script,
|
||||
scripting::ScriptEngine::RemoteScripting::Yes
|
||||
);
|
||||
|
||||
@@ -22,6 +22,7 @@
|
||||
* OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. *
|
||||
****************************************************************************************/
|
||||
|
||||
#include <openspace/engine/globals.h>
|
||||
#include <openspace/rendering/renderengine.h>
|
||||
#include <openspace/rendering/screenspacerenderable.h>
|
||||
|
||||
@@ -84,7 +85,7 @@ int iswa_addScreenSpaceCygnet(lua_State* L) {
|
||||
int updateInterval = info->updateInterval;
|
||||
info->selected = true;
|
||||
|
||||
if (OsEng.renderEngine().screenSpaceRenderable(name)) {
|
||||
if (global::renderEngine.screenSpaceRenderable(name)) {
|
||||
LERROR("A cygnet with the name \"" + name +"\" already exist");
|
||||
return 0;
|
||||
} else {
|
||||
@@ -95,7 +96,7 @@ int iswa_addScreenSpaceCygnet(lua_State* L) {
|
||||
std::unique_ptr<ScreenSpaceRenderable> s(
|
||||
ScreenSpaceRenderable::createFromDictionary(d)
|
||||
);
|
||||
OsEng.renderEngine().addScreenSpaceRenderable(std::move(s));
|
||||
global::renderEngine.addScreenSpaceRenderable(std::move(s));
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
@@ -122,7 +123,7 @@ int iswa_addScreenSpaceCygnet(lua_State* L) {
|
||||
|
||||
int iswa_removeCygnet(lua_State* L) {
|
||||
std::string name = luaL_checkstring(L, -1);
|
||||
OsEng.scriptEngine().queueScript(
|
||||
global::scriptEngine.queueScript(
|
||||
"openspace.removeSceneGraphNode('" + name + "')",
|
||||
scripting::ScriptEngine::RemoteScripting::Yes
|
||||
);
|
||||
@@ -148,7 +149,7 @@ int iswa_removeScrenSpaceCygnet(lua_State* L) {
|
||||
"openspace.unregisterScreenSpaceRenderable('" +
|
||||
cygnetInformation[id]->name + "');";
|
||||
|
||||
OsEng.scriptEngine().queueScript(
|
||||
global::scriptEngine.queueScript(
|
||||
script,
|
||||
scripting::ScriptEngine::RemoteScripting::Yes
|
||||
);
|
||||
|
||||
@@ -32,7 +32,7 @@
|
||||
#include <modules/volume/rendering/volumeclipplanes.h>
|
||||
#include <modules/volume/transferfunctionhandler.h>
|
||||
#include <modules/volume/volumegridtype.h>
|
||||
#include <openspace/engine/openspaceengine.h>
|
||||
#include <openspace/engine/globals.h>
|
||||
#include <openspace/rendering/renderengine.h>
|
||||
#include <openspace/rendering/raycastermanager.h>
|
||||
#include <openspace/util/updatestructures.h>
|
||||
@@ -264,14 +264,14 @@ void RenderableKameleonVolume::initializeGL() {
|
||||
|
||||
_raycaster->initialize();
|
||||
|
||||
OsEng.renderEngine().raycasterManager().attachRaycaster(*_raycaster.get());
|
||||
global::raycasterManager.attachRaycaster(*_raycaster.get());
|
||||
|
||||
auto onChange = [&](bool enabled) {
|
||||
if (enabled) {
|
||||
OsEng.renderEngine().raycasterManager().attachRaycaster(*_raycaster.get());
|
||||
global::raycasterManager.attachRaycaster(*_raycaster.get());
|
||||
}
|
||||
else {
|
||||
OsEng.renderEngine().raycasterManager().detachRaycaster(*_raycaster.get());
|
||||
global::raycasterManager.detachRaycaster(*_raycaster.get());
|
||||
}
|
||||
};
|
||||
|
||||
@@ -436,7 +436,7 @@ void RenderableKameleonVolume::storeRaw(const std::string& path) {
|
||||
|
||||
void RenderableKameleonVolume::deinitializeGL() {
|
||||
if (_raycaster) {
|
||||
OsEng.renderEngine().raycasterManager().detachRaycaster(*_raycaster.get());
|
||||
global::raycasterManager.detachRaycaster(*_raycaster.get());
|
||||
_raycaster = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -113,7 +113,6 @@ void AtlasManager::updateAtlas(BufferIndex bufferIndex, std::vector<int>& brickI
|
||||
|
||||
if (!mappedBuffer) {
|
||||
LERRORC("AtlasManager", "Failed to map PBO");
|
||||
std::cout << glGetError() << std::endl;
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -24,47 +24,38 @@
|
||||
|
||||
#include <modules/multiresvolume/rendering/renderablemultiresvolume.h>
|
||||
|
||||
#include <openspace/engine/openspaceengine.h>
|
||||
#include <modules/kameleon/include/kameleonwrapper.h>
|
||||
#include <modules/multiresvolume/rendering/atlasmanager.h>
|
||||
#include <modules/multiresvolume/rendering/errorhistogrammanager.h>
|
||||
#include <modules/multiresvolume/rendering/histogrammanager.h>
|
||||
#include <modules/multiresvolume/rendering/localerrorhistogrammanager.h>
|
||||
#include <modules/multiresvolume/rendering/localtfbrickselector.h>
|
||||
#include <modules/multiresvolume/rendering/multiresvolumeraycaster.h>
|
||||
#include <modules/multiresvolume/rendering/shenbrickselector.h>
|
||||
#include <modules/multiresvolume/rendering/simpletfbrickselector.h>
|
||||
#include <modules/multiresvolume/rendering/tfbrickselector.h>
|
||||
#include <modules/multiresvolume/rendering/tsp.h>
|
||||
#include <openspace/engine/globals.h>
|
||||
#include <openspace/rendering/renderengine.h>
|
||||
#include <openspace/rendering/raycastermanager.h>
|
||||
#include <openspace/util/updatestructures.h>
|
||||
#include <ghoul/misc/dictionary.h>
|
||||
|
||||
#include <ghoul/glm.h>
|
||||
#include <openspace/rendering/transferfunction.h>
|
||||
#include <modules/multiresvolume/rendering/multiresvolumeraycaster.h>
|
||||
|
||||
#include <ghoul/filesystem/filesystem.h>
|
||||
#include <ghoul/filesystem/file.h>
|
||||
#include <openspace/util/spicemanager.h>
|
||||
#include <openspace/util/time.h>
|
||||
#include <openspace/util/updatestructures.h>
|
||||
#include <ghoul/fmt.h>
|
||||
#include <ghoul/glm.h>
|
||||
#include <ghoul/filesystem/cachemanager.h>
|
||||
|
||||
#include <ghoul/filesystem/file.h>
|
||||
#include <ghoul/filesystem/filesystem.h>
|
||||
#include <ghoul/io/texture/texturereader.h>
|
||||
#include <ghoul/misc/dictionary.h>
|
||||
#include <ghoul/opengl/framebufferobject.h>
|
||||
#include <ghoul/opengl/programobject.h>
|
||||
#include <ghoul/io/texture/texturereader.h>
|
||||
#include <ghoul/opengl/texture.h>
|
||||
|
||||
#include <modules/multiresvolume/rendering/tsp.h>
|
||||
#include <modules/multiresvolume/rendering/atlasmanager.h>
|
||||
#include <modules/multiresvolume/rendering/shenbrickselector.h>
|
||||
#include <modules/multiresvolume/rendering/tfbrickselector.h>
|
||||
#include <modules/multiresvolume/rendering/simpletfbrickselector.h>
|
||||
#include <modules/multiresvolume/rendering/localtfbrickselector.h>
|
||||
|
||||
#include <modules/multiresvolume/rendering/histogrammanager.h>
|
||||
#include <modules/multiresvolume/rendering/errorhistogrammanager.h>
|
||||
#include <modules/multiresvolume/rendering/localerrorhistogrammanager.h>
|
||||
|
||||
#include <openspace/util/time.h>
|
||||
#include <openspace/util/spicemanager.h>
|
||||
|
||||
#include <algorithm>
|
||||
#include <iterator>
|
||||
#include <fstream>
|
||||
#include <algorithm>
|
||||
#include <chrono>
|
||||
|
||||
#include <ghoul/fmt.h>
|
||||
#include <fstream>
|
||||
#include <iterator>
|
||||
|
||||
namespace {
|
||||
constexpr const char* _loggerCat = "RenderableMultiresVolume";
|
||||
@@ -426,14 +417,14 @@ void RenderableMultiresVolume::initializeGL() {
|
||||
);
|
||||
_raycaster->initialize();
|
||||
|
||||
OsEng.renderEngine().raycasterManager().attachRaycaster(*_raycaster);
|
||||
global::raycasterManager.attachRaycaster(*_raycaster);
|
||||
|
||||
auto onChange = [&](bool enabled) {
|
||||
if (enabled) {
|
||||
OsEng.renderEngine().raycasterManager().attachRaycaster(*_raycaster);
|
||||
global::raycasterManager.attachRaycaster(*_raycaster);
|
||||
}
|
||||
else {
|
||||
OsEng.renderEngine().raycasterManager().detachRaycaster(*_raycaster);
|
||||
global::raycasterManager.detachRaycaster(*_raycaster);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user