From 738ecbd5fad2b46836bfd6a94aeebf165ae2bbca Mon Sep 17 00:00:00 2001 From: Aleks Kissinger Date: Thu, 4 Jan 2018 16:00:52 +0100 Subject: relocated source code to the root --- src/data/graph.h | 56 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 src/data/graph.h (limited to 'src/data/graph.h') diff --git a/src/data/graph.h b/src/data/graph.h new file mode 100644 index 0000000..8856e5c --- /dev/null +++ b/src/data/graph.h @@ -0,0 +1,56 @@ +/** + * A graph defined by tikz code. + */ + +#ifndef GRAPH_H +#define GRAPH_H + +#include "node.h" +#include "edge.h" +#include "graphelementdata.h" + +#include +#include +#include +#include +#include + +class Graph : public QObject +{ + Q_OBJECT +public: + explicit Graph(QObject *parent = 0); + ~Graph(); + void addNode(Node *n); + void addNode(Node *n, int index); + void removeNode(Node *n); + void addEdge(Edge *e); + void addEdge(Edge *e, int index); + void removeEdge(Edge *e); + + GraphElementData *data() const; + void setData(GraphElementData *data); + + const QVector &nodes(); + const QVector &edges(); + + QRectF bbox() const; + void setBbox(const QRectF &bbox); + bool hasBbox(); + void clearBbox(); + + QString tikz(); +signals: + +public slots: + +private: + QVector _nodes; + QVector _edges; + //QMultiHash inEdges; + //QMultiHash outEdges; + GraphElementData *_data; + QRectF _bbox; +}; + +#endif // GRAPH_H -- cgit v1.2.3