Engauge Digitizer  2
 All Classes Files Functions Variables Enumerations Enumerator Friends Pages
CallbackAxisPointsAbstract.h
1 #ifndef CALLBACK_AXIS_POINTS_ABSTRACT
2 #define CALLBACK_AXIS_POINTS_ABSTRACT
3 
4 #include "CallbackSearchReturn.h"
5 #include "DocumentModelCoords.h"
6 #include <QString>
7 #include <QTransform>
8 
9 class Point;
10 
25 {
27  friend class TestGraphCoords;
28 
29 public:
32 
35  const QString pointIdentifierOverride,
36  const QPointF &posGraphOverride,
37  const QPointF &posScreenOverride);
38 
40  CallbackSearchReturn callback (const QString &curveName,
41  const Point &point);
42 
45  QTransform matrixGraph () const;
46 
49  QTransform matrixScreen () const;
50 
52  double xGraphRange () const { return m_xGraphHigh - m_xGraphLow; }
53 
55  double yGraphRange () const { return m_yGraphHigh - m_yGraphLow; }
56 
57 protected:
58 
60  QString errorMessage () const { return m_errorMessage; }
61 
64  bool isError () const { return m_isError; }
65 
67  unsigned int numberAxisPoints () const { return m_numberAxisPoints; }
68 
69 private:
70 
71  bool anyColumnsRepeat (double m [3] [3], int numberColumns);
72  bool threePointsAreCollinear (double m [3] [3], int numberColumns);
73 
74  // Coordinates information that will be applied to the coordinates before they are used to compute the transformation
75  DocumentModelCoords m_modelCoords;
76 
77  // For overriding one existing Point. Identifier is empty for no overriding
78  QString m_pointIdentifierOverride;
79  QPointF m_posScreenOverride;
80  QPointF m_posGraphOverride;
81 
82  int m_numberAxisPoints;
83  QTransform m_screenInputs;
84  QTransform m_graphOutputs;
85 
86  bool m_isError;
87  QString m_errorMessage;
88 
89  // For computing the ranges of the graph coordinates
90  double m_xGraphLow;
91  double m_yGraphLow;
92  double m_xGraphHigh;
93  double m_yGraphHigh;
94 };
95 
96 #endif // CALLBACK_AXIS_POINTS_ABSTRACT
QTransform matrixGraph() const
Returns graph coordinates matrix after transformIsDefined has already indicated success.
Unit tests of graph coordinate sanity checking.
Class that represents one digitized point. The screen-to-graph coordinate transformation is always ex...
Definition: Point.h:17
CallbackSearchReturn
Return values for search callback methods.
CallbackAxisPointsAbstract(const DocumentModelCoords &modelCoords)
Constructor for when all of the existing axis points are to be processed as is.
double xGraphRange() const
Return the range of the x graph coordinate from low to high, after the transform is defined...
Model for DlgSettingsCoords and CmdSettingsCoords.
bool isError() const
This value is checked after iterating to see if the axis data is correct.
unsigned int numberAxisPoints() const
Number of axis points which is less than 3 if the axes curve is incomplete.
double yGraphRange() const
Return the range of the y graph coordinate from low to high, after the transform is defined...
Callback for collecting axis points and then performing common calculations on those axis points...
QString errorMessage() const
This value is checked after iterating to see what was wrong if the axis data was incorrect.
CallbackSearchReturn callback(const QString &curveName, const Point &point)
Callback method.
QTransform matrixScreen() const
Returns screen coordinates matrix after transformIsDefined has already indicated success.