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

#include <UN_GraphData.h>

Public Member Functions

 UN_GraphData (UN_GraphContext context=UN_GraphContext())
 Constructor. More...
 
 UN_GraphData (UN_GraphData &&other)
 
UN_GraphDataoperator= (UN_GraphData &&other)
 
const UN_GraphContextcontext () const
 Returns the graph context used by this graph. More...
 
void clearData (bool reset_ids=false)
 
UN_OptionsPtr asOptions () const
 Returns options that represent this graph. More...
 
UN_NodeID rootNode () const
 
bool isValidNodeName (const UT_StringRef &name) const
 Returns true if the given name can be used for naming a node. More...
 
UT_StringHolder findValidChildItemName (const UT_StringRef &child_name, bool force_valid_name, bool force_unique_name, UN_NodeID parent_node, const UT_StringRef &default_name=UT_StringRef()) const
 
UN_NodeID createNode (UN_NodeID parent_node, const UT_StringRef &name=UT_StringRef(), const UT_StringRef &type=UT_StringRef(), const UT_StringRef &category=UT_StringRef(), const UT_StringRef &signature=UT_StringRef())
 Creates a new node by the given name with the given parent. More...
 
const UN_NodeTypenodeType (UN_NodeID node_id) const
 Returns the node type object for the given node, or null if unavailable. More...
 
void setNodeName (UN_NodeID node_id, const UT_StringRef &name)
 Sets the name of the given node. More...
 
void setNodeSignature (UN_NodeID node_id, const UT_StringRef &signature_name)
 Sets the signature for the given node. More...
 
const UT_StringArraynodeSignatureNames (UN_NodeID node_id) const
 Returns the list of the signature names provided for the given node. More...
 
void deleteNode (UN_NodeID node)
 Deletes the node given its index. More...
 
void clearNode (UN_NodeID node)
 
void mergeNode (UN_NodeID node, const UN_Options &node_opts)
 
UN_OptionsPtr nodeAsOptions (UN_NodeID node) const
 Returns the representation of a node as options given its data index. More...
 
UN_NodeID nonRootParent (UN_NodeID child) const
 
bool isSubnet (UN_NodeID node) const
 Returns true if the given node is a subnet (ie, can have children). More...
 
UN_SubnetData::IDRange allSubnets () const
 Returns an ID iterator range for all the valid subnets in the graph. More...
 
void moveNode (UN_NodeID node, UN_NodeID new_parent)
 Moves a node from one parent to another. More...
 
void moveAllChildNodes (UN_NodeID old_parent, UN_NodeID new_parent)
 Moves all children of the given parent node to another one. More...
 
UN_DataSize nodeCount () const
 Returns the number of all nodes in the graph. More...
 
UN_NodeData::IDRange allNodes () const
 Returns a node ID iterator range for all the valid nodes in the graph. More...
 
UN_DataSize wireCount () const
 Returns the number of all wires in the graph. More...
 
UN_WireData::IDRange allWires () const
 Returns a wire ID iterator range for all the valid wires in the graph. More...
 
UN_ParmID createParm (UN_NodeID node, const UT_StringRef &name=UT_StringRef(), const UT_StringRef &type_name=UT_StringRef())
 Creates a parameter data object, and returns its index. More...
 
void deleteParm (UN_ParmID parm)
 Deletes the parameter. More...
 
const UN_ParmIDList & parms (UN_NodeID node) const
 Returns the parameters of the given node. More...
 
UN_ParmID parm (UN_NodeID node, const UT_StringRef &parm_name) const
 Returns the parameter of a given name on a given node. More...
 
UN_NodeID node (UN_ParmID parm) const
 Returns the owner node of the given parameter. More...
 
UN_PortID createPort (UN_NodeID node, UN_PortKind kind, const UT_StringRef &name=UT_StringRef(), const UT_StringRef &type_name=UT_StringRef(), const UT_StringRef &label=UT_StringRef(), const UT_Optional< exint > &index=std::nullopt)
 
