From a9236429e5691159f1ddc017b28ee0c060e0092d Mon Sep 17 00:00:00 2001 From: Samuel Fadel Date: Sun, 17 Jan 2016 16:09:51 +0100 Subject: 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 --- scatterplot.h | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) (limited to 'scatterplot.h') 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 &sx, const LinearScale &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 &selection) const; void scaleChanged(const LinearScale &sx, const LinearScale &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 &selection); void setScale(const LinearScale &sx, const LinearScale &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 m_sx, m_sy; + // Internal state + bool updateSelection(bool mergeSelection); + QSet m_selectedGlyphs; + enum InteractionState { INTERACTION_NONE, INTERACTION_SELECTING, @@ -74,14 +87,7 @@ private: QPointF m_dragOriginPos, m_dragCurrentPos; - QSet m_selectedGlyphs; - bool m_shouldUpdateGeometry, m_shouldUpdateMaterials; - - const ColorScale *m_colorScale; - - arma::vec m_colorData; - arma::vec m_opacityData; }; #endif // SCATTERPLOT_H -- cgit v1.2.3