Mercurial > hg > svgui
comparison layer/RegionLayer.h @ 1414:fa986b91d77f
Merge from branch fix-static-analysis
author | Chris Cannam |
---|---|
date | Wed, 09 Jan 2019 15:24:51 +0000 |
parents | a18e78b9c78b |
children | c9fa16e41664 |
comparison
equal
deleted
inserted
replaced
1413:0930a27ebea2 | 1414:fa986b91d77f |
---|---|
37 Q_OBJECT | 37 Q_OBJECT |
38 | 38 |
39 public: | 39 public: |
40 RegionLayer(); | 40 RegionLayer(); |
41 | 41 |
42 virtual void paint(LayerGeometryProvider *v, QPainter &paint, QRect rect) const; | 42 void paint(LayerGeometryProvider *v, QPainter &paint, QRect rect) const override; |
43 | 43 |
44 virtual int getVerticalScaleWidth(LayerGeometryProvider *v, bool, QPainter &) const; | 44 int getVerticalScaleWidth(LayerGeometryProvider *v, bool, QPainter &) const override; |
45 virtual void paintVerticalScale(LayerGeometryProvider *v, bool, QPainter &paint, QRect rect) const; | 45 void paintVerticalScale(LayerGeometryProvider *v, bool, QPainter &paint, QRect rect) const override; |
46 | 46 |
47 virtual QString getFeatureDescription(LayerGeometryProvider *v, QPoint &) const; | 47 QString getFeatureDescription(LayerGeometryProvider *v, QPoint &) const override; |
48 virtual QString getLabelPreceding(sv_frame_t) const; | 48 QString getLabelPreceding(sv_frame_t) const override; |
49 | 49 |
50 virtual bool snapToFeatureFrame(LayerGeometryProvider *v, sv_frame_t &frame, | 50 bool snapToFeatureFrame(LayerGeometryProvider *v, sv_frame_t &frame, |
51 int &resolution, | 51 int &resolution, |
52 SnapType snap) const; | 52 SnapType snap) const override; |
53 virtual bool snapToSimilarFeature(LayerGeometryProvider *v, sv_frame_t &frame, | 53 bool snapToSimilarFeature(LayerGeometryProvider *v, sv_frame_t &frame, |
54 int &resolution, | 54 int &resolution, |
55 SnapType snap) const; | 55 SnapType snap) const override; |
56 | 56 |
57 virtual void drawStart(LayerGeometryProvider *v, QMouseEvent *); | 57 void drawStart(LayerGeometryProvider *v, QMouseEvent *) override; |
58 virtual void drawDrag(LayerGeometryProvider *v, QMouseEvent *); | 58 void drawDrag(LayerGeometryProvider *v, QMouseEvent *) override; |
59 virtual void drawEnd(LayerGeometryProvider *v, QMouseEvent *); | 59 void drawEnd(LayerGeometryProvider *v, QMouseEvent *) override; |
60 | 60 |
61 virtual void eraseStart(LayerGeometryProvider *v, QMouseEvent *); | 61 void eraseStart(LayerGeometryProvider *v, QMouseEvent *) override; |
62 virtual void eraseDrag(LayerGeometryProvider *v, QMouseEvent *); | 62 void eraseDrag(LayerGeometryProvider *v, QMouseEvent *) override; |
63 virtual void eraseEnd(LayerGeometryProvider *v, QMouseEvent *); | 63 void eraseEnd(LayerGeometryProvider *v, QMouseEvent *) override; |
64 | 64 |
65 virtual void editStart(LayerGeometryProvider *v, QMouseEvent *); | 65 void editStart(LayerGeometryProvider *v, QMouseEvent *) override; |
66 virtual void editDrag(LayerGeometryProvider *v, QMouseEvent *); | 66 void editDrag(LayerGeometryProvider *v, QMouseEvent *) override; |
67 virtual void editEnd(LayerGeometryProvider *v, QMouseEvent *); | 67 void editEnd(LayerGeometryProvider *v, QMouseEvent *) override; |
68 | 68 |
69 virtual bool editOpen(LayerGeometryProvider *v, QMouseEvent *); | 69 bool editOpen(LayerGeometryProvider *v, QMouseEvent *) override; |
70 | 70 |
71 virtual void moveSelection(Selection s, sv_frame_t newStartFrame); | 71 void moveSelection(Selection s, sv_frame_t newStartFrame) override; |
72 virtual void resizeSelection(Selection s, Selection newSize); | 72 void resizeSelection(Selection s, Selection newSize) override; |
73 virtual void deleteSelection(Selection s); | 73 void deleteSelection(Selection s) override; |
74 | 74 |
75 virtual void copy(LayerGeometryProvider *v, Selection s, Clipboard &to); | 75 void copy(LayerGeometryProvider *v, Selection s, Clipboard &to) override; |
76 virtual bool paste(LayerGeometryProvider *v, const Clipboard &from, sv_frame_t frameOffset, | 76 bool paste(LayerGeometryProvider *v, const Clipboard &from, sv_frame_t frameOffset, |
77 bool interactive); | 77 bool interactive) override; |
78 | 78 |
79 virtual const Model *getModel() const { return m_model; } | 79 const Model *getModel() const override { return m_model; } |
80 void setModel(RegionModel *model); | 80 void setModel(RegionModel *model); |
81 | 81 |
82 virtual PropertyList getProperties() const; | 82 PropertyList getProperties() const override; |
83 virtual QString getPropertyLabel(const PropertyName &) const; | 83 QString getPropertyLabel(const PropertyName &) const override; |
84 virtual PropertyType getPropertyType(const PropertyName &) const; | 84 PropertyType getPropertyType(const PropertyName &) const override; |
85 virtual QString getPropertyGroupName(const PropertyName &) const; | 85 QString getPropertyGroupName(const PropertyName &) const override; |
86 virtual int getPropertyRangeAndValue(const PropertyName &, | 86 int getPropertyRangeAndValue(const PropertyName &, |
87 int *min, int *max, int *deflt) const; | 87 int *min, int *max, int *deflt) const override; |
88 virtual QString getPropertyValueLabel(const PropertyName &, | 88 QString getPropertyValueLabel(const PropertyName &, |
89 int value) const; | 89 int value) const override; |
90 virtual void setProperty(const PropertyName &, int value); | 90 void setProperty(const PropertyName &, int value) override; |
91 | 91 |
92 void setFillColourMap(int); | 92 void setFillColourMap(int); |
93 int getFillColourMap() const { return m_colourMap; } | 93 int getFillColourMap() const { return m_colourMap; } |
94 | 94 |
95 enum VerticalScale { | 95 enum VerticalScale { |
108 }; | 108 }; |
109 | 109 |
110 void setPlotStyle(PlotStyle style); | 110 void setPlotStyle(PlotStyle style); |
111 PlotStyle getPlotStyle() const { return m_plotStyle; } | 111 PlotStyle getPlotStyle() const { return m_plotStyle; } |
112 | 112 |
113 virtual bool isLayerScrollable(const LayerGeometryProvider *v) const; | 113 bool isLayerScrollable(const LayerGeometryProvider *v) const override; |
114 | 114 |
115 virtual bool isLayerEditable() const { return true; } | 115 bool isLayerEditable() const override { return true; } |
116 | 116 |
117 virtual int getCompletion(LayerGeometryProvider *) const { return m_model->getCompletion(); } | 117 int getCompletion(LayerGeometryProvider *) const override { return m_model->getCompletion(); } |
118 | 118 |
119 virtual bool getValueExtents(double &min, double &max, | 119 bool getValueExtents(double &min, double &max, |
120 bool &log, QString &unit) const; | 120 bool &log, QString &unit) const override; |
121 | 121 |
122 virtual bool getDisplayExtents(double &min, double &max) const; | 122 bool getDisplayExtents(double &min, double &max) const override; |
123 | 123 |
124 virtual void toXml(QTextStream &stream, QString indent = "", | 124 void toXml(QTextStream &stream, QString indent = "", |
125 QString extraAttributes = "") const; | 125 QString extraAttributes = "") const override; |
126 | 126 |
127 void setProperties(const QXmlAttributes &attributes); | 127 void setProperties(const QXmlAttributes &attributes) override; |
128 | 128 |
129 /// VerticalScaleLayer and ColourScaleLayer methods | 129 /// VerticalScaleLayer and ColourScaleLayer methods |
130 int getYForValue(LayerGeometryProvider *v, double value) const; | 130 int getYForValue(LayerGeometryProvider *v, double value) const override; |
131 double getValueForY(LayerGeometryProvider *v, int y) const; | 131 double getValueForY(LayerGeometryProvider *v, int y) const override; |
132 virtual QString getScaleUnits() const; | 132 QString getScaleUnits() const override; |
133 QColor getColourForValue(LayerGeometryProvider *v, double value) const; | 133 QColor getColourForValue(LayerGeometryProvider *v, double value) const override; |
134 | 134 |
135 protected slots: | 135 protected slots: |
136 void recalcSpacing(); | 136 void recalcSpacing(); |
137 | 137 |
138 protected: | 138 protected: |
139 double getValueForY(LayerGeometryProvider *v, int y, int avoid) const; | 139 double getValueForY(LayerGeometryProvider *v, int y, int avoid) const; |
140 void getScaleExtents(LayerGeometryProvider *, double &min, double &max, bool &log) const; | 140 void getScaleExtents(LayerGeometryProvider *, double &min, double &max, bool &log) const; |
141 | 141 |
142 virtual int getDefaultColourHint(bool dark, bool &impose); | 142 int getDefaultColourHint(bool dark, bool &impose) override; |
143 | 143 |
144 RegionModel::PointList getLocalPoints(LayerGeometryProvider *v, int x) const; | 144 RegionModel::PointList getLocalPoints(LayerGeometryProvider *v, int x) const; |
145 | 145 |
146 bool getPointToDrag(LayerGeometryProvider *v, int x, int y, RegionModel::Point &) const; | 146 bool getPointToDrag(LayerGeometryProvider *v, int x, int y, RegionModel::Point &) const; |
147 | 147 |