ParaView
Public Types | Public Member Functions | Static Public Member Functions | Protected Attributes
vtkUndoStack Class Reference

undo/redo stack. More...

#include <vtkUndoStack.h>

Inheritance diagram for vtkUndoStack:
Inheritance graph
[legend]
Collaboration diagram for vtkUndoStack:
Collaboration graph
[legend]

List of all members.

Public Types

enum  EventIds { UndoSetRemovedEvent = 1989, UndoSetClearedEvent = 1990 }

Public Member Functions

virtual const char * GetClassName ()
virtual int IsA (const char *type)
void PrintSelf (ostream &os, vtkIndent indent)
virtual void Push (const char *label, vtkUndoSet *changeSet)
const char * GetUndoSetLabel (unsigned int position)
const char * GetRedoSetLabel (unsigned int position)
unsigned int GetNumberOfUndoSets ()
unsigned int GetNumberOfRedoSets ()
virtual vtkUndoSetGetNextUndoSet ()
virtual vtkUndoSetGetNextRedoSet ()
virtual int Undo ()
virtual int Redo ()
void PopUndoStack ()
void PopRedoStack ()
void Clear ()
int CanUndo ()
int CanRedo ()
virtual bool GetInUndo ()
virtual bool GetInRedo ()

Static Public Member Functions

static vtkUndoStackNew ()
static int IsTypeOf (const char *type)
static vtkUndoStackSafeDownCast (vtkObject *o)

Protected Attributes

vtkUndoStackInternalInternal
int StackDepth
virtual void SetStackDepth (int)
virtual int GetStackDepth ()
 vtkUndoStack ()
 ~vtkUndoStack ()

Detailed Description

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.

See also:
vtkUndoSet vtkUndoElement

Definition at line 45 of file vtkUndoStack.h.


Member Enumeration Documentation

Enumerator:
UndoSetRemovedEvent 
UndoSetClearedEvent 

Reimplemented in vtkSMUndoStack.

Definition at line 49 of file vtkUndoStack.h.


Constructor & Destructor Documentation

vtkUndoStack::vtkUndoStack ( ) [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.

vtkUndoStack::~vtkUndoStack ( ) [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.


Member Function Documentation

static vtkUndoStack* vtkUndoStack::New ( ) [static]

Reimplemented from vtkObject.

Reimplemented in vtkSMUndoStack.

virtual const char* vtkUndoStack::GetClassName ( ) [virtual]

Reimplemented from vtkObject.

Reimplemented in vtkSMUndoStack.

static int vtkUndoStack::IsTypeOf ( const char *  type) [static]

Reimplemented from vtkObject.

Reimplemented in vtkSMUndoStack.

virtual int vtkUndoStack::IsA ( const char *  type) [virtual]

Reimplemented from vtkObject.

Reimplemented in vtkSMUndoStack.

static vtkUndoStack* vtkUndoStack::SafeDownCast ( vtkObject o) [static]

Reimplemented from vtkObject.

Reimplemented in vtkSMUndoStack.

void vtkUndoStack::PrintSelf ( ostream &  os,
vtkIndent  indent 
) [virtual]

Reimplemented from vtkObject.

Reimplemented in vtkSMUndoStack.

virtual void vtkUndoStack::Push ( const char *  label,
vtkUndoSet changeSet 
) [virtual]

Push an undo set on the Undo stack. This will clear any sets in the Redo stack.

Reimplemented in vtkSMUndoStack.

const char* vtkUndoStack::GetUndoSetLabel ( unsigned int  position)

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:
NULL is no set exists at the given index, otherwise the label for the change set.
const char* vtkUndoStack::GetRedoSetLabel ( unsigned int  position)

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.

Returns:
NULL is no set exists at the given index, otherwise the label for the change set.
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.

int vtkUndoStack::CanUndo ( ) [inline]

Returns if undo operation can be performed.

Definition at line 85 of file vtkUndoStack.h.

int vtkUndoStack::CanRedo ( ) [inline]

Returns if redo operation can be performed.

Definition at line 93 of file vtkUndoStack.h.

virtual vtkUndoSet* vtkUndoStack::GetNextUndoSet ( ) [virtual]

Get the UndoSet on the top of the Undo stack, if any.

virtual vtkUndoSet* vtkUndoStack::GetNextRedoSet ( ) [virtual]

Get the UndoSet on the top of the Redo stack, if any.

virtual int vtkUndoStack::Undo ( ) [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.

Returns:
the status of the operation.

Reimplemented in vtkSMUndoStack.

virtual int vtkUndoStack::Redo ( ) [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.

Returns:
the status of the operation.

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 bool vtkUndoStack::GetInUndo ( ) [virtual]

Returns if the stack is currently being undone.

virtual bool vtkUndoStack::GetInRedo ( ) [virtual]

Returns if the stack is currently being redone.

virtual void vtkUndoStack::SetStackDepth ( int  ) [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 int vtkUndoStack::GetStackDepth ( ) [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.


Member Data Documentation

Definition at line 153 of file vtkUndoStack.h.

Definition at line 154 of file vtkUndoStack.h.


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