aboutsummaryrefslogtreecommitdiff
path: root/main.cpp
diff options
context:
space:
mode:
authorSamuel Fadel <samuelfadel@gmail.com>2015-09-01 20:45:02 -0300
committerSamuel Fadel <samuelfadel@gmail.com>2015-09-01 20:45:02 -0300
commita1956a4ff879eb2d34c7a0ca448f48ee6e64ce99 (patch)
treeb958291afa29268517633a8490920ae38dfcf2d8 /main.cpp
parentf405ac30db93ed9f2adb739c3c09b2ce9369fee6 (diff)
Improvements related to visual representation of distortions.
- New continuous color scale class; - Improvements in signal handler for calculating distortions; - Implementation of the NP(k) measure.
Diffstat (limited to 'main.cpp')
-rw-r--r--main.cpp19
1 files changed, 12 insertions, 7 deletions
diff --git a/main.cpp b/main.cpp
index a67ad33..233d22b 100644
--- a/main.cpp
+++ b/main.cpp
@@ -6,6 +6,7 @@
#include <QQmlApplicationEngine>
#include "mp.h"
+#include "continuouscolorscale.h"
#include "scatterplot.h"
#include "interactionhandler.h"
#include "distortionobserver.h"
@@ -51,17 +52,21 @@ int main(int argc, char **argv)
QObject::connect(&interactionHandler, SIGNAL(subsampleChanged(const arma::mat &)),
plot, SLOT(setXY(const arma::mat &)));
- // TODO: works; though it needs measures implementation
- // std::unique_ptr<DistortionObserver> distortionObs(new NPDistortion(X, sampleIndices));
- // QObject::connect(&interactionHandler, SIGNAL(subsampleChanged(const arma::mat &)),
- // distortionObs.get(), SLOT(setMap(const arma::mat &)));
- // QObject::connect(distortionObs.get(), SIGNAL(mapChanged(const arma::vec &)),
- // plot, SLOT(setColorData(const arma::vec &)));
+ DistortionObserver distortionObs(X, sampleIndices);
+ std::unique_ptr<DistortionMeasure> distortionMeasure(new NPDistortion());
+ distortionObs.setMeasure(distortionMeasure.get());
+ QObject::connect(&interactionHandler, SIGNAL(subsampleChanged(const arma::mat &)),
+ &distortionObs, SLOT(setMap(const arma::mat &)));
+ QObject::connect(&distortionObs, SIGNAL(mapChanged(const arma::vec &)),
+ plot, SLOT(setColorData(const arma::vec &)));
+ ContinuousColorScale colorScale;
+ colorScale.setExtents(-1, 1);
+ plot->setColorScale(&colorScale);
interactionHandler.setSubsample(Ys);
// TODO: remove when proper measure coloring is done
- plot->setColorData(labels);
+ // plot->setColorData(labels);
return app.exec();
}