void setPortName (UN_PortID port_id, const UT_StringRef &name)
 Sets the name of the given port. More...
 
void deletePort (UN_PortID port)
 Deletes the port. More...
 
UN_DataSize portCount () const
 Returns the number of all ports in the graph. More...
 
UN_PortData::IDRange allPorts () const
 Returns a port ID iterator range for all the valid ports in the graph. More...
 
UN_PortID port (UN_NodeID node, UN_PortKind kind, const UT_StringRef &port_name) const
 Returns the port of a given kind on a given node. More...
 
const UN_PortIDList & ports (UN_NodeID node, UN_PortKind kind) const
 Returns the ports of the given kind for the given node. More...
 
const UN_PortIDList & inputPorts (UN_NodeID node) const
 Returns input ports of the given node. More...
 
const UN_PortIDList & outputPorts (UN_NodeID node) const
 Returns output ports of the given node. More...
 
UN_NodeID node (UN_PortID port) const
 Returns the owner node of the given port. More...
 
UN_WireID connectPorts (UN_PortID src_port, UN_PortID dst_port)
 
void disconnectPorts (UN_PortID src_port, UN_PortID dst_port)
 Removes the wire connection between the two ports. More...
 
const UN_WireIDList & srcWires (UN_PortID port) const
 
const UN_WireIDList & dstWires (UN_PortID port) const
 
UN_WireID createWire (UN_PortID src_port, UN_PortID dst_port)
 Creates a connection wire between the two given ports. More...
 
UN_WireID findWire (UN_PortID src_port, UN_PortID dst_port) const
 
void deleteWire (UN_WireID wire)
 Deletes the wire, effectively disconnecting the ports it connects. More...
 
UN_PortID srcPort (UN_WireID wire) const
 
UN_PortID dstPort (UN_WireID wire) const
 
UN_StickyNoteID createStickyNote (UN_NodeID parent_node, const UT_StringRef &name=UT_StringRef(), const UT_StringRef &text=UT_StringRef())
 Creates and adds a new sticky note to the graph. More...
 
void deleteStickyNote (UN_StickyNoteID sticky_note)
 Deletes the node given its index. More...
 
void setStickyNoteName (UN_StickyNoteID sticky_note, const UT_StringRef &name)
 Sets the name of the given sticky note. More...
 
void merge (const UN_Options &graph_opts)
 
UN_GraphMergeInfo merge (const UN_GraphData &src_graph_data, UN_NodeID root_dst_node=UN_ROOT_NODE_ID)
 
UN_NodeID parent (UN_NodeID child) const
 
UN_NodeID parent (UN_StickyNoteID child) const
 
const UN_NodeIDList & childNodes (UN_NodeID parent) const
 Returns a list of direct children of the given node (subnet). More...
 
const UN_NodeIDList & childNodes (UN_SubnetID parent) const
 Returns a list of direct children of the given node (subnet). More...
 
const UN_WireIDList & childWires (UN_NodeID parent) const
 Returns a list of wires directly inside the given node (subnet). More...
 
const UN_WireIDList & childWires (UN_SubnetID parent) const
 Returns a list of wires directly inside the given node (subnet). More...
 
UN_NodeID findChildNode (UN_NodeID parent, const UT_StringRef &child_name) const
 Returns a node ID of a child in a given subnet given its name. More...
 
UN_StickyNoteID findChildStickyNote (UN_NodeID parent, const UT_StringRef &child_name) const
 Returns a node ID of a child in a given subnet given its name. More...
 
UN_NodeID findNode (UN_NodeID current_node, const UT_StringRef &node_path) const
 
UN_StickyNoteID findStickyNote (UN_NodeID current_node, const UT_StringRef &sticky_note_path) const
 
const UN_StickyNoteIDList & childStickyNotes (UN_NodeID parent) const
 Returns a list of direct children of the given node (subnet). More...
 
const UN_StickyNoteIDList & childStickyNotes (UN_SubnetID parent) const
 Returns a list of direct children of the given node (subnet). More...
 
