comparison data/model/SparseValueModel.h @ 1580:c01cbe41aeb5 fix-static-analysis

Use override throughout
author Chris Cannam
date Mon, 26 Nov 2018 13:48:45 +0000
parents 48e9f538e6e9
children ad5f892c0c4d
comparison
equal deleted inserted replaced
1579:232d6ddf257d 1580:c01cbe41aeb5
51 using SparseModel<PointType>::m_points; 51 using SparseModel<PointType>::m_points;
52 using SparseModel<PointType>::modelChanged; 52 using SparseModel<PointType>::modelChanged;
53 using SparseModel<PointType>::getPoints; 53 using SparseModel<PointType>::getPoints;
54 using SparseModel<PointType>::tr; 54 using SparseModel<PointType>::tr;
55 55
56 QString getTypeName() const { return tr("Sparse Value"); } 56 QString getTypeName() const override { return tr("Sparse Value"); }
57 57
58 virtual float getValueMinimum() const { return m_valueMinimum; } 58 virtual float getValueMinimum() const { return m_valueMinimum; }
59 virtual float getValueMaximum() const { return m_valueMaximum; } 59 virtual float getValueMaximum() const { return m_valueMaximum; }
60 60
61 virtual QString getScaleUnits() const { return m_units; } 61 virtual QString getScaleUnits() const { return m_units; }
62 virtual void setScaleUnits(QString units) { 62 virtual void setScaleUnits(QString units) {
63 m_units = units; 63 m_units = units;
64 UnitDatabase::getInstance()->registerUnit(units); 64 UnitDatabase::getInstance()->registerUnit(units);
65 } 65 }
66 66
67 virtual void addPoint(const PointType &point) 67 void addPoint(const PointType &point) override
68 { 68 {
69 bool allChange = false; 69 bool allChange = false;
70 70
71 if (!ISNAN(point.value) && !ISINF(point.value)) { 71 if (!ISNAN(point.value) && !ISINF(point.value)) {
72 if (!m_haveExtents || point.value < m_valueMinimum) { 72 if (!m_haveExtents || point.value < m_valueMinimum) {
82 82
83 SparseModel<PointType>::addPoint(point); 83 SparseModel<PointType>::addPoint(point);
84 if (allChange) emit modelChanged(); 84 if (allChange) emit modelChanged();
85 } 85 }
86 86
87 virtual void deletePoint(const PointType &point) 87 void deletePoint(const PointType &point) override
88 { 88 {
89 SparseModel<PointType>::deletePoint(point); 89 SparseModel<PointType>::deletePoint(point);
90 90
91 if (point.value == m_valueMinimum || 91 if (point.value == m_valueMinimum ||
92 point.value == m_valueMaximum) { 92 point.value == m_valueMaximum) {
111 emit modelChanged(); 111 emit modelChanged();
112 } 112 }
113 } 113 }
114 } 114 }
115 115
116 virtual void toXml(QTextStream &stream, 116 void toXml(QTextStream &stream,
117 QString indent = "", 117 QString indent = "",
118 QString extraAttributes = "") const 118 QString extraAttributes = "") const override
119 { 119 {
120 std::cerr << "SparseValueModel::toXml: extraAttributes = \"" 120 std::cerr << "SparseValueModel::toXml: extraAttributes = \""
121 << extraAttributes.toStdString() << std::endl; 121 << extraAttributes.toStdString() << std::endl;
122 122
123 SparseModel<PointType>::toXml 123 SparseModel<PointType>::toXml