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

Abstract base class for context operations interface. More...

#include <contextOps.h>

Public Types

typedef std::shared_ptr< ContextOpsPtr
 
typedef std::vector< std::string > ItemPath
 
typedef std::vector< ContextItemItems
 

Public Member Functions

 ContextOps ()
 Constructor. More...
 
 ContextOps (const ContextOps &)=default
 Default copy constructor. More...
 
virtual ~ContextOps ()
 Destructor. More...
 
virtual SceneItem::Ptr sceneItem () const =0
 Scene item accessor. More...
 
virtual Items getItems (const ItemPath &itemPath) const =0
 
virtual void doOp (const ItemPath &itemPath)
 
virtual UndoableCommand::Ptr doOpCmd (const ItemPath &itemPath)=0
 

Static Public Member Functions

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

Detailed Description

Abstract base class for context operations interface.

This base class defines the interface that runtimes can implement to provide contextual operation support. As per

https://en.wikipedia.org/wiki/Context_menu

a context menu presents operations available on the selected item, given the current state. This interface can be used to describe and implement these contextual operations. The operations are organized in a lazily-populated tree structure, which is oriented to filling in a context menu hierarchy.

Definition at line 152 of file contextOps.h.

Member Typedef Documentation

◆ ItemPath

typedef std::vector<std::string> Ufe::ContextOps::ItemPath

Definition at line 156 of file contextOps.h.

◆ Items

typedef std::vector<ContextItem> Ufe::ContextOps::Items

Definition at line 157 of file contextOps.h.

◆ Ptr

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

Definition at line 155 of file contextOps.h.

Constructor & Destructor Documentation

◆ ContextOps() [1/2]

Ufe::ContextOps::ContextOps ( )

Constructor.

◆ ContextOps() [2/2]

Ufe::ContextOps::ContextOps ( const ContextOps )
default

Default copy constructor.

◆ ~ContextOps()

virtual Ufe::ContextOps::~ContextOps ( )
virtual

Destructor.

Member Function Documentation

◆ contextOps()

static Ptr Ufe::ContextOps::contextOps ( const SceneItem::Ptr item)
static

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

Parameters
itemSceneItem's ContextOps to retrieve
Returns
ContextOps interface for the given SceneItem

◆ doOp()

virtual void Ufe::ContextOps::doOp ( const ItemPath itemPath)
virtual

Perform the operation described by the itemPath. Failure should be reported by throwing an exception derived from std::exception. Implementation in this class calls doOpCmd() and executes the return command, if non-null.

Parameters
itemPathThe list of tokens that describes the operator.

◆ doOpCmd()

virtual UndoableCommand::Ptr Ufe::ContextOps::doOpCmd ( const ItemPath itemPath)
pure virtual

Return a command for undo / redo that performs the operation described by the itemPath. The returned command is not executed; it is up to the called to call execute(). If the operation is not undoable, a null pointer is returned. Failure should be reported by throwing an exception derived from std::exception.

Parameters
itemPathThe list of tokens that describes the operator.
Returns
Undoable command to perform the operation, or null if the operation is not undoable.

◆ getItems()

virtual Items Ufe::ContextOps::getItems ( const ItemPath itemPath) const
pure virtual

Get the child items of the argument. An empty vector means to return the top-level operations.

◆ sceneItem()

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

Scene item accessor.


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