Introduction of new Dictionary class (#1446)

* Adapting to introduction of new Dictionary class in Ghoul
 * Mainly replacing usage of float instead of doubles as expected
 * Adjust to the lack of the hasKeyAndValue function
This commit is contained in:
Alexander Bock
2021-01-02 15:07:11 +01:00
committed by GitHub
parent 7bf7a25401
commit 067c0f4b27
121 changed files with 2299 additions and 2160 deletions
@@ -54,17 +54,26 @@ namespace {
namespace openspace {
RenderablePlaneProjection::RenderablePlaneProjection(const ghoul::Dictionary& dictionary)
: Renderable(dictionary)
RenderablePlaneProjection::RenderablePlaneProjection(const ghoul::Dictionary& dict)
: Renderable(dict)
{
dictionary.getValue(KeySpacecraft, _spacecraft);
dictionary.getValue(KeyInstrument, _instrument);
dictionary.getValue(KeyMoving, _moving);
dictionary.getValue(KeyName, _name);
dictionary.getValue(KeyTarget, _defaultTarget);
if (dictionary.hasKeyAndValue<std::string>(KeyTexture)) {
_texturePath = dictionary.value<std::string>(KeyTexture);
if (dict.hasValue<std::string>(KeySpacecraft)) {
_spacecraft = dict.value<std::string>(KeySpacecraft);
}
if (dict.hasValue<std::string>(KeyInstrument)) {
_instrument = dict.value<std::string>(KeyInstrument);
}
if (dict.hasValue<bool>(KeyMoving)) {
_moving = dict.value<bool>(KeyMoving);
}
if (dict.hasValue<std::string>(KeyName)) {
_name = dict.value<std::string>(KeyName);
}
if (dict.hasValue<std::string>(KeyTarget)) {
_defaultTarget = dict.value<std::string>(KeyTarget);
}
if (dict.hasValue<std::string>(KeyTexture)) {
_texturePath = dict.value<std::string>(KeyTexture);
_texturePath = absPath(_texturePath);
_textureFile = std::make_unique<ghoul::filesystem::File>(_texturePath);
}