From 6adb0f62c7a51b77725dc5cfe37ba59ab8f8cc73 Mon Sep 17 00:00:00 2001 From: Samuel Fadel Date: Mon, 25 Jan 2016 19:53:01 +0100 Subject: VoronoiSplat: added methods & signals for dealing with scales. --- voronoisplat.h | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'voronoisplat.h') diff --git a/voronoisplat.h b/voronoisplat.h index 6682fed..21d2fb9 100644 --- a/voronoisplat.h +++ b/voronoisplat.h @@ -6,6 +6,7 @@ #include #include "colorscale.h" +#include "scale.h" class VoronoiSplat : public QQuickFramebufferObject @@ -19,8 +20,10 @@ public: const std::vector &sites() const { return m_sites; } const std::vector &values() const { return m_values; } const std::vector &colorScale() const { return m_cmap; } - Q_INVOKABLE float alpha() const { return m_alpha; } - Q_INVOKABLE float beta() const { return m_beta; } + LinearScale scaleX() const { return m_sx; } + LinearScale 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 &sx, const LinearScale &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 &sx, const LinearScale &sy); + // Shepard blur radius Q_INVOKABLE void setAlpha(float alpha); @@ -60,6 +67,7 @@ public slots: private: std::vector m_sites, m_values, m_cmap; + LinearScale m_sx, m_sy; float m_alpha, m_beta; bool m_sitesChanged, m_valuesChanged, m_colorScaleChanged; }; -- cgit v1.2.3