From eb829cd70e4d7cc3d863cdc199578801c3c82f9a Mon Sep 17 00:00:00 2001 From: Samuel Fadel Date: Thu, 21 May 2015 12:55:35 -0300 Subject: Correct interaction handling. --- interactionhandler.cpp | 2 +- main.cpp | 3 ++- scatterplot.cpp | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/interactionhandler.cpp b/interactionhandler.cpp index fab3c75..217f4a5 100644 --- a/interactionhandler.cpp +++ b/interactionhandler.cpp @@ -23,7 +23,7 @@ void InteractionHandler::setSubsample(const arma::mat &Ys) break; } - arma::mat Y(embedding.n_rows, embedding.n_cols); + arma::mat Y(embedding.n_rows, embedding.n_cols + 1); Y.cols(0, embedding.n_cols - 1) = embedding; Y.col(Y.n_cols - 1) = m_labels; diff --git a/main.cpp b/main.cpp index 3f2a85e..380d311 100644 --- a/main.cpp +++ b/main.cpp @@ -14,6 +14,7 @@ int main(int argc, char **argv) qmlRegisterType("PM", 1, 0, "Scatterplot"); + // Set up multisampling QSurfaceFormat fmt; fmt.setSamples(16); QSurfaceFormat::setDefaultFormat(fmt); @@ -46,7 +47,7 @@ int main(int argc, char **argv) interactionHandler.get(), SLOT(setSubsample(const arma::mat &))); QObject::connect(interactionHandler.get(), SIGNAL(subsampleChanged(const arma::mat &)), plot, SLOT(setData(const arma::mat &))); - + interactionHandler.get()->setSubsample(Ys); } return app.exec(); diff --git a/scatterplot.cpp b/scatterplot.cpp index dd8d378..3335e9e 100644 --- a/scatterplot.cpp +++ b/scatterplot.cpp @@ -150,7 +150,7 @@ QSGNode *Scatterplot::updatePaintNode(QSGNode *oldNode, UpdatePaintNodeData *) y = PADDING + (row[1] - ymin) / (ymax - ymin) * (height() - 2*PADDING) + yt * selected; QSGGeometry *geometry = static_cast(glyphNode)->geometry(); - geometry->setDrawingMode(m_selectedGlyphs[i] ? GL_POLYGON : GL_LINE_LOOP); + geometry->setDrawingMode(!m_selectedGlyphs[i] ? GL_POLYGON : GL_LINE_LOOP); updateCircleGeometry(geometry, GLYPH_SIZE, x, y); glyphNode->markDirty(QSGNode::DirtyGeometry); glyphNode = glyphNode->nextSibling(); -- cgit v1.2.3