From ff10df2f8bfc71afe8637eec67d11d6ce87b673b Mon Sep 17 00:00:00 2001 From: Samuel Fadel Date: Thu, 28 Jan 2016 15:52:39 +0100 Subject: ProjectionObsever now responds to selection changes. * Scatterplot: small fix to selection updates * ProjectionObserver: whenever CP selection changes, compute influence of CPs over all RPs. Whenever RP selection changes, compute influence of RPs by all CPs. * ProjectionObserver: with empty selections, go back to normal mode --- main.cpp | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'main.cpp') diff --git a/main.cpp b/main.cpp index a9a5a86..3631061 100644 --- a/main.cpp +++ b/main.cpp @@ -216,8 +216,8 @@ int main(int argc, char **argv) m->projectionObserver = &projectionObserver; QObject::connect(&manipulationHandler, SIGNAL(mapChanged(const arma::mat &)), m->projectionObserver, SLOT(setMap(const arma::mat &))); - QObject::connect(m->projectionObserver, SIGNAL(rpValuesChanged(const arma::vec &)), - m->rpPlot, SLOT(setColorData(const arma::vec &))); + QObject::connect(m->projectionObserver, SIGNAL(cpValuesChanged(const arma::vec &)), + m->cpPlot, SLOT(setColorData(const arma::vec &))); QObject::connect(m->projectionObserver, SIGNAL(rpValuesChanged(const arma::vec &)), m->splat, SLOT(setValues(const arma::vec &))); QObject::connect(m->projectionObserver, SIGNAL(cpValuesChanged(const arma::vec &)), @@ -225,11 +225,17 @@ int main(int argc, char **argv) QObject::connect(m->projectionObserver, SIGNAL(rpValuesChanged(const arma::vec &)), m->rpBarChart, SLOT(setValues(const arma::vec &))); + // Recompute values whenever selection changes + QObject::connect(&cpSelectionHandler, SIGNAL(selectionChanged(const std::vector &)), + &projectionObserver, SLOT(setCPSelection(const std::vector &))); + QObject::connect(&rpSelectionHandler, SIGNAL(selectionChanged(const std::vector &)), + &projectionObserver, SLOT(setRPSelection(const std::vector &))); + // General component set up m->cpPlot->setAcceptHoverEvents(true); m->cpPlot->setAcceptedMouseButtons(Qt::LeftButton | Qt::MiddleButton | Qt::RightButton); - m->cpBarChart->setAcceptedMouseButtons(Qt::LeftButton); - m->rpBarChart->setAcceptedMouseButtons(Qt::LeftButton); + m->cpBarChart->setAcceptedMouseButtons(Qt::LeftButton | Qt::RightButton); + m->rpBarChart->setAcceptedMouseButtons(Qt::LeftButton | Qt::RightButton); m->setColormapColorScale(Main::ColorScaleContinuous); m->setCPPlotColorScale(Main::ColorScaleContinuous); @@ -241,7 +247,6 @@ int main(int argc, char **argv) m->cpPlot->setAutoScale(false); m->rpPlot->setAutoScale(false); m->rpPlot->setGlyphSize(3.0f); - m->cpPlot->setColorData(labels(cpIndices), false); // This sets the initial CP configuration, triggering all the necessary // signals to set up the helper objects and visual components -- cgit v1.2.3