bool isValid (UN_NodeID node) const
 
bool isValid (UN_SubnetID subnet) const
 
bool isValid (UN_ParmID parm) const
 
bool isValid (UN_PortID port) const
 
bool isValid (UN_WireID wire) const
 
bool isValid (UN_StickyNoteID sticky_note) const
 
UN_NodeDatanodeData ()
 Returns the container of data for the nodes in the graph. More...
 
const UN_NodeDatanodeData () const
 Returns the container of data for the nodes in the graph. More...
 
UN_ParmDataparmData ()
 Returns the container of data for the parameters in the graph. More...
 
const UN_ParmDataparmData () const
 Returns the container of data for the parameters in the graph. More...
 
UN_PortDataportData ()
 Returns the container of data for the ports in the graph. More...
 
const UN_PortDataportData () const
 Returns the container of data for the ports in the graph. More...
 
UN_WireDatawireData ()
 Returns the container of data for the wires in the graph. More...
 
const UN_WireDatawireData () const
 Returns the container of data for the wires in the graph. More...
 
UN_SubnetDatasubnetData ()
 Returns the container of data for the subnets in the graph. More...
 
const UN_SubnetDatasubnetData () const
 Returns the container of data for the subnets in the graph. More...
 
UN_StickyNoteDatastickyNoteData ()
 Returns the container of data for the sticky notes in the graph. More...
 
const UN_StickyNoteDatastickyNoteData () const
 Returns the container of data for the sticky notes in the graph. More...
 
void setWireDrawStyle (UN_WireDrawStyle style)
 Drawing style of the connection wires in the editor. More...
 
UN_WireDrawStyle wireDrawStyle () const
 Drawing style of the connection wires in the editor. More...
 

Protected Member Functions

 UN_GraphData (const UN_GraphData &other)=default
 
UN_GraphDataoperator= (const UN_GraphData &other)=default
 
 UN_GraphData (UN_GraphContext context, UN_CustomNodeDataPtr custom_node_data, UN_CustomParmDataPtr custom_parm_data, UN_CustomPortDataPtr custom_port_data, UN_CustomWireDataPtr custom_wire_data, UN_CustomSubnetDataPtr custom_subnet_data, UN_CustomStickyNoteDataPtr custom_stickynote_data)
 Constructor intended for sub-class graphs that provide custom data. More...
 
const UN_GraphTopologytopology () const
 
UN_SubnetID findOrCreateSubnet (UN_NodeID node)
 
void reorderChildren (UN_SubnetID subnet, const UT_Array< UN_NodeID > &child_order)
 Sets the new order for the children. More...
 
void updateSubnetWires (UN_SubnetID old_subnet)
 
void deleteSubnet (UN_NodeID node)
 Deletes the subnet structure associated with the given (parent) node. More...
 
void deleteSubnet (UN_SubnetID subnet)
 Deletes the subnet structure associated with the given (parent) node. More...
 

Detailed Description

Definition at line 70 of file UN_GraphData.h.

Constructor & Destructor Documentation

UN_GraphData::UN_GraphData ( UN_GraphContext  context = UN_GraphContext())

Constructor.

Parameters
contextThe context that knows about allowed categories, node types, port types, and parm types in this graph. Note, UN_GraphData makes a copy of the passed argument, so that it's not dependent on the lifespan of this arg.
UN_GraphData::UN_GraphData ( UN_GraphData &&  other)

Graph data can be very large, so allow the public to use only cheap move operations.

UN_GraphData::UN_GraphData ( const UN_GraphData other)
protecteddefault

Graph data can be very large, so forbid the public to use the costly copy operations. Knowledgeable friends and derived classes can still use them.

UN_GraphData::UN_GraphData ( UN_GraphContext  context,
UN_CustomNodeDataPtr  custom_node_data,
UN_CustomParmDataPtr  custom_parm_data,
UN_CustomPortDataPtr  custom_port_data,
UN_CustomWireDataPtr  custom_wire_data,
UN_CustomSubnetDataPtr  custom_subnet_data,
UN_CustomStickyNoteDataPtr  custom_stickynote_data 
)
protected

