ufe  4.2
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...
 
bool inCompositeNotification () const override
 
 ObservableSelection (const Selection &)
 
 ObservableSelection (const ObservableSelection &)
 
 ObservableSelection (Selection &&)
 
 ObservableSelection (ObservableSelection &&)
 
ObservableSelectionoperator= (const Selection &)
 
ObservableSelectionoperator= (const ObservableSelection &)
 
ObservableSelectionoperator= (Selection &&rhs)
 
ObservableSelectionoperator= (ObservableSelection &&rhs)
 
- Public Member Functions inherited from Ufe::Selection
 Selection ()
 Constructor. More...
 
 Selection (const Selection &)
 Default copy constructor. More...
 
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
 Element access. More...
 
const_iterator cbegin () const
 Iteration interface on SceneItems. More...
 
const_iterator begin () const
 Iteration interface on SceneItems. More...
 
const_iterator cend () const
 Iteration interface on SceneItems. More...
 
const_iterator end () const
 Iteration interface on SceneItems. More...
 
const_reverse_iterator crbegin () const
 Iteration interface on SceneItems. More...
 
const_reverse_iterator rbegin () const
 Iteration interface on SceneItems. More...
 
const_reverse_iterator crend () const
 Iteration interface on SceneItems. More...
 
const_reverse_iterator rend () const
 Iteration interface on SceneItems. More...
 
- 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)
 

Protected Member Functions

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 () override
 Method called after clearing the observable selection. More...
 
void postReplaceWith () override
 Method called after replacing the observable selection. More...
 
void beginNotificationGuard () override
 
void endNotificationGuard () override
 
- Protected Member Functions inherited from Ufe::Selection
SceneItemListlist ()
 
bool doAppend (const SceneItem::Ptr &item)
 
bool doRemove (const SceneItem::Ptr &item)
 
bool doInsert (const SceneItem::Ptr &position, const SceneItem::Ptr &item)
 
void doClear ()
 
void doReplaceWith (const Selection &selection)
 
SelectionTrietrie ()
 Trie-based acceleration structure access. More...
 
const SelectionTrietrie () const
 Trie-based acceleration structure access. More...
 

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 )

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() [4/5]

Ufe::ObservableSelection::ObservableSelection ( 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() [5/5]

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

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.

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

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.

◆ 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 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.

◆ operator=() [2/4]

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

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.

◆ operator=() [3/4]

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

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.

◆ operator=() [4/4]

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

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.

◆ 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 ( )
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 ( )
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: