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::Scene Class Reference

Singleton class to manage UFE scenes. More...

#include <scene.h>

Inheritance diagram for Ufe::Scene:
Collaboration diagram for Ufe::Scene:

Public Types

typedef std::shared_ptr< ScenePtr
 

Public Member Functions

 ~Scene () override
 Destructor. More...
 
 Scene (const Scene &)=delete
 Cannot copy the scene singleton. More...
 
Sceneoperator= (const Scene &)=delete
 Cannot assign the scene singleton. More...
 
void notify (const Notification &notification) override
 
bool inCompositeNotification () const override
 
- 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
 

Static Public Member Functions

static Sceneinstance ()
 
static void initializeInstance (const Ptr &instance)
 

Protected Member Functions

 Scene ()
 Only derived classes can create a scene. More...
 
virtual void postNotifyObjectAdd (const ObjectAdd &notification)
 
virtual void postNotifyObjectDelete (const ObjectDelete &notification)
 
virtual void postNotifyObjectPathChange (const ObjectPathChange &notification)
 
virtual void postNotifySubtreeInvalidate (const SubtreeInvalidate &notification)
 
virtual void postNotifySceneCompositeChange (const SceneCompositeNotification &notification)
 
void beginNotificationGuard () override
 
void endNotificationGuard () override
 
virtual void beginNotificationGuard ()
 Notification guard interface. Implementation in this class is a no-op. More...
 
virtual void endNotificationGuard ()
 

Private Attributes

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

Detailed Description

Singleton class to manage UFE scenes.

This singleton class can be thought of as a "container" of scene objects, and so is responsible notifications which affect its objects. The Ufe scene is organized into scene segments which form a tree.

It also has post-notification hooks, which are indented to be implemented by the DCC app.

The application must provide the scene singleton, and initialize it in UFE with the initializeInstance() call. There is no Python binding for initializing the instance, which must therefore be done in C++.

Definition at line 43 of file scene.h.

Member Typedef Documentation

◆ Ptr

typedef std::shared_ptr<Scene> Ufe::Scene::Ptr

Definition at line 47 of file scene.h.

Constructor & Destructor Documentation

◆ ~Scene()

Ufe::Scene::~Scene ( )
override

Destructor.

◆ Scene() [1/2]

Ufe::Scene::Scene ( const Scene )
delete

Cannot copy the scene singleton.

◆ Scene() [2/2]

Ufe::Scene::Scene ( )
protected

Only derived classes can create a scene.

Member Function Documentation

◆ beginNotificationGuard()

void Ufe::Scene::beginNotificationGuard ( )
overrideprotectedvirtual

Scene Notification guard interface. creates a SceneCompositeNotification on begin, and notifies observers with the composite notification on end.

Reimplemented from Ufe::Subject.

◆ endNotificationGuard()

void Ufe::Scene::endNotificationGuard ( )
overrideprotectedvirtual

Reimplemented from Ufe::Subject.

◆ inCompositeNotification()

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

Composite notification predicate.

Returns
True if the scene is collecting notifications into a composite notification.

Reimplemented from Ufe::Subject.

◆ initializeInstance()

static void Ufe::Scene::initializeInstance ( const Ptr instance)
static

Initialize the scene singleton. The application should call this once, on startup, to initialize, and to clean up once on shut down, with a null pointer.

Parameters
instanceThe scene instance.
Exceptions
std::invalid_argumentif the scene instance is initialized with a non-null pointer more than once.

◆ instance()

static Scene & Ufe::Scene::instance ( )
static
Returns
The scene singleton instance.

◆ notify()

void Ufe::Scene::notify ( const Notification notification)
overridevirtual

Notify observers.

Parameters
notificationThe notification, must be derived from SceneChanged.

Reimplemented from Ufe::Subject.

◆ operator=()

Scene & Ufe::Scene::operator= ( const Scene )
delete

Cannot assign the scene singleton.

◆ postNotifyObjectAdd()

virtual void Ufe::Scene::postNotifyObjectAdd ( const ObjectAdd notification)
protectedvirtual

notifyObjectAdd() hook method, called after observer notification. Implementation in this class is empty.

Parameters
notificationObject add notification for the added object.

◆ postNotifyObjectDelete()

virtual void Ufe::Scene::postNotifyObjectDelete ( const ObjectDelete notification)
protectedvirtual

notifyObjectDelete() hook method, called after observer notification. Implementation in this class is empty.

Parameters
notificationObject delete notification for the deleted object.

◆ postNotifyObjectPathChange()

virtual void Ufe::Scene::postNotifyObjectPathChange ( const ObjectPathChange notification)
protectedvirtual

notifyObjectPathChange() hook method, called after observer notification. Implementation in this class is empty.

Parameters
notificationObject path change notification for the object whose path was changed.

◆ postNotifySceneCompositeChange()

virtual void Ufe::Scene::postNotifySceneCompositeChange ( const SceneCompositeNotification notification)
protectedvirtual

notifySceneCompositeChange() hook method, called after observer notification. Implementation in this class is empty.

Parameters
notificationscene composite notification.

◆ postNotifySubtreeInvalidate()

virtual void Ufe::Scene::postNotifySubtreeInvalidate ( const SubtreeInvalidate notification)
protectedvirtual

notifySubtreeInvalidate() hook method, called after observer notification. Implementation in this class is empty.

Parameters
notificationSubtree invalidate notification for the subtree which was invalidated.

Member Data Documentation

◆ fCompositeNotification

std::unique_ptr<SceneCompositeNotification> Ufe::Scene::fCompositeNotification
private

Composite notification, when within the scope of a guard.

Definition at line 120 of file scene.h.


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