Constructor intended for sub-class graphs that provide custom data.

Member Function Documentation

UN_NodeData::IDRange UN_GraphData::allNodes ( ) const
inline

Returns a node ID iterator range for all the valid nodes in the graph.

Definition at line 260 of file UN_GraphData.h.

UN_PortData::IDRange UN_GraphData::allPorts ( ) const
inline

Returns a port ID iterator range for all the valid ports in the graph.

Definition at line 374 of file UN_GraphData.h.

UN_SubnetData::IDRange UN_GraphData::allSubnets ( ) const
inline

Returns an ID iterator range for all the valid subnets in the graph.

Definition at line 234 of file UN_GraphData.h.

UN_WireData::IDRange UN_GraphData::allWires ( ) const
inline

Returns a wire ID iterator range for all the valid wires in the graph.

Definition at line 276 of file UN_GraphData.h.

UN_OptionsPtr UN_GraphData::asOptions ( ) const

Returns options that represent this graph.

const UN_NodeIDList& UN_GraphData::childNodes ( UN_NodeID  parent) const
inline

Returns a list of direct children of the given node (subnet).

Definition at line 264 of file UN_GraphData.h.

const UN_NodeIDList& UN_GraphData::childNodes ( UN_SubnetID  parent) const
inline

Returns a list of direct children of the given node (subnet).

Definition at line 266 of file UN_GraphData.h.

const UN_StickyNoteIDList& UN_GraphData::childStickyNotes ( UN_NodeID  parent) const
inline

Returns a list of direct children of the given node (subnet).

Definition at line 463 of file UN_GraphData.h.

const UN_StickyNoteIDList& UN_GraphData::childStickyNotes ( UN_SubnetID  parent) const
inline

Returns a list of direct children of the given node (subnet).

Definition at line 465 of file UN_GraphData.h.

const UN_WireIDList& UN_GraphData::childWires ( UN_NodeID  parent) const
inline

Returns a list of wires directly inside the given node (subnet).

Definition at line 280 of file UN_GraphData.h.

const UN_WireIDList& UN_GraphData::childWires ( UN_SubnetID  parent) const
inline

Returns a list of wires directly inside the given node (subnet).

Definition at line 282 of file UN_GraphData.h.

void UN_GraphData::clearData ( bool  reset_ids = false)

Clears the graph, bringing it to an empty state.

Parameters
reset_idsIf true, the next data IDs for nodes, ports, etc will reset to the initial state. This may be useful if a graph loads and clears nodes repeatedly, but has the danger of anyone holding the previous IDs thinking that that data is still valid. So use this option with great caution!
void UN_GraphData::clearNode ( UN_NodeID  node)

Clears node to a pristine state (no parameters or ports), equivalent to node being just created.

UN_WireID UN_GraphData::connectPorts ( UN_PortID  src_port,
UN_PortID  dst_port 
)
inline

Creates a new connection wire between the two ports. Returns the wire data index of the created connection.

Definition at line 404 of file UN_GraphData.h.

const UN_GraphContext& UN_GraphData::context ( ) const
inline

Returns the graph context used by this graph.

Definition at line 91 of file UN_GraphData.h.

UN_NodeID UN_GraphData::createNode ( UN_NodeID  parent_node,
const UT_StringRef name = UT_StringRef(),
const UT_StringRef type = UT_StringRef(),
const UT_StringRef category = UT_StringRef(),
const UT_StringRef signature = UT_StringRef() 
)

Creates a new node by the given name with the given parent.

UN_ParmID UN_GraphData::createParm ( UN_NodeID  node,
const UT_StringRef name = UT_StringRef(),
const UT_StringRef type_name = UT_StringRef() 
)

Creates a parameter data object, and returns its index.

