diff options
author | Samuel Fadel <samuelfadel@gmail.com> | 2016-01-21 19:36:14 +0100 |
---|---|---|
committer | Samuel Fadel <samuelfadel@gmail.com> | 2016-01-21 19:36:14 +0100 |
commit | d414b68cea008edc063e26133564d120a7430bd2 (patch) | |
tree | 7ae861a100d0b1560294b646014743dcd785ab4b /main.cpp | |
parent | e9d14f93498832687cbdbeb79748f9030e49fb2f (diff) |
Added selection linking. Needs more tests.
Diffstat (limited to 'main.cpp')
-rw-r--r-- | main.cpp | 40 |
1 files changed, 22 insertions, 18 deletions
@@ -17,6 +17,7 @@ #include "barchart.h" #include "colormap.h" #include "interactionhandler.h" +#include "selectionhandler.h" #include "projectionobserver.h" #include "skelft.h" @@ -153,13 +154,6 @@ int main(int argc, char **argv) QObject::connect(&interactionHandler, SIGNAL(cpChanged(const arma::mat &)), m->splat, SLOT(setSites(const arma::mat &))); - // Linking between selections in cp plot and rp plot - //SelectionHandler selectionHandler(cpIndices); - //QObject::connect(cpPlot, SIGNAL(selectionChanged(const QSet<int> &)), - // &selectionHandler, SLOT(setSelection(const QSet<int> &))); - //QObject::connect(&selectionHandler, SIGNAL(selectionChanged(const QSet<int> &)), - // plot, SLOT(setSelection(const QSet<int> &))); - // Connections between history graph and cp plot //HistoryGraph *history = engine.rootObjects()[0]->findChild<HistoryGraph *>("history"); //QObject::connect(cpPlot, SIGNAL(xyInteractivelyChanged(const arma::mat &)), @@ -181,26 +175,36 @@ int main(int argc, char **argv) m->rpBarChart->setAcceptedMouseButtons(Qt::LeftButton); m->setRPBarChartColorScale(Main::ColorScaleContinuous); - QObject::connect(m->cpBarChart, SIGNAL(selectionChanged(const QSet<int> &)), - m->cpPlot, SLOT(setSelection(const QSet<int> &))); - - QObject::connect(m->rpBarChart, SIGNAL(selectionChanged(const QSet<int> &)), - m->rpPlot, SLOT(setSelection(const QSet<int> &))); + // Linking between selections + SelectionHandler cpSelectionHandler(cpIndices.n_elem); + QObject::connect(m->cpPlot, SIGNAL(selectionInteractivelyChanged(const std::vector<bool> &)), + &cpSelectionHandler, SLOT(setSelection(const std::vector<bool> &))); + QObject::connect(m->cpBarChart, SIGNAL(selectionInteractivelyChanged(const std::vector<bool> &)), + &cpSelectionHandler, SLOT(setSelection(const std::vector<bool> &))); + QObject::connect(&cpSelectionHandler, SIGNAL(selectionChanged(const std::vector<bool> &)), + m->cpPlot, SLOT(setSelection(const std::vector<bool> &))); + + //SelectionHandler rpSelectionHandler(X.n_rows - cpIndices.n_elem); + //QObject::connect(m->rpPlot, SIGNAL(selectionInteractivelyChanged(const std::vector<bool> &)), + // &rpSelectionHandler, SLOT(setSelection(const std::vector<bool> &))); + //QObject::connect(m->rpBarChart, SIGNAL(selectionInteractivelyChanged(const std::vector<bool> &)), + // &rpSelectionHandler, SLOT(setSelection(const std::vector<bool> &))); + //QObject::connect(&rpSelectionHandler, SIGNAL(selectionChanged(const std::vector<bool> &)), + // m->rpPlot, SLOT(setSelection(const std::vector<bool> &))); ProjectionObserver projectionObserver(X, cpIndices); m->projectionObserver = &projectionObserver; QObject::connect(&interactionHandler, SIGNAL(cpChanged(const arma::mat &)), m->projectionObserver, SLOT(setMap(const arma::mat &))); - QObject::connect(m->projectionObserver, SIGNAL(valuesChanged(const arma::vec &)), - m->rpPlot, SLOT(setColorData(const arma::vec &))); + //QObject::connect(m->projectionObserver, SIGNAL(valuesChanged(const arma::vec &)), + // m->rpPlot, SLOT(setColorData(const arma::vec &))); QObject::connect(m->projectionObserver, SIGNAL(valuesChanged(const arma::vec &)), m->splat, SLOT(setValues(const arma::vec &))); - QObject::connect(m->projectionObserver, SIGNAL(valuesChanged(const arma::vec &)), + QObject::connect(m->projectionObserver, SIGNAL(cpValuesChanged(const arma::vec &)), m->cpBarChart, SLOT(setValues(const arma::vec &))); - QObject::connect(m->projectionObserver, SIGNAL(valuesChanged(const arma::vec &)), - m->rpBarChart, SLOT(setValues(const arma::vec &))); + //QObject::connect(m->projectionObserver, SIGNAL(rpValuesChanged(const arma::vec &)), + // m->rpBarChart, SLOT(setValues(const arma::vec &))); - //history->addHistoryItem(Ys); m->setColormapColorScale(Main::ColorScaleContinuous); m->setCPPlotColorScale(Main::ColorScaleContinuous); m->setRPPlotColorScale(Main::ColorScaleContinuous); |