HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
UN_NodeUtils Namespace Reference

Classes

class  DescendantNodeIterator
 
class  DescendantWireIterator
 An iterator for traversing the wires deep inside the given node. More...
 

Typedefs

using ParmIterator = UN_ParmIDList::const_iterator
 
using ParmRange = UT_IteratorRange< ParmIterator >
 
using PortIterator = UN_PortIDList::const_iterator
 An iterator and a range for iterating over node port IDs. More...
 
using PortRange = UT_IteratorRange< PortIterator >
 
using PortReverseIterator = UN_PortIDList::const_reverse_iterator
 
using PortReverseRange = UT_IteratorRange< PortReverseIterator >
 
using ChildNodeIterator = UN_NodeIDList::const_iterator
 An iterator and a range for iterating over child node IDs. More...
 
using ChildNodeRange = UT_IteratorRange< ChildNodeIterator >
 
using DescendantNodeRange = UT_IteratorRange< DescendantNodeIterator >
 A range for traversing the descendant nodes of a given ancestor node. More...
 
using ChildWireIterator = UN_WireIDList::const_iterator
 A range for traversing the wires contained directly inside a node. More...
 
using ChildWireRange = UT_IteratorRange< ChildWireIterator >
 
using DescendantWireRange = UT_IteratorRange< DescendantWireIterator >
 

Functions

UN_API UT_StringHolder path (const UN_GraphData *graph_data, UN_NodeID node_id)
 Returns the node path. More...
 
UN_API UN_ParmID createParm (UN_GraphData *graph_data, UN_NodeID node_id, const UT_StringRef &parm_name, const UT_StringRef &parm_type_name=UN_UNDEFINED_PARM_TYPE_NAME.asRef())
 
UN_API UT_Array< UT_StringHolderparmNames (const UN_GraphData *graph_data, UN_NodeID node_id)
 Returns the names of the node parameters. More...
 
UN_API UT_Array< UT_StringHolderparmTypeNames (const UN_GraphData *graph_data, UN_NodeID node_id)
 Returns the type names of the node parameters. More...
 
UN_API UN_PortID createPort (UN_GraphData *graph_data, UN_NodeID node_id, UN_PortKind port_kind, const UT_StringRef &port_name, const UT_StringRef &port_type_name=UN_UNDEFINED_PORT_TYPE_NAME.asRef(), const UT_StringRef &port_label=UT_StringRef(), const UT_Optional< exint > &index=std::nullopt)
 
UN_API UT_Array< UT_StringHolderportNames (const UN_GraphData *graph_data, UN_NodeID node_id, UN_PortKind port_kind)
 Returns the names of the node ports of a given kind. More...
 
UN_API UT_Array< UT_StringHolderportTypeNames (const UN_GraphData *graph_data, UN_NodeID node_id, UN_PortKind port_kind)
 Returns the type names of the node ports of a given kind. More...
 
UN_API bool isAnyInputPortConnectedToSrc (const UN_GraphData *graph_data, UN_NodeID node_id)
 
UN_API bool isAnyOutputPortConnectedToDst (const UN_GraphData *graph_data, UN_NodeID node_id)
 
UN_API UT_StringHolder findValidUniqueChildNodeName (const UN_GraphData *graph_data, UN_NodeID node_id, const UT_StringRef &child_name=UT_StringRef())
 
UN_API UN_NodeID createChildNode (UN_GraphData *graph_data, UN_NodeID parent_id, const UT_StringRef &child_name=UT_StringRef(), const UT_StringRef &child_type=UT_StringRef(), const UT_StringRef &child_category=UT_StringRef())
 Creates and returns a new node that is a child of this node. More...
 
UN_API void deleteChildNode (UN_GraphData *graph_data, UN_NodeID parent_id, const UT_StringRef &child_name)
 Deletes the child node from the graph (removing it from this network). More...
 
