Engauge Digitizer  2
Public Member Functions | List of all members
CmdMediator Class Reference

Command queue stack. More...

#include <CmdMediator.h>

Inheritance diagram for CmdMediator:

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 CoordSystemcoordSystem () const
 Provide the current CoordSystem to commands with read-only access, primarily for undo/redo processing.
 
const CurvecurveAxes () const
 See Document::curveAxes.
 
QStringList curvesGraphsNames () const
 See CurvesGraphs::curvesGraphsNames.
 
int curvesGraphsNumPoints (const QString &curveName) const
 See CurvesGraphs::curvesGraphsNumPoints.
 
Documentdocument ()
 Provide the Document to commands, primarily for undo/redo processing.
 
const Documentdocument () const
 Provide the Document to commands with read-only access, primarily for undo/redo processing.
 
bool isModified () const
 Dirty flag. More...
 
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. More...
 
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.
 

Detailed Description

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.

Member Function Documentation

◆ isModified()

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.

◆ setDocumentAxesPointsRequired()

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.


The documentation for this class was generated from the following files: