/usr/include/paraview/vtkUndoElement.h is in paraview-dev 5.0.1+dfsg1-4.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 | /*=========================================================================
Program: ParaView
Module: vtkUndoElement.h
Copyright (c) Kitware, Inc.
All rights reserved.
See Copyright.txt or http://www.paraview.org/HTML/Copyright.html for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
// .NAME vtkUndoElement - unit undo-redo-able operation.
// .SECTION Description
// This is an abstract class that defines the API for an undo-redo-able operation.
// One or more vtkUndoElement objects can define
// a single undo-redo step. Every concrete implementation of this class
// must know how to undo as well as redo the operation, and save and load the
// state as an XML.
//
// vtkUndoElement, vtkUndoSet and vtkUndoStack form the undo/redo framework core.
// .SECTION See Also
// vtkUndoStack vtkUndoSet
#ifndef vtkUndoElement_h
#define vtkUndoElement_h
#include "vtkObject.h"
#include "vtkPVVTKExtensionsCoreModule.h" // needed for export macro
class vtkCollection;
class VTKPVVTKEXTENSIONSCORE_EXPORT vtkUndoElement : public vtkObject
{
public:
vtkTypeMacro(vtkUndoElement, vtkObject);
void PrintSelf(ostream& os, vtkIndent indent);
// Description:
// Undo the operation encapsulated by this element.
// \return the status of the operation, 1 on success, 0 otherwise.
virtual int Undo() = 0;
// Description:
// Redo the operation encaspsulated by this element.
// \return the status of the operation, 1 on success, 0 otherwise.
virtual int Redo() = 0;
// Description:
// Returns if this undo element can be merged with other
// undo elements.
// When an undo element is added to a vtkUndoSet unsing AddElement,
// an attempt is made to \c "merge" the element with the
// most recently added undo element, if any, if both the undo elements
// are mergeable.
vtkGetMacro(Mergeable, bool);
// Description:
// Called on the older element in the UndoSet to merge with the
// element being added if both the elements are \c mergeable.
// Returns if the merge was successful.
// Default implementation doesn't do anything.
virtual bool Merge(vtkUndoElement* vtkNotUsed(new_element))
{
return false;
}
// Set the working context if run inside a UndoSet context, so object
// that are cross referenced can leave long enought to be associated
// to another object. Otherwise the undo of a Delete will create the object
// again but as no-one is holding a reference to that newly created object
// it will be automatically deleted. Therefore, we provide a collection
// that will hold a reference during an undoset so the object has a chance
// to be attached to the ProxyManager or any other object.
virtual void SetUndoSetWorkingContext(vtkCollection *workCTX)
{
this->UndoSetWorkingContext = workCTX;
}
//BTX
protected:
vtkUndoElement();
~vtkUndoElement();
// Description:
// Subclasses must set this flag to enable merging of consecutive elements
// in an UndoSet.
bool Mergeable;
vtkSetMacro(Mergeable, bool);
vtkCollection *UndoSetWorkingContext;
private:
vtkUndoElement(const vtkUndoElement&); // Not implemented.
void operator=(const vtkUndoElement&); // Not implemented.
//ETX
};
#endif
|