UN_API UT_Array< UT_StringHolderchildNodeNames (const UN_GraphData *graph_data, UN_NodeID node_id)
 Returns the names of the children nodes of the given parent node. More...
 
UN_API UN_WireIDList srcWires (const UN_GraphData *graph_data, UN_NodeID node_id, UN_PortKind port_kind)
 
UN_API UN_WireIDList dstWires (const UN_GraphData *graph_data, UN_NodeID node_id, UN_PortKind port_kind)
 
UN_API UN_StickyNoteID createChildStickyNote (UN_GraphData *graph_data, UN_NodeID parent_id, const UT_StringRef &sticky_note_name=UT_StringRef(), const UT_StringRef &sticky_note_text=UT_StringRef())
 Creates and returns a new sticky note that is a child of this node. More...
 
UN_API void deleteChildStickyNote (UN_GraphData *graph_data, UN_NodeID parent_id, const UT_StringRef &child_sticky_note_name)
 
UN_API UN_OptionsPtr asOptions (const UN_GraphData *graph_data, UN_NodeID node_id)
 
UN_API void setFromOptions (UN_GraphData *graph_data, UN_NodeID node_id, const UN_Options &node_opts)
 Load and set the node based on the given options. More...
 

Typedef Documentation

using UN_NodeUtils::ChildNodeIterator = typedef UN_NodeIDList::const_iterator

An iterator and a range for iterating over child node IDs.

Definition at line 648 of file UN_NodeUtils.h.

Definition at line 649 of file UN_NodeUtils.h.

using UN_NodeUtils::ChildWireIterator = typedef UN_WireIDList::const_iterator

A range for traversing the wires contained directly inside a node.

Definition at line 845 of file UN_NodeUtils.h.

Definition at line 846 of file UN_NodeUtils.h.

A range for traversing the descendant nodes of a given ancestor node.

Definition at line 763 of file UN_NodeUtils.h.

An range for traversing the wires between the descendants (children, grandchildren, etc) inside a node.

Definition at line 954 of file UN_NodeUtils.h.

using UN_NodeUtils::ParmIterator = typedef UN_ParmIDList::const_iterator

Definition at line 284 of file UN_NodeUtils.h.

Definition at line 285 of file UN_NodeUtils.h.

using UN_NodeUtils::PortIterator = typedef UN_PortIDList::const_iterator

An iterator and a range for iterating over node port IDs.

Definition at line 458 of file UN_NodeUtils.h.

Definition at line 459 of file UN_NodeUtils.h.

using UN_NodeUtils::PortReverseIterator = typedef UN_PortIDList::const_reverse_iterator

An iterator and a range for iterating over node port IDs in reverse order.

Definition at line 492 of file UN_NodeUtils.h.

Function Documentation

UN_API UN_OptionsPtr UN_NodeUtils::asOptions ( const UN_GraphData graph_data,
UN_NodeID  node_id 
)

Returns the options object representing this node. This can be then used for serialization to JSON, etc.

UN_API UT_Array< UT_StringHolder > UN_NodeUtils::childNodeNames ( const UN_GraphData graph_data,
UN_NodeID  node_id 
)

Returns the names of the children nodes of the given parent node.

UN_API UN_NodeID UN_NodeUtils::createChildNode ( UN_GraphData graph_data,
UN_NodeID  parent_id,
const UT_StringRef child_name = UT_StringRef(),
const UT_StringRef child_type = UT_StringRef(),
const UT_StringRef child_category = UT_StringRef() 
)

Creates and returns a new node that is a child of this node.

UN_API UN_StickyNoteID UN_NodeUtils::createChildStickyNote ( UN_GraphData graph_data,
UN_NodeID  parent_id,
const UT_StringRef sticky_note_name = UT_StringRef(),
const UT_StringRef sticky_note_text = UT_StringRef() 
)

Creates and returns a new sticky note that is a child of this node.

