diff layer/SliceLayer.h @ 1395:32bbb86094c3

Merge from branch spectrogramparam
author Chris Cannam
date Wed, 14 Nov 2018 14:23:17 +0000
parents 3c99083a4d83
children decb7741d036
line wrap: on
line diff
--- a/layer/SliceLayer.h	Tue Nov 06 15:42:06 2018 +0000
+++ b/layer/SliceLayer.h	Wed Nov 14 14:23:17 2018 +0000
@@ -73,7 +73,9 @@
     virtual void setVerticalZoomStep(int);
     virtual RangeMapper *getNewVerticalZoomRangeMapper() const;
 
-    virtual bool hasTimeXAxis() const { return false; }
+    virtual bool hasTimeXAxis() const override { return false; }
+
+    virtual void zoomToRegion(const LayerGeometryProvider *, QRect) override;
 
     virtual bool isLayerScrollable(const LayerGeometryProvider *) const { return false; }
 
@@ -119,9 +121,22 @@
     void modelAboutToBeDeleted(Model *);
 
 protected:
+    /// Convert a (possibly non-integral) bin into x-coord. May be overridden
     virtual double getXForBin(const LayerGeometryProvider *, double bin) const;
+    
+    /// Convert an x-coord into (possibly non-integral) bin. May be overridden
     virtual double getBinForX(const LayerGeometryProvider *, double x) const;
 
+    /// Convert a point such as a bin number into x-coord, given max &
+    /// min. For use by getXForBin etc
+    double getXForScalePoint(const LayerGeometryProvider *,
+                             double p, double pmin, double pmax) const;
+
+    /// Convert an x-coord into a point such as a bin number, given
+    /// max & min. For use by getBinForX etc
+    double getScalePointForX(const LayerGeometryProvider *,
+                             double x, double pmin, double pmax) const;
+
     virtual double getYForValue(const LayerGeometryProvider *v, double value, double &norm) const;
     virtual double getValueForY(const LayerGeometryProvider *v, double y) const;