Go to the documentation of this file.
14 #include <QXmlStreamReader>
21 const QPointF &posScreen0,
22 const QPointF &posScreen1,
29 m_posScreen0 (posScreen0),
30 m_posScreen1 (posScreen1),
31 m_scaleLength (scaleLength),
32 m_ordinal0 (ordinal0),
38 <<
" scaleLength=" << scaleLength
39 <<
" ordinal0=" << ordinal0
40 <<
" ordinal1=" << ordinal1;
45 const QString &cmdDescription,
46 QXmlStreamReader &reader) :
53 QXmlStreamAttributes attributes = reader.attributes();
65 QString (
"Missing attribute(s) %1, %2, %3, %4, %5, %6, %7, %8 and/or %9")
124 const char FORMAT =
'g';
125 const int PRECISION = 16;
139 writer.writeEndElement();
virtual void cmdRedo()
Redo method that is called when QUndoStack is moved one command forward.
void xmlExitWithError(QXmlStreamReader &reader, const QString &message)
Show specified message for an error while reading xml, then quit.
virtual void saveXml(QXmlStreamWriter &writer) const
Save commands as xml for later uploading.
Document & document()
Return the Document that this command will modify during redo and undo.
const QString DOCUMENT_SERIALIZE_ORDINAL1
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.
CmdAddScale(MainWindow &mainWindow, Document &document, const QPointF &posScreen0, const QPointF &posScreen1, double scaleLength, double ordinal0, double ordinal1)
Constructor for normal creation.
Storage of one imported image and the data attached to that image.
const QString DOCUMENT_SERIALIZE_SCALE_LENGTH
const QString DOCUMENT_SERIALIZE_ORDINAL
const QString DOCUMENT_SERIALIZE_IDENTIFIER
const QString DOCUMENT_SERIALIZE_SCREEN_X1
void saveDocumentState(const Document &document)
Save the document state for restoration by restoreDocumentState.
const QString CMD_DESCRIPTION("Add scale point")
void updateAfterCommand()
See GraphicsScene::updateAfterCommand.
Main window consisting of menu, graphics scene, status bar and optional toolbars as a Single Document...
const QString DOCUMENT_SERIALIZE_SCREEN_Y
const QString DOCUMENT_SERIALIZE_SCREEN_X
#define LOG4CPP_INFO_S(logger)
Base class for CmdBase leaf subclasses that involve point additions, deletions and/or modifications.
const QString DOCUMENT_SERIALIZE_CMD_TYPE
void saveOrCheckPostCommandDocumentStateHash(const Document &document)
Save, when called the first time, a hash value representing the state of the Document.
void restoreDocumentState(Document &document) const
Restore the document previously saved by saveDocumentState.
virtual void cmdUndo()
Undo method that is called when QUndoStack is moved one command backward.
void saveOrCheckPreCommandDocumentStateHash(const Document &document)
Save, when called the first time, a hash value representing the state of the Document.
log4cpp::Category * mainCat
void updatePointOrdinals(const Transformation &transformation)
Update point ordinals after point addition/removal or dragging.
MainWindow & mainWindow()
Return the MainWindow so it can be updated by this command as a last step.
const QString DOCUMENT_SERIALIZE_SCREEN_Y1
const QString DOCUMENT_SERIALIZE_CMD_DESCRIPTION
const QString DOCUMENT_SERIALIZE_CMD
QString QPointFToString(const QPointF &pos)
const QString DOCUMENT_SERIALIZE_IDENTIFIER1
const QString DOCUMENT_SERIALIZE_CMD_ADD_SCALE