Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | List of all members
vtkSMUndoStack Class Reference

This is the undo/redo stack for the Server Manager. More...

#include <vtkSMUndoStack.h>

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

Public Types

enum  EventIds { PushUndoSetEvent = 1987, ObjectCreationEvent = 1988 }
 
typedef vtkUndoStack Superclass
 
- Public Types inherited from vtkUndoStack
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
 
void Push (const char *label, vtkUndoSet *changeSet) override
 Push an undo set on the Undo stack. More...
 
int Undo () override
 Performs an Undo using the set on the top of the undo stack. More...
 
int Redo () override
 Performs a Redo using the set on the top of the redo stack. More...
 
- Public Member Functions inherited from vtkUndoStack
void PrintSelf (ostream &os, vtkIndent indent) override
 
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 vtkUndoSetGetNextUndoSet ()
 Get the UndoSet on the top of the Undo stack, if any. More...
 
virtual vtkUndoSetGetNextRedoSet ()
 Get the UndoSet on the top of the Redo stack, if any. 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...
 
virtual void SetStackDepth (int)
 Get set the maximum stack depth. More...
 
virtual int GetStackDepth ()
 Get set the maximum stack depth. 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)
 
vtkCommandGetCommand (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)
 
vtkCommandGetCommand (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 vtkSMUndoStackNew ()
 
static int IsTypeOf (const char *type)
 
static vtkSMUndoStackSafeDownCast (vtkObject *o)
 
- Static Public Member Functions inherited from vtkUndoStack
static vtkUndoStackNew ()
 
static int IsTypeOf (const char *type)
 
static vtkUndoStackSafeDownCast (vtkObject *o)
 
- Static Public Member Functions inherited from vtkObject
static vtkObjectNew ()
 
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 vtkObjectBaseNew ()
 
static vtkObjectBaseNew ()
 

Protected Member Functions

 vtkSMUndoStack ()
 
 ~vtkSMUndoStack () override
 
void FillWithRemoteObjects (vtkUndoSet *undoSet, vtkCollection *collection)
 
- Protected Member Functions inherited from vtkUndoStack
 vtkUndoStack ()
 Get set the maximum stack depth. More...
 
 ~vtkUndoStack () override
 Get set the maximum stack depth. More...
 
- 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 &)
 

Additional Inherited Members

- Protected Attributes inherited from vtkUndoStack
vtkUndoStackInternalInternal
 
int StackDepth
 
- Protected Attributes inherited from vtkObject
bool Debug
 
vtkTimeStamp MTime
 
vtkSubjectHelper * SubjectHelper
 
- Protected Attributes inherited from vtkObjectBase
vtkAtomicInt32 ReferenceCount
 
vtkWeakPointerBase ** WeakPointers
 

Detailed Description

This is the undo/redo stack for the Server Manager.

This provides a unified face for undo/redo irrespective of number of connections, their type etc etc.

On every undo/redo, it fetches the XML state change from the server. vtkSMUndoRedoStateLoader is used to generate a vtkUndoSet object from the XML. GUI can subclass vtkSMUndoRedoStateLoader to handle GUI specific XML elements. The loader instance must be set before performing the undo, otherwise vtkSMUndoRedoStateLoader is used.

This class also provides API to push any vtkUndoSet instance on to a server. GUI can use this to push its own changes that is undoable across connections.

See also
vtkSMUndoStackBuilder

Definition at line 35 of file vtkSMUndoStack.h.

Member Typedef Documentation

◆ Superclass

Definition at line 39 of file vtkSMUndoStack.h.

Member Enumeration Documentation

◆ EventIds

Enumerator
PushUndoSetEvent 
ObjectCreationEvent 

Definition at line 66 of file vtkSMUndoStack.h.

Constructor & Destructor Documentation

◆ vtkSMUndoStack()

vtkSMUndoStack::vtkSMUndoStack ( )
protected

◆ ~vtkSMUndoStack()

vtkSMUndoStack::~vtkSMUndoStack ( )
overrideprotected

Member Function Documentation

◆ New()

static vtkSMUndoStack* vtkSMUndoStack::New ( )
static

◆ GetClassName()

virtual const char* vtkSMUndoStack::GetClassName ( )
virtual

Reimplemented from vtkUndoStack.

◆ IsTypeOf()

static int vtkSMUndoStack::IsTypeOf ( const char *  type)
static

◆ IsA()

virtual int vtkSMUndoStack::IsA ( const char *  type)
virtual

Reimplemented from vtkUndoStack.

◆ SafeDownCast()

static vtkSMUndoStack* vtkSMUndoStack::SafeDownCast ( vtkObject o)
static

◆ PrintSelf()

void vtkSMUndoStack::PrintSelf ( ostream &  os,
vtkIndent  indent 
)
overridevirtual

Reimplemented from vtkObject.

◆ Push()

void vtkSMUndoStack::Push ( const char *  label,
vtkUndoSet changeSet 
)
overridevirtual

Push an undo set on the Undo stack.

This will clear any sets in the Redo stack.

Reimplemented from vtkUndoStack.

◆ Undo()

int vtkSMUndoStack::Undo ( )
overridevirtual

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 from vtkUndoStack.

◆ Redo()

int vtkSMUndoStack::Redo ( )
overridevirtual

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 from vtkUndoStack.

◆ FillWithRemoteObjects()

void vtkSMUndoStack::FillWithRemoteObjects ( vtkUndoSet undoSet,
vtkCollection collection 
)
protected

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