aboutsummaryrefslogtreecommitdiff
path: root/projectionhistory.h
diff options
context:
space:
mode:
authorSamuel Fadel <samuelfadel@gmail.com>2016-02-10 18:31:48 -0200
committerSamuel Fadel <samuelfadel@gmail.com>2016-02-10 18:31:48 -0200
commitb45a21976bece19da81166324dc1cc4260a0e0f4 (patch)
tree2f21da285edb214766fa559081b76a6754cfa8b0 /projectionhistory.h
parent8d4e5ff43fd9d51dc05d8d2dd87f69ab35bee423 (diff)
Added ProjectionHistory object for history tracking.
Diffstat (limited to 'projectionhistory.h')
-rw-r--r--projectionhistory.h36
1 files changed, 36 insertions, 0 deletions
diff --git a/projectionhistory.h b/projectionhistory.h
new file mode 100644
index 0000000..28a9b4b
--- /dev/null
+++ b/projectionhistory.h
@@ -0,0 +1,36 @@
+#ifndef PROJECTIONHISTORY_H
+#define PROJECTIONHISTORY_H
+
+#include <QObject>
+
+#include <armadillo>
+
+class ProjectionHistory
+ : public QObject
+{
+ Q_OBJECT
+public:
+ explicit ProjectionHistory(QObject *parent = 0);
+
+ const arma::mat &Y() const { return m_Y; }
+ const arma::mat &first() const { return m_firstY; }
+ const arma::mat &prev() const { return m_prevY; }
+
+ bool hasFirst() const { return m_hasFirst; }
+ bool hasPrev() const { return m_hasPrev; }
+
+ void undo();
+ void undoAll();
+
+signals:
+ void historyChanged(const arma::mat &currentY) const;
+
+public slots:
+ void addMap(const arma::mat &Y);
+
+private:
+ arma::mat m_Y, m_firstY, m_prevY;
+ bool m_hasFirst, m_hasPrev;
+};
+
+#endif // PROJECTIONHISTORY_H