10 #include "CoordSystemContext.h" 11 #include "CoordSystemIndex.h" 12 #include "CurvesGraphs.h" 13 #include "CurveStyles.h" 14 #include "DocumentAxesPointsRequired.h" 15 #include "DocumentModelAxesChecker.h" 16 #include "DocumentModelColorFilter.h" 17 #include "DocumentModelCoords.h" 18 #include "DocumentModelDigitizeCurve.h" 19 #include "DocumentModelExportFormat.h" 20 #include "DocumentModelGeneral.h" 21 #include "DocumentModelGridDisplay.h" 22 #include "DocumentModelGridRemoval.h" 23 #include "DocumentModelPointMatch.h" 24 #include "DocumentModelSegments.h" 25 #include "PointStyle.h" 29 #include <QXmlStreamReader> 37 class QXmlStreamWriter;
64 const QPointF &posGraph,
76 const QPointF &posGraph,
77 const QString &identifier,
83 const QPointF &posScreen,
84 QString &generatedIentifier,
89 const QPointF &posScreen,
90 const QString &identifier,
105 const QPointF &posScreen1,
107 QString &identifier0,
108 QString &identifier1,
114 const QPointF &posGraph,
116 QString &errorMessage,
121 const QPointF &posScreen,
122 const QPointF &posGraph,
124 QString &errorMessage);
155 const QString &identifier);
162 const QStringList &identifiers,
169 bool isXOnly (
const QString &pointIdentifier)
const;
179 const Functor2wRet<const Point &, const Point &, CallbackSearchReturn> &ftorWithCallback)
const;
224 void movePoint (
const QString &pointIdentifier,
225 const QPointF &deltaScreen);
234 QPointF
positionGraph (
const QString &pointIdentifier)
const;
244 QTextStream &str)
const;
259 void saveXml (QXmlStreamWriter &writer)
const;
326 bool bytesIndicatePreVersion6 (
const QByteArray &bytes)
const;
328 void generateEmptyPixmap(
const QXmlStreamAttributes &attributes);
329 void loadImage(QXmlStreamReader &reader);
330 void loadPreVersion6 (QDataStream &str);
331 void loadVersion6 (QFile *file);
332 void loadVersions7AndUp (QFile *file);
333 void overrideGraphDefaultsWithMapDefaults ();
334 int versionFromFile (QFile *file)
const;
341 DocumentAxesPointsRequired m_documentAxesPointsRequired;
344 bool m_successfulRead;
345 QString m_reasonForUnsuccessfulRead;
void addCoordSystems(unsigned int numberCoordSystemToAdd)
Add some number (0 or more) of additional coordinate systems.
void addGraphCurveAtEnd(const QString &curveName)
Add new graph curve to the list of existing graph curves.
Model for DlgSettingsGeneral and CmdSettingsGeneral.
int curvesGraphsNumPoints(const QString &curveName) const
See CurvesGraphs::curvesGraphsNumPoints.
void movePoint(const QString &pointIdentifier, const QPointF &deltaScreen)
See Curve::movePoint.
const CoordSystem & coordSystem() const
Currently active CoordSystem.
Model for DlgSettingsPointMatch and CmdSettingsPointMatch.
Model for DlgSettingsGridDisplay and CmdSettingsGridDisplay.
void setModelAxesChecker(const DocumentModelAxesChecker &modelAxesChecker)
Set method for DocumentModelAxesChecker.
void setModelGridRemoval(const DocumentModelGridRemoval &modelGridRemoval)
Set method for DocumentModelGridRemoval.
void addPointGraphWithGeneratedIdentifier(const QString &curveName, const QPointF &posScreen, QString &generatedIentifier, double ordinal)
Add a single graph point with a generated point identifier.
void setModelPointMatch(const DocumentModelPointMatch &modelPointMatch)
Set method for DocumentModelPointMatch.
void removePointAxis(const QString &identifier)
Perform the opposite of addPointAxis.
void setModelGeneral(const DocumentModelGeneral &modelGeneral)
Set method for DocumentModelGeneral.
Model for DlgSettingsCurveProperties and CmdSettingsCurveProperties.
DocumentModelGridRemoval modelGridRemoval() const
Get method for DocumentModelGridRemoval.
void setModelSegments(const DocumentModelSegments &modelSegments)
Set method for DocumentModelSegments.
int nextOrdinalForCurve(const QString &curveName) const
Default next ordinal value for specified curve.
bool successfulRead() const
Return true if startup loading succeeded. If the loading failed then reasonForUnsuccessfulRed will ex...
Storage of data belonging to one coordinate system.
void setModelGridDisplay(const DocumentModelGridDisplay &modelGridDisplay)
Set method for DocumentModelGridDisplay.
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...
void iterateThroughCurvePointsAxes(const Functor2wRet< const QString &, const Point &, CallbackSearchReturn > &ftorWithCallback)
See Curve::iterateThroughCurvePoints, for the axes curve.
const Curve * curveForCurveName(const QString &curveName) const
See CurvesGraphs::curveForCurveNames, although this also works for AXIS_CURVE_NAME.
DocumentModelGeneral modelGeneral() const
Get method for DocumentModelGeneral.
DocumentAxesPointsRequired documentAxesPointsRequired() const
Get method for DocumentAxesPointsRequired.
DocumentModelColorFilter modelColorFilter() const
Get method for DocumentModelColorFilter.
void setModelDigitizeCurve(const DocumentModelDigitizeCurve &modelDigitizeCurve)
Set method for DocumentModelDigitizeCurve.
void addScaleWithGeneratedIdentifier(const QPointF &posScreen0, const QPointF &posScreen1, double scaleLength, QString &identifier0, QString &identifier1, double ordinal0, double ordinal1)
Add scale with a generated point identifier.
void setModelCoords(const DocumentModelCoords &modelCoords)
Set method for DocumentModelCoords.
DocumentModelPointMatch modelPointMatch() const
Get method for DocumentModelPointMatch.
bool loadCurvesFile(const QString &curvesFile)
Load the curve names in the specified Engauge file into the current document. This is called near the...
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...
void setPixmap(const QImage &image)
Set method for the background pixmap.
void checkEditPointAxis(const QString &pointIdentifier, const QPointF &posScreen, const QPointF &posGraph, bool &isError, QString &errorMessage)
Check before calling editPointAxis.
void setCoordSystemIndex(CoordSystemIndex coordSystemIndex)
Set the index of current active CoordSystem.
void removePointGraph(const QString &identifier)
Perform the opposite of addPointGraph.
void setModelExport(const DocumentModelExportFormat &modelExport)
Set method for DocumentModelExportFormat.
DocumentModelDigitizeCurve modelDigitizeCurve() const
Get method for DocumentModelDigitizeCurve.
Model for DlgSettingsDigitizeCurve and CmdSettingsDigitizeCurve.
void editPointAxis(const QPointF &posGraph, const QString &identifier)
Edit the graph coordinates of a single axis point. Call this after checkAddPointAxis to guarantee suc...
Container for all graph curves. The axes point curve is external to this class.
Model for DlgSettingsColorFilter and CmdSettingsColorFilter.
void setModelCurveStyles(const CurveStyles &modelCurveStyles)
Set method for CurveStyles.
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.
void setCurveAxes(const Curve &curveAxes)
Let CmdAbstract classes overwrite axes Curve.
CoordSystemIndex coordSystemIndex() const
Index of current active CoordSystem.
void removePointsInCurvesGraphs(CurvesGraphs &curvesGraphs)
Remove all points identified in the specified CurvesGraphs. See also addPointsInCurvesGraphs.
DocumentModelSegments modelSegments() const
Get method for DocumentModelSegments.
QPointF positionScreen(const QString &pointIdentifier) const
See Curve::positionScreen.
DocumentModelGridDisplay modelGridDisplay() const
Get method for DocumentModelGridDisplay.
void setModelColorFilter(const DocumentModelColorFilter &modelColorFilter)
Set method for DocumentModelColorFilter.
Model for DlgSettingsCoords and CmdSettingsCoords.
Storage of one imported image and the data attached to that image.
Container for one set of digitized Points.
void printStream(QString indentation, QTextStream &str) const
Debugging method that supports print method of this class and printStream method of some other class(...
QString reasonForUnsuccessfulRead() const
Return an informative text message explaining why startup loading failed. Applies if successfulRead r...
Model for DlgSettingsAxesChecker and CmdSettingsAxesChecker.
void addPointAxisWithGeneratedIdentifier(const QPointF &posScreen, const QPointF &posGraph, QString &identifier, double ordinal, bool isXOnly)
Add a single axis point with a generated point identifier.
unsigned int coordSystemCount() const
Number of CoordSystem.
void setDocumentAxesPointsRequired(DocumentAxesPointsRequired documentAxesPointsRequired)
Set the number of axes points required.
Model for DlgSettingsSegments and CmdSettingsSegments.
void iterateThroughCurvesPointsGraphs(const Functor2wRet< const QString &, const Point &, CallbackSearchReturn > &ftorWithCallback)
See Curve::iterateThroughCurvePoints, for all the graphs curves.
void setCurvesGraphs(const CurvesGraphs &curvesGraphs)
Let CmdAbstract classes overwrite CurvesGraphs.
DocumentModelExportFormat modelExport() const
Get method for DocumentModelExportFormat.
void saveXml(QXmlStreamWriter &writer) const
Save document to xml.
QPixmap pixmap() const
Return the image that is being digitized.
void addPointsInCurvesGraphs(CurvesGraphs &curvesGraphs)
Add all points identified in the specified CurvesGraphs. See also removePointsInCurvesGraphs.
void iterateThroughCurveSegments(const QString &curveName, const Functor2wRet< const Point &, const Point &, CallbackSearchReturn > &ftorWithCallback) const
See Curve::iterateThroughCurveSegments, for any axes or graph curve.
QPointF positionGraph(const QString &pointIdentifier) const
See Curve::positionGraph.
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.
CurveStyles modelCurveStyles() const
Get method for CurveStyles.
This class plays the role of context class in a state machine, although the 'states' are actually dif...
void initializeGridDisplay(const Transformation &transformation)
Initialize grid display. This is called immediately after the transformation has been defined for the...
void print() const
Debugging method for printing directly from symbolic debugger.
const CurvesGraphs & curvesGraphs() const
Make all Curves available, read only, for CmdAbstract classes only.
Model for DlgSettingsGridRemoval and CmdSettingsGridRemoval. The settings are unstable until the user...
const Curve & curveAxes() const
Get method for axis curve.
DocumentModelCoords modelCoords() const
Get method for DocumentModelCoords.
QStringList curvesGraphsNames() const
See CurvesGraphs::curvesGraphsNames.
void updatePointOrdinals(const Transformation &transformation)
Update point ordinals after point addition/removal or dragging.
QString selectedCurveName() const
Currently selected curve name. This is used to set the selected curve combobox in MainWindow...
bool isXOnly(const QString &pointIdentifier) const
See Curve::isXOnly.
void setSelectedCurveName(const QString &selectedCurveName)
Save curve name that is selected for the current coordinate system, for the next time the coordinate ...
DocumentModelAxesChecker modelAxesChecker() const
Get method for DocumentModelAxesChecker.