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
selection.h
Go to the documentation of this file.
1#line 1 "S:/jenkins/workspace/ECP/ufe/ufe-full-python3.11-windows/ufe/include/selection.h"
2#ifndef _ufeSelection
3#define _ufeSelection
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 "sceneItemList.h"
13#include "sceneItem.h"
14#include "selectionTrieFwd.h"
15
17
19
28{
29public:
30
31 typedef SceneItemList::const_iterator const_iterator;
32 typedef SceneItemList::const_reverse_iterator const_reverse_iterator;
33
35
37 Selection(std::initializer_list<SceneItem::Ptr> items);
42
44 virtual ~Selection();
45
48
51
54
56 std::size_t size() const;
57
59 bool empty() const;
60
69 bool append(const SceneItem::Ptr& item);
70
79 bool remove(const SceneItem::Ptr& item);
80
91 bool insert(const SceneItem::Ptr& position, const SceneItem::Ptr& item);
92
97 void clear();
98
105 void replaceWith(const Selection& selection);
106
110 bool contains(const Path& path) const;
111
120 bool containsDescendant(const Path& path) const;
121
130
139 bool containsAncestor(const Path& path) const;
140
149
157
167
169
170 const SceneItem::Ptr& front() const;
171 const SceneItem::Ptr& back() const;
173
175
185protected:
186
188
193 bool doAppend(const SceneItem::Ptr& item);
194 bool doRemove(const SceneItem::Ptr& item);
195 bool doInsert(const SceneItem::Ptr& position, const SceneItem::Ptr& item);
199
201 // Hook methods for append, remove, insert, clear, and replaceWith.
202 // postAppend(), postRemove(), and postInsert() are only called if
203 // doAppend(), doRemove(), and doInsert() return true, respectively.
204 // Implementations in this class do nothing.
205 virtual void postAppend(const SceneItem::Ptr& item);
206 virtual void postRemove(const SceneItem::Ptr& item);
207 virtual void postInsert(
208 const SceneItem::Ptr& position, const SceneItem::Ptr& item
209 );
210 virtual void postClear(const Selection& previous);
211 virtual void postReplaceWith(const Selection& previous);
213
215
217 const SelectionTrie& trie() const;
219
223 inline SceneItemList& list() { return fList; }
224
225private:
227 Selection(SceneItemList&& list, SelectionTrie&& selectionTrie);
228
230
233 void* fTrieStorage[2];
234};
235
236}
237
238#endif /* _ufeSelection */
Identify an object or 3D path in the scene.
Definition: path.h:38
std::shared_ptr< SceneItem > Ptr
Definition: sceneItem.h:44
Selection list for objects in the scene.
Definition: selection.h:28
Selection & operator=(Selection &&rhs)
Move assignment. postClear is first called on rhs, then postReplaceWith on this.
SelectionTrie & trie()
Trie-based acceleration structure access.
bool containsDescendant(const Path &path) const
const SceneItem::Ptr & back() const
const_iterator cbegin() const
Iteration interface on SceneItems.
bool contains(const Path &path) const
SceneItemList::const_iterator const_iterator
Definition: selection.h:31
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
Selection()
Constructors.
Selection(SceneItemList items)
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:32
bool insert(const SceneItem::Ptr &position, const SceneItem::Ptr &item)
SceneItemList fList
Definition: selection.h:229
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 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
Element access.
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:223
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:128
Path path(const std::string &pathString)
std::list< std::shared_ptr< SceneItem > > SceneItemList
Definition: sceneItemList.h:21
#define UFE_NS_DEF
Definition: ufe.h:35
#define UFE_SDK_DECL
Definition: ufeExport.h:36