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

#include <vtkUndoStack.h>

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

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 vtkUndoSet * GetNextUndoSet ()
 
virtual vtkUndoSet * GetNextRedoSet ()
 
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 vtkUndoStack * New ()
 

Protected Member Functions

 vtkUndoStack ()
 
 ~vtkUndoStack () override
 

Protected Attributes

int StackDepth
 

Member Enumeration Documentation

◆ EventIds

Enumerator
UndoSetRemovedEvent 
UndoSetClearedEvent 

Constructor & Destructor Documentation

◆ vtkUndoStack()

vtkUndoStack::vtkUndoStack ( )
protected

References StackDepth.

◆ ~vtkUndoStack()

vtkUndoStack::~vtkUndoStack ( )
overrideprotected

Member Function Documentation

◆ CanRedo()

int vtkUndoStack::CanRedo ( )
inline

Returns if redo operation can be performed.

Referenced by GetNextRedoSet().

◆ CanUndo()

int vtkUndoStack::CanUndo ( )
inline

Returns if undo operation can be performed.

Referenced by GetNextUndoSet().

◆ Clear()

void vtkUndoStack::Clear ( )

Clears all the undo/redo elements from the stack.

References UndoSetClearedEvent.

◆ GetNextRedoSet()

vtkUndoSet * vtkUndoStack::GetNextRedoSet ( )
virtual

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

References CanRedo(), and NULL.

◆ GetNextUndoSet()

vtkUndoSet * vtkUndoStack::GetNextUndoSet ( )
virtual

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

References CanUndo(), and NULL.

◆ GetNumberOfRedoSets()

unsigned int vtkUndoStack::GetNumberOfRedoSets ( )

Returns the number of sets on the undo stack.

◆ GetNumberOfUndoSets()

unsigned int vtkUndoStack::GetNumberOfUndoSets ( )

Returns the number of sets on the undo stack.

◆ 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.

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.

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.

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.

Referenced by Undo().

◆ PrintSelf()

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

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.

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.

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.

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  ,
1  ,
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

Referenced by PrintSelf(), and vtkUndoStack().


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