Engauge Digitizer  2
 All Classes Files Functions Variables Enumerations Enumerator Friends Pages
CoordSystemContext.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 "CoordSystemContext.h"
8 #include "EngaugeAssert.h"
9 #include "Logger.h"
10 
11 const CoordSystemIndex DEFAULT_COORD_SYSTEM_INDEX = 0;
12 
14  m_coordSystemIndex (DEFAULT_COORD_SYSTEM_INDEX)
15 {
16  LOG4CPP_INFO_S ((*mainCat)) << "CoordSystemContext::CoordSystemContext";
17 }
18 
19 CoordSystemContext::~CoordSystemContext()
20 {
21  LOG4CPP_INFO_S ((*mainCat)) << "CoordSystemContext::~CoordSystemContext";
22 
23  for (int i = 0; i < m_coordSystems.count(); i++) {
24  CoordSystem *coordSystem = m_coordSystems.at (i);
25  delete coordSystem;
26  }
27 
28  m_coordSystems.clear ();
29  m_coordSystemIndex = 0;
30 }
31 
32 void CoordSystemContext::addCoordSystems(DocumentAxesPointsRequired documentAxesPointsRequired,
33  unsigned int numberCoordSystemToAdd)
34 {
35  LOG4CPP_INFO_S ((*mainCat)) << "CoordSystemContext::addCoordSystems"
36  << " numberToAdd=" << numberCoordSystemToAdd;
37 
38  // The CoordSystem vector is populated with defaults here
39  for (unsigned int i = 0; i < numberCoordSystemToAdd; i++) {
40  m_coordSystems.push_back (new CoordSystem (documentAxesPointsRequired));
41  }
42 }
43 
44 void CoordSystemContext::addGraphCurveAtEnd (const QString &curveName)
45 {
46  LOG4CPP_INFO_S ((*mainCat)) << "CoordSystemContext::addGraphCurveAtEnd";
47 
48  m_coordSystems [m_coordSystemIndex]->addGraphCurveAtEnd(curveName);
49 }
50 
52  const QPointF &posGraph,
53  QString &identifier,
54  double ordinal,
55  bool isXOnly)
56 {
57  LOG4CPP_INFO_S ((*mainCat)) << "CoordSystemContext::addPointAxisWithGeneratedIdentifier";
58 
59  m_coordSystems [m_coordSystemIndex]->addPointAxisWithGeneratedIdentifier(posScreen,
60  posGraph,
61  identifier,
62  ordinal,
63  isXOnly);
64 }
65 
67  const QPointF &posGraph,
68  const QString &identifier,
69  double ordinal,
70  bool isXOnly)
71 {
72  LOG4CPP_INFO_S ((*mainCat)) << "CoordSystemContext::addPointAxisWithSpecifiedIdentifier";
73 
74  m_coordSystems [m_coordSystemIndex]->addPointAxisWithSpecifiedIdentifier(posScreen,
75  posGraph,
76  identifier,
77  ordinal,
78  isXOnly);
79 }
80 
82  const QPointF &posScreen,
83  QString &generatedIdentifier,
84  double ordinal)
85 {
86  LOG4CPP_INFO_S ((*mainCat)) << "CoordSystemContext::addPointGraphWithGeneratedIdentifier";
87 
88  m_coordSystems [m_coordSystemIndex]->addPointGraphWithGeneratedIdentifier(curveName,
89  posScreen,
90  generatedIdentifier,
91  ordinal);
92 }
93 
95  const QPointF &posScreen,
96  const QString &identifier,
97  double ordinal)
98 {
99  LOG4CPP_INFO_S ((*mainCat)) << "CoordSystemContext::addPointGraphWithSpecifiedIdentifier";
100 
101  m_coordSystems [m_coordSystemIndex]->addPointGraphWithSpecifiedIdentifier(curveName,
102  posScreen,
103  identifier,
104  ordinal);
105 }
106 
108 {
109  LOG4CPP_INFO_S ((*mainCat)) << "CoordSystemContext::addPointsInCurvesGraphs";
110 
111  m_coordSystems [m_coordSystemIndex]->addPointsInCurvesGraphs(curvesGraphs);
112 }
113 
114 void CoordSystemContext::checkAddPointAxis (const QPointF &posScreen,
115  const QPointF &posGraph,
116  bool &isError,
117  QString &errorMessage,
118  bool isXOnly)
119 {
120  LOG4CPP_INFO_S ((*mainCat)) << "CoordSystemContext::checkAddPointAxis";
121 
122  m_coordSystems [m_coordSystemIndex]->checkAddPointAxis(posScreen,
123  posGraph,
124  isError,
125  errorMessage,
126  isXOnly);
127 }
128 
129 void CoordSystemContext::checkEditPointAxis (const QString &pointIdentifier,
130  const QPointF &posScreen,
131  const QPointF &posGraph,
132  bool &isError,
133  QString &errorMessage)
134 {
135  LOG4CPP_INFO_S ((*mainCat)) << "CoordSystemContext::checkEditPointAxis";
136 
137  m_coordSystems [m_coordSystemIndex]->checkEditPointAxis(pointIdentifier,
138  posScreen,
139  posGraph,
140  isError,
141  errorMessage);
142 }
143 
145 {
146  LOG4CPP_INFO_S ((*mainCat)) << "CoordSystemContext::coordSystem";
147 
148  return *(m_coordSystems [m_coordSystemIndex]);
149 }
150 
152 {
153  return m_coordSystems.count();
154 }
155 
156 CoordSystemIndex CoordSystemContext::coordSystemIndex () const
157 {
158  return m_coordSystemIndex;
159 }
160 
162 {
163  LOG4CPP_INFO_S ((*mainCat)) << "CoordSystemContext::curveAxes";
164 
165  return m_coordSystems [m_coordSystemIndex]->curveAxes();
166 }
167 
168 Curve *CoordSystemContext::curveForCurveName (const QString &curveName)
169 {
170  LOG4CPP_INFO_S ((*mainCat)) << "CoordSystemContext::curveForCurveName";
171 
172  return m_coordSystems [m_coordSystemIndex]->curveForCurveName(curveName);
173 }
174 
175 const Curve *CoordSystemContext::curveForCurveName (const QString &curveName) const
176 {
177  LOG4CPP_INFO_S ((*mainCat)) << "CoordSystemContext::curveForCurveName";
178 
179  return m_coordSystems [m_coordSystemIndex]->curveForCurveName(curveName);
180 }
181 
183 {
184  LOG4CPP_INFO_S ((*mainCat)) << "CoordSystemContext::curvesGraphs";
185 
186  return m_coordSystems [m_coordSystemIndex]->curvesGraphs();
187 }
188 
190 {
191  LOG4CPP_INFO_S ((*mainCat)) << "CoordSystemContext::curvesGraphsNames";
192 
193  return m_coordSystems [m_coordSystemIndex]->curvesGraphsNames();
194 }
195 
196 int CoordSystemContext::curvesGraphsNumPoints (const QString &curveName) const
197 {
198  LOG4CPP_INFO_S ((*mainCat)) << "CoordSystemContext::curvesGraphsNumPoints";
199 
200  return m_coordSystems [m_coordSystemIndex]->curvesGraphsNumPoints(curveName);
201 }
202 
203 DocumentAxesPointsRequired CoordSystemContext::documentAxesPointsRequired () const
204 {
205  return m_coordSystems [m_coordSystemIndex]->documentAxesPointsRequired ();
206 }
207 
208 void CoordSystemContext::editPointAxis (const QPointF &posGraph,
209  const QString &identifier)
210 {
211  LOG4CPP_INFO_S ((*mainCat)) << "CoordSystemContext::editPointAxis";
212 
213  m_coordSystems [m_coordSystemIndex]->editPointAxis(posGraph,
214  identifier);
215 }
216 
218  bool isY,
219  double x,
220  double y,
221  const QStringList &identifiers,
222  const Transformation &transformation)
223 {
224  LOG4CPP_INFO_S ((*mainCat)) << "CoordSystemContext::editPointGraph";
225 
226  m_coordSystems [m_coordSystemIndex]->editPointGraph (isX,
227  isY,
228  x,
229  y,
230  identifiers,
231  transformation);
232 }
233 
234 bool CoordSystemContext::isXOnly (const QString &pointIdentifier) const
235 {
236  LOG4CPP_INFO_S ((*mainCat)) << "CoordSystemContext::isXOnly";
237 
238  return m_coordSystems [m_coordSystemIndex]->isXOnly (pointIdentifier);
239 }
240 
241 void CoordSystemContext::iterateThroughCurvePointsAxes (const Functor2wRet<const QString &, const Point &, CallbackSearchReturn> &ftorWithCallback)
242 {
243  LOG4CPP_INFO_S ((*mainCat)) << "CoordSystemContext::iterateThroughCurvePointsAxes";
244 
245  m_coordSystems [m_coordSystemIndex]->iterateThroughCurvePointsAxes(ftorWithCallback);
246 }
247 
248 void CoordSystemContext::iterateThroughCurvePointsAxes (const Functor2wRet<const QString &, const Point &, CallbackSearchReturn> &ftorWithCallback) const
249 {
250  LOG4CPP_INFO_S ((*mainCat)) << "CoordSystemContext::iterateThroughCurvePointsAxes";
251 
252  m_coordSystems [m_coordSystemIndex]->iterateThroughCurvePointsAxes(ftorWithCallback);
253 }
254 
255 void CoordSystemContext::iterateThroughCurveSegments (const QString &curveName,
256  const Functor2wRet<const Point &, const Point &, CallbackSearchReturn> &ftorWithCallback) const
257 {
258  LOG4CPP_INFO_S ((*mainCat)) << "CoordSystemContext::iterateThroughCurveSegments";
259 
260  m_coordSystems [m_coordSystemIndex]->iterateThroughCurveSegments(curveName,
261  ftorWithCallback);
262 }
263 
264 void CoordSystemContext::iterateThroughCurvesPointsGraphs (const Functor2wRet<const QString &, const Point &, CallbackSearchReturn> &ftorWithCallback)
265 {
266  LOG4CPP_INFO_S ((*mainCat)) << "CoordSystemContext::iterateThroughCurvesPointsGraphs";
267 
268  m_coordSystems [m_coordSystemIndex]->iterateThroughCurvesPointsGraphs(ftorWithCallback);
269 }
270 
271 void CoordSystemContext::iterateThroughCurvesPointsGraphs (const Functor2wRet<const QString &, const Point &, CallbackSearchReturn> &ftorWithCallback) const
272 {
273  LOG4CPP_INFO_S ((*mainCat)) << "CoordSystemContext::iterateThroughCurvesPointsGraphs";
274 
275  m_coordSystems [m_coordSystemIndex]->iterateThroughCurvesPointsGraphs(ftorWithCallback);
276 }
277 
278 bool CoordSystemContext::loadCurvesFile (const QString &curvesFile)
279 {
280  LOG4CPP_INFO_S ((*mainCat)) << "CoordSystemContext::loadCurvesFile";
281 
282  return m_coordSystems [m_coordSystemIndex]->loadCurvesFile (curvesFile);
283 }
284 
285 void CoordSystemContext::loadPreVersion6 (QDataStream &str,
286  double version)
287 {
288  LOG4CPP_INFO_S ((*mainCat)) << "CoordSystemContext::loadPreVersion6";
289 
290  m_coordSystems [m_coordSystemIndex]->loadPreVersion6 (str,
291  version);
292 }
293 
294 void CoordSystemContext::loadVersion6 (QXmlStreamReader &reader)
295 {
296  LOG4CPP_INFO_S ((*mainCat)) << "CoordSystemContext::loadVersion6";
297 
298  m_coordSystems [m_coordSystemIndex]->loadVersion6 (reader);
299 }
300 
301 void CoordSystemContext::loadVersions7AndUp (QXmlStreamReader &reader,
302  DocumentAxesPointsRequired documentAxesPointsRequired)
303 {
304  LOG4CPP_INFO_S ((*mainCat)) << "CoordSystemContext::loadVersion7AndUp";
305 
306  int indexLast = m_coordSystems.count() - 1;
307  m_coordSystems [indexLast]->loadVersions7AndUp (reader,
308  documentAxesPointsRequired);
309 }
310 
312 {
313  LOG4CPP_DEBUG_S ((*mainCat)) << "CoordSystemContext::modelAxesChecker";
314 
315  return m_coordSystems [m_coordSystemIndex]->modelAxesChecker();
316 }
317 
319 {
320  LOG4CPP_DEBUG_S ((*mainCat)) << "CoordSystemContext::modelColorFilter";
321 
322  return m_coordSystems [m_coordSystemIndex]->modelColorFilter();
323 }
324 
326 {
327  LOG4CPP_DEBUG_S ((*mainCat)) << "CoordSystemContext::modelCoords";
328 
329  return m_coordSystems [m_coordSystemIndex]->modelCoords();
330 }
331 
333 {
334  LOG4CPP_DEBUG_S ((*mainCat)) << "CoordSystemContext::modelCurveStyles";
335 
336  return m_coordSystems [m_coordSystemIndex]->modelCurveStyles();
337 }
338 
340 {
341  LOG4CPP_DEBUG_S ((*mainCat)) << "CoordSystemContext::modelDigitizeCurve";
342 
343  return m_coordSystems [m_coordSystemIndex]->modelDigitizeCurve();
344 }
345 
347 {
348  LOG4CPP_DEBUG_S ((*mainCat)) << "CoordSystemContext::modelExport";
349 
350  return m_coordSystems [m_coordSystemIndex]->modelExport();
351 }
352 
354 {
355  LOG4CPP_DEBUG_S ((*mainCat)) << "CoordSystemContext::modelGeneral";
356 
357  return m_coordSystems [m_coordSystemIndex]->modelGeneral();
358 }
359 
361 {
362  LOG4CPP_DEBUG_S ((*mainCat)) << "CoordSystemContext::modelGridDisplay";
363 
364  return m_coordSystems [m_coordSystemIndex]->modelGridDisplay();
365 }
366 
368 {
369  LOG4CPP_DEBUG_S ((*mainCat)) << "CoordSystemContext::modelGridRemoval";
370 
371  return m_coordSystems [m_coordSystemIndex]->modelGridRemoval();
372 }
373 
375 {
376  LOG4CPP_DEBUG_S ((*mainCat)) << "CoordSystemContext::modelPointMatch";
377 
378  return m_coordSystems [m_coordSystemIndex]->modelPointMatch();
379 }
380 
382 {
383  LOG4CPP_DEBUG_S ((*mainCat)) << "CoordSystemContext::modelSegments";
384 
385  return m_coordSystems [m_coordSystemIndex]->modelSegments();
386 }
387 
388 void CoordSystemContext::movePoint (const QString &pointIdentifier,
389  const QPointF &deltaScreen)
390 {
391  LOG4CPP_INFO_S ((*mainCat)) << "CoordSystemContext::movePoint";
392 
393  return m_coordSystems [m_coordSystemIndex]->movePoint(pointIdentifier,
394  deltaScreen);
395 }
396 
397 int CoordSystemContext::nextOrdinalForCurve (const QString &curveName) const
398 {
399  LOG4CPP_INFO_S ((*mainCat)) << "CoordSystemContext::nextOrdinalForCurve";
400 
401  return m_coordSystems [m_coordSystemIndex]->nextOrdinalForCurve(curveName);
402 }
403 
404 QPointF CoordSystemContext::positionGraph (const QString &pointIdentifier) const
405 {
406  LOG4CPP_INFO_S ((*mainCat)) << "CoordSystemContext::positionGraph";
407 
408  return m_coordSystems [m_coordSystemIndex]->positionGraph(pointIdentifier);
409 }
410 
411 QPointF CoordSystemContext::positionScreen (const QString &pointIdentifier) const
412 {
413  LOG4CPP_INFO_S ((*mainCat)) << "CoordSystemContext::addGraphCurveAtEnd";
414 
415  return m_coordSystems [m_coordSystemIndex]->positionScreen(pointIdentifier);
416 }
417 
419 {
420  LOG4CPP_INFO_S ((*mainCat)) << "CoordSystemContext::print";
421 
422  return m_coordSystems [m_coordSystemIndex]->print();
423 }
424 
425 void CoordSystemContext::printStream (QString indentation,
426  QTextStream &str) const
427 {
428  LOG4CPP_INFO_S ((*mainCat)) << "CoordSystemContext::printStream";
429 
430  m_coordSystems [m_coordSystemIndex]->printStream(indentation,
431  str);
432 }
433 
435 {
436  LOG4CPP_INFO_S ((*mainCat)) << "CoordSystemContext::reasonForUnsuccessfulRead";
437 
438  return m_coordSystems [m_coordSystemIndex]->reasonForUnsuccessfulRead();
439 }
440 
441 void CoordSystemContext::removePointAxis (const QString &identifier)
442 {
443  LOG4CPP_INFO_S ((*mainCat)) << "CoordSystemContext::removePointAxis";
444 
445  m_coordSystems [m_coordSystemIndex]->removePointAxis(identifier);
446 }
447 
448 void CoordSystemContext::removePointGraph (const QString &identifier)
449 {
450  LOG4CPP_INFO_S ((*mainCat)) << "CoordSystemContext::removePointGraph";
451 
452  m_coordSystems [m_coordSystemIndex]->removePointGraph(identifier);
453 }
454 
456 {
457  LOG4CPP_INFO_S ((*mainCat)) << "CoordSystemContext::removePointsInCurvesGraphs";
458 
459  m_coordSystems [m_coordSystemIndex]->removePointsInCurvesGraphs(curvesGraphs);
460 }
461 
462 void CoordSystemContext::saveXml (QXmlStreamWriter &writer) const
463 {
464  LOG4CPP_INFO_S ((*mainCat)) << "CoordSystemContext::saveXml";
465 
466  for (int index = 0; index < m_coordSystems.count(); index++) {
467  m_coordSystems [index]->saveXml (writer);
468  }
469 }
470 
472 {
473  return m_coordSystems [m_coordSystemIndex]->selectedCurveName();
474 }
475 
476 void CoordSystemContext::setCoordSystemIndex(CoordSystemIndex coordSystemIndex)
477 {
478  LOG4CPP_INFO_S ((*mainCat)) << "CoordSystemContext::setCoordSystemIndex"
479  << " index=" << coordSystemIndex;
480 
481  ENGAUGE_ASSERT(coordSystemIndex < (unsigned int) m_coordSystems.count());
482 
483  m_coordSystemIndex = coordSystemIndex;
484 }
485 
487 {
488  LOG4CPP_INFO_S ((*mainCat)) << "CoordSystemContext::setCurveAxes";
489 
490  m_coordSystems [m_coordSystemIndex]->setCurveAxes(curveAxes);
491 }
492 
494 {
495  LOG4CPP_INFO_S ((*mainCat)) << "CoordSystemContext::setCurvesGraphs";
496 
497  m_coordSystems [m_coordSystemIndex]->setCurvesGraphs(curvesGraphs);
498 }
499 
501 {
502  LOG4CPP_INFO_S ((*mainCat)) << "CoordSystemContext::setModelAxesChecker";
503 
504  m_coordSystems [m_coordSystemIndex]->setModelAxesChecker(modelAxesChecker);
505 }
506 
508 {
509  LOG4CPP_INFO_S ((*mainCat)) << "CoordSystemContext::setModelColorFilter";
510 
511  m_coordSystems [m_coordSystemIndex]->setModelColorFilter(modelColorFilter);
512 }
513 
515 {
516  LOG4CPP_INFO_S ((*mainCat)) << "CoordSystemContext::setModelCoords";
517 
518  m_coordSystems [m_coordSystemIndex]->setModelCoords(modelCoords);
519 }
520 
522 {
523  LOG4CPP_INFO_S ((*mainCat)) << "CoordSystemContext::setModelCurveStyles";
524 
525  m_coordSystems [m_coordSystemIndex]->setModelCurveStyles(modelCurveStyles);
526 }
527 
529 {
530  LOG4CPP_INFO_S ((*mainCat)) << "CoordSystemContext::setModelDigitizeCurve";
531 
532  m_coordSystems [m_coordSystemIndex]->setModelDigitizeCurve(modelDigitizeCurve);
533 }
534 
536 {
537  LOG4CPP_INFO_S ((*mainCat)) << "CoordSystemContext::setModelExport";
538 
539  m_coordSystems [m_coordSystemIndex]->setModelExport (modelExport);
540 }
541 
543 {
544  LOG4CPP_INFO_S ((*mainCat)) << "CoordSystemContext::setModelGeneral";
545 
546  m_coordSystems [m_coordSystemIndex]->setModelGeneral(modelGeneral);
547 }
548 
550 {
551  LOG4CPP_INFO_S ((*mainCat)) << "CoordSystemContext::setModelGridDisplay";
552 
553  m_coordSystems [m_coordSystemIndex]->setModelGridDisplay(modelGridDisplay);
554 }
555 
557 {
558  LOG4CPP_INFO_S ((*mainCat)) << "CoordSystemContext::setModelGridRemoval";
559 
560  m_coordSystems [m_coordSystemIndex]->setModelGridRemoval(modelGridRemoval);
561 }
562 
564 {
565  LOG4CPP_INFO_S ((*mainCat)) << "CoordSystemContext::setModelPointMatch";
566 
567  m_coordSystems [m_coordSystemIndex]->setModelPointMatch(modelPointMatch);
568 }
569 
571 {
572  LOG4CPP_INFO_S ((*mainCat)) << "CoordSystemContext::setModelSegments";
573 
574  m_coordSystems [m_coordSystemIndex]->setModelSegments(modelSegments);
575 }
576 
577 void CoordSystemContext::setSelectedCurveName(const QString &selectedCurveName)
578 {
579  m_coordSystems [m_coordSystemIndex]->setSelectedCurveName(selectedCurveName);
580 }
581 
583 {
584  LOG4CPP_INFO_S ((*mainCat)) << "CoordSystemContext::successfulRead";
585 
586  return m_coordSystems [m_coordSystemIndex]->successfulRead();
587 }
588 
590 {
591  LOG4CPP_INFO_S ((*mainCat)) << "CoordSystemContext::updatePointOrdinals";
592 
593  m_coordSystems [m_coordSystemIndex]->updatePointOrdinals(transformation);
594 }
virtual QString selectedCurveName() const
Currently selected curve name. This is used to set the selected curve combobox in MainWindow...
void addCoordSystems(DocumentAxesPointsRequired documentAxesPointsRequired, unsigned int numberCoordSystemToAdd)
Add specified number of coordinate systems to the original one created by the constructor.
virtual DocumentModelGeneral modelGeneral() const
Get method for DocumentModelGeneral.
Model for DlgSettingsGeneral and CmdSettingsGeneral.
virtual void saveXml(QXmlStreamWriter &writer) const
Save graph to xml.
Model for DlgSettingsPointMatch and CmdSettingsPointMatch.
Model for DlgSettingsGridDisplay and CmdSettingsGridDisplay.
virtual bool successfulRead() const
Return true if startup loading succeeded. If the loading failed then reasonForUnsuccessfulRed will ex...
virtual void addPointGraphWithGeneratedIdentifier(const QString &curveName, const QPointF &posScreen, QString &generatedIentifier, double ordinal)
Add a single graph point with a generated point identifier.
Model for DlgSettingsExportFormat and CmdSettingsExportFormat.
Model for DlgSettingsCurveProperties and CmdSettingsCurveProperties.
Definition: CurveStyles.h:22
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...
virtual DocumentModelGridRemoval modelGridRemoval() const
Get method for DocumentModelGridRemoval.
virtual void checkEditPointAxis(const QString &pointIdentifier, const QPointF &posScreen, const QPointF &posGraph, bool &isError, QString &errorMessage)
Check before calling editPointAxis.
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...
Storage of data belonging to one coordinate system.
Definition: CoordSystem.h:42
const CoordSystem & coordSystem() const
Current CoordSystem.
virtual DocumentModelExportFormat modelExport() const
Get method for DocumentModelExportFormat.
virtual Curve * curveForCurveName(const QString &curveName)
See CurvesGraphs::curveForCurveName, although this also works for AXIS_CURVE_NAME.
unsigned int coordSystemCount() const
Number of CoordSystem.
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...
CoordSystemIndex coordSystemIndex() const
Index of current CoordSystem.
virtual void removePointsInCurvesGraphs(CurvesGraphs &curvesGraphs)
Remove all points identified in the specified CurvesGraphs. See also addPointsInCurvesGraphs.
virtual void setModelCoords(const DocumentModelCoords &modelCoords)
Set method for DocumentModelCoords.
virtual const Curve & curveAxes() const
Get method for axis curve.
virtual void setModelColorFilter(const DocumentModelColorFilter &modelColorFilter)
Set method for DocumentModelColorFilter.
virtual void setSelectedCurveName(const QString &selectedCurveName)
Save curve name that is selected for the current coordinate system, for the next time the coordinate ...
virtual void setModelGridDisplay(const DocumentModelGridDisplay &modelGridDisplay)
Set method for DocumentModelGridDisplay.
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.
virtual void setCurvesGraphs(const CurvesGraphs &curvesGraphs)
Let CmdAbstract classes overwrite CurvesGraphs. Applies to current coordinate system.
virtual CurveStyles modelCurveStyles() const
Get method for CurveStyles.
virtual void setModelCurveStyles(const CurveStyles &modelCurveStyles)
Set method for CurveStyles.
void loadVersions7AndUp(QXmlStreamReader &reader, DocumentAxesPointsRequired documentAxesPointsRequired)
Load one CoordSystem from file in version 7 format or newer, into the most recent CoordSystem which w...
void loadVersion6(QXmlStreamReader &reader)
Load from file in version 6 format, into the single CoordSystem.
virtual DocumentModelColorFilter modelColorFilter() const
Get method for DocumentModelColorFilter.
virtual void setCurveAxes(const Curve &curveAxes)
Let CmdAbstract classes overwrite axes Curve. Applies to current coordinate system.
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 void setModelGridRemoval(const DocumentModelGridRemoval &modelGridRemoval)
Set method for DocumentModelGridRemoval.
Model for DlgSettingsDigitizeCurve and CmdSettingsDigitizeCurve.
virtual void setModelAxesChecker(const DocumentModelAxesChecker &modelAxesChecker)
Set method for DocumentModelAxesChecker.
void loadPreVersion6(QDataStream &str, double version)
Load from file in pre-version 6 format.
Affine transformation between screen and graph coordinates, based on digitized axis points...
bool isXOnly(const QString &pointIdentifier) const
True/false if y/x value is empty.
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 setModelExport(const DocumentModelExportFormat &modelExport)
Set method for DocumentModelExportFormat.
void setModelPointMatch(const DocumentModelPointMatch &modelPointMatch)
Set method for DocumentModelPointMatch.
virtual void addPointsInCurvesGraphs(CurvesGraphs &curvesGraphs)
Add all points identified in the specified CurvesGraphs. See also removePointsInCurvesGraphs.
virtual QString reasonForUnsuccessfulRead() const
Return an informative text message explaining why startup loading failed. Applies if successfulRead r...
virtual QStringList curvesGraphsNames() const
See CurvesGraphs::curvesGraphsNames.
virtual void addGraphCurveAtEnd(const QString &curveName)
Add new graph curve to the list of existing graph curves.
virtual void setModelDigitizeCurve(const DocumentModelDigitizeCurve &modelDigitizeCurve)
Set method for DocumentModelDigitizeCurve.
virtual void removePointGraph(const QString &identifier)
Perform the opposite of addPointGraph.
virtual void setModelSegments(const DocumentModelSegments &modelSegments)
Set method for DocumentModelSegments.
Model for DlgSettingsCoords and CmdSettingsCoords.
virtual void removePointAxis(const QString &identifier)
Perform the opposite of addPointAxis.
virtual void print() const
Debugging method for printing directly from symbolic debugger.
virtual DocumentModelAxesChecker modelAxesChecker() const
Get method for DocumentModelAxesChecker.
Container for one set of digitized Points.
Definition: Curve.h:33
virtual int nextOrdinalForCurve(const QString &curveName) const
Default next ordinal value for specified curve.
virtual QPointF positionGraph(const QString &pointIdentifier) const
See Curve::positionGraph.
virtual DocumentAxesPointsRequired documentAxesPointsRequired() const
Number of axes points for map or graph. This value is returned after opening a file.
Model for DlgSettingsAxesChecker and CmdSettingsAxesChecker.
virtual void setModelGeneral(const DocumentModelGeneral &modelGeneral)
Set method for DocumentModelGeneral.
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.
virtual 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.
virtual QPointF positionScreen(const QString &pointIdentifier) const
See Curve::positionScreen.
virtual 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 iterateThroughCurvePointsAxes(const Functor2wRet< const QString &, const Point &, CallbackSearchReturn > &ftorWithCallback)
See Curve::iterateThroughCurvePoints, for the axes curve.
virtual int curvesGraphsNumPoints(const QString &curveName) const
See CurvesGraphs::curvesGraphsNumPoints.
Model for DlgSettingsSegments and CmdSettingsSegments.
virtual const CurvesGraphs & curvesGraphs() const
Make all Curves available, read only, for CmdAbstract classes only.
virtual void updatePointOrdinals(const Transformation &transformation)
Update point ordinals after point addition/removal or dragging.
virtual DocumentModelPointMatch modelPointMatch() const
Get method for DocumentModelPointMatch.
virtual DocumentModelSegments modelSegments() const
Get method for DocumentModelSegments.
CoordSystemContext()
Default constructor for constructing from opened file.
virtual void movePoint(const QString &pointIdentifier, const QPointF &deltaScreen)
See Curve::movePoint.
virtual DocumentModelGridDisplay modelGridDisplay() const
Get method for DocumentModelGridDisplay.
virtual DocumentModelCoords modelCoords() const
Get method for DocumentModelCoords.
Model for DlgSettingsGridRemoval and CmdSettingsGridRemoval. The settings are unstable until the user...
void setCoordSystemIndex(CoordSystemIndex coordSystemIndex)
Index of current CoordSystem.
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 iterateThroughCurvesPointsGraphs(const Functor2wRet< const QString &, const Point &, CallbackSearchReturn > &ftorWithCallback)
See Curve::iterateThroughCurvePoints, for all the graphs curves.
virtual DocumentModelDigitizeCurve modelDigitizeCurve() const
Get method for DocumentModelDigitizeCurve.