diff view/View.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 4eafe5a1b655
children bfacecf7ea7e
line wrap: on
line diff
--- a/view/View.h	Tue Oct 15 09:32:24 2019 +0100
+++ b/view/View.h	Tue Oct 15 11:40:56 2019 +0100
@@ -350,11 +350,25 @@
      */
     virtual bool renderPartToSvgFile(QString filename,
                                      sv_frame_t f0, sv_frame_t f1);
+
+    /**
+     * Return the visible vertical extents for the given unit, if any.
+     * Overridden from LayerGeometryProvider (see docs there).
+     */
+    bool getVisibleExtentsForUnit(QString unit, double &min, double &max,
+                                  bool &log) const override;
+
+    /**
+     * Return some visible vertical extents and unit. That is, if at
+     * least one non-dormant layer has a non-empty unit and returns
+     * some values from its getDisplayExtents() method, return the
+     * extents and unit from the topmost of those. Otherwise return
+     * false.
+     */
+    bool getVisibleExtentsForAnyUnit(double &min, double &max,
+                                     bool &logarithmic, QString &unit) const;
     
-    int getTextLabelHeight(const Layer *layer, QPainter &) const override;
-
-    bool getValueExtents(QString unit, double &min, double &max,
-                         bool &log) const override;
+    int getTextLabelYCoord(const Layer *layer, QPainter &) const override;
 
     void toXml(QTextStream &stream, QString indent = "",
                        QString extraAttributes = "") const override;