From 95a77b04a6855b26d340aaca5e3030a7d1a7cb3c Mon Sep 17 00:00:00 2001 From: Samuel Fadel Date: Fri, 12 Feb 2016 18:01:27 -0200 Subject: 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) --- projectionobserver.h | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'projectionobserver.h') 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 &cpSelection); void setRPSelection(const std::vector &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 -- cgit v1.2.3