1 /******************************************************************************************************
2  * (C) 2017 markummitchell@github.com. This file is part of Engauge Digitizer, which is released      *
3  * under GNU General Public License version 2 (GPLv2) or (at your option) any later version. See file *
4  * LICENSE or go to gnu.org/licenses for details. Distribution requires prior written permission.     *
5  ******************************************************************************************************/
6 
7 #ifndef ZOOM_TRANSITION_H
8 #define ZOOM_TRANSITION_H
9 
10 #include <QMap>
11 #include "ZoomFactor.h"
12 
13 /// Perform calculations to determine the next zoom setting given the current zoom setting, when zooming in or out
14 class ZoomTransition
15 {
16 public:
17   /// Single constructor.
18   ZoomTransition ();
19 
20   /// Return the floating precision zoom factor given the enum value
21   double mapToFactor (ZoomFactor zoomFactor) const;
22 
23   /// Zoom in
24   ZoomFactor zoomIn (ZoomFactor currentZoomFactor,
25                      double m11,
26                      double m22,
27                      bool actionZoomFillIsChecked) const;
28 
29   /// Zoom out
30   ZoomFactor zoomOut (ZoomFactor currentZoomFactor,
31                       double m11,
32                       double m22,
33                       bool actionZoomFillIsChecked) const;
34 
35 private:
36   QMap<ZoomFactor, double> m_zoomMapToFactor;
37 };
38 
39 #endif // ZOOM_TRANSITION_H
40