ufe 7.0
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 "D:/Jenkins/workspace/EMS/ECG/ufe/full/ufe-full-python3.13-windows/ufe/include/selectionUndoableCommands.h"
2#ifndef UFE_SELECTIONUNDOABLECOMMANDS_H
3#define UFE_SELECTIONUNDOABLECOMMANDS_H
4
5// ===========================================================================
6// Copyright 2025 Autodesk, Inc. All rights reserved.
7//
8// The use of this software is subject to the Autodesk Terms of Use or other
9// license agreement provided at the time of installation or download, or
10// which otherwise accompanies this software.
11// ===========================================================================
12
13#include "undoableCommand.h"
14#include "globalSelection.h"
15#include "sceneItem.h"
16#include "path.h"
17
19
20class Selection;
21
23
29{
30public:
31
35 const GlobalSelection::Ptr& sn,
36 const SceneItem::Ptr& item
37 );
38
41 const GlobalSelection::Ptr& sn,
42 const SceneItem::Ptr& item
43 );
44
45 std::string commandString() const override { return "AppendToSelection"; }
46
48 void undo() override;
50 void redo() override;
51
52private:
53
55 // Store path instead of scene item.
56 // A valid scene item at command creation may be invalidated by a sequence
57 // of undos, followed by corresponding redos.
58 const Path fPath;
59};
60
62
68{
69public:
70
74 const GlobalSelection::Ptr& sn,
75 const SceneItem::Ptr& item
76 );
77
80 const GlobalSelection::Ptr& sn,
81 const SceneItem::Ptr& item
82 );
83
84 std::string commandString() const override { return "RemoveFromSelection"; }
85
87 void undo() override;
89 void redo() override;
90
91private:
92
94 // Store path instead of scene item.
95 // A valid scene item at command creation may be invalidated by a sequence
96 // of undos, followed by corresponding redos.
97 const Path fPath;
98};
99
101
105{
106public:
107
111
114
115 std::string commandString() const override { return "ClearSelection"; }
116
118 void undo() override;
120 void redo() override;
121
122private:
123
125 // Store paths instead of scene item.
126 // A valid scene item at command creation may be invalidated by a sequence
127 // of undos, followed by corresponding redos.
128 const std::list<Path> fPaths;
129};
130
132
136{
137public:
138
142 const GlobalSelection::Ptr& sn,
143 const Selection& replacementSn
144 );
145
148 const GlobalSelection::Ptr& sn,
149 const Selection& replacementSn
150 );
151
152 std::string commandString() const override { return "ReplaceSelection"; }
153
155 void undo() override;
157 void redo() override;
158
159private:
160
162 // Store paths instead of scene item.
163 // A valid scene item at command creation may be invalidated by a sequence
164 // of undos, followed by corresponding redos.
165 const std::list<Path> fSnPaths;
166 const std::list<Path> fReplacementSnPaths;
167};
168
169}
170
171#endif /* UFE_SELECTIONUNDOABLECOMMANDS_H */
Identify an object or 3D path in the scene.
Definition: path.h:40
std::shared_ptr< SceneItem > Ptr
Definition: sceneItem.h:45
Append an item to the argument selection.
void redo() override
Redo the append.
void undo() override
Undo the append (i.e. remove).
std::string commandString() const override
Get a user friendly string representation of the command.
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
std::string commandString() const override
Get a user friendly string representation of the command.
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:29
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)
std::string commandString() const override
Get a user friendly string representation of the command.
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
std::string commandString() const override
Get a user friendly string representation of the command.
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
std::string string(const Path &path)
#define UFE_NS_DEF
Definition: ufe.h:36
#define UFE_SDK_DECL
Definition: ufeExport.h:35