Mercurial > hg > svgui
comparison layer/TimeInstantLayer.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 | cda569dfbdfe |
comparison
equal
deleted
inserted
replaced
286:7554ae119882 | 287:cd2492c5fe45 |
---|---|
14 */ | 14 */ |
15 | 15 |
16 #ifndef _TIME_INSTANT_LAYER_H_ | 16 #ifndef _TIME_INSTANT_LAYER_H_ |
17 #define _TIME_INSTANT_LAYER_H_ | 17 #define _TIME_INSTANT_LAYER_H_ |
18 | 18 |
19 #include "Layer.h" | 19 #include "SingleColourLayer.h" |
20 #include "data/model/SparseOneDimensionalModel.h" | 20 #include "data/model/SparseOneDimensionalModel.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 TimeInstantLayer : public Layer | 28 class TimeInstantLayer : public SingleColourLayer |
29 { | 29 { |
30 Q_OBJECT | 30 Q_OBJECT |
31 | 31 |
32 public: | 32 public: |
33 TimeInstantLayer(); | 33 TimeInstantLayer(); |
68 int *min, int *max, int *deflt) const; | 68 int *min, int *max, int *deflt) const; |
69 virtual QString getPropertyValueLabel(const PropertyName &, | 69 virtual QString getPropertyValueLabel(const PropertyName &, |
70 int value) const; | 70 int value) const; |
71 virtual void setProperty(const PropertyName &, int value); | 71 virtual void setProperty(const PropertyName &, int value); |
72 | 72 |
73 void setBaseColour(QColor); | |
74 QColor getBaseColour() const { return m_colour; } | |
75 | |
76 enum PlotStyle { | 73 enum PlotStyle { |
77 PlotInstants, | 74 PlotInstants, |
78 PlotSegmentation | 75 PlotSegmentation |
79 }; | 76 }; |
80 | 77 |
99 void setProperties(const QXmlAttributes &attributes); | 96 void setProperties(const QXmlAttributes &attributes); |
100 | 97 |
101 protected: | 98 protected: |
102 SparseOneDimensionalModel::PointList getLocalPoints(View *v, int) const; | 99 SparseOneDimensionalModel::PointList getLocalPoints(View *v, int) const; |
103 | 100 |
101 virtual int getDefaultColourHint(bool dark, bool &impose); | |
102 | |
104 SparseOneDimensionalModel *m_model; | 103 SparseOneDimensionalModel *m_model; |
105 bool m_editing; | 104 bool m_editing; |
106 SparseOneDimensionalModel::Point m_editingPoint; | 105 SparseOneDimensionalModel::Point m_editingPoint; |
107 SparseOneDimensionalModel::EditCommand *m_editingCommand; | 106 SparseOneDimensionalModel::EditCommand *m_editingCommand; |
108 QColor m_colour; | |
109 PlotStyle m_plotStyle; | 107 PlotStyle m_plotStyle; |
110 }; | 108 }; |
111 | 109 |
112 #endif | 110 #endif |
113 | 111 |