ufe 5.5
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.11-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
18
19class Selection;
20
22
28{
29public:
30
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
49private:
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{
66public:
67
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
86private:
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{
101public:
102
106
109
111 void undo() override;
113 void redo() override;
114
115private:
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{
130public:
131
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
150private:
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 */
Identify an object or 3D path in the scene.
Definition: path.h:38
std::shared_ptr< SceneItem > Ptr
Definition: sceneItem.h:44
Append an item to the argument selection.
void redo() override
Redo the append.
void undo() override
Undo the append (i.e. remove).
const GlobalSelection::Ptr fSn
SelectionAppendItem(const GlobalSelection::Ptr &sn, const SceneItem::Ptr &item)
Constructor.
static Ptr createAndExecute(const GlobalSelection::Ptr &sn, const SceneItem::Ptr &item)
Clear the argument selection.
const std::list< Path > fPaths
void undo() override
Undo the clear.
static Ptr createAndExecute(const GlobalSelection::Ptr &sn)
SelectionClear(const GlobalSelection::Ptr &sn)
Constructor.
void redo() override
Redo the clear.
const GlobalSelection::Ptr fSn
Selection list for objects in the scene.
Definition: selection.h:28
Remove an item from the argument selection.
void undo() override
Undo the remove (i.e. append).
static Ptr createAndExecute(const GlobalSelection::Ptr &sn, const SceneItem::Ptr &item)
SelectionRemoveItem(const GlobalSelection::Ptr &sn, const SceneItem::Ptr &item)
Constructor.
const GlobalSelection::Ptr fSn
void redo() override
Redo the remove.
Replace the argument selection.
void undo() override
Undo the replace.
const GlobalSelection::Ptr fSn
static Ptr createAndExecute(const GlobalSelection::Ptr &sn, const Selection &replacementSn)
const std::list< Path > fSnPaths
const std::list< Path > fReplacementSnPaths
void redo() override
Redo the replace.
SelectionReplaceWith(const GlobalSelection::Ptr &sn, const Selection &replacementSn)
Constructor.
Abstract base class for undoable commands.
std::shared_ptr< UndoableCommand > Ptr
std::shared_ptr< ObservableSelection > Ptr
#define UFE_NS_DEF
Definition: ufe.h:35
#define UFE_SDK_DECL
Definition: ufeExport.h:36