From b5ca997b2d2a64f955b78208d0362cba0278f8d3 Mon Sep 17 00:00:00 2001 From: Samuel Fadel Date: Thu, 11 Feb 2016 12:03:59 -0200 Subject: Modified the way the history interacts with other components. * Main class is now responsible for updating map components whenever the current map changes (even rewinding): this simplifies other objects because they don't have to know anything about how the data is being displayed later (no CP/RP juggling everywhere) * Added undo/reset actions to main view, including menu items * ProjectionHistory now has specific signals for each change happening to the history --- manipulationhandler.cpp | 10 ---------- 1 file changed, 10 deletions(-) (limited to 'manipulationhandler.cpp') diff --git a/manipulationhandler.cpp b/manipulationhandler.cpp index f764eaf..f561ad7 100644 --- a/manipulationhandler.cpp +++ b/manipulationhandler.cpp @@ -3,22 +3,16 @@ #include #include "mp.h" -#include "numericrange.h" ManipulationHandler::ManipulationHandler(const arma::mat &X, const arma::uvec &cpIndices, ProjectionHistory *history) : m_X(X) , m_cpIndices(cpIndices) - , m_rpIndices(X.n_rows - cpIndices.n_elem) , m_history(history) , m_technique(TECHNIQUE_LAMP) { Q_ASSERT(history); - - NumericRange allIndices(0, m_X.n_rows); - std::set_symmetric_difference(allIndices.cbegin(), allIndices.cend(), - m_cpIndices.cbegin(), m_cpIndices.cend(), m_rpIndices.begin()); } void ManipulationHandler::setCP(const arma::mat &Ys) @@ -39,8 +33,6 @@ void ManipulationHandler::setCP(const arma::mat &Ys) break; } - emit cpChanged(Y.rows(m_cpIndices)); - emit rpChanged(Y.rows(m_rpIndices)); emit mapChanged(Y); } @@ -51,7 +43,5 @@ void ManipulationHandler::setRewind(double t) } arma::mat Y = m_history->Y() * t + m_history->prev() * (1.0 - t); - emit cpRewound(Y.rows(m_cpIndices)); - emit rpRewound(Y.rows(m_rpIndices)); emit mapRewound(Y); } -- cgit v1.2.3