UN_API UN_ParmID UN_NodeUtils::createParm ( UN_GraphData graph_data,
UN_NodeID  node_id,
const UT_StringRef parm_name,
const UT_StringRef parm_type_name = UN_UNDEFINED_PARM_TYPE_NAME.asRef() 
)

Adds and returns a new parameter to this node. If another parameter of a given name already exists, returns an invalid parameter, indicating a failure due to the name collision.

UN_API UN_PortID UN_NodeUtils::createPort ( UN_GraphData graph_data,
UN_NodeID  node_id,
UN_PortKind  port_kind,
const UT_StringRef port_name,
const UT_StringRef port_type_name = UN_UNDEFINED_PORT_TYPE_NAME.asRef(),
const UT_StringRef port_label = UT_StringRef(),
const UT_Optional< exint > &  index = std::nullopt 
)

Adds a new port to this node and returns its ID. If another port of a given name already exists, returns an invalid port, indicating a failure due to the name collision.

UN_API void UN_NodeUtils::deleteChildNode ( UN_GraphData graph_data,
UN_NodeID  parent_id,
const UT_StringRef child_name 
)

Deletes the child node from the graph (removing it from this network).

UN_API void UN_NodeUtils::deleteChildStickyNote ( UN_GraphData graph_data,
UN_NodeID  parent_id,
const UT_StringRef child_sticky_note_name 
)

Deletes the child sticky note from the graph (removing it from this network).

UN_API UN_WireIDList UN_NodeUtils::dstWires ( const UN_GraphData graph_data,
UN_NodeID  node_id,
UN_PortKind  port_kind 
)

Returns the destination wires connected to the of all the ports of the given kind on the given node. Destination wires carry data from the given node.

UN_API UT_StringHolder UN_NodeUtils::findValidUniqueChildNodeName ( const UN_GraphData graph_data,
UN_NodeID  node_id,
const UT_StringRef child_name = UT_StringRef() 
)

Returns a node name that is not taken by any of this nodes' children, given the suggested candidate child name.

UN_API bool UN_NodeUtils::isAnyInputPortConnectedToSrc ( const UN_GraphData graph_data,
UN_NodeID  node_id 
)

Returns true if any of the node's input ports has a connected source wire (feeding data from a source port).

UN_API bool UN_NodeUtils::isAnyOutputPortConnectedToDst ( const UN_GraphData graph_data,
UN_NodeID  node_id 
)

Returns true if any of the node's output ports has a connected destination wire feeding data to a destination port.

UN_API UT_Array< UT_StringHolder > UN_NodeUtils::parmNames ( const UN_GraphData graph_data,
UN_NodeID  node_id 
)

Returns the names of the node parameters.

UN_API UT_Array< UT_StringHolder > UN_NodeUtils::parmTypeNames ( const UN_GraphData graph_data,
UN_NodeID  node_id 
)

Returns the type names of the node parameters.

UN_API UT_StringHolder UN_NodeUtils::path ( const UN_GraphData graph_data,
UN_NodeID  node_id 
)

Returns the node path.

UN_API UT_Array< UT_StringHolder > UN_NodeUtils::portNames ( const UN_GraphData graph_data,
UN_NodeID  node_id,
UN_PortKind  port_kind 
)

Returns the names of the node ports of a given kind.

UN_API UT_Array< UT_StringHolder > UN_NodeUtils::portTypeNames ( const UN_GraphData graph_data,
UN_NodeID  node_id,
UN_PortKind  port_kind 
)

Returns the type names of the node ports of a given kind.

UN_API void UN_NodeUtils::setFromOptions ( UN_GraphData graph_data,
UN_NodeID  node_id,
const UN_Options node_opts 
)

Load and set the node based on the given options.

UN_API UN_WireIDList UN_NodeUtils::srcWires ( const UN_GraphData graph_data,
UN_NodeID  node_id,
UN_PortKind  port_kind 
)

Returns the source wires connected to all of the ports of the given kind on the given node. Source wires carry data to the given node.