Engauge Digitizer
2
Main Page
Classes
Files
File List
File Members
Cmd
CmdAbstract.h
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_ABSTRACT_H
8
#define CMD_ABSTRACT_H
9
10
#include "PointIdentifiers.h"
11
#include <QUndoCommand>
12
13
class
Document
;
14
class
MainWindow
;
15
class
QXmlStreamWriter;
16
18
class
CmdAbstract
:
public
QUndoCommand
19
{
20
public
:
22
CmdAbstract
(
MainWindow
&
mainWindow
,
23
Document
&
document
,
24
const
QString &cmdDescription);
25
26
virtual
~
CmdAbstract
();
27
29
virtual
void
cmdRedo
() = 0;
30
32
virtual
void
cmdUndo
() = 0;
33
35
virtual
void
saveXml
(QXmlStreamWriter &writer)
const
= 0;
36
37
protected
:
39
Document
&
document
();
40
42
const
Document
&
document
()
const
;
43
45
MainWindow
&
mainWindow
();
46
49
void
resetSelection
(
const
PointIdentifiers
&pointIdentifiersToSelect);
50
51
private
:
52
CmdAbstract
();
53
54
virtual
void
redo ();
// Calls cmdRedo
55
virtual
void
undo ();
// Calls cmdUndo
56
57
MainWindow
&m_mainWindow;
58
Document
&m_document;
59
60
// Snapshots of GraphicsPointAbstractBase::identifierIndex before and after redo
61
bool
m_isFirstRedo;
62
unsigned
int
m_identifierIndexBeforeRedo;
63
unsigned
int
m_identifierIndexAfterRedo;
64
};
65
66
#endif // CMD_ABSTRACT_H
PointIdentifiers
Hash table class that tracks point identifiers as the key, with a corresponding boolean value...
Definition:
PointIdentifiers.h:19
CmdAbstract
Wrapper around QUndoCommand. This simplifies the more complicated feature set of QUndoCommand.
Definition:
CmdAbstract.h:18
CmdAbstract::cmdRedo
virtual void cmdRedo()=0
Redo method that is called when QUndoStack is moved one command forward.
CmdAbstract::mainWindow
MainWindow & mainWindow()
Return the MainWindow so it can be updated by this command as a last step.
Definition:
CmdAbstract.cpp:43
Document
Storage of one imported image and the data attached to that image.
Definition:
Document.h:40
CmdAbstract::cmdUndo
virtual void cmdUndo()=0
Undo method that is called when QUndoStack is moved one command backward.
CmdAbstract::document
Document & document()
Return the Document that this command will modify during redo and undo.
Definition:
CmdAbstract.cpp:33
CmdAbstract::saveXml
virtual void saveXml(QXmlStreamWriter &writer) const =0
Save commands as xml for later uploading.
CmdAbstract::resetSelection
void resetSelection(const PointIdentifiers &pointIdentifiersToSelect)
Since the set of selected points has probably changed, changed that set back to the specified set...
Definition:
CmdAbstract.cpp:79
MainWindow
Main window consisting of menu, graphics scene, status bar and optional toolbars as a Single Document...
Definition:
MainWindow.h:77
Generated on Mon Apr 25 2016 11:02:00 for Engauge Digitizer by
1.8.11