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