Merge branch 'develop' of github.com:OpenSpace/OpenSpace into feature/parallelconnection

Conflicts:
	include/openspace/engine/openspaceengine.h
	src/engine/openspaceengine.cpp
	src/interaction/interactionhandler.cpp
	src/network/parallelconnection.cpp
	src/scripting/scriptengine.cpp
This commit is contained in:
Emil Axelsson
2016-09-22 19:33:05 +02:00
311 changed files with 12363 additions and 4144 deletions

View File

@@ -25,6 +25,8 @@
#ifndef __CONFIGURATIONMANAGER_H__
#define __CONFIGURATIONMANAGER_H__
#include <openspace/documentation/documentation.h>
#include <ghoul/misc/dictionary.h>
namespace openspace {
@@ -49,22 +51,22 @@ public:
/// The key that stores the location of the SGCT configuration file that is used on
/// application launch
static const std::string KeyConfigSgct;
/// The key that stores the type of Lua documentation that should be stored
static const std::string KeyLuaDocumentationType;
/// The key that stores the save location of the Lua documentation
static const std::string KeyLuaDocumentationFile;
/// The key that stores the type of scripting log that should be stored
static const std::string KeyScriptLogType;
/// The key that stores the save location of the scripting log
static const std::string KeyScriptLogFile;
/// The key that stores the type of Property documentation that should be stored
static const std::string KeyPropertyDocumentationType;
/// The key that stores the save location of the Property documentation
static const std::string KeyPropertyDocumentationFile;
/// The key that stores the type of keyboard bindings that should be stored
static const std::string KeyKeyboardShortcutsType;
/// The key that stores the save location of the keyboard bindings file
static const std::string KeyKeyboardShortcutsFile;
/// The part of the key that defines the type
static const std::string PartType;
/// The part of the key that defines the file
static const std::string PartFile;
/// The key that stores the Lua documentation
static const std::string KeyLuaDocumentation;
/// The key that stores the scripting log
static const std::string KeyScriptLog;
/// The key that stores the Property documentation
static const std::string KeyPropertyDocumentation;
/// The key that stores the keyboard bindings that should be stored
static const std::string KeyKeyboardShortcuts;
/// The key that stores the main documentation
static const std::string KeyDocumentation;
/// The key that stores the factory documentation values
static const std::string KeyFactoryDocumentation;
/// The key that stores the location of the scene file that is initially loaded
static const std::string KeyConfigScene;
/// The key that stores the subdirectory containing a list of all startup scripts to
@@ -73,18 +75,24 @@ public:
/// The key that stores the subdirectory containing a list of all settings scripts to
/// be executed on application start and after the scene file is loaded
static const std::string KeySettingsScript;
/// The key that stores the settings for determining log-related settings
static const std::string KeyLogging;
/// The key that stores the desired LogLevel for the whole application
/// \sa ghoul::logging::LogManager
static const std::string KeyLogLevel;
static const std::string PartLogLevel;
/// The key that stores whether the log should be immediately flushed after a n
/// \sa ghoul::logging::LogManager
static const std::string KeyLogImmediateFlush;
static const std::string PartImmediateFlush;
/// The key that stores a subdirectory with a description for additional
/// ghoul::logging::Log%s to be created
/// \sa LogFactory
static const std::string KeyLogs;
static const std::string PartLogs;
/// The key that stores whether a log should be appended to or should be overwritten
static const std::string PartAppend;
/// The key that stores the verbosity (None, Minimal, Default, Full) of the system
/// capabilities components
static const std::string PartCapabilitiesVerbosity;
/// The full key that stores the verbosity of the system capabilities component
static const std::string KeyCapabilitiesVerbosity;
/// The key that stores the time (in seconds) that the application will wait before
/// shutting down after the shutdown call is made
@@ -95,6 +103,9 @@ public:
/// The key that sets the request URL that is used to request additional data to be
/// downloaded
static const std::string KeyDownloadRequestURL;
/// The key that stores the switch for enabling/disabling the rendering on a master
/// computer
static const std::string KeyRenderingMethod;
/**
* Iteratively walks the directory structure starting with \p filename to find the
@@ -123,6 +134,8 @@ public:
*/
void loadFromFile(const std::string& filename);
static openspace::Documentation Documentation();
private:
/**
* Checks whether the loaded configuration file is complete, that is specifying the

View File

@@ -29,6 +29,7 @@
#include <openspace/util/mouse.h>
#include <openspace/scripting/scriptengine.h>
#include <openspace/scripting/scriptscheduler.h>
#include <ghoul/glm.h>
#include <ghoul/misc/dictionary.h>
@@ -50,11 +51,11 @@ class LuaConsole;
class NetworkEngine;
class GUI;
class RenderEngine;
class SyncBuffer;
class ModuleEngine;
class WindowWrapper;
class SettingsEngine;
class TimeManager;
class SyncEngine;
namespace interaction { class InteractionHandler; }
namespace gui { class GUI; }
@@ -81,6 +82,7 @@ public:
interaction::InteractionHandler& interactionHandler();
RenderEngine& renderEngine();
scripting::ScriptEngine& scriptEngine();
scripting::ScriptScheduler& scriptScheduler();
NetworkEngine& networkEngine();
LuaConsole& console();
ModuleEngine& moduleEngine();
@@ -115,6 +117,9 @@ public:
void disableBarrier();
void toggleShutdownMode();
bool useBusyWaitForDecode();
bool logSGCTOutOfOrderErrors();
void runPostInitializationScripts(const std::string& sceneDescription);
@@ -140,7 +145,9 @@ private:
std::unique_ptr<interaction::InteractionHandler> _interactionHandler;
std::unique_ptr<RenderEngine> _renderEngine;
std::unique_ptr<scripting::ScriptEngine> _scriptEngine;
std::unique_ptr<scripting::ScriptScheduler> _scriptScheduler;
std::unique_ptr<NetworkEngine> _networkEngine;
std::unique_ptr<SyncEngine> _syncEngine;
std::unique_ptr<ghoul::cmdparser::CommandlineParser> _commandlineParser;
std::unique_ptr<LuaConsole> _console;
std::unique_ptr<ModuleEngine> _moduleEngine;
@@ -156,7 +163,6 @@ private:
// Others
std::unique_ptr<properties::PropertyOwner> _globalPropertyNamespace;
std::unique_ptr<SyncBuffer> _syncBuffer;
bool _isMaster;
double _runTime;

View File

@@ -43,12 +43,25 @@ public:
void setModules(std::vector<OpenSpaceModule*> modules);
bool busyWaitForDecode();
bool logSGCTOutOfOrderErrors();
bool useDoubleBuffering();
private:
void initEyeSeparation();
void initSceneFiles();
void initShowFrameNumber();
void initBusyWaitForDecode();
void initLogSGCTOutOfOrderErrors();
void initUseDoubleBuffering();
properties::FloatProperty _eyeSeparation;
properties::OptionProperty _scenes;
properties::BoolProperty _showFrameNumber;
properties::BoolProperty _busyWaitForDecode;
properties::BoolProperty _logSGCTOutOfOrderErrors;
properties::BoolProperty _useDoubleBuffering;
};
} // namespace openspace

View File

@@ -0,0 +1,106 @@
/*****************************************************************************************
* *
* OpenSpace *
* *
* Copyright (c) 2014-2016 *
* *
* 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 __SYNCENGINE_H__
#define __SYNCENGINE_H__
#include <vector>
#include <memory>
namespace openspace {
class Syncable;
class SyncBuffer;
/**
* Manages a collection of <code>Syncable</code>s and ensures they are synchronized
* over SGCT nodes. Encoding/Decoding order is handles internally.
*/
class SyncEngine {
public:
/**
* Dependency injection: a SyncEngine relies on a SyncBuffer to encode the sync data.
*/
SyncEngine(SyncBuffer* syncBuffer);
/**
* Encodes all added Syncables in the injected <code>SyncBuffer</code>.
* This method is only called on the SGCT master node
*/
void encodeSyncables();
/**
* Decodes the <code>SyncBuffer</code> into the added Syncables.
* This method is only called on the SGCT slave nodes
*/
void decodeSyncables();
/**
* Invokes the presync method of all added Syncables
*/
void presync(bool isMaster);
/**
* Invokes the postsync method of all added Syncables
*/
void postsync(bool isMaster);
/**
* Add a Syncable to be synchronized over the SGCT cluster
*/
void addSyncable(Syncable* syncable);
/**
* Add multiple Syncables to be synchronized over the SGCT cluster
*/
void addSyncables(const std::vector<Syncable*>& syncables);
/**
* Remove a Syncable from being synchronized over the SGCT cluster
*/
void removeSyncable(Syncable* syncable);
private:
/**
* Vector of Syncables. The vectors ensures consistent encode/decode order
*/
std::vector<Syncable*> _syncables;
/**
* Databuffer used in encoding/decoding
*/
std::unique_ptr<SyncBuffer> _syncBuffer;
};
} // namespace openspace
#endif //#ifndef __SYNCENGINE_H__

View File

@@ -53,6 +53,8 @@ public:
bool isRegularRendering() const override;
bool hasGuiWindow() const override;
bool isGuiWindow() const override;
bool isUsingSwapGroups() const override;
bool isSwapGroupMaster() const override;
glm::mat4 viewProjectionMatrix() const override;
glm::mat4 modelMatrix() const override;
@@ -66,7 +68,7 @@ public:
bool isSimpleRendering() const override;
void takeScreenshot() const override;
void takeScreenshot(bool applyWarping = false) const override;
};
} // namespace openspace

View File

@@ -153,6 +153,16 @@ public:
*/
virtual bool isGuiWindow() 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.
@@ -216,7 +226,7 @@ public:
/**
* Advises the windowing system to take a screenshot. This method defaults to a no-op.
*/
virtual void takeScreenshot() const;
virtual void takeScreenshot(bool applyWarping = false) const;
struct WindowWrapperException : public ghoul::RuntimeError {
explicit WindowWrapperException(const std::string& msg);