From d9ec25d1bcea4e45d1965e95bb3099c3864e04a0 Mon Sep 17 00:00:00 2001 From: Aleks Kissinger Date: Sun, 12 Apr 2020 16:43:44 +0100 Subject: parsing and outputting complex paths --- src/data/graphelementdata.cpp | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to 'src/data/graphelementdata.cpp') 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 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"); +} -- cgit v1.2.3