UN_PortID UN_GraphData::createPort ( UN_NodeID  node,
UN_PortKind  kind,
const UT_StringRef name = UT_StringRef(),
const UT_StringRef type_name = UT_StringRef(),
const UT_StringRef label = UT_StringRef(),
const UT_Optional< exint > &  index = std::nullopt 
)

Creates a port, and returns its index.

Parameters
nodeThe owner (parent) node on which the port appears.
kindThe port kind (ie, input or output).
nameThe port name.
type_nameThe name of the port type.
labelThe port label that shows up in the graph editor.
indexThe index at which to insert the port on a node.
UN_StickyNoteID UN_GraphData::createStickyNote ( UN_NodeID  parent_node,
const UT_StringRef name = UT_StringRef(),
const UT_StringRef text = UT_StringRef() 
)

Creates and adds a new sticky note to the graph.

UN_WireID UN_GraphData::createWire ( UN_PortID  src_port,
UN_PortID  dst_port 
)

Creates a connection wire between the two given ports.

void UN_GraphData::deleteNode ( UN_NodeID  node)

Deletes the node given its index.

void UN_GraphData::deleteParm ( UN_ParmID  parm)

Deletes the parameter.

void UN_GraphData::deletePort ( UN_PortID  port)

Deletes the port.

void UN_GraphData::deleteStickyNote ( UN_StickyNoteID  sticky_note)

Deletes the node given its index.

void UN_GraphData::deleteSubnet ( UN_NodeID  node)
protected

Deletes the subnet structure associated with the given (parent) node.

void UN_GraphData::deleteSubnet ( UN_SubnetID  subnet)
protected

Deletes the subnet structure associated with the given (parent) node.

void UN_GraphData::deleteWire ( UN_WireID  wire)

Deletes the wire, effectively disconnecting the ports it connects.

void UN_GraphData::disconnectPorts ( UN_PortID  src_port,
UN_PortID  dst_port 
)

Removes the wire connection between the two ports.

UN_PortID UN_GraphData::dstPort ( UN_WireID  wire) const
inline

Returns the destination port of the given wire. Ie, the port that consumes (receives) the data.

Definition at line 446 of file UN_GraphData.h.

const UN_WireIDList& UN_GraphData::dstWires ( UN_PortID  port) const
inline

Returns destination wires connected to the given port. Ie, connection wires to which this port provides (sends) data.

Definition at line 421 of file UN_GraphData.h.

UN_NodeID UN_GraphData::findChildNode ( UN_NodeID  parent,
const UT_StringRef child_name 
) const

Returns a node ID of a child in a given subnet given its name.

UN_StickyNoteID UN_GraphData::findChildStickyNote ( UN_NodeID  parent,
const UT_StringRef child_name 
) const

Returns a node ID of a child in a given subnet given its name.

UN_NodeID UN_GraphData::findNode ( UN_NodeID  current_node,
const UT_StringRef node_path 
) const

Returns an ID of a node at a given path, or an invalid ID if not found.

current_node - When the given node path is relative, this is the anchor node from which the relative path is followed to find the desired node.

node_path - The node path identifying the node to find. This can be either an absolute path (starting with a slash, '/') or a relative path. In particular, when the node path is just a name, this function will look for a child by that name directly inside the given parent. The path can contain '.' for the current node, and '..' for the parent node.

UN_SubnetID UN_GraphData::findOrCreateSubnet ( UN_NodeID  node)
protected

Returns a subnet for the given (parent) node, either an existing or newly created one.

UN_StickyNoteID UN_GraphData::findStickyNote ( UN_NodeID  current_node,
const UT_StringRef sticky_note_path 
) const

Returns an ID of a node at a given path, or an invalid ID if not found.

current_node - When the given node path is relative, this is the anchor node from which the relative path is followed to find the desired node.

node_path - The node path identifying the node to find. This can be either an absolute path (starting with a slash, '/') or a relative path. In particular, when the node path is just a name, this function will look for a child by that name directly inside the given parent. The path can contain '.' for the current node, and '..' for the parent node.

