ufe  1.0
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>

Collaboration diagram for Ufe::Scene:

Public Types

typedef std::shared_ptr< ScenePtr
 

Public Member Functions

virtual ~Scene ()
 Destructor. More...
 
 Scene (const Scene &)=delete
 Cannot copy the scene singleton. More...
 
Sceneoperator= (const Scene &)=delete
 Cannot assign the scene singleton. More...
 

Static Public Member Functions

static Sceneinstance ()
 
static void initializeInstance (const Ptr &instance)
 
static void notifyObjectAdd (const ObjectAdd &notification)
 Add object Subject interface. More...
 
static bool addObjectAddObserver (const Observer::Ptr &obs)
 Add object Subject interface. More...
 
static bool removeObjectAddObserver (const Observer::Ptr &obs)
 Add object Subject interface. More...
 
static bool hasObjectAddObserver (const Observer::Ptr &obs)
 Add object Subject interface. More...
 
static void notifyObjectDelete (const ObjectDelete &notification)
 Delete object Subject interface. More...
 
static bool addObjectDeleteObserver (const Observer::Ptr &obs)
 Delete object Subject interface. More...
 
static bool removeObjectDeleteObserver (const Observer::Ptr &obs)
 Delete object Subject interface. More...
 
static bool hasObjectDeleteObserver (const Observer::Ptr &obs)
 Delete object Subject interface. More...
 
static void notifyObjectPathChange (const ObjectPathChange &notification)
 Path change object Subject interface. More...
 
static bool addObjectPathChangeObserver (const Observer::Ptr &obs)
 Path change object Subject interface. More...
 
static bool removeObjectPathChangeObserver (const Observer::Ptr &obs)
 Path change object Subject interface. More...
 
static bool hasObjectPathChangeObserver (const Observer::Ptr &obs)
 Path change object Subject interface. More...
 

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)
 

Private Attributes

Subject fAddObject
 
Subject fDeleteObject
 
Subject fPathChangeObject
 

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.

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 40 of file scene.h.

Member Typedef Documentation

◆ Ptr

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

Definition at line 44 of file scene.h.

Constructor & Destructor Documentation

◆ ~Scene()

virtual Ufe::Scene::~Scene ( )
virtual

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

◆ addObjectAddObserver()

static bool Ufe::Scene::addObjectAddObserver ( const Observer::Ptr obs)
static

Add object Subject interface.

◆ addObjectDeleteObserver()

static bool Ufe::Scene::addObjectDeleteObserver ( const Observer::Ptr obs)
static

Delete object Subject interface.

◆ addObjectPathChangeObserver()

static bool Ufe::Scene::addObjectPathChangeObserver ( const Observer::Ptr obs)
static

Path change object Subject interface.

◆ hasObjectAddObserver()

static bool Ufe::Scene::hasObjectAddObserver ( const Observer::Ptr obs)
static

Add object Subject interface.

◆ hasObjectDeleteObserver()

static bool Ufe::Scene::hasObjectDeleteObserver ( const Observer::Ptr obs)
static

Delete object Subject interface.

◆ hasObjectPathChangeObserver()

static bool Ufe::Scene::hasObjectPathChangeObserver ( const Observer::Ptr obs)
static

Path change object Subject interface.

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

◆ notifyObjectAdd()

static void Ufe::Scene::notifyObjectAdd ( const ObjectAdd notification)
static

Add object Subject interface.

◆ notifyObjectDelete()

static void Ufe::Scene::notifyObjectDelete ( const ObjectDelete notification)
static

Delete object Subject interface.

◆ notifyObjectPathChange()

static void Ufe::Scene::notifyObjectPathChange ( const ObjectPathChange notification)
static

Path change object Subject interface.

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

◆ removeObjectAddObserver()

static bool Ufe::Scene::removeObjectAddObserver ( const Observer::Ptr obs)
static

Add object Subject interface.

◆ removeObjectDeleteObserver()

static bool Ufe::Scene::removeObjectDeleteObserver ( const Observer::Ptr obs)
static

Delete object Subject interface.

◆ removeObjectPathChangeObserver()

static bool Ufe::Scene::removeObjectPathChangeObserver ( const Observer::Ptr obs)
static

Path change object Subject interface.

Member Data Documentation

◆ fAddObject

Subject Ufe::Scene::fAddObject
private

Subjects to manage add object, delete object, and path change object observers.

Definition at line 116 of file scene.h.

◆ fDeleteObject

Subject Ufe::Scene::fDeleteObject
private

Subjects to manage add object, delete object, and path change object observers.

Definition at line 117 of file scene.h.

◆ fPathChangeObject

Subject Ufe::Scene::fPathChangeObject
private

Subjects to manage add object, delete object, and path change object observers.

Definition at line 118 of file scene.h.


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