From ed0db5c8d8ed12fa02eab5e529db60d92d78d8b2 Mon Sep 17 00:00:00 2001 From: Samuel Fadel Date: Wed, 10 Feb 2016 11:59:59 -0200 Subject: Updated signal/slot connections to function pointers. Also, some small changes in Scatterplot and VoronoiSplat to accomodate this. --- scatterplot.cpp | 57 ++++++++++++--------------------------------------------- 1 file changed, 12 insertions(+), 45 deletions(-) (limited to 'scatterplot.cpp') diff --git a/scatterplot.cpp b/scatterplot.cpp index 91c85e5..4ef266b 100644 --- a/scatterplot.cpp +++ b/scatterplot.cpp @@ -243,7 +243,7 @@ bool Scatterplot::saveToFile(const QUrl &url) return m_xy.save(url.path().toStdString(), arma::raw_ascii); } -void Scatterplot::setXY(const arma::mat &xy, bool updateView) +void Scatterplot::setXY(const arma::mat &xy) { if (xy.n_cols != 2) { return; @@ -262,23 +262,17 @@ void Scatterplot::setXY(const arma::mat &xy, bool updateView) } if (m_opacityData.n_elem != m_xy.n_rows) { - arma::vec opacityData(xy.n_rows); - opacityData.fill(GLYPH_OPACITY); - setOpacityData(opacityData, false); + // Reset opacity data + m_opacityData.resize(xy.n_rows); + m_opacityData.fill(GLYPH_OPACITY); + emit opacityDataChanged(m_opacityData); } m_shouldUpdateGeometry = true; - if (updateView) { - update(); - } -} - -void Scatterplot::setXY(const arma::mat &xy) -{ - setXY(xy, true); + update(); } -void Scatterplot::setColorData(const arma::vec &colorData, bool updateView) +void Scatterplot::setColorData(const arma::vec &colorData) { if (m_xy.n_rows > 0 && (colorData.n_elem > 0 && colorData.n_elem != m_xy.n_rows)) { @@ -293,17 +287,10 @@ void Scatterplot::setColorData(const arma::vec &colorData, bool updateView) } m_shouldUpdateMaterials = true; - if (updateView) { - update(); - } -} - -void Scatterplot::setColorData(const arma::vec &colorData) -{ - setColorData(colorData, true); + update(); } -void Scatterplot::setOpacityData(const arma::vec &opacityData, bool updateView) +void Scatterplot::setOpacityData(const arma::vec &opacityData) { if (m_xy.n_rows > 0 && opacityData.n_elem != m_xy.n_rows) { return; @@ -311,18 +298,10 @@ void Scatterplot::setOpacityData(const arma::vec &opacityData, bool updateView) m_opacityData = opacityData; emit opacityDataChanged(m_opacityData); - - if (updateView) { - update(); - } -} - -void Scatterplot::setOpacityData(const arma::vec &opacityData) -{ - setOpacityData(opacityData, true); + update(); } -void Scatterplot::setScale(const LinearScale &sx, const LinearScale &sy, bool updateView) +void Scatterplot::setScale(const LinearScale &sx, const LinearScale &sy) { m_sx = sx; m_sy = sy; @@ -331,14 +310,7 @@ void Scatterplot::setScale(const LinearScale &sx, const LinearScale &sx, const LinearScale &sy) -{ - setScale(sx, sy, true); + update(); } void Scatterplot::setAutoScale(bool autoScale) @@ -368,11 +340,6 @@ void Scatterplot::setGlyphSize(float glyphSize, bool updateView) } } -void Scatterplot::setGlyphSize(float glyphSize) -{ - setGlyphSize(glyphSize, true); -} - QSGNode *Scatterplot::newSceneGraph() { // NOTE: -- cgit v1.2.3