Add setting to SpiceManager that disables exceptions (closing #142)

Disable exceptions on default
This commit is contained in:
Alexander Bock
2016-11-24 10:57:53 +01:00
parent 6fad08dfda
commit c199d38aac
6 changed files with 78 additions and 29 deletions
+13 -3
View File
@@ -28,8 +28,10 @@
#include <openspace/engine/configurationmanager.h>
#include <openspace/engine/wrapper/windowwrapper.h>
#include <openspace/util/openspacemodule.h>
#include <openspace/util/spicemanager.h>
#include <openspace/scene/scene.h>
#include <ghoul/ghoul.h>
#include <ghoul/filesystem/filesystem.h>
#include <ghoul/logging/logmanager.h>
@@ -41,11 +43,8 @@ namespace {
const std::string _loggerCat = "SettingsEngine";
}
namespace openspace {
SettingsEngine::SettingsEngine()
: _eyeSeparation("eyeSeparation", "Eye Separation" , 0.f, 0.f, 10.f)
, _scenes("scenes", "Scene", properties::OptionProperty::DisplayType::Dropdown)
@@ -53,8 +52,19 @@ SettingsEngine::SettingsEngine()
, _busyWaitForDecode("busyWaitForDecode", "Busy Wait for decode", false)
, _logSGCTOutOfOrderErrors("logSGCTOutOfOrderErrors", "Log SGCT out-of-order", false)
, _useDoubleBuffering("useDoubleBuffering", "Use double buffering", false)
, _spiceUseExceptions("enableSpiceExceptions", "Enable Spice Exceptions", false)
{
setName("Global Properties");
_spiceUseExceptions.onChange([this]{
if (_spiceUseExceptions) {
SpiceManager::ref().setExceptionHandling(SpiceManager::UseException::Yes);
}
else {
SpiceManager::ref().setExceptionHandling(SpiceManager::UseException::No);
}
});
addProperty(_spiceUseExceptions);
}
void SettingsEngine::initialize() {