vtkSMUndoStack.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: ParaView
4  Module: vtkSMUndoStack.h
5 
6  Copyright (c) Kitware, Inc.
7  All rights reserved.
8  See Copyright.txt or http://www.paraview.org/HTML/Copyright.html for details.
9 
10  This software is distributed WITHOUT ANY WARRANTY; without even
11  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12  PURPOSE. See the above copyright notice for more information.
13 
14 =========================================================================*/
36 #ifndef vtkSMUndoStack_h
37 #define vtkSMUndoStack_h
38 
39 #include "vtkRemotingServerManagerModule.h" //needed for exports
40 #include "vtkUndoStack.h"
41 
42 class vtkSMUndoRedoStateLoader;
43 class vtkSMUndoStackObserver;
44 class vtkUndoSet;
45 class vtkCollection;
46 
48 {
49 public:
50  static vtkSMUndoStack* New();
51  vtkTypeMacro(vtkSMUndoStack, vtkUndoStack);
52  void PrintSelf(ostream& os, vtkIndent indent) override;
53 
58  void Push(const char* label, vtkUndoSet* changeSet) override;
59 
67  int Undo() override;
68 
76  int Redo() override;
77 
78  enum EventIds
79  {
80  PushUndoSetEvent = 1987,
81  ObjectCreationEvent = 1988
82 
83  };
84 
85 protected:
87  ~vtkSMUndoStack() override;
88 
89  // Helper method used to push all vtkSMRemoteObject to the collection of
90  // all the sessions that have been used across that undoset.
91  // (It is more than likely that only one session will be find but in case of
92  // collaboration, we might want to support a set of sessions.)
93  // This is useful when we execute the undoset to prevent automatic
94  // object deletion between 2 undo element calls when a proxy registration
95  // is supposed to happen.
96  void FillWithRemoteObjects(vtkUndoSet* undoSet, vtkCollection* collection);
97 
98 private:
99  vtkSMUndoStack(const vtkSMUndoStack&) = delete;
100  void operator=(const vtkSMUndoStack&) = delete;
101 
102  class vtkInternal;
103  vtkInternal* Internal;
104 };
105 
106 #endif
virtual int Undo()
Performs an Undo using the set on the top of the undo stack.
undo/redo stack.
Definition: vtkUndoStack.h:47
#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:42
static vtkUndoStack * New()
vtkUndoStackInternal * Internal
Definition: vtkUndoStack.h:179