ufe  4.2
Universal Front End is a DCC-agnostic component that will allow a DCC to browse and edit data in multiple data models
selectionUndoableCommands.h
Go to the documentation of this file.
1 #line 1 "S:/jenkins/workspace/ECP/ufe/ufe-full-python3.10-windows/ufe/include/selectionUndoableCommands.h"
2 #ifndef _selectionUndoableCommands
3 #define _selectionUndoableCommands
4 // ===========================================================================
5 // Copyright 2020 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 "undoableCommand.h"
13 #include "globalSelection.h"
14 #include "sceneItem.h"
15 #include "path.h"
16 
17 UFE_NS_DEF {
18 
19 class Selection;
20 
22 
28 {
29 public:
30 
33  static Ptr createAndExecute(
34  const GlobalSelection::Ptr& sn,
35  const SceneItem::Ptr& item
36  );
37 
40  const GlobalSelection::Ptr& sn,
41  const SceneItem::Ptr& item
42  );
43 
45  void undo() override;
47  void redo() override;
48 
49 private:
50 
52  // Store path instead of scene item.
53  // A valid scene item at command creation may be invalidated by a sequence
54  // of undos, followed by corresponding redos.
55  const Path fPath;
56 };
57 
59 
65 {
66 public:
67 
70  static Ptr createAndExecute(
71  const GlobalSelection::Ptr& sn,
72  const SceneItem::Ptr& item
73  );
74 
77  const GlobalSelection::Ptr& sn,
78  const SceneItem::Ptr& item
79  );
80 
82  void undo() override;
84  void redo() override;
85 
86 private:
87 
89  // Store path instead of scene item.
90  // A valid scene item at command creation may be invalidated by a sequence
91  // of undos, followed by corresponding redos.
92  const Path fPath;
93 };
94 
96 
100 {
101 public:
102 
105  static Ptr createAndExecute(const GlobalSelection::Ptr& sn);
106 
109 
111  void undo() override;
113  void redo() override;
114 
115 private:
116 
118  // Store paths instead of scene item.
119  // A valid scene item at command creation may be invalidated by a sequence
120  // of undos, followed by corresponding redos.
121  const std::list<Path> fPaths;
122 };
123 
125 
129 {
130 public:
131 
134  static Ptr createAndExecute(
135  const GlobalSelection::Ptr& sn,
136  const Selection& replacementSn
137  );
138 
141  const GlobalSelection::Ptr& sn,
142  const Selection& replacementSn
143  );
144 
146  void undo() override;
148  void redo() override;
149 
150 private:
151 
153  // Store paths instead of scene item.
154  // A valid scene item at command creation may be invalidated by a sequence
155  // of undos, followed by corresponding redos.
156  const std::list<Path> fSnPaths;
157  const std::list<Path> fReplacementSnPaths;
158 };
159 
160 }
161 
162 #endif /* _selectionUndoableCommands */
virtual void redo()=0
std::shared_ptr< UndoableCommand > Ptr
const GlobalSelection::Ptr fSn
const std::list< Path > fReplacementSnPaths
std::shared_ptr< ObservableSelection > Ptr
Clear the argument selection.
Append an item to the argument selection.
Identify an object or 3D path in the scene.
Definition: path.h:37
const GlobalSelection::Ptr fSn
Remove an item from the argument selection.
Selection list for objects in the scene.
Definition: selection.h:27
#define UFE_NS_DEF
Definition: ufe.h:35
Abstract base class for undoable commands.
std::shared_ptr< SceneItem > Ptr
Definition: sceneItem.h:40
const std::list< Path > fPaths
const GlobalSelection::Ptr fSn
const GlobalSelection::Ptr fSn
virtual void undo()=0
const std::list< Path > fSnPaths
Replace the argument selection.
#define UFE_SDK_DECL
Definition: ufeExport.h:36