HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
UN_Node Class Reference

#include <UN_Node.h>

+ Inheritance diagram for UN_Node:

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_StringHolderparmNames () 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_StringHolderportNames (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_StringHolderinputPortNames () 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_StringHolderoutputPortNames () 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_StringHolderchildNames () 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_Nodeoperator= (const UN_Node &)
 Default constructors and assignment operators. More...
 
UN_Nodeoperator= (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_StringHoldername () 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_StringHoldertypeName () 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_StringHoldercategoryName () 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_Handleoperator= (const UN_Handle &)=default
 Default destructor, constructors and assignment operators. More...
 
UN_Handleoperator= (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
 

Detailed Description

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.

Definition at line 51 of file UN_Node.h.

Member Typedef Documentation

An iterator and a range for the children of this parent node.

Definition at line 244 of file UN_Node.h.

Definition at line 245 of file UN_Node.h.

An iterator and a range for the connection wires between immediate children inside this node. (And also direct wires between inputs and outputs on this node).

Definition at line 263 of file UN_Node.h.

An iterator and a range for the descendants (children, grandchildren, etc) of this ancestor node.

Definition at line 252 of file UN_Node.h.

An iterator and a range for the connection wires between the descendants inside this node. (And also direct wires between inputs and outputs on this node).

Definition at line 275 of file UN_Node.h.

An iterator and a range for parameters that belong to this node.

Definition at line 126 of file UN_Node.h.

Definition at line 127 of file UN_Node.h.

And iterator and a range for ports that belong to this node.

Definition at line 149 of file UN_Node.h.

Definition at line 150 of file UN_Node.h.

Constructor & Destructor Documentation

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.

Member Function Documentation

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.

Parameters
child_name- The name of the node that uniquely identifies it among other children inside this network.
UN_Port UN_Node::createInputPort ( const UT_StringRef port_name,
const UT_StringRef port_type_name = UN_UNDEFINED_PORT_TYPE_NAME.asRef() 
) const
inline

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

Definition at line 159 of file UN_Node.h.

UN_Port UN_Node::createOutputPort ( const UT_StringRef port_name,
const UT_StringRef port_type_name = UN_UNDEFINED_PORT_TYPE_NAME.asRef() 
) const
inline

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

Definition at line 191 of file UN_Node.h.

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.

UN_Port UN_Node::findInputPort ( const UT_StringRef port_name) const
inline

Returns a input port by the given name, or null if not found.

Definition at line 169 of file UN_Node.h.

UN_Port UN_Node::findOutputPort ( const UT_StringRef port_name) const
inline

Returns an output port by the given name, or null if not found.

Definition at line 200 of file UN_Node.h.

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.

UT_Array< UT_StringHolder > UN_Node::inputPortNames ( ) const
inline

Returns the names of the node input ports.

Definition at line 173 of file UN_Node.h.

PortRange UN_Node::inputPortRange ( ) const
inline

Returns a range for iterating over node input ports.

Definition at line 177 of file UN_Node.h.

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.

UN_NodeData* UN_Node::nodeData ( ) const
protected

The node data container for all the nodes in the graph.

UN_NodeID UN_Node::nodeID ( ) const
inline

Returns the unique ID of the node data this handle refers to.

Definition at line 292 of file UN_Node.h.

UN_Node::operator bool ( ) const
inlineexplicit

Returns true if this is a valid node; false otherwise.

Definition at line 69 of file UN_Node.h.

bool UN_Node::operator!= ( const UN_Node other) const
inline

Comparison operators.

Definition at line 77 of file UN_Node.h.

UN_Node& UN_Node::operator= ( const UN_Node )

Default constructors and assignment operators.

UN_Node& UN_Node::operator= ( UN_Node &&  )

Default constructors and assignment operators.

bool UN_Node::operator== ( const UN_Node other) const
inline

Comparison operators.

Definition at line 75 of file UN_Node.h.

UT_Array< UT_StringHolder > UN_Node::outputPortNames ( ) const
inline

Returns the names of the node output ports.

Definition at line 204 of file UN_Node.h.

PortRange UN_Node::outputPortRange ( ) const
inline

Returns a range for iterating over node output ports.

Definition at line 208 of file UN_Node.h.

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.


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