23 qDeleteAll (m_coordSystems);
29 <<
" numberToAdd=" << numberCoordSystemToAdd;
32 for (
unsigned int i = 0; i < numberCoordSystemToAdd; i++) {
41 m_coordSystems [signed (m_coordSystemIndex)]->addGraphCurveAtEnd(curveName);
45 const QPointF &posGraph,
52 m_coordSystems [signed (m_coordSystemIndex)]->addPointAxisWithGeneratedIdentifier(posScreen,
60 const QPointF &posGraph,
61 const QString &identifier,
67 m_coordSystems [signed (m_coordSystemIndex)]->addPointAxisWithSpecifiedIdentifier(posScreen,
75 const QPointF &posScreen,
76 QString &generatedIdentifier,
81 m_coordSystems [signed (m_coordSystemIndex)]->addPointGraphWithGeneratedIdentifier(curveName,
88 const QPointF &posScreen,
89 const QString &identifier,
94 m_coordSystems [signed (m_coordSystemIndex)]->addPointGraphWithSpecifiedIdentifier(curveName,
104 m_coordSystems [signed (m_coordSystemIndex)]->addPointsInCurvesGraphs(
curvesGraphs);
108 const QPointF &posGraph,
110 QString &errorMessage,
116 m_coordSystems [signed (m_coordSystemIndex)]->checkAddPointAxis(posScreen,
121 documentAxesPointsRequired);
125 const QPointF &posScreen,
126 const QPointF &posGraph,
128 QString &errorMessage,
133 m_coordSystems [signed (m_coordSystemIndex)]->checkEditPointAxis(pointIdentifier,
138 documentAxesPointsRequired);
145 return *(m_coordSystems [signed (m_coordSystemIndex)]);
150 return unsigned (m_coordSystems.count());
155 return m_coordSystemIndex;
162 return m_coordSystems [signed (m_coordSystemIndex)]->curveAxes();
169 return m_coordSystems [signed (m_coordSystemIndex)]->curveForCurveName(curveName);
176 return m_coordSystems [signed (m_coordSystemIndex)]->curveForCurveName(curveName);
183 return m_coordSystems [signed (m_coordSystemIndex)]->curvesGraphs();
190 return m_coordSystems [signed (m_coordSystemIndex)]->curvesGraphsNames();
197 return m_coordSystems [signed (m_coordSystemIndex)]->curvesGraphsNumPoints(curveName);
201 const QString &identifier)
205 m_coordSystems [signed (m_coordSystemIndex)]->editPointAxis(posGraph,
213 const QStringList &identifiers,
218 m_coordSystems [signed (m_coordSystemIndex)]->editPointGraph (isX,
230 return m_coordSystems [signed (m_coordSystemIndex)]->isXOnly (pointIdentifier);
237 m_coordSystems [signed (m_coordSystemIndex)]->iterateThroughCurvePointsAxes(ftorWithCallback);
244 m_coordSystems [signed (m_coordSystemIndex)]->iterateThroughCurvePointsAxes(ftorWithCallback);
248 const Functor2wRet<const Point &, const Point &, CallbackSearchReturn> &ftorWithCallback)
const 252 m_coordSystems [signed (m_coordSystemIndex)]->iterateThroughCurveSegments(curveName,
260 m_coordSystems [signed (m_coordSystemIndex)]->iterateThroughCurvesPointsGraphs(ftorWithCallback);
267 m_coordSystems [signed (m_coordSystemIndex)]->iterateThroughCurvesPointsGraphs(ftorWithCallback);
274 return m_coordSystems [signed (m_coordSystemIndex)]->loadCurvesFile (curvesFile);
283 m_coordSystems [signed (m_coordSystemIndex)]->loadPreVersion6 (str,
285 documentAxesPointsRequired);
293 m_coordSystems [signed (m_coordSystemIndex)]->loadVersion6 (reader,
294 documentAxesPointsRequired);
301 int indexLast = m_coordSystems.count() - 1;
302 m_coordSystems [indexLast]->loadVersions7AndUp (reader);
309 return m_coordSystems [signed (m_coordSystemIndex)]->modelAxesChecker();
316 return m_coordSystems [signed (m_coordSystemIndex)]->modelColorFilter();
323 return m_coordSystems [signed (m_coordSystemIndex)]->modelCoords();
330 return m_coordSystems [signed (m_coordSystemIndex)]->modelCurveStyles();
337 return m_coordSystems [signed (m_coordSystemIndex)]->modelDigitizeCurve();
344 return m_coordSystems [signed (m_coordSystemIndex)]->modelExport();
351 return m_coordSystems [signed (m_coordSystemIndex)]->modelGeneral();
358 return m_coordSystems [signed (m_coordSystemIndex)]->modelGridDisplay();
365 return m_coordSystems [signed (m_coordSystemIndex)]->modelGridRemoval();
372 return m_coordSystems [signed (m_coordSystemIndex)]->modelPointMatch();
379 return m_coordSystems [signed (m_coordSystemIndex)]->modelSegments();
383 const QPointF &deltaScreen)
387 return m_coordSystems [signed (m_coordSystemIndex)]->movePoint(pointIdentifier,
395 return m_coordSystems [signed (m_coordSystemIndex)]->nextOrdinalForCurve(curveName);
402 return m_coordSystems [signed (m_coordSystemIndex)]->positionGraph(pointIdentifier);
409 return m_coordSystems [signed (m_coordSystemIndex)]->positionScreen(pointIdentifier);
416 return m_coordSystems [signed (m_coordSystemIndex)]->print();
420 QTextStream &str)
const 424 m_coordSystems [signed (m_coordSystemIndex)]->printStream(indentation,
432 return m_coordSystems [signed (m_coordSystemIndex)]->reasonForUnsuccessfulRead();
439 m_coordSystems [signed (m_coordSystemIndex)]->removePointAxis(identifier);
446 m_coordSystems [signed (m_coordSystemIndex)]->removePointGraph(identifier);
453 m_coordSystems [signed (m_coordSystemIndex)]->removePointsInCurvesGraphs(
curvesGraphs);
460 for (
int index = 0; index < m_coordSystems.count(); index++) {
461 m_coordSystems [index]->saveXml (writer);
467 return m_coordSystems [signed (m_coordSystemIndex)]->selectedCurveName();
484 m_coordSystems [signed (m_coordSystemIndex)]->setCurveAxes(
curveAxes);
491 m_coordSystems [signed (m_coordSystemIndex)]->setCurvesGraphs(
curvesGraphs);
498 m_coordSystems [signed (m_coordSystemIndex)]->setModelAxesChecker(
modelAxesChecker);
505 m_coordSystems [signed (m_coordSystemIndex)]->setModelColorFilter(
modelColorFilter);
512 m_coordSystems [signed (m_coordSystemIndex)]->setModelCoords(
modelCoords);
519 m_coordSystems [signed (m_coordSystemIndex)]->setModelCurveStyles(
modelCurveStyles);
526 m_coordSystems [signed (m_coordSystemIndex)]->setModelDigitizeCurve(
modelDigitizeCurve);
533 m_coordSystems [signed (m_coordSystemIndex)]->setModelExport (
modelExport);
540 m_coordSystems [signed (m_coordSystemIndex)]->setModelGeneral(
modelGeneral);
547 m_coordSystems [signed (m_coordSystemIndex)]->setModelGridDisplay(
modelGridDisplay);
554 m_coordSystems [signed (m_coordSystemIndex)]->setModelGridRemoval(
modelGridRemoval);
561 m_coordSystems [signed (m_coordSystemIndex)]->setModelPointMatch(
modelPointMatch);
568 m_coordSystems [signed (m_coordSystemIndex)]->setModelSegments(
modelSegments);
573 m_coordSystems [signed (m_coordSystemIndex)]->setSelectedCurveName(
selectedCurveName);
580 return m_coordSystems [signed (m_coordSystemIndex)]->successfulRead();
587 m_coordSystems [signed (m_coordSystemIndex)]->updatePointOrdinals(transformation);
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 DlgSettingsCurveProperties and CmdSettingsCurveProperties.
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...
const CoordSystemIndex DEFAULT_COORD_SYSTEM_INDEX
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.
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.
#define LOG4CPP_INFO_S(logger)
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.
Container for all graph curves. The axes point curve is external to this class.
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.
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.
log4cpp::Category * mainCat
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.
unsigned int CoordSystemIndex
Zero-based index for identifying CoordSystem instantiations.
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.
DocumentAxesPointsRequired
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.
#define ENGAUGE_ASSERT(cond)
Drop in replacement for Q_ASSERT if defined(QT_NO_DEBUG) && !defined(QT_FORCE_ASSERTS) define ENGAUGE...
#define LOG4CPP_DEBUG_S(logger)
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.