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
selection.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/selection.h"
2#ifndef UFE_SELECTION_H
3#define UFE_SELECTION_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 "sceneItemList.h"
14#include "sceneItem.h"
15#include "selectionTrieFwd.h"
16
18
20
29{
30public:
31
32 typedef SceneItemList::const_iterator const_iterator;
33 typedef SceneItemList::const_reverse_iterator const_reverse_iterator;
34
38 Selection(std::initializer_list<SceneItem::Ptr> items);
39 Selection(const SceneItemList& items);
43
45 virtual ~Selection();
46
49
52
55
57 std::size_t size() const;
58
60 bool empty() const;
61
70 bool append(const SceneItem::Ptr& item);
71
80 bool remove(const SceneItem::Ptr& item);
81
92 bool insert(const SceneItem::Ptr& position, const SceneItem::Ptr& item);
93
98 void clear();
99
106 void replaceWith(const Selection& selection);
107
111 bool contains(const Path& path) const;
112
121 bool containsDescendant(const Path& path) const;
122
131
140 bool containsAncestor(const Path& path) const;
141
150
158
168
171 const SceneItem::Ptr& front() const;
172 const SceneItem::Ptr& back() const;
174
186protected:
187
194 bool doAppend(const SceneItem::Ptr& item);
195 bool doRemove(const SceneItem::Ptr& item);
196 bool doInsert(const SceneItem::Ptr& position, const SceneItem::Ptr& item);
200
202 // Hook methods for append, remove, insert, clear, and replaceWith.
203 // postAppend(), postRemove(), and postInsert() are only called if
204 // doAppend(), doRemove(), and doInsert() return true, respectively.
205 // Implementations in this class do nothing.
206 virtual void postAppend(const SceneItem::Ptr& item);
207 virtual void postRemove(const SceneItem::Ptr& item);
208 virtual void postInsert(
209 const SceneItem::Ptr& position, const SceneItem::Ptr& item
210 );
211 virtual void postClear(const Selection& previous);
212 virtual void postReplaceWith(const Selection& previous);
214
218 const SelectionTrie& trie() const;
220
224 inline SceneItemList& list() { return fList; }
225
226private:
228 Selection(SceneItemList&& list, SelectionTrie&& selectionTrie);
229
231
234 void* fTrieStorage[2];
235};
236
237}
238
239#endif /* UFE_SELECTION_H */
Identify an object or 3D path in the scene.
Definition: path.h:40
std::shared_ptr< SceneItem > Ptr
Definition: sceneItem.h:45
Selection list for objects in the scene.
Definition: selection.h:29
Selection & operator=(Selection &&rhs)
Move assignment. postClear is first called on rhs, then postReplaceWith on this.
SelectionTrie & trie()
bool containsDescendant(const Path &path) const
const SceneItem::Ptr & back() const
const_iterator cbegin() const
bool contains(const Path &path) const
SceneItemList::const_iterator const_iterator
Definition: selection.h:32
virtual void postReplaceWith(const Selection &previous)
Selection doClear()
Selection(const Selection &)
const_iterator end() const
std::size_t size() const
bool doInsert(const SceneItem::Ptr &position, const SceneItem::Ptr &item)
virtual void postClear(const Selection &previous)
bool containsDescendantInclusive(const Path &path) const
const_reverse_iterator crend() const
Selection(SceneItemList &&list, SelectionTrie &&selectionTrie)
Constructor used internally to build previous selection list.
SceneItem::Ptr closestCommonAncestor() const
bool doAppend(const SceneItem::Ptr &item)
SceneItemList::const_reverse_iterator const_reverse_iterator
Definition: selection.h:33
bool insert(const SceneItem::Ptr &position, const SceneItem::Ptr &item)
SceneItemList fList
Definition: selection.h:230
const_reverse_iterator rend() const
bool doRemove(const SceneItem::Ptr &item)
void replaceWith(const Selection &selection)
virtual void postAppend(const SceneItem::Ptr &item)
bool containsAncestorInclusive(const Path &path) const
Selection(const SceneItemList &items)
Selection(const SceneItem::Ptr &item)
Selection & operator=(const Selection &)
Syntactic convenience that calls replaceWith.
Selection(Selection &&)
Move construction. postClear is called on the argument.
bool remove(const SceneItem::Ptr &item)
SceneItem::Ptr next(const SceneItem::Ptr &item) const
const SelectionTrie & trie() const
const SceneItem::Ptr & front() const
bool containsAncestor(const Path &path) const
virtual void postInsert(const SceneItem::Ptr &position, const SceneItem::Ptr &item)
const_reverse_iterator rbegin() const
virtual ~Selection()
Destructor.
const_iterator cend() const
bool append(const SceneItem::Ptr &item)
Selection(std::initializer_list< SceneItem::Ptr > items)
const_reverse_iterator crbegin() const
SceneItemList & list()
Definition: selection.h:224
bool empty() const
virtual void postRemove(const SceneItem::Ptr &item)
Selection doReplaceWith(const Selection &selection)
const_iterator begin() const
Node for Universal Front End trie.
Definition: trie.h:127
Path path(const std::string &pathString)
std::list< std::shared_ptr< SceneItem > > SceneItemList
Definition: sceneItemList.h:22
#define UFE_NS_DEF
Definition: ufe.h:36
#define UFE_SDK_DECL
Definition: ufeExport.h:35