diff options
author | Samuel Fadel <samuelfadel@gmail.com> | 2016-01-25 19:53:01 +0100 |
---|---|---|
committer | Samuel Fadel <samuelfadel@gmail.com> | 2016-01-25 19:53:01 +0100 |
commit | 6adb0f62c7a51b77725dc5cfe37ba59ab8f8cc73 (patch) | |
tree | d3693794d56bbcaaa190d6d4941ba0f3f9bae402 /voronoisplat.h | |
parent | 07d0b1d07bb52e7b509b6f66836e56aa644532ab (diff) |
VoronoiSplat: added methods & signals for dealing with scales.
Diffstat (limited to 'voronoisplat.h')
-rw-r--r-- | voronoisplat.h | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/voronoisplat.h b/voronoisplat.h index 6682fed..21d2fb9 100644 --- a/voronoisplat.h +++ b/voronoisplat.h @@ -6,6 +6,7 @@ #include <armadillo> #include "colorscale.h" +#include "scale.h" class VoronoiSplat : public QQuickFramebufferObject @@ -19,8 +20,10 @@ public: const std::vector<float> &sites() const { return m_sites; } const std::vector<float> &values() const { return m_values; } const std::vector<float> &colorScale() const { return m_cmap; } - Q_INVOKABLE float alpha() const { return m_alpha; } - Q_INVOKABLE float beta() const { return m_beta; } + LinearScale<float> scaleX() const { return m_sx; } + LinearScale<float> scaleY() const { return m_sy; } + Q_INVOKABLE float alpha() const { return m_alpha; } + Q_INVOKABLE float beta() const { return m_beta; } bool sitesChanged() const { return m_sitesChanged; } bool valuesChanged() const { return m_valuesChanged; } @@ -40,7 +43,9 @@ signals: void sitesChanged(const arma::mat &sites) const; void valuesChanged(const arma::vec &values) const; void colorScaleChanged(const ColorScale &scale) const; + void scaleChanged(const LinearScale<float> &sx, const LinearScale<float> &sy) const; void alphaChanged(float alpha) const; + void betaChanged(float alpha) const; public slots: // 'points' should be a 2D points matrix (each point in a row) @@ -52,6 +57,8 @@ public slots: // Set colorScale data based on the given color scale void setColorScale(const ColorScale &scale); + void setScale(const LinearScale<float> &sx, const LinearScale<float> &sy); + // Shepard blur radius Q_INVOKABLE void setAlpha(float alpha); @@ -60,6 +67,7 @@ public slots: private: std::vector<float> m_sites, m_values, m_cmap; + LinearScale<float> m_sx, m_sy; float m_alpha, m_beta; bool m_sitesChanged, m_valuesChanged, m_colorScaleChanged; }; |