mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-05-08 20:39:47 -05:00
Added option for single or multiple tags in a scenegraph node
This commit is contained in:
@@ -41,7 +41,7 @@ namespace {
|
||||
const char* keyStart = "StartTime";
|
||||
const char* keyEnd = "EndTime";
|
||||
const char* KeyType = "Type";
|
||||
const char* keyTag = "Tag";
|
||||
const char* KeyTag = "Tag";
|
||||
}
|
||||
|
||||
namespace openspace {
|
||||
@@ -112,10 +112,23 @@ Renderable::Renderable(const ghoul::Dictionary& dictionary)
|
||||
|
||||
dictionary.getValue(keyStart, _startTime);
|
||||
dictionary.getValue(keyEnd, _endTime);
|
||||
|
||||
std::string tagName;
|
||||
dictionary.getValue(keyTag, tagName);
|
||||
if (! tagName.empty())
|
||||
addTag(tagName);
|
||||
ghoul::Dictionary tagNames;
|
||||
if (dictionary.hasKeyAndValue<std::string>(KeyTag)) {
|
||||
dictionary.getValue(KeyTag, tagName);
|
||||
if (! tagName.empty())
|
||||
addTag(tagName);
|
||||
} else if (dictionary.hasKeyAndValue<ghoul::Dictionary>(KeyTag)) {
|
||||
dictionary.getValue(KeyTag, tagNames);
|
||||
std::vector<std::string> keys = tagNames.keys();
|
||||
for (const std::string key : keys) {
|
||||
tagNames.getValue(key, tagName);
|
||||
if (! tagName.empty())
|
||||
addTag(tagName);
|
||||
}
|
||||
}
|
||||
|
||||
if (_startTime != "" && _endTime != "") {
|
||||
_hasTimeInterval = true;
|
||||
}
|
||||
|
||||
@@ -47,7 +47,7 @@ namespace {
|
||||
const char* KeyScale = "Scale";
|
||||
const char* KeyDepth = "Depth";
|
||||
const char* KeyAlpha = "Alpha";
|
||||
const char* keyTag = "Tag";
|
||||
const char* KeyTag = "Tag";
|
||||
const float PlaneDepth = -2.f;
|
||||
}
|
||||
|
||||
@@ -147,9 +147,20 @@ ScreenSpaceRenderable::ScreenSpaceRenderable(const ghoul::Dictionary& dictionary
|
||||
dictionary.getValue(KeyAlpha, _alpha);
|
||||
|
||||
std::string tagName;
|
||||
dictionary.getValue(keyTag, tagName);
|
||||
if (! tagName.empty())
|
||||
addTag(tagName);
|
||||
ghoul::Dictionary tagNames;
|
||||
if (dictionary.hasKeyAndValue<std::string>(KeyTag)) {
|
||||
dictionary.getValue(KeyTag, tagName);
|
||||
if (! tagName.empty())
|
||||
addTag(tagName);
|
||||
} else if (dictionary.hasKeyAndValue<ghoul::Dictionary>(KeyTag)) {
|
||||
dictionary.getValue(KeyTag, tagNames);
|
||||
std::vector<std::string> keys = tagNames.keys();
|
||||
for (const std::string key : keys) {
|
||||
tagNames.getValue(key, tagName);
|
||||
if (! tagName.empty())
|
||||
addTag(tagName);
|
||||
}
|
||||
}
|
||||
|
||||
// Setting spherical/euclidean onchange handler
|
||||
_useFlatScreen.onChange([this](){
|
||||
|
||||
Reference in New Issue
Block a user