diff options
author | Samuel Fadel <samuelfadel@gmail.com> | 2015-05-21 12:55:35 -0300 |
---|---|---|
committer | Samuel Fadel <samuelfadel@gmail.com> | 2015-05-21 18:09:16 -0300 |
commit | eb829cd70e4d7cc3d863cdc199578801c3c82f9a (patch) | |
tree | fc3d2f8fdaa94c7894a10ba6603f0de7a046cb2f | |
parent | b3c7ac156e1c4ac5d7455ce61e89549291ac85b1 (diff) |
Correct interaction handling.
-rw-r--r-- | interactionhandler.cpp | 2 | ||||
-rw-r--r-- | main.cpp | 3 | ||||
-rw-r--r-- | 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; @@ -14,6 +14,7 @@ int main(int argc, char **argv) qmlRegisterType<Scatterplot>("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<QSGGeometryNode *>(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(); |