comparison layer/TimeValueLayer.h @ 1414:fa986b91d77f

Merge from branch fix-static-analysis
author Chris Cannam
date Wed, 09 Jan 2019 15:24:51 +0000
parents a18e78b9c78b
children 8a7c82282fbc
comparison
equal deleted inserted replaced
1413:0930a27ebea2 1414:fa986b91d77f
35 Q_OBJECT 35 Q_OBJECT
36 36
37 public: 37 public:
38 TimeValueLayer(); 38 TimeValueLayer();
39 39
40 virtual void paint(LayerGeometryProvider *v, QPainter &paint, QRect rect) const; 40 void paint(LayerGeometryProvider *v, QPainter &paint, QRect rect) const override;
41 41
42 virtual int getVerticalScaleWidth(LayerGeometryProvider *v, bool, QPainter &) const; 42 int getVerticalScaleWidth(LayerGeometryProvider *v, bool, QPainter &) const override;
43 virtual void paintVerticalScale(LayerGeometryProvider *v, bool, QPainter &paint, QRect rect) const; 43 void paintVerticalScale(LayerGeometryProvider *v, bool, QPainter &paint, QRect rect) const override;
44 44
45 virtual QString getFeatureDescription(LayerGeometryProvider *v, QPoint &) const; 45 QString getFeatureDescription(LayerGeometryProvider *v, QPoint &) const override;
46 virtual QString getLabelPreceding(sv_frame_t) const; 46 QString getLabelPreceding(sv_frame_t) const override;
47 47
48 virtual bool snapToFeatureFrame(LayerGeometryProvider *v, sv_frame_t &frame, 48 bool snapToFeatureFrame(LayerGeometryProvider *v, sv_frame_t &frame,
49 int &resolution, 49 int &resolution,
50 SnapType snap) const; 50 SnapType snap) const override;
51 virtual bool snapToSimilarFeature(LayerGeometryProvider *v, sv_frame_t &frame, 51 bool snapToSimilarFeature(LayerGeometryProvider *v, sv_frame_t &frame,
52 int &resolution, 52 int &resolution,
53 SnapType snap) const; 53 SnapType snap) const override;
54 54
55 virtual void drawStart(LayerGeometryProvider *v, QMouseEvent *); 55 void drawStart(LayerGeometryProvider *v, QMouseEvent *) override;
56 virtual void drawDrag(LayerGeometryProvider *v, QMouseEvent *); 56 void drawDrag(LayerGeometryProvider *v, QMouseEvent *) override;
57 virtual void drawEnd(LayerGeometryProvider *v, QMouseEvent *); 57 void drawEnd(LayerGeometryProvider *v, QMouseEvent *) override;
58 58
59 virtual void eraseStart(LayerGeometryProvider *v, QMouseEvent *); 59 void eraseStart(LayerGeometryProvider *v, QMouseEvent *) override;
60 virtual void eraseDrag(LayerGeometryProvider *v, QMouseEvent *); 60 void eraseDrag(LayerGeometryProvider *v, QMouseEvent *) override;
61 virtual void eraseEnd(LayerGeometryProvider *v, QMouseEvent *); 61 void eraseEnd(LayerGeometryProvider *v, QMouseEvent *) override;
62 62
63 virtual void editStart(LayerGeometryProvider *v, QMouseEvent *); 63 void editStart(LayerGeometryProvider *v, QMouseEvent *) override;
64 virtual void editDrag(LayerGeometryProvider *v, QMouseEvent *); 64 void editDrag(LayerGeometryProvider *v, QMouseEvent *) override;
65 virtual void editEnd(LayerGeometryProvider *v, QMouseEvent *); 65 void editEnd(LayerGeometryProvider *v, QMouseEvent *) override;
66 66
67 virtual bool editOpen(LayerGeometryProvider *v, QMouseEvent *); 67 bool editOpen(LayerGeometryProvider *v, QMouseEvent *) override;
68 68
69 virtual void moveSelection(Selection s, sv_frame_t newStartFrame); 69 void moveSelection(Selection s, sv_frame_t newStartFrame) override;
70 virtual void resizeSelection(Selection s, Selection newSize); 70 void resizeSelection(Selection s, Selection newSize) override;
71 virtual void deleteSelection(Selection s); 71 void deleteSelection(Selection s) override;
72 72
73 virtual void copy(LayerGeometryProvider *v, Selection s, Clipboard &to); 73 void copy(LayerGeometryProvider *v, Selection s, Clipboard &to) override;
74 virtual bool paste(LayerGeometryProvider *v, const Clipboard &from, sv_frame_t frameOffset, 74 bool paste(LayerGeometryProvider *v, const Clipboard &from, sv_frame_t frameOffset,
75 bool interactive); 75 bool interactive) override;
76 76
77 virtual const Model *getModel() const { return m_model; } 77 const Model *getModel() const override { return m_model; }
78 void setModel(SparseTimeValueModel *model); 78 void setModel(SparseTimeValueModel *model);
79 79
80 virtual PropertyList getProperties() const; 80 PropertyList getProperties() const override;
81 virtual QString getPropertyLabel(const PropertyName &) const; 81 QString getPropertyLabel(const PropertyName &) const override;
82 virtual QString getPropertyIconName(const PropertyName &) const; 82 QString getPropertyIconName(const PropertyName &) const override;
83 virtual PropertyType getPropertyType(const PropertyName &) const; 83 PropertyType getPropertyType(const PropertyName &) const override;
84 virtual QString getPropertyGroupName(const PropertyName &) const; 84 QString getPropertyGroupName(const PropertyName &) const override;
85 virtual int getPropertyRangeAndValue(const PropertyName &, 85 int getPropertyRangeAndValue(const PropertyName &,
86 int *min, int *max, int *deflt) const; 86 int *min, int *max, int *deflt) const override;
87 virtual QString getPropertyValueLabel(const PropertyName &, 87 QString getPropertyValueLabel(const PropertyName &,
88 int value) const; 88 int value) const override;
89 virtual void setProperty(const PropertyName &, int value); 89 void setProperty(const PropertyName &, int value) override;
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 {
118 bool getDrawSegmentDivisions() const { return m_drawSegmentDivisions; } 118 bool getDrawSegmentDivisions() const { return m_drawSegmentDivisions; }
119 119
120 void setShowDerivative(bool); 120 void setShowDerivative(bool);
121 bool getShowDerivative() const { return m_derivative; } 121 bool getShowDerivative() const { return m_derivative; }
122 122
123 virtual bool isLayerScrollable(const LayerGeometryProvider *v) const; 123 bool isLayerScrollable(const LayerGeometryProvider *v) const override;
124 124
125 virtual bool isLayerEditable() const { return true; } 125 bool isLayerEditable() const override { return true; }
126 126
127 virtual int getCompletion(LayerGeometryProvider *) const { return m_model->getCompletion(); } 127 int getCompletion(LayerGeometryProvider *) const override { return m_model->getCompletion(); }
128 128
129 virtual bool needsTextLabelHeight() const { 129 bool needsTextLabelHeight() const override {
130 return m_plotStyle == PlotSegmentation && m_model->hasTextLabels(); 130 return m_plotStyle == PlotSegmentation && m_model->hasTextLabels();
131 } 131 }
132 132
133 virtual bool getValueExtents(double &min, double &max, 133 bool getValueExtents(double &min, double &max,
134 bool &logarithmic, QString &unit) const; 134 bool &logarithmic, QString &unit) const override;
135 135
136 virtual bool getDisplayExtents(double &min, double &max) const; 136 bool getDisplayExtents(double &min, double &max) const override;
137 virtual bool setDisplayExtents(double min, double max); 137 bool setDisplayExtents(double min, double max) override;
138 138
139 virtual int getVerticalZoomSteps(int &defaultStep) const; 139 int getVerticalZoomSteps(int &defaultStep) const override;
140 virtual int getCurrentVerticalZoomStep() const; 140 int getCurrentVerticalZoomStep() const override;
141 virtual void setVerticalZoomStep(int); 141 void setVerticalZoomStep(int) override;
142 virtual RangeMapper *getNewVerticalZoomRangeMapper() const; 142 RangeMapper *getNewVerticalZoomRangeMapper() const override;
143 143
144 virtual void toXml(QTextStream &stream, QString indent = "", 144 void toXml(QTextStream &stream, QString indent = "",
145 QString extraAttributes = "") const; 145 QString extraAttributes = "") const override;
146 146
147 void setProperties(const QXmlAttributes &attributes); 147 void setProperties(const QXmlAttributes &attributes) override;
148 148
149 /// Override from SingleColourLayer 149 /// Override from SingleColourLayer
150 virtual ColourSignificance getLayerColourSignificance() const { 150 ColourSignificance getLayerColourSignificance() const override {
151 if (m_plotStyle == PlotSegmentation) { 151 if (m_plotStyle == PlotSegmentation) {
152 return ColourHasMeaningfulValue; 152 return ColourHasMeaningfulValue;
153 } else { 153 } else {
154 return ColourDistinguishes; 154 return ColourDistinguishes;
155 } 155 }
156 } 156 }
157 157
158 /// Override from SingleColourLayer 158 /// Override from SingleColourLayer
159 virtual bool hasLightBackground() const { 159 bool hasLightBackground() const override {
160 if (m_plotStyle == PlotSegmentation) { 160 if (m_plotStyle == PlotSegmentation) {
161 return true; 161 return true;
162 } else { 162 } else {
163 return SingleColourLayer::hasLightBackground(); 163 return SingleColourLayer::hasLightBackground();
164 } 164 }
165 } 165 }
166 166
167 /// VerticalScaleLayer and ColourScaleLayer methods 167 /// VerticalScaleLayer and ColourScaleLayer methods
168 virtual int getYForValue(LayerGeometryProvider *, double value) const; 168 int getYForValue(LayerGeometryProvider *, double value) const override;
169 virtual double getValueForY(LayerGeometryProvider *, int y) const; 169 double getValueForY(LayerGeometryProvider *, int y) const override;
170 virtual QString getScaleUnits() const; 170 QString getScaleUnits() const override;
171 virtual QColor getColourForValue(LayerGeometryProvider *v, double value) const; 171 QColor getColourForValue(LayerGeometryProvider *v, double value) const override;
172 172
173 protected: 173 protected:
174 void getScaleExtents(LayerGeometryProvider *, double &min, double &max, bool &log) const; 174 void getScaleExtents(LayerGeometryProvider *, double &min, double &max, bool &log) const;
175 bool shouldAutoAlign() const; 175 bool shouldAutoAlign() const;
176 176
177 SparseTimeValueModel::PointList getLocalPoints(LayerGeometryProvider *v, int) const; 177 SparseTimeValueModel::PointList getLocalPoints(LayerGeometryProvider *v, int) const;
178 178
179 virtual int getDefaultColourHint(bool dark, bool &impose); 179 int getDefaultColourHint(bool dark, bool &impose) override;
180 180
181 SparseTimeValueModel *m_model; 181 SparseTimeValueModel *m_model;
182 bool m_editing; 182 bool m_editing;
183 SparseTimeValueModel::Point m_originalPoint; 183 SparseTimeValueModel::Point m_originalPoint;
184 SparseTimeValueModel::Point m_editingPoint; 184 SparseTimeValueModel::Point m_editingPoint;