Engauge Digitizer  2
CmdAddScale.h
1 /******************************************************************************************************
2  * (C) 2017 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_ADD_SCALE_H
8 #define CMD_ADD_SCALE_H
9 
10 #include "CmdPointChangeBase.h"
11 #include <QPointF>
12 
13 class QXmlStreamReader;
14 
17 {
18  public:
22  const QPointF &posScreen0,
23  const QPointF &posScreen1,
24  double scaleLength,
25  double ordinal0,
26  double ordinal1);
27 
29  CmdAddScale(MainWindow &mainWindow,
30  Document &document,
31  const QString &cmdDescription,
32  QXmlStreamReader &reader);
33 
34  virtual ~CmdAddScale();
35 
36  virtual void cmdRedo ();
37  virtual void cmdUndo ();
38  virtual void saveXml (QXmlStreamWriter &writer) const;
39 
40 private:
41  CmdAddScale();
42 
43  QPointF m_posScreen0;
44  QPointF m_posScreen1;
45  double m_scaleLength;
46  QString m_identifierAdded0; // First point that got added
47  QString m_identifierAdded1; // Second point that got added
48  double m_ordinal0;
49  double m_ordinal1;
50 };
51 
52 #endif // CMD_ADD_SCALE_H
Base class for CmdBase leaf subclasses that involve point additions, deletions and/or modifications...
MainWindow & mainWindow()
Return the MainWindow so it can be updated by this command as a last step.
Definition: CmdAbstract.cpp:45
Storage of one imported image and the data attached to that image.
Definition: Document.h:41
Command for adding one scale point.
Definition: CmdAddScale.h:16
virtual void cmdRedo()
Redo method that is called when QUndoStack is moved one command forward.
Definition: CmdAddScale.cpp:92
virtual void cmdUndo()
Undo method that is called when QUndoStack is moved one command backward.
Document & document()
Return the Document that this command will modify during redo and undo.
Definition: CmdAbstract.cpp:35
virtual void saveXml(QXmlStreamWriter &writer) const
Save commands as xml for later uploading.
Main window consisting of menu, graphics scene, status bar and optional toolbars as a Single Document...
Definition: MainWindow.h:89