Engauge Digitizer 2
Loading...
Searching...
No Matches
CallbackGatherXThetaValuesFunctions.cpp
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
7#include "CallbackGatherXThetaValuesFunctions.h"
8#include "DocumentModelExportFormat.h"
9#include "ExportAlignLinear.h"
10#include "ExportAlignLog.h"
11#include "ExportLayoutFunctions.h"
12#include "ExportPointsSelectionFunctions.h"
13#include "Logger.h"
14#include "Point.h"
15
17 const QStringList &curvesIncluded,
18 const Transformation &transformation) :
19 m_transformation (transformation)
20{
21 bool firstCurveForGatherXTheta = (modelExport.pointsSelectionFunctions() == EXPORT_POINTS_SELECTION_FUNCTIONS_INTERPOLATE_FIRST_CURVE);
22
23 // Included just the first curve, or all curves depending on DocumentModelExportFormat
24 QStringList::const_iterator itr;
25 for (itr = curvesIncluded.begin(); itr != curvesIncluded.end(); itr++) {
26
27 QString curveIncluded = *itr;
28 m_curveNamesIncluded [curveIncluded] = true;
29
30 if (firstCurveForGatherXTheta) {
31
32 // We only want points belonging to the first included curve so exit this loop
33 break;
34
35 }
36 }
37}
38
40 const Point &point)
41{
42 LOG4CPP_DEBUG_S ((*mainCat)) << "CallbackGatherXThetaValuesFunctions::callback"
43 << " curveName=" << curveName.toLatin1().data()
44 << " point=" << point.identifier().toLatin1().data();
45
46 if (m_curveNamesIncluded.contains (curveName)) {
47
48 QPointF posGraph;
49 m_transformation.transformScreenToRawGraph (point.posScreen(),
50 posGraph);
51
52 m_xThetaValues [posGraph.x ()] = true;
53 }
54
56}
57
59{
60 LOG4CPP_INFO_S ((*mainCat)) << "CallbackGatherXThetaValuesFunctions::xThetaValuesRaw";
61
62 return m_xThetaValues;
63}
CallbackSearchReturn
Return values for search callback methods.
@ CALLBACK_SEARCH_RETURN_CONTINUE
Continue normal execution of the search.
CallbackSearchReturn callback(const QString &curveName, const Point &point)
Callback method.
CallbackGatherXThetaValuesFunctions(const DocumentModelExportFormat &modelExport, const QStringList &curveNamesIncluded, const Transformation &transformation)
Single constructor.
ValuesVectorXOrY xThetaValuesRaw() const
Resulting x/theta values for all included functions.
Model for DlgSettingsExportFormat and CmdSettingsExportFormat.
ExportPointsSelectionFunctions pointsSelectionFunctions() const
Get method for point selection for functions.
Class that represents one digitized point. The screen-to-graph coordinate transformation is always ex...
Definition Point.h:24
QPointF posScreen() const
Accessor for screen position.
Definition Point.cpp:392
QString identifier() const
Unique identifier for a specific Point.
Definition Point.cpp:256
Affine transformation between screen and graph coordinates, based on digitized axis points.
void transformScreenToRawGraph(const QPointF &coordScreen, QPointF &coordGraph) const
Transform from cartesian pixel screen coordinates to cartesian/polar graph coordinates.