16#include <QXmlStreamWriter>
26 m_curvesGraphs.push_back (curve);
40 CurveList::iterator itr;
41 for (itr = m_curvesGraphs.begin (); itr != m_curvesGraphs.end (); itr++) {
55 CurveList::const_iterator itr;
56 for (itr = m_curvesGraphs.begin (); itr != m_curvesGraphs.end (); itr++) {
58 const Curve &curve = *itr;
71 CurveList::const_iterator itr;
72 for (itr = m_curvesGraphs.begin (); itr != m_curvesGraphs.end (); itr++) {
74 const Curve &curve = *itr;
84 CurveList::const_iterator itr;
85 for (itr = m_curvesGraphs.begin (); itr != m_curvesGraphs.end (); itr++) {
87 const Curve &curve = *itr;
100 const QStringList &identifiers,
103 CurveList::iterator itr;
104 for (itr = m_curvesGraphs.begin (); itr != m_curvesGraphs.end (); itr++) {
117 const Functor2wRet<const QString &, const Point &, CallbackSearchReturn> &ftorWithCallback)
120 CurveList::const_iterator itr;
121 for (itr = m_curvesGraphs.begin (); itr != m_curvesGraphs.end (); itr++) {
123 const Curve &curve = *itr;
124 if (curve.
curveName () == curveNameWanted) {
135 const Functor2wRet<const Point &, const Point &, CallbackSearchReturn> &ftorWithCallback)
const
138 CurveList::const_iterator itr;
139 for (itr = m_curvesGraphs.begin (); itr != m_curvesGraphs.end (); itr++) {
141 const Curve &curve = *itr;
142 if (curve.
curveName () == curveNameWanted) {
154 CurveList::const_iterator itr;
155 for (itr = m_curvesGraphs.begin (); itr != m_curvesGraphs.end (); itr++) {
157 const Curve &curve = *itr;
164 CurveList::const_iterator itr;
165 for (itr = m_curvesGraphs.begin (); itr != m_curvesGraphs.end (); itr++) {
167 const Curve &curve = *itr;
179 m_curvesGraphs.clear();
181 qint32 numberCurvesGraphs;
182 str >> numberCurvesGraphs;
183 for (i = 0; i < numberCurvesGraphs; i++) {
185 m_curvesGraphs.append (curve);
188 qint32 numberCurvesMeasures;
189 str >> numberCurvesMeasures;
190 for (i = 0; i < numberCurvesMeasures; i++) {
204 m_curvesGraphs.clear();
207 while ((reader.tokenType() != QXmlStreamReader::EndElement) ||
211 if (reader.atEnd()) {
216 if ((reader.tokenType() == QXmlStreamReader::StartElement) &&
219 Curve curve (reader);
223 QString DUPLICATE = QString (
"-%1").arg (QObject::tr (
"DUPLICATE"));
226 curveName += DUPLICATE;
231 m_curvesGraphs.push_back (curve);
237 reader.raiseError (QObject::tr (
"Cannot read graph curves data"));
243 return m_curvesGraphs.count ();
247 QTextStream &str)
const
249 str << indentation <<
"CurvesGraphs\n";
253 CurveList::const_iterator itr;
254 for (itr = m_curvesGraphs.begin (); itr != m_curvesGraphs.end (); itr++) {
256 const Curve &curve = *itr;
276 CurveList::const_iterator itr;
277 for (itr = m_curvesGraphs.begin (); itr != m_curvesGraphs.end (); itr++) {
279 const Curve &curve = *itr;
283 writer.writeEndElement();
290 CurveList::iterator itr;
291 for (itr = m_curvesGraphs.begin (); itr != m_curvesGraphs.end (); itr++) {
const QString DOCUMENT_SERIALIZE_CURVES_GRAPHS
const QString DOCUMENT_SERIALIZE_CURVE
#define ENGAUGE_ASSERT(cond)
Drop in replacement for Q_ASSERT if defined(QT_NO_DEBUG) && !defined(QT_FORCE_ASSERTS) define ENGAUGE...
log4cpp::Category * mainCat
const QString INDENTATION_DELTA
QXmlStreamReader::TokenType loadNextFromReader(QXmlStreamReader &reader)
Load next token from xml reader.
Container for one set of digitized Points.
void saveXml(QXmlStreamWriter &writer) const
Serialize curve.
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)
See CurveGraphs::updatePointOrdinals.
void removePoint(const QString &identifier)
Perform the opposite of addPointAtEnd.
void addPoint(const Point &point)
Add Point to this Curve.
void setCurveName(const QString &curveName)
Change the curve name.
QString curveName() const
Name of this Curve.
void iterateThroughCurvePoints(const Functor2wRet< const QString &, const Point &, CallbackSearchReturn > &ftorWithCallback) const
Apply functor to Points on Curve.
void iterateThroughCurveSegments(const Functor2wRet< const Point &, const Point &, CallbackSearchReturn > &ftorWithCallback) const
Apply functor to successive Points, as line segments, on Curve. This could be a bit slow.
void editPointGraph(bool isX, bool isY, double x, double y, const QStringList &identifiers, const Transformation &transformation)
Edit the graph coordinates of one or more graph points. This method does not apply to an axis point.
int numPoints() const
Number of points.
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...
static QString curveNameFromPointIdentifier(const QString &pointIdentifier)
Parse the curve name from the specified point identifier. This does the opposite of uniqueIdentifierG...
QString identifier() const
Unique identifier for a specific Point.
#define LOG4CPP_INFO_S(logger)