HDK
|
#include <UN_Node.h>
Public Types | |
using | ParmIterator = UN_DataArrayIterator< UN_Parm, UN_ParmIDList > |
An iterator and a range for parameters that belong to this node. More... | |
using | ParmRange = UT_IteratorRange< ParmIterator > |
using | PortIterator = UN_DataArrayIterator< UN_Port, UN_PortIDList > |
And iterator and a range for ports that belong to this node. More... | |
using | PortRange = UT_IteratorRange< PortIterator > |
using | ChildIterator = UN_DataArrayIterator< UN_Node, UN_NodeIDList > |
An iterator and a range for the children of this parent node. More... | |
using | ChildRange = UT_IteratorRange< ChildIterator > |
using | DescendantIterator = UN_NodeDescendantIterator |
using | DescendantRange = UT_IteratorRange< DescendantIterator > |
using | ChildWireIterator = UN_NodeWireIterator< true > |
using | ChildWireRange = UT_IteratorRange< ChildWireIterator > |
using | DescendantWireIterator = UN_NodeWireIterator< false > |
using | DescendantWireRange = UT_IteratorRange< DescendantWireIterator > |
Public Member Functions | |
UN_Node (UN_GraphData *graph_data, UN_NodeID node_id) | |
Convenience constructor for the node handle. More... | |
UN_Graph | graph () const |
Returns the graph which owns this node. More... | |
UN_Node | parent () const |
Returns the parent of this node. More... | |
void | destroy () const |
Deletes this node from the graph. More... | |
UN_Parm | createParm (const UT_StringRef &parm_name, const UT_StringRef &parm_type_name=UN_UNDEFINED_PARM_TYPE_NAME.asRef()) const |
UN_Parm | findParm (const UT_StringRef &parm_name) const |
Returns a parameter by the given name, or null if not found. More... | |
UT_Array< UT_StringHolder > | parmNames () const |
Returns the names of the node parameters. More... | |
ParmRange | parmRange () const |
Returns a range for iterating over node parameters. More... | |
UN_Port | createPort (UN_PortKind port_kind, const UT_StringRef &port_name, const UT_StringRef &port_type_name=UN_UNDEFINED_PORT_TYPE_NAME.asRef()) const |
UN_Port | findPort (UN_PortKind port_kind, const UT_StringRef &port_name) const |
Returns a input port by the given name, or null if not found. More... | |
UT_Array< UT_StringHolder > | portNames (UN_PortKind port_kind) const |
Returns the names of the node ports of a given kind. More... | |
PortRange | portRange (UN_PortKind port_kind) const |
Returns a range for iterating over node input ports. More... | |
UN_Port | createInputPort (const UT_StringRef &port_name, const UT_StringRef &port_type_name=UN_UNDEFINED_PORT_TYPE_NAME.asRef()) const |
UN_Port | findInputPort (const UT_StringRef &port_name) const |
Returns a input port by the given name, or null if not found. More... | |
UT_Array< UT_StringHolder > | inputPortNames () const |
Returns the names of the node input ports. More... | |
PortRange | inputPortRange () const |
Returns a range for iterating over node input ports. More... | |
bool | hasAnyInputPortSrcWires () const |
UN_Port | createOutputPort (const UT_StringRef &port_name, const UT_StringRef &port_type_name=UN_UNDEFINED_PORT_TYPE_NAME.asRef()) const |
UN_Port | findOutputPort (const UT_StringRef &port_name) const |
Returns an output port by the given name, or null if not found. More... | |
UT_Array< UT_StringHolder > | outputPortNames () const |
Returns the names of the node output ports. More... | |
PortRange | outputPortRange () const |
Returns a range for iterating over node output ports. More... | |
bool | hasAnyOutputPortDstWires () const |
UT_StringHolder | findUniqueChildName (const UT_StringRef &name) const |
Returns a node name that is not taken by any of this nodes' children. More... | |
UN_Node | createChild (const UT_StringRef &child_name=UT_StringRef(), const UT_StringRef &child_type=UT_StringRef(), const UT_StringRef &child_category=UT_StringRef()) const |
UN_Node | findChild (const UT_StringRef &child_name) const |
void | deleteChild (const UT_StringRef &child_name) const |
Removes and deletes the child node from this network. More... | |
bool | isSubnet () const |
Returns true if the node can have child nodes inside. More... | |
UT_Array< UT_StringHolder > | childNames () const |
Returns the names of the node children nodes. More... | |
ChildRange | childRange () const |
Returns a range for iterating over node's immediate children. More... | |
DescendantRange | descendantRange () const |
ChildWireRange | childWireRange () const |
DescendantWireRange | descendantWireRange () const |
UT_Options | asOptions () const |
void | setFromOptions (const UT_Options &node_opts) const |
Configure the node based on the given options. More... | |
UN_NodeID | nodeID () const |
Returns the unique ID of the node data this handle refers to. More... | |
UN_Node () | |
Default constructors and assignment operators. More... | |
~UN_Node () | |
Default constructors and assignment operators. More... | |
UN_Node (const UN_Node &) | |
Default constructors and assignment operators. More... | |
UN_Node (UN_Node &&) | |
Default constructors and assignment operators. More... | |
UN_Node & | operator= (const UN_Node &) |
Default constructors and assignment operators. More... | |
UN_Node & | operator= (UN_Node &&) |
Default constructors and assignment operators. More... | |
bool | isValid () const |
Returns true if this is a valid node; false otherwise. More... | |
operator bool () const | |
Returns true if this is a valid node; false otherwise. More... | |
bool | operator== (const UN_Node &other) const |
Comparison operators. More... | |
bool | operator!= (const UN_Node &other) const |
Comparison operators. More... | |
const UT_StringHolder & | name () const |
The node name that differentiates it among its siblings. More... | |
void | setName (const UT_StringRef &name) const |
The node name that differentiates it among its siblings. More... | |
const UT_StringHolder & | typeName () const |
The node's type that determines its functional behavour. More... | |
void | setTypeName (const UT_StringRef &type_name) const |
The node's type that determines its functional behavour. More... | |
const UT_StringHolder & | categoryName () const |
void | setCategoryName (const UT_StringRef &category) const |
Public Member Functions inherited from UN_Handle | |
UN_Handle (UN_GraphData *graph_data, UN_DataID data_id) | |
Convenience constructor. More... | |
UN_Handle () | |
Default constructor. More... | |
UN_DataID | dataID () const |
~UN_Handle ()=default | |
Default destructor, constructors and assignment operators. More... | |
UN_Handle (const UN_Handle &)=default | |
Default destructor, constructors and assignment operators. More... | |
UN_Handle (UN_Handle &&)=default | |
Default destructor, constructors and assignment operators. More... | |
UN_Handle & | operator= (const UN_Handle &)=default |
Default destructor, constructors and assignment operators. More... | |
UN_Handle & | operator= (UN_Handle &&)=default |
Default destructor, constructors and assignment operators. More... | |
bool | operator== (const UN_Handle &other) const |
Comparison operators. More... | |
bool | operator!= (const UN_Handle &other) const |
Comparison operators. More... | |
Protected Member Functions | |
UN_NodeData * | nodeData () const |
The node data container for all the nodes in the graph. More... | |
Protected Member Functions inherited from UN_Handle | |
UN_GraphData * | graphData () const |
A light-weight handle for a node data.
The actual node data is owned and managed by UN_GraphData. UN_Node serves as a handle for clients to refer to that node data.
using UN_Node::ChildIterator = UN_DataArrayIterator< UN_Node, UN_NodeIDList > |
using UN_Node::ChildRange = UT_IteratorRange< ChildIterator > |
using UN_Node::ChildWireIterator = UN_NodeWireIterator< true > |
using UN_Node::DescendantWireIterator = UN_NodeWireIterator< false > |
using UN_Node::ParmIterator = UN_DataArrayIterator< UN_Parm, UN_ParmIDList > |
using UN_Node::ParmRange = UT_IteratorRange< ParmIterator > |
using UN_Node::PortIterator = UN_DataArrayIterator< UN_Port, UN_PortIDList > |
using UN_Node::PortRange = UT_IteratorRange< PortIterator > |
UN_Node::UN_Node | ( | UN_GraphData * | graph_data, |
UN_NodeID | node_id | ||
) |
Convenience constructor for the node handle.
UN_Node::UN_Node | ( | ) |
Default constructors and assignment operators.
UN_Node::~UN_Node | ( | ) |
Default constructors and assignment operators.
UN_Node::UN_Node | ( | const UN_Node & | ) |
Default constructors and assignment operators.
UN_Node::UN_Node | ( | UN_Node && | ) |
Default constructors and assignment operators.
UT_Options UN_Node::asOptions | ( | ) | const |
Returns the options object representing this node. This can be then used for serialization to JSON, etc.
const UT_StringHolder& UN_Node::categoryName | ( | ) | const |
Sets and gets the node's category that groups it with other nodes that are operationally compatible (and connectable).
UT_Array< UT_StringHolder > UN_Node::childNames | ( | ) | const |
Returns the names of the node children nodes.
ChildRange UN_Node::childRange | ( | ) | const |
Returns a range for iterating over node's immediate children.
ChildWireRange UN_Node::childWireRange | ( | ) | const |
Returns a range for iterating over the connection wires between this node's immediate children. (And also direct wires between inputs and outputs on this node).
UN_Node UN_Node::createChild | ( | const UT_StringRef & | child_name = UT_StringRef() , |
const UT_StringRef & | child_type = UT_StringRef() , |
||
const UT_StringRef & | child_category = UT_StringRef() |
||
) | const |
Creates and returns a new node that is a child of this node.
child_name | - The name of the node that uniquely identifies it among other children inside this network. |
|
inline |
|
inline |
UN_Parm UN_Node::createParm | ( | const UT_StringRef & | parm_name, |
const UT_StringRef & | parm_type_name = UN_UNDEFINED_PARM_TYPE_NAME.asRef() |
||
) | const |
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_Port UN_Node::createPort | ( | UN_PortKind | port_kind, |
const UT_StringRef & | port_name, | ||
const UT_StringRef & | port_type_name = UN_UNDEFINED_PORT_TYPE_NAME.asRef() |
||
) | const |
Adds and returns a new port to this node. If another port of a given kind and name already exists, returns an invalid port, indicating a failure due to the name collision.
void UN_Node::deleteChild | ( | const UT_StringRef & | child_name | ) | const |
Removes and deletes the child node from this network.
DescendantRange UN_Node::descendantRange | ( | ) | const |
Returns a range for iterating over nodes's descendants (ie, children, and their grand children, etc).
DescendantWireRange UN_Node::descendantWireRange | ( | ) | const |
Returns a range for iterating over the connection wires between this node's descendants (ie, its children and grandchildren, etc). (And also direct wires between inputs and outputs on this node).
void UN_Node::destroy | ( | ) | const |
Deletes this node from the graph.
UN_Node UN_Node::findChild | ( | const UT_StringRef & | child_name | ) | const |
Returns the child node by the given name. Note, the return object may be invalid if no such child node was found.
|
inline |
|
inline |
UN_Parm UN_Node::findParm | ( | const UT_StringRef & | parm_name | ) | const |
Returns a parameter by the given name, or null if not found.
UN_Port UN_Node::findPort | ( | UN_PortKind | port_kind, |
const UT_StringRef & | port_name | ||
) | const |
Returns a input port by the given name, or null if not found.
UT_StringHolder UN_Node::findUniqueChildName | ( | const UT_StringRef & | name | ) | const |
Returns a node name that is not taken by any of this nodes' children.
UN_Graph UN_Node::graph | ( | ) | const |
Returns the graph which owns this node.
bool UN_Node::hasAnyInputPortSrcWires | ( | ) | const |
Returns true if any of the node's input ports has a connected source wire feeding data from a source port. In other words, if the node is not a leaf in the tree formed by input chains in the subnet, ie, the node is not an original data source in the subnet.
bool UN_Node::hasAnyOutputPortDstWires | ( | ) | const |
Returns true if any of the node's output ports has a connected destination wire feeding data to a destination port. In other woreds, if the node is not a terminal node, ie, if the node is not a root in a tree formed by the input chains in the subnet.
|
inline |
|
inline |
bool UN_Node::isSubnet | ( | ) | const |
Returns true if the node can have child nodes inside.
bool UN_Node::isValid | ( | ) | const |
Returns true if this is a valid node; false otherwise.
const UT_StringHolder& UN_Node::name | ( | ) | const |
The node name that differentiates it among its siblings.
|
protected |
The node data container for all the nodes in the graph.
|
inline |
|
inlineexplicit |
|
inline |
|
inline |
|
inline |
|
inline |
UN_Node UN_Node::parent | ( | ) | const |
Returns the parent of this node.
UT_Array< UT_StringHolder > UN_Node::parmNames | ( | ) | const |
Returns the names of the node parameters.
ParmRange UN_Node::parmRange | ( | ) | const |
Returns a range for iterating over node parameters.
UT_Array< UT_StringHolder > UN_Node::portNames | ( | UN_PortKind | port_kind | ) | const |
Returns the names of the node ports of a given kind.
PortRange UN_Node::portRange | ( | UN_PortKind | port_kind | ) | const |
Returns a range for iterating over node input ports.
void UN_Node::setCategoryName | ( | const UT_StringRef & | category | ) | const |
Sets and gets the node's category that groups it with other nodes that are operationally compatible (and connectable).
void UN_Node::setFromOptions | ( | const UT_Options & | node_opts | ) | const |
Configure the node based on the given options.
void UN_Node::setName | ( | const UT_StringRef & | name | ) | const |
The node name that differentiates it among its siblings.
void UN_Node::setTypeName | ( | const UT_StringRef & | type_name | ) | const |
The node's type that determines its functional behavour.
const UT_StringHolder& UN_Node::typeName | ( | ) | const |
The node's type that determines its functional behavour.