Mercurial > hg > svcore
comparison data/model/DenseThreeDimensionalModel.h @ 1580:c01cbe41aeb5 fix-static-analysis
Use override throughout
author | Chris Cannam |
---|---|
date | Mon, 26 Nov 2018 13:48:45 +0000 |
parents | 51d6551d5244 |
children | ad5f892c0c4d |
comparison
equal
deleted
inserted
replaced
1579:232d6ddf257d | 1580:c01cbe41aeb5 |
---|---|
116 */ | 116 */ |
117 bool isOverThreshold(int x, int y, float threshold) { | 117 bool isOverThreshold(int x, int y, float threshold) { |
118 return getValueAt(x, y) > threshold; | 118 return getValueAt(x, y) > threshold; |
119 } | 119 } |
120 | 120 |
121 QString getTypeName() const { return tr("Dense 3-D"); } | 121 QString getTypeName() const override { return tr("Dense 3-D"); } |
122 | 122 |
123 virtual int getCompletion() const = 0; | 123 virtual int getCompletion() const = 0; |
124 | 124 |
125 /* | 125 /* |
126 TabularModel methods. | 126 TabularModel methods. |
127 This class is non-editable -- subclasses may be editable. | 127 This class is non-editable -- subclasses may be editable. |
128 Row and column are transposed for the tabular view (which is | 128 Row and column are transposed for the tabular view (which is |
129 "on its side"). | 129 "on its side"). |
130 */ | 130 */ |
131 | 131 |
132 virtual int getRowCount() const { return getWidth(); } | 132 int getRowCount() const override { return getWidth(); } |
133 virtual int getColumnCount() const { return getHeight() + 2; } | 133 int getColumnCount() const override { return getHeight() + 2; } |
134 | 134 |
135 virtual QString getHeading(int column) const | 135 QString getHeading(int column) const override |
136 { | 136 { |
137 switch (column) { | 137 switch (column) { |
138 case 0: return tr("Time"); | 138 case 0: return tr("Time"); |
139 case 1: return tr("Frame"); | 139 case 1: return tr("Frame"); |
140 default: | 140 default: |
144 } | 144 } |
145 return name; | 145 return name; |
146 } | 146 } |
147 } | 147 } |
148 | 148 |
149 virtual QVariant getData(int row, int column, int) const | 149 QVariant getData(int row, int column, int) const |
150 { | 150 override { |
151 switch (column) { | 151 switch (column) { |
152 case 0: { | 152 case 0: { |
153 RealTime rt = RealTime::frame2RealTime | 153 RealTime rt = RealTime::frame2RealTime |
154 (row * getResolution() + getStartFrame(), getSampleRate()); | 154 (row * getResolution() + getStartFrame(), getSampleRate()); |
155 return rt.toText().c_str(); | 155 return rt.toText().c_str(); |
159 default: | 159 default: |
160 return getValueAt(row, column - 2); | 160 return getValueAt(row, column - 2); |
161 } | 161 } |
162 } | 162 } |
163 | 163 |
164 virtual bool isColumnTimeValue(int col) const { | 164 bool isColumnTimeValue(int col) const override { |
165 return col < 2; | 165 return col < 2; |
166 } | 166 } |
167 virtual SortType getSortType(int) const { | 167 SortType getSortType(int) const override { |
168 return SortNumeric; | 168 return SortNumeric; |
169 } | 169 } |
170 | 170 |
171 virtual sv_frame_t getFrameForRow(int row) const { | 171 sv_frame_t getFrameForRow(int row) const override { |
172 return sv_frame_t(row) * getResolution() + getStartFrame(); | 172 return sv_frame_t(row) * getResolution() + getStartFrame(); |
173 } | 173 } |
174 virtual int getRowForFrame(sv_frame_t frame) const { | 174 int getRowForFrame(sv_frame_t frame) const override { |
175 return int((frame - getStartFrame()) / getResolution()); | 175 return int((frame - getStartFrame()) / getResolution()); |
176 } | 176 } |
177 | 177 |
178 protected: | 178 protected: |
179 DenseThreeDimensionalModel() { } | 179 DenseThreeDimensionalModel() { } |