Engauge Digitizer 2
|
Command queue stack. More...
#include <CmdMediator.h>
Public Member Functions | |
CmdMediator (MainWindow &mainWindow, const QImage &image) | |
Constructor for imported images and dragged images. Only one coordinate system is created but others can be added later. | |
CmdMediator (MainWindow &mainWindow, const QString &fileName) | |
Constructor for opened Documents and error report files. The specified xml file is opened and read. | |
~CmdMediator () | |
Destructor. | |
const CoordSystem & | coordSystem () const |
Provide the current CoordSystem to commands with read-only access, primarily for undo/redo processing. | |
const Curve & | curveAxes () const |
See Document::curveAxes. | |
QStringList | curvesGraphsNames () const |
See CurvesGraphs::curvesGraphsNames. | |
int | curvesGraphsNumPoints (const QString &curveName) const |
See CurvesGraphs::curvesGraphsNumPoints. | |
Document & | document () |
Provide the Document to commands, primarily for undo/redo processing. | |
const Document & | document () const |
Provide the Document to commands with read-only access, primarily for undo/redo processing. | |
bool | isModified () const |
Dirty flag. | |
void | iterateThroughCurvePointsAxes (const Functor2wRet< const QString &, const Point &, CallbackSearchReturn > &ftorWithCallback) |
See Curve::iterateThroughCurvePoints, for the single axes curve. | |
void | iterateThroughCurvePointsAxes (const Functor2wRet< const QString &, const Point &, CallbackSearchReturn > &ftorWithCallback) const |
See Curve::iterateThroughCurvePoints, for the single axes curve. | |
void | iterateThroughCurvesPointsGraphs (const Functor2wRet< const QString &, const Point &, CallbackSearchReturn > &ftorWithCallback) |
See Curve::iterateThroughCurvePoints, for all the graphs curves. | |
QPixmap | pixmap () const |
See Document::pixmap. | |
QString | reasonForUnsuccessfulRead () const |
See Document::reasonForUnsuccessfulRead. | |
void | saveXml (QXmlStreamWriter &writer) const |
Serialize to xml. | |
QString | selectedCurveName () const |
Currently selected curve name. This is used to set the selected curve combobox in MainWindow. | |
void | setDocumentAxesPointsRequired (DocumentAxesPointsRequired documentAxesPointsRequired) |
Set the number of axes points required. | |
void | setSelectedCurveName (const QString &selectedCurveName) |
Save curve name that is selected for the current coordinate system, for the next time the coordinate system reappears. | |
bool | successfulRead () const |
Wrapper for Document::successfulRead. |
Command queue stack.
This class lies between the Document and the rest of the application. This approach is attractive because the command stack and Document are born together, work together, and deleted together. Also, wrapping this class around Document helps to encapsulate Document that much more.
Definition at line 23 of file CmdMediator.h.
CmdMediator::CmdMediator | ( | MainWindow & | mainWindow, |
const QImage & | image ) |
Constructor for imported images and dragged images. Only one coordinate system is created but others can be added later.
Definition at line 25 of file CmdMediator.cpp.
CmdMediator::CmdMediator | ( | MainWindow & | mainWindow, |
const QString & | fileName ) |
Constructor for opened Documents and error report files. The specified xml file is opened and read.
Definition at line 34 of file CmdMediator.cpp.
CmdMediator::~CmdMediator | ( | ) |
const CoordSystem & CmdMediator::coordSystem | ( | ) | const |
Provide the current CoordSystem to commands with read-only access, primarily for undo/redo processing.
Definition at line 52 of file CmdMediator.cpp.
const Curve & CmdMediator::curveAxes | ( | ) | const |
See Document::curveAxes.
Definition at line 57 of file CmdMediator.cpp.
QStringList CmdMediator::curvesGraphsNames | ( | ) | const |
See CurvesGraphs::curvesGraphsNames.
Definition at line 62 of file CmdMediator.cpp.
int CmdMediator::curvesGraphsNumPoints | ( | const QString & | curveName | ) | const |
See CurvesGraphs::curvesGraphsNumPoints.
Definition at line 67 of file CmdMediator.cpp.
Document & CmdMediator::document | ( | ) |
Provide the Document to commands, primarily for undo/redo processing.
Definition at line 72 of file CmdMediator.cpp.
const Document & CmdMediator::document | ( | ) | const |
Provide the Document to commands with read-only access, primarily for undo/redo processing.
Definition at line 77 of file CmdMediator.cpp.
bool CmdMediator::isModified | ( | ) | const |
Dirty flag.
Document is dirty if there are any unsaved changes. The dirty flag is pushed (rather than pulled from this method) through the QUndoStack::cleanChanged signal
Definition at line 82 of file CmdMediator.cpp.
void CmdMediator::iterateThroughCurvePointsAxes | ( | const Functor2wRet< const QString &, const Point &, CallbackSearchReturn > & | ftorWithCallback | ) |
See Curve::iterateThroughCurvePoints, for the single axes curve.
Definition at line 87 of file CmdMediator.cpp.
void CmdMediator::iterateThroughCurvePointsAxes | ( | const Functor2wRet< const QString &, const Point &, CallbackSearchReturn > & | ftorWithCallback | ) | const |
See Curve::iterateThroughCurvePoints, for the single axes curve.
Definition at line 92 of file CmdMediator.cpp.
void CmdMediator::iterateThroughCurvesPointsGraphs | ( | const Functor2wRet< const QString &, const Point &, CallbackSearchReturn > & | ftorWithCallback | ) |
See Curve::iterateThroughCurvePoints, for all the graphs curves.
Definition at line 97 of file CmdMediator.cpp.
QPixmap CmdMediator::pixmap | ( | ) | const |
See Document::pixmap.
Definition at line 102 of file CmdMediator.cpp.
QString CmdMediator::reasonForUnsuccessfulRead | ( | ) | const |
See Document::reasonForUnsuccessfulRead.
Definition at line 109 of file CmdMediator.cpp.
void CmdMediator::saveXml | ( | QXmlStreamWriter & | writer | ) | const |
Serialize to xml.
Definition at line 114 of file CmdMediator.cpp.
QString CmdMediator::selectedCurveName | ( | ) | const |
Currently selected curve name. This is used to set the selected curve combobox in MainWindow.
Definition at line 127 of file CmdMediator.cpp.
void CmdMediator::setDocumentAxesPointsRequired | ( | DocumentAxesPointsRequired | documentAxesPointsRequired | ) |
Set the number of axes points required.
This is called during the Document creation process, after imported images have been previewed or loaded files have had at least some xml parsing
Definition at line 132 of file CmdMediator.cpp.
void CmdMediator::setSelectedCurveName | ( | const QString & | selectedCurveName | ) |
Save curve name that is selected for the current coordinate system, for the next time the coordinate system reappears.
Definition at line 137 of file CmdMediator.cpp.
bool CmdMediator::successfulRead | ( | ) | const |
Wrapper for Document::successfulRead.
Definition at line 142 of file CmdMediator.cpp.