HDK
|
#include <DT_Plugin.h>
Public Member Functions | |
DT_Plugin (DT_Host &host) | |
virtual | ~DT_Plugin () |
const DT_NodeHandle & | rootNode () const |
DT_Host & | host () const |
virtual bool | getSelected (const DT_Node &node, bool &state) |
virtual bool | setSelected (const DT_Node &node, bool state) |
virtual const DT_ParmDefList & | getOptionDefs () |
Returns the list of parameter definitions for the tree columns. More... | |
virtual bool | getOptionValue (int parm_id, DT_Value &value) |
virtual bool | setOptionValue (int parm_id, const DT_Value &value) |
Sets an option value for the plugin. More... | |
virtual bool | getOptionMenuItems (int parm_id, DT_MenuItemList &items) |
virtual void | opEvent (const DT_NodeIdSet &node_ids, OP_EventType type, void *data) |
virtual void | runDelayedAction (int action_id, const UT_Array< UT_SharedPtr< void > > &data_list) |
virtual bool | dragHasData (const DT_Node &node, const char *data_label) |
Drag Source. More... | |
virtual void * | dragGetData (const DT_Node &node, const char *data_label) |
Drag Source. More... | |
virtual bool | dropAccept (const DT_Node &node, DD_Source &drag_src, const char *data_label) |
Drop Receiver. More... | |
virtual bool | dropTest (const DT_Node &node, DD_Source &drag_src) |
Drag Source. More... | |
virtual void | dropGetChoice (const DT_Node &node, DD_Source &drag_src, DD_ChoiceList &drop_choices) |
Drag Source. More... | |
virtual void | nodesReordered (const DT_Node &parent_node, const UT_IntArray &from_idx, const UT_IntArray &to_idx) |
virtual bool | writeDesktopData (std::ostream &os) |
virtual bool | readDesktopData (std::istream &is) |
virtual bool | writeSceneData (std::ostream &os) |
virtual bool | readSceneData (std::istream &is) |
Protected Member Functions | |
DT_Node & | rootNodeRef () |
Only subclasses can access a non-const version of our root DT_Node. More... | |
Static Protected Member Functions | |
static DT_NodeHandle | createRootNode () |
enum | RenameStyle { RS_INVALID, RS_ALPHANUM, RS_OPNAME, RS_ANY } |
virtual const UT_StringHolder & | name () const =0 |
virtual const UT_StringHolder & | helpId () const =0 |
virtual bool | getChildren (const DT_Node &parent, DT_NodeList &list)=0 |
Get the children of the given node. More... | |
virtual bool | hasChildren (const DT_Node &parent) |
virtual bool | getNodeInfoText (const DT_Node &node, UT_WorkBuffer &info_text) |
Get the info text to show in the MMB popup window. More... | |
virtual bool | canDeleteNode (const DT_Node &node) |
The node delete operation is valid for this plugin. More... | |
virtual bool | deleteNodes (const DT_NodeList &node_list) |
Called when a request for delete occurs. More... | |
virtual bool | canCopyNodes (const DT_NodeList &list, DT_NodeList *filtered_list) |
Check if the node copy operation is valid for this plugin. More... | |
virtual bool | copyNodes (const DT_NodeList &list) |
Called when a request to copy occurs. More... | |
virtual bool | canPasteNodes (const DT_Node &parent_node) |
Check if the reviously copied nodes can be pasted into the given parent. More... | |
virtual bool | pasteNodes (const DT_Node &parent_node) |
Called when a request to paste into a parent node occurs. More... | |
virtual RenameStyle | getRenameStyle (const DT_Node &node) |
The node rename operation is valid for this plugin. More... | |
virtual bool | renameNode (const DT_Node &node, const char *new_name) |
Called when a request for node rename occurs. More... | |
virtual bool | getNodeMenu (const DT_NodeList &node_list, const char *sub_menu_token, DT_NodeMenuItemList &items) |
virtual void | runMenuAction (const DT_NodeList &node_list, const char *menu_token) |
enum | ParmState { PS_INVALID, PS_VALID, PS_INDETERMINATE, PS_ANIMATED, PS_LOCKED } |
virtual const DT_ParmDefList & | getParameterDefs ()=0 |
Returns the list of parameter definitions for the tree columns. More... | |
virtual int | getGroupedParameterId (const DT_Node &node, int parm_id) |
virtual ParmState | getParameterValue (const DT_Node &node, int parm_id, DT_Value &value, bool for_feel)=0 |
virtual bool | setParameterValue (const DT_Node &node, int parm_id, const DT_Value &value)=0 |
virtual bool | setParameterValues (const DT_NodeList &node_list, int parm_id, const DT_Value &value) |
virtual bool | getParameterMenuItems (const DT_Node &node, int parm_id, DT_MenuItemList &items) |
Definition at line 893 of file DT_Plugin.h.
enum DT_Plugin::ParmState |
Tree parameters
Enumerator | |
---|---|
PS_INVALID |
No value can be retrieved. |
PS_VALID |
Value is valid. |
PS_INDETERMINATE |
The value state is indeterminate. |
PS_ANIMATED |
The value is animated and should have a green background. |
PS_LOCKED |
The value is locked and cannot be edited. |
Definition at line 998 of file DT_Plugin.h.
Tree nodes
Enumerator | |
---|---|
RS_INVALID | |
RS_ALPHANUM | |
RS_OPNAME | |
RS_ANY |
Definition at line 924 of file DT_Plugin.h.
DT_Plugin::DT_Plugin | ( | DT_Host & | host | ) |
|
virtual |
|
inlinevirtual |
Check if the node copy operation is valid for this plugin.
Definition at line 954 of file DT_Plugin.h.
|
inlinevirtual |
The node delete operation is valid for this plugin.
Definition at line 946 of file DT_Plugin.h.
|
inlinevirtual |
Check if the reviously copied nodes can be pasted into the given parent.
Definition at line 963 of file DT_Plugin.h.
|
inlinevirtual |
Called when a request to copy occurs.
Definition at line 959 of file DT_Plugin.h.
|
staticprotected |
|
inlinevirtual |
Called when a request for delete occurs.
Definition at line 950 of file DT_Plugin.h.
|
inlinevirtual |
|
inlinevirtual |
Drop Receiver.
Definition at line 1140 of file DT_Plugin.h.
|
inlinevirtual |
|
pure virtual |
Get the children of the given node.
For dealing with DT_ParmDefGrouped parameters, this method controls which grouped DT_ParmDef should be displayed for a particular DT_Node.
Definition at line 1013 of file DT_Plugin.h.
|
inlinevirtual |
Get the info text to show in the MMB popup window.
Definition at line 941 of file DT_Plugin.h.
|
inlinevirtual |
Called when the right mouse-button (RMB) is clicked on a node. The entire node selection is passed in, allowing to create a combined menu for all selected nodes. When retrieving the top-level menu, sub_menu_token
will be NULL
.
Definition at line 982 of file DT_Plugin.h.
|
virtual |
Returns the list of parameter definitions for the tree columns.
User-modifiable Plugin Options
|
inlinevirtual |
For DT_ParmDefMenu items that are defined as dynamic, this function returns the list of menu items based on the current state.
Definition at line 1101 of file DT_Plugin.h.
Gets a value for a given option from the plugin. See getParameterValue
parm_id | The id of the parameter. Corresponds to the return value of DT_ParmDef::id. |
value | The value returned from the plugin. |
true
if successful, false
otherwise. Definition at line 1092 of file DT_Plugin.h.
|
pure virtual |
Returns the list of parameter definitions for the tree columns.
|
inlinevirtual |
For DT_ParmDefMenu items that are defined as dynamic, this function can be used to return a list of menu items based on the specific node, or the current state of other parameters.
Definition at line 1053 of file DT_Plugin.h.
|
pure virtual |
Retrieve a value of a specific parameter for the given node. The parm_id is the value returned from DT_ParmDef::id(). The for_feel flag indicates if we are fetching this value to set up our UI_Feel when the mouse moves over this cell.
Use the copyValue function for each function definition to retrieve a concrete values from the opaque DT_Value type. The caller expects DT_Value to be able to cast to specific types to retrieve the display value. Use the following table, based on the parm def type:
A return value of PS_INDETERMINATE
should only be returned if the parameter definition supports it, otherwise it is ignored. Return PS_INVALID
if no value can be retrieved from the node.
|
inlinevirtual |
The node rename operation is valid for this plugin.
Definition at line 971 of file DT_Plugin.h.
|
inlinevirtual |
Selection Called when a node queries for its selection state. If the selection state can be computed, the selection state is returned through the argument 'state' and a value of true returned. Return false if the selection can not be computed, or not supported. In that case, if DT_Node::opId returns a valid id, the op node is queried for its selection state.
Definition at line 1068 of file DT_Plugin.h.
|
inlinevirtual |
Returns true if the parent node potentially has children. False positives are much better than false negatives.
Definition at line 937 of file DT_Plugin.h.
|
pure virtual |
Returns the help ID to be used when the user clicks on the help button in the Data Tree pane. By default it just returns the base help for the Data Tree.
|
inline |
Returns the DT_DT_HostInterface object which can be used to communicate with the host to notify of dirty nodes, parameter changes, global option changes, etc.
Definition at line 906 of file DT_Plugin.h.
|
pure virtual |
Methods to be implemented by the plugin. Returns the display name of the data tree plugin. This will be shown in the list of available plugins in the data tree pane.
|
inlinevirtual |
When drag and drop is used to reorder child nodes, we get notified through this function.
Definition at line 1155 of file DT_Plugin.h.
|
inlinevirtual |
Events Called when an operator event has occurred. All nodes that have an interest in a given operator are in the array. See OP_EventType for explanation of what the data
pointer contains.
Definition at line 1112 of file DT_Plugin.h.
|
inlinevirtual |
Called when a request to paste into a parent node occurs.
Definition at line 967 of file DT_Plugin.h.
|
inlinevirtual |
Persistence When the desktop is saved, this method is called to allow the plugin to save any data that would not be saved otherwise.
Definition at line 1169 of file DT_Plugin.h.
|
inlinevirtual |
Persistence When the desktop is saved, this method is called to allow the plugin to save any data that would not be saved otherwise.
Definition at line 1175 of file DT_Plugin.h.
|
inlinevirtual |
Called when a request for node rename occurs.
Definition at line 975 of file DT_Plugin.h.
|
inline |
Methods provided by the plugin architecture.
Definition at line 901 of file DT_Plugin.h.
|
protected |
Only subclasses can access a non-const version of our root DT_Node.
|
inlinevirtual |
Called by the host when it is time to run a delayed action that was added with DT_Host::addDelayedAction. Multiple delayed actions are coalesced into one call, hence the list of data.
Definition at line 1120 of file DT_Plugin.h.
|
inlinevirtual |
Perform the menu action specified by the user. The menu_token
argument will be the token of the menu item that the user selected. The node list will be the same as was passed into getNodeMenu
.
Definition at line 990 of file DT_Plugin.h.
Sets an option value for the plugin.
Definition at line 1096 of file DT_Plugin.h.
|
pure virtual |
Sets the value of a specific parameter for the given node. The parm_id is the value returned from DT_ParmDef::id() See the table for getValue for which C++ types should be expected for a given parameter definition type.
|
virtual |
Sets the same value of a specific parameter on multiple nodes. This can be used to optimize costly operations, or support exclusivity. The first node in the list is the node for who the user set the value on. The parm_id is the value returned from DT_ParmDef::id()
|
inlinevirtual |
Called when a node is selected or de-selected in the UI. The requested selection state is given by the 'state' argument. If the selection is handled, a value of true
should be returned. Otherwise, return a value of false
. In that case, if DT_Node::opId returns a valid id, the op node is selected.
Definition at line 1076 of file DT_Plugin.h.
|
inlinevirtual |
Persistence When the desktop is saved, this method is called to allow the plugin to save any data that would not be saved otherwise.
Definition at line 1166 of file DT_Plugin.h.
|
inlinevirtual |
Persistence When the desktop is saved, this method is called to allow the plugin to save any data that would not be saved otherwise.
Definition at line 1172 of file DT_Plugin.h.