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::Object3d Class Referenceabstract

Abstract base class for 3D object interface. More...

#include <object3d.h>

Public Types

typedef std::shared_ptr< Object3dPtr
 

Public Member Functions

 Object3d ()
 Constructor. More...
 
 Object3d (const Object3d &)=default
 Default copy constructor. More...
 
virtual ~Object3d ()
 Destructor. More...
 
virtual SceneItem::Ptr sceneItem () const =0
 Scene item accessor. More...
 
virtual BBox3d boundingBox () const =0
 
virtual bool visibility () const =0
 
virtual void setVisibility (bool vis)=0
 Set the visibility state of the object. More...
 
virtual Ufe::UndoableCommand::Ptr setVisibleCmd (bool vis)=0
 Create an undoable visible command. More...
 

Static Public Member Functions

static Ptr object3d (const SceneItem::Ptr &item)
 
static bool addObserver (const Observer::Ptr &obs)
 
static bool removeObserver (const Observer::Ptr &obs)
 
static std::size_t nbObservers ()
 
static bool hasObserver (const Observer::Ptr &obs)
 
static void notify (const Notification &notif)
 

Detailed Description

Abstract base class for 3D object interface.

This base class defines the interface that runtimes can implement to provide basic 3D object behavior. 3D objects have visibility, and have 3D space bounds.

To avoid the memory-consuming "one proxy object per scene object" approach, Object3d interface objects should be obtained and used within a local scope, and not stored. Object3d interfaces should be considered stateless, and can be bound to new selection items.

Definition at line 38 of file object3d.h.

Member Typedef Documentation

◆ Ptr

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

Definition at line 41 of file object3d.h.

Constructor & Destructor Documentation

◆ Object3d() [1/2]

Ufe::Object3d::Object3d ( )

Constructor.

◆ Object3d() [2/2]

Ufe::Object3d::Object3d ( const Object3d )
default

Default copy constructor.

◆ ~Object3d()

virtual Ufe::Object3d::~Object3d ( )
virtual

Destructor.

Member Function Documentation

◆ addObserver()

static bool Ufe::Object3d::addObserver ( const Observer::Ptr obs)
static

Add observation for Object3d changes on any item in the scene (global observation).

Parameters
obsObserver to add.
Returns
True if the observer is added. Add does nothing and returns false if the observer is already present.

◆ boundingBox()

virtual BBox3d Ufe::Object3d::boundingBox ( ) const
pure virtual

Return the local space, axis-aligned 3D extents of the object.

Returns
Object bounding box.

◆ hasObserver()

static bool Ufe::Object3d::hasObserver ( const Observer::Ptr obs)
static

Query observation for Object3d changes on any item in the scene (global observers).

Parameters
obsObserver to query.
Returns
True if the observer observes Object3d changes on any item in the scene.

◆ nbObservers()

static std::size_t Ufe::Object3d::nbObservers ( )
static

Number of observers for Object3d changes on any item in the scene (global observers).

Returns
Number of observers.

◆ notify()

static void Ufe::Object3d::notify ( const Notification notif)
static

Notify all global observers. The order in which observers are notified is unspecified. If no observer exists, does nothing.

Parameters
notifThe Object3d notification to send.

◆ object3d()

static Ptr Ufe::Object3d::object3d ( const SceneItem::Ptr item)
static

Convenience method that calls the object3d method on the Object3d handler for the item. Returns a null pointer if the argument is null, or has an empty path.

Parameters
itemSceneItem for which Object3d interface is desired.
Returns
Object3d interface of the given SceneItem.

◆ removeObserver()

static bool Ufe::Object3d::removeObserver ( const Observer::Ptr obs)
static

Remove observation for Object3d changes on any item in the scene (global observation).

Parameters
obsObserver to remove.
Returns
True if the observer is removed. False if the observer isn't found.

◆ sceneItem()

virtual SceneItem::Ptr Ufe::Object3d::sceneItem ( ) const
pure virtual

Scene item accessor.

◆ setVisibility()

virtual void Ufe::Object3d::setVisibility ( bool  vis)
pure virtual

Set the visibility state of the object.

◆ setVisibleCmd()

virtual Ufe::UndoableCommand::Ptr Ufe::Object3d::setVisibleCmd ( bool  vis)
pure virtual

Create an undoable visible command.

◆ visibility()

virtual bool Ufe::Object3d::visibility ( ) const
pure virtual

Return the visibility state of the object.

Returns
true if the object is visible

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