Engauge Digitizer  2
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(unsigned int numberCoordSystemToAdd)
33 {
34  LOG4CPP_INFO_S ((*mainCat)) << "CoordSystemContext::addCoordSystems"
35  << " numberToAdd=" << numberCoordSystemToAdd;
36 
37  // The CoordSystem vector is populated with defaults here
38  for (unsigned int i = 0; i < numberCoordSystemToAdd; i++) {
39  m_coordSystems.push_back (new CoordSystem ());
40  }
41 }
42 
43 void CoordSystemContext::addGraphCurveAtEnd (const QString &curveName)
44 {
45  LOG4CPP_INFO_S ((*mainCat)) << "CoordSystemContext::addGraphCurveAtEnd";
46 
47  m_coordSystems [m_coordSystemIndex]->addGraphCurveAtEnd(curveName);
48 }
49 
51  const QPointF &posGraph,
52  QString &identifier,
53  double ordinal,
54  bool isXOnly)
55 {
56  LOG4CPP_INFO_S ((*mainCat)) << "CoordSystemContext::addPointAxisWithGeneratedIdentifier";
57 
58  m_coordSystems [m_coordSystemIndex]->addPointAxisWithGeneratedIdentifier(posScreen,
59  posGraph,
60  identifier,
61  ordinal,
62  isXOnly);
63 }
64 
66  const QPointF &posGraph,
67  const QString &identifier,
68  double ordinal,
69  bool isXOnly)
70 {
71  LOG4CPP_INFO_S ((*mainCat)) << "CoordSystemContext::addPointAxisWithSpecifiedIdentifier";
72 
73  m_coordSystems [m_coordSystemIndex]->addPointAxisWithSpecifiedIdentifier(posScreen,
74  posGraph,
75  identifier,
76  ordinal,
77  isXOnly);
78 }
79 
81  const QPointF &posScreen,
82  QString &generatedIdentifier,
83  double ordinal)
84 {
85  LOG4CPP_INFO_S ((*mainCat)) << "CoordSystemContext::addPointGraphWithGeneratedIdentifier";
86 
87  m_coordSystems [m_coordSystemIndex]->addPointGraphWithGeneratedIdentifier(curveName,
88  posScreen,
89  generatedIdentifier,
90  ordinal);
91 }
92 
94  const QPointF &posScreen,
95  const QString &identifier,
96  double ordinal)
97 {
98  LOG4CPP_INFO_S ((*mainCat)) << "CoordSystemContext::addPointGraphWithSpecifiedIdentifier";
99 
100  m_coordSystems [m_coordSystemIndex]->addPointGraphWithSpecifiedIdentifier(curveName,
101  posScreen,
102  identifier,
103  ordinal);
104 }
105 
107 {
108  LOG4CPP_INFO_S ((*mainCat)) << "CoordSystemContext::addPointsInCurvesGraphs";
109 
110  m_coordSystems [m_coordSystemIndex]->addPointsInCurvesGraphs(curvesGraphs);
111 }
112 
113 void CoordSystemContext::checkAddPointAxis (const QPointF &posScreen,
114  const QPointF &posGraph,
115  bool &isError,
116  QString &errorMessage,
117  bool isXOnly,
118  DocumentAxesPointsRequired documentAxesPointsRequired)
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  documentAxesPointsRequired);
128 }
129 
130 void CoordSystemContext::checkEditPointAxis (const QString &pointIdentifier,
131  const QPointF &posScreen,
132  const QPointF &posGraph,
133  bool &isError,
134  QString &errorMessage,
135  DocumentAxesPointsRequired documentAxesPointsRequired)
136 {
137  LOG4CPP_INFO_S ((*mainCat)) << "CoordSystemContext::checkEditPointAxis";
138 
139  m_coordSystems [m_coordSystemIndex]->checkEditPointAxis(pointIdentifier,
140  posScreen,
141  posGraph,
142  isError,
143  errorMessage,
144  documentAxesPointsRequired);
145 }
146 
148 {
149  LOG4CPP_INFO_S ((*mainCat)) << "CoordSystemContext::coordSystem";
150 
151  return *(m_coordSystems [m_coordSystemIndex]);
152 }
153 
155 {
156  return m_coordSystems.count();
157 }
158 
159 CoordSystemIndex CoordSystemContext::coordSystemIndex () const
160 {
161  return m_coordSystemIndex;
162 }
163 
165 {
166  LOG4CPP_INFO_S ((*mainCat)) << "CoordSystemContext::curveAxes";
167 
168  return m_coordSystems [m_coordSystemIndex]->curveAxes();
169 }
170 
171 Curve *CoordSystemContext::curveForCurveName (const QString &curveName)
172 {
173  LOG4CPP_INFO_S ((*mainCat)) << "CoordSystemContext::curveForCurveName";
174 
175  return m_coordSystems [m_coordSystemIndex]->curveForCurveName(curveName);
176 }
177 
178 const Curve *CoordSystemContext::curveForCurveName (const QString &curveName) const
179 {
180  LOG4CPP_INFO_S ((*mainCat)) << "CoordSystemContext::curveForCurveName";
181 
182  return m_coordSystems [m_coordSystemIndex]->curveForCurveName(curveName);
183 }
184 
186 {
187  LOG4CPP_INFO_S ((*mainCat)) << "CoordSystemContext::curvesGraphs";
188 
189  return m_coordSystems [m_coordSystemIndex]->curvesGraphs();
190 }
191 
193 {
194  LOG4CPP_INFO_S ((*mainCat)) << "CoordSystemContext::curvesGraphsNames";
195 
196  return m_coordSystems [m_coordSystemIndex]->curvesGraphsNames();
197 }
198 
199 int CoordSystemContext::curvesGraphsNumPoints (const QString &curveName) const
200 {
201  LOG4CPP_INFO_S ((*mainCat)) << "CoordSystemContext::curvesGraphsNumPoints";
202 
203  return m_coordSystems [m_coordSystemIndex]->curvesGraphsNumPoints(curveName);
204 }
205 
206 void CoordSystemContext::editPointAxis (const QPointF &posGraph,
207  const QString &identifier)
208 {
209  LOG4CPP_INFO_S ((*mainCat)) << "CoordSystemContext::editPointAxis";
210 
211  m_coordSystems [m_coordSystemIndex]->editPointAxis(posGraph,
212  identifier);
213 }
214 
216  bool isY,
217  double x,
218  double y,
219  const QStringList &identifiers,
220  const Transformation &transformation)
221 {
222  LOG4CPP_INFO_S ((*mainCat)) << "CoordSystemContext::editPointGraph";
223 
224  m_coordSystems [m_coordSystemIndex]->editPointGraph (isX,
225  isY,
226  x,
227  y,
228  identifiers,
229  transformation);
230 }
231 
232 bool CoordSystemContext::isXOnly (const QString &pointIdentifier) const
233 {
234  LOG4CPP_INFO_S ((*mainCat)) << "CoordSystemContext::isXOnly";
235 
236  return m_coordSystems [m_coordSystemIndex]->isXOnly (pointIdentifier);
237 }
238 
239 void CoordSystemContext::iterateThroughCurvePointsAxes (const Functor2wRet<const QString &, const Point &, CallbackSearchReturn> &ftorWithCallback)
240 {
241  LOG4CPP_INFO_S ((*mainCat)) << "CoordSystemContext::iterateThroughCurvePointsAxes";
242 
243  m_coordSystems [m_coordSystemIndex]->iterateThroughCurvePointsAxes(ftorWithCallback);
244 }
245 
246 void CoordSystemContext::iterateThroughCurvePointsAxes (const Functor2wRet<const QString &, const Point &, CallbackSearchReturn> &ftorWithCallback) const
247 {
248  LOG4CPP_INFO_S ((*mainCat)) << "CoordSystemContext::iterateThroughCurvePointsAxes";
249 
250  m_coordSystems [m_coordSystemIndex]->iterateThroughCurvePointsAxes(ftorWithCallback);
251 }
252 
253 void CoordSystemContext::iterateThroughCurveSegments (const QString &curveName,
254  const Functor2wRet<const Point &, const Point &, CallbackSearchReturn> &ftorWithCallback) const
255 {
256  LOG4CPP_INFO_S ((*mainCat)) << "CoordSystemContext::iterateThroughCurveSegments";
257 
258  m_coordSystems [m_coordSystemIndex]->iterateThroughCurveSegments(curveName,
259  ftorWithCallback);
260 }
261 
262 void CoordSystemContext::iterateThroughCurvesPointsGraphs (const Functor2wRet<const QString &, const Point &, CallbackSearchReturn> &ftorWithCallback)
263 {
264  LOG4CPP_INFO_S ((*mainCat)) << "CoordSystemContext::iterateThroughCurvesPointsGraphs";
265 
266  m_coordSystems [m_coordSystemIndex]->iterateThroughCurvesPointsGraphs(ftorWithCallback);
267 }
268 
269 void CoordSystemContext::iterateThroughCurvesPointsGraphs (const Functor2wRet<const QString &, const Point &, CallbackSearchReturn> &ftorWithCallback) const
270 {
271  LOG4CPP_INFO_S ((*mainCat)) << "CoordSystemContext::iterateThroughCurvesPointsGraphs";
272 
273  m_coordSystems [m_coordSystemIndex]->iterateThroughCurvesPointsGraphs(ftorWithCallback);
274 }
275 
276 bool CoordSystemContext::loadCurvesFile (const QString &curvesFile)
277 {
278  LOG4CPP_INFO_S ((*mainCat)) << "CoordSystemContext::loadCurvesFile";
279 
280  return m_coordSystems [m_coordSystemIndex]->loadCurvesFile (curvesFile);
281 }
282 
283 void CoordSystemContext::loadPreVersion6 (QDataStream &str,
284  double version,
285  DocumentAxesPointsRequired &documentAxesPointsRequired)
286 {
287  LOG4CPP_INFO_S ((*mainCat)) << "CoordSystemContext::loadPreVersion6";
288 
289  m_coordSystems [m_coordSystemIndex]->loadPreVersion6 (str,
290  version,
291  documentAxesPointsRequired);
292 }
293 
294 void CoordSystemContext::loadVersion6 (QXmlStreamReader &reader,
295  DocumentAxesPointsRequired &documentAxesPointsRequired)
296 {
297  LOG4CPP_INFO_S ((*mainCat)) << "CoordSystemContext::loadVersion6";
298 
299  m_coordSystems [m_coordSystemIndex]->loadVersion6 (reader,
300  documentAxesPointsRequired);
301 }
302 
303 void CoordSystemContext::loadVersions7AndUp (QXmlStreamReader &reader)
304 {
305  LOG4CPP_INFO_S ((*mainCat)) << "CoordSystemContext::loadVersion7AndUp";
306 
307  int indexLast = m_coordSystems.count() - 1;
308  m_coordSystems [indexLast]->loadVersions7AndUp (reader);
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 
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 
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 }
Model for DlgSettingsGeneral and CmdSettingsGeneral.
void addCoordSystems(unsigned int numberCoordSystemToAdd)
Add specified number of coordinate systems to the original one created by the constructor.
virtual int curvesGraphsNumPoints(const QString &curveName) const
See CurvesGraphs::curvesGraphsNumPoints.
Model for DlgSettingsPointMatch and CmdSettingsPointMatch.
Model for DlgSettingsGridDisplay and CmdSettingsGridDisplay.
virtual void addPointGraphWithGeneratedIdentifier(const QString &curveName, const QPointF &posScreen, QString &generatedIentifier, double ordinal)
Add a single graph point with a generated point identifier.
virtual DocumentModelDigitizeCurve modelDigitizeCurve() const
Get method for DocumentModelDigitizeCurve.
virtual DocumentModelGridDisplay modelGridDisplay() const
Get method for DocumentModelGridDisplay.
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 void saveXml(QXmlStreamWriter &writer) const
Save graph to xml.
virtual DocumentModelGeneral modelGeneral() const
Get method for DocumentModelGeneral.
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...
virtual DocumentModelColorFilter modelColorFilter() const
Get method for DocumentModelColorFilter.
Storage of data belonging to one coordinate system.
Definition: CoordSystem.h:42
virtual DocumentModelPointMatch modelPointMatch() const
Get method for DocumentModelPointMatch.
virtual void checkAddPointAxis(const QPointF &posScreen, const QPointF &posGraph, bool &isError, QString &errorMessage, bool isXOnly, DocumentAxesPointsRequired documentAxesPointsRequired)
Check before calling addPointAxis. Also returns the next available ordinal number (to prevent clashes...
virtual bool successfulRead() const
Return true if startup loading succeeded. If the loading failed then reasonForUnsuccessfulRed will ex...
virtual Curve * curveForCurveName(const QString &curveName)
See CurvesGraphs::curveForCurveName, although this also works for AXIS_CURVE_NAME.
virtual DocumentModelAxesChecker modelAxesChecker() const
Get method for DocumentModelAxesChecker.
unsigned int coordSystemCount() const
Number of CoordSystem.
virtual void removePointsInCurvesGraphs(CurvesGraphs &curvesGraphs)
Remove all points identified in the specified CurvesGraphs. See also addPointsInCurvesGraphs.
void loadVersions7AndUp(QXmlStreamReader &reader)
Load one CoordSystem from file in version 7 format or newer, into the most recent CoordSystem which w...
virtual void setModelCoords(const DocumentModelCoords &modelCoords)
Set method for DocumentModelCoords.
CoordSystemIndex coordSystemIndex() const
Index of current CoordSystem.
virtual CurveStyles modelCurveStyles() const
Get method for CurveStyles.
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 int nextOrdinalForCurve(const QString &curveName) const
Default next ordinal value for specified curve.
virtual void setCurvesGraphs(const CurvesGraphs &curvesGraphs)
Let CmdAbstract classes overwrite CurvesGraphs. Applies to current coordinate system.
virtual void setModelCurveStyles(const CurveStyles &modelCurveStyles)
Set method for CurveStyles.
virtual void setCurveAxes(const Curve &curveAxes)
Let CmdAbstract classes overwrite axes Curve. Applies to current coordinate system.
virtual void setModelGridRemoval(const DocumentModelGridRemoval &modelGridRemoval)
Set method for DocumentModelGridRemoval.
Model for DlgSettingsDigitizeCurve and CmdSettingsDigitizeCurve.
bool isXOnly(const QString &pointIdentifier) const
True/false if y/x value is empty.
virtual void setModelAxesChecker(const DocumentModelAxesChecker &modelAxesChecker)
Set method for DocumentModelAxesChecker.
Affine transformation between screen and graph coordinates, based on digitized axis points...
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 checkEditPointAxis(const QString &pointIdentifier, const QPointF &posScreen, const QPointF &posGraph, bool &isError, QString &errorMessage, DocumentAxesPointsRequired documentAxesPointsRequired)
Check before calling editPointAxis.
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 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.
virtual DocumentModelSegments modelSegments() const
Get method for DocumentModelSegments.
Model for DlgSettingsCoords and CmdSettingsCoords.
virtual void removePointAxis(const QString &identifier)
Perform the opposite of addPointAxis.
Container for one set of digitized Points.
Definition: Curve.h:33
virtual const Curve & curveAxes() const
Get method for axis curve.
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 const CurvesGraphs & curvesGraphs() const
Make all Curves available, read only, for CmdAbstract classes only.
virtual void print() const
Debugging method for printing directly from symbolic debugger.
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 void iterateThroughCurvePointsAxes(const Functor2wRet< const QString &, const Point &, CallbackSearchReturn > &ftorWithCallback)
See Curve::iterateThroughCurvePoints, for the axes curve.
Model for DlgSettingsSegments and CmdSettingsSegments.
virtual DocumentModelCoords modelCoords() const
Get method for DocumentModelCoords.
virtual QPointF positionGraph(const QString &pointIdentifier) const
See Curve::positionGraph.
virtual DocumentModelGridRemoval modelGridRemoval() const
Get method for DocumentModelGridRemoval.
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 updatePointOrdinals(const Transformation &transformation)
Update point ordinals after point addition/removal or dragging.
void loadPreVersion6(QDataStream &str, double version, DocumentAxesPointsRequired &documentAxesPointsRequired)
Load from file in pre-version 6 format.
void loadVersion6(QXmlStreamReader &reader, DocumentAxesPointsRequired &documentAxesPointsRequired)
Load from file in version 6 format, into the single CoordSystem.
CoordSystemContext()
Default constructor for constructing from opened file.
virtual void movePoint(const QString &pointIdentifier, const QPointF &deltaScreen)
See Curve::movePoint.
virtual QString reasonForUnsuccessfulRead() const
Return an informative text message explaining why startup loading failed. Applies if successfulRead r...
const CoordSystem & coordSystem() const
Current CoordSystem.
Model for DlgSettingsGridRemoval and CmdSettingsGridRemoval. The settings are unstable until the user...
virtual DocumentModelExportFormat modelExport() const
Get method for DocumentModelExportFormat.
virtual QStringList curvesGraphsNames() const
See CurvesGraphs::curvesGraphsNames.
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 QString selectedCurveName() const
Currently selected curve name. This is used to set the selected curve combobox in MainWindow...
virtual QPointF positionScreen(const QString &pointIdentifier) const
See Curve::positionScreen.