mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-02-25 06:19:02 -06:00
Add function to return a list of all tags
This commit is contained in:
@@ -253,6 +253,13 @@ public:
|
||||
std::vector<properties::Property*> propertiesMatchingRegex(
|
||||
std::string propertyString);
|
||||
|
||||
/**
|
||||
* Returns a list of all unique tags that are used in the currently loaded scene.
|
||||
*
|
||||
* \return A list of all unique tags that are used in the currently loaded scene.
|
||||
*/
|
||||
std::vector<std::string> allTags();
|
||||
|
||||
private:
|
||||
/**
|
||||
* Accepts string version of a property value from a profile, converts it to the
|
||||
|
||||
@@ -754,6 +754,16 @@ std::vector<properties::Property*> Scene::propertiesMatchingRegex(
|
||||
return findMatchesInAllProperties(propertyString, allProperties(), "");
|
||||
}
|
||||
|
||||
std::vector<std::string> Scene::allTags() {
|
||||
std::set<std::string> result;
|
||||
for (SceneGraphNode* node : _topologicallySortedNodes) {
|
||||
const std::vector<std::string>& tags = node->tags();
|
||||
result.insert(tags.begin(), tags.end());
|
||||
}
|
||||
|
||||
return std::vector<std::string>(result.begin(), result.end());
|
||||
}
|
||||
|
||||
scripting::LuaLibrary Scene::luaLibrary() {
|
||||
return {
|
||||
"",
|
||||
|
||||
Reference in New Issue
Block a user