Engauge Digitizer  2
 All Classes Files Functions Variables Enumerations Enumerator Friends Pages
CoordSystem.cpp
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 #include "CallbackAddPointsInCurvesGraphs.h"
8 #include "CallbackCheckAddPointAxis.h"
9 #include "CallbackCheckEditPointAxis.h"
10 #include "CallbackNextOrdinal.h"
11 #include "CallbackRemovePointsInCurvesGraphs.h"
12 #include "CoordSystem.h"
13 #include "Curve.h"
14 #include "CurvesGraphs.h"
15 #include "CurveStyles.h"
16 #include "DocumentSerialize.h"
17 #include "EngaugeAssert.h"
18 #include "EnumsToQt.h"
19 #include <iostream>
20 #include "Logger.h"
21 #include "OrdinalGenerator.h"
22 #include "Point.h"
23 #include <QByteArray>
24 #include <QDataStream>
25 #include <QDebug>
26 #include <QFile>
27 #include <QImage>
28 #include <QtToString.h>
29 #include <QXmlStreamReader>
30 #include <QXmlStreamWriter>
31 #include "SettingsForGraph.h"
32 #include "Transformation.h"
33 #include "Version.h"
34 #include "Xml.h"
35 
36 const int FOUR_BYTES = 4;
37 
38 CoordSystem::CoordSystem (DocumentAxesPointsRequired documentAxesPointsRequired) :
39  m_curveAxes (new Curve (AXIS_CURVE_NAME,
40  ColorFilterSettings::defaultFilter (),
41  CurveStyle (LineStyle::defaultAxesCurve(),
42  PointStyle::defaultAxesCurve ()))),
43  m_documentAxesPointsRequired (documentAxesPointsRequired)
44 {
45  LOG4CPP_INFO_S ((*mainCat)) << "CoordSystem::CoordSystem";
46 
47  SettingsForGraph settingsForGraph;
48  QString curveName = settingsForGraph.defaultCurveName (1,
49  DEFAULT_GRAPH_CURVE_NAME);
50  m_curvesGraphs.addGraphCurveAtEnd (Curve (curveName,
53  PointStyle::defaultGraphCurve (m_curvesGraphs.numCurves ()))));
54 }
55 
56 void CoordSystem::addGraphCurveAtEnd (const QString &curveName)
57 {
58  m_curvesGraphs.addGraphCurveAtEnd (Curve (curveName,
61  PointStyle::defaultGraphCurve(m_curvesGraphs.numCurves()))));
62 }
63 
64 void CoordSystem::addPointAxisWithGeneratedIdentifier (const QPointF &posScreen,
65  const QPointF &posGraph,
66  QString &identifier,
67  double ordinal,
68  bool isXOnly)
69 {
70  Point point (AXIS_CURVE_NAME,
71  posScreen,
72  posGraph,
73  ordinal,
74  isXOnly);
75  m_curveAxes->addPoint (point);
76 
77  identifier = point.identifier();
78 
79  LOG4CPP_INFO_S ((*mainCat)) << "CoordSystem::addPointAxisWithGeneratedIdentifier"
80  << " ordinal=" << ordinal
81  << " posScreen=" << QPointFToString (posScreen).toLatin1 ().data ()
82  << " posGraph=" << QPointFToString (posGraph).toLatin1 ().data ()
83  << " identifier=" << identifier.toLatin1 ().data ();
84 }
85 
86 void CoordSystem::addPointAxisWithSpecifiedIdentifier (const QPointF &posScreen,
87  const QPointF &posGraph,
88  const QString &identifier,
89  double ordinal,
90  bool isXOnly)
91 {
92  Point point (AXIS_CURVE_NAME,
93  identifier,
94  posScreen,
95  posGraph,
96  ordinal,
97  isXOnly);
98  m_curveAxes->addPoint (point);
99 
100  LOG4CPP_INFO_S ((*mainCat)) << "CoordSystem::addPointAxisWithSpecifiedIdentifier"
101  << " ordinal=" << ordinal
102  << " posScreen=" << QPointFToString (posScreen).toLatin1 ().data ()
103  << " posGraph=" << QPointFToString (posGraph).toLatin1 ().data ()
104  << " identifier=" << identifier.toLatin1 ().data ();
105 }
106 
108  const QPointF &posScreen,
109  QString &identifier,
110  double ordinal)
111 {
112  Point point (curveName,
113  posScreen,
114  ordinal);
115  m_curvesGraphs.addPoint (point);
116 
117  identifier = point.identifier();
118 
119  LOG4CPP_INFO_S ((*mainCat)) << "CoordSystem::addPointGraphWithGeneratedIdentifier"
120  << " ordinal=" << ordinal
121  << " posScreen=" << QPointFToString (posScreen).toLatin1 ().data ()
122  << " identifier=" << identifier.toLatin1 ().data ();
123 }
124 
126  const QPointF &posScreen,
127  const QString &identifier,
128  double ordinal)
129 {
130  Point point (curveName,
131  identifier,
132  posScreen,
133  ordinal);
134  m_curvesGraphs.addPoint (point);
135 
136  LOG4CPP_INFO_S ((*mainCat)) << "CoordSystem::addPointGraphWithSpecifiedIdentifier"
137  << " ordinal=" << ordinal
138  << " posScreen=" << QPointFToString (posScreen).toLatin1 ().data ()
139  << " identifier=" << identifier.toLatin1 ().data ();
140 }
141 
143 {
144  CallbackAddPointsInCurvesGraphs ftor (*this);
145 
146  Functor2wRet<const QString &, const Point &, CallbackSearchReturn> ftorWithCallback = functor_ret (ftor,
148 
149  curvesGraphs.iterateThroughCurvesPoints (ftorWithCallback);
150 }
151 
152 bool CoordSystem::bytesIndicatePreVersion6 (const QByteArray &bytes) const
153 {
154  QByteArray preVersion6MagicNumber;
155  preVersion6MagicNumber.resize (FOUR_BYTES);
156 
157  // Windows compiler gives warning if 0x## is used instead of '\x##' below
158  preVersion6MagicNumber[0] = '\x00';
159  preVersion6MagicNumber[1] = '\x00';
160  preVersion6MagicNumber[2] = '\xCA';
161  preVersion6MagicNumber[3] = '\xFE';
162 
163  return (bytes == preVersion6MagicNumber);
164 }
165 
166 void CoordSystem::checkAddPointAxis (const QPointF &posScreen,
167  const QPointF &posGraph,
168  bool &isError,
169  QString &errorMessage,
170  bool isXOnly)
171 {
172  LOG4CPP_INFO_S ((*mainCat)) << "CoordSystem::checkAddPointAxis"
173  << " posScreen=" << QPointFToString (posScreen).toLatin1 ().data ()
174  << " posGraph=" << QPointFToString (posGraph).toLatin1 ().data ();
175 
176  CallbackCheckAddPointAxis ftor (m_modelCoords,
177  posScreen,
178  posGraph,
179  m_documentAxesPointsRequired,
180  isXOnly);
181 
182  Functor2wRet<const QString &, const Point &, CallbackSearchReturn> ftorWithCallback = functor_ret (ftor,
184  m_curveAxes->iterateThroughCurvePoints (ftorWithCallback);
185 
186  isError = ftor.isError ();
187  errorMessage = ftor.errorMessage ();
188 }
189 
190 void CoordSystem::checkEditPointAxis (const QString &pointIdentifier,
191  const QPointF &posScreen,
192  const QPointF &posGraph,
193  bool &isError,
194  QString &errorMessage)
195 {
196  LOG4CPP_INFO_S ((*mainCat)) << "CoordSystem::checkEditPointAxis"
197  << " posGraph=" << QPointFToString (posGraph).toLatin1 ().data ();
198 
199  CallbackCheckEditPointAxis ftor (m_modelCoords,
200  pointIdentifier,
201  posScreen,
202  posGraph,
203  m_documentAxesPointsRequired);
204 
205  Functor2wRet<const QString &, const Point &, CallbackSearchReturn> ftorWithCallback = functor_ret (ftor,
207  m_curveAxes->iterateThroughCurvePoints (ftorWithCallback);
208 
209  isError = ftor.isError ();
210  errorMessage = ftor.errorMessage ();
211 }
212 
214 {
215  ENGAUGE_CHECK_PTR (m_curveAxes);
216 
217  return *m_curveAxes;
218 }
219 
220 Curve *CoordSystem::curveForCurveName (const QString &curveName)
221 {
222  if (curveName == AXIS_CURVE_NAME) {
223 
224  return m_curveAxes;
225 
226  } else {
227 
228  return m_curvesGraphs.curveForCurveName (curveName);
229 
230  }
231 }
232 
233 const Curve *CoordSystem::curveForCurveName (const QString &curveName) const
234 {
235  if (curveName == AXIS_CURVE_NAME) {
236 
237  return m_curveAxes;
238 
239  } else {
240 
241  return m_curvesGraphs.curveForCurveName (curveName);
242 
243  }
244 }
245 
247 {
248  return m_curvesGraphs;
249 }
250 
252 {
253  return m_curvesGraphs.curvesGraphsNames();
254 }
255 
256 int CoordSystem::curvesGraphsNumPoints(const QString &curveName) const
257 {
258  return m_curvesGraphs.curvesGraphsNumPoints(curveName);
259 }
260 
261 void CoordSystem::editPointAxis (const QPointF &posGraph,
262  const QString &identifier)
263 {
264  LOG4CPP_INFO_S ((*mainCat)) << "CoordSystem::editPointAxis posGraph=("
265  << posGraph.x () << ", " << posGraph.y () << ") identifier="
266  << identifier.toLatin1 ().data ();
267 
268  m_curveAxes->editPoint (posGraph,
269  identifier);
270 }
271 
272 bool CoordSystem::isXOnly (const QString &pointIdentifier) const
273 {
274  return m_curveAxes->isXOnly (pointIdentifier);
275 }
276 
277 void CoordSystem::iterateThroughCurvePointsAxes (const Functor2wRet<const QString &, const Point &, CallbackSearchReturn> &ftorWithCallback)
278 {
279  ENGAUGE_CHECK_PTR (m_curveAxes);
280 
281  m_curveAxes->iterateThroughCurvePoints (ftorWithCallback);
282 }
283 
284 void CoordSystem::iterateThroughCurvePointsAxes (const Functor2wRet<const QString &, const Point &, CallbackSearchReturn> &ftorWithCallback) const
285 {
286  ENGAUGE_CHECK_PTR (m_curveAxes);
287 
288  m_curveAxes->iterateThroughCurvePoints (ftorWithCallback);
289 }
290 
291 void CoordSystem::iterateThroughCurveSegments (const QString &curveName,
292  const Functor2wRet<const Point &, const Point &, CallbackSearchReturn> &ftorWithCallback) const
293 {
294  if (curveName == AXIS_CURVE_NAME) {
295  m_curveAxes->iterateThroughCurveSegments(ftorWithCallback);
296  } else {
297  m_curvesGraphs.iterateThroughCurveSegments(curveName,
298  ftorWithCallback);
299  }
300 }
301 
302 void CoordSystem::iterateThroughCurvesPointsGraphs (const Functor2wRet<const QString &, const Point &, CallbackSearchReturn> &ftorWithCallback)
303 {
304  ENGAUGE_CHECK_PTR (m_curveAxes);
305 
306  m_curvesGraphs.iterateThroughCurvesPoints (ftorWithCallback);
307 }
308 
309 void CoordSystem::iterateThroughCurvesPointsGraphs (const Functor2wRet<const QString &, const Point &, CallbackSearchReturn> &ftorWithCallback) const
310 {
311  ENGAUGE_CHECK_PTR (m_curveAxes);
312 
313  m_curvesGraphs.iterateThroughCurvesPoints (ftorWithCallback);
314 }
315 
316 bool CoordSystem::loadCurvesFile(const QString & /* curvesFile */)
317 {
318  LOG4CPP_INFO_S ((*mainCat)) << "CoordSystem::loadCurvesFile";
319 
320  return true;
321 }
322 
323 void CoordSystem::loadPreVersion6 (QDataStream &str,
324  double version)
325 {
326  LOG4CPP_INFO_S ((*mainCat)) << "CoordSystem::loadPreVersion6";
327 
328  qint32 int32;
329  double dbl, radius = 0.0;
330  QString st;
331 
332  m_documentAxesPointsRequired = DOCUMENT_AXES_POINTS_REQUIRED_3;
333 
334  str >> st; // CurveCmbText selection
335  str >> st; // MeasureCmbText selection
336  str >> int32;
337  m_modelCoords.setCoordsType((CoordsType) int32);
338  if (version >= 3) {
339  str >> (double &) radius;
340  }
341  m_modelCoords.setOriginRadius(radius);
342  str >> int32;
343  m_modelCoords.setCoordUnitsRadius(COORD_UNITS_NON_POLAR_THETA_NUMBER);
344  m_modelCoords.setCoordUnitsTheta((CoordUnitsPolarTheta) int32);
345  str >> int32;
346  m_modelCoords.setCoordScaleXTheta((CoordScale) int32);
347  str >> int32;
348  m_modelCoords.setCoordScaleYRadius((CoordScale) int32);
349 
350  str >> int32;
351  m_modelExport.setDelimiter((ExportDelimiter) int32);
352  str >> int32;
353  m_modelExport.setLayoutFunctions((ExportLayoutFunctions) int32);
354  str >> int32;
355  m_modelExport.setPointsSelectionFunctions((ExportPointsSelectionFunctions) int32);
356  m_modelExport.setPointsIntervalUnitsRelations((ExportPointsIntervalUnits) int32);
357  str >> int32;
358  m_modelExport.setHeader((ExportHeader) int32);
359  if (version >= 5.1) {
360  str >> st; // X label
361  if (m_modelCoords.coordsType() == COORDS_TYPE_CARTESIAN) {
362  m_modelExport.setXLabel(st);
363  }
364  str >> st; // Theta label
365  if (m_modelCoords.coordsType() == COORDS_TYPE_POLAR) {
366  m_modelExport.setXLabel(st);
367  }
368  }
369 
370  // Stable flag in m_modelGridRemoval is set below after points are read in
371  str >> int32; // Remove thin lines parallel to axes
372  str >> dbl; // Thin thickness
373  str >> int32;
374  m_modelGridRemoval.setRemoveDefinedGridLines(int32);
375  str >> int32; // Initialized
376  str >> int32;
377  m_modelGridRemoval.setCountX(int32);
378  str >> int32;
379  m_modelGridRemoval.setCountY(int32);
380  str >> int32;
381  m_modelGridRemoval.setGridCoordDisableX((GridCoordDisable) int32);
382  str >> int32;
383  m_modelGridRemoval.setGridCoordDisableY((GridCoordDisable) int32);
384  str >> dbl;
385  m_modelGridRemoval.setStartX(dbl);
386  str >> dbl;
387  m_modelGridRemoval.setStartY(dbl);
388  str >> dbl;
389  m_modelGridRemoval.setStepX(dbl);
390  str >> dbl;
391  m_modelGridRemoval.setStepY(dbl);
392  str >> dbl;
393  m_modelGridRemoval.setStopX(dbl);
394  str >> dbl;
395  m_modelGridRemoval.setStopY(dbl);
396  str >> dbl;
397  m_modelGridRemoval.setCloseDistance(dbl);
398  str >> int32; // Boolean remove color flag
399  if (version >= 5) {
400  QColor color;
401  str >> color;
402  } else {
403  str >> int32; // Rgb color
404  }
405  str >> int32; // Foreground threshold low
406  str >> int32; // Foreground threshold high
407  str >> dbl; // Gap separation
408 
409  str >> int32; // Grid display is initialized flag
410  str >> int32; // X count
411  str >> int32; // Y count
412  str >> int32; // X parameter
413  str >> int32; // Y parameter
414  str >> dbl; // X start
415  str >> dbl; // Y start
416  str >> dbl; // X step
417  str >> dbl; // Y step
418  str >> dbl; // X stop
419  str >> dbl; // Y stop
420 
421  str >> int32;
422  m_modelSegments.setMinLength(int32);
423  str >> int32;
424  m_modelSegments.setPointSeparation(int32);
425  str >> int32;
426  m_modelSegments.setLineWidth(int32);
427  str >> int32;
428  m_modelSegments.setLineColor((ColorPalette) int32);
429 
430  str >> int32; // Point separation
431  str >> int32;
432  m_modelPointMatch.setMaxPointSize(int32);
433  str >> int32;
434  m_modelPointMatch.setPaletteColorAccepted((ColorPalette) int32);
435  str >> int32;
436  m_modelPointMatch.setPaletteColorRejected((ColorPalette) int32);
437  if (version < 4) {
438  m_modelPointMatch.setPaletteColorCandidate(COLOR_PALETTE_BLUE);
439  } else {
440  str >> int32;
441  m_modelPointMatch.setPaletteColorCandidate((ColorPalette) int32);
442  }
443 
444  str >> int32; // Discretize method
445  str >> int32; // Intensity threshold low
446  str >> int32; // Intensity threshold high
447  str >> int32; // Foreground threshold low
448  str >> int32; // Foreground threshold high
449  str >> int32; // Hue threshold low
450  str >> int32; // Hue threshold high
451  str >> int32; // Saturation threshold low
452  str >> int32; // Saturation threshold high
453  str >> int32; // Value threshold low
454  str >> int32; // Value threshold high
455 
456  m_curveAxes = new Curve (str);
457  Curve curveScale (str); // Scales are dropped on the floor
458  m_curvesGraphs.loadPreVersion6 (str);
459 
460  // Information from curves and points can affect some data structures that were (mostly) set earlier
461  if (m_curveAxes->numPoints () > 2) {
462  m_modelGridRemoval.setStable();
463  }
464 }
465 
466 void CoordSystem::loadVersion6 (QXmlStreamReader &reader)
467 {
468  LOG4CPP_INFO_S ((*mainCat)) << "CoordSystem::loadVersion6";
469 
470  m_documentAxesPointsRequired = DOCUMENT_AXES_POINTS_REQUIRED_3;
471 
472  // Import from xml. Loop to end of data or error condition occurs, whichever is first
473  while (!reader.atEnd() &&
474  !reader.hasError()) {
475  QXmlStreamReader::TokenType tokenType = loadNextFromReader(reader);
476 
477  if ((reader.name() == DOCUMENT_SERIALIZE_DOCUMENT) &&
478  (tokenType == QXmlStreamReader::EndElement)) {
479 
480  // Exit out of loop immediately
481  break;
482  }
483 
484  // Iterate to next StartElement
485  if (tokenType == QXmlStreamReader::StartElement) {
486 
487  // This is a StartElement, so process it
488  QString tag = reader.name().toString();
489  if (tag == DOCUMENT_SERIALIZE_AXES_CHECKER){
490  m_modelAxesChecker.loadXml (reader);
491  } else if (tag == DOCUMENT_SERIALIZE_COORDS) {
492  m_modelCoords.loadXml (reader);
493  } else if (tag == DOCUMENT_SERIALIZE_CURVE) {
494  m_curveAxes = new Curve (reader);
495  } else if (tag == DOCUMENT_SERIALIZE_CURVES_GRAPHS) {
496  m_curvesGraphs.loadXml (reader);
497  } else if (tag == DOCUMENT_SERIALIZE_DIGITIZE_CURVE) {
498  m_modelDigitizeCurve.loadXml (reader);
499  } else if (tag == DOCUMENT_SERIALIZE_EXPORT) {
500  m_modelExport.loadXml (reader);
501  } else if (tag == DOCUMENT_SERIALIZE_GENERAL || tag == DOCUMENT_SERIALIZE_COMMON) {
502  m_modelGeneral.loadXml (reader);
503  } else if (tag == DOCUMENT_SERIALIZE_GRID_REMOVAL) {
504  m_modelGridRemoval.loadXml (reader);
505  } else if (tag == DOCUMENT_SERIALIZE_IMAGE) {
506  ENGAUGE_ASSERT (false); // The image should have been read before this method was called
507  } else if (tag == DOCUMENT_SERIALIZE_POINT_MATCH) {
508  m_modelPointMatch.loadXml (reader);
509  } else if (tag == DOCUMENT_SERIALIZE_SEGMENTS) {
510  m_modelSegments.loadXml (reader);
511  } else {
512  m_successfulRead = false;
513  m_reasonForUnsuccessfulRead = QString ("%1 '%2' %3")
514  .arg (QObject::tr ("Unexpected xml token"))
515  .arg (tag)
516  .arg ("encountered");
517  break;
518  }
519  }
520  }
521 }
522 
523 void CoordSystem::loadVersion7 (QXmlStreamReader &reader,
524  DocumentAxesPointsRequired documentAxesPointsRequired)
525 {
526  LOG4CPP_INFO_S ((*mainCat)) << "CoordSystem::loadVersion7";
527 
528  m_documentAxesPointsRequired = documentAxesPointsRequired;
529 
530  // Import from xml. Loop to end of data or error condition occurs, whichever is first
531  while (!reader.atEnd() &&
532  !reader.hasError()) {
533  QXmlStreamReader::TokenType tokenType = loadNextFromReader(reader);
534 
535  if ((reader.name() == DOCUMENT_SERIALIZE_COORD_SYSTEM) &&
536  (tokenType == QXmlStreamReader::EndElement)) {
537 
538  // Exit out of loop immediately
539  break;
540  }
541 
542  // Iterate to next StartElement
543  if (tokenType == QXmlStreamReader::StartElement) {
544 
545  // This is a StartElement, so process it
546  QString tag = reader.name().toString();
547  if (tag == DOCUMENT_SERIALIZE_AXES_CHECKER){
548  m_modelAxesChecker.loadXml (reader);
549  } else if (tag == DOCUMENT_SERIALIZE_COORDS) {
550  m_modelCoords.loadXml (reader);
551  } else if (tag == DOCUMENT_SERIALIZE_CURVE) {
552  m_curveAxes = new Curve (reader);
553  } else if (tag == DOCUMENT_SERIALIZE_CURVES_GRAPHS) {
554  m_curvesGraphs.loadXml (reader);
555  } else if (tag == DOCUMENT_SERIALIZE_DIGITIZE_CURVE) {
556  m_modelDigitizeCurve.loadXml (reader);
557  } else if (tag == DOCUMENT_SERIALIZE_EXPORT) {
558  m_modelExport.loadXml (reader);
559  } else if (tag == DOCUMENT_SERIALIZE_GENERAL || tag == DOCUMENT_SERIALIZE_COMMON) {
560  m_modelGeneral.loadXml (reader);
561  } else if (tag == DOCUMENT_SERIALIZE_GRID_REMOVAL) {
562  m_modelGridRemoval.loadXml (reader);
563  } else if (tag == DOCUMENT_SERIALIZE_IMAGE) {
564  ENGAUGE_ASSERT (false); // The image should have been read before this method was called
565  } else if (tag == DOCUMENT_SERIALIZE_POINT_MATCH) {
566  m_modelPointMatch.loadXml (reader);
567  } else if (tag == DOCUMENT_SERIALIZE_SEGMENTS) {
568  m_modelSegments.loadXml (reader);
569  } else {
570  m_successfulRead = false;
571  m_reasonForUnsuccessfulRead = QString ("Unexpected xml token '%1' encountered").arg (tag);
572  break;
573  }
574  }
575  }
576 }
577 
579 {
580  return m_modelAxesChecker;
581 }
582 
584 {
585  // Construct a curve-specific model
587 
588  return modelColorFilter;
589 }
590 
592 {
593  return m_modelCoords;
594 }
595 
597 {
598  // Construct a curve-specific model
600 
601  return modelCurveStyles;
602 }
603 
605 {
606  return m_modelDigitizeCurve;
607 }
608 
610 {
611  return m_modelExport;
612 }
613 
615 {
616  return m_modelGeneral;
617 }
618 
620 {
621  return m_modelGridRemoval;
622 }
623 
625 {
626  return m_modelPointMatch;
627 }
628 
630 {
631  return m_modelSegments;
632 }
633 
634 void CoordSystem::movePoint (const QString &pointIdentifier,
635  const QPointF &deltaScreen)
636 {
637  QString curveName = Point::curveNameFromPointIdentifier (pointIdentifier);
638 
639  Curve *curve = curveForCurveName (curveName);
640  ENGAUGE_ASSERT (curve != 0);
641  curve->movePoint (pointIdentifier,
642  deltaScreen);
643 }
644 
645 int CoordSystem::nextOrdinalForCurve (const QString &curveName) const
646 {
647  CallbackNextOrdinal ftor (curveName);
648 
649  Functor2wRet<const QString &, const Point &, CallbackSearchReturn> ftorWithCallback = functor_ret (ftor,
651 
652  if (curveName == AXIS_CURVE_NAME) {
653  m_curveAxes->iterateThroughCurvePoints (ftorWithCallback);
654  } else {
655  m_curvesGraphs.iterateThroughCurvesPoints (ftorWithCallback);
656  }
657 
658  return ftor.nextOrdinal ();
659 }
660 
661 QPointF CoordSystem::positionGraph (const QString &pointIdentifier) const
662 {
663  QString curveName = Point::curveNameFromPointIdentifier (pointIdentifier);
664 
665  const Curve *curve = curveForCurveName (curveName);
666  return curve->positionGraph (pointIdentifier);
667 }
668 
669 QPointF CoordSystem::positionScreen (const QString &pointIdentifier) const
670 {
671  QString curveName = Point::curveNameFromPointIdentifier (pointIdentifier);
672 
673  const Curve *curve = curveForCurveName (curveName);
674  return curve->positionScreen (pointIdentifier);
675 }
676 
677 void CoordSystem::print () const
678 {
679  QString text;
680  QTextStream str (&text);
681 
682  printStream ("",
683  str);
684  std::cerr << text.toLatin1().data();
685 }
686 
687 void CoordSystem::printStream (QString indentation,
688  QTextStream &str) const
689 {
690  str << indentation << "Graph\n";
691 
692  indentation += INDENTATION_DELTA;
693 
694  // str << indentation << "name=" << m_name << "\n";
695  // str << indentation << "pixmap=" << m_pixmap.width() << "x" << m_pixmap.height() << "\n";
696 
697  m_curveAxes->printStream (indentation,
698  str);
699  m_curvesGraphs.printStream (indentation,
700  str);
701 
702  m_modelAxesChecker.printStream (indentation,
703  str);
704  m_modelCoords.printStream (indentation,
705  str);
706  m_modelDigitizeCurve.printStream (indentation,
707  str);
708  m_modelExport.printStream (indentation,
709  str);
710  m_modelGeneral.printStream (indentation,
711  str);
712  m_modelGridRemoval.printStream (indentation,
713  str);
714  m_modelPointMatch.printStream (indentation,
715  str);
716  m_modelSegments.printStream (indentation,
717  str);
718 }
719 
721 {
722  ENGAUGE_ASSERT (!m_successfulRead);
723 
724  return m_reasonForUnsuccessfulRead;
725 }
726 
727 void CoordSystem::removePointAxis (const QString &identifier)
728 {
729  LOG4CPP_INFO_S ((*mainCat)) << "CoordSystem::removePointAxis identifier=" << identifier.toLatin1 ().data ();
730 
731  m_curveAxes->removePoint (identifier);
732 }
733 
734 void CoordSystem::removePointGraph (const QString &identifier)
735 {
736  LOG4CPP_INFO_S ((*mainCat)) << "CoordSystem::removePointGraph identifier=" << identifier.toLatin1 ().data ();
737 
738  m_curvesGraphs.removePoint (identifier);
739 }
740 
742 {
744 
745  Functor2wRet<const QString &, const Point &, CallbackSearchReturn> ftorWithCallback = functor_ret (ftor,
747 
748  curvesGraphs.iterateThroughCurvesPoints (ftorWithCallback);
749 }
750 
751 void CoordSystem::saveXml (QXmlStreamWriter &writer) const
752 {
753  writer.writeStartElement(DOCUMENT_SERIALIZE_COORD_SYSTEM);
754 
755  // Serialize the Document variables
756  m_modelGeneral.saveXml (writer);
757  m_modelCoords.saveXml (writer);
758  m_modelDigitizeCurve.saveXml (writer);
759  m_modelExport.saveXml (writer);
760  m_modelAxesChecker.saveXml (writer);
761  m_modelGridRemoval.saveXml (writer);
762  m_modelPointMatch.saveXml (writer);
763  m_modelSegments.saveXml (writer);
764  m_curveAxes->saveXml (writer);
765  m_curvesGraphs.saveXml (writer);
766  writer.writeEndElement();
767 }
768 
769 void CoordSystem::setCurvesGraphs (const CurvesGraphs &curvesGraphs)
770 {
771  LOG4CPP_INFO_S ((*mainCat)) << "CoordSystem::setCurvesGraphs";
772 
773  m_curvesGraphs = curvesGraphs;
774 }
775 
777 {
778  m_modelAxesChecker = modelAxesChecker;
779 }
780 
782 {
783  // Save the CurveFilter for each Curve
784  ColorFilterSettingsList::const_iterator itr;
785  for (itr = modelColorFilter.colorFilterSettingsList().constBegin ();
786  itr != modelColorFilter.colorFilterSettingsList().constEnd();
787  itr++) {
788 
789  QString curveName = itr.key();
790  const ColorFilterSettings &colorFilterSettings = itr.value();
791 
792  Curve *curve = curveForCurveName (curveName);
793  curve->setColorFilterSettings (colorFilterSettings);
794  }
795 }
796 
798 {
799  m_modelCoords = modelCoords;
800 }
801 
802 void CoordSystem::setModelCurveStyles(const CurveStyles &modelCurveStyles)
803 {
804  // Save the LineStyle and PointStyle for each Curve
805  QStringList curveNames = modelCurveStyles.curveNames();
806  QStringList::iterator itr;
807  for (itr = curveNames.begin(); itr != curveNames.end(); itr++) {
808 
809  QString curveName = *itr;
810  const CurveStyle &curveStyle = modelCurveStyles.curveStyle (curveName);
811 
812  Curve *curve = curveForCurveName (curveName);
813  curve->setCurveStyle (curveStyle);
814  }
815 }
816 
818 {
819  m_modelDigitizeCurve = modelDigitizeCurve;
820 }
821 
823 {
824  m_modelExport = modelExport;
825 }
826 
828 {
829  m_modelGeneral = modelGeneral;
830 }
831 
833 {
834  m_modelGridRemoval = modelGridRemoval;
835 }
836 
838 {
839  m_modelPointMatch = modelPointMatch;
840 }
841 
843 {
844  m_modelSegments = modelSegments;
845 }
846 
848 {
849  return m_successfulRead;
850 }
851 
853 {
854  LOG4CPP_INFO_S ((*mainCat)) << "CoordSystem::updatePointOrdinals";
855 
856  // The graph coordinates of all points in m_curvesGraphs must have already been updated at this point. See applyTransformation
857  m_curvesGraphs.updatePointOrdinals (transformation);
858 }
void loadVersion6(QXmlStreamReader &reader)
Load from file in version 6 format.
virtual DocumentModelSegments modelSegments() const
Get method for DocumentModelSegments.
void setPointsSelectionFunctions(ExportPointsSelectionFunctions exportPointsSelectionFunctions)
Set method for point selection for functions.
CallbackSearchReturn callback(const QString &curveName, const Point &point)
Callback method.
void removePoint(const QString &identifier)
Perform the opposite of addPointAtEnd.
Definition: Curve.cpp:452
QStringList curveNames() const
List of all curve names.
Definition: CurveStyles.cpp:67
Manage storage and retrieval of the settings for the curves.
QPointF positionScreen(const QString &pointIdentifier) const
Return the position, in screen coordinates, of the specified Point.
Definition: Curve.cpp:415
Model for DlgSettingsGeneral and CmdSettingsGeneral.
static QString curveNameFromPointIdentifier(const QString &pointIdentifier)
Parse the curve name from the specified point identifier. This does the opposite of uniqueIdentifierG...
Definition: Point.cpp:227
void saveXml(QXmlStreamWriter &writer) const
Serialize curves.
QString errorMessage() const
Error message that explains the problem indicated by isError.
virtual void saveXml(QXmlStreamWriter &writer) const
Save entire model as xml into stream.
Model for DlgSettingsPointMatch and CmdSettingsPointMatch.
Callback for computing the next ordinal for a new point.
Color filter parameters for one curve. For a class, this is handled the same as LineStyle and PointSt...
virtual QString reasonForUnsuccessfulRead() const
Return an informative text message explaining why startup loading failed. Applies if successfulRead r...
static LineStyle defaultGraphCurve(int index)
Initial default for index&#39;th graph curve.
Definition: LineStyle.cpp:84
void printStream(QString indentation, QTextStream &str) const
Debugging method that supports print method of this class and printStream method of some other class(...
void loadXml(QXmlStreamReader &reader)
Load from serialized xml post-version 5 file.
virtual void setModelAxesChecker(const DocumentModelAxesChecker &modelAxesChecker)
Set method for DocumentModelAxesChecker.
void loadVersion7(QXmlStreamReader &reader, DocumentAxesPointsRequired documentAxesPointsRequired)
Load from file in version 7 format.
virtual void saveXml(QXmlStreamWriter &writer) const
Save entire model as xml into stream.
Callback that is used when iterating through a read-only CurvesGraphs to remove corresponding points ...
virtual DocumentModelPointMatch modelPointMatch() const
Get method for DocumentModelPointMatch.
void setCurveStyle(const CurveStyle &curveStyle)
Set curve style.
Definition: Curve.cpp:505
void setCloseDistance(double closeDistance)
Set method for close distance.
Model for DlgSettingsExportFormat and CmdSettingsExportFormat.
void setLineColor(ColorPalette lineColor)
Set method for line color.
virtual void saveXml(QXmlStreamWriter &writer) const
Save entire model as xml into stream.
Model for DlgSettingsCurveProperties and CmdSettingsCurveProperties.
Definition: CurveStyles.h:22
void setCountX(int countX)
Set method for x count.
void setModelPointMatch(const DocumentModelPointMatch &modelPointMatch)
Set method for DocumentModelPointMatch.
void setMinLength(double minLength)
Set method for min length.
void loadPreVersion6(QDataStream &str, double version)
Load from file in pre-version 6 format.
virtual void saveXml(QXmlStreamWriter &writer) const
Save entire model as xml into stream.
void addPoint(Point point)
Add Point to this Curve.
Definition: Curve.cpp:124
virtual void checkEditPointAxis(const QString &pointIdentifier, const QPointF &posScreen, const QPointF &posGraph, bool &isError, QString &errorMessage)
Check before calling editPointAxis.
void setColorFilterSettings(const ColorFilterSettings &colorFilterSettings)
Set color filter.
Definition: Curve.cpp:488
virtual void saveXml(QXmlStreamWriter &writer) const
Save entire model as xml into stream.
virtual void loadXml(QXmlStreamReader &reader)
Load model from serialized xml.
void setPaletteColorCandidate(ColorPalette paletteColorCandidate)
Set method for candidate color.
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 setStopY(double stopY)
Set method for y stop.
virtual void loadXml(QXmlStreamReader &reader)
Load model from serialized xml.
Curve * curveForCurveName(const QString &curveName)
Return the axis or graph curve for the specified curve name.
void printStream(QString indentation, QTextStream &str) const
Debugging method that supports print method of this class and printStream method of some other class(...
virtual DocumentModelCoords modelCoords() const
Get method for DocumentModelCoords.
int numCurves() const
Current number of graphs curves.
QString errorMessage() const
Error message that explains the problem indicated by isError.
int numPoints() const
Number of points.
Definition: Curve.cpp:374
void printStream(QString indentation, QTextStream &str) const
Debugging method that supports print method of this class and printStream method of some other class(...
void setCoordScaleYRadius(CoordScale coordScale)
Set method for linear/log scale on y/radius.
Callback that is used when iterating through a read-only CurvesGraphs to add corresponding points in ...
virtual bool successfulRead() const
Return true if startup loading succeeded. If the loading failed then reasonForUnsuccessfulRed will ex...
virtual void updatePointOrdinals(const Transformation &transformation)
Update point ordinals after point addition/removal or dragging.
virtual void setModelExport(const DocumentModelExportFormat &modelExport)
Set method for DocumentModelExportFormat.
bool isError() const
True if an error occurred during iteration.
bool isXOnly(const QString &pointIdentifier) const
Determine if specified point has just x coordinate. Otherwise has just y coordinate, or both x and y coordinates.
Definition: Curve.cpp:226
void addGraphCurveAtEnd(Curve curve)
Append new graph Curve to end of Curve list.
void iterateThroughCurvesPoints(const Functor2wRet< const QString &, const Point &, CallbackSearchReturn > &ftorWithCallback)
Apply functor to Points on all of the Curves.
void setStartY(double startY)
Set method for y start.
void setStepY(double stepY)
Set method for y step.
virtual DocumentModelDigitizeCurve modelDigitizeCurve() const
Get method for DocumentModelDigitizeCurve.
Class that represents one digitized point. The screen-to-graph coordinate transformation is always ex...
Definition: Point.h:23
QPointF positionGraph(const QString &pointIdentifier) const
Return the position, in graph coordinates, of the specified Point.
Definition: Curve.cpp:398
virtual void loadXml(QXmlStreamReader &reader)
Load model from serialized xml.
virtual DocumentModelGeneral modelGeneral() const
Get method for DocumentModelGeneral.
bool isError() const
True if an error occurred during iteration.
QString defaultCurveName(int indexOneBased, const QString &defaultName) const
Default graph name for the specified curve index.
Callback for sanity checking the screen and graph coordinates of an axis point that is in the axes cu...
void setDelimiter(ExportDelimiter exportDelimiter)
Set method for delimiter.
void setStartX(double startX)
Set method for x start.
void printStream(QString indentation, QTextStream &str) const
Debugging method that supports print method of this class and printStream method of some other class(...
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:432
virtual void loadXml(QXmlStreamReader &reader)
Load model from serialized xml.
CallbackSearchReturn callback(const QString &curveName, const Point &point)
Callback method.
virtual void setModelSegments(const DocumentModelSegments &modelSegments)
Set method for DocumentModelSegments.
virtual void setModelGridRemoval(const DocumentModelGridRemoval &modelGridRemoval)
Set method for DocumentModelGridRemoval.
void setLineWidth(double lineWidth)
Set method for line width.
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:144
virtual void loadXml(QXmlStreamReader &reader)
Load model from serialized xml.
QString identifier() const
Unique identifier for a specific Point.
Definition: Point.cpp:256
virtual void checkAddPointAxis(const QPointF &posScreen, const QPointF &posGraph, bool &isError, QString &errorMessage, bool isXOnly)
Check before calling addPointAxis. Also returns the next available ordinal number (to prevent clashes...
virtual void saveXml(QXmlStreamWriter &writer) const
Save graph to xml.
double nextOrdinal() const
Computed next ordinal.
void setCountY(int countY)
Set method for y count.
void movePoint(const QString &pointIdentifier, const QPointF &deltaScreen)
Translate the position of a point by the specified distance vector.
Definition: Curve.cpp:365
virtual void addPointGraphWithGeneratedIdentifier(const QString &curveName, const QPointF &posScreen, QString &generatedIentifier, double ordinal)
Add a single graph point with a generated point identifier.
void setLayoutFunctions(ExportLayoutFunctions exportLayoutFunctions)
Set method for functions layout.
static ColorFilterSettings defaultFilter()
Initial default for any Curve.
virtual void setModelGeneral(const DocumentModelGeneral &modelGeneral)
Set method for DocumentModelGeneral.
Model for DlgSettingsDigitizeCurve and CmdSettingsDigitizeCurve.
virtual void setCurvesGraphs(const CurvesGraphs &curvesGraphs)
Let CmdAbstract classes overwrite CurvesGraphs.
virtual void saveXml(QXmlStreamWriter &writer) const
Save entire model as xml into stream.
Affine transformation between screen and graph coordinates, based on digitized axis points...
virtual DocumentModelAxesChecker modelAxesChecker() const
Get method for DocumentModelAxesChecker.
Details for a specific Point.
Definition: PointStyle.h:20
void setStepX(double stepX)
Set method for x step.
void setMaxPointSize(double maxPointSize)
Set method for max point size.
void addPoint(const Point &point)
Append new Point to the specified Curve.
Container for all graph curves. The axes point curve is external to this class.
Definition: CurvesGraphs.h:24
Model for DlgSettingsColorFilter and CmdSettingsColorFilter.
virtual void print() const
Debugging method for printing directly from symbolic debugger.
virtual void loadXml(QXmlStreamReader &reader)
Load model from serialized xml.
virtual int nextOrdinalForCurve(const QString &curveName) const
Default next ordinal value for specified curve.
virtual void addPointAxisWithSpecifiedIdentifier(const QPointF &posScreen, const QPointF &posGraph, const QString &identifier, double ordinal, bool isXOnly)
Add a single axis point with the specified point identifier.
Definition: CoordSystem.cpp:86
virtual void loadXml(QXmlStreamReader &reader)
Load model from serialized xml.
void printStream(QString indentation, QTextStream &str) const
Debugging method that supports print method of this class and printStream method of some other class(...
virtual void removePointsInCurvesGraphs(CurvesGraphs &curvesGraphs)
Remove all points identified in the specified CurvesGraphs. See also addPointsInCurvesGraphs.
bool isXOnly(const QString &pointIdentifier) const
Return true if y coordinate is undefined, otherwise x coordinae is undefined in DOCUMENT_AXES_POINT_R...
virtual CurveStyles modelCurveStyles() const
Get method for CurveStyles.
virtual const CurvesGraphs & curvesGraphs() const
Make all Curves available, read only, for CmdAbstract classes only.
virtual void loadXml(QXmlStreamReader &reader)
Load model from serialized xml.
virtual void setModelColorFilter(const DocumentModelColorFilter &modelColorFilter)
Set method for DocumentModelColorFilter.
void iterateThroughCurvePoints(const Functor2wRet< const QString &, const Point &, CallbackSearchReturn > &ftorWithCallback) const
Apply functor to Points on Curve.
Definition: Curve.cpp:243
void setCoordUnitsTheta(CoordUnitsPolarTheta coordUnits)
Set method for theta units.
void setRemoveDefinedGridLines(bool removeDefinedGridLines)
Set method for removing defined grid lines.
virtual int curvesGraphsNumPoints(const QString &curveName) const
See CurvesGraphs::curvesGraphsNumPoints.
virtual void removePointGraph(const QString &identifier)
Perform the opposite of addPointGraph.
CoordsType coordsType() const
Get method for coordinates type.
CallbackSearchReturn callback(const QString &curveName, const Point &point)
Callback method.
Model for DlgSettingsCoords and CmdSettingsCoords.
virtual QStringList curvesGraphsNames() const
See CurvesGraphs::curvesGraphsNames.
int curvesGraphsNumPoints(const QString &curveName) const
Point count.
Container for LineStyle and PointStyle for one Curve.
Definition: CurveStyle.h:18
void setOriginRadius(double originRadius)
Set method for origin radius in polar mode.
void setGridCoordDisableY(GridCoordDisable gridCoordDisable)
Set method for y coord parameter to disable.
virtual const Curve & curveAxes() const
Get method for axis curve.
Container for one set of digitized Points.
Definition: Curve.h:32
void updatePointOrdinals(const Transformation &transformation)
Update point ordinals to be consistent with their CurveStyle and x/theta coordinate.
Details for a specific Line.
Definition: LineStyle.h:19
virtual QPointF positionGraph(const QString &pointIdentifier) const
See Curve::positionGraph.
virtual void printStream(QString indentation, QTextStream &str) const
Debugging method that supports print method of this class and printStream method of some other class(...
void setCoordUnitsRadius(CoordUnitsNonPolarTheta coordUnits)
Set method for radius units.
void setGridCoordDisableX(GridCoordDisable gridCoordDisable)
Set method for x coord parameter to disable.
void setPaletteColorRejected(ColorPalette paletteColorRejected)
Set method for rejected color.
virtual Curve * curveForCurveName(const QString &curveName)
See CurvesGraphs::curveForCurveName, although this also works for AXIS_CURVE_NAME.
virtual void removePointAxis(const QString &identifier)
Perform the opposite of addPointAxis.
Model for DlgSettingsAxesChecker and CmdSettingsAxesChecker.
virtual void addGraphCurveAtEnd(const QString &curveName)
Add new graph curve to the list of existing graph curves.
Definition: CoordSystem.cpp:56
void setStable()
Set the stable flag to true. This public version has no argument since it cannot be undone...
virtual bool loadCurvesFile(const QString &curvesFile)
Load the curve names in the specified Engauge file into the current graph. This is called near the en...
virtual void addPointGraphWithSpecifiedIdentifier(const QString &curveName, const QPointF &posScreen, const QString &identifier, double ordinal)
Add a single graph point with the specified point identifer. Note that PointStyle is not applied to t...
CurveStyle curveStyle(const QString &curveName) const
CurveStyle in specified curve.
Definition: CurveStyles.cpp:79
virtual void addPointAxisWithGeneratedIdentifier(const QPointF &posScreen, const QPointF &posGraph, QString &identifier, double ordinal, bool isXOnly)
Add a single axis point with a generated point identifier.
Definition: CoordSystem.cpp:64
virtual void movePoint(const QString &pointIdentifier, const QPointF &deltaScreen)
See Curve::movePoint.
void setPointsIntervalUnitsRelations(ExportPointsIntervalUnits pointsIntervalUnitsRelations)
Set method for points interval units for relations.
virtual void addPointsInCurvesGraphs(CurvesGraphs &curvesGraphs)
Add all points identified in the specified CurvesGraphs. See also removePointsInCurvesGraphs.
virtual DocumentModelColorFilter modelColorFilter() const
Get method for DocumentModelColorFilter.
virtual void iterateThroughCurvesPointsGraphs(const Functor2wRet< const QString &, const Point &, CallbackSearchReturn > &ftorWithCallback)
See Curve::iterateThroughCurvePoints, for all the graphs curves.
virtual void saveXml(QXmlStreamWriter &writer) const
Save entire model as xml into stream.
Model for DlgSettingsSegments and CmdSettingsSegments.
void loadPreVersion6(QDataStream &str)
Load from serialized binary pre-version 6 file.
Callback for sanity checking the screen and graph coordinates of an axis point, before it is added to...
virtual void editPointAxis(const QPointF &posGraph, const QString &identifier)
Edit the graph coordinates of a single axis point. Call this after checkAddPointAxis to guarantee suc...
void setHeader(ExportHeader exportHeader)
Set method for header.
virtual QPointF positionScreen(const QString &pointIdentifier) const
See Curve::positionScreen.
QStringList curvesGraphsNames() const
List of graph curve names.
virtual void setModelCurveStyles(const CurveStyles &modelCurveStyles)
Set method for CurveStyles.
void removePoint(const QString &pointIdentifier)
Remove the Point from its Curve.
const ColorFilterSettingsList & colorFilterSettingsList() const
Get method for copying all color filters in one step.
virtual void iterateThroughCurveSegments(const QString &curveName, const Functor2wRet< const Point &, const Point &, CallbackSearchReturn > &ftorWithCallback) const
See Curve::iterateThroughCurveSegments, for any axes or graph curve.
virtual DocumentModelGridRemoval modelGridRemoval() const
Get method for DocumentModelGridRemoval.
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:258
Model for DlgSettingsGridRemoval and CmdSettingsGridRemoval. The settings are unstable until the user...
void saveXml(QXmlStreamWriter &writer) const
Serialize curve.
Definition: Curve.cpp:465
void printStream(QString indentation, QTextStream &str) const
Debugging method that supports print method of this class and printStream method of some other class(...
static PointStyle defaultGraphCurve(int index)
Initial default for index&#39;th graph curve.
Definition: PointStyle.cpp:83
void setPointSeparation(double pointSeparation)
Set method for point separation.
virtual void saveXml(QXmlStreamWriter &writer) const
Save entire model as xml into stream.
void printStream(QString indentation, QTextStream &str) const
Debugging method that supports print method of this class and printStream method of some other class(...
virtual DocumentModelExportFormat modelExport() const
Get method for DocumentModelExportFormat.
CoordSystem(DocumentAxesPointsRequired documentAxesPointsRequired)
Single constructor.
Definition: CoordSystem.cpp:38
void printStream(QString indentation, QTextStream &str) const
Debugging method that supports print method of this class and printStream method of some other class(...
void printStream(QString indentation, QTextStream &str) const
Debugging method that supports print method of this class and printStream method of some other class(...
void setPaletteColorAccepted(ColorPalette paletteColorAccepted)
Set method for accepted color.
void setStopX(double stopX)
Set method for x stop.
virtual void iterateThroughCurvePointsAxes(const Functor2wRet< const QString &, const Point &, CallbackSearchReturn > &ftorWithCallback)
See Curve::iterateThroughCurvePoints, for the axes curve.
void setCoordScaleXTheta(CoordScale coordScale)
Set method for linear/log scale on x/theta.
virtual void setModelCoords(const DocumentModelCoords &modelCoords)
Set method for DocumentModelCoords.
CallbackSearchReturn callback(const QString &curveName, const Point &point)
Callback method.
void setXLabel(const QString &xLabel)
Set method for x label.
virtual void setModelDigitizeCurve(const DocumentModelDigitizeCurve &modelDigitizeCurve)
Set method for DocumentModelDigitizeCurve.
void setCoordsType(CoordsType coordsType)
Set method for coordinates type.