From 41e1b2bfb8e2ba3d0e74180200e7cc109171213e Mon Sep 17 00:00:00 2001 From: Samuel Fadel Date: Tue, 26 Jan 2016 18:15:50 +0100 Subject: Scatterplot & BarChart: initial brushing mechanism. * Both components now support brushing (support in Scatterplot for activating a brush is still incomplete, though it can be brushed on by other components) * Added a handler for linking the brushing between components * Added crosshair geometry handler to geometry lib * Fixed issue #15 --- barchart.h | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'barchart.h') diff --git a/barchart.h b/barchart.h index d49c001..e9de96d 100644 --- a/barchart.h +++ b/barchart.h @@ -23,11 +23,14 @@ signals: void colorScaleChanged(const ColorScale &scale) const; void selectionChanged(const std::vector &selection) const; void selectionInteractivelyChanged(const std::vector &selection) const; + void itemBrushed(int item) const; + void itemInteractivelyBrushed(int item) const; public slots: void setValues(const arma::vec &values); void setColorScale(const ColorScale &scale); void setSelection(const std::vector &selection); + void brushItem(int item); protected: QSGNode *updatePaintNode(QSGNode *oldNode, UpdatePaintNodeData *); @@ -48,9 +51,9 @@ private: void updateBarNodeGeom(QSGNode *barNode, float x, float width, float height); void updateBarNodeColor(QSGNode *barNode, const QColor &color); void updateBars(QSGNode *node); - void updateHoverHints(QSGNode *node); + void updateBrush(QSGNode *node); bool m_shouldUpdateBars; - float m_hoverPos; + int m_brushedItem; void updateSelectionRect(QSGNode *node); bool m_shouldUpdateSelectionRect; @@ -62,7 +65,7 @@ private: arma::vec m_values; ColorScale m_colorScale; - std::vector m_originalIndices; + std::vector m_originalIndices, m_currentIndices; LinearScale m_scale; }; -- cgit v1.2.3