UT_StringHolder UN_GraphData::findValidChildItemName ( const UT_StringRef child_name,
bool  force_valid_name,
bool  force_unique_name,
UN_NodeID  parent_node,
const UT_StringRef default_name = UT_StringRef() 
) const

Returns a validated name for a graph item (eg, node, sticky note, etc).

Parameters
force_valid_nameIf true, the returned name will have valid characters (C-style variable, ie, alphanum and '_').
force_unique_nameIf true, the teturned name will be unique among the sibling inside the given subnet. The node inside which to check for the unique node name. Used only if force_unique_name is true, otherwise it can be an invalid ID. The default name to use if forcing a valid name, and the child name is an empty string.
UN_WireID UN_GraphData::findWire ( UN_PortID  src_port,
UN_PortID  dst_port 
) const

Returns the wire that connects the two ports, or an invalid wire ID if the ports are not connected.

const UN_PortIDList& UN_GraphData::inputPorts ( UN_NodeID  node) const
inline

Returns input ports of the given node.

Definition at line 390 of file UN_GraphData.h.

bool UN_GraphData::isSubnet ( UN_NodeID  node) const
inline

Returns true if the given node is a subnet (ie, can have children).

Definition at line 230 of file UN_GraphData.h.

bool UN_GraphData::isValid ( UN_NodeID  node) const
inline

Returns true if the given ID refers to a valid entry in the data buffers. Ie, such an item exists and is valid.

Definition at line 472 of file UN_GraphData.h.

bool UN_GraphData::isValid ( UN_SubnetID  subnet) const
inline

Returns true if the given ID refers to a valid entry in the data buffers. Ie, such an item exists and is valid.

Definition at line 474 of file UN_GraphData.h.

bool UN_GraphData::isValid ( UN_ParmID  parm) const
inline

Returns true if the given ID refers to a valid entry in the data buffers. Ie, such an item exists and is valid.

Definition at line 476 of file UN_GraphData.h.

bool UN_GraphData::isValid ( UN_PortID  port) const
inline

Returns true if the given ID refers to a valid entry in the data buffers. Ie, such an item exists and is valid.

Definition at line 478 of file UN_GraphData.h.

bool UN_GraphData::isValid ( UN_WireID  wire) const
inline

Returns true if the given ID refers to a valid entry in the data buffers. Ie, such an item exists and is valid.

Definition at line 480 of file UN_GraphData.h.

bool UN_GraphData::isValid ( UN_StickyNoteID  sticky_note) const
inline

Returns true if the given ID refers to a valid entry in the data buffers. Ie, such an item exists and is valid.

Definition at line 482 of file UN_GraphData.h.

bool UN_GraphData::isValidNodeName ( const UT_StringRef name) const

Returns true if the given name can be used for naming a node.

void UN_GraphData::merge ( const UN_Options graph_opts)

Merges another graph (represented as options) into this one.

Parameters
root_dst_nodeAn existing node in the destination graph to which the source root should map to. Ie, into which node to merge the other (source) graph.
UN_GraphMergeInfo UN_GraphData::merge ( const UN_GraphData src_graph_data,
UN_NodeID  root_dst_node = UN_ROOT_NODE_ID 
)

Merges another graph (represented as options) into this one.

Parameters
root_dst_nodeAn existing node in the destination graph to which the source root should map to. Ie, into which node to merge the other (source) graph.
void UN_GraphData::mergeNode ( UN_NodeID  node,
const UN_Options node_opts 
)

Sets the aspects of the node based on the information given in the options dictionary. Leaves other aspects (not present in opt) intact.

void UN_GraphData::moveAllChildNodes ( UN_NodeID  old_parent,
UN_NodeID  new_parent 
)
inline

Moves all children of the given parent node to another one.

Definition at line 244 of file UN_GraphData.h.

void UN_GraphData::moveNode ( UN_NodeID  node,
UN_NodeID  new_parent 
)
inline

Moves a node from one parent to another.

Definition at line 240 of file UN_GraphData.h.

