diff --git a/ext/ghoul b/ext/ghoul index 4b0e00c748..d873c668d4 160000 --- a/ext/ghoul +++ b/ext/ghoul @@ -1 +1 @@ -Subproject commit 4b0e00c748310dcd3f6af2b61acd7b8322596ac3 +Subproject commit d873c668d426a2992bcdd370a34408ab88b2c55b diff --git a/src/engine/configurationmanager.cpp b/src/engine/configurationmanager.cpp index 8c438f3ea9..32631d20e1 100644 --- a/src/engine/configurationmanager.cpp +++ b/src/engine/configurationmanager.cpp @@ -63,7 +63,7 @@ bool ConfigurationManager::loadFromFile(const std::string& filename) { // Register all the paths ghoul::Dictionary dictionary; - const bool success = getValueSafe(keyPaths, dictionary); + const bool success = getValue(keyPaths, dictionary); if (!success) { LERROR("Configuration does not contain the key '" << keyPaths << "'"); return false; diff --git a/src/engine/openspaceengine.cpp b/src/engine/openspaceengine.cpp index fbc7edac9c..93a88ceca7 100644 --- a/src/engine/openspaceengine.cpp +++ b/src/engine/openspaceengine.cpp @@ -189,7 +189,7 @@ bool OpenSpaceEngine::create(int argc, char** argv, // Determining SGCT configuration file LDEBUG("Determining SGCT configuration file"); std::string sgctConfigurationPath = _sgctDefaultConfigFile; - _engine->configurationManager().getValueSafe(constants::configurationmanager::keyConfigSgct, + _engine->configurationManager().getValue(constants::configurationmanager::keyConfigSgct, sgctConfigurationPath); // Prepend the outgoing sgctArguments with the program name @@ -247,7 +247,7 @@ bool OpenSpaceEngine::initialize() SysCap.logCapabilities(); std::string timeKernel; - OsEng.configurationManager().getValueSafe(constants::configurationmanager::keyConfigTimekernel, timeKernel); + OsEng.configurationManager().getValue(constants::configurationmanager::keyConfigTimekernel, timeKernel); // initialize OpenSpace helpers SpiceManager::initialize(); @@ -281,7 +281,7 @@ bool OpenSpaceEngine::initialize() sceneGraph->initialize(); std::string sceneDescriptionPath; - bool success = OsEng.configurationManager().getValueSafe( + bool success = OsEng.configurationManager().getValue( constants::configurationmanager::keyConfigScene, sceneDescriptionPath); if (success) sceneGraph->scheduleLoadSceneFile(sceneDescriptionPath); @@ -300,7 +300,7 @@ bool OpenSpaceEngine::initialize() // Run start up scripts ghoul::Dictionary scripts; - success = _engine->configurationManager().getValueSafe( + success = _engine->configurationManager().getValue( constants::configurationmanager::keyStartupScript, scripts); for (size_t i = 1; i <= scripts.size(); ++i) { std::stringstream stream; diff --git a/src/properties/property.cpp b/src/properties/property.cpp index 0b5004a281..81347f43bd 100644 --- a/src/properties/property.cpp +++ b/src/properties/property.cpp @@ -87,7 +87,7 @@ int Property::typeLua() const { const std::string& Property::guiName() const { std::string result; - _metaData.getValueSafe(_metaDataKeyGuiName, result); + _metaData.getValue(_metaDataKeyGuiName, result); return std::move(result); } @@ -97,7 +97,7 @@ void Property::setGroupIdentifier(std::string groupId) { std::string Property::groupIdentifier() const { std::string result; - _metaData.getValueSafe(_metaDataKeyGroup, result); + _metaData.getValue(_metaDataKeyGroup, result); return std::move(result); } diff --git a/src/rendering/planets/planetgeometry.cpp b/src/rendering/planets/planetgeometry.cpp index 547984a8fe..7802145493 100644 --- a/src/rendering/planets/planetgeometry.cpp +++ b/src/rendering/planets/planetgeometry.cpp @@ -37,7 +37,7 @@ namespace planetgeometry { PlanetGeometry* PlanetGeometry::createFromDictionary(const ghoul::Dictionary& dictionary) { std::string geometryType; - const bool success = dictionary.getValueSafe( + const bool success = dictionary.getValue( constants::planetgeometry::keyType, geometryType); if (!success) { LERROR("PlanetGeometry did not contain a correct value of the key '" diff --git a/src/rendering/planets/renderableplanet.cpp b/src/rendering/planets/renderableplanet.cpp index 8b6cc755e1..0b574c8ffd 100644 --- a/src/rendering/planets/renderableplanet.cpp +++ b/src/rendering/planets/renderableplanet.cpp @@ -59,7 +59,7 @@ RenderablePlanet::RenderablePlanet(const ghoul::Dictionary& dictionary) assert(success); ghoul::Dictionary geometryDictionary; - success = dictionary.getValueSafe( + success = dictionary.getValue( constants::renderableplanet::keyGeometry, geometryDictionary); if (success) { geometryDictionary.setValue(constants::scenegraphnode::keyName, name); @@ -73,7 +73,7 @@ RenderablePlanet::RenderablePlanet(const ghoul::Dictionary& dictionary) // TODO: textures need to be replaced by a good system similar to the geometry as soon // as the requirements are fixed (ab) std::string texturePath = ""; - success = dictionary.getValueSafe("Textures.Color", texturePath); + success = dictionary.getValue("Textures.Color", texturePath); if (success) _colorTexturePath = path + "/" + texturePath; diff --git a/src/rendering/planets/simplespheregeometry.cpp b/src/rendering/planets/simplespheregeometry.cpp index bd08f2368f..f34de92b95 100644 --- a/src/rendering/planets/simplespheregeometry.cpp +++ b/src/rendering/planets/simplespheregeometry.cpp @@ -57,7 +57,7 @@ SimpleSphereGeometry::SimpleSphereGeometry(const ghoul::Dictionary& dictionary) assert(success); glm::vec2 radius; - success = dictionary.getValueSafe(keyRadius, radius); + success = dictionary.getValue(keyRadius, radius); if (!success) { LERROR("SimpleSphereGeometry of '" << name << "' did not provide a key '" << keyRadius << "'"); @@ -66,7 +66,7 @@ SimpleSphereGeometry::SimpleSphereGeometry(const ghoul::Dictionary& dictionary) _radius = radius; double segments; - success = dictionary.getValueSafe(keySegments, segments); + success = dictionary.getValue(keySegments, segments); if (!success) { LERROR("SimpleSphereGeometry of '" << name << "' did not provide a key '" << keySegments << "'"); diff --git a/src/rendering/renderable.cpp b/src/rendering/renderable.cpp index c789148cb7..832a3a6f39 100644 --- a/src/rendering/renderable.cpp +++ b/src/rendering/renderable.cpp @@ -43,7 +43,7 @@ Renderable* Renderable::createFromDictionary(const ghoul::Dictionary& dictionary assert(success); std::string renderableType; - success = dictionary.getValueSafe(constants::renderable::keyType, renderableType); + success = dictionary.getValue(constants::renderable::keyType, renderableType); if (!success) { LERROR("Renderable '" << name << "' did not have key '" << constants::renderable::keyType << "'"); @@ -67,7 +67,7 @@ Renderable::Renderable(const ghoul::Dictionary& dictionary) setName("renderable"); // get path if available - const bool success = dictionary.getValueSafe(constants::scenegraph::keyPathModule, _relativePath); + const bool success = dictionary.getValue(constants::scenegraph::keyPathModule, _relativePath); if (success) _relativePath += ghoul::filesystem::FileSystem::PathSeparator; diff --git a/src/rendering/renderablefieldlines.cpp b/src/rendering/renderablefieldlines.cpp index 4c25ab73d5..2c950aa753 100644 --- a/src/rendering/renderablefieldlines.cpp +++ b/src/rendering/renderablefieldlines.cpp @@ -53,7 +53,7 @@ RenderableFieldlines::RenderableFieldlines(const ghoul::Dictionary& dictionary) assert(success); ghoul::Dictionary fieldlines; - success = dictionary.getValueSafe(keyFieldlines, fieldlines); + success = dictionary.getValue(keyFieldlines, fieldlines); if (!success) { LERROR("RenderableFieldlines '" << name << "' did not contain a '" << keyFieldlines << "' key"); @@ -61,7 +61,7 @@ RenderableFieldlines::RenderableFieldlines(const ghoul::Dictionary& dictionary) } for (const std::string& key : fieldlines.keys()) { ghoul::Dictionary fieldline; - success = fieldlines.getValueSafe(key, fieldline); + success = fieldlines.getValue(key, fieldline); if (!success) { LERROR("Key '" << key << "' in '" << keyFieldlines << @@ -71,13 +71,13 @@ RenderableFieldlines::RenderableFieldlines(const ghoul::Dictionary& dictionary) } std::string fileName; - fieldline.getValueSafe(keyFilename, fileName); + fieldline.getValue(keyFilename, fileName); fileName = findPath(fileName); if (fileName.empty()) LERROR("File not found!"); else { ghoul::Dictionary hintsDictionary; - fieldline.getValueSafe(keyHints, hintsDictionary); + fieldline.getValue(keyHints, hintsDictionary); _filenames.push_back(fileName); _hintsDictionaries.push_back(hintsDictionary); @@ -85,7 +85,7 @@ RenderableFieldlines::RenderableFieldlines(const ghoul::Dictionary& dictionary) } ghoul::Dictionary shaderDictionary; - success = dictionary.getValueSafe(keyShaders, shaderDictionary); + success = dictionary.getValue(keyShaders, shaderDictionary); if (!success) { LERROR("RenderableFieldlines '" << name << "' does not contain a '" << keyShaders << "' table"); @@ -93,7 +93,7 @@ RenderableFieldlines::RenderableFieldlines(const ghoul::Dictionary& dictionary) } std::string vshaderpath; - success = shaderDictionary.getValueSafe(keyVertexShader, vshaderpath); + success = shaderDictionary.getValue(keyVertexShader, vshaderpath); if (!success) { LERROR("RenderableFieldlines '" << name << "' does not have a '" << keyVertexShader << "'"); @@ -102,7 +102,7 @@ RenderableFieldlines::RenderableFieldlines(const ghoul::Dictionary& dictionary) vshaderpath = findPath(vshaderpath); std::string fshaderpath; - success = shaderDictionary.getValueSafe(keyFragmentShader, fshaderpath); + success = shaderDictionary.getValue(keyFragmentShader, fshaderpath); if (!success) { LERROR("RenderableFieldlines '" << name << "' does not have a '" << keyFragmentShader << "'"); @@ -117,7 +117,7 @@ RenderableFieldlines::RenderableFieldlines(const ghoul::Dictionary& dictionary) ShaderCreator sc = OsEng.shaderBuilder(); _fieldlinesProgram = sc.buildShader("FieldlinesProgram", vshaderpath, fshaderpath); - dictionary.getValueSafe("UpdateOnSave", _programUpdateOnSave); + dictionary.getValue("UpdateOnSave", _programUpdateOnSave); setBoundingSphere(PowerScaledScalar::CreatePSS(5)); // FIXME a non-magic number perhaps } diff --git a/src/rendering/renderablevolumegl.cpp b/src/rendering/renderablevolumegl.cpp index f602384b47..fd68ed3cbf 100644 --- a/src/rendering/renderablevolumegl.cpp +++ b/src/rendering/renderablevolumegl.cpp @@ -56,7 +56,7 @@ RenderableVolumeGL::RenderableVolumeGL(const ghoul::Dictionary& dictionary) assert(success); _filename = ""; - success = dictionary.getValueSafe(constants::renderablevolumegl::keyVolume, + success = dictionary.getValue(constants::renderablevolumegl::keyVolume, _filename); if (!success) { LERROR("Node '" << name << "' did not contain a valid '" << @@ -67,12 +67,12 @@ RenderableVolumeGL::RenderableVolumeGL(const ghoul::Dictionary& dictionary) LDEBUG("Volume Filename: " << _filename); - dictionary.getValueSafe(constants::renderablevolumegl::keyHints, _hintsDictionary); + dictionary.getValue(constants::renderablevolumegl::keyHints, _hintsDictionary); _transferFunction = nullptr; _transferFunctionFile = nullptr; _transferFunctionPath = ""; - success = dictionary.getValueSafe( + success = dictionary.getValue( constants::renderablevolumegl::keyTransferFunction, _transferFunctionPath); if (!success) { LERROR("Node '" << name << "' did not contain a valid '" << @@ -83,7 +83,7 @@ RenderableVolumeGL::RenderableVolumeGL(const ghoul::Dictionary& dictionary) _transferFunctionFile = new ghoul::filesystem::File(_transferFunctionPath, true); _samplerFilename = ""; - success = dictionary.getValueSafe(constants::renderablevolumegl::keySampler, + success = dictionary.getValue(constants::renderablevolumegl::keySampler, _samplerFilename); if (!success) { LERROR("Node '" << name << "' did not contain a valid '" << @@ -93,14 +93,14 @@ RenderableVolumeGL::RenderableVolumeGL(const ghoul::Dictionary& dictionary) _samplerFilename = findPath(_samplerFilename); glm::vec4 scalingVec4(_boxScaling, _w); - success = dictionary.getValueSafe(constants::renderablevolumegl::keyBoxScaling, + success = dictionary.getValue(constants::renderablevolumegl::keyBoxScaling, scalingVec4); if (success) { _boxScaling = scalingVec4.xyz; _w = scalingVec4.w; } else { - success = dictionary.getValueSafe(constants::renderablevolumegl::keyBoxScaling, + success = dictionary.getValue(constants::renderablevolumegl::keyBoxScaling, _boxScaling); if (!success) { LERROR("Node '" << name << "' did not contain a valid '" << @@ -109,8 +109,8 @@ RenderableVolumeGL::RenderableVolumeGL(const ghoul::Dictionary& dictionary) } } - dictionary.getValueSafe(constants::renderablevolumegl::keyVolumeName, _volumeName); - dictionary.getValueSafe(constants::renderablevolumegl::keyTransferFunctionName, + dictionary.getValue(constants::renderablevolumegl::keyVolumeName, _volumeName); + dictionary.getValue(constants::renderablevolumegl::keyTransferFunctionName, _transferFunctionName); setBoundingSphere(PowerScaledScalar::CreatePSS(glm::length(_boxScaling)*pow(10,_w))); diff --git a/src/scenegraph/scenegraph.cpp b/src/scenegraph/scenegraph.cpp index 5bceaa96dd..7c72226568 100644 --- a/src/scenegraph/scenegraph.cpp +++ b/src/scenegraph/scenegraph.cpp @@ -466,7 +466,7 @@ bool SceneGraph::loadSceneInternal(const std::string& sceneDescriptionFilePath) std::string&& sceneDescriptionDirectory = ghoul::filesystem::File(sceneDescriptionFilePath).directoryName(); std::string moduleDirectory("."); - dictionary.getValueSafe(constants::scenegraph::keyPathScene, moduleDirectory); + dictionary.getValue(constants::scenegraph::keyPathScene, moduleDirectory); // The scene path could either be an absolute or relative path to the description // paths directory