Engauge Digitizer  2
CallbackCheckAddPointAxis.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 "CallbackCheckAddPointAxis.h"
8 #include "Curve.h"
9 #include "Point.h"
10 
11 extern const QString AXIS_CURVE_NAME;
12 
14  const QPointF &posScreen,
15  const QPointF &posGraph,
16  DocumentAxesPointsRequired documentAxesPointsRequired,
17  bool isXOnly) :
18  CallbackAxisPointsAbstract (modelCoords,
19  documentAxesPointsRequired)
20 {
21  // Insert an extra Point as if it already was in the axes curve. This is done before iterating rather
22  // than after since there is no safe place to do this afterwards (isError and errorMessage may be called more than once)
23  Point point (AXIS_CURVE_NAME,
24  posScreen,
25  posGraph,
26  isXOnly);
27 
28  callback (AXIS_CURVE_NAME,
29  point);
30 }
31 
33 {
35 }
36 
38 {
40 }
bool isError() const
True if an error occurred during iteration.
CallbackCheckAddPointAxis(const DocumentModelCoords &modelCoords, const QPointF &posScreen, const QPointF &posGraph, DocumentAxesPointsRequired documentAxesPointsRequired, bool isXOnly)
Single constructor.
QString errorMessage() const
Error message that explains the problem indicated by isError.
Class that represents one digitized point. The screen-to-graph coordinate transformation is always ex...
Definition: Point.h:23
QString errorMessage() const
This value is checked after iterating to see what was wrong if the axis data was incorrect.
Model for DlgSettingsCoords and CmdSettingsCoords.
bool isError() const
This value is checked after iterating to see if the axis data is correct.
Callback for collecting axis points and then performing common calculations on those axis points...
CallbackSearchReturn callback(const QString &curveName, const Point &point)
Callback method.