From 6da67a32e56c101b9334d2c6f33bd5238d082330 Mon Sep 17 00:00:00 2001 From: Samuel Fadel Date: Fri, 24 Jul 2015 13:01:16 -0300 Subject: 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. --- scatterplot.h | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) (limited to 'scatterplot.h') 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 { -- cgit v1.2.3