Add additional Lua functions that make use of regular expressions to match against fully qualified property identifiers

- Making the GUI use the new function setPropertyValueSingle to not incur the overhead of compiling the regex
 - The default setPropertyValue Lua function uses a wildcard, which replaces a * with the correct regex (.*) for ease of use
 - The setPropertyValueRegex Lua function allows a full regular expression to be used

Closing #108
This commit is contained in:
Alexander Bock
2016-07-18 20:12:24 +02:00
parent a2db1bed99
commit a244defdbc
8 changed files with 166 additions and 10 deletions
+27
View File
@@ -96,4 +96,31 @@ properties::Property* property(const std::string& uri) {
}
}
std::vector<properties::Property*> allProperties() {
std::vector<properties::Property*> properties;
auto p = OsEng.globalPropertyOwner().propertiesRecursive();
properties.insert(
properties.end(),
p.begin(),
p.end()
);
const Scene* graph = sceneGraph();
std::vector<SceneGraphNode*> nodes = graph->allSceneGraphNodes();
for (SceneGraphNode* n : nodes) {
auto p = n->propertiesRecursive();
properties.insert(
properties.end(),
p.begin(),
p.end()
);
}
return properties;
}
} // namespace