mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-02-25 22:39:04 -06:00
Some minor changes and added tag support to screenspacerenderable
This commit is contained in:
@@ -212,7 +212,7 @@ public:
|
||||
* trying to find a match for a desired batch operation on Properties.
|
||||
* \return Pointer to vector of string tags that were assigned to the Property
|
||||
*/
|
||||
const std::vector<std::string>* getTags(void) const;
|
||||
const std::vector<std::string> tags() const;
|
||||
|
||||
/**
|
||||
* Adds a tag to the Property's list of assigned tags. Tags are useful for creating
|
||||
|
||||
@@ -324,8 +324,8 @@ const std::string& PropertyOwner::name() const {
|
||||
return _name;
|
||||
}
|
||||
|
||||
const std::vector<std::string>* PropertyOwner::getTags(void) const {
|
||||
return &_tags;
|
||||
const std::vector<std::string> PropertyOwner::tags() const {
|
||||
return _tags;
|
||||
}
|
||||
|
||||
void PropertyOwner::addTag(std::string tag) {
|
||||
|
||||
@@ -41,7 +41,6 @@ namespace {
|
||||
const char* keyStart = "StartTime";
|
||||
const char* keyEnd = "EndTime";
|
||||
const char* KeyType = "Type";
|
||||
|
||||
const char* keyTag = "Tag";
|
||||
}
|
||||
|
||||
@@ -117,7 +116,6 @@ Renderable::Renderable(const ghoul::Dictionary& dictionary)
|
||||
dictionary.getValue(keyTag, 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 float PlaneDepth = -2.f;
|
||||
}
|
||||
|
||||
@@ -146,6 +146,11 @@ ScreenSpaceRenderable::ScreenSpaceRenderable(const ghoul::Dictionary& dictionary
|
||||
dictionary.getValue(KeyDepth, _depth);
|
||||
dictionary.getValue(KeyAlpha, _alpha);
|
||||
|
||||
std::string tagName;
|
||||
dictionary.getValue(keyTag, tagName);
|
||||
if (! tagName.empty())
|
||||
addTag(tagName);
|
||||
|
||||
// Setting spherical/euclidean onchange handler
|
||||
_useFlatScreen.onChange([this](){
|
||||
if (_useFlatScreen) {
|
||||
|
||||
@@ -46,8 +46,8 @@ const std::string tagToMatch) {
|
||||
properties::PropertyOwner* owner = prop->owner();
|
||||
|
||||
if (owner != nullptr) {
|
||||
std::vector<std::string>* tags = (std::vector<std::string>*)owner->getTags();
|
||||
for (std::string currTag : *tags) {
|
||||
std::vector<std::string> tags = (std::vector<std::string>)owner->tags();
|
||||
for (std::string currTag : tags) {
|
||||
if (tagToMatch.compare(currTag) == 0) {
|
||||
tagMatchOwner = owner;
|
||||
break;
|
||||
@@ -67,7 +67,7 @@ void applyRegularExpression(lua_State* L, std::regex regex,
|
||||
std::string groupName = "") {
|
||||
using ghoul::lua::errorLocation;
|
||||
using ghoul::lua::luaTypeToString;
|
||||
bool isGroupMode = (groupName.compare("") != 0) ? true : false;
|
||||
bool isGroupMode = (groupName.empty()) ? false : true;
|
||||
|
||||
for (properties::Property* prop : properties) {
|
||||
// Check the regular expression for all properties
|
||||
|
||||
Reference in New Issue
Block a user