ufe  3.2
Universal Front End is a DCC-agnostic component that will allow a DCC to browse and edit data in multiple data models
undoableCommand.h
Go to the documentation of this file.
1 #line 1 "S:/jenkins/workspace/ECP/ufe/ufe-full-python3.9-windows/ufe/include/undoableCommand.h"
2 #ifndef _undoableCommand
3 #define _undoableCommand
4 // ===========================================================================
5 // Copyright 2018 Autodesk, Inc. All rights reserved.
6 //
7 // Use of this software is subject to the terms of the Autodesk license
8 // agreement provided at the time of installation or download, or which
9 // otherwise accompanies this software in either electronic or hard copy form.
10 // ===========================================================================
11 
12 #include "common/ufeExport.h"
13 
14 #include "sceneItem.h"
15 
16 #include <memory>
17 #include <list>
18 #include <initializer_list>
19 
20 UFE_NS_DEF {
21 
23 
33 {
34 public:
35  typedef std::shared_ptr<UndoableCommand> Ptr;
36 
38  virtual ~UndoableCommand();
39 
42  virtual void execute();
43 
44  virtual void undo() = 0;
45  virtual void redo() = 0;
46 
47 protected:
51  UndoableCommand(const UndoableCommand&) = delete;
52 };
53 
55 
65 {
66 public:
67  typedef std::list<Ptr> CmdList;
68 
71  static std::shared_ptr<CompositeUndoableCommand> create(
72  std::initializer_list<Ptr> undoableCommands
73  );
74 
78  CompositeUndoableCommand(std::initializer_list<Ptr> undoableCommands);
79  CompositeUndoableCommand(const std::list<Ptr>& undoableCommands);
81  ~CompositeUndoableCommand() override;
83 
85  void execute() override;
86 
88  void undo() override;
89 
91  void redo() override;
92 
94  void append(const Ptr& cmd);
95 
97  const CmdList& cmdsList() const;
98 
99 private:
102 
104 };
105 
107 
113 {
114 public:
115  typedef std::shared_ptr<InsertChildCommand> Ptr;
116 
118  InsertChildCommand() = default;
119 
121  virtual ~InsertChildCommand() = default;
122 
124  virtual SceneItem::Ptr insertedChild() const = 0;
125 };
126 
127 }
128 
129 #endif /* _undoableCommand */
virtual void redo()=0
std::shared_ptr< UndoableCommand > Ptr
Definition of macros for symbol visibility.
Composite undoable command.
#define UFE_NS_DEF
Definition: ufe.h:35
Abstract base class for undoable commands.
std::shared_ptr< SceneItem > Ptr
Definition: sceneItem.h:40
virtual void execute()
Command to change the parent of a scene item.
virtual void undo()=0
#define UFE_SDK_DECL
Definition: ufeExport.h:36
std::shared_ptr< InsertChildCommand > Ptr