Engauge Digitizer
2
Loading...
Searching...
No Matches
Cmd
CmdSelectCoordSystem.cpp
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
#include "CmdSelectCoordSystem.h"
8
#include "DataKey.h"
9
#include "Document.h"
10
#include "DocumentSerialize.h"
11
#include "EngaugeAssert.h"
12
#include "Logger.h"
13
#include "MainWindow.h"
14
#include "MimePoints.h"
15
#include <QApplication>
16
#include <QClipboard>
17
#include <QTextStream>
18
#include "QtToString.h"
19
#include <QXmlStreamReader>
20
21
const
QString CMD_DESCRIPTION (
"Select Coordinate System"
);
22
23
CmdSelectCoordSystem::CmdSelectCoordSystem
(
MainWindow
&mainWindow,
24
Document
&document,
25
CoordSystemIndex coordSystemIndex) :
26
CmdAbstract
(mainWindow,
27
document,
28
CMD_DESCRIPTION),
29
m_coordSystemIndexBefore (document.coordSystemIndex()),
30
m_coordSystemIndexAfter (coordSystemIndex)
31
{
32
LOG4CPP_INFO_S ((*mainCat)) <<
"CmdSelectCoordSystem::CmdSelectCoordSystem"
;
33
}
34
35
CmdSelectCoordSystem::CmdSelectCoordSystem
(
MainWindow
&mainWindow,
36
Document
&document,
37
const
QString &cmdDescription,
38
QXmlStreamReader &
/* reader */
) :
39
CmdAbstract
(mainWindow,
40
document,
41
cmdDescription)
42
{
43
LOG4CPP_INFO_S ((*mainCat)) <<
"CmdSelectCoordSystem::CmdSelectCoordSystem"
;
44
}
45
46
CmdSelectCoordSystem::~CmdSelectCoordSystem ()
47
{
48
}
49
50
void
CmdSelectCoordSystem::cmdRedo
()
51
{
52
LOG4CPP_INFO_S ((*mainCat)) <<
"CmdSelectCoordSystem::cmdRedo"
53
<<
" index="
<< m_coordSystemIndexBefore <<
"->"
<< m_coordSystemIndexAfter;
54
55
mainWindow
().
updateCoordSystem
(m_coordSystemIndexAfter);
56
}
57
58
void
CmdSelectCoordSystem::cmdUndo
()
59
{
60
LOG4CPP_INFO_S ((*mainCat)) <<
"CmdSelectCoordSystem::cmdUndo"
61
<<
" index="
<< m_coordSystemIndexAfter <<
"->"
<< m_coordSystemIndexBefore;
62
63
mainWindow
().
updateCoordSystem
(m_coordSystemIndexBefore);
64
}
65
66
void
CmdSelectCoordSystem::saveXml
(QXmlStreamWriter &writer)
const
67
{
68
writer.writeStartElement(DOCUMENT_SERIALIZE_CMD);
69
writer.writeEndElement();
70
}
CmdAbstract
Wrapper around QUndoCommand. This simplifies the more complicated feature set of QUndoCommand.
Definition
CmdAbstract.h:19
CmdAbstract::mainWindow
MainWindow & mainWindow()
Return the MainWindow so it can be updated by this command as a last step.
Definition
CmdAbstract.cpp:43
CmdSelectCoordSystem::CmdSelectCoordSystem
CmdSelectCoordSystem(MainWindow &mainWindow, Document &document, CoordSystemIndex coordSystem)
Constructor for normal creation.
Definition
CmdSelectCoordSystem.cpp:23
CmdSelectCoordSystem::cmdUndo
virtual void cmdUndo()
Undo method that is called when QUndoStack is moved one command backward.
Definition
CmdSelectCoordSystem.cpp:58
CmdSelectCoordSystem::cmdRedo
virtual void cmdRedo()
Redo method that is called when QUndoStack is moved one command forward.
Definition
CmdSelectCoordSystem.cpp:50
CmdSelectCoordSystem::saveXml
virtual void saveXml(QXmlStreamWriter &writer) const
Save commands as xml for later uploading.
Definition
CmdSelectCoordSystem.cpp:66
Document
Storage of one imported image and the data attached to that image.
Definition
Document.h:41
MainWindow
Main window consisting of menu, graphics scene, status bar and optional toolbars as a Single Document...
Definition
MainWindow.h:78
MainWindow::updateCoordSystem
void updateCoordSystem(CoordSystemIndex coordSystemIndex)
Select a different CoordSystem.
Definition
MainWindow.cpp:3818
Generated on Mon Jan 8 2024 05:59:40 for Engauge Digitizer by
1.9.8