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

Command for changing the currently selected CoordSystem. More...

#include <CmdSelectCoordSystem.h>

Inheritance diagram for CmdSelectCoordSystem:
Inheritance graph
Collaboration diagram for CmdSelectCoordSystem:
Collaboration graph

Public Member Functions

 CmdSelectCoordSystem (MainWindow &mainWindow, Document &document, CoordSystemIndex coordSystem)
 Constructor for normal creation. More...
 
 CmdSelectCoordSystem (MainWindow &mainWindow, Document &document, const QString &cmdDescription, QXmlStreamReader &reader)
 Constructor for parsing error report file xml. More...
 
virtual ~CmdSelectCoordSystem ()
 
virtual void cmdRedo ()
 Redo method that is called when QUndoStack is moved one command forward. More...
 
virtual void cmdUndo ()
 Undo method that is called when QUndoStack is moved one command backward. More...
 
virtual void saveXml (QXmlStreamWriter &writer) const
 Save commands as xml for later uploading. More...
 
- Public Member Functions inherited from CmdAbstract
 CmdAbstract (MainWindow &mainWindow, Document &document, const QString &cmdDescription)
 Single constructor. More...
 
virtual ~CmdAbstract ()
 

Additional Inherited Members

- Protected Member Functions inherited from CmdAbstract
Documentdocument ()
 Return the Document that this command will modify during redo and undo. More...
 
const Documentdocument () const
 Return a const copy of the Document for non redo/undo interaction. More...
 
MainWindowmainWindow ()
 Return the MainWindow so it can be updated by this command as a last step. More...
 
void resetSelection (const PointIdentifiers &pointIdentifiersToSelect)
 Since the set of selected points has probably changed, changed that set back to the specified set. More...
 
void saveOrCheckPostCommandDocumentStateHash (const Document &document)
 Save, when called the first time, a hash value representing the state of the Document. More...
 
void saveOrCheckPreCommandDocumentStateHash (const Document &document)
 Save, when called the first time, a hash value representing the state of the Document. More...
 

Detailed Description

Command for changing the currently selected CoordSystem.

Definition at line 15 of file CmdSelectCoordSystem.h.

Constructor & Destructor Documentation

◆ CmdSelectCoordSystem() [1/2]

CmdSelectCoordSystem::CmdSelectCoordSystem ( MainWindow mainWindow,
Document document,
CoordSystemIndex  coordSystem 
)

Constructor for normal creation.

Definition at line 21 of file CmdSelectCoordSystem.cpp.

24  :
26  document,
28  m_coordSystemIndexBefore (document.coordSystemIndex()),
29  m_coordSystemIndexAfter (coordSystemIndex)
30 {
31  LOG4CPP_INFO_S ((*mainCat)) << "CmdSelectCoordSystem::CmdSelectCoordSystem";

◆ CmdSelectCoordSystem() [2/2]

CmdSelectCoordSystem::CmdSelectCoordSystem ( MainWindow mainWindow,
Document document,
const QString &  cmdDescription,
QXmlStreamReader &  reader 
)

Constructor for parsing error report file xml.

Definition at line 33 of file CmdSelectCoordSystem.cpp.

37  :
39  document,
40  cmdDescription)
41 {
42  LOG4CPP_INFO_S ((*mainCat)) << "CmdSelectCoordSystem::CmdSelectCoordSystem";

◆ ~CmdSelectCoordSystem()

CmdSelectCoordSystem::~CmdSelectCoordSystem ( )
virtual

Definition at line 44 of file CmdSelectCoordSystem.cpp.

46 {

Member Function Documentation

◆ cmdRedo()

void CmdSelectCoordSystem::cmdRedo ( )
virtual

Redo method that is called when QUndoStack is moved one command forward.

Implements CmdAbstract.

Definition at line 48 of file CmdSelectCoordSystem.cpp.

50 {
51  LOG4CPP_INFO_S ((*mainCat)) << "CmdSelectCoordSystem::cmdRedo"
52  << " index=" << m_coordSystemIndexBefore << "->" << m_coordSystemIndexAfter;
53 
55  mainWindow().updateCoordSystem (m_coordSystemIndexAfter);

◆ cmdUndo()

void CmdSelectCoordSystem::cmdUndo ( )
virtual

Undo method that is called when QUndoStack is moved one command backward.

Implements CmdAbstract.

Definition at line 58 of file CmdSelectCoordSystem.cpp.

60 {
61  LOG4CPP_INFO_S ((*mainCat)) << "CmdSelectCoordSystem::cmdUndo"
62  << " index=" << m_coordSystemIndexAfter << "->" << m_coordSystemIndexBefore;
63 
65  mainWindow().updateCoordSystem (m_coordSystemIndexBefore);

◆ saveXml()

void CmdSelectCoordSystem::saveXml ( QXmlStreamWriter &  writer) const
virtual

Save commands as xml for later uploading.

Implements CmdAbstract.

Definition at line 68 of file CmdSelectCoordSystem.cpp.

70 {
71  writer.writeStartElement(DOCUMENT_SERIALIZE_CMD);
72  writer.writeEndElement();

The documentation for this class was generated from the following files:
CmdAbstract::document
Document & document()
Return the Document that this command will modify during redo and undo.
Definition: CmdAbstract.cpp:35
MainWindow::updateCoordSystem
void updateCoordSystem(CoordSystemIndex coordSystemIndex)
Select a different CoordSystem.
Definition: MainWindow.cpp:3416
LOG4CPP_INFO_S
#define LOG4CPP_INFO_S(logger)
Definition: convenience.h:18
CMD_DESCRIPTION
const QString CMD_DESCRIPTION("Select Coordinate System")
CmdAbstract::saveOrCheckPostCommandDocumentStateHash
void saveOrCheckPostCommandDocumentStateHash(const Document &document)
Save, when called the first time, a hash value representing the state of the Document.
Definition: CmdAbstract.cpp:102
Document::coordSystemIndex
CoordSystemIndex coordSystemIndex() const
Index of current active CoordSystem.
Definition: Document.cpp:314
CmdAbstract::saveOrCheckPreCommandDocumentStateHash
void saveOrCheckPreCommandDocumentStateHash(const Document &document)
Save, when called the first time, a hash value representing the state of the Document.
Definition: CmdAbstract.cpp:125
mainCat
log4cpp::Category * mainCat
Definition: Logger.cpp:14
CmdAbstract::mainWindow
MainWindow & mainWindow()
Return the MainWindow so it can be updated by this command as a last step.
Definition: CmdAbstract.cpp:45
DOCUMENT_SERIALIZE_CMD
const QString DOCUMENT_SERIALIZE_CMD
CmdAbstract
Wrapper around QUndoCommand. This simplifies the more complicated feature set of QUndoCommand.
Definition: CmdAbstract.h:18