aboutsummaryrefslogtreecommitdiff
path: root/manipulationhandler.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'manipulationhandler.cpp')
-rw-r--r--manipulationhandler.cpp31
1 files changed, 28 insertions, 3 deletions
diff --git a/manipulationhandler.cpp b/manipulationhandler.cpp
index b298860..7d3e3c0 100644
--- a/manipulationhandler.cpp
+++ b/manipulationhandler.cpp
@@ -4,6 +4,8 @@
#include <iostream>
#include <numeric>
+#include <QDebug>
+
#include "mp.h"
#include "numericrange.h"
@@ -30,24 +32,47 @@ void ManipulationHandler::setTechnique(ManipulationHandler::Technique technique)
void ManipulationHandler::setCP(const arma::mat &Ys)
{
+ m_prevY = m_Y;
+
switch (m_technique) {
case TECHNIQUE_PLMP:
- mp::plmp(m_X, m_cpIndices, Ys, m_Y);
+ // TODO?
+ // mp::plmp(m_X, m_cpIndices, Ys, m_Y);
break;
case TECHNIQUE_LSP:
- // TODO
+ // TODO?
// mp::lsp(m_X, m_cpIndices, Ys, m_Y);
break;
case TECHNIQUE_LAMP:
mp::lamp(m_X, m_cpIndices, Ys, m_Y);
break;
case TECHNIQUE_PEKALSKA:
- // TODO
+ // TODO?
// mp::pekalska(m_X, m_cpIndices, Ys, m_Y);
break;
}
+ if (m_firstY.n_rows != m_Y.n_rows) {
+ m_firstY = m_Y;
+ }
+
emit cpChanged(m_Y.rows(m_cpIndices));
emit rpChanged(m_Y.rows(m_rpIndices));
emit mapChanged(m_Y);
}
+
+void ManipulationHandler::setRewind(double t)
+{
+ if (m_prevY.n_rows != m_Y.n_rows) {
+ return;
+ }
+
+ arma::mat Y = m_Y * t + m_prevY * (1.0 - t);
+ emit cpChanged(Y.rows(m_cpIndices));
+ emit rpChanged(Y.rows(m_rpIndices));
+
+ // NOTE: this signal was supposed to be emitted, but since we don't want
+ // anything besides graphical objects to know the projection is being
+ // rewound, this is (for now) left out.
+ // emit mapChanged(Y);
+}