Engauge Digitizer  2
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
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
CurveLimits curveLimitsMin() const
Endpoint minima for each curve, if extrapolation has been disabled.
Base callback for collecting X/Theta independent variables, for functions, in preparation for exporti...
ValuesVectorXOrY xThetaValuesRaw() const
Resulting x/theta values for all included functions.
void updateMinMax(const QString &curveName, const Point &point)
Update the tracked min and max values for each curve.
QHash< QString, double > CurveLimits
Definition: CurveLimits.h:14
Class that represents one digitized point. The screen-to-graph coordinate transformation is always ex...
Definition: Point.h:25
void addGraphX(double xGraph)
Save one graph x value.
CurvesIncludedHash curvesIncludedHash() const
Get method for included names as hash.
QHash< QString, bool > CurvesIncludedHash
CallbackSearchReturn
Return values for search callback methods.
Affine transformation between screen and graph coordinates, based on digitized axis points...
const Transformation & transformation() const
Get method for transformation.
virtual CallbackSearchReturn callback(const QString &curveName, const Point &point)=0
Callback method.
CurveLimits curveLimitsMax() const
Endpoint maxima for each curve, if extrapolation has been disabled.
QStringList curvesIncluded() const
Get method for included names.
QMap< double, bool > ValuesVectorXOrY