diff options
author | Samuel Fadel <samuelfadel@gmail.com> | 2016-02-12 19:03:51 -0200 |
---|---|---|
committer | Samuel Fadel <samuelfadel@gmail.com> | 2016-02-12 19:03:51 -0200 |
commit | 5bd1fec462466d605f974fa27c3b00826a1bab57 (patch) | |
tree | 6cfefd8bd5c81644755c3be197f7ab2d60cd268b /projectionobserver.h | |
parent | 95a77b04a6855b26d340aaca5e3030a7d1a7cb3c (diff) |
Refactoring of Projection{Observer,History} & ManipulationHandler.
ProjectionObserver class has been removed, all of its functionality
is now inside class ProjectionHistory, thus dealing with the design
problem mentioned in the previous commit. ProjectionHistory is now
also responsible for all rewinding functionality, which makes more
sense.
Diffstat (limited to 'projectionobserver.h')
-rw-r--r-- | projectionobserver.h | 61 |
1 files changed, 0 insertions, 61 deletions
diff --git a/projectionobserver.h b/projectionobserver.h deleted file mode 100644 index c021482..0000000 --- a/projectionobserver.h +++ /dev/null @@ -1,61 +0,0 @@ -#ifndef PROJECTIONOBSERVER_H -#define PROJECTIONOBSERVER_H - -#include <QObject> -#include <armadillo> - -#include "projectionhistory.h" - -class ProjectionObserver - : public QObject -{ - Q_OBJECT -public: - enum ObserverType { - ObserverCurrent, - ObserverDiffPrevious, - ObserverDiffFirst - }; - - ProjectionObserver(const arma::mat &X, - const arma::uvec &cpIndices); - - void undo(); - void reset(); - -signals: - void valuesChanged(const arma::vec &values) const; - void cpValuesChanged(const arma::vec &values) const; - void rpValuesChanged(const arma::vec &values) const; - void valuesRewound(const arma::vec &values) const; - void cpValuesRewound(const arma::vec &values) const; - void rpValuesRewound(const arma::vec &values) const; - -public slots: - 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); - -private: - bool emitValuesChanged() const; - - ObserverType m_type; - arma::mat m_X; - arma::mat m_distX, m_distY, m_firstDistY, m_prevDistY; - arma::uvec m_cpIndices, m_rpIndices; - - bool m_cpSelectionEmpty, m_rpSelectionEmpty; - std::vector<int> m_cpSelection, m_rpSelection; - - // alpha(i, j): the influence CP j has on RP i - void computeAlphas(); - arma::mat m_alphas, m_influences; - - // TODO: one per implemented measure - arma::vec m_values, m_firstValues, m_prevValues; - bool m_hasFirst, m_hasPrev; -}; - -#endif // PROJECTIONOBSERVER_H |