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) {
132 << curveNameWanted.toLatin1().data();
137 const Functor2wRet<const Point &, const Point &, CallbackSearchReturn> &ftorWithCallback)
const
140 CurveList::const_iterator itr;
141 for (itr = m_curvesGraphs.begin (); itr != m_curvesGraphs.end (); itr++) {
143 const Curve &curve = *itr;
144 if (curve.
curveName () == curveNameWanted) {
152 << curveNameWanted.toLatin1().data();
158 CurveList::const_iterator itr;
159 for (itr = m_curvesGraphs.begin (); itr != m_curvesGraphs.end (); itr++) {
161 const Curve &curve = *itr;
168 CurveList::const_iterator itr;
169 for (itr = m_curvesGraphs.begin (); itr != m_curvesGraphs.end (); itr++) {
171 const Curve &curve = *itr;
183 m_curvesGraphs.clear();
185 qint32 numberCurvesGraphs;
186 str >> numberCurvesGraphs;
187 for (i = 0; i < numberCurvesGraphs; i++) {
189 m_curvesGraphs.append (curve);
192 qint32 numberCurvesMeasures;
193 str >> numberCurvesMeasures;
194 for (i = 0; i < numberCurvesMeasures; i++) {
208 m_curvesGraphs.clear();
211 while ((reader.tokenType() != QXmlStreamReader::EndElement) ||
215 if (reader.atEnd()) {
220 if ((reader.tokenType() == QXmlStreamReader::StartElement) &&
223 Curve curve (reader);
227 QString DUPLICATE = QString (
"-%1").arg (QObject::tr (
"DUPLICATE"));
230 curveName += DUPLICATE;
235 m_curvesGraphs.push_back (curve);
241 reader.raiseError (QObject::tr (
"Cannot read graph curves data"));
247 return m_curvesGraphs.count ();
251 QTextStream &str)
const
253 str << indentation <<
"CurvesGraphs\n";
257 CurveList::const_iterator itr;
258 for (itr = m_curvesGraphs.begin (); itr != m_curvesGraphs.end (); itr++) {
260 const Curve &curve = *itr;
280 CurveList::const_iterator itr;
281 for (itr = m_curvesGraphs.begin (); itr != m_curvesGraphs.end (); itr++) {
283 const Curve &curve = *itr;
287 writer.writeEndElement();
294 CurveList::iterator itr;
295 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.
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)
#define LOG4CPP_ERROR_S(logger)