ACloudViewer  3.9.4
A Modern Library for 3D Data Processing
vtkUndoStack.h
Go to the documentation of this file.
1 // ----------------------------------------------------------------------------
2 // - CloudViewer: www.cloudViewer.org -
3 // ----------------------------------------------------------------------------
4 // Copyright (c) 2018-2024 www.cloudViewer.org
5 // SPDX-License-Identifier: MIT
6 // ----------------------------------------------------------------------------
7 
8 #pragma once
9 
10 #include "qPCL.h" // needed for export macro
11 #include "vtkObject.h"
12 
13 class vtkUndoStackInternal;
14 class vtkUndoSet;
15 
16 class QPCL_ENGINE_LIB_API vtkUndoStack : public vtkObject {
17 public:
18  enum EventIds { UndoSetRemovedEvent = 1989, UndoSetClearedEvent = 1990 };
19 
20  static vtkUndoStack* New();
22  void PrintSelf(ostream& os, vtkIndent indent) override;
23 
28  virtual void Push(const char* label, vtkUndoSet* changeSet);
29 
37  const char* GetUndoSetLabel(unsigned int position);
38 
46  const char* GetRedoSetLabel(unsigned int position);
47 
51  unsigned int GetNumberOfUndoSets();
52 
56  unsigned int GetNumberOfRedoSets();
57 
61  int CanUndo() { return (this->GetNumberOfUndoSets() > 0); }
62 
66  int CanRedo() { return (this->GetNumberOfRedoSets() > 0); }
67 
71  virtual vtkUndoSet* GetNextUndoSet();
72 
76  virtual vtkUndoSet* GetNextRedoSet();
77 
84  virtual int Undo();
85 
92  virtual int Redo();
93 
99  void PopUndoStack();
100 
106  void PopRedoStack();
107 
111  void Clear();
112 
114 
117  vtkGetMacro(InUndo, bool);
119 
121 
124  vtkGetMacro(InRedo, bool);
126 
128 
133  vtkSetClampMacro(StackDepth, int, 1, 100);
134  vtkGetMacro(StackDepth, int);
135 
136 protected:
137  vtkUndoStack();
138  ~vtkUndoStack() override;
140 
141  vtkUndoStackInternal* Internal;
143 
144 private:
145  vtkUndoStack(const vtkUndoStack&) = delete;
146  void operator=(const vtkUndoStack&) = delete;
147 
148  bool InUndo;
149  bool InRedo;
150 };
math::float3 position
vtkSetClampMacro(StackDepth, int, 1, 100)
vtkGetMacro(InUndo, bool)
static vtkUndoStack * New()
vtkGetMacro(InRedo, bool)
vtkGetMacro(StackDepth, int)
vtkTypeMacro(vtkUndoStack, vtkObject)
#define QPCL_ENGINE_LIB_API
Definition: qPCL.h:15