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  qDeleteAll (m_coordSystems);
24 }
25 
26 void CoordSystemContext::addCoordSystems(unsigned int numberCoordSystemToAdd)
27 {
28  LOG4CPP_INFO_S ((*mainCat)) << "CoordSystemContext::addCoordSystems"
29  << " numberToAdd=" << numberCoordSystemToAdd;
30 
31  // The CoordSystem vector is populated with defaults here
32  for (unsigned int i = 0; i < numberCoordSystemToAdd; i++) {
33  m_coordSystems.push_back (new CoordSystem ());
34  }
35 }
36 
37 void CoordSystemContext::addGraphCurveAtEnd (const QString &curveName)
38 {
39  LOG4CPP_INFO_S ((*mainCat)) << "CoordSystemContext::addGraphCurveAtEnd";
40 
41  m_coordSystems [signed (m_coordSystemIndex)]->addGraphCurveAtEnd(curveName);
42 }
43 
45  const QPointF &posGraph,
46  QString &identifier,
47  double ordinal,
48  bool isXOnly)
49 {
50  LOG4CPP_INFO_S ((*mainCat)) << "CoordSystemContext::addPointAxisWithGeneratedIdentifier";
51 
52  m_coordSystems [signed (m_coordSystemIndex)]->addPointAxisWithGeneratedIdentifier(posScreen,
53  posGraph,
54  identifier,
55  ordinal,
56  isXOnly);
57 }
58 
60  const QPointF &posGraph,
61  const QString &identifier,
62  double ordinal,
63  bool isXOnly)
64 {
65  LOG4CPP_INFO_S ((*mainCat)) << "CoordSystemContext::addPointAxisWithSpecifiedIdentifier";
66 
67  m_coordSystems [signed (m_coordSystemIndex)]->addPointAxisWithSpecifiedIdentifier(posScreen,
68  posGraph,
69  identifier,
70  ordinal,
71  isXOnly);
72 }
73 
75  const QPointF &posScreen,
76  QString &generatedIdentifier,
77  double ordinal)
78 {
79  LOG4CPP_INFO_S ((*mainCat)) << "CoordSystemContext::addPointGraphWithGeneratedIdentifier";
80 
81  m_coordSystems [signed (m_coordSystemIndex)]->addPointGraphWithGeneratedIdentifier(curveName,
82  posScreen,
83  generatedIdentifier,
84  ordinal);
85 }
86 
88  const QPointF &posScreen,
89  const QString &identifier,
90  double ordinal)
91 {
92  LOG4CPP_INFO_S ((*mainCat)) << "CoordSystemContext::addPointGraphWithSpecifiedIdentifier";
93 
94  m_coordSystems [signed (m_coordSystemIndex)]->addPointGraphWithSpecifiedIdentifier(curveName,
95  posScreen,
96  identifier,
97  ordinal);
98 }
99 
101 {
102  LOG4CPP_INFO_S ((*mainCat)) << "CoordSystemContext::addPointsInCurvesGraphs";
103 
104  m_coordSystems [signed (m_coordSystemIndex)]->addPointsInCurvesGraphs(curvesGraphs);
105 }
106 
107 void CoordSystemContext::checkAddPointAxis (const QPointF &posScreen,
108  const QPointF &posGraph,
109  bool &isError,
110  QString &errorMessage,
111  bool isXOnly,
112  DocumentAxesPointsRequired documentAxesPointsRequired)
113 {
114  LOG4CPP_INFO_S ((*mainCat)) << "CoordSystemContext::checkAddPointAxis";
115 
116  m_coordSystems [signed (m_coordSystemIndex)]->checkAddPointAxis(posScreen,
117  posGraph,
118  isError,
119  errorMessage,
120  isXOnly,
121  documentAxesPointsRequired);
122 }
123 
124 void CoordSystemContext::checkEditPointAxis (const QString &pointIdentifier,
125  const QPointF &posScreen,
126  const QPointF &posGraph,
127  bool &isError,
128  QString &errorMessage,
129  DocumentAxesPointsRequired documentAxesPointsRequired)
130 {
131  LOG4CPP_INFO_S ((*mainCat)) << "CoordSystemContext::checkEditPointAxis";
132 
133  m_coordSystems [signed (m_coordSystemIndex)]->checkEditPointAxis(pointIdentifier,
134  posScreen,
135  posGraph,
136  isError,
137  errorMessage,
138  documentAxesPointsRequired);
139 }
140 
142 {
143  LOG4CPP_INFO_S ((*mainCat)) << "CoordSystemContext::coordSystem";
144 
145  return *(m_coordSystems [signed (m_coordSystemIndex)]);
146 }
147 
149 {
150  return unsigned (m_coordSystems.count());
151 }
152 
153 CoordSystemIndex CoordSystemContext::coordSystemIndex () const
154 {
155  return m_coordSystemIndex;
156 }
157 
159 {
160  LOG4CPP_INFO_S ((*mainCat)) << "CoordSystemContext::curveAxes";
161 
162  return m_coordSystems [signed (m_coordSystemIndex)]->curveAxes();
163 }
164 
165 Curve *CoordSystemContext::curveForCurveName (const QString &curveName)
166 {
167  LOG4CPP_INFO_S ((*mainCat)) << "CoordSystemContext::curveForCurveName";
168 
169  return m_coordSystems [signed (m_coordSystemIndex)]->curveForCurveName(curveName);
170 }
171 
172 const Curve *CoordSystemContext::curveForCurveName (const QString &curveName) const
173 {
174  LOG4CPP_INFO_S ((*mainCat)) << "CoordSystemContext::curveForCurveName";
175 
176  return m_coordSystems [signed (m_coordSystemIndex)]->curveForCurveName(curveName);
177 }
178 
180 {
181  LOG4CPP_INFO_S ((*mainCat)) << "CoordSystemContext::curvesGraphs";
182 
183  return m_coordSystems [signed (m_coordSystemIndex)]->curvesGraphs();
184 }
185 
187 {
188  LOG4CPP_INFO_S ((*mainCat)) << "CoordSystemContext::curvesGraphsNames";
189 
190  return m_coordSystems [signed (m_coordSystemIndex)]->curvesGraphsNames();
191 }
192 
193 int CoordSystemContext::curvesGraphsNumPoints (const QString &curveName) const
194 {
195  LOG4CPP_INFO_S ((*mainCat)) << "CoordSystemContext::curvesGraphsNumPoints";
196 
197  return m_coordSystems [signed (m_coordSystemIndex)]->curvesGraphsNumPoints(curveName);
198 }
199 
200 void CoordSystemContext::editPointAxis (const QPointF &posGraph,
201  const QString &identifier)
202 {
203  LOG4CPP_INFO_S ((*mainCat)) << "CoordSystemContext::editPointAxis";
204 
205  m_coordSystems [signed (m_coordSystemIndex)]->editPointAxis(posGraph,
206  identifier);
207 }
208 
210  bool isY,
211  double x,
212  double y,
213  const QStringList &identifiers,
214  const Transformation &transformation)
215 {
216  LOG4CPP_INFO_S ((*mainCat)) << "CoordSystemContext::editPointGraph";
217 
218  m_coordSystems [signed (m_coordSystemIndex)]->editPointGraph (isX,
219  isY,
220  x,
221  y,
222  identifiers,
223  transformation);
224 }
225 
226 bool CoordSystemContext::isXOnly (const QString &pointIdentifier) const
227 {
228  LOG4CPP_INFO_S ((*mainCat)) << "CoordSystemContext::isXOnly";
229 
230  return m_coordSystems [signed (m_coordSystemIndex)]->isXOnly (pointIdentifier);
231 }
232 
233 void CoordSystemContext::iterateThroughCurvePointsAxes (const Functor2wRet<const QString &, const Point &, CallbackSearchReturn> &ftorWithCallback)
234 {
235  LOG4CPP_INFO_S ((*mainCat)) << "CoordSystemContext::iterateThroughCurvePointsAxes";
236 
237  m_coordSystems [signed (m_coordSystemIndex)]->iterateThroughCurvePointsAxes(ftorWithCallback);
238 }
239 
240 void CoordSystemContext::iterateThroughCurvePointsAxes (const Functor2wRet<const QString &, const Point &, CallbackSearchReturn> &ftorWithCallback) const
241 {
242  LOG4CPP_INFO_S ((*mainCat)) << "CoordSystemContext::iterateThroughCurvePointsAxes";
243 
244  m_coordSystems [signed (m_coordSystemIndex)]->iterateThroughCurvePointsAxes(ftorWithCallback);
245 }
246 
247 void CoordSystemContext::iterateThroughCurveSegments (const QString &curveName,
248  const Functor2wRet<const Point &, const Point &, CallbackSearchReturn> &ftorWithCallback) const
249 {
250  LOG4CPP_INFO_S ((*mainCat)) << "CoordSystemContext::iterateThroughCurveSegments";
251 
252  m_coordSystems [signed (m_coordSystemIndex)]->iterateThroughCurveSegments(curveName,
253  ftorWithCallback);
254 }
255 
256 void CoordSystemContext::iterateThroughCurvesPointsGraphs (const Functor2wRet<const QString &, const Point &, CallbackSearchReturn> &ftorWithCallback)
257 {
258  LOG4CPP_INFO_S ((*mainCat)) << "CoordSystemContext::iterateThroughCurvesPointsGraphs";
259 
260  m_coordSystems [signed (m_coordSystemIndex)]->iterateThroughCurvesPointsGraphs(ftorWithCallback);
261 }
262 
263 void CoordSystemContext::iterateThroughCurvesPointsGraphs (const Functor2wRet<const QString &, const Point &, CallbackSearchReturn> &ftorWithCallback) const
264 {
265  LOG4CPP_INFO_S ((*mainCat)) << "CoordSystemContext::iterateThroughCurvesPointsGraphs";
266 
267  m_coordSystems [signed (m_coordSystemIndex)]->iterateThroughCurvesPointsGraphs(ftorWithCallback);
268 }
269 
270 bool CoordSystemContext::loadCurvesFile (const QString &curvesFile)
271 {
272  LOG4CPP_INFO_S ((*mainCat)) << "CoordSystemContext::loadCurvesFile";
273 
274  return m_coordSystems [signed (m_coordSystemIndex)]->loadCurvesFile (curvesFile);
275 }
276 
277 void CoordSystemContext::loadPreVersion6 (QDataStream &str,
278  double version,
279  DocumentAxesPointsRequired &documentAxesPointsRequired)
280 {
281  LOG4CPP_INFO_S ((*mainCat)) << "CoordSystemContext::loadPreVersion6";
282 
283  m_coordSystems [signed (m_coordSystemIndex)]->loadPreVersion6 (str,
284  version,
285  documentAxesPointsRequired);
286 }
287 
288 void CoordSystemContext::loadVersion6 (QXmlStreamReader &reader,
289  DocumentAxesPointsRequired &documentAxesPointsRequired)
290 {
291  LOG4CPP_INFO_S ((*mainCat)) << "CoordSystemContext::loadVersion6";
292 
293  m_coordSystems [signed (m_coordSystemIndex)]->loadVersion6 (reader,
294  documentAxesPointsRequired);
295 }
296 
297 void CoordSystemContext::loadVersions7AndUp (QXmlStreamReader &reader)
298 {
299  LOG4CPP_INFO_S ((*mainCat)) << "CoordSystemContext::loadVersion7AndUp";
300 
301  int indexLast = m_coordSystems.count() - 1;
302  m_coordSystems [indexLast]->loadVersions7AndUp (reader);
303 }
304 
306 {
307  LOG4CPP_DEBUG_S ((*mainCat)) << "CoordSystemContext::modelAxesChecker";
308 
309  return m_coordSystems [signed (m_coordSystemIndex)]->modelAxesChecker();
310 }
311 
313 {
314  LOG4CPP_DEBUG_S ((*mainCat)) << "CoordSystemContext::modelColorFilter";
315 
316  return m_coordSystems [signed (m_coordSystemIndex)]->modelColorFilter();
317 }
318 
320 {
321  LOG4CPP_DEBUG_S ((*mainCat)) << "CoordSystemContext::modelCoords";
322 
323  return m_coordSystems [signed (m_coordSystemIndex)]->modelCoords();
324 }
325 
327 {
328  LOG4CPP_DEBUG_S ((*mainCat)) << "CoordSystemContext::modelCurveStyles";
329 
330  return m_coordSystems [signed (m_coordSystemIndex)]->modelCurveStyles();
331 }
332 
334 {
335  LOG4CPP_DEBUG_S ((*mainCat)) << "CoordSystemContext::modelDigitizeCurve";
336 
337  return m_coordSystems [signed (m_coordSystemIndex)]->modelDigitizeCurve();
338 }
339 
341 {
342  LOG4CPP_DEBUG_S ((*mainCat)) << "CoordSystemContext::modelExport";
343 
344  return m_coordSystems [signed (m_coordSystemIndex)]->modelExport();
345 }
346 
348 {
349  LOG4CPP_DEBUG_S ((*mainCat)) << "CoordSystemContext::modelGeneral";
350 
351  return m_coordSystems [signed (m_coordSystemIndex)]->modelGeneral();
352 }
353 
355 {
356  LOG4CPP_DEBUG_S ((*mainCat)) << "CoordSystemContext::modelGridDisplay";
357 
358  return m_coordSystems [signed (m_coordSystemIndex)]->modelGridDisplay();
359 }
360 
362 {
363  LOG4CPP_DEBUG_S ((*mainCat)) << "CoordSystemContext::modelGridRemoval";
364 
365  return m_coordSystems [signed (m_coordSystemIndex)]->modelGridRemoval();
366 }
367 
369 {
370  LOG4CPP_DEBUG_S ((*mainCat)) << "CoordSystemContext::modelPointMatch";
371 
372  return m_coordSystems [signed (m_coordSystemIndex)]->modelPointMatch();
373 }
374 
376 {
377  LOG4CPP_DEBUG_S ((*mainCat)) << "CoordSystemContext::modelSegments";
378 
379  return m_coordSystems [signed (m_coordSystemIndex)]->modelSegments();
380 }
381 
382 void CoordSystemContext::movePoint (const QString &pointIdentifier,
383  const QPointF &deltaScreen)
384 {
385  LOG4CPP_INFO_S ((*mainCat)) << "CoordSystemContext::movePoint";
386 
387  return m_coordSystems [signed (m_coordSystemIndex)]->movePoint(pointIdentifier,
388  deltaScreen);
389 }
390 
391 int CoordSystemContext::nextOrdinalForCurve (const QString &curveName) const
392 {
393  LOG4CPP_INFO_S ((*mainCat)) << "CoordSystemContext::nextOrdinalForCurve";
394 
395  return m_coordSystems [signed (m_coordSystemIndex)]->nextOrdinalForCurve(curveName);
396 }
397 
398 QPointF CoordSystemContext::positionGraph (const QString &pointIdentifier) const
399 {
400  LOG4CPP_INFO_S ((*mainCat)) << "CoordSystemContext::positionGraph";
401 
402  return m_coordSystems [signed (m_coordSystemIndex)]->positionGraph(pointIdentifier);
403 }
404 
405 QPointF CoordSystemContext::positionScreen (const QString &pointIdentifier) const
406 {
407  LOG4CPP_INFO_S ((*mainCat)) << "CoordSystemContext::addGraphCurveAtEnd";
408 
409  return m_coordSystems [signed (m_coordSystemIndex)]->positionScreen(pointIdentifier);
410 }
411 
413 {
414  LOG4CPP_INFO_S ((*mainCat)) << "CoordSystemContext::print";
415 
416  return m_coordSystems [signed (m_coordSystemIndex)]->print();
417 }
418 
419 void CoordSystemContext::printStream (QString indentation,
420  QTextStream &str) const
421 {
422  LOG4CPP_INFO_S ((*mainCat)) << "CoordSystemContext::printStream";
423 
424  m_coordSystems [signed (m_coordSystemIndex)]->printStream(indentation,
425  str);
426 }
427 
429 {
430  LOG4CPP_INFO_S ((*mainCat)) << "CoordSystemContext::reasonForUnsuccessfulRead";
431 
432  return m_coordSystems [signed (m_coordSystemIndex)]->reasonForUnsuccessfulRead();
433 }
434 
435 void CoordSystemContext::removePointAxis (const QString &identifier)
436 {
437  LOG4CPP_INFO_S ((*mainCat)) << "CoordSystemContext::removePointAxis";
438 
439  m_coordSystems [signed (m_coordSystemIndex)]->removePointAxis(identifier);
440 }
441 
442 void CoordSystemContext::removePointGraph (const QString &identifier)
443 {
444  LOG4CPP_INFO_S ((*mainCat)) << "CoordSystemContext::removePointGraph";
445 
446  m_coordSystems [signed (m_coordSystemIndex)]->removePointGraph(identifier);
447 }
448 
450 {
451  LOG4CPP_INFO_S ((*mainCat)) << "CoordSystemContext::removePointsInCurvesGraphs";
452 
453  m_coordSystems [signed (m_coordSystemIndex)]->removePointsInCurvesGraphs(curvesGraphs);
454 }
455 
456 void CoordSystemContext::saveXml (QXmlStreamWriter &writer) const
457 {
458  LOG4CPP_INFO_S ((*mainCat)) << "CoordSystemContext::saveXml";
459 
460  for (int index = 0; index < m_coordSystems.count(); index++) {
461  m_coordSystems [index]->saveXml (writer);
462  }
463 }
464 
466 {
467  return m_coordSystems [signed (m_coordSystemIndex)]->selectedCurveName();
468 }
469 
470 void CoordSystemContext::setCoordSystemIndex(CoordSystemIndex coordSystemIndex)
471 {
472  LOG4CPP_INFO_S ((*mainCat)) << "CoordSystemContext::setCoordSystemIndex"
473  << " index=" << coordSystemIndex;
474 
475  ENGAUGE_ASSERT(coordSystemIndex < unsigned (m_coordSystems.count()));
476 
477  m_coordSystemIndex = coordSystemIndex;
478 }
479 
481 {
482  LOG4CPP_INFO_S ((*mainCat)) << "CoordSystemContext::setCurveAxes";
483 
484  m_coordSystems [signed (m_coordSystemIndex)]->setCurveAxes(curveAxes);
485 }
486 
488 {
489  LOG4CPP_INFO_S ((*mainCat)) << "CoordSystemContext::setCurvesGraphs";
490 
491  m_coordSystems [signed (m_coordSystemIndex)]->setCurvesGraphs(curvesGraphs);
492 }
493 
495 {
496  LOG4CPP_INFO_S ((*mainCat)) << "CoordSystemContext::setModelAxesChecker";
497 
498  m_coordSystems [signed (m_coordSystemIndex)]->setModelAxesChecker(modelAxesChecker);
499 }
500 
502 {
503  LOG4CPP_INFO_S ((*mainCat)) << "CoordSystemContext::setModelColorFilter";
504 
505  m_coordSystems [signed (m_coordSystemIndex)]->setModelColorFilter(modelColorFilter);
506 }
507 
509 {
510  LOG4CPP_INFO_S ((*mainCat)) << "CoordSystemContext::setModelCoords";
511 
512  m_coordSystems [signed (m_coordSystemIndex)]->setModelCoords(modelCoords);
513 }
514 
516 {
517  LOG4CPP_INFO_S ((*mainCat)) << "CoordSystemContext::setModelCurveStyles";
518 
519  m_coordSystems [signed (m_coordSystemIndex)]->setModelCurveStyles(modelCurveStyles);
520 }
521 
523 {
524  LOG4CPP_INFO_S ((*mainCat)) << "CoordSystemContext::setModelDigitizeCurve";
525 
526  m_coordSystems [signed (m_coordSystemIndex)]->setModelDigitizeCurve(modelDigitizeCurve);
527 }
528 
530 {
531  LOG4CPP_INFO_S ((*mainCat)) << "CoordSystemContext::setModelExport";
532 
533  m_coordSystems [signed (m_coordSystemIndex)]->setModelExport (modelExport);
534 }
535 
537 {
538  LOG4CPP_INFO_S ((*mainCat)) << "CoordSystemContext::setModelGeneral";
539 
540  m_coordSystems [signed (m_coordSystemIndex)]->setModelGeneral(modelGeneral);
541 }
542 
544 {
545  LOG4CPP_INFO_S ((*mainCat)) << "CoordSystemContext::setModelGridDisplay";
546 
547  m_coordSystems [signed (m_coordSystemIndex)]->setModelGridDisplay(modelGridDisplay);
548 }
549 
551 {
552  LOG4CPP_INFO_S ((*mainCat)) << "CoordSystemContext::setModelGridRemoval";
553 
554  m_coordSystems [signed (m_coordSystemIndex)]->setModelGridRemoval(modelGridRemoval);
555 }
556 
558 {
559  LOG4CPP_INFO_S ((*mainCat)) << "CoordSystemContext::setModelPointMatch";
560 
561  m_coordSystems [signed (m_coordSystemIndex)]->setModelPointMatch(modelPointMatch);
562 }
563 
565 {
566  LOG4CPP_INFO_S ((*mainCat)) << "CoordSystemContext::setModelSegments";
567 
568  m_coordSystems [signed (m_coordSystemIndex)]->setModelSegments(modelSegments);
569 }
570 
571 void CoordSystemContext::setSelectedCurveName(const QString &selectedCurveName)
572 {
573  m_coordSystems [signed (m_coordSystemIndex)]->setSelectedCurveName(selectedCurveName);
574 }
575 
577 {
578  LOG4CPP_INFO_S ((*mainCat)) << "CoordSystemContext::successfulRead";
579 
580  return m_coordSystems [signed (m_coordSystemIndex)]->successfulRead();
581 }
582 
584 {
585  LOG4CPP_INFO_S ((*mainCat)) << "CoordSystemContext::updatePointOrdinals";
586 
587  m_coordSystems [signed (m_coordSystemIndex)]->updatePointOrdinals(transformation);
588 }
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.