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 list for objects in the scene. More...
#include <selection.h>
Public Types | |
typedef SceneItemList::const_iterator | const_iterator |
typedef SceneItemList::const_reverse_iterator | const_reverse_iterator |
Public Member Functions | |
Selection () | |
Constructors. More... | |
Selection (std::initializer_list< SceneItem::Ptr > items) | |
Selection (SceneItemList items) | |
Selection (const SceneItem::Ptr &item) | |
Selection (const Selection &) | |
virtual | ~Selection () |
Destructor. More... | |
Selection & | operator= (const Selection &) |
Syntactic convenience that calls replaceWith. More... | |
Selection (Selection &&) | |
Move construction. postClear is called on the argument. More... | |
Selection & | operator= (Selection &&rhs) |
Move assignment. postClear is first called on rhs, then postReplaceWith on this. More... | |
std::size_t | size () const |
bool | empty () const |
bool | append (const SceneItem::Ptr &item) |
bool | remove (const SceneItem::Ptr &item) |
bool | insert (const SceneItem::Ptr &position, const SceneItem::Ptr &item) |
void | clear () |
void | replaceWith (const Selection &selection) |
bool | contains (const Path &path) const |
bool | containsDescendant (const Path &path) const |
bool | containsDescendantInclusive (const Path &path) const |
bool | containsAncestor (const Path &path) const |
bool | containsAncestorInclusive (const Path &path) const |
SceneItem::Ptr | closestCommonAncestor () const |
SceneItem::Ptr | next (const SceneItem::Ptr &item) const |
const SceneItem::Ptr & | front () const |
Element access. More... | |
const SceneItem::Ptr & | back () const |
const_iterator | cbegin () const |
Iteration interface on SceneItems. More... | |
const_iterator | begin () const |
const_iterator | cend () const |
const_iterator | end () const |
const_reverse_iterator | crbegin () const |
const_reverse_iterator | rbegin () const |
const_reverse_iterator | crend () const |
const_reverse_iterator | rend () const |
Protected Member Functions | |
bool | doAppend (const SceneItem::Ptr &item) |
bool | doRemove (const SceneItem::Ptr &item) |
bool | doInsert (const SceneItem::Ptr &position, const SceneItem::Ptr &item) |
Selection | doClear () |
Selection | doReplaceWith (const Selection &selection) |
virtual void | postAppend (const SceneItem::Ptr &item) |
virtual void | postRemove (const SceneItem::Ptr &item) |
virtual void | postInsert (const SceneItem::Ptr &position, const SceneItem::Ptr &item) |
virtual void | postClear (const Selection &previous) |
virtual void | postReplaceWith (const Selection &previous) |
SelectionTrie & | trie () |
Trie-based acceleration structure access. More... | |
const SelectionTrie & | trie () const |
SceneItemList & | list () |
Private Member Functions | |
Selection (SceneItemList &&list, SelectionTrie &&selectionTrie) | |
Constructor used internally to build previous selection list. More... | |
Private Attributes | |
SceneItemList | fList |
void * | fTrieStorage [2] |
Selection list for objects in the scene.
This class provides an ordered list composed of selection items. It uses a backing trie data structure so that on average, for a path with c components, addition, lookup, and removal from the selection can be done in O(c) time.
Definition at line 27 of file selection.h.
typedef SceneItemList::const_iterator Ufe::Selection::const_iterator |
Definition at line 31 of file selection.h.
typedef SceneItemList::const_reverse_iterator Ufe::Selection::const_reverse_iterator |
Definition at line 32 of file selection.h.
Ufe::Selection::Selection | ( | ) |
Constructors.
Ufe::Selection::Selection | ( | std::initializer_list< SceneItem::Ptr > | items | ) |
Ufe::Selection::Selection | ( | SceneItemList | items | ) |
Ufe::Selection::Selection | ( | const SceneItem::Ptr & | item | ) |
Ufe::Selection::Selection | ( | const Selection & | ) |
|
virtual |
Destructor.
Ufe::Selection::Selection | ( | Selection && | ) |
Move construction. postClear is called on the argument.
|
private |
Constructor used internally to build previous selection list.
bool Ufe::Selection::append | ( | const SceneItem::Ptr & | item | ) |
If the item is not on the selection list, append it at the end and return true. If the item is already in the list, do nothing and return false.
item | SceneItem to append to the selection list. |
std::invalid_argument | if the argument is a null pointer. |
const SceneItem::Ptr & Ufe::Selection::back | ( | ) | const |
const_iterator Ufe::Selection::begin | ( | ) | const |
const_iterator Ufe::Selection::cbegin | ( | ) | const |
Iteration interface on SceneItems.
const_iterator Ufe::Selection::cend | ( | ) | const |
void Ufe::Selection::clear | ( | ) |
Remove all SceneItems from the selection list.
SceneItem::Ptr Ufe::Selection::closestCommonAncestor | ( | ) | const |
Finds the single common parent of the existing selection.
std::invalid_argument | if the selection is empty. |
bool Ufe::Selection::contains | ( | const Path & | path | ) | const |
bool Ufe::Selection::containsAncestor | ( | const Path & | path | ) | const |
Query whether the selection contains an ancestor of the argument path. Must be a strict ancestor: if the selection contains only the argument itself, returns false. If the argument path is empty, returns false.
path | descendant Path |
bool Ufe::Selection::containsAncestorInclusive | ( | const Path & | path | ) | const |
Query whether the selection contains the argument path or an ancestor of the argument path. If the argument path is empty, returns false.
path | descendant Path |
bool Ufe::Selection::containsDescendant | ( | const Path & | path | ) | const |
Query whether the selection contains a descendant of the argument path. Must be a strict descendant: if the selection contains only the argument itself, returns false. If the argument path is empty, returns false.
path | ancestor Path |
bool Ufe::Selection::containsDescendantInclusive | ( | const Path & | path | ) | const |
Query whether the selection contains the argument path or a descendant of the argument path. If the argument path is empty, returns false.
path | ancestor Path |
const_reverse_iterator Ufe::Selection::crbegin | ( | ) | const |
const_reverse_iterator Ufe::Selection::crend | ( | ) | const |
|
protected |
Engine methods for append, remove, insert, clear, and replaceWith, to implement the Template Method design pattern. See
|
protected |
|
protected |
|
protected |
bool Ufe::Selection::empty | ( | ) | const |
const_iterator Ufe::Selection::end | ( | ) | const |
const SceneItem::Ptr & Ufe::Selection::front | ( | ) | const |
Element access.
bool Ufe::Selection::insert | ( | const SceneItem::Ptr & | position, |
const SceneItem::Ptr & | item | ||
) |
Insert item just before the position item. If the item is already in the list, do nothing and return false. If position is the null pointer, append. Will throw an exception if the position argument is not found.
position | SceneItem before which to insert into selection list. |
item | SceneItem to insert into selection list. |
std::invalid_argument | if item is a null pointer, or if position is not found. |
|
inlineprotected |
Internal SceneItem list structure access. Do not change the order of this list as the internal trie saves iterators into fList.
Definition at line 223 of file selection.h.
SceneItem::Ptr Ufe::Selection::next | ( | const SceneItem::Ptr & | item | ) | const |
Finds the item which follows the argument item. This can be used to undo the effect of remove, by using insert.
item | SceneItem whose successor must be found. |
std::invalid_argument | if the argument item is not found. |
Syntactic convenience that calls replaceWith.
Move assignment. postClear is first called on rhs, then postReplaceWith on this.
|
protectedvirtual |
Reimplemented in Ufe::ObservableSelection.
|
protectedvirtual |
Reimplemented in Ufe::ObservableSelection.
|
protectedvirtual |
Reimplemented in Ufe::ObservableSelection.
|
protectedvirtual |
Reimplemented in Ufe::ObservableSelection.
|
protectedvirtual |
Reimplemented in Ufe::ObservableSelection.
const_reverse_iterator Ufe::Selection::rbegin | ( | ) | const |
bool Ufe::Selection::remove | ( | const SceneItem::Ptr & | item | ) |
Remove the item from the selection list, if present, and return true. If no such item is on the list, return false.
item | SceneItem to remove from selection list. |
std::invalid_argument | if the argument is a null pointer. |
const_reverse_iterator Ufe::Selection::rend | ( | ) | const |
void Ufe::Selection::replaceWith | ( | const Selection & | selection | ) |
Replace all SceneItems in the selection list with those from the argument selection list. The items are shared between both lists (shallow copy).
selection | Selection to replace with. |
std::size_t Ufe::Selection::size | ( | ) | const |
|
protected |
Trie-based acceleration structure access.
|
protected |
|
private |
Definition at line 229 of file selection.h.
|
private |
Hidden trie-based untyped storage. The untyped storage avoids a dynamic memory allocation.
Definition at line 233 of file selection.h.