No longer do recursive lookups of Dictionarys when keys have dots in them (closes #2302)

This commit is contained in:
Alexander Bock
2023-01-26 22:51:44 +01:00
parent 059842ecd4
commit b3fcfc75ec
3 changed files with 4 additions and 15 deletions

View File

@@ -256,15 +256,6 @@ RenderablePlanetProjection::RenderablePlanetProjection(const ghoul::Dictionary&
_meridianShift = p.meridianShift.value_or(_meridianShift);
addProperty(_meridianShift);
// @TODO (abock, 2021-03-26) Poking into the Geometry dictionary is not really
// optimal as we don't have local control over how the dictionary is checked. We
// should instead ask the geometry whether it has a radius or not
double radius = std::pow(10.0, 9.0);
if (dict.hasValue<double>(KeyRadius)) {
radius = dict.value<double>(KeyRadius);
}
setBoundingSphere(radius);
addPropertySubOwner(_projectionComponent);
_heightExaggeration.setExponent(3.f);
@@ -291,6 +282,7 @@ RenderablePlanetProjection::RenderablePlanetProjection(const ghoul::Dictionary&
else {
_radius = std::get<glm::vec3>(p.radius);
}
setBoundingSphere(glm::compMax(_radius.value()));
_radius.onChange([&]() { createSphere(); });
addProperty(_radius);

View File

@@ -58,13 +58,10 @@ LabelParser::LabelParser(std::string fileName, const ghoul::Dictionary& dictiona
if (decoderStr == "Instrument") {
// for each playbook call -> create a Decoder object
for (std::string_view key : typeDict.keys()) {
std::string currentKey = fmt::format("{}.{}", decoderStr, key);
if (!dictionary.hasValue<ghoul::Dictionary>(currentKey)) {
if (!typeDict.hasValue<ghoul::Dictionary>(key)) {
continue;
}
ghoul::Dictionary decoderDict =
dictionary.value<ghoul::Dictionary>(currentKey);
ghoul::Dictionary decoderDict = typeDict.value<ghoul::Dictionary>(key);
std::unique_ptr<Decoder> decoder = Decoder::createFromDictionary(
decoderDict,