mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-03-08 22:38:42 -05:00
Merge branch 'master' of github.com:OpenSpace/OpenSpace into feature/data-management
This commit is contained in:
@@ -167,7 +167,7 @@ public:
|
||||
* \throw ghoul::RuntimeError If the configuration could not be found
|
||||
*/
|
||||
static std::string findConfiguration(const std::string& filename);
|
||||
|
||||
|
||||
/**
|
||||
* Load the provided configuration file (\p filename) into this Dictionary. All paths
|
||||
* that are specified in the configuration file will automatically be registered in
|
||||
|
||||
@@ -57,7 +57,7 @@ public:
|
||||
* name
|
||||
*/
|
||||
void initialize();
|
||||
|
||||
|
||||
/**
|
||||
* Deinitializes all of the contained OpenSpaceModule%s by calling the
|
||||
* OpenSpaceModule::deinitialize methods.
|
||||
@@ -68,19 +68,19 @@ public:
|
||||
* Registers the passed \p module with this ModuleEngine. The OpenSpaceModule::create
|
||||
* method will be called on the \p module in the process.
|
||||
* \param module The OpenSpaceModule that is to be registered
|
||||
* \throw ghoul::RuntimeError If the name of the \p module was already registered
|
||||
* \throw ghoul::RuntimeError If the name of the \p module was already registered
|
||||
* previously
|
||||
* \pre \p module must not be nullptr
|
||||
*/
|
||||
void registerModule(std::unique_ptr<OpenSpaceModule> module);
|
||||
|
||||
|
||||
/**
|
||||
* Returns a list of all registered OpenSpaceModule%s that have been registered with
|
||||
* this ModuleEngine. All returned OpenSpaceModule%s are guaranteed to be initialized.
|
||||
* \return A list of all registered OpenSpaceModule%s
|
||||
*/
|
||||
std::vector<OpenSpaceModule*> modules() const;
|
||||
|
||||
|
||||
/**
|
||||
* Get the module subclass with given template argument. Requires the module subclass
|
||||
* to have the public static member variable <code>name</code> which must be equal to
|
||||
|
||||
@@ -88,6 +88,7 @@ public:
|
||||
void postSynchronizationPreDraw();
|
||||
void render(const glm::mat4& sceneMatrix, const glm::mat4& viewMatrix,
|
||||
const glm::mat4& projectionMatrix);
|
||||
void drawOverlays();
|
||||
void postDraw();
|
||||
void keyboardCallback(Key key, KeyModifier mod, KeyAction action);
|
||||
void charCallback(unsigned int codepoint, KeyModifier mod);
|
||||
@@ -98,6 +99,7 @@ public:
|
||||
void encode();
|
||||
void decode();
|
||||
|
||||
|
||||
void scheduleLoadSingleAsset(std::string assetPath);
|
||||
|
||||
void writeDocumentation();
|
||||
@@ -124,7 +126,7 @@ public:
|
||||
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
|
||||
@@ -134,16 +136,17 @@ public:
|
||||
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);
|
||||
@@ -151,16 +154,16 @@ public:
|
||||
// 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
|
||||
);
|
||||
|
||||
|
||||
/**
|
||||
* Returns the Lua library that contains all Lua functions available to affect the
|
||||
* application.
|
||||
@@ -215,23 +218,24 @@ private:
|
||||
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;
|
||||
|
||||
|
||||
// Structure that is responsible for the delayed shutdown of the application
|
||||
struct {
|
||||
// Whether the application is currently in shutdown mode (i.e. counting down the
|
||||
|
||||
@@ -34,7 +34,7 @@
|
||||
#include <vector>
|
||||
|
||||
namespace openspace {
|
||||
|
||||
|
||||
class OpenSpaceModule;
|
||||
|
||||
class SettingsEngine : public properties::PropertyOwner {
|
||||
@@ -42,7 +42,7 @@ public:
|
||||
SettingsEngine();
|
||||
|
||||
void initialize();
|
||||
|
||||
|
||||
void setModules(const std::vector<OpenSpaceModule*>& modules);
|
||||
|
||||
private:
|
||||
|
||||
@@ -51,7 +51,7 @@ public:
|
||||
SyncEngine(unsigned int syncBufferSize);
|
||||
|
||||
/**
|
||||
* Encodes all added Syncables in the injected <code>SyncBuffer</code>.
|
||||
* Encodes all added Syncables in the injected <code>SyncBuffer</code>.
|
||||
* This method is only called on the SGCT master node
|
||||
*/
|
||||
void encodeSyncables();
|
||||
@@ -71,7 +71,7 @@ public:
|
||||
* Invokes the postsync method of all added Syncables
|
||||
*/
|
||||
void postSynchronization(IsMaster isMaster);
|
||||
|
||||
|
||||
/**
|
||||
* Add a Syncable to be synchronized over the SGCT cluster.
|
||||
* \pre syncable must not be nullptr
|
||||
@@ -95,7 +95,7 @@ public:
|
||||
void removeSyncables(const std::vector<Syncable*>& syncables);
|
||||
|
||||
private:
|
||||
/**
|
||||
/**
|
||||
* Vector of Syncables. The vectors ensures consistent encode/decode order
|
||||
*/
|
||||
std::vector<Syncable*> _syncables;
|
||||
|
||||
@@ -64,14 +64,14 @@ public:
|
||||
bool isMaster() const override;
|
||||
bool isUsingSwapGroups() const override;
|
||||
bool isSwapGroupMaster() const override;
|
||||
|
||||
|
||||
glm::mat4 viewProjectionMatrix() const override;
|
||||
glm::mat4 modelMatrix() const override;
|
||||
void setNearFarClippingPlane(float near, float far) override;
|
||||
void setEyeSeparationDistance(float distance) override;
|
||||
|
||||
|
||||
glm::ivec4 viewportPixelCoordinates() const override;
|
||||
|
||||
|
||||
bool isExternalControlConnected() const override;
|
||||
void sendMessageToExternalControl(const std::vector<char>& message) const override;
|
||||
|
||||
|
||||
@@ -76,7 +76,7 @@ public:
|
||||
* 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.
|
||||
@@ -84,7 +84,7 @@ public:
|
||||
* \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>.
|
||||
@@ -119,38 +119,38 @@ public:
|
||||
* \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
|
||||
* \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 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 DPI scaling factor for the current window. This is normally 1 on all
|
||||
* regular monitors and 2 on Retina screens.
|
||||
@@ -187,7 +187,7 @@ public:
|
||||
* \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.
|
||||
@@ -201,8 +201,9 @@ public:
|
||||
virtual bool isUsingSwapGroups() const;
|
||||
|
||||
/**
|
||||
* Returns <code>true</code> if the current rendering window is master of the swap its group.
|
||||
*/
|
||||
* Returns <code>true</code> if the current rendering window is master of the swap its
|
||||
* group.
|
||||
*/
|
||||
virtual bool isSwapGroupMaster() const;
|
||||
|
||||
/**
|
||||
@@ -218,7 +219,7 @@ public:
|
||||
* \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.
|
||||
@@ -226,7 +227,7 @@ public:
|
||||
* \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.
|
||||
@@ -241,7 +242,7 @@ public:
|
||||
* \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
|
||||
@@ -249,13 +250,13 @@ public:
|
||||
* \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
|
||||
|
||||
Reference in New Issue
Block a user