From b45a21976bece19da81166324dc1cc4260a0e0f4 Mon Sep 17 00:00:00 2001 From: Samuel Fadel Date: Wed, 10 Feb 2016 18:31:48 -0200 Subject: Added ProjectionHistory object for history tracking. --- projectionhistory.h | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 projectionhistory.h (limited to 'projectionhistory.h') 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 + +#include + +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 ¤tY) 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 -- cgit v1.2.3