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
|
Abstract base class for context operations interface. More...
#include <contextOps.h>
Public Types | |
typedef std::shared_ptr< ContextOps > | Ptr |
typedef std::vector< std::string > | ItemPath |
typedef std::vector< ContextItem > | Items |
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) |
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.
typedef std::vector<std::string> Ufe::ContextOps::ItemPath |
Definition at line 156 of file contextOps.h.
typedef std::vector<ContextItem> Ufe::ContextOps::Items |
Definition at line 157 of file contextOps.h.
typedef std::shared_ptr<ContextOps> Ufe::ContextOps::Ptr |
Definition at line 155 of file contextOps.h.
Ufe::ContextOps::ContextOps | ( | ) |
Constructor.
|
default |
Default copy constructor.
|
virtual |
Destructor.
|
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.
item | SceneItem's ContextOps to retrieve |
|
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.
itemPath | The list of tokens that describes the operator. |
|
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.
itemPath | The list of tokens that describes the operator. |
Get the child items of the argument. An empty vector means to return the top-level operations.
|
pure virtual |
Scene item accessor.