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

Abstract base class for scene hierarchy interface. More...

#include <hierarchy.h>

Public Types

typedef std::shared_ptr< HierarchyPtr
 

Public Member Functions

 Hierarchy ()
 Constructor. More...
 
 Hierarchy (const Hierarchy &)=default
 Default copy constructor. More...
 
virtual ~Hierarchy ()
 Destructor. More...
 
virtual SceneItem::Ptr sceneItem () const =0
 Scene item accessor. More...
 
virtual bool hasChildren () const =0
 
virtual SceneItemList children () const =0
 
virtual SceneItem::Ptr parent () const =0
 
virtual AppendedChild appendChild (const SceneItem::Ptr &child)=0
 

Static Public Member Functions

static Ptr hierarchy (const SceneItem::Ptr &item)
 
static SceneItem::Ptr createItem (const Path &path)
 

Detailed Description

Abstract base class for scene hierarchy interface.

This base class defines the interface that run-times can implement to navigate the scene hierarchy, for a given scene item. The Hierarchy interface supports parent-child hierarchy semantics and queries, with the following characteristics:

  • an item has a single parent, or none if it is not in a hierarchy, or is a hierarchy root.
  • an item has 0 or more children. Certain DCC data models (e.g. Maya) allow objects to have multiple parents in the case of instancing. This does not affect UFE single-parent semantics. The different UFE paths to a Maya instanced object uniquely identify each instance, in exact correspondence to how a Maya MDagPath uniquely identifies the instance to Maya.

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

Definition at line 64 of file hierarchy.h.

Member Typedef Documentation

◆ Ptr

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

Definition at line 67 of file hierarchy.h.

Constructor & Destructor Documentation

◆ Hierarchy() [1/2]

Ufe::Hierarchy::Hierarchy ( )

Constructor.

◆ Hierarchy() [2/2]

Ufe::Hierarchy::Hierarchy ( const Hierarchy )
default

Default copy constructor.

◆ ~Hierarchy()

virtual Ufe::Hierarchy::~Hierarchy ( )
virtual

Destructor.

Member Function Documentation

◆ appendChild()

virtual AppendedChild Ufe::Hierarchy::appendChild ( const SceneItem::Ptr child)
pure virtual

Remove the argument child from its existing parent, and append it as a child of this SceneItem. Because of name uniqueness, the child may be renamed.

Returns
AppendedChild object containing a SceneItem for the appended child, the child's previous path, and its previous index position.

◆ children()

virtual SceneItemList Ufe::Hierarchy::children ( ) const
pure virtual
Returns
Ordered list of children for this Hierarchy's SceneItem.

◆ createItem()

static SceneItem::Ptr Ufe::Hierarchy::createItem ( const Path path)
static

Convenience method that calls the createItem method on the hierarchy handler for the item. Returns a null pointer if the argument is an empty path.

Parameters
pathPath of SceneItem to create
Returns
SceneItem of argument Path

◆ hasChildren()

virtual bool Ufe::Hierarchy::hasChildren ( ) const
pure virtual

Predicate to return if the SceneItem has children in the hierarchy.

Returns
True if SceneItem has children

◆ hierarchy()

static Ptr Ufe::Hierarchy::hierarchy ( const SceneItem::Ptr item)
static

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

Parameters
itemSceneItem to build Hierarchy on
Returns
Hierarchy of given SceneItem.

◆ parent()

virtual SceneItem::Ptr Ufe::Hierarchy::parent ( ) const
pure virtual
Returns
The SceneItem's parent. Returns a null pointer if the item is the world root, and has no parent.

◆ sceneItem()

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

Scene item accessor.


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