diff options
author | Samuel Fadel <samuelfadel@gmail.com> | 2016-02-10 11:59:59 -0200 |
---|---|---|
committer | Samuel Fadel <samuelfadel@gmail.com> | 2016-02-10 11:59:59 -0200 |
commit | ed0db5c8d8ed12fa02eab5e529db60d92d78d8b2 (patch) | |
tree | c055cedd70dcc22215bc4ef2f0ce4b95803eab7c /scatterplot.cpp | |
parent | df39a28c86c44ec676a24f7f42f79839ae597b1a (diff) |
Updated signal/slot connections to function pointers.
Also, some small changes in Scatterplot and VoronoiSplat to
accomodate this.
Diffstat (limited to 'scatterplot.cpp')
-rw-r--r-- | scatterplot.cpp | 57 |
1 files changed, 12 insertions, 45 deletions
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<float> &sx, const LinearScale<float> &sy, bool updateView) +void Scatterplot::setScale(const LinearScale<float> &sx, const LinearScale<float> &sy) { m_sx = sx; m_sy = sy; @@ -331,14 +310,7 @@ void Scatterplot::setScale(const LinearScale<float> &sx, const LinearScale<float updateQuadTree(); m_shouldUpdateGeometry = true; - if (updateView) { - update(); - } -} - -void Scatterplot::setScale(const LinearScale<float> &sx, const LinearScale<float> &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: |