aboutsummaryrefslogtreecommitdiff
path: root/main.cpp
diff options
context:
space:
mode:
authorSamuel Fadel <samuelfadel@gmail.com>2016-01-07 15:10:20 +0100
committerSamuel Fadel <samuelfadel@gmail.com>2016-01-07 15:10:20 +0100
commit7676a38ea8a06d3d31228cb7eb1be00f90de46d3 (patch)
tree3082a0a466938f1a78c8738e30a7f37731717e3f /main.cpp
parentd17979519423b8afb67d9178820a458bf6a5474a (diff)
Added a bar chart.
* HistoryGraph replaced by BarChart * HistoryGraph not removed from code, might be useful in the future
Diffstat (limited to 'main.cpp')
-rw-r--r--main.cpp18
1 files changed, 11 insertions, 7 deletions
diff --git a/main.cpp b/main.cpp
index b9d7232..41d0ed0 100644
--- a/main.cpp
+++ b/main.cpp
@@ -14,6 +14,7 @@
#include "scatterplot.h"
#include "voronoisplat.h"
#include "historygraph.h"
+#include "barchart.h"
#include "interactionhandler.h"
#include "selectionhandler.h"
#include "effectivenessobserver.h"
@@ -158,6 +159,7 @@ int main(int argc, char **argv)
qmlRegisterType<Scatterplot>("PM", 1, 0, "Scatterplot");
qmlRegisterType<HistoryGraph>("PM", 1, 0, "HistoryGraph");
+ qmlRegisterType<BarChart>("PM", 1, 0, "BarChart");
qmlRegisterType<InteractionHandler>("PM", 1, 0, "InteractionHandler");
qmlRegisterSingletonType<Main>("PM", 1, 0, "Main", mainProvider);
@@ -222,11 +224,14 @@ int main(int argc, char **argv)
plot, SLOT(setSelection(const QSet<int> &)));
// Connections between history graph and subsample plot
- HistoryGraph *history = engine.rootObjects()[0]->findChild<HistoryGraph *>("history");
- QObject::connect(subsamplePlot, SIGNAL(xyInteractivelyChanged(const arma::mat &)),
- history, SLOT(addHistoryItem(const arma::mat &)));
- QObject::connect(history, SIGNAL(currentItemChanged(const arma::mat &)),
- subsamplePlot, SLOT(setXY(const arma::mat &)));
+ //HistoryGraph *history = engine.rootObjects()[0]->findChild<HistoryGraph *>("history");
+ //QObject::connect(subsamplePlot, SIGNAL(xyInteractivelyChanged(const arma::mat &)),
+ // history, SLOT(addHistoryItem(const arma::mat &)));
+ //QObject::connect(history, SIGNAL(currentItemChanged(const arma::mat &)),
+ // subsamplePlot, SLOT(setXY(const arma::mat &)));
+
+ BarChart *barChart = engine.rootObjects()[0]->findChild<BarChart *>("barChart");
+ barChart->setValues(arma::randn<arma::vec>(100));
// Map distortion as the glyph color
//DistortionObserver distortionObs(X, sampleIndices);
@@ -245,8 +250,7 @@ int main(int argc, char **argv)
//QObject::connect(&enforcer, SIGNAL(effectivenessChanged(const arma::vec &)),
// subsamplePlot, SLOT(setColorData(const arma::vec &)));
-
- history->addHistoryItem(Ys);
+ //history->addHistoryItem(Ys);
subsamplePlot->setXY(Ys);
subsamplePlot->setColorData(labels(sampleIndices));
plot->setColorScale(&colorScale);