diff options
author | Samuel Fadel <samuelfadel@gmail.com> | 2016-01-17 16:09:51 +0100 |
---|---|---|
committer | Samuel Fadel <samuelfadel@gmail.com> | 2016-01-17 16:09:51 +0100 |
commit | a9236429e5691159f1ddc017b28ee0c060e0092d (patch) | |
tree | 73abfac910e8b801105190e74b8fe3251c4c44bf /scatterplot.h | |
parent | 2260996d93e723a55a72bf23447a8f77e98e1371 (diff) |
Added a options panel.
* Added screenshot action that saves two images: one of the main
view (plot + splat) and one of the bottom view (bar chart)
* Added methods/signals/slots to Scatterplot for handling glyph sizes
* Added methods/signals/slots to VoronoiSplat for handling the
alpha/beta parameters, which are now also no longer fixed
* Options panel:
- glyph sizes of both CPs and RPs
- splat opacity
- splat parameters (alpha & beta)
- color scale combo box currently does nothing
Diffstat (limited to 'scatterplot.h')
-rw-r--r-- | scatterplot.h | 26 |
1 files changed, 16 insertions, 10 deletions
diff --git a/scatterplot.h b/scatterplot.h index 2997425..3c2d50b 100644 --- a/scatterplot.h +++ b/scatterplot.h @@ -22,9 +22,12 @@ public: void setColorData(const arma::vec &colorData, bool updateView); void setOpacityData(const arma::vec &opacityData, bool updateView); void setScale(const LinearScale<float> &sx, const LinearScale<float> &sy, bool updateView); + void setGlyphSize(float glyphSize, bool updateView); void setAutoScale(bool autoScale); Q_INVOKABLE bool saveToFile(const QUrl &url); + Q_INVOKABLE float glyphSize() const { return m_glyphSize; } + static const int PADDING = 10; signals: @@ -34,6 +37,7 @@ signals: void opacityDataChanged(const arma::vec &opacityData) const; void selectionChanged(const QSet<int> &selection) const; void scaleChanged(const LinearScale<float> &sx, const LinearScale<float> &sy) const; + void glyphSizeChanged(float glyphSize) const; public slots: void setXY(const arma::mat &xy); @@ -41,6 +45,7 @@ public slots: void setOpacityData(const arma::vec &opacityData); void setSelection(const QSet<int> &selection); void setScale(const LinearScale<float> &sx, const LinearScale<float> &sy); + Q_INVOKABLE void setGlyphSize(float glyphSize); protected: QSGNode *updatePaintNode(QSGNode *oldNode, UpdatePaintNodeData *); @@ -53,17 +58,25 @@ private: QSGNode *newGlyphTree(); void applyManipulation(); - void updateGlyphs(QSGNode *node); - bool updateSelection(bool mergeSelection); - + // Data arma::mat m_xy; + arma::vec m_colorData; + arma::vec m_opacityData; + + // Visuals + float m_glyphSize; + const ColorScale *m_colorScale; void autoScale(); bool m_autoScale; LinearScale<float> m_sx, m_sy; + // Internal state + bool updateSelection(bool mergeSelection); + QSet<int> m_selectedGlyphs; + enum InteractionState { INTERACTION_NONE, INTERACTION_SELECTING, @@ -74,14 +87,7 @@ private: QPointF m_dragOriginPos, m_dragCurrentPos; - QSet<int> m_selectedGlyphs; - bool m_shouldUpdateGeometry, m_shouldUpdateMaterials; - - const ColorScale *m_colorScale; - - arma::vec m_colorData; - arma::vec m_opacityData; }; #endif // SCATTERPLOT_H |