Engauge Digitizer  2
Curve.cpp
1 #include "Curve.h"
2 #include "CurvesGraphs.h"
3 #include "CurveStyle.h"
4 #include "DocumentSerialize.h"
5 #include "EngaugeAssert.h"
6 #include "Logger.h"
7 #include "MigrateToVersion6.h"
8 #include "Point.h"
9 #include "PointComparator.h"
10 #include <QDataStream>
11 #include <QDebug>
12 #include <QMap>
13 #include <QTextStream>
14 #include <QXmlStreamReader>
15 #include <QXmlStreamWriter>
16 #include "Transformation.h"
17 #include "Xml.h"
18 
19 const QString AXIS_CURVE_NAME ("Axes");
20 const int AXIS_CURVE_ORDINAL = 0;
21 const QString DEFAULT_GRAPH_CURVE_NAME ("Curve1");
22 const QString DUMMY_CURVE_NAME ("dummy");
23 const QString TAB_DELIMITER ("\t");
24 
25 typedef QMap<double, QString> XOrThetaToPointIdentifier;
26 
27 Curve::Curve(const QString &curveName,
28  const ColorFilterSettings &colorFilterSettings,
29  const CurveStyle &curveStyle) :
30  m_curveName (curveName),
31  m_colorFilterSettings (colorFilterSettings),
32  m_curveStyle (curveStyle)
33 {
34 }
35 
36 Curve::Curve (const Curve &curve) :
37  m_curveName (curve.curveName ()),
38  m_points (curve.points ()),
39  m_colorFilterSettings (curve.colorFilterSettings ()),
40  m_curveStyle (curve.curveStyle ())
41 {
42 }
43 
44 Curve::Curve (QDataStream &str)
45 {
46  MigrateToVersion6 migrate;
47 
48  qint32 int32, xScreen, yScreen;
49  double xGraph, yGraph;
50 
51  str >> m_curveName;
52  str >> int32;
53  m_curveStyle.setPointShape(migrate.pointShape (int32));
54  str >> int32;
55  m_curveStyle.setPointRadius(int32);
56  str >> int32;
57  m_curveStyle.setPointLineWidth (int32);
58  str >> int32;
59  m_curveStyle.setPointColor(migrate.colorPalette (int32));
60  str >> int32; // Point interior color
61  str >> int32;
62  m_curveStyle.setLineWidth(int32);
63  str >> int32;
64  if (m_curveName == AXIS_CURVE_NAME) {
65  m_curveStyle.setLineColor(migrate.colorPalette (int32));
66  } else {
67  m_curveStyle.setLineColor(COLOR_PALETTE_TRANSPARENT);
68  }
69  str >> int32;
70  m_curveStyle.setLineConnectAs(migrate.curveConnectAs (int32));
71 
72  str >> int32;
73  int count = int32;
74  int ordinal = 0;
75  for (int i = 0; i < count; i++) {
76 
77  str >> xScreen;
78  str >> yScreen;
79  str >> xGraph;
80  str >> yGraph;
81  if (m_curveName == AXIS_CURVE_NAME) {
82 
83  // Axis point, with graph coordinates set by user and managed here
84  Point point (m_curveName,
85  QPointF (xScreen, yScreen),
86  QPointF (xGraph, yGraph),
87  ordinal++);
88 
89  addPoint(point);
90  } else {
91 
92  // Curve point, with graph coordinates managed elsewhere
93  Point point (m_curveName,
94  QPointF (xScreen, yScreen));
95  point.setOrdinal (ordinal++);
96 
97  addPoint(point);
98  }
99  }
100 }
101 
102 Curve::Curve (QXmlStreamReader &reader)
103 {
104  loadXml(reader);
105 }
106 
108 {
109  m_curveName = curve.curveName ();
110  m_points = curve.points ();
111  m_colorFilterSettings = curve.colorFilterSettings ();
112  m_curveStyle = curve.curveStyle ();
113 
114  return *this;
115 }
116 
117 void Curve::addPoint (Point point)
118 {
119  m_points.push_back (point);
120 }
121 
123 {
124  return m_colorFilterSettings;
125 }
126 
127 QString Curve::curveName () const
128 {
129  return m_curveName;
130 }
131 
133 {
134  return m_curveStyle;
135 }
136 
137 void Curve::editPoint (const QPointF &posGraph,
138  const QString &identifier)
139 {
140  // Search for the point with matching identifier
141  QList<Point>::iterator itr;
142  for (itr = m_points.begin (); itr != m_points.end (); itr++) {
143 
144  Point &point = *itr;
145  if (point.identifier () == identifier) {
146 
147  point.setPosGraph (posGraph);
148  break;
149 
150  }
151  }
152 }
153 
154 void Curve::exportToClipboard (const QHash<QString, bool> &selectedHash,
155  const Transformation &transformation,
156  QTextStream &strCsv,
157  QTextStream &strHtml,
158  CurvesGraphs &curvesGraphs) const
159 {
160  LOG4CPP_INFO_S ((*mainCat)) << "Curve::exportToClipboard"
161  << " hashCount=" << selectedHash.count();
162 
163  // This method assumes Copy is only allowed when Transformation is valid
164 
165  bool isFirst = true;
166  QList<Point>::const_iterator itr;
167  for (itr = m_points.begin (); itr != m_points.end (); itr++) {
168 
169  const Point &point = *itr;
170  if (selectedHash.contains (point.identifier ())) {
171 
172  if (isFirst) {
173 
174  // Insert headers to identify the points that follow
175  isFirst = false;
176  strCsv << "X" << TAB_DELIMITER << m_curveName << "\n";
177  strHtml << "<table>\n"
178  << "<tr><th>X</th><th>" << m_curveName << "</th></tr>\n";
179  }
180 
181  // Default curve style
182  CurveStyle curveStyleDefault;
183  curveStyleDefault.setLineStyle(LineStyle::defaultAxesCurve());
184  curveStyleDefault.setPointStyle(PointStyle::defaultGraphCurve (curvesGraphs.numCurves ()));
185 
186  // Check if this curve already exists from a previously exported point
187  if (curvesGraphs.curveForCurveName (m_curveName) == 0) {
188  Curve curve(m_curveName,
190  curveStyleDefault);
191  curvesGraphs.addGraphCurveAtEnd(curve);
192  }
193 
194  // Start with screen coordinates
195  QPointF pos = point.posScreen();
196  if (transformation.transformIsDefined()) {
197 
198  // Replace with graph coordinates which are almost always more useful
199  QPointF posGraph;
200  transformation.transformScreenToRawGraph(pos,
201  posGraph);
202  pos = posGraph;
203  }
204 
205  // Add point to text going to clipboard
206  strCsv << pos.x() << TAB_DELIMITER << pos.y() << "\n";
207  strHtml << "<tr><td>" << pos.x() << "</td><td>" << pos.y() << "</td></tr>\n";
208 
209  // Add point to list for undo/redo
210  curvesGraphs.curveForCurveName (m_curveName)->addPoint (point);
211  }
212  }
213 
214  if (!isFirst) {
215  strHtml << "</table>\n";
216  }
217 }
218 
219 void Curve::iterateThroughCurvePoints (const Functor2wRet<const QString &, const Point&, CallbackSearchReturn> &ftorWithCallback) const
220 {
221  QList<Point>::const_iterator itr;
222  for (itr = m_points.begin (); itr != m_points.end (); itr++) {
223 
224  const Point &point = *itr;
225 
226  CallbackSearchReturn rtn = ftorWithCallback (m_curveName, point);
227 
229  break;
230  }
231  }
232 }
233 
234 void Curve::iterateThroughCurveSegments (const Functor2wRet<const Point&, const Point&, CallbackSearchReturn> &ftorWithCallback) const
235 {
236  // Loop through Points. They are assumed to be already sorted by their ordinals, but we do NOT
237  // check the ordinal ordering since this could be called before, or while, the ordinal sorting is done
238  QList<Point>::const_iterator itr;
239  const Point *pointBefore = 0;
240  for (itr = m_points.begin(); itr != m_points.end(); itr++) {
241 
242  const Point &point = *itr;
243 
244  if (pointBefore != 0) {
245 
246  CallbackSearchReturn rtn = ftorWithCallback (*pointBefore,
247  point);
248 
250  break;
251  }
252 
253  }
254  pointBefore = &point;
255  }
256 }
257 
258 void Curve::loadCurvePoints(QXmlStreamReader &reader)
259 {
260  LOG4CPP_INFO_S ((*mainCat)) << "Curve::loadCurvePoints";
261 
262  bool success = true;
263 
264  while ((reader.tokenType() != QXmlStreamReader::EndElement) ||
265  (reader.name() != DOCUMENT_SERIALIZE_CURVE_POINTS)) {
266 
267  QXmlStreamReader::TokenType tokenType = loadNextFromReader(reader);
268 
269  if (reader.atEnd()) {
270  success = false;
271  break;
272  }
273 
274  if (tokenType == QXmlStreamReader::StartElement) {
275 
276  if (reader.name () == DOCUMENT_SERIALIZE_POINT) {
277 
278  Point point (reader);
279  m_points.push_back (point);
280  }
281  }
282  }
283 
284  if (!success) {
285  reader.raiseError("Cannot read curve data");
286  }
287 }
288 
289 void Curve::loadXml(QXmlStreamReader &reader)
290 {
291  LOG4CPP_INFO_S ((*mainCat)) << "Curve::loadXml";
292 
293  bool success = true;
294 
295  QXmlStreamAttributes attributes = reader.attributes();
296 
297  if (attributes.hasAttribute (DOCUMENT_SERIALIZE_CURVE_NAME)) {
298 
299  setCurveName (attributes.value (DOCUMENT_SERIALIZE_CURVE_NAME).toString());
300 
301  // Read until end of this subtree
302  while ((reader.tokenType() != QXmlStreamReader::EndElement) ||
303  (reader.name() != DOCUMENT_SERIALIZE_CURVE)){
304 
305  QXmlStreamReader::TokenType tokenType = loadNextFromReader(reader);
306 
307  if (reader.atEnd()) {
308  success = false;
309  break;
310  }
311 
312  if (tokenType == QXmlStreamReader::StartElement) {
313 
314  if (reader.name() == DOCUMENT_SERIALIZE_COLOR_FILTER) {
315  m_colorFilterSettings.loadXml(reader);
316  } else if (reader.name() == DOCUMENT_SERIALIZE_CURVE_POINTS) {
317  loadCurvePoints(reader);
318  } else if (reader.name() == DOCUMENT_SERIALIZE_CURVE_STYLE) {
319  m_curveStyle.loadXml(reader);
320  } else {
321  success = false;
322  break;
323  }
324  }
325 
326  if (reader.hasError()) {
327  // No need to set success flag to indicate failure, which raises the error, since the error was already raised. Just
328  // need to exit the loop immediately
329  break;
330  }
331  }
332  } else {
333  success = false;
334  }
335 
336  if (!success) {
337  reader.raiseError ("Cannot read curve data");
338  }
339 }
340 
341 void Curve::movePoint (const QString &pointIdentifier,
342  const QPointF &deltaScreen)
343 {
344  Point *point = pointForPointIdentifier (pointIdentifier);
345 
346  QPointF posScreen = deltaScreen + point->posScreen ();
347  point->setPosScreen (posScreen);
348 }
349 
350 int Curve::numPoints () const
351 {
352  return m_points.count ();
353 }
354 
355 Point *Curve::pointForPointIdentifier (const QString pointIdentifier)
356 {
357  Points::iterator itr;
358  for (itr = m_points.begin (); itr != m_points.end (); itr++) {
359  Point &point = *itr;
360  if (pointIdentifier == point.identifier ()) {
361  return &point;
362  }
363  }
364 
365  ENGAUGE_ASSERT (false);
366  return 0;
367 }
368 
369 const Points Curve::points () const
370 {
371  return m_points;
372 }
373 
374 QPointF Curve::positionGraph (const QString &pointIdentifier) const
375 {
376  QPointF posGraph;
377 
378  // Search for point with matching identifier
379  Points::const_iterator itr;
380  for (itr = m_points.begin (); itr != m_points.end (); itr++) {
381  const Point &point = *itr;
382  if (pointIdentifier == point.identifier ()) {
383  posGraph = point.posGraph ();
384  break;
385  }
386  }
387 
388  return posGraph;
389 }
390 
391 QPointF Curve::positionScreen (const QString &pointIdentifier) const
392 {
393  QPointF posScreen;
394 
395  // Search for point with matching identifier
396  Points::const_iterator itr;
397  for (itr = m_points.begin (); itr != m_points.end (); itr++) {
398  const Point &point = *itr;
399  if (pointIdentifier == point.identifier ()) {
400  posScreen = point.posScreen ();
401  break;
402  }
403  }
404 
405  return posScreen;
406 }
407 
408 void Curve::printStream (QString indentation,
409  QTextStream &str) const
410 {
411  str << indentation << "Curve=" << m_curveName << "\n";
412 
413  indentation += INDENTATION_DELTA;
414 
415  Points::const_iterator itr;
416  for (itr = m_points.begin (); itr != m_points.end (); itr++) {
417  const Point &point = *itr;
418  point.printStream (indentation,
419  str);
420  }
421 
422  m_colorFilterSettings.printStream (indentation,
423  str);
424  m_curveStyle.printStream (indentation,
425  str);
426 }
427 
428 void Curve::removePoint (const QString &identifier)
429 {
430  // Search for point with matching identifier
431  Points::iterator itr;
432  for (itr = m_points.begin (); itr != m_points.end (); itr++) {
433  Point point = *itr;
434  if (point.identifier () == identifier) {
435  m_points.erase (itr);
436  break;
437  }
438  }
439 }
440 
441 void Curve::saveXml(QXmlStreamWriter &writer) const
442 {
443  LOG4CPP_INFO_S ((*mainCat)) << "Curve::saveXml";
444 
445  writer.writeStartElement(DOCUMENT_SERIALIZE_CURVE);
446  writer.writeAttribute(DOCUMENT_SERIALIZE_CURVE_NAME, m_curveName);
447  m_colorFilterSettings.saveXml (writer);
448  m_curveStyle.saveXml (writer,
449  m_curveName);
450 
451  // Loop through points
452  writer.writeStartElement(DOCUMENT_SERIALIZE_CURVE_POINTS);
453  Points::const_iterator itr;
454  for (itr = m_points.begin (); itr != m_points.end (); itr++) {
455  const Point &point = *itr;
456  point.saveXml (writer);
457  }
458  writer.writeEndElement();
459 
460  writer.writeEndElement();
461 }
462 
463 void Curve::setColorFilterSettings (const ColorFilterSettings &colorFilterSettings)
464 {
465  m_colorFilterSettings = colorFilterSettings;
466 }
467 
468 void Curve::setCurveName (const QString &curveName)
469 {
470  m_curveName = curveName;
471 }
472 
473 void Curve::setCurveStyle (const CurveStyle &curveStyle)
474 {
475  m_curveStyle = curveStyle;
476 }
477 
478 void Curve::updatePointOrdinals (const Transformation &transformation)
479 {
480  CurveConnectAs curveConnectAs = m_curveStyle.lineStyle().curveConnectAs();
481 
482  LOG4CPP_INFO_S ((*mainCat)) << "Curve::updatePointOrdinals"
483  << " curve=" << m_curveName.toLatin1().data()
484  << " connectAs=" << curveConnectAsToString(curveConnectAs).toLatin1().data();
485 
486  // Make sure ordinals are properly ordered. Sorting is done afterward
487 
488  if (curveConnectAs == CONNECT_AS_FUNCTION_SMOOTH ||
489  curveConnectAs == CONNECT_AS_FUNCTION_STRAIGHT) {
490 
491  updatePointOrdinalsFunctions (transformation);
492 
493  } else if (curveConnectAs == CONNECT_AS_RELATION_SMOOTH ||
494  curveConnectAs == CONNECT_AS_RELATION_STRAIGHT) {
495 
496  updatePointOrdinalsRelations ();
497 
498  } else {
499 
500  LOG4CPP_ERROR_S ((*mainCat)) << "Curve::updatePointOrdinals";
501  ENGAUGE_ASSERT (false);
502 
503  }
504 
505  qSort (m_points.begin(),
506  m_points.end(),
507  PointComparator());
508 }
509 
510 void Curve::updatePointOrdinalsFunctions (const Transformation &transformation)
511 {
512  CurveConnectAs curveConnectAs = m_curveStyle.lineStyle().curveConnectAs();
513 
514  LOG4CPP_INFO_S ((*mainCat)) << "Curve::updatePointOrdinalsFunctions"
515  << " curve=" << m_curveName.toLatin1().data()
516  << " connectAs=" << curveConnectAsToString(curveConnectAs).toLatin1().data();
517 
518  // Get a map of x/theta values as keys with point identifiers as the values
519  XOrThetaToPointIdentifier xOrThetaToPointIdentifier;
520  Points::iterator itr;
521  for (itr = m_points.begin (); itr != m_points.end (); itr++) {
522  Point &point = *itr;
523 
524  QPointF posGraph;
525  if (transformation.transformIsDefined()) {
526 
527  // Transformation is available so use it
528  transformation.transformScreenToRawGraph (point.posScreen (),
529  posGraph);
530  } else {
531 
532  // Transformation is not available so we just use the screen coordinates. Effectively, the
533  // transformation is the identity matrix
534  posGraph= point.posScreen();
535  }
536 
537  xOrThetaToPointIdentifier [posGraph.x()] = point.identifier();
538  }
539 
540  // Since m_points is a list (and therefore does not provide direct access to elements), we build a temporary map of
541  // point identifier to ordinal, by looping through the sorted x/theta values. Since QMap is used, the x/theta keys are sorted
542  QMap<QString, double> pointIdentifierToOrdinal;
543  int ordinal = 0;
544  XOrThetaToPointIdentifier::const_iterator itrX;
545  for (itrX = xOrThetaToPointIdentifier.begin(); itrX != xOrThetaToPointIdentifier.end(); itrX++) {
546 
547  QString pointIdentifier = itrX.value();
548  pointIdentifierToOrdinal [pointIdentifier] = ordinal++;
549  }
550 
551  // Override the old ordinal values
552  for (itr = m_points.begin(); itr != m_points.end(); itr++) {
553  Point &point = *itr;
554  int ordinalNew = pointIdentifierToOrdinal [point.identifier()];
555  point.setOrdinal (ordinalNew);
556  }
557 }
558 
559 void Curve::updatePointOrdinalsRelations ()
560 {
561  CurveConnectAs curveConnectAs = m_curveStyle.lineStyle().curveConnectAs();
562 
563  LOG4CPP_INFO_S ((*mainCat)) << "Curve::updatePointOrdinalsRelations"
564  << " curve=" << m_curveName.toLatin1().data()
565  << " connectAs=" << curveConnectAsToString(curveConnectAs).toLatin1().data();
566 
567  // Keep the ordinal numbering, but make sure the ordinals are evenly spaced
568  Points::iterator itr;
569  int ordinal = 0;
570  for (itr = m_points.begin(); itr != m_points.end(); itr++) {
571  Point &point = *itr;
572  point.setOrdinal (ordinal++);
573  }
574 }
void transformScreenToRawGraph(const QPointF &coordScreen, QPointF &coordGraph) const
Transform from cartesian pixel screen coordinates to cartesian/polar graph coordinates.
void removePoint(const QString &identifier)
Perform the opposite of addPointAtEnd.
Definition: Curve.cpp:428
QPointF positionScreen(const QString &pointIdentifier) const
Return the position, in screen coordinates, of the specified Point.
Definition: Curve.cpp:391
QPointF posGraph(ApplyHasCheck applyHasCheck=KEEP_HAS_CHECK) const
Accessor for graph position. Skip check if copying one instance to another.
Definition: Point.cpp:335
Comparator for sorting Point class.
void saveXml(QXmlStreamWriter &writer, const QString &curveName) const
Serialize to xml.
Definition: CurveStyle.cpp:87
Color filter parameters for one curve. For a class, this is handled the same as LineStyle and PointSt...
void exportToClipboard(const QHash< QString, bool > &selectedHash, const Transformation &transformation, QTextStream &strCsv, QTextStream &strHtml, CurvesGraphs &curvesGraphs) const
Export points in this Curve found in the specified point list.
Definition: Curve.cpp:154
const Points points() const
Return a shallow copy of the Points.
Definition: Curve.cpp:369
void setCurveStyle(const CurveStyle &curveStyle)
Set curve style.
Definition: Curve.cpp:473
void printStream(QString indentation, QTextStream &str) const
Debugging method that supports print method of this class and printStream method of some other class(...
Definition: CurveStyle.cpp:74
void addPoint(Point point)
Add Point to this Curve.
Definition: Curve.cpp:117
void setColorFilterSettings(const ColorFilterSettings &colorFilterSettings)
Set color filter.
Definition: Curve.cpp:463
void saveXml(QXmlStreamWriter &writer) const
Serialize to stream.
Definition: Point.cpp:372
Curve * curveForCurveName(const QString &curveName)
Return the axis or graph curve for the specified curve name.
int numCurves() const
Current number of graphs curves.
int numPoints() const
Number of points.
Definition: Curve.cpp:350
void updatePointOrdinals(const Transformation &transformation)
See CurveGraphs::updatePointOrdinals.
Definition: Curve.cpp:478
LineStyle lineStyle() const
Get method for LineStyle.
Definition: CurveStyle.cpp:20
void setPointShape(PointShape shape)
Set method for curve point shape in specified curve.
Definition: CurveStyle.cpp:134
void addGraphCurveAtEnd(Curve curve)
Append new graph Curve to end of Curve list.
Class that represents one digitized point. The screen-to-graph coordinate transformation is always ex...
Definition: Point.h:17
static LineStyle defaultAxesCurve()
Initial default for axes curve.
Definition: LineStyle.cpp:48
QPointF posScreen() const
Accessor for screen position.
Definition: Point.cpp:344
void setLineConnectAs(CurveConnectAs curveConnectAs)
Set method for connect as method for lines in specified curve.
Definition: CurveStyle.cpp:104
QPointF positionGraph(const QString &pointIdentifier) const
Return the position, in graph coordinates, of the specified Point.
Definition: Curve.cpp:374
void setLineStyle(const LineStyle &lineStyle)
Set method for LineStyle.
Definition: CurveStyle.cpp:109
Curve(const QString &curveName, const ColorFilterSettings &colorFilterSettings, const CurveStyle &curveStyle)
Constructor from scratch.
Definition: Curve.cpp:27
void setPosGraph(const QPointF &posGraph)
Set method for position in graph coordinates.
Definition: Point.cpp:421
void printStream(QString indentation, QTextStream &str) const
Debugging method that supports print method of this class and printStream method of some other class(...
Definition: Curve.cpp:408
ColorPalette colorPalette(int preVersion6) const
Color from color palette.
void editPoint(const QPointF &posGraph, const QString &identifier)
Edit the graph coordinates of an axis point. This method does not apply to a graph point...
Definition: Curve.cpp:137
Curve & operator=(const Curve &curve)
Assignment constructor.
Definition: Curve.cpp:107
CallbackSearchReturn
Return values for search callback methods.
QString identifier() const
Unique identifier for a specific Point.
Definition: Point.cpp:220
Converts old (=pre version 6) enums to new (=version 6) enums, for reading of old document files...
PointShape pointShape(int preVersion6) const
Point shape.
void movePoint(const QString &pointIdentifier, const QPointF &deltaScreen)
Translate the position of a point by the specified distance vector.
Definition: Curve.cpp:341
void setPointRadius(int radius)
Set method for curve point radius.
Definition: CurveStyle.cpp:129
void setPointLineWidth(int width)
Set method for curve point perimeter line width.
Definition: CurveStyle.cpp:124
static ColorFilterSettings defaultFilter()
Initial default for any Curve.
Affine transformation between screen and graph coordinates, based on digitized axis points...
QString loadXml(QXmlStreamReader &reader)
Load from serialized xml. Returns the curve name.
Definition: CurveStyle.cpp:25
Container for all graph curves. The axes point curve is external to this class.
Definition: CurvesGraphs.h:18
void saveXml(QXmlStreamWriter &writer) const
Save curve filter to stream.
void iterateThroughCurvePoints(const Functor2wRet< const QString &, const Point &, CallbackSearchReturn > &ftorWithCallback) const
Apply functor to Points on Curve.
Definition: Curve.cpp:219
void printStream(QString indentation, QTextStream &str) const
Debugging method that supports print method of this class and printStream method of some other class(...
Definition: Point.cpp:349
void setCurveName(const QString &curveName)
Change the curve name.
Definition: Curve.cpp:468
Container for LineStyle and PointStyle for one Curve.
Definition: CurveStyle.h:12
void setPosScreen(const QPointF &posScreen)
Set method for position in screen coordinates.
Definition: Point.cpp:435
Container for one set of digitized Points.
Definition: Curve.h:26
void setLineColor(ColorPalette lineColor)
Set method for line color in specified curve.
Definition: CurveStyle.cpp:99
bool transformIsDefined() const
Transform is defined when at least three axis points have been digitized.
void loadXml(QXmlStreamReader &reader)
Load curve filter to stream.
void setPointColor(ColorPalette curveColor)
Set method curve point color in specified curve.
Definition: CurveStyle.cpp:119
Immediately terminate the current search.
CurveStyle curveStyle() const
Return the curve style.
Definition: Curve.cpp:132
CurveConnectAs curveConnectAs() const
Get method for connect type.
Definition: LineStyle.cpp:43
void printStream(QString indentation, QTextStream &str) const
Debugging method that supports print method of this class and printStream method of some other class(...
void setLineWidth(int width)
Set method for line width in specified curve.
Definition: CurveStyle.cpp:114
void setPointStyle(const PointStyle &pointStyle)
Set method for PointStyle.
Definition: CurveStyle.cpp:139
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...
Definition: Curve.cpp:234
void saveXml(QXmlStreamWriter &writer) const
Serialize curve.
Definition: Curve.cpp:441
void setOrdinal(double ordinal)
Set the ordinal used for ordering Points.
Definition: Point.cpp:411
static PointStyle defaultGraphCurve(int index)
Initial default for index'th graph curve.
Definition: PointStyle.cpp:57
CurveConnectAs curveConnectAs(int preVersion6) const
Line drawn between points.
ColorFilterSettings colorFilterSettings() const
Return the color filter.
Definition: Curve.cpp:122
QString curveName() const
Name of this Curve.
Definition: Curve.cpp:127