comparison layer/TimeValueLayer.h @ 696:e77b1673e17e tonioni

Pull out log and linear vertical scales into their own classes, make some improvements to log numbering
author Chris Cannam
date Wed, 04 Dec 2013 11:35:08 +0000
parents 156a120345ae
children 1a1448f7beb2
comparison
equal deleted inserted replaced
695:6d9624e0ac55 696:e77b1673e17e
15 15
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 "data/model/SparseTimeValueModel.h" 21 #include "data/model/SparseTimeValueModel.h"
21 22
22 #include <QObject> 23 #include <QObject>
23 #include <QColor> 24 #include <QColor>
24 25
25 class View; 26 class View;
26 class QPainter; 27 class QPainter;
27 28
28 class TimeValueLayer : public SingleColourLayer 29 class TimeValueLayer : public SingleColourLayer, public VerticalScaleLayer
29 { 30 {
30 Q_OBJECT 31 Q_OBJECT
31 32
32 public: 33 public:
33 TimeValueLayer(); 34 TimeValueLayer();
147 } else { 148 } else {
148 return ColourDistinguishes; 149 return ColourDistinguishes;
149 } 150 }
150 } 151 }
151 152
153 /// VerticalScaleLayer methods
154 virtual void getScaleExtents(View *, float &min, float &max, bool &log) const;
155 virtual int getYForValue(View *, float value) const;
156 virtual float getValueForY(View *, int y) const;
157 virtual QString getScaleUnits() const;
158
152 protected: 159 protected:
153 void getScaleExtents(View *, float &min, float &max, bool &log) const;
154 int getYForValue(View *, float value) const;
155 float getValueForY(View *, int y) const;
156 QColor getColourForValue(View *v, float value) const; 160 QColor getColourForValue(View *v, float value) const;
157 bool shouldAutoAlign() const; 161 bool shouldAutoAlign() const;
158 162
159 SparseTimeValueModel::PointList getLocalPoints(View *v, int) const; 163 SparseTimeValueModel::PointList getLocalPoints(View *v, int) const;
160 164