From 0518b806d8ce25c69847ec8c403276193611b2e1 Mon Sep 17 00:00:00 2001 From: Samuel Fadel Date: Thu, 17 Sep 2015 12:20:24 -0300 Subject: Additional interactive functionalities. - Selection linking between subsample plot and main plot - Dumb "effectiveness" coloring --- selectionhandler.cpp | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 selectionhandler.cpp (limited to 'selectionhandler.cpp') diff --git a/selectionhandler.cpp b/selectionhandler.cpp new file mode 100644 index 0000000..4c488a0 --- /dev/null +++ b/selectionhandler.cpp @@ -0,0 +1,19 @@ +#include "selectionhandler.h" + +SelectionHandler::SelectionHandler(const arma::uvec &sampleIndices) + : m_sampleIndices(sampleIndices) +{ +} + +void SelectionHandler::setSelection(const arma::uvec &selection) +{ + arma::uvec newSelection(selection); + + // The selecion happens over the sample indices. We use the original dataset + // indices in sampleIndices to translate indices. + for (auto it = newSelection.begin(); it != newSelection.end(); it++) { + *it = m_sampleIndices[*it]; + } + + emit selectionChanged(newSelection); +} -- cgit v1.2.3