# HG changeset patch # User Chris Cannam # Date 1391711683 0 # Node ID c27a3604fe6f1fd02aa115a6b2dec3cae3b3b844 # Parent 5d3a6ecdf2db20411f1124f42af9ace078792881 Toward getYScaleValue in Colour3DPlotLayer diff -r 5d3a6ecdf2db -r c27a3604fe6f layer/Colour3DPlotLayer.cpp --- a/layer/Colour3DPlotLayer.cpp Thu Feb 06 15:31:46 2014 +0000 +++ b/layer/Colour3DPlotLayer.cpp Thu Feb 06 18:34:43 2014 +0000 @@ -579,6 +579,13 @@ return true; } +bool +Colour3DPlotLayer::getYScaleValue(const View *v, int y, + float &value, QString &unit) const +{ + return false;//!!! +} + int Colour3DPlotLayer::getVerticalZoomSteps(int &defaultStep) const { diff -r 5d3a6ecdf2db -r c27a3604fe6f layer/Colour3DPlotLayer.h --- a/layer/Colour3DPlotLayer.h Thu Feb 06 15:31:46 2014 +0000 +++ b/layer/Colour3DPlotLayer.h Thu Feb 06 18:34:43 2014 +0000 @@ -151,6 +151,9 @@ virtual bool getDisplayExtents(float &min, float &max) const; virtual bool setDisplayExtents(float min, float max); + virtual bool getYScaleValue(const View *, int /* y */, + float &/* value */, QString &/* unit */) const; + virtual int getVerticalZoomSteps(int &defaultStep) const; virtual int getCurrentVerticalZoomStep() const; virtual void setVerticalZoomStep(int); @@ -188,17 +191,32 @@ bool m_smooth; size_t m_peakResolution; + // Minimum and maximum bin numbers visible within the view. We + // always snap to whole bins at view edges. int m_miny; int m_maxy; + + /** + * Return the y coordinate at which the given bin "starts" + * (i.e. at the bottom of the bin, if the given bin is an integer + * and the vertical scale is the usual way up). Bin number may be + * fractional, to obtain a position part-way through a bin. + */ + float getYForBin(View *, float bin) const; + + /** + * Return the bin number, possibly fractional, at the given y + * coordinate. Note that the whole numbers occur at the positions + * at which the bins "start" (i.e. the bottom of the visible bin, + * if the vertical scale is the usual way up). + */ + float getBinForY(View *, float y) const; DenseThreeDimensionalModel::Column getColumn(size_t col) const; int getColourScaleWidth(QPainter &) const; void fillCache(size_t firstBin, size_t lastBin) const; void paintDense(View *v, QPainter &paint, QRect rect) const; - - float getYForBin(View *, float bin) const; - float getBinForY(View *, float y) const; }; #endif