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

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

#include <hierarchy.h>

Public Types

typedef std::shared_ptr< HierarchyPtr
 
typedef std::list< ChildFilterFlagChildFilter
 

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 bool hasFilteredChildren (const ChildFilter &) const =0
 
virtual SceneItemList filteredChildren (const ChildFilter &) const =0
 
virtual SceneItem::Ptr parent () const =0
 
virtual SceneItem::Ptr defaultParent () const =0
 
virtual SceneItem::Ptr insertChild (const SceneItem::Ptr &child, const SceneItem::Ptr &pos)=0
 
virtual InsertChildCommand::Ptr insertChildCmd (const SceneItem::Ptr &child, const SceneItem::Ptr &pos)=0
 
InsertChildCommand::Ptr appendChildCmd (const SceneItem::Ptr &child)
 
virtual SceneItem::Ptr createGroup (const PathComponent &name) const =0
 
virtual InsertChildCommand::Ptr createGroupCmd (const PathComponent &name) const =0
 
virtual UndoableCommand::Ptr reorderCmd (const Ufe::SceneItemList &orderedList) const =0
 
virtual bool reorder (const Ufe::SceneItemList &orderedList)
 
virtual UndoableCommand::Ptr ungroupCmd () const =0
 
virtual bool ungroup ()
 

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 runtimes 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 69 of file hierarchy.h.

Member Typedef Documentation

◆ ChildFilter

Definition at line 73 of file hierarchy.h.

◆ Ptr

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

Definition at line 72 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

◆ appendChildCmd()

InsertChildCommand::Ptr Ufe::Hierarchy::appendChildCmd ( const SceneItem::Ptr child)
inline

Create a command to 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. The command is not executed.

Parameters
childChild item to be appended.
Returns
Command whose execution will reparent the child.

Definition at line 155 of file hierarchy.h.

◆ children()

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

◆ createGroup()

virtual SceneItem::Ptr Ufe::Hierarchy::createGroup ( const PathComponent name) const
pure virtual

Create a new group object as a child of this object. Returned SceneItem will be the newly created parent. The argument component is the desired name of the created group. The resulting name will be different if an existing sibling already has that name.

Parameters
nameDesired name of new group to create
Returns
SceneItem for the new group. Returns a null pointer on failure.

◆ createGroupCmd()

virtual InsertChildCommand::Ptr Ufe::Hierarchy::createGroupCmd ( const PathComponent name) const
pure virtual

Create a command to create a new group object as a child of this object. The argument component is the desired name of the created group. The resulting name will be different if an existing sibling already has that name. The command is not executed.

Parameters
nameDesired name of new group to create
Returns
Command whose execution will create a new group and move the selection under it.

◆ 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. Note that this method does not create an object in the runtime; rather, it creates a UFE scene item for an existing runtime object. Returns a null pointer if the argument is an empty path.

Parameters
pathPath of SceneItem to create
Returns
SceneItem of argument Path

Referenced by Ufe::BaseUndoableCommand::sceneItem().

Here is the caller graph for this function:

◆ defaultParent()

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

Return the parent to which this SceneItem should be appended, if it is removed from its current parent (unparent). This will typically be the scene root, or a meaningful sub-root of a sub-hierarchy.

Returns
The SceneItem's default parent. Returns a null pointer if the item cannot be reparented to a default parent.

◆ filteredChildren()

virtual SceneItemList Ufe::Hierarchy::filteredChildren ( const ChildFilter ) const
pure virtual
Returns
Ordered list of children filtered by input child filter for this Hierarchy's SceneItem.

◆ 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

◆ hasFilteredChildren()

virtual bool Ufe::Hierarchy::hasFilteredChildren ( const ChildFilter ) const
pure virtual

Predicate to return if the SceneItem has children in the hierarchy for the given filter.

Returns
True if SceneItem has filtered 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.

◆ insertChild()

virtual SceneItem::Ptr Ufe::Hierarchy::insertChild ( const SceneItem::Ptr child,
const SceneItem::Ptr pos 
)
pure virtual

Remove the argument child from its existing parent, and append it as a child of this SceneItem, inserting before SceneItem pos. If pos is a null pointer, child is appended. Because of name uniqueness, the child may be renamed.

Parameters
childChild item to be inserted.
posItem before which child is to be inserted.
Returns
SceneItem for the appended child, at its new path.

◆ insertChildCmd()

virtual InsertChildCommand::Ptr Ufe::Hierarchy::insertChildCmd ( const SceneItem::Ptr child,
const SceneItem::Ptr pos 
)
pure virtual

Create a command to remove the argument child from its existing parent, and insert it as a child of this SceneItem, inserting before SceneItem pos. If pos is a null pointer, child is appended. Because of name uniqueness, the child may be renamed. The command is not executed.

Parameters
childChild item to be inserted.
posItem before which child is to be inserted.
Returns
Command whose execution will reparent the child.

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

◆ reorder()

virtual bool Ufe::Hierarchy::reorder ( const Ufe::SceneItemList orderedList)
inlinevirtual

Reorder the children of this scene item. Default implementation calls reorder command and executes.

Parameters
orderedListlist of already reordered children.
Returns
Command whose execution will reorder the child(s).

Definition at line 188 of file hierarchy.h.

◆ reorderCmd()

virtual UndoableCommand::Ptr Ufe::Hierarchy::reorderCmd ( const Ufe::SceneItemList orderedList) const
pure virtual

Create a command to reorder the children of this scene item.

Parameters
orderedListlist of already reordered children.
Returns
Command whose execution will reorder the child(s).

◆ sceneItem()

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

Scene item accessor.

◆ ungroup()

virtual bool Ufe::Hierarchy::ungroup ( )
inlinevirtual

Ungroup the specified objects. Default implementation calls ungroup command and executes.

Definition at line 204 of file hierarchy.h.

◆ ungroupCmd()

virtual UndoableCommand::Ptr Ufe::Hierarchy::ungroupCmd ( ) const
pure virtual

Create a command to ungroup the specified objects.

Returns
Command whose execution will ungroup the specified objects.

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