vtkUndoStackInternal.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: ParaView
4  Module: vtkUndoStackInternal.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 =========================================================================*/
15 #include "vtkSmartPointer.h"
16 #include "vtkUndoSet.h"
17 
18 #include <string>
19 #include <vector>
20 
22 {
23 public:
24  struct Element
25  {
26  std::string Label;
28  Element(const char* label, vtkUndoSet* set)
29  {
30  this->Label = label;
31  this->UndoSet = vtkSmartPointer<vtkUndoSet>::New();
32  for (int i = 0, nb = set->GetNumberOfElements(); i < nb; i++)
33  {
34  this->UndoSet->AddElement(set->GetElement(i));
35  }
36  }
37  };
38  typedef std::vector<Element> VectorOfElements;
39  VectorOfElements UndoStack;
40  VectorOfElements RedoStack;
41 };
42 //****************************************************************************
43 // 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:42
int AddElement(vtkUndoElement *elem)
Add an element to this set.