Mercurial > hg > svgui
comparison layer/TimeValueLayer.h @ 1324:13d9b422f7fe zoom
Merge from default branch
author | Chris Cannam |
---|---|
date | Mon, 17 Sep 2018 13:51:31 +0100 |
parents | a34a2a25907c |
children | d79e21855aef |
comparison
equal
deleted
inserted
replaced
1183:57d192e26331 | 1324:13d9b422f7fe |
---|---|
11 published by the Free Software Foundation; either version 2 of the | 11 published by the Free Software Foundation; either version 2 of the |
12 License, or (at your option) any later version. See the file | 12 License, or (at your option) any later version. See the file |
13 COPYING included with this distribution for more information. | 13 COPYING included with this distribution for more information. |
14 */ | 14 */ |
15 | 15 |
16 #ifndef _TIME_VALUE_LAYER_H_ | 16 #ifndef SV_TIME_VALUE_LAYER_H |
17 #define _TIME_VALUE_LAYER_H_ | 17 #define SV_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" | 21 #include "ColourScaleLayer.h" |
22 | 22 |
44 | 44 |
45 virtual QString getFeatureDescription(LayerGeometryProvider *v, QPoint &) const; | 45 virtual QString getFeatureDescription(LayerGeometryProvider *v, QPoint &) const; |
46 virtual QString getLabelPreceding(sv_frame_t) const; | 46 virtual QString getLabelPreceding(sv_frame_t) const; |
47 | 47 |
48 virtual bool snapToFeatureFrame(LayerGeometryProvider *v, sv_frame_t &frame, | 48 virtual bool snapToFeatureFrame(LayerGeometryProvider *v, sv_frame_t &frame, |
49 int &resolution, | 49 int &resolution, |
50 SnapType snap) const; | 50 SnapType snap) const; |
51 virtual bool snapToSimilarFeature(LayerGeometryProvider *v, sv_frame_t &frame, | 51 virtual bool snapToSimilarFeature(LayerGeometryProvider *v, sv_frame_t &frame, |
52 int &resolution, | 52 int &resolution, |
53 SnapType snap) const; | 53 SnapType snap) const; |
54 | 54 |
55 virtual void drawStart(LayerGeometryProvider *v, QMouseEvent *); | 55 virtual void drawStart(LayerGeometryProvider *v, QMouseEvent *); |
83 virtual PropertyType getPropertyType(const PropertyName &) const; | 83 virtual PropertyType getPropertyType(const PropertyName &) const; |
84 virtual QString getPropertyGroupName(const PropertyName &) const; | 84 virtual QString getPropertyGroupName(const PropertyName &) const; |
85 virtual int getPropertyRangeAndValue(const PropertyName &, | 85 virtual int getPropertyRangeAndValue(const PropertyName &, |
86 int *min, int *max, int *deflt) const; | 86 int *min, int *max, int *deflt) const; |
87 virtual QString getPropertyValueLabel(const PropertyName &, | 87 virtual QString getPropertyValueLabel(const PropertyName &, |
88 int value) const; | 88 int value) const; |
89 virtual void setProperty(const PropertyName &, int value); | 89 virtual void setProperty(const PropertyName &, int value); |
90 | 90 |
91 void setFillColourMap(int); | 91 void setFillColourMap(int); |
92 int getFillColourMap() const { return m_colourMap; } | 92 int getFillColourMap() const { return m_colourMap; } |
93 | 93 |
94 enum PlotStyle { | 94 enum PlotStyle { |
95 PlotPoints, | 95 PlotPoints, |
96 PlotStems, | 96 PlotStems, |
97 PlotConnectedPoints, | 97 PlotConnectedPoints, |
98 PlotLines, | 98 PlotLines, |
99 PlotCurve, | 99 PlotCurve, |
100 PlotSegmentation, | 100 PlotSegmentation, |
101 PlotDiscreteCurves | 101 PlotDiscreteCurves |
102 }; | 102 }; |
103 | 103 |
104 void setPlotStyle(PlotStyle style); | 104 void setPlotStyle(PlotStyle style); |
105 PlotStyle getPlotStyle() const { return m_plotStyle; } | 105 PlotStyle getPlotStyle() const { return m_plotStyle; } |
144 virtual void toXml(QTextStream &stream, QString indent = "", | 144 virtual void toXml(QTextStream &stream, QString indent = "", |
145 QString extraAttributes = "") const; | 145 QString extraAttributes = "") const; |
146 | 146 |
147 void setProperties(const QXmlAttributes &attributes); | 147 void setProperties(const QXmlAttributes &attributes); |
148 | 148 |
149 /// Override from SingleColourLayer | |
149 virtual ColourSignificance getLayerColourSignificance() const { | 150 virtual ColourSignificance getLayerColourSignificance() const { |
150 if (m_plotStyle == PlotSegmentation) { | 151 if (m_plotStyle == PlotSegmentation) { |
151 return ColourHasMeaningfulValue; | 152 return ColourHasMeaningfulValue; |
152 } else { | 153 } else { |
153 return ColourDistinguishes; | 154 return ColourDistinguishes; |
155 } | |
156 } | |
157 | |
158 /// Override from SingleColourLayer | |
159 virtual bool hasLightBackground() const { | |
160 if (m_plotStyle == PlotSegmentation) { | |
161 return true; | |
162 } else { | |
163 return SingleColourLayer::hasLightBackground(); | |
154 } | 164 } |
155 } | 165 } |
156 | 166 |
157 /// VerticalScaleLayer and ColourScaleLayer methods | 167 /// VerticalScaleLayer and ColourScaleLayer methods |
158 virtual int getYForValue(LayerGeometryProvider *, double value) const; | 168 virtual int getYForValue(LayerGeometryProvider *, double value) const; |