aboutsummaryrefslogtreecommitdiff
path: root/projectionhistory.cpp
diff options
context:
space:
mode:
authorSamuel Fadel <samuelfadel@gmail.com>2016-03-02 15:47:24 -0300
committerSamuel Fadel <samuelfadel@gmail.com>2016-03-02 15:47:24 -0300
commit3ce49858c6859fccc2e4d35839c34685348790d1 (patch)
tree9919729ae2d094ab3bed9fb45184c027713d9127 /projectionhistory.cpp
parent00efaedf4e328604598975a07a497d1ce769bb19 (diff)
Improvements related to ColorScale and screenshots.
* ColorScale: now a pointer whenever needed. main() takes care of updating extents * New class DivergentColorScale: works specifically for divergent scales, always has 3 colors as input: negative values, 0, positive values * ManipulationHandler: ProjectionHistory no longer needed
Diffstat (limited to 'projectionhistory.cpp')
-rw-r--r--projectionhistory.cpp21
1 files changed, 12 insertions, 9 deletions
diff --git a/projectionhistory.cpp b/projectionhistory.cpp
index e58d227..30c6b76 100644
--- a/projectionhistory.cpp
+++ b/projectionhistory.cpp
@@ -3,6 +3,8 @@
#include <algorithm>
#include <cmath>
+#include <QDebug>
+
#include "mp.h"
#include "numericrange.h"
@@ -93,6 +95,7 @@ void ProjectionHistory::addMap(const arma::mat &Y)
m_distY = mp::dist(Y);
mp::aggregatedError(m_distX, m_distY, m_values);
+ qDebug("Aggr. error: min: %f, max: %f", m_values.min(), m_values.max());
if (!m_hasFirst) {
m_hasFirst = true;
@@ -147,7 +150,7 @@ void ProjectionHistory::setCPSelection(const std::vector<bool> &cpSelection)
}
}
- emit rpValuesChanged(m_influences(m_rpIndices));
+ emit rpValuesChanged(m_influences(m_rpIndices), true);
} else {
emitValuesChanged();
}
@@ -172,9 +175,9 @@ void ProjectionHistory::setRPSelection(const std::vector<bool> &rpSelection)
}
}
- emit cpValuesChanged(m_influences(m_cpIndices));
+ emit cpValuesChanged(m_influences(m_cpIndices), true);
} else {
- emit cpValuesChanged(arma::vec());
+ emit cpValuesChanged(arma::vec(), false);
}
}
@@ -182,22 +185,22 @@ bool ProjectionHistory::emitValuesChanged() const
{
switch (m_type) {
case ObserverCurrent:
- emit rpValuesChanged(m_values(m_rpIndices));
- emit valuesChanged(m_values);
+ emit rpValuesChanged(m_values(m_rpIndices), false);
+ emit valuesChanged(m_values, false);
return true;
case ObserverDiffPrevious:
if (m_hasPrev) {
arma::vec diff = m_values - m_prevValues;
- emit rpValuesChanged(diff(m_rpIndices));
- emit valuesChanged(diff);
+ emit rpValuesChanged(diff(m_rpIndices), true);
+ emit valuesChanged(diff, false);
return true;
}
return false;
case ObserverDiffFirst:
if (m_hasFirst) {
arma::vec diff = m_values - m_firstValues;
- emit rpValuesChanged(diff(m_rpIndices));
- emit valuesChanged(diff);
+ emit rpValuesChanged(diff(m_rpIndices), true);
+ emit valuesChanged(diff, true);
return true;
}
return false;