Engauge Digitizer  2
CallbackGatherXThetasAbstractBase.h
Go to the documentation of this file.
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 #ifndef CALLBACK_GATHER_X_THETAS_ABSTRACT_BASE_H
8 #define CALLBACK_GATHER_X_THETAS_ABSTRACT_BASE_H
9 
10 #include "CallbackSearchReturn.h"
11 #include "CurveLimits.h"
12 #include "CurvesIncludedHash.h"
13 #include "ExportValuesXOrY.h"
14 #include "Transformation.h"
15 #include "ValuesVectorXOrY.h"
16 
17 class Point;
18 
21 {
22 public:
24  CallbackGatherXThetasAbstractBase(bool firstCurveOnly,
25  bool extrapolateOutsideEndpoints,
26  const QStringList &curvesIncluded,
29 
31  virtual CallbackSearchReturn callback (const QString &curveName,
32  const Point &point) = 0;
33 
35  CurveLimits curveLimitsMax () const;
36 
38  CurveLimits curveLimitsMin () const;
39 
42 
43 protected:
44 
46  void addGraphX (double xGraph);
47 
49  QStringList curvesIncluded () const;
50 
53 
55  const Transformation &transformation() const;
56 
58  void updateMinMax (const QString &curveName,
59  const Point &point);
60 
61 private:
63 
64  bool m_extrapolateOutsideEndpoints;
65  QStringList m_curvesIncluded;
66  const Transformation m_transformation;
67  CurvesIncludedHash m_curvesIncludedHash;
68  ValuesVectorXOrY m_xThetaValues;
69 
70  // Curve limits that may or may not be merged into m_xThetaValues
71  CurveLimits m_curveLimitsMin;
72  CurveLimits m_curveLimitsMax;
73 };
74 
75 #endif // CALLBACK_GATHER_X_THETAS_ABSTRACT_BASE_H
CallbackGatherXThetasAbstractBase::updateMinMax
void updateMinMax(const QString &curveName, const Point &point)
Update the tracked min and max values for each curve.
Definition: CallbackGatherXThetasAbstractBase.cpp:75
ExportValuesXOrY.h
CallbackGatherXThetasAbstractBase::transformation
const Transformation & transformation() const
Get method for transformation.
Definition: CallbackGatherXThetasAbstractBase.cpp:70
CallbackGatherXThetasAbstractBase::curveLimitsMax
CurveLimits curveLimitsMax() const
Endpoint maxima for each curve, if extrapolation has been disabled.
Definition: CallbackGatherXThetasAbstractBase.cpp:50
CallbackSearchReturn
CallbackSearchReturn
Return values for search callback methods.
Definition: CallbackSearchReturn.h:17
CallbackGatherXThetasAbstractBase::addGraphX
void addGraphX(double xGraph)
Save one graph x value.
Definition: CallbackGatherXThetasAbstractBase.cpp:45
CallbackGatherXThetasAbstractBase::xThetaValuesRaw
ValuesVectorXOrY xThetaValuesRaw() const
Resulting x/theta values for all included functions.
Definition: CallbackGatherXThetasAbstractBase.cpp:102
CallbackGatherXThetasAbstractBase
Base callback for collecting X/Theta independent variables, for functions, in preparation for exporti...
Definition: CallbackGatherXThetasAbstractBase.h:19
ValuesVectorXOrY.h
Transformation
Affine transformation between screen and graph coordinates, based on digitized axis points.
Definition: Transformation.h:30
CurveLimits.h
CallbackGatherXThetasAbstractBase::~CallbackGatherXThetasAbstractBase
virtual ~CallbackGatherXThetasAbstractBase()
Definition: CallbackGatherXThetasAbstractBase.cpp:41
CallbackGatherXThetasAbstractBase::callback
virtual CallbackSearchReturn callback(const QString &curveName, const Point &point)=0
Callback method.
CurvesIncludedHash.h
CurvesIncludedHash
QHash< QString, bool > CurvesIncludedHash
Definition: CurvesIncludedHash.h:13
Transformation.h
CurveLimits
QHash< QString, double > CurveLimits
Definition: CurveLimits.h:13
CallbackGatherXThetasAbstractBase::curvesIncludedHash
CurvesIncludedHash curvesIncludedHash() const
Get method for included names as hash.
Definition: CallbackGatherXThetasAbstractBase.cpp:65
CallbackSearchReturn.h
CallbackGatherXThetasAbstractBase::curvesIncluded
QStringList curvesIncluded() const
Get method for included names.
Definition: CallbackGatherXThetasAbstractBase.cpp:60
Point
Class that represents one digitized point. The screen-to-graph coordinate transformation is always ex...
Definition: Point.h:24
CallbackGatherXThetasAbstractBase::curveLimitsMin
CurveLimits curveLimitsMin() const
Endpoint minima for each curve, if extrapolation has been disabled.
Definition: CallbackGatherXThetasAbstractBase.cpp:55
ValuesVectorXOrY
QMap< double, bool > ValuesVectorXOrY
Definition: ValuesVectorXOrY.h:13