Engauge Digitizer  2
 All Classes Functions Variables Typedefs Enumerations Friends Pages
CallbackGatherXThetasInCurves.cpp
1 /******************************************************************************************************
2  * (C) 2019 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 "CallbackGatherXThetasInCurves.h"
8 #include "DocumentModelExportFormat.h"
9 #include "EngaugeAssert.h"
10 #include "ExportPointsSelectionFunctions.h"
11 #include "Logger.h"
12 #include "Point.h"
13 
15  const QStringList &curvesIncluded,
16  const Transformation &transformation) :
17  CallbackGatherXThetasAbstractBase ((modelExport.pointsSelectionFunctions() ==
18  EXPORT_POINTS_SELECTION_FUNCTIONS_INTERPOLATE_FIRST_CURVE),
19  modelExport.extrapolateOutsideEndpoints (),
20  curvesIncluded,
21  transformation)
22 {
23 }
24 
25 CallbackSearchReturn CallbackGatherXThetasInCurves::callback (const QString &curveName,
26  const Point &point)
27 {
28  LOG4CPP_DEBUG_S ((*mainCat)) << "CallbackGatherXThetasInCurves::callback"
29  << " curveName=" << curveName.toLatin1().data()
30  << " point=" << point.identifier().toLatin1().data();
31 
32  updateMinMax (curveName,
33  point);
34 
35  if (curvesIncludedHash ().contains (curveName)) {
36 
37  QPointF posGraph;
39  posGraph);
40  addGraphX (posGraph.x ());
41  }
42 
43  return CALLBACK_SEARCH_RETURN_CONTINUE;
44 }
void transformScreenToRawGraph(const QPointF &coordScreen, QPointF &coordGraph) const
Transform from cartesian pixel screen coordinates to cartesian/polar graph coordinates.
virtual CallbackSearchReturn callback(const QString &curveName, const Point &point)
Callback method.
Model for DlgSettingsExportFormat and CmdSettingsExportFormat.
Base callback for collecting X/Theta independent variables, for functions, in preparation for exporti...
CallbackGatherXThetasInCurves(const DocumentModelExportFormat &modelExport, const QStringList &curvesIncluded, const Transformation &transformation)
Single constructor.
void updateMinMax(const QString &curveName, const Point &point)
Update the tracked min and max values for each curve.
Class that represents one digitized point. The screen-to-graph coordinate transformation is always ex...
Definition: Point.h:25
QPointF posScreen() const
Accessor for screen position.
Definition: Point.cpp:404
void addGraphX(double xGraph)
Save one graph x value.
CurvesIncludedHash curvesIncludedHash() const
Get method for included names as hash.
QString identifier() const
Unique identifier for a specific Point.
Definition: Point.cpp:268
Affine transformation between screen and graph coordinates, based on digitized axis points...
const Transformation & transformation() const
Get method for transformation.