Engauge Digitizer  2
CallbackAddPointsInCurvesGraphs.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 "CallbackAddPointsInCurvesGraphs.h"
8 #include "CoordSystem.h"
9 
10 extern const QString AXIS_CURVE_NAME;
11 
13  m_coordSystem (coordSystem)
14 {
15 }
16 
17 CallbackSearchReturn CallbackAddPointsInCurvesGraphs::callback (const QString &curveName,
18  const Point &point)
19 {
20  const QString identifier = point.identifier ();
21 
22  if (curveName == AXIS_CURVE_NAME) {
23  m_coordSystem.addPointAxisWithSpecifiedIdentifier (point.posScreen (),
24  point.posGraph (),
25  identifier,
26  point.ordinal (),
27  point.isXOnly ());
28  } else {
29  m_coordSystem.addPointGraphWithSpecifiedIdentifier (curveName,
30  point.posScreen (),
31  identifier,
32  point.ordinal ());
33  }
34 
35  return CALLBACK_SEARCH_RETURN_CONTINUE;
36 }
bool isXOnly() const
In DOCUMENT_AXES_POINTS_REQUIRED_4 modes, this is true/false if y/x coordinate is undefined...
Definition: Point.cpp:274
Storage of data belonging to one coordinate system.
Definition: CoordSystem.h:42
Class that represents one digitized point. The screen-to-graph coordinate transformation is always ex...
Definition: Point.h:23
QPointF posScreen() const
Accessor for screen position.
Definition: Point.cpp:392
double ordinal(ApplyHasCheck applyHasCheck=KEEP_HAS_CHECK) const
Get method for ordinal. Skip check if copying one instance to another.
Definition: Point.cpp:374
CallbackAddPointsInCurvesGraphs(CoordSystem &coordSystem)
Single constructor.
QString identifier() const
Unique identifier for a specific Point.
Definition: Point.cpp:256
virtual void addPointAxisWithSpecifiedIdentifier(const QPointF &posScreen, const QPointF &posGraph, const QString &identifier, double ordinal, bool isXOnly)
Add a single axis point with the specified point identifier.
Definition: CoordSystem.cpp:94
QPointF posGraph(ApplyHasCheck applyHasCheck=KEEP_HAS_CHECK) const
Accessor for graph position. Skip check if copying one instance to another.
Definition: Point.cpp:383
CallbackSearchReturn callback(const QString &curveName, const Point &point)
Callback method.
virtual void addPointGraphWithSpecifiedIdentifier(const QString &curveName, const QPointF &posScreen, const QString &identifier, double ordinal)
Add a single graph point with the specified point identifer. Note that PointStyle is not applied to t...