aboutsummaryrefslogtreecommitdiff
path: root/projectionobserver.h
diff options
context:
space:
mode:
authorSamuel Fadel <samuelfadel@gmail.com>2016-02-12 18:01:27 -0200
committerSamuel Fadel <samuelfadel@gmail.com>2016-02-12 18:04:03 -0200
commit95a77b04a6855b26d340aaca5e3030a7d1a7cb3c (patch)
tree7f636d927f7d31f0972496387325332a098e529d /projectionobserver.h
parent7a07231716f04ee98091a946e122056e1fa69686 (diff)
Many bugfixes related to ProjectionObserver.
* Correct handling of relative metrics in UI * undo(), reset() methods added * Main class responsible for undoing and resetting both history and the observer (MUST BE AT THE SAME TIME! -- this might indicate a design issue to be addressed in the future)
Diffstat (limited to 'projectionobserver.h')
-rw-r--r--projectionobserver.h14
1 files changed, 8 insertions, 6 deletions
diff --git a/projectionobserver.h b/projectionobserver.h
index 7e9239d..c021482 100644
--- a/projectionobserver.h
+++ b/projectionobserver.h
@@ -18,8 +18,10 @@ public:
};
ProjectionObserver(const arma::mat &X,
- const arma::uvec &cpIndices,
- ProjectionHistory *history);
+ const arma::uvec &cpIndices);
+
+ void undo();
+ void reset();
signals:
void valuesChanged(const arma::vec &values) const;
@@ -30,8 +32,8 @@ signals:
void rpValuesRewound(const arma::vec &values) const;
public slots:
- void setMap(const arma::mat &Y);
- bool setType(int type);
+ void addMap(const arma::mat &Y);
+ bool setType(ObserverType type);
void setCPSelection(const std::vector<bool> &cpSelection);
void setRPSelection(const std::vector<bool> &rpSelection);
void setRewind(double t);
@@ -39,7 +41,7 @@ public slots:
private:
bool emitValuesChanged() const;
- int m_type;
+ ObserverType m_type;
arma::mat m_X;
arma::mat m_distX, m_distY, m_firstDistY, m_prevDistY;
arma::uvec m_cpIndices, m_rpIndices;
@@ -53,7 +55,7 @@ private:
// TODO: one per implemented measure
arma::vec m_values, m_firstValues, m_prevValues;
- ProjectionHistory *m_history;
+ bool m_hasFirst, m_hasPrev;
};
#endif // PROJECTIONOBSERVER_H