comparison layer/Colour3DPlotLayer.h @ 916:94e4952a6774 osx-retina

Start trying to introduce LayerGeometryProvider as proxyable interface for View methods that the Layer wants to use
author Chris Cannam
date Tue, 17 Mar 2015 15:05:25 +0000
parents 4a578a360011
children 1011ffb1b6d5
comparison
equal deleted inserted replaced
915:f6d9f28f37cb 916:94e4952a6774
47 47
48 virtual const ZoomConstraint *getZoomConstraint() const { 48 virtual const ZoomConstraint *getZoomConstraint() const {
49 return m_model ? m_model->getZoomConstraint() : 0; 49 return m_model ? m_model->getZoomConstraint() : 0;
50 } 50 }
51 virtual const Model *getModel() const { return m_model; } 51 virtual const Model *getModel() const { return m_model; }
52 virtual void paint(View *v, QPainter &paint, QRect rect) const; 52 virtual void paint(LayerGeometryProvider *v, QPainter &paint, QRect rect) const;
53 53
54 virtual int getVerticalScaleWidth(View *v, bool, QPainter &) const; 54 virtual int getVerticalScaleWidth(LayerGeometryProvider *v, bool, QPainter &) const;
55 virtual void paintVerticalScale(View *v, bool, QPainter &paint, QRect rect) const; 55 virtual void paintVerticalScale(LayerGeometryProvider *v, bool, QPainter &paint, QRect rect) const;
56 56
57 virtual QString getFeatureDescription(View *v, QPoint &) const; 57 virtual QString getFeatureDescription(LayerGeometryProvider *v, QPoint &) const;
58 58
59 virtual bool snapToFeatureFrame(View *v, sv_frame_t &frame, 59 virtual bool snapToFeatureFrame(LayerGeometryProvider *v, sv_frame_t &frame,
60 int &resolution, 60 int &resolution,
61 SnapType snap) const; 61 SnapType snap) const;
62 62
63 virtual void setLayerDormant(const View *v, bool dormant); 63 virtual void setLayerDormant(const LayerGeometryProvider *v, bool dormant);
64 64
65 virtual bool isLayerScrollable(const View *v) const; 65 virtual bool isLayerScrollable(const LayerGeometryProvider *v) const;
66 66
67 virtual ColourSignificance getLayerColourSignificance() const { 67 virtual ColourSignificance getLayerColourSignificance() const {
68 return ColourHasMeaningfulValue; 68 return ColourHasMeaningfulValue;
69 } 69 }
70 70
71 void setModel(const DenseThreeDimensionalModel *model); 71 void setModel(const DenseThreeDimensionalModel *model);
72 72
73 virtual int getCompletion(View *) const { return m_model->getCompletion(); } 73 virtual int getCompletion(LayerGeometryProvider *) const { return m_model->getCompletion(); }
74 74
75 virtual PropertyList getProperties() const; 75 virtual PropertyList getProperties() const;
76 virtual PropertyType getPropertyType(const PropertyName &) const; 76 virtual PropertyType getPropertyType(const PropertyName &) const;
77 virtual QString getPropertyLabel(const PropertyName &) const; 77 virtual QString getPropertyLabel(const PropertyName &) const;
78 virtual QString getPropertyIconName(const PropertyName &) const; 78 virtual QString getPropertyIconName(const PropertyName &) const;
149 bool &logarithmic, QString &unit) const; 149 bool &logarithmic, QString &unit) const;
150 150
151 virtual bool getDisplayExtents(double &min, double &max) const; 151 virtual bool getDisplayExtents(double &min, double &max) const;
152 virtual bool setDisplayExtents(double min, double max); 152 virtual bool setDisplayExtents(double min, double max);
153 153
154 virtual bool getYScaleValue(const View *, int /* y */, 154 virtual bool getYScaleValue(const LayerGeometryProvider *, int /* y */,
155 double &/* value */, QString &/* unit */) const; 155 double &/* value */, QString &/* unit */) const;
156 156
157 virtual int getVerticalZoomSteps(int &defaultStep) const; 157 virtual int getVerticalZoomSteps(int &defaultStep) const;
158 virtual int getCurrentVerticalZoomStep() const; 158 virtual int getCurrentVerticalZoomStep() const;
159 virtual void setVerticalZoomStep(int); 159 virtual void setVerticalZoomStep(int);
200 * Return the y coordinate at which the given bin "starts" 200 * Return the y coordinate at which the given bin "starts"
201 * (i.e. at the bottom of the bin, if the given bin is an integer 201 * (i.e. at the bottom of the bin, if the given bin is an integer
202 * and the vertical scale is the usual way up). Bin number may be 202 * and the vertical scale is the usual way up). Bin number may be
203 * fractional, to obtain a position part-way through a bin. 203 * fractional, to obtain a position part-way through a bin.
204 */ 204 */
205 double getYForBin(View *, double bin) const; 205 double getYForBin(LayerGeometryProvider *, double bin) const;
206 206
207 /** 207 /**
208 * As getYForBin, but rounding to integer values. 208 * As getYForBin, but rounding to integer values.
209 */ 209 */
210 int getIYForBin(View *, int bin) const; 210 int getIYForBin(LayerGeometryProvider *, int bin) const;
211 211
212 /** 212 /**
213 * Return the bin number, possibly fractional, at the given y 213 * Return the bin number, possibly fractional, at the given y
214 * coordinate. Note that the whole numbers occur at the positions 214 * coordinate. Note that the whole numbers occur at the positions
215 * at which the bins "start" (i.e. the bottom of the visible bin, 215 * at which the bins "start" (i.e. the bottom of the visible bin,
216 * if the vertical scale is the usual way up). 216 * if the vertical scale is the usual way up).
217 */ 217 */
218 double getBinForY(View *, double y) const; 218 double getBinForY(LayerGeometryProvider *, double y) const;
219 219
220 /** 220 /**
221 * As getBinForY, but rounding to integer values. 221 * As getBinForY, but rounding to integer values.
222 */ 222 */
223 int getIBinForY(View *, int y) const; 223 int getIBinForY(LayerGeometryProvider *, int y) const;
224 224
225 DenseThreeDimensionalModel::Column getColumn(int col) const; 225 DenseThreeDimensionalModel::Column getColumn(int col) const;
226 226
227 /** 227 /**
228 * True if we have the opaque or smooth flag set, or if the cells 228 * True if we have the opaque or smooth flag set, or if the cells
229 * are so small you can't see their borders. False for big, 229 * are so small you can't see their borders. False for big,
230 * translucent cells. 230 * translucent cells.
231 */ 231 */
232 bool shouldPaintDenseIn(const View *) const; 232 bool shouldPaintDenseIn(const LayerGeometryProvider *) const;
233 233
234 int getColourScaleWidth(QPainter &) const; 234 int getColourScaleWidth(QPainter &) const;
235 void fillCache(int firstBin, int lastBin) const; 235 void fillCache(int firstBin, int lastBin) const;
236 void paintDense(View *v, QPainter &paint, QRect rect) const; 236 void paintDense(LayerGeometryProvider *v, QPainter &paint, QRect rect) const;
237 }; 237 };
238 238
239 #endif 239 #endif