From a5378abcbb3d8ee8dc3b76380dd50a43a2eec22e Mon Sep 17 00:00:00 2001 From: Samuel Fadel Date: Tue, 12 Jan 2016 17:37:20 +0100 Subject: Scatterplot: autoscaling & signals. * Added methods & signal/slots to handle auto/manual scaling * The subsample plot is now scaled by the full data plot, naturally superimposing them * LAMP was corrected in order to always preserve the mapping of the subsample --- scatterplot.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'scatterplot.h') diff --git a/scatterplot.h b/scatterplot.h index fb664a1..1c61656 100644 --- a/scatterplot.h +++ b/scatterplot.h @@ -20,6 +20,8 @@ public: void setColorScale(ColorScale *colorScale); void setXY(const arma::mat &xy, bool updateView); void setColorData(const arma::vec &colorData, bool updateView); + void setScale(const LinearScale &sx, const LinearScale &sy, bool updateView); + void setAutoScale(bool autoScale); Q_INVOKABLE bool saveToFile(const QUrl &url); signals: @@ -28,12 +30,14 @@ signals: void colorDataChanged(const arma::vec &colorData) const; void selectionChanged(const QSet &selection) const; void displaySplatChanged(bool displaySplat) const; + void scaleChanged(const LinearScale &sx, const LinearScale &sy) const; public slots: void setXY(const arma::mat &xy); void setColorData(const arma::vec &colorData); void setSelection(const QSet &selection); void setDisplaySplat(bool displaySplat); + void setScale(const LinearScale &sx, const LinearScale &sy); protected: QSGNode *updatePaintNode(QSGNode *oldNode, UpdatePaintNodeData *); @@ -56,6 +60,9 @@ private: void updateGlyphs(QSGNode *node); arma::mat m_xy; + + void autoScale(); + bool m_autoScale; LinearScale m_sx, m_sy; enum InteractionState { -- cgit v1.2.3