diff options
author | Samuel Fadel <samuelfadel@gmail.com> | 2015-07-24 13:01:16 -0300 |
---|---|---|
committer | Samuel Fadel <samuelfadel@gmail.com> | 2015-07-24 13:01:16 -0300 |
commit | 6da67a32e56c101b9334d2c6f33bd5238d082330 (patch) | |
tree | 87d6f4dbc4b1d926be75c432ede2578ab45d8b33 /scatterplot.h | |
parent | b7e1060b7cb71b30b91cc65c011b719e255c0a06 (diff) |
Color mapping in Scatterplot and initial measures.
- Scatterplot: can now map any floating point data to colors;
- Scatterplot: somewhat optimized geometry/material updates;
- Removed anything related to labels where it was not necessary;
- Added observers to implement distortion (via measures) visualization;
- Added skeleton implementations of NP and silhouette.
Diffstat (limited to 'scatterplot.h')
-rw-r--r-- | scatterplot.h | 23 |
1 files changed, 17 insertions, 6 deletions
diff --git a/scatterplot.h b/scatterplot.h index a155daf..a942217 100644 --- a/scatterplot.h +++ b/scatterplot.h @@ -11,13 +11,16 @@ class Scatterplot : public QQuickItem Q_OBJECT public: Scatterplot(QQuickItem *parent = 0); - ~Scatterplot(); + + void setColorScale(const ColorScale &colorScale); signals: - void dataChanged(const arma::mat &data); + void xyChanged(const arma::mat &XY); + void colorDataChanged(const arma::vec &colorData); public slots: - void setData(const arma::mat &data); + void setXY(const arma::mat &xy); + void setColorData(const arma::vec &colorData); protected: QSGNode *updatePaintNode(QSGNode *oldNode, UpdatePaintNodeData *); @@ -26,16 +29,24 @@ protected: void mouseReleaseEvent(QMouseEvent *event); private: - QSGNode *newGlyphNodeTree(); + QSGNode *createGlyphNodeTree(); bool selectGlyphs(bool mergeSelection); - void updateData(); float fromDataXToScreenX(float x); float fromDataYToScreenY(float y); - arma::mat m_data; + void applyManipulation(); + + void updateGeometry(); + void updateMaterials(); + + arma::mat m_xy; float m_xmin, m_xmax, m_ymin, m_ymax; + bool m_shouldUpdateGeometry, m_shouldUpdateMaterials; + + arma::vec m_colorData; + ColorScale m_colorScale; enum InteractionState { |