Engauge Digitizer 2
Loading...
Searching...
No Matches
CurvesGraphs.h
Go to the documentation of this file.
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 (const 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
91private:
92
93 CurveList m_curvesGraphs;
94};
95
96#endif // CURVES_GRAPHS_H
QList< Curve > CurveList
Model for DlgSettingsCurveProperties and CmdSettingsCurveProperties.
Definition CurveStyles.h:23
Container for one set of digitized Points.
Definition Curve.h:34
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 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 addGraphCurveAtEnd(const Curve &curve)
Append new graph Curve to end of Curve list.
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 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.
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:26
Affine transformation between screen and graph coordinates, based on digitized axis points.