7 #include "CallbackBoundingRects.h" 9 #include "DocumentModelCoords.h" 10 #include "DocumentModelGridDisplay.h" 11 #include "DocumentModelGridRemoval.h" 12 #include "GridLineLimiter.h" 13 #include "MainWindowModel.h" 15 #include "Transformation.h" 17 const int DEFAULT_MAXIMUM_GRID_LINES = 25;
23 QRectF GridLineLimiter::documentBounds (
const Document &document,
29 Functor2wRet<const QString &, const Point &, CallbackSearchReturn> ftorWithCallback = functor_ret (ftor,
37 return boundingRectGraph;
48 startX = modelGrid.
startX();
49 double stopX = modelGrid.
stopX();
50 stepX = modelGrid.
stepX();
55 bool needNewStep = (stepX <= 0);
57 double count = 1.0 + (stopX - startX) / stepX;
74 QRectF boundingRectGraph = documentBounds (document,
78 startX = boundingRectGraph.left ();
81 bool needNewStep = (stepX <= 1);
83 double count = 1.0 + (qLn (stopX) - qLn (startX)) / qLn (stepX);
90 stepX = qExp ((qLn (stopX) - qLn (startX)) / (modelMainWindow.
maximumGridLines() - 1));
104 startY = modelGrid.
startY();
105 double stopY = modelGrid.
stopY();
106 stepY = modelGrid.
stepY();
111 bool needNewStep = (stepY <= 0);
113 double count = 1.0 + (stopY - startY) / stepY;
130 QRectF boundingRectGraph = documentBounds (document,
134 startY = boundingRectGraph.top ();
137 bool needNewStep = (stepY <= 1);
139 double count = 1.0 + (qLn (stopY) - qLn (startY)) / qLn (stepY);
146 stepY = qExp ((qLn (stopY) - qLn (startY)) / (modelMainWindow.
maximumGridLines() - 1));
CallbackSearchReturn callback(const QString &curveName, const Point &point)
Callback method.
Model for DlgSettingsGridDisplay and CmdSettingsGridDisplay.
void iterateThroughCurvePointsAxes(const Functor2wRet< const QString &, const Point &, CallbackSearchReturn > &ftorWithCallback)
See Curve::iterateThroughCurvePoints, for the axes curve.
GridLineLimiter()
Single constructor.
Model for DlgSettingsMainWindow.
int maximumGridLines() const
Maximum number of grid lines.
CoordScale coordScaleXTheta() const
Get method for linear/log scale on x/theta.
double stopY() const
Get method for y grid line upper bound (inclusive).
double stopX() const
Get method for x grid line upper bound (inclusive).
Model for DlgSettingsCoords and CmdSettingsCoords.
void limitForYRadius(const Document &document, const Transformation &transformation, const DocumentModelCoords &modelCoords, const MainWindowModel &modelMainWindow, const DocumentModelGridDisplay &modelGrid, double &startY, double &stepY) const
Limit step value for y/range coordinate. This is a noop if the maximum grid line limit in MainWindowM...
Storage of one imported image and the data attached to that image.
double startY() const
Get method for y grid line lower bound (inclusive).
CoordScale coordScaleYRadius() const
Get method for linear/log scale on y/radius.
QRectF boundingRectGraph(bool &isEmpty) const
Graph coordinate bounding rectangle.
void iterateThroughCurvesPointsGraphs(const Functor2wRet< const QString &, const Point &, CallbackSearchReturn > &ftorWithCallback)
See Curve::iterateThroughCurvePoints, for all the graphs curves.
double stepY() const
Get method for y grid line increment.
double startX() const
Get method for x grid line lower bound (inclusive).
void limitForXTheta(const Document &document, const Transformation &transformation, const DocumentModelCoords &modelCoords, const MainWindowModel &modelMainWindow, const DocumentModelGridDisplay &modelGrid, double &startX, double &stepX) const
Limit step value for x/theta coordinate. This is a noop if the maximum grid line limit in MainWindowM...
Callback for computing the bounding rectangles of the screen and graph coordinates of the points in t...
double stepX() const
Get method for x grid line increment.