From d9d0beb9069d0e1e40499bcfd12b8204d4356b04 Mon Sep 17 00:00:00 2001 From: Samuel Fadel Date: Wed, 13 Jan 2016 12:04:55 +0100 Subject: Scatterplot: individual glyph opacity methods & signals. * Removed code that handles selection coordination between cpPlot and full data plot from main * Full plot has control points invisible (opacity = 0) by default --- main.cpp | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) (limited to 'main.cpp') diff --git a/main.cpp b/main.cpp index 0ce1b58..593c922 100644 --- a/main.cpp +++ b/main.cpp @@ -61,7 +61,7 @@ int main(int argc, char **argv) arma::vec labels = m->labels(); arma::uword n = X.n_rows; - int cpSize = (int) (3 * sqrt(n)); + int cpSize; arma::uvec cpIndices; arma::mat Ys; @@ -73,6 +73,7 @@ int main(int argc, char **argv) cpIndices.load(indicesFilename.toStdString(), arma::raw_ascii); cpSize = cpIndices.n_elem; } else { + cpSize = (int) (3 * sqrt(n)); // cpIndices = relevanceSampling(X, cpSize); cpIndices = arma::randi(cpSize, arma::distr_param(0, n-1)); } @@ -136,7 +137,7 @@ int main(int argc, char **argv) QObject::connect(cpPlot, SIGNAL(xyInteractivelyChanged(const arma::mat &)), m, SLOT(setCP(const arma::mat &))); - // Update projection as the cp is modified + // Update projection as the cp are modified InteractionHandler interactionHandler(X, cpIndices); m->setInteractionHandler(&interactionHandler); QObject::connect(cpPlot, SIGNAL(xyChanged(const arma::mat &)), @@ -148,11 +149,11 @@ int main(int argc, char **argv) m->setTechnique(InteractionHandler::TECHNIQUE_LAMP); // Linking between selections in cp plot and full dataset plot - SelectionHandler selectionHandler(cpIndices); - QObject::connect(cpPlot, SIGNAL(selectionChanged(const QSet &)), - &selectionHandler, SLOT(setSelection(const QSet &))); - QObject::connect(&selectionHandler, SIGNAL(selectionChanged(const QSet &)), - plot, SLOT(setSelection(const QSet &))); + //SelectionHandler selectionHandler(cpIndices); + //QObject::connect(cpPlot, SIGNAL(selectionChanged(const QSet &)), + // &selectionHandler, SLOT(setSelection(const QSet &))); + //QObject::connect(&selectionHandler, SIGNAL(selectionChanged(const QSet &)), + // plot, SLOT(setSelection(const QSet &))); // Connections between history graph and cp plot //HistoryGraph *history = engine.rootObjects()[0]->findChild("history"); @@ -176,6 +177,11 @@ int main(int argc, char **argv) cpPlot->setXY(Ys, false); cpPlot->update(); + arma::vec plotOpacities(X.n_rows); + plotOpacities.fill(0.4f); + plotOpacities(cpIndices).fill(0.0f); + plot->setOpacityData(plotOpacities); + auto ret = app.exec(); skelft2DDeinitialization(); -- cgit v1.2.3