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
Ufe::ObservableSelection Class Reference

Observable selection for objects in the scene. More...

#include <observableSelection.h>

Inheritance diagram for Ufe::ObservableSelection:
Collaboration diagram for Ufe::ObservableSelection:

Public Member Functions

 ObservableSelection ()
 Constructor. More...
 
 ~ObservableSelection () override
 Destructor. More...
 
 ObservableSelection (const Selection &)
 
 ObservableSelection (const ObservableSelection &)
 
 ObservableSelection (Selection &&)
 
 ObservableSelection (ObservableSelection &&)
 
ObservableSelectionoperator= (const Selection &)
 
ObservableSelectionoperator= (const ObservableSelection &)
 
ObservableSelectionoperator= (Selection &&rhs)
 
ObservableSelectionoperator= (ObservableSelection &&rhs)
 
bool inCompositeNotification () const override
 
- Public Member Functions inherited from Ufe::Selection
 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...
 
Selectionoperator= (const Selection &)
 Syntactic convenience that calls replaceWith. More...
 
 Selection (Selection &&)
 Move construction. postClear is called on the argument. More...
 
Selectionoperator= (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::Ptrfront () const
 Element access. More...
 
const SceneItem::Ptrback () 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
 
- Public Member Functions inherited from Ufe::Subject
 Subject ()
 Constructor. More...
 
 Subject (const Subject &)
 Copy constructor. Observers are not copied. More...
 
 Subject (Subject &&)
 Move constructor. Observers are not moved. More...
 
virtual ~Subject ()
 Destructor. More...
 
Subjectoperator= (const Subject &)
 Assignment operator. Does nothing, as observers are not copied. More...
 
Subjectoperator= (Subject &&)
 Move assignment operator. Does nothing, as observers are not moved. More...
 
bool addObserver (const Observer::Ptr &obs)
 
bool removeObserver (const Observer::Ptr &obs)
 
bool hasObserver (const Observer::Ptr &obs) const
 
std::size_t nbObservers () const
 
virtual void notify (const Notification &notification)
 
virtual bool inCompositeNotification () const
 

Protected Member Functions

void beginNotificationGuard () override
 
void endNotificationGuard () override
 
void postAppend (const SceneItem::Ptr &item) override
 
void postRemove (const SceneItem::Ptr &item) override
 
void postInsert (const SceneItem::Ptr &position, const SceneItem::Ptr &item) override
 
void postClear (const Selection &previous) override
 Method called after clearing the observable selection. More...
 
void postReplaceWith (const Selection &previous) override
 Method called after replacing the observable selection. More...
 
- Protected Member Functions inherited from Ufe::Selection
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)
 
SelectionTrietrie ()
 Trie-based acceleration structure access. More...
 
const SelectionTrietrie () const
 
SceneItemListlist ()
 
virtual void beginNotificationGuard ()
 Notification guard interface. Implementation in this class is a no-op. More...
 
virtual void endNotificationGuard ()
 

Private Types

typedef Selection BaseClass
 

Private Attributes

std::unique_ptr< SelectionCompositeNotificationfCompositeNotification
 Composite notification, when within the scope of a guard. More...
 

Additional Inherited Members

- Public Types inherited from Ufe::Selection
typedef SceneItemList::const_iterator const_iterator
 
typedef SceneItemList::const_reverse_iterator const_reverse_iterator
 

Detailed Description

Observable selection for objects in the scene.

This class extends the base class selection to provide notifications on change. It acts as a Subject, so that Observers can register to it and receive SelectionChanged notifications.

Definition at line 30 of file observableSelection.h.

Member Typedef Documentation

◆ BaseClass

Definition at line 100 of file observableSelection.h.

Constructor & Destructor Documentation

◆ ObservableSelection() [1/5]

Ufe::ObservableSelection::ObservableSelection ( )

Constructor.

◆ ~ObservableSelection()

Ufe::ObservableSelection::~ObservableSelection ( )
override

Destructor.

◆ ObservableSelection() [2/5]

Ufe::ObservableSelection::ObservableSelection ( const Selection )

Copy and move assignment and construction. These methods do not assign or move observers from the right hand ObservableSelection (source) to the destination. For assignment, the observers of both objects are unchanged. For construction, the observers of the source are unchanged, and the destination has no observers. See Ufe::Selection base class.

◆ ObservableSelection() [3/5]

Ufe::ObservableSelection::ObservableSelection ( const ObservableSelection )

◆ ObservableSelection() [4/5]

Ufe::ObservableSelection::ObservableSelection ( Selection &&  )

◆ ObservableSelection() [5/5]

Ufe::ObservableSelection::ObservableSelection ( ObservableSelection &&  )

Member Function Documentation

◆ beginNotificationGuard()

void Ufe::ObservableSelection::beginNotificationGuard ( )
overrideprotectedvirtual

Subject Notification guard interface. Implementation in this class creates a SelectionCompositeNotification on begin, and notifies observers with the composite notification on end.

Reimplemented from Ufe::Subject.

◆ endNotificationGuard()

void Ufe::ObservableSelection::endNotificationGuard ( )
overrideprotectedvirtual

Reimplemented from Ufe::Subject.

◆ inCompositeNotification()

bool Ufe::ObservableSelection::inCompositeNotification ( ) const
overridevirtual

Composite notification predicate.

Returns
True if this subject is collecting notifications into a composite notification.

Reimplemented from Ufe::Subject.

◆ operator=() [1/4]

ObservableSelection & Ufe::ObservableSelection::operator= ( const ObservableSelection )

◆ operator=() [2/4]

ObservableSelection & Ufe::ObservableSelection::operator= ( const Selection )

◆ operator=() [3/4]

ObservableSelection & Ufe::ObservableSelection::operator= ( ObservableSelection &&  rhs)

◆ operator=() [4/4]

ObservableSelection & Ufe::ObservableSelection::operator= ( Selection &&  rhs)

◆ postAppend()

void Ufe::ObservableSelection::postAppend ( const SceneItem::Ptr item)
overrideprotectedvirtual

Method called after adding an item to the observable selection

Parameters
itemAdded SceneItem to the observable selection

Reimplemented from Ufe::Selection.

◆ postClear()

void Ufe::ObservableSelection::postClear ( const Selection previous)
overrideprotectedvirtual

Method called after clearing the observable selection.

Reimplemented from Ufe::Selection.

◆ postInsert()

void Ufe::ObservableSelection::postInsert ( const SceneItem::Ptr position,
const SceneItem::Ptr item 
)
overrideprotectedvirtual

Method called after inserting an item into the observable selection

Parameters
positionSceneItem following the inserted item
itemSceneItem inserted into the observable selection

Reimplemented from Ufe::Selection.

◆ postRemove()

void Ufe::ObservableSelection::postRemove ( const SceneItem::Ptr item)
overrideprotectedvirtual

Method called after removing an item from the observable selection

Parameters
itemRemoved SceneItem from the observable selection

Reimplemented from Ufe::Selection.

◆ postReplaceWith()

void Ufe::ObservableSelection::postReplaceWith ( const Selection previous)
overrideprotectedvirtual

Method called after replacing the observable selection.

Reimplemented from Ufe::Selection.

Member Data Documentation

◆ fCompositeNotification

std::unique_ptr<SelectionCompositeNotification> Ufe::ObservableSelection::fCompositeNotification
private

Composite notification, when within the scope of a guard.

Definition at line 103 of file observableSelection.h.


The documentation for this class was generated from the following file: