Engauge Digitizer  2
 All Classes Functions Variables Enumerations Friends Pages
CurvesGraphs.h
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 #ifndef CURVES_GRAPHS_H
8 #define CURVES_GRAPHS_H
9 
10 #include "CallbackSearchReturn.h"
11 #include "Curve.h"
12 #include <QList>
13 #include <QStringList>
14 
15 class CurveStyles;
16 class Point;
17 class QXmlStreamReader;
18 class QXmlStreamWriter;
19 class Transformation;
20 
21 typedef QList<Curve> CurveList;
22 
25 {
26 public:
27  CurvesGraphs();
28 
30  void addGraphCurveAtEnd (Curve curve);
31 
33  void addPoint (const Point &point);
34 
36  Curve *curveForCurveName (const QString &curveName);
37 
39  const Curve *curveForCurveName (const QString &curveName) const;
40 
42  QStringList curvesGraphsNames () const;
43 
45  int curvesGraphsNumPoints (const QString &curveName) const;
46 
48  void editPointGraph (bool isX,
49  bool isY,
50  double x,
51  double y,
52  const QStringList &identifiers,
53  const Transformation &transformation);
54 
56  void iterateThroughCurvePoints (const QString &curveNameWanted,
57  const Functor2wRet<const QString &, const Point &, CallbackSearchReturn> &ftorWithCallback);
58 
60  void iterateThroughCurveSegments (const QString &curveNameWanted,
61  const Functor2wRet<const Point &, const Point &, CallbackSearchReturn> &ftorWithCallback) const;
62 
64  void iterateThroughCurvesPoints (const Functor2wRet<const QString &, const Point &, CallbackSearchReturn> &ftorWithCallback);
65 
67  void iterateThroughCurvesPoints (const Functor2wRet<const QString &, const Point &, CallbackSearchReturn> &ftorWithCallback) const;
68 
70  void loadPreVersion6 (QDataStream &str);
71 
73  void loadXml(QXmlStreamReader &reader);
74 
76  int numCurves () const;
77 
79  void printStream (QString indentation,
80  QTextStream &str) const;
81 
83  void removePoint (const QString &pointIdentifier);
84 
86  void saveXml(QXmlStreamWriter &writer) const;
87 
89  void updatePointOrdinals (const Transformation &transformation);
90 
91 private:
92 
93  CurveList m_curvesGraphs;
94 };
95 
96 #endif // CURVES_GRAPHS_H
void saveXml(QXmlStreamWriter &writer) const
Serialize curves.
void printStream(QString indentation, QTextStream &str) const
Debugging method that supports print method of this class and printStream method of some other class(...
void loadXml(QXmlStreamReader &reader)
Load from serialized xml post-version 5 file.
Model for DlgSettingsCurveProperties and CmdSettingsCurveProperties.
Definition: CurveStyles.h:22
void iterateThroughCurveSegments(const QString &curveNameWanted, const Functor2wRet< const Point &, const Point &, CallbackSearchReturn > &ftorWithCallback) const
Apply functor to segments on the specified axis or graph Curve.
Curve * curveForCurveName(const QString &curveName)
Return the axis or graph curve for the specified curve name.
int numCurves() const
Current number of graphs curves.
void addGraphCurveAtEnd(Curve curve)
Append new graph Curve to end of Curve list.
void iterateThroughCurvesPoints(const Functor2wRet< const QString &, const Point &, CallbackSearchReturn > &ftorWithCallback)
Apply functor to Points on all of the Curves.
Class that represents one digitized point. The screen-to-graph coordinate transformation is always ex...
Definition: Point.h:23
void editPointGraph(bool isX, bool isY, double x, double y, const QStringList &identifiers, const Transformation &transformation)
Set the x and/or y coordinate values of the specified points.
Affine transformation between screen and graph coordinates, based on digitized axis points...
void addPoint(const Point &point)
Append new Point to the specified Curve.
Container for all graph curves. The axes point curve is external to this class.
Definition: CurvesGraphs.h:24
void iterateThroughCurvePoints(const QString &curveNameWanted, const Functor2wRet< const QString &, const Point &, CallbackSearchReturn > &ftorWithCallback)
Apply functor to Points in the specified axis or graph Curve.
int curvesGraphsNumPoints(const QString &curveName) const
Point count.
Container for one set of digitized Points.
Definition: Curve.h:33
void updatePointOrdinals(const Transformation &transformation)
Update point ordinals to be consistent with their CurveStyle and x/theta coordinate.
void loadPreVersion6(QDataStream &str)
Load from serialized binary pre-version 6 file.
QStringList curvesGraphsNames() const
List of graph curve names.
void removePoint(const QString &pointIdentifier)
Remove the Point from its Curve.