UN_NodeID UN_GraphData::node ( UN_ParmID  parm) const
inline

Returns the owner node of the given parameter.

Definition at line 335 of file UN_GraphData.h.

UN_NodeID UN_GraphData::node ( UN_PortID  port) const
inline

Returns the owner node of the given port.

Definition at line 398 of file UN_GraphData.h.

UN_OptionsPtr UN_GraphData::nodeAsOptions ( UN_NodeID  node) const

Returns the representation of a node as options given its data index.

UN_DataSize UN_GraphData::nodeCount ( ) const
inline

Returns the number of all nodes in the graph.

Definition at line 253 of file UN_GraphData.h.

UN_NodeData& UN_GraphData::nodeData ( )
inline

Returns the container of data for the nodes in the graph.

Definition at line 488 of file UN_GraphData.h.

const UN_NodeData& UN_GraphData::nodeData ( ) const
inline

Returns the container of data for the nodes in the graph.

Definition at line 490 of file UN_GraphData.h.

const UT_StringArray& UN_GraphData::nodeSignatureNames ( UN_NodeID  node_id) const

Returns the list of the signature names provided for the given node.

const UN_NodeType* UN_GraphData::nodeType ( UN_NodeID  node_id) const

Returns the node type object for the given node, or null if unavailable.

UN_NodeID UN_GraphData::nonRootParent ( UN_NodeID  child) const
inline

Returns a non-root parent node ID of the given child node. Note, for top-level nodes, this will return an invalid node ID, because their parent is the implicitly created graph's root node.

Definition at line 226 of file UN_GraphData.h.

UN_GraphData& UN_GraphData::operator= ( UN_GraphData &&  other)
UN_GraphData& UN_GraphData::operator= ( const UN_GraphData other)
protecteddefault
const UN_PortIDList& UN_GraphData::outputPorts ( UN_NodeID  node) const
inline

Returns output ports of the given node.

Definition at line 394 of file UN_GraphData.h.

UN_NodeID UN_GraphData::parent ( UN_NodeID  child) const
inline

Returns a parent node ID of the given child node. Note, for top-level nodes, this will return a graph's root node.

Definition at line 216 of file UN_GraphData.h.

UN_NodeID UN_GraphData::parent ( UN_StickyNoteID  child) const
inline

Returns a parent node ID of the given child node. Note, for top-level nodes, this will return a graph's root node.

Definition at line 218 of file UN_GraphData.h.

UN_ParmID UN_GraphData::parm ( UN_NodeID  node,
const UT_StringRef parm_name 
) const

Returns the parameter of a given name on a given node.

UN_ParmData& UN_GraphData::parmData ( )
inline

Returns the container of data for the parameters in the graph.

Definition at line 495 of file UN_GraphData.h.

const UN_ParmData& UN_GraphData::parmData ( ) const
inline

Returns the container of data for the parameters in the graph.

Definition at line 497 of file UN_GraphData.h.

const UN_ParmIDList& UN_GraphData::parms ( UN_NodeID  node) const
inline

Returns the parameters of the given node.

Definition at line 327 of file UN_GraphData.h.

UN_PortID UN_GraphData::port ( UN_NodeID  node,
UN_PortKind  kind,
const UT_StringRef port_name 
) const

Returns the port of a given kind on a given node.

UN_DataSize UN_GraphData::portCount ( ) const
inline

Returns the number of all ports in the graph.

Definition at line 370 of file UN_GraphData.h.

UN_PortData& UN_GraphData::portData ( )
inline

Returns the container of data for the ports in the graph.

Definition at line 502 of file UN_GraphData.h.

const UN_PortData& UN_GraphData::portData ( ) const
inline

Returns the container of data for the ports in the graph.

Definition at line 504 of file UN_GraphData.h.

const UN_PortIDList& UN_GraphData::ports ( UN_NodeID  node,
UN_PortKind  kind 
) const
inline

Returns the ports of the given kind for the given node.

Definition at line 382 of file UN_GraphData.h.

