summaryrefslogtreecommitdiff
path: root/src/data/graphelementdata.cpp
diff options
context:
space:
mode:
authorAleks Kissinger <aleks0@gmail.com>2020-04-12 16:43:44 +0100
committerAleks Kissinger <aleks0@gmail.com>2020-04-12 16:43:44 +0100
commitd9ec25d1bcea4e45d1965e95bb3099c3864e04a0 (patch)
tree181ddebe4d8c47d751d7cdbb0e27da8326d93d35 /src/data/graphelementdata.cpp
parentc56b682750e9f2a911a841e89e4e51b7d0608ab5 (diff)
parsing and outputting complex paths
Diffstat (limited to 'src/data/graphelementdata.cpp')
-rw-r--r--src/data/graphelementdata.cpp26
1 files changed, 26 insertions, 0 deletions
diff --git a/src/data/graphelementdata.cpp b/src/data/graphelementdata.cpp
index 931f86a..d2146d9 100644
--- a/src/data/graphelementdata.cpp
+++ b/src/data/graphelementdata.cpp
@@ -265,3 +265,29 @@ QVector<GraphElementProperty> GraphElementData::properties() const
{
return _properties;
}
+
+GraphElementData *GraphElementData::pathData() const
+{
+ GraphElementData *d = new GraphElementData();
+ foreach(GraphElementProperty p, _properties) {
+ if (isPathProperty(p.key())) d->add(p);
+ }
+ return d;
+}
+
+GraphElementData *GraphElementData::nonPathData() const
+{
+ GraphElementData *d = new GraphElementData();
+ foreach(GraphElementProperty p, _properties) {
+ if (!isPathProperty(p.key())) d->add(p);
+ }
+ return d;
+}
+
+bool GraphElementData::isPathProperty(QString key)
+{
+ return (key == "bend left" ||
+ key == "bend right" ||
+ key == "in" ||
+ key == "out");
+}