comparison layer/LayerGeometryProvider.h @ 1537:4f8c72adbf43

Clarify naming of some view-related methods. Rename LayerGeometryProvider::getValueExtents to getVisibleExtentsForUnit, and View::getTextLabelHeight to getTextLabelYCoord. Add View::getVisibleExtentsForAnyUnit to be used to determine which unit to adopt in a new e.g. box layer.
author Chris Cannam
date Tue, 15 Oct 2019 11:40:56 +0100
parents b0eeec95ab5b
children
comparison
equal deleted inserted replaced
1536:5a215033b853 1537:4f8c72adbf43
140 */ 140 */
141 virtual double getFrequencyForY(double y, 141 virtual double getFrequencyForY(double y,
142 double minFreq, double maxFreq, 142 double minFreq, double maxFreq,
143 bool logarithmic) const = 0; 143 bool logarithmic) const = 0;
144 144
145 virtual int getTextLabelHeight(const Layer *layer, QPainter &) const = 0; 145 /**
146 146 * Return a y-coordinate at which text labels for individual items
147 virtual bool getValueExtents(QString unit, double &min, double &max, 147 * in a layer may be drawn, so as not to overlap with those of
148 bool &log) const = 0; 148 * other layers. The returned coordinate will be near the top of
149 * the visible widget, but adjusted downward depending on how many
150 * other visible layers return true from their implementation of
151 * Layer::needsTextLabelHeight().
152 */
153 virtual int getTextLabelYCoord(const Layer *layer, QPainter &) const = 0;
154
155 /**
156 * Return the visible vertical extents for the given unit, if any.
157 * That is:
158 *
159 * - if at least one non-dormant layer uses the same unit and
160 * returns some values from its getDisplayExtents() method,
161 * return the extents from the topmost of those
162 *
163 * - otherwise, if at least one non-dormant layer uses the same
164 * unit, return the union of the value extents of all of those
165 *
166 * - otherwise return false
167 */
168 virtual bool getVisibleExtentsForUnit(QString unit,
169 double &min, double &max,
170 bool &log) const = 0;
149 171
150 /** 172 /**
151 * Return the zoom level, i.e. the number of frames per pixel or 173 * Return the zoom level, i.e. the number of frames per pixel or
152 * pixels per frame 174 * pixels per frame
153 */ 175 */