summaryrefslogtreecommitdiff
path: root/src/data/node.cpp
diff options
context:
space:
mode:
authorAleks Kissinger <aleks0@gmail.com>2018-01-04 16:00:52 +0100
committerAleks Kissinger <aleks0@gmail.com>2018-01-04 16:00:52 +0100
commit738ecbd5fad2b46836bfd6a94aeebf165ae2bbca (patch)
treedf04709807cc9ec8481a3ebc7d80ac25e5b2f457 /src/data/node.cpp
parent0421a96749743868554d44585050b1b3d04864d2 (diff)
relocated source code to the root
Diffstat (limited to 'src/data/node.cpp')
-rw-r--r--src/data/node.cpp79
1 files changed, 79 insertions, 0 deletions
diff --git a/src/data/node.cpp b/src/data/node.cpp
new file mode 100644
index 0000000..f94a3df
--- /dev/null
+++ b/src/data/node.cpp
@@ -0,0 +1,79 @@
+#include "node.h"
+#include "tikzit.h"
+
+#include <QDebug>
+
+Node::Node(QObject *parent) : QObject(parent)
+{
+ _data = new GraphElementData();
+ _style = noneStyle;
+ _styleName = "none";
+}
+
+Node::~Node()
+{
+ delete _data;
+}
+
+QPointF Node::point() const
+{
+ return _point;
+}
+
+void Node::setPoint(const QPointF &point)
+{
+ _point = point;
+}
+
+QString Node::name() const
+{
+ return _name;
+}
+
+void Node::setName(const QString &name)
+{
+ _name = name;
+}
+
+QString Node::label() const
+{
+ return _label;
+}
+
+void Node::setLabel(const QString &label)
+{
+ _label = label;
+}
+
+GraphElementData *Node::data() const
+{
+ return _data;
+}
+
+void Node::setData(GraphElementData *data)
+{
+ delete _data;
+ _data = data;
+ if (_data->property("style") != 0) _styleName = _data->property("style");
+}
+
+QString Node::styleName() const
+{
+ return _styleName;
+}
+
+void Node::setStyleName(const QString &styleName)
+{
+ _styleName = styleName;
+}
+
+void Node::attachStyle()
+{
+ if (_styleName == "none") _style = noneStyle;
+ else _style = tikzit->nodeStyle(_styleName);
+}
+
+NodeStyle *Node::style() const
+{
+ return _style;
+}