aboutsummaryrefslogtreecommitdiff
path: root/historygraph.h
diff options
context:
space:
mode:
Diffstat (limited to 'historygraph.h')
-rw-r--r--historygraph.h38
1 files changed, 38 insertions, 0 deletions
diff --git a/historygraph.h b/historygraph.h
new file mode 100644
index 0000000..60cce94
--- /dev/null
+++ b/historygraph.h
@@ -0,0 +1,38 @@
+#ifndef HISTORYGRAPH_H
+#define HISTORYGRAPH_H
+
+#include <QtQuick>
+#include <armadillo>
+
+class HistoryGraph : public QQuickItem
+{
+ Q_OBJECT
+public:
+ HistoryGraph(QQuickItem *parent = 0);
+ ~HistoryGraph();
+
+signals:
+ void currentItemChanged(const arma::mat &item);
+
+public slots:
+ void addHistoryItem(const arma::mat &item);
+
+protected:
+ QSGNode *updatePaintNode(QSGNode *oldNode, UpdatePaintNodeData *);
+ void mousePressEvent(QMouseEvent *event);
+
+private:
+ class HistoryItemNode;
+
+ HistoryItemNode *nodeAt(const QPointF &pos) const;
+ HistoryItemNode *nodeAt(const QPointF &pos, HistoryItemNode *node) const;
+
+ QSGNode *createNodeTree();
+ void updateNodeTree(QSGNode *root);
+ void addScatterplot(QSGNode *node, const HistoryItemNode *historyItemNode, float x, float y, float w, float h);
+
+ HistoryItemNode *m_firstNode, *m_currentNode;
+ bool m_needsUpdate;
+};
+
+#endif // HISTORYGRAPH_H