comparison layer/TimeValueLayer.h @ 699:1a1448f7beb2

Pull out colour scale drawing as well
author Chris Cannam
date Wed, 04 Dec 2013 13:11:23 +0000
parents ad7623c39396
children 084f65094203
comparison
equal deleted inserted replaced
698:ad7623c39396 699:1a1448f7beb2
16 #ifndef _TIME_VALUE_LAYER_H_ 16 #ifndef _TIME_VALUE_LAYER_H_
17 #define _TIME_VALUE_LAYER_H_ 17 #define _TIME_VALUE_LAYER_H_
18 18
19 #include "SingleColourLayer.h" 19 #include "SingleColourLayer.h"
20 #include "VerticalScaleLayer.h" 20 #include "VerticalScaleLayer.h"
21 #include "ColourScaleLayer.h"
22
21 #include "data/model/SparseTimeValueModel.h" 23 #include "data/model/SparseTimeValueModel.h"
22 24
23 #include <QObject> 25 #include <QObject>
24 #include <QColor> 26 #include <QColor>
25 27
26 class View; 28 class View;
27 class QPainter; 29 class QPainter;
28 30
29 class TimeValueLayer : public SingleColourLayer, public VerticalScaleLayer 31 class TimeValueLayer : public SingleColourLayer,
32 public VerticalScaleLayer,
33 public ColourScaleLayer
30 { 34 {
31 Q_OBJECT 35 Q_OBJECT
32 36
33 public: 37 public:
34 TimeValueLayer(); 38 TimeValueLayer();
148 } else { 152 } else {
149 return ColourDistinguishes; 153 return ColourDistinguishes;
150 } 154 }
151 } 155 }
152 156
153 /// VerticalScaleLayer methods 157 /// VerticalScaleLayer and ColourScaleLayer methods
154 virtual void getScaleExtents(View *, float &min, float &max, bool &log) const; 158 virtual void getScaleExtents(View *, float &min, float &max, bool &log) const;
155 virtual int getYForValue(View *, float value) const; 159 virtual int getYForValue(View *, float value) const;
156 virtual float getValueForY(View *, int y) const; 160 virtual float getValueForY(View *, int y) const;
157 virtual QString getScaleUnits() const; 161 virtual QString getScaleUnits() const;
162 virtual QColor getColourForValue(View *v, float value) const;
158 163
159 protected: 164 protected:
160 QColor getColourForValue(View *v, float value) const;
161 bool shouldAutoAlign() const; 165 bool shouldAutoAlign() const;
162 166
163 SparseTimeValueModel::PointList getLocalPoints(View *v, int) const; 167 SparseTimeValueModel::PointList getLocalPoints(View *v, int) const;
164 168
165 virtual int getDefaultColourHint(bool dark, bool &impose); 169 virtual int getDefaultColourHint(bool dark, bool &impose);