Engauge Digitizer 2
Loading...
Searching...
No Matches
CmdMediator.h
Go to the documentation of this file.
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#ifndef CMD_MEDIATOR_H
8#define CMD_MEDIATOR_H
9
10#include "CoordsType.h"
11#include "Document.h"
13#include "PointStyle.h"
14#include <QUndoStack>
15
16class MainWindow;
17class QImage;
18
23class CmdMediator : public QUndoStack
24{
25public:
27 CmdMediator (MainWindow &mainWindow,
28 const QImage &image);
29
31 CmdMediator (MainWindow &mainWindow,
32 const QString &fileName);
33
36
38 const CoordSystem &coordSystem () const;
39
41 const Curve &curveAxes () const;
42
44 QStringList curvesGraphsNames () const;
45
47 int curvesGraphsNumPoints (const QString &curveName) const;
48
51
53 const Document &document () const;
54
57 bool isModified () const;
58
60 void iterateThroughCurvePointsAxes (const Functor2wRet<const QString &, const Point &, CallbackSearchReturn> &ftorWithCallback);
61
63 void iterateThroughCurvePointsAxes (const Functor2wRet<const QString &, const Point &, CallbackSearchReturn> &ftorWithCallback) const;
64
66 void iterateThroughCurvesPointsGraphs (const Functor2wRet<const QString &, const Point &, CallbackSearchReturn> &ftorWithCallback);
67
69 QPixmap pixmap () const;
70
72 QString reasonForUnsuccessfulRead () const;
73
75 void saveXml(QXmlStreamWriter &writer) const;
76
78 QString selectedCurveName () const;
79
82 void setDocumentAxesPointsRequired (DocumentAxesPointsRequired documentAxesPointsRequired);
83
85 void setSelectedCurveName (const QString &selectedCurveName);
86
88 bool successfulRead () const;
89
90private:
91 CmdMediator ();
92
93 void connectSignals (MainWindow &mainWindow);
94
95 Document m_document;
96
97};
98
99#endif // CMD_MEDIATOR_H
Command queue stack.
Definition CmdMediator.h:24
~CmdMediator()
Destructor.
const Curve & curveAxes() const
See Document::curveAxes.
QString selectedCurveName() const
Currently selected curve name. This is used to set the selected curve combobox in MainWindow.
QString reasonForUnsuccessfulRead() const
See Document::reasonForUnsuccessfulRead.
QPixmap pixmap() const
See Document::pixmap.
bool isModified() const
Dirty flag.
void saveXml(QXmlStreamWriter &writer) const
Serialize to xml.
void iterateThroughCurvesPointsGraphs(const Functor2wRet< const QString &, const Point &, CallbackSearchReturn > &ftorWithCallback)
See Curve::iterateThroughCurvePoints, for all the graphs curves.
void setSelectedCurveName(const QString &selectedCurveName)
Save curve name that is selected for the current coordinate system, for the next time the coordinate ...
QStringList curvesGraphsNames() const
See CurvesGraphs::curvesGraphsNames.
const CoordSystem & coordSystem() const
Provide the current CoordSystem to commands with read-only access, primarily for undo/redo processing...
int curvesGraphsNumPoints(const QString &curveName) const
See CurvesGraphs::curvesGraphsNumPoints.
bool successfulRead() const
Wrapper for Document::successfulRead.
void setDocumentAxesPointsRequired(DocumentAxesPointsRequired documentAxesPointsRequired)
Set the number of axes points required.
void iterateThroughCurvePointsAxes(const Functor2wRet< const QString &, const Point &, CallbackSearchReturn > &ftorWithCallback)
See Curve::iterateThroughCurvePoints, for the single axes curve.
Document & document()
Provide the Document to commands, primarily for undo/redo processing.
Storage of data belonging to one coordinate system.
Definition CoordSystem.h:43
Container for one set of digitized Points.
Definition Curve.h:34
Storage of one imported image and the data attached to that image.
Definition Document.h:42
Main window consisting of menu, graphics scene, status bar and optional toolbars as a Single Document...
Definition MainWindow.h:92