Merged master into StereoATM

This commit is contained in:
Jonathas Costa
2018-05-14 13:23:47 -04:00
101 changed files with 2620 additions and 2152 deletions
+7 -3
View File
@@ -39,7 +39,9 @@ struct Configuration {
std::string windowConfiguration = "${CONFIG}/single.xml";
std::string asset = "default";
std::vector<std::string> globalCustomizationScripts;
std::map<std::string, std::string> pathTokens;
std::map<std::string, std::string> pathTokens = {
{ "CACHE" , "CACHE = \"${BASE}/cache\"" }
};
std::map<std::string, std::string> fonts;
struct Logging {
@@ -83,14 +85,14 @@ struct Configuration {
std::string onScreenTextScaling = "window";
bool usePerSceneCache = false;
bool isRenderingOnMasterDisabled = false;
bool isSceneTranslationOnMasterDisabled = false;
std::map<std::string, ghoul::Dictionary> moduleConfigurations;
std::string renderingMethod = "Framebuffer";
struct OpenGLDebugContext {
bool isActive = false;
bool isSynchronous = true;
@@ -129,6 +131,8 @@ std::string findConfiguration(const std::string& filename = "openspace.cfg");
Configuration loadConfigurationFromFile(const std::string& filename);
void parseLuaState(Configuration& configuration);
} // namespace openspace
#endif // __OPENSPACE_CORE___CONFIGURATION___H__
+11 -7
View File
@@ -76,12 +76,12 @@ namespace scripting {
struct ShutdownInformation {
// Whether the application is currently in shutdown mode (i.e. counting down the
// timer and closing it at '0'
bool inShutdown;
bool inShutdown = false;
// Total amount of time the application will wait before actually shutting down
float waitTime;
float waitTime = 0.f;
// Current state of the countdown; if it reaches '0', the application will
// close
float timer;
float timer = 0.f;
};
class OpenSpaceEngine {
@@ -95,7 +95,7 @@ public:
static OpenSpaceEngine& ref();
static bool isCreated();
~OpenSpaceEngine();
~OpenSpaceEngine() = default;
// callbacks
void initialize();
@@ -121,6 +121,9 @@ public:
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
@@ -196,7 +199,6 @@ private:
OpenSpaceEngine(std::string programName,
std::unique_ptr<WindowWrapper> windowWrapper);
std::unique_ptr<LoadingScreen> createLoadingScreen();
void loadSingleAsset(const std::string& assetPath);
void gatherCommandlineArguments();
void loadFonts();
@@ -241,7 +243,7 @@ private:
properties::StringProperty sourceControlInformation;
} _versionInformation;
bool _hasScheduledAssetLoading;
bool _hasScheduledAssetLoading = false;
std::string _scheduledAssetPathToLoad;
struct {
@@ -269,7 +271,9 @@ private:
// 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;
bool _isFirstRenderingFirstFrame = true;
glm::dvec2 _mousePosition;
static OpenSpaceEngine* _engine;
};
@@ -22,8 +22,8 @@
* OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. *
****************************************************************************************/
#ifndef __OPENSPACE_CORE___INPUTDEVICESTATES___H__
#define __OPENSPACE_CORE___INPUTDEVICESTATES___H__
#ifndef __OPENSPACE_CORE___CAMERAINTERACTIONSTATES___H__
#define __OPENSPACE_CORE___CAMERAINTERACTIONSTATES___H__
#include <openspace/interaction/delayedvariable.h>
#include <ghoul/glm.h>
@@ -43,7 +43,7 @@ public:
virtual ~CameraInteractionStates() = default;
virtual void updateStateFromInput(const InputState& inputState, double deltaTime) = 0;
void setRotationalFriction(double friction);
void setHorizontalFriction(double friction);
void setVerticalFriction(double friction);
@@ -78,4 +78,4 @@ protected:
} // namespace openspace::interaction
#endif // __OPENSPACE_CORE___INPUTDEVICESTATES___H__
#endif // __OPENSPACE_CORE___CAMERAINTERACTIONSTATES___H__
@@ -22,8 +22,8 @@
* OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. *
****************************************************************************************/
#ifndef __OPENSPACE_CORE___CAMERAINTERACTIONSTATES___H__
#define __OPENSPACE_CORE___CAMERAINTERACTIONSTATES___H__
#ifndef __OPENSPACE_CORE___INPUTDEVICESTATES___H__
#define __OPENSPACE_CORE___INPUTDEVICESTATES___H__
#include <openspace/interaction/delayedvariable.h>
#include <ghoul/glm.h>
@@ -43,7 +43,7 @@ public:
virtual ~CameraInteractionStates() = default;
virtual void updateStateFromInput(const InputState& inputState, double deltaTime) = 0;
void setRotationalFriction(double friction);
void setHorizontalFriction(double friction);
void setVerticalFriction(double friction);
@@ -78,4 +78,4 @@ protected:
} // namespace openspace::interaction
#endif // __OPENSPACE_CORE___CAMERAINTERACTIONSTATES___H__
#endif // __OPENSPACE_CORE___INPUTDEVICESTATES___H__
@@ -22,8 +22,8 @@
* OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. *
****************************************************************************************/
#ifndef __OPENSPACE_CORE___JOYSTICKSTATE___H__
#define __OPENSPACE_CORE___JOYSTICKSTATE___H__
#ifndef __OPENSPACE_CORE___JOYSTICKCAMERASTATES___H__
#define __OPENSPACE_CORE___JOYSTICKCAMERASTATES___H__
#include <openspace/interaction/camerainteractionstates.h>
@@ -115,8 +115,9 @@ std::string to_string(const openspace::interaction::JoystickCameraStates::AxisTy
namespace ghoul {
template <>
openspace::interaction::JoystickCameraStates::AxisType from_string(const std::string& string);
openspace::interaction::JoystickCameraStates::AxisType
from_string(const std::string& string);
} // namespace ghoul
#endif // __OPENSPACE_CORE___JOYSTICKSTATE___H__
#endif // __OPENSPACE_CORE___JOYSTICKCAMERASTATES___H__
@@ -52,9 +52,9 @@ enum class JoystickAction : uint8_t {
*/
struct JoystickInputState {
/// The maximum number of supported axes
static const int MaxAxes = 8;
static constexpr const int MaxAxes = 8;
/// The maximum number of supported buttons
static const int MaxButtons = 32;
static constexpr const int MaxButtons = 32;
/// Marks whether this joystick is connected. If this value is \c false, all other
/// members of this struct are undefined
@@ -123,4 +123,4 @@ openspace::interaction::JoystickAction from_string(const std::string& str);
} // namespace ghoul
#endif // __OPENSPACE_CORE___JOYSTICKSTATE___H__
#endif // __OPENSPACE_CORE___JOYSTICKINPUTSTATE___H__
@@ -86,8 +86,10 @@ public:
void setJoystickAxisMapping(
int axis,
JoystickCameraStates::AxisType mapping,
JoystickCameraStates::AxisInvert shouldInvert = JoystickCameraStates::AxisInvert::No,
JoystickCameraStates::AxisNormalize shouldNormalize = JoystickCameraStates::AxisNormalize::No
JoystickCameraStates::AxisInvert shouldInvert =
JoystickCameraStates::AxisInvert::No,
JoystickCameraStates::AxisNormalize shouldNormalize =
JoystickCameraStates::AxisNormalize::No
);
JoystickCameraStates::AxisInformation joystickAxisMapping(int axis) const;
@@ -86,7 +86,7 @@ private:
properties::FloatProperty _followFocusNodeRotationDistance;
properties::FloatProperty _minimumAllowedDistance;
properties::FloatProperty _mouseSensitivity;
properties::FloatProperty _joystickSensitivity;
@@ -45,7 +45,7 @@ namespace ghoul::filesystem { class File; }
namespace ghoul::opengl {
class ProgramObject;
class Texture;
} // namespace opengl
} // namespace ghoul::opengl
namespace openspace {
@@ -61,8 +61,6 @@ public:
void initialize() override;
void deinitialize() override;
void setCamera(Camera* camera) override;
void setScene(Scene* scene) override;
void setResolution(glm::ivec2 res) override;
void setNAaSamples(int nAaSamples) override;
void setHDRExposure(float hdrExposure) override;
@@ -79,7 +77,8 @@ public:
void postRaycast(const RaycasterTask& raycasterTask);
void update() override;
void render(float blackoutFactor, bool doPerformanceMeasurements) override;
void render(Scene* scene, Camera* camera, float blackoutFactor,
bool doPerformanceMeasurements) override;
/**
* Update render data
@@ -97,8 +96,6 @@ private:
void saveTextureToMemory(const GLenum color_buffer_attachment,
const int width, const int height, std::vector<double> & memory) const;
Camera* _camera;
Scene* _scene;
glm::ivec2 _resolution;
bool _dirtyResolution;
@@ -44,7 +44,7 @@ namespace ghoul::filesystem { class File; }
namespace ghoul::opengl {
class ProgramObject;
class Texture;
}
} // namespace ghoul::opengl
namespace openspace {
@@ -76,8 +76,6 @@ public:
void updateHDRData();
void updateMSAASamplingPattern();
void setCamera(Camera* camera) override;
void setScene(Scene* scene) override;
void setResolution(glm::ivec2 res) override;
void setNAaSamples(int nAaSamples) override;
void setHDRExposure(float hdrExposure) override;
@@ -86,13 +84,13 @@ public:
float hdrBackground() const override;
int nAaSamples() const override;
/*const double * mSSAPattern() const override;*/
std::vector<double> mSSAPattern() const override;
void update() override;
void render(float blackoutFactor, bool doPerformanceMeasurements) 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;
/**
* Update render data
@@ -135,8 +133,6 @@ private:
bool _dirtyResolution;
bool _dirtyMsaaSamplingPattern;
Camera* _camera;
Scene* _scene;
glm::vec2 _resolution;
int _nAaSamples;
float _hdrExposure;
+26 -26
View File
@@ -36,7 +36,7 @@
namespace ghoul {
class Dictionary;
class SharedMemory;
}
} // ghoul
namespace ghoul::fontrendering { class Font; }
namespace ghoul::opengl { class ProgramObject; }
@@ -77,8 +77,7 @@ public:
Scene* scene();
void updateScene();
Camera* camera() const;
Renderer* renderer() const;
const Renderer& renderer() const;
RendererImplementation rendererImplementation() const;
RaycasterManager& raycasterManager();
DeferredcasterManager& deferredcasterManager();
@@ -91,6 +90,8 @@ public:
void render(const glm::mat4& sceneMatrix, const glm::mat4& viewMatrix,
const glm::mat4& projectionMatrix);
bool mouseActivationCallback(const glm::dvec2& mousePosition) const;
void renderOverlays(const ShutdownInformation& shutdownInfo);
void postDraw();
@@ -101,24 +102,19 @@ public:
float globalBlackOutFactor();
void setGlobalBlackOutFactor(float factor);
void addScreenSpaceRenderable(std::shared_ptr<ScreenSpaceRenderable> s);
void removeScreenSpaceRenderable(std::shared_ptr<ScreenSpaceRenderable> s);
void addScreenSpaceRenderable(std::unique_ptr<ScreenSpaceRenderable> s);
void removeScreenSpaceRenderable(ScreenSpaceRenderable* s);
void removeScreenSpaceRenderable(const std::string& name);
std::shared_ptr<ScreenSpaceRenderable> screenSpaceRenderable(const std::string& name);
ScreenSpaceRenderable* screenSpaceRenderable(const std::string& name);
std::vector<ScreenSpaceRenderable*> screenSpaceRenderables() const;
std::unique_ptr<ghoul::opengl::ProgramObject> buildRenderProgram(
std::string name,
std::string vsPath,
std::string fsPath,
const ghoul::Dictionary& dictionary = ghoul::Dictionary());
const std::string& name, const std::string& vsPath, std::string fsPath,
ghoul::Dictionary dictionary = ghoul::Dictionary());
std::unique_ptr<ghoul::opengl::ProgramObject> buildRenderProgram(
std::string name,
std::string vsPath,
std::string fsPath,
std::string csPath,
const ghoul::Dictionary& dictionary = ghoul::Dictionary());
const std::string& name, const std::string& vsPath, std::string fsPath,
const std::string& csPath, ghoul::Dictionary dictionary = ghoul::Dictionary());
void removeRenderProgram(ghoul::opengl::ProgramObject* program);
@@ -144,13 +140,13 @@ public:
* Lets the renderer update the data to be brought into the rendererer programs
* as a 'rendererData' variable in the dictionary.
*/
void setRendererData(const ghoul::Dictionary& rendererData);
void setRendererData(ghoul::Dictionary rendererData);
/**
* Lets the renderer update the data to be brought into the post rendererer programs
* as a 'resolveData' variable in the dictionary.
*/
void setResolveData(const ghoul::Dictionary& resolveData);
void setResolveData(ghoul::Dictionary resolveData);
/**
* Returns the Lua library that contains all Lua functions available to affect the
@@ -164,8 +160,6 @@ public:
glm::ivec2 renderingResolution() const;
glm::ivec2 fontResolution() const;
std::vector<Syncable*> getSyncables();
properties::PropertyOwner& screenSpaceOwner();
private:
@@ -199,31 +193,37 @@ private:
properties::BoolProperty _showCameraInfo;
properties::TriggerProperty _takeScreenshot;
bool _shouldTakeScreenshot;
bool _shouldTakeScreenshot = false;
properties::BoolProperty _applyWarping;
properties::BoolProperty _showFrameNumber;
properties::BoolProperty _disableMasterRendering;
properties::BoolProperty _disableSceneTranslationOnMaster;
float _globalBlackOutFactor;
float _fadeDuration;
float _currentFadeTime;
int _fadeDirection;
float _globalBlackOutFactor = 1.f;
float _fadeDuration = 2.f;
float _currentFadeTime = 0.f;
int _fadeDirection = 0;
properties::IntProperty _nAaSamples;
properties::FloatProperty _hdrExposure;
properties::FloatProperty _hdrBackground;
properties::FloatProperty _gamma;
uint64_t _frameNumber;
uint64_t _frameNumber = 0;
std::vector<ghoul::opengl::ProgramObject*> _programs;
properties::PropertyOwner _screenSpaceOwner;
std::vector<std::shared_ptr<ScreenSpaceRenderable>> _screenSpaceRenderables;
std::vector<std::unique_ptr<ScreenSpaceRenderable>> _screenSpaceRenderables;
std::shared_ptr<ghoul::fontrendering::Font> _fontBig = nullptr;
std::shared_ptr<ghoul::fontrendering::Font> _fontInfo = nullptr;
std::shared_ptr<ghoul::fontrendering::Font> _fontDate = nullptr;
std::shared_ptr<ghoul::fontrendering::Font> _fontLog = nullptr;
struct {
glm::ivec4 rotation;
glm::ivec4 zoom;
glm::ivec4 roll;
} _cameraButtonLocations;
};
} // namespace openspace
+2 -3
View File
@@ -52,8 +52,6 @@ public:
virtual void initialize() = 0;
virtual void deinitialize() = 0;
virtual void setCamera(Camera* camera) = 0;
virtual void setScene(Scene* scene) = 0;
virtual void setResolution(glm::ivec2 res) = 0;
virtual void setNAaSamples(int nAaSamples) = 0;
virtual void setHDRExposure(float hdrExposure) = 0;
@@ -77,7 +75,8 @@ public:
virtual void update() = 0;
virtual void render(float blackoutFactor, bool doPerformanceMeasurements) = 0;
virtual void render(Scene* scene, Camera* camera, float blackoutFactor,
bool doPerformanceMeasurements) = 0;
/**
* Update render data
* Responsible for calling renderEngine::setRenderData
+11 -6
View File
@@ -70,10 +70,11 @@ public:
* Constructor that creates a ScreenLog with the provided \p timeToLive, and the
* minimum \p logLevel that is stored. Log message with a lower
* ghoul::logging::LogLevel are automatically discarded.
*
* \param timeToLive The time-to-live for the messages in this ScreenLog. Expired
* messages are removed whenever the #removeExpiredEntries method is called
* messages are removed whenever the #removeExpiredEntries method is called
* \param logLevel The minimum ghoul::logging::LogLevel that messages must
* have in order to be stored in the ScreenLog
* have in order to be stored in the ScreenLog
*/
ScreenLog(std::chrono::seconds timeToLive, LogLevel logLevel = LogLevel::Info);
@@ -85,6 +86,7 @@ public:
/**
* Overwritten ghoul::loggling::Log method that is called whenever a new log message
* shall be stored.
*
* \param level The ghoul::logging::LogLevel of the incoming log message
* \param category The category of the log message
* \param message The actual log message that was transmitted
@@ -95,17 +97,19 @@ public:
/**
* This method removes all the stored LogEntry%s that have expired, calculated by
* their <code>timeStamp</code> and the #_timeToLive value.
*
* \post All entries retrieved by the #entries function have a <code>timeStamp</code>
* that is lower than the current time + #_timeToLive. The current time used is the
* time when this method was last called
* that is lower than the current time + #_timeToLive. The current time used is
* the time when this method was last called
*/
void removeExpiredEntries();
/**
* Returns the list of all stored LogEntry%s.
*
* \return The list of all stored LogEntry%s
*/
std::vector<LogEntry> entries() const;
const std::vector<LogEntry>& entries() const;
private:
/// The list of all LogEntry%s stored by this ScreenLog
@@ -118,7 +122,8 @@ private:
/// The minimum LogLevel of messages
LogLevel _logLevel;
/// A mutex to ensure thread-safety
/// A mutex to ensure thread-safety since the logging and the removal of expired
/// entires can occur on different threads
mutable std::mutex _mutex;
};