undo/redo stack. More...
#include <vtkUndoStack.h>
Public Types | |
enum | EventIds { UndoSetRemovedEvent = 1989, UndoSetClearedEvent = 1990 } |
typedef vtkObject | Superclass |
Public Member Functions | |
virtual const char * | GetClassName () |
virtual int | IsA (const char *type) |
void | PrintSelf (ostream &os, vtkIndent indent) override |
virtual void | Push (const char *label, vtkUndoSet *changeSet) |
Push an undo set on the Undo stack. More... | |
const char * | GetUndoSetLabel (unsigned int position) |
Returns the label for the set at the given Undo position. More... | |
const char * | GetRedoSetLabel (unsigned int position) |
Returns the label for the set at the given Redo position. More... | |
unsigned int | GetNumberOfUndoSets () |
Returns the number of sets on the undo stack. More... | |
unsigned int | GetNumberOfRedoSets () |
Returns the number of sets on the undo stack. More... | |
int | CanUndo () |
Returns if undo operation can be performed. More... | |
int | CanRedo () |
Returns if redo operation can be performed. More... | |
virtual vtkUndoSet * | GetNextUndoSet () |
Get the UndoSet on the top of the Undo stack, if any. More... | |
virtual vtkUndoSet * | GetNextRedoSet () |
Get the UndoSet on the top of the Redo stack, if any. More... | |
virtual int | Undo () |
Performs an Undo using the set on the top of the undo stack. More... | |
virtual int | Redo () |
Performs a Redo using the set on the top of the redo stack. More... | |
void | PopUndoStack () |
Pop the undo stack. More... | |
void | PopRedoStack () |
Pop the redo stack. More... | |
void | Clear () |
Clears all the undo/redo elements from the stack. More... | |
virtual bool | GetInUndo () |
Returns if the stack is currently being undone. More... | |
virtual bool | GetInRedo () |
Returns if the stack is currently being redone. More... | |
Public Member Functions inherited from vtkObject | |
vtkBaseTypeMacro (vtkObject, vtkObjectBase) | |
virtual void | DebugOn () |
virtual void | DebugOff () |
bool | GetDebug () |
void | SetDebug (bool debugFlag) |
virtual void | Modified () |
virtual vtkMTimeType | GetMTime () |
void | RemoveObserver (unsigned long tag) |
void | RemoveObservers (unsigned long event) |
void | RemoveObservers (const char *event) |
void | RemoveAllObservers () |
int | HasObserver (unsigned long event) |
int | HasObserver (const char *event) |
int | InvokeEvent (unsigned long event) |
int | InvokeEvent (const char *event) |
unsigned long | AddObserver (unsigned long event, vtkCommand *, float priority=0.0f) |
unsigned long | AddObserver (const char *event, vtkCommand *, float priority=0.0f) |
vtkCommand * | GetCommand (unsigned long tag) |
void | RemoveObserver (vtkCommand *) |
void | RemoveObservers (unsigned long event, vtkCommand *) |
void | RemoveObservers (const char *event, vtkCommand *) |
int | HasObserver (unsigned long event, vtkCommand *) |
int | HasObserver (const char *event, vtkCommand *) |
unsigned long | AddObserver (unsigned long event, U observer, void(T::*callback)(), float priority=0.0f) |
unsigned long | AddObserver (unsigned long event, U observer, void(T::*callback)(vtkObject *, unsigned long, void *), float priority=0.0f) |
unsigned long | AddObserver (unsigned long event, U observer, bool(T::*callback)(vtkObject *, unsigned long, void *), float priority=0.0f) |
int | InvokeEvent (unsigned long event, void *callData) |
int | InvokeEvent (const char *event, void *callData) |
unsigned long | AddObserver (unsigned long event, vtkCommand *, float priority=0.0f) |
unsigned long | AddObserver (const char *event, vtkCommand *, float priority=0.0f) |
vtkCommand * | GetCommand (unsigned long tag) |
void | RemoveObserver (vtkCommand *) |
void | RemoveObservers (unsigned long event, vtkCommand *) |
void | RemoveObservers (const char *event, vtkCommand *) |
int | HasObserver (unsigned long event, vtkCommand *) |
int | HasObserver (const char *event, vtkCommand *) |
unsigned long | AddObserver (unsigned long event, U observer, void(T::*callback)(), float priority=0.0f) |
unsigned long | AddObserver (unsigned long event, U observer, void(T::*callback)(vtkObject *, unsigned long, void *), float priority=0.0f) |
unsigned long | AddObserver (unsigned long event, U observer, bool(T::*callback)(vtkObject *, unsigned long, void *), float priority=0.0f) |
int | InvokeEvent (unsigned long event, void *callData) |
int | InvokeEvent (const char *event, void *callData) |
Public Member Functions inherited from vtkObjectBase | |
const char * | GetClassName () const |
virtual void | Delete () |
virtual void | FastDelete () |
void | Print (ostream &os) |
virtual void | Register (vtkObjectBase *o) |
virtual void | UnRegister (vtkObjectBase *o) |
void | SetReferenceCount (int) |
virtual void | PrintHeader (ostream &os, vtkIndent indent) |
virtual void | PrintTrailer (ostream &os, vtkIndent indent) |
int | GetReferenceCount () |
void | PrintRevisions (ostream &) |
virtual void | PrintHeader (ostream &os, vtkIndent indent) |
virtual void | PrintTrailer (ostream &os, vtkIndent indent) |
int | GetReferenceCount () |
void | PrintRevisions (ostream &) |
Static Public Member Functions | |
static vtkUndoStack * | New () |
static int | IsTypeOf (const char *type) |
static vtkUndoStack * | SafeDownCast (vtkObject *o) |
Static Public Member Functions inherited from vtkObject | |
static vtkObject * | New () |
static void | BreakOnError () |
static void | SetGlobalWarningDisplay (int val) |
static void | GlobalWarningDisplayOn () |
static void | GlobalWarningDisplayOff () |
static int | GetGlobalWarningDisplay () |
static void | SetGlobalWarningDisplay (int val) |
static void | GlobalWarningDisplayOn () |
static void | GlobalWarningDisplayOff () |
static int | GetGlobalWarningDisplay () |
Static Public Member Functions inherited from vtkObjectBase | |
static vtkTypeBool | IsTypeOf (const char *name) |
static vtkObjectBase * | New () |
static vtkObjectBase * | New () |
Protected Attributes | |
vtkUndoStackInternal * | Internal |
int | StackDepth |
Protected Attributes inherited from vtkObject | |
bool | Debug |
vtkTimeStamp | MTime |
vtkSubjectHelper * | SubjectHelper |
Protected Attributes inherited from vtkObjectBase | |
vtkAtomicInt32 | ReferenceCount |
vtkWeakPointerBase ** | WeakPointers |
virtual void | SetStackDepth (int) |
Get set the maximum stack depth. More... | |
virtual int | GetStackDepth () |
Get set the maximum stack depth. More... | |
vtkUndoStack () | |
Get set the maximum stack depth. More... | |
~vtkUndoStack () override | |
Get set the maximum stack depth. More... | |
Additional Inherited Members | |
Protected Member Functions inherited from vtkObject | |
vtkObject () | |
virtual | ~vtkObject () |
void | RegisterInternal (vtkObjectBase *, vtkTypeBool check) VTK_OVERRIDE |
void | UnRegisterInternal (vtkObjectBase *, vtkTypeBool check) VTK_OVERRIDE |
void | InternalGrabFocus (vtkCommand *mouseEvents, vtkCommand *keypressEvents=NULL) |
void | InternalReleaseFocus () |
void | InternalGrabFocus (vtkCommand *mouseEvents, vtkCommand *keypressEvents=NULL) |
void | InternalReleaseFocus () |
Protected Member Functions inherited from vtkObjectBase | |
vtkObjectBase () | |
virtual | ~vtkObjectBase () |
virtual void | CollectRevisions (ostream &) |
virtual void | ReportReferences (vtkGarbageCollector *) |
vtkObjectBase (const vtkObjectBase &) | |
void | operator= (const vtkObjectBase &) |
undo/redo stack.
This an undo stack. Each undo/redo-able operation is a vtkUndoSet object. This class fires a vtkCommand::ModifiedEvent when the undo/redo stack changes.
On Undo, vtkUndoSet::Undo is called on the vtkUndoSet at the top of the undo stack and the set is pushed onto the top of the redo stack. On Redo, vtkUndoSet::Redo is called on the vtkUndoSet at the top of the redo stack and the set is pushed onto the top of the undo stack. When a vtkUndoSet is pushed on the undo stack, the redo stack is cleared.
Each undo set are assigned user-readable labels providing information about the operation(s) that will be undone/redone.
vtkUndoElement, vtkUndoSet and vtkUndoStack form the undo/redo framework core.
Definition at line 35 of file vtkUndoStack.h.
typedef vtkObject vtkUndoStack::Superclass |
Definition at line 45 of file vtkUndoStack.h.
Enumerator | |
---|---|
UndoSetRemovedEvent | |
UndoSetClearedEvent |
Definition at line 38 of file vtkUndoStack.h.
|
protected |
Get set the maximum stack depth.
As more entries are pushed on the stack, if its size exceeds this limit then old entries will be removed. Default is 10.
|
overrideprotected |
Get set the maximum stack depth.
As more entries are pushed on the stack, if its size exceeds this limit then old entries will be removed. Default is 10.
|
static |
|
virtual |
Reimplemented in vtkSMUndoStack.
Reimplemented from vtkObjectBase.
Reimplemented in vtkSMUndoStack.
|
static |
|
overridevirtual |
Reimplemented from vtkObject.
|
virtual |
Push an undo set on the Undo stack.
This will clear any sets in the Redo stack.
Reimplemented in vtkSMUndoStack.
Returns the label for the set at the given Undo position.
0 is the current undo set, 1 is the one preceding to the current one and so on.
Returns the label for the set at the given Redo position.
0 is the next set to redo, 1 is the one after the next one and so on.
unsigned int vtkUndoStack::GetNumberOfUndoSets | ( | ) |
Returns the number of sets on the undo stack.
unsigned int vtkUndoStack::GetNumberOfRedoSets | ( | ) |
Returns the number of sets on the undo stack.
|
inline |
Returns if undo operation can be performed.
Definition at line 85 of file vtkUndoStack.h.
|
inline |
Returns if redo operation can be performed.
Definition at line 90 of file vtkUndoStack.h.
|
virtual |
Get the UndoSet on the top of the Undo stack, if any.
|
virtual |
Get the UndoSet on the top of the Redo stack, if any.
|
virtual |
Performs an Undo using the set on the top of the undo stack.
The set is poped from the undo stack and pushed at the top of the redo stack. Before undo begins, it fires vtkCommand::StartEvent and when undo completes, it fires vtkCommand::EndEvent.
Reimplemented in vtkSMUndoStack.
|
virtual |
Performs a Redo using the set on the top of the redo stack.
The set is poped from the redo stack and pushed at the top of the undo stack. Before redo begins, it fires vtkCommand::StartEvent and when redo completes, it fires vtkCommand::EndEvent.
Reimplemented in vtkSMUndoStack.
void vtkUndoStack::PopUndoStack | ( | ) |
Pop the undo stack.
The UndoElement on the top of the undo stack is popped from the undo stack and pushed on the redo stack. This is same as Undo() except that the vtkUndoElement::Undo() is not invoked.
void vtkUndoStack::PopRedoStack | ( | ) |
Pop the redo stack.
The UndoElement on the top of the redo stack is popped and then pushed on the undo stack. This is same as Redo() except that vtkUndoElement::Redo() is not invoked.
void vtkUndoStack::Clear | ( | ) |
Clears all the undo/redo elements from the stack.
|
virtual |
Returns if the stack is currently being undone.
|
virtual |
Returns if the stack is currently being redone.
|
virtual |
Get set the maximum stack depth.
As more entries are pushed on the stack, if its size exceeds this limit then old entries will be removed. Default is 10.
|
virtual |
Get set the maximum stack depth.
As more entries are pushed on the stack, if its size exceeds this limit then old entries will be removed. Default is 10.
|
protected |
Definition at line 167 of file vtkUndoStack.h.
|
protected |
Definition at line 168 of file vtkUndoStack.h.