Engauge Digitizer  2
GridLineLimiter.h
Go to the documentation of this file.
1 /******************************************************************************************************
2  * (C) 2016 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 GRID_LINE_LIMITER_H
8 #define GRID_LINE_LIMITER_H
9 
10 #include <QPointF>
11 
12 class Document;
15 class MainWindowModel;
16 class Transformation;
17 
19 extern const int DEFAULT_MAXIMUM_GRID_LINES;
20 
24 {
25 public:
27  GridLineLimiter ();
28 
30  void limitForXTheta (const Document &document,
31  const Transformation &transformation,
32  const DocumentModelCoords &modelCoords,
33  const MainWindowModel &modelMainWindow,
34  const DocumentModelGridDisplay &modelGrid,
35  double &startX,
36  double &stepX,
37  double &stopX) const;
38 
40  void limitForYRadius (const Document &document,
41  const Transformation &transformation,
42  const DocumentModelCoords &modelCoords,
43  const MainWindowModel &modelMainWindow,
44  const DocumentModelGridDisplay &modelGrid,
45  double &startY,
46  double &stepY,
47  double &stopY) const;
48 
49 private:
50 
51  void documentBounds (const Document &document,
52  const Transformation &transformation,
53  QPointF &boundingRectMin,
54  QPointF &boundingRectMax) const;
55 
56 };
57 
58 #endif // GRID_LINE_LIMITER_H
void limitForXTheta(const Document &document, const Transformation &transformation, const DocumentModelCoords &modelCoords, const MainWindowModel &modelMainWindow, const DocumentModelGridDisplay &modelGrid, double &startX, double &stepX, double &stopX) const
Limit step value for x/theta coordinate. This is a noop if the maximum grid line limit in MainWindowM...
Model for DlgSettingsGridDisplay and CmdSettingsGridDisplay.
const int DEFAULT_MAXIMUM_GRID_LINES
Default for maximum number of grid lines.
Affine transformation between screen and graph coordinates, based on digitized axis points...
GridLineLimiter()
Single constructor.
Model for DlgSettingsMainWindow.
void limitForYRadius(const Document &document, const Transformation &transformation, const DocumentModelCoords &modelCoords, const MainWindowModel &modelMainWindow, const DocumentModelGridDisplay &modelGrid, double &startY, double &stepY, double &stopY) const
Limit step value for y/range coordinate. This is a noop if the maximum grid line limit in MainWindowM...
Model for DlgSettingsCoords and CmdSettingsCoords.
Storage of one imported image and the data attached to that image.
Definition: Document.h:41
Limit the number of grid lines so a bad combination of start/step/stop value will not lead to extreme...