vtkSMUndoStack.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Kitware Inc.
2 // SPDX-License-Identifier: BSD-3-Clause
24 #ifndef vtkSMUndoStack_h
25 #define vtkSMUndoStack_h
26 
27 #include "vtkRemotingServerManagerModule.h" //needed for exports
28 #include "vtkUndoStack.h"
29 
30 class vtkSMUndoRedoStateLoader;
31 class vtkSMUndoStackObserver;
32 class vtkUndoSet;
33 class vtkCollection;
34 
36 {
37 public:
38  static vtkSMUndoStack* New();
39  vtkTypeMacro(vtkSMUndoStack, vtkUndoStack);
40  void PrintSelf(ostream& os, vtkIndent indent) override;
41 
46  void Push(const char* label, vtkUndoSet* changeSet) override;
47 
55  int Undo() override;
56 
64  int Redo() override;
65 
66  enum EventIds
67  {
68  PushUndoSetEvent = 1987,
69  ObjectCreationEvent = 1988
70 
71  };
72 
73 protected:
75  ~vtkSMUndoStack() override;
76 
77  // Helper method used to push all vtkSMRemoteObject to the collection of
78  // all the sessions that have been used across that undoset.
79  // (It is more than likely that only one session will be find but in case of
80  // collaboration, we might want to support a set of sessions.)
81  // This is useful when we execute the undoset to prevent automatic
82  // object deletion between 2 undo element calls when a proxy registration
83  // is supposed to happen.
84  void FillWithRemoteObjects(vtkUndoSet* undoSet, vtkCollection* collection);
85 
86 private:
87  vtkSMUndoStack(const vtkSMUndoStack&) = delete;
88  void operator=(const vtkSMUndoStack&) = delete;
89 
90  class vtkInternal;
91  vtkInternal* Internal;
92 };
93 
94 #endif
virtual int Undo()
Performs an Undo using the set on the top of the undo stack.
undo/redo stack.
Definition: vtkUndoStack.h:35
#define VTKREMOTINGSERVERMANAGER_EXPORT
void PrintSelf(ostream &os, vtkIndent indent) override
This is the undo/redo stack for the Server Manager.
virtual int Redo()
Performs a Redo using the set on the top of the redo stack.
virtual void Push(const char *label, vtkUndoSet *changeSet)
Push an undo set on the Undo stack.
Maintains a collection of vtkUndoElement that can be undone/redone in a single step.
Definition: vtkUndoSet.h:30
static vtkUndoStack * New()
vtkUndoStackInternal * Internal
Definition: vtkUndoStack.h:167