vtkUndoStackInternal.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Kitware Inc.
2 // SPDX-License-Identifier: BSD-3-Clause
3 
4 #ifndef vtkUndoStackInternal_h
5 #define vtkUndoStackInternal_h
6 
7 #include "vtkSmartPointer.h" // for vtkSmartPointer
8 #include "vtkUndoSet.h" // for vtkUndoSet
9 
10 #include <string> // for std::string
11 #include <vector> // for std::vector
12 
14 {
15 public:
16  struct Element
17  {
18  std::string Label;
20  Element(const char* label, vtkUndoSet* set)
21  {
22  this->Label = label;
23  this->UndoSet = vtkSmartPointer<vtkUndoSet>::New();
24  for (int i = 0, nb = set->GetNumberOfElements(); i < nb; i++)
25  {
26  this->UndoSet->AddElement(set->GetElement(i));
27  }
28  }
29  };
30  typedef std::vector<Element> VectorOfElements;
31  VectorOfElements UndoStack;
32  VectorOfElements RedoStack;
33 };
34 
35 #endif
36 //****************************************************************************
37 // VTK-HeaderTest-Exclude: vtkUndoStackInternal.h
VectorOfElements RedoStack
std::vector< Element > VectorOfElements
vtkSmartPointer< vtkUndoSet > UndoSet
VectorOfElements UndoStack
static vtkSmartPointer< T > New()
Element(const char *label, vtkUndoSet *set)
Maintains a collection of vtkUndoElement that can be undone/redone in a single step.
Definition: vtkUndoSet.h:30
int AddElement(vtkUndoElement *elem)
Add an element to this set.