23void GridLineLimiter::documentBounds (
const Document &document,
25 QPointF &boundingRectMin,
26 QPointF &boundingRectMax)
const
32 Functor2wRet<const QString &, const Point &, CallbackSearchReturn> ftorWithCallback = functor_ret (ftor,
38 boundingRectMin = ftor.boundingRectGraphMin (isEmpty);
39 boundingRectMax = ftor.boundingRectGraphMax (isEmpty);
49 unsigned int countX)
const
51 bool needReduction = (countX > (
unsigned int) modelMainWindow.
maximumGridLines());
61 countX = qFloor (1.0 + (stopX - startX) / stepX);
62 needReduction = (countX > (
unsigned int) modelMainWindow.
maximumGridLines());
76 QPointF boundingRectGraphMin, boundingRectGraphMax;
77 documentBounds (document,
80 boundingRectGraphMax);
83 startX = boundingRectGraphMin.x ();
91 countX = qFloor (1.0 + (qLn (stopX) - qLn (startX)) / qLn (stepX));
92 needReduction = (countX > (
unsigned int) modelMainWindow.
maximumGridLines());
97 stopX = qExp (qLn (startX) + qLn (stepX) * (modelMainWindow.
maximumGridLines() - 1));
109 unsigned int countY)
const
111 bool needReduction = (countY > (
unsigned int) modelMainWindow.
maximumGridLines());
116 if (!needReduction) {
119 needReduction =
true;
121 countY = qFloor (1.0 + (stopY - startY) / stepY);
122 needReduction = (countY > (
unsigned int) modelMainWindow.
maximumGridLines());
136 QPointF boundingRectGraphMin, boundingRectGraphMax;
137 documentBounds (document,
139 boundingRectGraphMin,
140 boundingRectGraphMax);
143 startY = boundingRectGraphMin.y ();
146 if (!needReduction) {
149 needReduction =
true;
151 countY = qFloor (1.0 + (qLn (stopY) - qLn (startY)) / qLn (stepY));
152 needReduction = (countY > (
unsigned int) modelMainWindow.
maximumGridLines());
157 stopY = qExp (qLn (startY) + qLn (stepY) * (modelMainWindow.
maximumGridLines() - 1));
const int DEFAULT_MAXIMUM_GRID_LINES
Default for maximum number of grid lines.
Callback for computing the bounding rectangles of the screen and graph coordinates of the points in t...
CallbackSearchReturn callback(const QString &curveName, const Point &point)
Callback method.
Model for DlgSettingsCoords and CmdSettingsCoords.
CoordScale coordScaleYRadius() const
Get method for linear/log scale on y/radius.
CoordScale coordScaleXTheta() const
Get method for linear/log scale on x/theta.
Storage of one imported image and the data attached to that image.
void iterateThroughCurvePointsAxes(const Functor2wRet< const QString &, const Point &, CallbackSearchReturn > &ftorWithCallback)
See Curve::iterateThroughCurvePoints, for the axes curve.
void iterateThroughCurvesPointsGraphs(const Functor2wRet< const QString &, const Point &, CallbackSearchReturn > &ftorWithCallback)
See Curve::iterateThroughCurvePoints, for all the graphs curves.
DocumentAxesPointsRequired documentAxesPointsRequired() const
Get method for DocumentAxesPointsRequired.
void limitForYRadius(const Document &document, const Transformation &transformation, const DocumentModelCoords &modelCoords, const MainWindowModel &modelMainWindow, double &startY, double &stepY, double &stopY, unsigned int numY) const
Limit step value for y/range coordinate. This is a noop if the maximum grid line limit in MainWindowM...
void limitForXTheta(const Document &document, const Transformation &transformation, const DocumentModelCoords &modelCoords, const MainWindowModel &modelMainWindow, double &startX, double &stepX, double &stopX, unsigned int numX) const
Limit step value for x/theta coordinate. This is a noop if the maximum grid line limit in MainWindowM...
GridLineLimiter()
Single constructor.
Model for DlgSettingsMainWindow.
int maximumGridLines() const
Get method for maximum number of grid lines.