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();
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)]->modelGuideline();
379 return m_coordSystems [signed (m_coordSystemIndex)]->modelPointMatch();
386 return m_coordSystems [signed (m_coordSystemIndex)]->modelSegments();
390 const QPointF &deltaScreen)
394 return m_coordSystems [signed (m_coordSystemIndex)]->movePoint(pointIdentifier,
402 return m_coordSystems [signed (m_coordSystemIndex)]->nextOrdinalForCurve(curveName);
409 return m_coordSystems [signed (m_coordSystemIndex)]->positionGraph(pointIdentifier);
416 return m_coordSystems [signed (m_coordSystemIndex)]->positionScreen(pointIdentifier);
423 return m_coordSystems [signed (m_coordSystemIndex)]->print();
427 QTextStream &str)
const
431 m_coordSystems [signed (m_coordSystemIndex)]->
printStream(indentation,
439 return m_coordSystems [signed (m_coordSystemIndex)]->reasonForUnsuccessfulRead();
446 m_coordSystems [signed (m_coordSystemIndex)]->removePointAxis(identifier);
453 m_coordSystems [signed (m_coordSystemIndex)]->removePointGraph(identifier);
460 m_coordSystems [signed (m_coordSystemIndex)]->removePointsInCurvesGraphs(
curvesGraphs);
467 for (
int index = 0; index < m_coordSystems.count(); index++) {
468 m_coordSystems [index]->saveXml (writer);
474 return m_coordSystems [signed (m_coordSystemIndex)]->selectedCurveName();
491 m_coordSystems [signed (m_coordSystemIndex)]->setCurveAxes(
curveAxes);
498 m_coordSystems [signed (m_coordSystemIndex)]->setCurvesGraphs(
curvesGraphs);
505 m_coordSystems [signed (m_coordSystemIndex)]->setModelAxesChecker(
modelAxesChecker);
512 m_coordSystems [signed (m_coordSystemIndex)]->setModelColorFilter(
modelColorFilter);
519 m_coordSystems [signed (m_coordSystemIndex)]->setModelCoords(
modelCoords);
526 m_coordSystems [signed (m_coordSystemIndex)]->setModelCurveStyles(
modelCurveStyles);
533 m_coordSystems [signed (m_coordSystemIndex)]->setModelDigitizeCurve(
modelDigitizeCurve);
540 m_coordSystems [signed (m_coordSystemIndex)]->setModelExport (
modelExport);
547 m_coordSystems [signed (m_coordSystemIndex)]->setModelGeneral(
modelGeneral);
554 m_coordSystems [signed (m_coordSystemIndex)]->setModelGridDisplay(
modelGridDisplay);
561 m_coordSystems [signed (m_coordSystemIndex)]->setModelGridRemoval(
modelGridRemoval);
568 m_coordSystems [signed (m_coordSystemIndex)]->setModelGuideline(
modelGuideline);
575 m_coordSystems [signed (m_coordSystemIndex)]->setModelPointMatch(
modelPointMatch);
582 m_coordSystems [signed (m_coordSystemIndex)]->setModelSegments(
modelSegments);
587 m_coordSystems [signed (m_coordSystemIndex)]->setSelectedCurveName(
selectedCurveName);
594 return m_coordSystems [signed (m_coordSystemIndex)]->successfulRead();
601 m_coordSystems [signed (m_coordSystemIndex)]->updatePointOrdinals(transformation);
const CoordSystemIndex DEFAULT_COORD_SYSTEM_INDEX
unsigned int CoordSystemIndex
Zero-based index for identifying CoordSystem instantiations.
DocumentAxesPointsRequired
#define ENGAUGE_ASSERT(cond)
Drop in replacement for Q_ASSERT.
log4cpp::Category * mainCat
unsigned int coordSystemCount() const
Number of CoordSystem.
void loadVersions7AndUp(QXmlStreamReader &reader)
Load one CoordSystem from file in version 7 format or newer, into the most recent CoordSystem which w...
virtual void addPointGraphWithSpecifiedIdentifier(const QString &curveName, const QPointF &posScreen, const QString &identifier, double ordinal)
Add a single graph point with the specified point identifier. Note that PointStyle is not applied to ...
virtual DocumentModelColorFilter modelColorFilter() const
Get method for DocumentModelColorFilter.
CoordSystemIndex coordSystemIndex() const
Index of current CoordSystem.
virtual void setModelCurveStyles(const CurveStyles &modelCurveStyles)
Set method for CurveStyles.
virtual CurveStyles modelCurveStyles() const
Get method for CurveStyles.
virtual void setModelAxesChecker(const DocumentModelAxesChecker &modelAxesChecker)
Set method for DocumentModelAxesChecker.
virtual void iterateThroughCurvePointsAxes(const Functor2wRet< const QString &, const Point &, CallbackSearchReturn > &ftorWithCallback)
See Curve::iterateThroughCurvePoints, for the axes curve.
virtual const CurvesGraphs & curvesGraphs() const
Make all Curves available, read only, for CmdAbstract classes only.
const CoordSystem & coordSystem() const
Current CoordSystem.
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 printStream(QString indentation, QTextStream &str) const
Debugging method that supports print method of this class and printStream method of some other class(...
virtual void editPointAxis(const QPointF &posGraph, const QString &identifier)
Edit the graph coordinates of a single axis point. Call this after checkAddPointAxis to guarantee suc...
void setModelPointMatch(const DocumentModelPointMatch &modelPointMatch)
Set method for DocumentModelPointMatch.
virtual void setModelGeneral(const DocumentModelGeneral &modelGeneral)
Set method for DocumentModelGeneral.
virtual void setModelColorFilter(const DocumentModelColorFilter &modelColorFilter)
Set method for DocumentModelColorFilter.
virtual const Curve & curveAxes() const
Get method for axis curve.
virtual void addPointsInCurvesGraphs(CurvesGraphs &curvesGraphs)
Add all points identified in the specified CurvesGraphs. See also removePointsInCurvesGraphs.
virtual void setModelCoords(const DocumentModelCoords &modelCoords)
Set method for DocumentModelCoords.
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.
virtual void addPointGraphWithGeneratedIdentifier(const QString &curveName, const QPointF &posScreen, QString &generatedIentifier, double ordinal)
Add a single graph point with a generated point identifier.
CoordSystemContext()
Default constructor for constructing from opened file.
virtual DocumentModelAxesChecker modelAxesChecker() const
Get method for DocumentModelAxesChecker.
virtual void print() const
Debugging method for printing directly from symbolic debugger.
void loadVersion6(QXmlStreamReader &reader, DocumentAxesPointsRequired &documentAxesPointsRequired)
Load from file in version 6 format, into the single CoordSystem.
virtual int curvesGraphsNumPoints(const QString &curveName) const
See CurvesGraphs::curvesGraphsNumPoints.
virtual QPointF positionScreen(const QString &pointIdentifier) const
See Curve::positionScreen.
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...
bool isXOnly(const QString &pointIdentifier) const
True/false if y/x value is empty.
virtual void setModelSegments(const DocumentModelSegments &modelSegments)
Set method for DocumentModelSegments.
virtual DocumentModelDigitizeCurve modelDigitizeCurve() const
Get method for DocumentModelDigitizeCurve.
virtual DocumentModelCoords modelCoords() const
Get method for DocumentModelCoords.
virtual Curve * curveForCurveName(const QString &curveName)
See CurvesGraphs::curveForCurveName, although this also works for AXIS_CURVE_NAME.
virtual int nextOrdinalForCurve(const QString &curveName) const
Default next ordinal value for specified curve.
virtual DocumentModelSegments modelSegments() const
Get method for DocumentModelSegments.
virtual DocumentModelGuideline modelGuideline() const
Get method for DocumentModelGuideline.
virtual DocumentModelExportFormat modelExport() const
Get method for DocumentModelExportFormat.
virtual void addGraphCurveAtEnd(const QString &curveName)
Add new graph curve to the list of existing graph curves.
virtual void movePoint(const QString &pointIdentifier, const QPointF &deltaScreen)
See Curve::movePoint.
virtual void setCurvesGraphs(const CurvesGraphs &curvesGraphs)
Let CmdAbstract classes overwrite CurvesGraphs. Applies to current coordinate system.
virtual QString reasonForUnsuccessfulRead() const
Return an informative text message explaining why startup loading failed. Applies if successfulRead r...
virtual void saveXml(QXmlStreamWriter &writer) const
Save graph to xml.
virtual DocumentModelGridDisplay modelGridDisplay() const
Get method for DocumentModelGridDisplay.
virtual void setModelExport(const DocumentModelExportFormat &modelExport)
Set method for DocumentModelExportFormat.
virtual void removePointGraph(const QString &identifier)
Perform the opposite of addPointGraph.
void addCoordSystems(unsigned int numberCoordSystemToAdd)
Add specified number of coordinate systems to the original one created by the constructor.
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...
void setCoordSystemIndex(CoordSystemIndex coordSystemIndex)
Index of current CoordSystem.
virtual bool successfulRead() const
Return true if startup loading succeeded. If the loading failed then reasonForUnsuccessfulRed will ex...
virtual void setCurveAxes(const Curve &curveAxes)
Let CmdAbstract classes overwrite axes Curve. Applies to current coordinate system.
virtual DocumentModelGridRemoval modelGridRemoval() const
Get method for DocumentModelGridRemoval.
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 setModelGuideline(const DocumentModelGuideline &modelGuideline)
Set method for DocumentModelGuideline.
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 setModelGridDisplay(const DocumentModelGridDisplay &modelGridDisplay)
Set method for DocumentModelGridDisplay.
virtual DocumentModelPointMatch modelPointMatch() const
Get method for DocumentModelPointMatch.
virtual QStringList curvesGraphsNames() const
See CurvesGraphs::curvesGraphsNames.
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 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 removePointsInCurvesGraphs(CurvesGraphs &curvesGraphs)
Remove all points identified in the specified CurvesGraphs. See also addPointsInCurvesGraphs.
virtual void removePointAxis(const QString &identifier)
Perform the opposite of addPointAxis.
virtual void checkEditPointAxis(const QString &pointIdentifier, const QPointF &posScreen, const QPointF &posGraph, bool &isError, QString &errorMessage, DocumentAxesPointsRequired documentAxesPointsRequired)
Check before calling editPointAxis.
virtual QString selectedCurveName() const
Currently selected curve name. This is used to set the selected curve combobox in MainWindow.
virtual void iterateThroughCurvesPointsGraphs(const Functor2wRet< const QString &, const Point &, CallbackSearchReturn > &ftorWithCallback)
See Curve::iterateThroughCurvePoints, for all the graphs curves.
virtual void setModelGridRemoval(const DocumentModelGridRemoval &modelGridRemoval)
Set method for DocumentModelGridRemoval.
virtual DocumentModelGeneral modelGeneral() const
Get method for DocumentModelGeneral.
virtual QPointF positionGraph(const QString &pointIdentifier) const
See Curve::positionGraph.
virtual void setModelDigitizeCurve(const DocumentModelDigitizeCurve &modelDigitizeCurve)
Set method for DocumentModelDigitizeCurve.
Storage of data belonging to one coordinate system.
Model for DlgSettingsCurveProperties and CmdSettingsCurveProperties.
Container for one set of digitized Points.
Container for all graph curves. The axes point curve is external to this class.
QStringList curvesGraphsNames() const
List of graph curve names.
Model for DlgSettingsAxesChecker and CmdSettingsAxesChecker.
Model for DlgSettingsColorFilter and CmdSettingsColorFilter.
Model for DlgSettingsCoords and CmdSettingsCoords.
Model for DlgSettingsDigitizeCurve and CmdSettingsDigitizeCurve.
Model for DlgSettingsGeneral and CmdSettingsGeneral.
Model for DlgSettingsGridDisplay and CmdSettingsGridDisplay.
Model for DlgSettingsGridRemoval and CmdSettingsGridRemoval.
Model for managing the coordinate values corresponding Guidelines.
Model for DlgSettingsPointMatch and CmdSettingsPointMatch.
Model for DlgSettingsSegments and CmdSettingsSegments.
void printStream(QString indentation, QTextStream &str) const
Debugging method that supports print method of this class and printStream method of some other class(...
#define LOG4CPP_INFO_S(logger)
#define LOG4CPP_DEBUG_S(logger)