aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSamuel Fadel <samuelfadel@gmail.com>2015-05-21 12:55:35 -0300
committerSamuel Fadel <samuelfadel@gmail.com>2015-05-21 18:09:16 -0300
commiteb829cd70e4d7cc3d863cdc199578801c3c82f9a (patch)
treefc3d2f8fdaa94c7894a10ba6603f0de7a046cb2f
parentb3c7ac156e1c4ac5d7455ce61e89549291ac85b1 (diff)
Correct interaction handling.
-rw-r--r--interactionhandler.cpp2
-rw-r--r--main.cpp3
-rw-r--r--scatterplot.cpp2
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<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();