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

Abstract base class for scene item operations interface. More...

#include <sceneItemOps.h>

Public Types

typedef std::shared_ptr< SceneItemOpsPtr
 

Public Member Functions

 SceneItemOps ()
 Constructor. More...
 
 SceneItemOps (const SceneItemOps &)=default
 Default copy constructor. More...
 
virtual ~SceneItemOps ()
 Destructor. More...
 
virtual SceneItem::Ptr sceneItem () const =0
 Scene item accessor. More...
 
virtual UndoableCommand::Ptr deleteItemCmdNoExecute ()=0
 
virtual UndoableCommand::Ptr deleteItemCmd ()=0
 
virtual bool deleteItem ()=0
 
virtual SceneItemResultUndoableCommand::Ptr duplicateItemCmdNoExecute ()=0
 
virtual Duplicate duplicateItemCmd ()=0
 
virtual SceneItem::Ptr duplicateItem ()=0
 
virtual SceneItemResultUndoableCommand::Ptr renameItemCmdNoExecute (const PathComponent &newName)=0
 
virtual Rename renameItemCmd (const PathComponent &newName)=0
 
virtual SceneItem::Ptr renameItem (const PathComponent &newName)=0
 

Static Public Member Functions

static Ptr sceneItemOps (const SceneItem::Ptr &item)
 

Detailed Description

Abstract base class for scene item operations interface.

This base class defines the interface that runtimes can implement to operate on a given selection item as a whole. These include operations like:

  • deleting an item
  • renaming an item
  • duplicating an item and its sub-hierarchy of items

Each operation has two calls, one with undo capability, and one without. Providing undo capability typically involves code complexity, and using undo capability incurs runtime cost in processing and memory. Therefore, non- interactive use of this interface should use calls without undo capability.

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

Definition at line 80 of file sceneItemOps.h.

Member Typedef Documentation

◆ Ptr

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

Definition at line 83 of file sceneItemOps.h.

Constructor & Destructor Documentation

◆ SceneItemOps() [1/2]

Ufe::SceneItemOps::SceneItemOps ( )

Constructor.

◆ SceneItemOps() [2/2]

Ufe::SceneItemOps::SceneItemOps ( const SceneItemOps )
default

Default copy constructor.

◆ ~SceneItemOps()

virtual Ufe::SceneItemOps::~SceneItemOps ( )
virtual

Destructor.

Member Function Documentation

◆ deleteItem()

virtual bool Ufe::SceneItemOps::deleteItem ( )
pure virtual

Remove the item from participation in the scene.

Returns
True for success.

◆ deleteItemCmd()

virtual UndoableCommand::Ptr Ufe::SceneItemOps::deleteItemCmd ( )
pure virtual

Remove the item from participation in the scene.

Note
The command is executed.
Returns
Pointer to an undoable command object whose undo method will restore the object.

◆ deleteItemCmdNoExecute()

virtual UndoableCommand::Ptr Ufe::SceneItemOps::deleteItemCmdNoExecute ( )
pure virtual

Get the command to remove the item from participation in the scene.

Returns
Pointer to an undoable command object whose undo method will restore the object.

◆ duplicateItem()

virtual SceneItem::Ptr Ufe::SceneItemOps::duplicateItem ( )
pure virtual

Duplicate the item and all its descendants.

Returns
The root of the duplicate hierarchy, if successful, else a null pointer.

◆ duplicateItemCmd()

virtual Duplicate Ufe::SceneItemOps::duplicateItemCmd ( )
pure virtual

Duplicate the item and all its descendants. If duplication cannot be done, both the item and the undoable command will be null pointers.

Note
The command is executed.
Returns
Duplicate object containing the root of the duplicate hierarchy and a pointer to an undoable command whose undo removes the duplicated object(s).

◆ duplicateItemCmdNoExecute()

virtual SceneItemResultUndoableCommand::Ptr Ufe::SceneItemOps::duplicateItemCmdNoExecute ( )
pure virtual

Get the command to duplicate the item and all its descendants.

Returns
Pointer to an undoable command whose undo removes the duplicated object(s).

◆ renameItem()

virtual SceneItem::Ptr Ufe::SceneItemOps::renameItem ( const PathComponent newName)
pure virtual

Rename the scene item by changing the tail of its path. After the rename, this interface object will be updated to the new scene item.

Returns
The renamed item, if successful, else a null pointer.

◆ renameItemCmd()

virtual Rename Ufe::SceneItemOps::renameItemCmd ( const PathComponent newName)
pure virtual

Rename the scene item by changing the tail of its path. After the rename, this interface object will be updated to the new scene item.

Note
The command is executed.
Returns
Rename object containing the renamed item and a pointer to an undoable command object whose undo method restores the original name.

◆ renameItemCmdNoExecute()

virtual SceneItemResultUndoableCommand::Ptr Ufe::SceneItemOps::renameItemCmdNoExecute ( const PathComponent newName)
pure virtual

Get the command to rename the scene item by changing the tail of its path.

Returns
Pointer to an undoable command object whose undo method will revert the rename.

◆ sceneItem()

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

Scene item accessor.

◆ sceneItemOps()

static Ptr Ufe::SceneItemOps::sceneItemOps ( const SceneItem::Ptr item)
static

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

Parameters
itemSceneItem's SceneItemOps to retrieve
Returns
SceneItemOps of the given SceneItem

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