ACloudViewer  3.9.4
A Modern Library for 3D Data Processing
vtkUndoStack Class Reference

#include <vtkUndoStack.h>

Inheritance diagram for vtkUndoStack:
Collaboration diagram for vtkUndoStack:

Public Types

enum  EventIds { UndoSetRemovedEvent = 1989 , UndoSetClearedEvent = 1990 }
 

Public Member Functions

 vtkTypeMacro (vtkUndoStack, vtkObject)
 
void PrintSelf (ostream &os, vtkIndent indent) override
 
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 ()
 
int CanUndo ()
 
int CanRedo ()
 
virtual vtkUndoSetGetNextUndoSet ()
 
virtual vtkUndoSetGetNextRedoSet ()
 
virtual int Undo ()
 
virtual int Redo ()
 
void PopUndoStack ()
 
void PopRedoStack ()
 
void Clear ()
 
 vtkGetMacro (InUndo, bool)
 
 vtkGetMacro (InRedo, bool)
 
 vtkSetClampMacro (StackDepth, int, 1, 100)
 
 vtkGetMacro (StackDepth, int)
 

Static Public Member Functions

static vtkUndoStackNew ()
 

Protected Member Functions

 vtkUndoStack ()
 
 ~vtkUndoStack () override
 

Protected Attributes

int StackDepth
 

Detailed Description

Definition at line 16 of file vtkUndoStack.h.

Member Enumeration Documentation

◆ EventIds

Enumerator
UndoSetRemovedEvent 
UndoSetClearedEvent 

Definition at line 18 of file vtkUndoStack.h.

Constructor & Destructor Documentation

◆ vtkUndoStack()

vtkUndoStack::vtkUndoStack ( )
protected

Definition at line 23 of file vtkUndoStack.cxx.

References StackDepth.

◆ ~vtkUndoStack()

vtkUndoStack::~vtkUndoStack ( )
overrideprotected

Definition at line 32 of file vtkUndoStack.cxx.

Member Function Documentation

◆ CanRedo()

int vtkUndoStack::CanRedo ( )
inline

Returns if redo operation can be performed.

Definition at line 66 of file vtkUndoStack.h.

Referenced by GetNextRedoSet().

◆ CanUndo()

int vtkUndoStack::CanUndo ( )
inline

Returns if undo operation can be performed.

Definition at line 61 of file vtkUndoStack.h.

Referenced by GetNextUndoSet().

◆ Clear()

void vtkUndoStack::Clear ( )

Clears all the undo/redo elements from the stack.

Definition at line 38 of file vtkUndoStack.cxx.

References UndoSetClearedEvent.

◆ GetNextRedoSet()

vtkUndoSet * vtkUndoStack::GetNextRedoSet ( )
virtual

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

Definition at line 168 of file vtkUndoStack.cxx.

References CanRedo(), and NULL.

◆ GetNextUndoSet()

vtkUndoSet * vtkUndoStack::GetNextUndoSet ( )
virtual

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

Definition at line 158 of file vtkUndoStack.cxx.

References CanUndo(), and NULL.

◆ GetNumberOfRedoSets()

unsigned int vtkUndoStack::GetNumberOfRedoSets ( )

Returns the number of sets on the undo stack.

Definition at line 68 of file vtkUndoStack.cxx.

◆ GetNumberOfUndoSets()

unsigned int vtkUndoStack::GetNumberOfUndoSets ( )

Returns the number of sets on the undo stack.

Definition at line 62 of file vtkUndoStack.cxx.

◆ GetRedoSetLabel()

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.

Definition at line 85 of file vtkUndoStack.cxx.

References NULL, and position.

◆ GetUndoSetLabel()

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.

Definition at line 74 of file vtkUndoStack.cxx.

References NULL, and position.

◆ New()

static vtkUndoStack* vtkUndoStack::New ( )
static

◆ PopRedoStack()

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.

Definition at line 146 of file vtkUndoStack.cxx.

Referenced by Redo().

◆ PopUndoStack()

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.

Definition at line 134 of file vtkUndoStack.cxx.

Referenced by Undo().

◆ PrintSelf()

void vtkUndoStack::PrintSelf ( ostream &  os,
vtkIndent  indent 
)
override

Definition at line 178 of file vtkUndoStack.cxx.

References QtCompat::endl(), and StackDepth.

◆ Push()

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.

Definition at line 47 of file vtkUndoStack.cxx.

References UndoSetRemovedEvent.

◆ Redo()

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.

Definition at line 115 of file vtkUndoStack.cxx.

References PopRedoStack().

◆ Undo()

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.

Definition at line 96 of file vtkUndoStack.cxx.

References PopUndoStack().

◆ vtkGetMacro() [1/3]

vtkUndoStack::vtkGetMacro ( InRedo  ,
bool   
)

Returns if the stack is currently being redone.

◆ vtkGetMacro() [2/3]

vtkUndoStack::vtkGetMacro ( InUndo  ,
bool   
)

Returns if the stack is currently being undone.

◆ vtkGetMacro() [3/3]

vtkUndoStack::vtkGetMacro ( StackDepth  ,
int   
)

◆ vtkSetClampMacro()

vtkUndoStack::vtkSetClampMacro ( StackDepth  ,
int  ,
,
100   
)

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.

◆ vtkTypeMacro()

vtkUndoStack::vtkTypeMacro ( vtkUndoStack  ,
vtkObject   
)

Member Data Documentation

◆ StackDepth

int vtkUndoStack::StackDepth
protected

Definition at line 142 of file vtkUndoStack.h.

Referenced by PrintSelf(), and vtkUndoStack().


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