Engauge Digitizer 2
Loading...
Searching...
No Matches
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
11#include "Curve.h"
12#include <QList>
13#include <QStringList>
14
15class CurveStyles;
16class Point;
17class QXmlStreamReader;
18class QXmlStreamWriter;
19class Transformation;
20
21typedef QList<Curve> CurveList;
22
25{
26public:
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 iterateThroughCurvePoints (const QString &curveNameWanted,
49 const Functor2wRet<const QString &, const Point &, CallbackSearchReturn> &ftorWithCallback);
50
52 void iterateThroughCurveSegments (const QString &curveNameWanted,
53 const Functor2wRet<const Point &, const Point &, CallbackSearchReturn> &ftorWithCallback) const;
54
56 void iterateThroughCurvesPoints (const Functor2wRet<const QString &, const Point &, CallbackSearchReturn> &ftorWithCallback);
57
59 void iterateThroughCurvesPoints (const Functor2wRet<const QString &, const Point &, CallbackSearchReturn> &ftorWithCallback) const;
60
62 void loadPreVersion6 (QDataStream &str);
63
65 void loadXml(QXmlStreamReader &reader);
66
68 int numCurves () const;
69
71 void printStream (QString indentation,
72 QTextStream &str) const;
73
75 void removePoint (const QString &pointIdentifier);
76
78 void saveXml(QXmlStreamWriter &writer) const;
79
81 void updatePointOrdinals (const Transformation &transformation);
82
83private:
84
85 CurveList m_curvesGraphs;
86};
87
88#endif // CURVES_GRAPHS_H
Model for DlgSettingsCurveProperties and CmdSettingsCurveProperties.
Definition CurveStyles.h:23
Container for one set of digitized Points.
Definition Curve.h:33
Container for all graph curves. The axes point curve is external to this class.
void saveXml(QXmlStreamWriter &writer) const
Serialize curves.
Curve * curveForCurveName(const QString &curveName)
Return the axis or graph curve for the specified curve name.
void addGraphCurveAtEnd(Curve curve)
Append new graph Curve to end of Curve list.
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.
void loadXml(QXmlStreamReader &reader)
Load from serialized xml post-version 5 file.
int numCurves() const
Current number of graphs curves.
void loadPreVersion6(QDataStream &str)
Load from serialized binary pre-version 6 file.
void printStream(QString indentation, QTextStream &str) const
Debugging method that supports print method of this class and printStream method of some other class(...
void updatePointOrdinals(const Transformation &transformation)
Update point ordinals to be consistent with their CurveStyle and x/theta coordinate.
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.
void removePoint(const QString &pointIdentifier)
Remove the Point from its Curve.
QStringList curvesGraphsNames() const
List of graph curve names.
void addPoint(const Point &point)
Append new Point to the specified Curve.
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:24
Affine transformation between screen and graph coordinates, based on digitized axis points.