Engauge Digitizer 2
Loading...
Searching...
No Matches
OrdinalGenerator.cpp
Go to the documentation of this file.
1/******************************************************************************************************
2 * (C) 2014 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
8#include "Document.h"
9#include "OrdinalGenerator.h"
10#include "Transformation.h"
11
15
17{
18 // Values that really only apply to curve points. These are set arbitrarily
19 QPointF posScreen (0, 0);
20 Transformation transformation;
21
23 transformation,
24 posScreen);
25
26 Functor2wRet<const Point&, const Point&, CallbackSearchReturn> ftorWithCallback = functor_ret (ftor,
29 ftorWithCallback);
30
31 return ftor.ordinal () + 1.0;
32}
33
35 const Transformation &transformation,
36 const QPointF &posScreen,
37 const QString &curveName)
38{
39 CallbackPointOrdinal ftor (document.modelCurveStyles().lineStyle(curveName),
40 transformation,
41 posScreen);
42
43 Functor2wRet<const Point&, const Point&, CallbackSearchReturn> ftorWithCallback = functor_ret (ftor,
45 document.iterateThroughCurveSegments (curveName,
46 ftorWithCallback);
47
48 return ftor.ordinal () + 1.0;
49}
const QString AXIS_CURVE_NAME
Callback for computing the ordinal for a specified point, as a function of the LineStyle and curve ge...
double ordinal() const
Computed ordinal.
CallbackSearchReturn callback(const Point &pointStart, const Point &pointStop)
Callback method.
const LineStyle lineStyle(const QString &curveName) const
Get method for copying one line style in one step.
Storage of one imported image and the data attached to that image.
Definition Document.h:44
void iterateThroughCurveSegments(const QString &curveName, const Functor2wRet< const Point &, const Point &, CallbackSearchReturn > &ftorWithCallback) const
See Curve::iterateThroughCurveSegments, for any axes or graph curve.
Definition Document.cpp:469
CurveStyles modelCurveStyles() const
Get method for CurveStyles.
Definition Document.cpp:714
double generateAxisPointOrdinal(const Document &document)
Select ordinal just for uniqueness, since there is never a curve drawn through the axis points.
double generateCurvePointOrdinal(const Document &document, const Transformation &transformation, const QPointF &posScreen, const QString &curveName)
Select ordinal so new point curve passes smoothly through existing points.
Affine transformation between screen and graph coordinates, based on digitized axis points.