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

Base class for CmdBase leaf subclasses that involve point additions, deletions and/or modifications. More...

#include <CmdPointChangeBase.h>

Inheritance diagram for CmdPointChangeBase:
CmdAbstract CmdAddPointAxis CmdAddPointGraph CmdAddPointsGraph CmdAddScale CmdCut CmdDelete CmdEditPointAxis CmdEditPointGraph CmdMoveBy

Public Member Functions

 CmdPointChangeBase (MainWindow &mainWindow, Document &document, const QString &cmdDescription)
 Single constructor.
 
- Public Member Functions inherited from CmdAbstract
 CmdAbstract (MainWindow &mainWindow, Document &document, const QString &cmdDescription)
 Single constructor.
 
virtual void cmdRedo ()=0
 Redo method that is called when QUndoStack is moved one command forward.
 
virtual void cmdUndo ()=0
 Undo method that is called when QUndoStack is moved one command backward.
 
virtual void saveXml (QXmlStreamWriter &writer) const =0
 Save commands as xml for later uploading.
 

Protected Member Functions

void restoreDocumentState (Document &document) const
 Restore the document previously saved by saveDocumentState.
 
void saveDocumentState (const Document &document)
 Save the document state for restoration by restoreDocumentState.
 
- Protected Member Functions inherited from CmdAbstract
Documentdocument ()
 Return the Document that this command will modify during redo and undo.
 
const Documentdocument () const
 Return a const copy of the Document for non redo/undo interaction.
 
MainWindowmainWindow ()
 Return the MainWindow so it can be updated by this command as a last step.
 
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

Base class for CmdBase leaf subclasses that involve point additions, deletions and/or modifications.

This class uses a strategy of taking a snapshot of all points before the redo, and then applying that snapshot to the Document to (later) perform the undo. Before this strategy, the strategy was to just do the opposite steps of the redo, but that strategy was too fragile since it implicity assumed no point changes occurred after the redo of this command and before the redo of the next command. However, point updates like "ordinal maintenance" do occur during that time period

Definition at line 22 of file CmdPointChangeBase.h.


The documentation for this class was generated from the following files: