Merge branch 'master' of github.com:OpenSpace/OpenSpace into feature/data-management

This commit is contained in:
Emil Axelsson
2017-12-17 18:30:00 +01:00
210 changed files with 5201 additions and 1299 deletions
@@ -51,6 +51,9 @@ 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 defines a list of scripts for global customization that get executed
/// regardless of which scene is loaded
static const std::string KeyGlobalCustomizationScripts;
/// The part of the key that defines the type
static const std::string PartType;
/// The part of the key that defines the file
@@ -43,6 +43,7 @@ namespace openspace {
class AssetManager;
class ConfigurationManager;
class Dashboard;
class DownloadManager;
class GUI;
class LoadingScreen;
@@ -109,6 +110,7 @@ public:
ConfigurationManager& configurationManager();
LuaConsole& console();
AssetManager& assetManager();
Dashboard& dashboard();
DownloadManager& downloadManager();
ModuleEngine& moduleEngine();
LoadingScreen& loadingScreen();
@@ -177,13 +179,18 @@ private:
void loadSingleAsset(const std::string& assetPath);
void gatherCommandlineArguments();
void loadFonts();
void configureLogging(bool consoleLog);
void writeDocumentations();
void runGlobalCustomizationScripts(const std::string& sceneDescription);
void configureLogging();
// Components
std::unique_ptr<ConfigurationManager> _configurationManager;
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;
@@ -40,6 +40,15 @@ namespace openspace::interaction {
class KeyBindingManager : public DocumentationGenerator {
public:
using IsLocalBind = ghoul::Boolean;
using IsSynchronized = ghoul::Boolean;
struct KeyInformation {
std::string command;
IsSynchronized synchronization;
std::string documentation;
};
KeyBindingManager();
~KeyBindingManager() = default;
@@ -59,19 +68,17 @@ public:
std::string documentation = ""
);
void removeKeyBinding(const std::string& key);
std::vector<std::pair<KeyWithModifier, KeyInformation>> keyBinding(
const std::string& key) const;
static scripting::LuaLibrary luaLibrary();
// Callback functions
void keyboardCallback(Key key, KeyModifier modifier, KeyAction action);
private:
using Synchronized = ghoul::Boolean;
struct KeyInformation {
std::string command;
Synchronized synchronization;
std::string documentation;
};
std::string generateJson() const override;
+67
View File
@@ -0,0 +1,67 @@
/*****************************************************************************************
* *
* OpenSpace *
* *
* Copyright (c) 2014-2017 *
* *
* 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___DASHBOARD___H__
#define __OPENSPACE_CORE___DASHBOARD___H__
#include <openspace/properties/propertyowner.h>
#include <openspace/rendering/dashboarditem.h>
#include <ghoul/glm.h>
#include <memory>
#include <vector>
namespace openspace {
namespace scripting { struct LuaLibrary; }
class DashboardItem;
class Dashboard : public properties::PropertyOwner {
public:
Dashboard();
void render(glm::vec2& penPosition);
void addDashboardItem(std::unique_ptr<DashboardItem> item);
bool hasItem(int index) const;
const DashboardItem& item(int index) const;
void removeDashboardItem(int index);
void removeDashboardItems();
/**
* Returns the Lua library that contains all Lua functions available to affect the
* rendering.
*/
static scripting::LuaLibrary luaLibrary();
private:
std::vector<std::unique_ptr<DashboardItem>> _items;
};
} // openspace
#endif // __OPENSPACE_CORE___DASHBOARD___H__
@@ -0,0 +1,58 @@
/*****************************************************************************************
* *
* OpenSpace *
* *
* Copyright (c) 2014-2017 *
* *
* 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___DASHBOARDITEM___H__
#define __OPENSPACE_CORE___DASHBOARDITEM___H__
#include <openspace/properties/propertyowner.h>
#include <openspace/properties/scalar/boolproperty.h>
#include <ghoul/glm.h>
#include <ghoul/misc/dictionary.h>
#include <string>
namespace openspace {
class DashboardItem : public properties::PropertyOwner {
public:
static std::unique_ptr<DashboardItem> createFromDictionary(
ghoul::Dictionary dictionary
);
DashboardItem(std::string name);
bool isEnabled() const;
virtual void render(glm::vec2& penPosition) = 0;
virtual glm::vec2 size() const = 0;
protected:
properties::BoolProperty _isEnabled;
};
} // openspace
#endif // __OPENSPACE_CORE___DASHBOARDITEM___H__
@@ -62,13 +62,6 @@ public:
Invalid
};
enum class FrametimeType {
DtTimeAvg = 0,
FPS,
FPSAvg,
None
};
RenderEngine();
~RenderEngine();
@@ -126,8 +119,6 @@ public:
std::string csPath,
const ghoul::Dictionary& dictionary = ghoul::Dictionary());
std::string progressToStr(int size, double t);
void removeRenderProgram(
const std::unique_ptr<ghoul::opengl::ProgramObject>& program);
@@ -179,8 +170,6 @@ private:
void setRenderer(std::unique_ptr<Renderer> renderer);
RendererImplementation rendererFromString(const std::string& method) const;
void renderInformation();
Camera* _camera;
Scene* _scene;
std::unique_ptr<RaycasterManager> _raycasterManager;
@@ -194,12 +183,6 @@ private:
ghoul::Dictionary _resolveData;
ScreenLog* _log;
properties::OptionProperty _frametimeType;
//FrametimeType _frametimeType;
properties::BoolProperty _showDate;
properties::BoolProperty _showInfo;
properties::BoolProperty _showLog;
properties::BoolProperty _showVersionInfo;
properties::BoolProperty _showCameraInfo;
+1
View File
@@ -217,6 +217,7 @@ struct KeyWithModifier {
KeyWithModifier stringToKey(std::string str);
bool operator<(const KeyWithModifier& lhs, const KeyWithModifier& rhs);
bool operator==(const KeyWithModifier& lhs, const KeyWithModifier& rhs);
static const std::map<std::string, KeyModifier> KeyModifierMapping = {
{ "SHIFT", KeyModifier::Shift },
+9
View File
@@ -87,6 +87,15 @@ public:
*/
virtual scripting::LuaLibrary luaLibrary() const;
/**
* Returns the Lua libraries that are defined by objects contained in this
* OpenSpaceModule. Note that the #luaLibrary library is *not* contained in this list
* as this is solely the list of libraries as defined by, for example Renderables,
* defined in the OpenSpaceModule.
* \return A list of libraries defined by items contained in this OpenSpaceModule
*/
virtual std::vector<scripting::LuaLibrary> luaLibraries() const;
/**
* Returns the minimum required OpenGL version of this OpenSpaceModule. Unless
* overwritten, it returns an OpenGL version of <code>3.3</code>.