void UN_GraphData::reorderChildren ( UN_SubnetID  subnet,
const UT_Array< UN_NodeID > &  child_order 
)
inlineprotected

Sets the new order for the children.

Definition at line 554 of file UN_GraphData.h.

UN_NodeID UN_GraphData::rootNode ( ) const
inline

Returns an ID of the graph's root node. Root is a special node that holds graph's top-level nodes. It cannot be deleted or renamed.

NOTE: Within the graph, nodes are arranged in a parental hierarchy, where any node can be a parent of other nodes, as long as it has UN_SubnetData attached to it. We call such a node a subnet. The top-level nodes in a graph don't really have an explicitly created parent, however it's convenient to reuse UN_NodeData to hold them. We call such implicitly created node a root. It holds top-level nodes. All nodes except the root must have a valid parent.

Definition at line 151 of file UN_GraphData.h.

void UN_GraphData::setNodeName ( UN_NodeID  node_id,
const UT_StringRef name 
)

Sets the name of the given node.

void UN_GraphData::setNodeSignature ( UN_NodeID  node_id,
const UT_StringRef signature_name 
)

Sets the signature for the given node.

void UN_GraphData::setPortName ( UN_PortID  port_id,
const UT_StringRef name 
)

Sets the name of the given port.

void UN_GraphData::setStickyNoteName ( UN_StickyNoteID  sticky_note,
const UT_StringRef name 
)

Sets the name of the given sticky note.

void UN_GraphData::setWireDrawStyle ( UN_WireDrawStyle  style)
inline

Drawing style of the connection wires in the editor.

Definition at line 530 of file UN_GraphData.h.

UN_PortID UN_GraphData::srcPort ( UN_WireID  wire) const
inline

Returns the source port of the given wire. Ie, the port that provides (sends) the data.

Definition at line 441 of file UN_GraphData.h.

const UN_WireIDList& UN_GraphData::srcWires ( UN_PortID  port) const
inline

Returns source wires connected to the given port. Ie, connection wires from which this port takes (receives) data.

Definition at line 416 of file UN_GraphData.h.

UN_StickyNoteData& UN_GraphData::stickyNoteData ( )
inline

Returns the container of data for the sticky notes in the graph.

Definition at line 523 of file UN_GraphData.h.

const UN_StickyNoteData& UN_GraphData::stickyNoteData ( ) const
inline

Returns the container of data for the sticky notes in the graph.

Definition at line 525 of file UN_GraphData.h.

UN_SubnetData& UN_GraphData::subnetData ( )
inline

Returns the container of data for the subnets in the graph.

Definition at line 516 of file UN_GraphData.h.

const UN_SubnetData& UN_GraphData::subnetData ( ) const
inline

Returns the container of data for the subnets in the graph.

Definition at line 518 of file UN_GraphData.h.

const UN_GraphTopology& UN_GraphData::topology ( ) const
inlineprotected

Returns the topology object containing info about interconnections between graph elements such as nodes, ports, and wires.

Definition at line 539 of file UN_GraphData.h.

void UN_GraphData::updateSubnetWires ( UN_SubnetID  old_subnet)
inlineprotected

Updates the internal dictionaries after nodes have been moved to a new subnet. This method is needed for APEX.

Definition at line 562 of file UN_GraphData.h.

UN_DataSize UN_GraphData::wireCount ( ) const
inline

Returns the number of all wires in the graph.

Definition at line 272 of file UN_GraphData.h.

UN_WireData& UN_GraphData::wireData ( )
inline

Returns the container of data for the wires in the graph.

Definition at line 509 of file UN_GraphData.h.

const UN_WireData& UN_GraphData::wireData ( ) const
inline

Returns the container of data for the wires in the graph.

Definition at line 511 of file UN_GraphData.h.

UN_WireDrawStyle UN_GraphData::wireDrawStyle ( ) const
inline

Drawing style of the connection wires in the editor.

Definition at line 532 of file UN_GraphData.h.


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