comparison layer/TimeValueLayer.h @ 287:cd2492c5fe45

* Add SingleColourLayer to manage colours for layers that have a single predominant colour (i.e. most of them).
author Chris Cannam
date Thu, 12 Jul 2007 16:14:59 +0000
parents e175ade2d6b0
children ea37c229a578
comparison
equal deleted inserted replaced
286:7554ae119882 287:cd2492c5fe45
14 */ 14 */
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 "Layer.h" 19 #include "SingleColourLayer.h"
20 #include "data/model/SparseTimeValueModel.h" 20 #include "data/model/SparseTimeValueModel.h"
21 21
22 #include <QObject> 22 #include <QObject>
23 #include <QColor> 23 #include <QColor>
24 24
25 class View; 25 class View;
26 class QPainter; 26 class QPainter;
27 27
28 class TimeValueLayer : public Layer 28 class TimeValueLayer : public SingleColourLayer
29 { 29 {
30 Q_OBJECT 30 Q_OBJECT
31 31
32 public: 32 public:
33 TimeValueLayer(); 33 TimeValueLayer();
71 virtual int getPropertyRangeAndValue(const PropertyName &, 71 virtual int getPropertyRangeAndValue(const PropertyName &,
72 int *min, int *max, int *deflt) const; 72 int *min, int *max, int *deflt) const;
73 virtual QString getPropertyValueLabel(const PropertyName &, 73 virtual QString getPropertyValueLabel(const PropertyName &,
74 int value) const; 74 int value) const;
75 virtual void setProperty(const PropertyName &, int value); 75 virtual void setProperty(const PropertyName &, int value);
76
77 void setBaseColour(QColor);
78 QColor getBaseColour() const { return m_colour; }
79 76
80 void setFillColourMap(int); 77 void setFillColourMap(int);
81 int getFillColourMap() const { return m_colourMap; } 78 int getFillColourMap() const { return m_colourMap; }
82 79
83 enum PlotStyle { 80 enum PlotStyle {
128 float getValueForY(View *, int y) const; 125 float getValueForY(View *, int y) const;
129 QColor getColourForValue(View *v, float value) const; 126 QColor getColourForValue(View *v, float value) const;
130 127
131 SparseTimeValueModel::PointList getLocalPoints(View *v, int) const; 128 SparseTimeValueModel::PointList getLocalPoints(View *v, int) const;
132 129
130 virtual int getDefaultColourHint(bool dark, bool &impose);
131
133 SparseTimeValueModel *m_model; 132 SparseTimeValueModel *m_model;
134 bool m_editing; 133 bool m_editing;
135 SparseTimeValueModel::Point m_originalPoint; 134 SparseTimeValueModel::Point m_originalPoint;
136 SparseTimeValueModel::Point m_editingPoint; 135 SparseTimeValueModel::Point m_editingPoint;
137 SparseTimeValueModel::EditCommand *m_editingCommand; 136 SparseTimeValueModel::EditCommand *m_editingCommand;
138 QColor m_colour;
139 int m_colourMap; 137 int m_colourMap;
140 PlotStyle m_plotStyle; 138 PlotStyle m_plotStyle;
141 VerticalScale m_verticalScale; 139 VerticalScale m_verticalScale;
142 }; 140 };
143 141