HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
UNI_Graph Class Referenceabstract

#include <UNI_Graph.h>

+ Inheritance diagram for UNI_Graph:

Classes

class  ChangeBlock
 

Public Types

using ChangeCallback = UT_Function< void(UNI_Graph &, UNI_GraphChangeType, bool)>
 
using ChangeCallbackID = int
 

Public Member Functions

virtual ~UNI_Graph ()
 Destructor. More...
 
UNI_GraphID graphID () const
 
virtual UT_StringHolder name () const =0
 
virtual bool isEmpty () const =0
 Returns true if the graph has no nodes. More...
 
virtual UNI_NodeID rootNode () const =0
 
virtual bool hasDynamicPorts (UNI_NodeID node_id) const =0
 
virtual bool copyItems (UNI_NodeID parent_id, const UNI_NodeIDList &node_ids, const UNI_StickyNoteIDList &note_ids, std::ostream &os) const =0
 
bool isEditable () const
 Control whether this graph is editable. More...
 
void setEditable (bool editable)
 Control whether this graph is editable. More...
 
virtual UNI_WireStyle wireStyle () const =0
 The drawing style of the connection wires in the graph. More...
 
virtual void setWireStyle (UNI_WireStyle wire_style)=0
 The drawing style of the connection wires in the graph. More...
 
virtual bool isValid (UNI_NodeID node_id) const =0
 Returns true if the given ID refers to a valid item in this graph. More...
 
virtual bool isValid (UNI_PortID port_id) const =0
 Returns true if the given ID refers to a valid item in this graph. More...
 
virtual bool isValid (UNI_WireID wire_id) const =0
 Returns true if the given ID refers to a valid item in this graph. More...
 
virtual bool isValid (UNI_StickyNoteID note_id) const =0
 Returns true if the given ID refers to a valid item in this graph. More...
 
virtual bool isValidName (const UT_StringRef &name) const =0
 Generic functions related to entity naming. More...
 
virtual bool isNameInUse (UNI_NodeID parent_id, const UT_StringRef &name) const =0
 Generic functions related to entity naming. More...
 
virtual UT_StringHolder findUniqueName (UNI_NodeID parent_id, const UT_StringHolder &name) const =0
 Generic functions related to entity naming. More...
 
virtual UNI_NodeID parentNode (UNI_NodeID node_id) const =0
 
virtual bool isSubnet (UNI_NodeID node_id) const =0
 Returns true if the given node is a subnet (can have child nodes). More...
 
virtual bool isEditable (UNI_NodeID node_id) const =0
 
virtual bool isEditableSubnet (UNI_NodeID parent_id) const =0
 
virtual UNI_NodeIDList childNodes (UNI_NodeID parent_id) const =0
 Returns the children nodes that live inside the given parent node. More...
 
virtual UNI_NodeID findNode (UNI_NodeID from_id, const UT_StringRef &path) const =0
 
virtual UT_StringHolder name (UNI_NodeID node_id) const =0
 The name of a node. More...
 
virtual UT_StringHolder path (UNI_NodeID node_id) const =0
 The full path of the node. More...
 
virtual UT_StringHolder categoryName (UNI_NodeID node_id) const =0
 The category name of the node. More...
 
virtual UT_StringHolder typeName (UNI_NodeID node_id) const =0
 The type name of the node. More...
 
virtual UT_StringHolder signatureName (UNI_NodeID node_id) const =0
 The name of the current signature of the given node. More...
 
virtual bool isMultiSignature (UNI_NodeID node_id) const =0
 Returns true if the node has many signatures to choose from. More...
 
virtual UT_Array< UNI_Signaturesignatures (UNI_NodeID node_id, bool compatible_only, bool force_include_current) const =0
 
virtual UT_StringHolder helpURL (UNI_NodeID node_id) const =0
 
virtual UT_Vector2D position (UNI_NodeID node_id) const =0
 The position of the node in the graph editor. More...
 
virtual UT_Color color (UNI_NodeID node_id) const =0
 The color tint of the node in the graph editor. More...
 
virtual UT_StringHolder iconName (UNI_NodeID node_id) const =0
 Returns the icon name for the given node. More...
 
virtual UT_StringHolder comment (UNI_NodeID node_id) const =0
 The user-authored comment for a node. More...
 
virtual UT_StringArray tags (UNI_NodeID node_id) const =0
 The list of tags associated with a node. More...
 
virtual UT_StringHolder parmDialogScript (UNI_NodeID node_id) const =0
 
virtual UNI_ParmValue parmValue (UNI_NodeID node_id, const UT_StringRef &parm_name) const =0
 Get the value of a parm on this node. More...
 
virtual bool parmOverriddenByConnection (UNI_NodeID node_id, const UT_StringRef &parm_name) const =0
 
virtual int numberOfInputPorts (UNI_NodeID node_id) const =0
 Input ports of a node. More...
 
virtual UNI_PortIDList inputPorts (UNI_NodeID node_id) const =0
 Input ports of a node. More...
 
virtual UNI_PortID inputPort (UNI_NodeID node_id, int port_index) const =0
 Input ports of a node. More...
 
virtual int findInputPortIndex (UNI_NodeID node_id, UNI_PortID port_id) const =0
 Input ports of a node. More...
 
virtual int numberOfOutputPorts (UNI_NodeID node_id) const =0
 Output ports of a node. More...
 
virtual UNI_PortIDList outputPorts (UNI_NodeID node_id) const =0
 Output ports of a node. More...
 
virtual UNI_PortID outputPort (UNI_NodeID node_id, int port_index) const =0
 Output ports of a node. More...
 
virtual int findOutputPortIndex (UNI_NodeID node_id, UNI_PortID port_id) const =0
 Output ports of a node. More...
 
virtual bool wireDirectlyToContainer () const =0
 
virtual UT_Vector2D containerConnectPosition (UNI_NodeID parent_id, UNI_ContainerConnectType contype) const =0
 
virtual UT_Color containerConnectColor (UNI_NodeID parent_id, UNI_ContainerConnectType contype) const =0
 
virtual UNI_NodeID ownerNode (UNI_PortID port_id) const =0
 
virtual UNI_PortKind portKind (UNI_PortID port_id) const =0
 Returns what kind of a port this is: input or output. More...
 
virtual bool portAcceptsSubPorts (UNI_PortID port_id) const =0
 Returns whether the port accepts subports. More...
 
virtual bool portIsSubPort (UNI_PortID port_id) const =0
 Returns whether the port is a subport. More...
 
virtual UNI_PortID outerPort (UNI_PortID port_id) const =0
 Returns the "outer port" of a subport. More...
 
virtual UNI_PortIDList subnetOutputPorts (UNI_PortID port_id) const =0
 
virtual UNI_PortIDList subnetInputPorts (UNI_PortID port_id) const =0
 
virtual UT_StringHolder name (UNI_PortID port_id) const =0
 The name of the port. Some ports can be renamed. More...
 
virtual bool canSetName (UNI_PortID port_id) const =0
 Some graphs support setting port names. More...
 
virtual UT_StringHolder label (UNI_PortID port_id) const =0
 The label of the port. Some ports can be renamed. More...
 
virtual UT_StringHolder typeName (UNI_PortID port_id) const =0
 Returns the data type name for the given port. More...
 
virtual UT_StringHolder colorName (UNI_PortID port_id) const =0
 
virtual UNI_PortShape shape (UNI_PortID port_id) const =0
 Returns the visual shape of the port in the UI. More...
 
virtual UNI_WireIDList childWires (UNI_NodeID parent_id) const =0
 Returns the wires that live directly inside the given parent node. More...
 
virtual UNI_WireIDList srcWires (UNI_PortID port_id) const =0
 Return the wires that connect to a given port. More...
 
virtual UNI_WireIDList dstWires (UNI_PortID port_id) const =0
 Return the wires that connect to a given port. More...
 
virtual UNI_PortID srcPort (UNI_WireID wire_id) const =0
 
virtual UNI_PortID dstPort (UNI_WireID wire_id) const =0
 
virtual UNI_StickyNoteIDList childStickyNotes (UNI_NodeID parent_id) const =0
 
virtual UNI_StickyNoteID findStickyNote (UNI_NodeID from_id, const UT_StringRef &path) const =0
 Find the sticky note at a path relative to a starting node. More...
 
virtual UT_StringHolder name (UNI_StickyNoteID note_id) const =0
 The name of a sticky note. More...
 
virtual UT_StringHolder path (UNI_StickyNoteID note_id) const =0
 The full path of the sticky note. More...
 
virtual UNI_NodeID ownerNode (UNI_StickyNoteID note_id) const =0
 Returns the id of the node that contains this sticky note. More...
 
virtual UT_StringHolder text (UNI_StickyNoteID note_id) const =0
 Returns the sticky note's contents. More...
 
virtual UT_Color textColor (UNI_StickyNoteID note_id) const =0
 Returns the sticky note's text (foreground) color. More...
 
virtual float textSize (UNI_StickyNoteID note_id) const =0
 Returns the sticky note's text size. More...
 
virtual UT_Color color (UNI_StickyNoteID note_id) const =0
 Returns the sticky note's (background) color. More...
 
virtual UT_Vector2D position (UNI_StickyNoteID note_id) const =0
 Returns the sticky note's position in the graph editor. More...
 
virtual UT_Vector2D size (UNI_StickyNoteID note_id) const =0
 Returns the sticky note's size (width & height). More...
 
virtual bool isCollapsed (UNI_StickyNoteID note_id) const =0
 Returns true if the sticky note is collapsed (minimized). More...
 
virtual bool isBackgroundHidden (UNI_StickyNoteID note_id) const =0
 
UNI_NodeID currentChildNode (UNI_NodeID parent_id)
 Functions for tracking the current and selected nodes and wires. More...
 
const UT_Array
< UNI_SelectableItemID > & 
selectedItems () const
 Functions for tracking the current and selected nodes and wires. More...
 
template<typename T >
UT_Array< TselectedItemsOfType () const
 Functions for tracking the current and selected nodes and wires. More...
 
bool isItemSelected (UNI_SelectableItemID id)
 Functions for tracking the current and selected nodes and wires. More...
 
void addSelectedItem (UNI_SelectableItemID id)
 Functions for tracking the current and selected nodes and wires. More...
 
void removeSelectedItem (UNI_SelectableItemID id)
 Functions for tracking the current and selected nodes and wires. More...
 
void clearSelection ()
 Functions for tracking the current and selected nodes and wires. More...
 
ChangeCallbackID addChangeCallback (const UNI_Graph::ChangeCallback &cb)
 
void removeChangeCallback (ChangeCallbackID id)
 
- Public Member Functions inherited from UT_IntrusiveRefCounter< UNI_Graph, UNI_GraphDeleter >
SYS_FORCE_INLINE UT_IntrusiveRefCounter () noexcept
 Default constructor: Sets counter to 0. More...
 
SYS_FORCE_INLINE UT_IntrusiveRefCounter (const UT_IntrusiveRefCounter &) noexcept
 Copy constructor: Sets counter to 0. More...
 
UT_IntrusiveRefCounteroperator= (const UT_IntrusiveRefCounter &) noexcept
 Assignment operator: Does not modify counter. More...
 
SYS_FORCE_INLINE uint32 use_count () const noexcept
 Return current counter. More...
 
SYS_FORCE_INLINE bool conditionalAddRef () noexcept
 

Static Public Member Functions

static UNI_GraphfindGraph (UNI_GraphID id)
 Returns a UNI graph given its ID. Returns a null if not found. More...
 

Protected Member Functions

 UNI_Graph ()
 
virtual UNI_NodeID createNode (UNI_NodeID parent_id, const UT_StringHolder &node_name, const UT_StringHolder &node_type_name, const UT_StringHolder &signature_name=UT_StringHolder())=0
 Create a new node inside the provided node. More...
 
virtual UNI_NodeID createSubnet (UNI_NodeID parent_id, const UT_StringHolder &subnet_node_name, const UNI_PortIDList &create_input_ports, const UNI_PortIDList &create_output_ports)=0
 
virtual void setName (UNI_NodeID node_id, const UT_StringHolder &name)=0
 Set the name of a node. More...
 
virtual void setSignature (UNI_NodeID node_id, const UT_StringHolder &signature_name)=0
 Sets the new signature on a node. More...
 
virtual void updateDownstreamPortTypes (UNI_NodeID node_id, bool update_node)=0
 
virtual void updateDownstreamPortTypes (UNI_PortID port_id, bool update_port)=0
 
virtual void setPosition (UNI_NodeID node_id, const UT_Vector2D &pos)=0
 Set the position of the node in the graph editor. More...
 
virtual void setColor (UNI_NodeID node_id, const UT_Color &clr)=0
 Set the color tint of the node in the graph editor. More...
 
virtual void setComment (UNI_NodeID node_id, const UT_StringHolder &comment)=0
 Set the user-authored comment for a node. More...
 
virtual void setTags (UNI_NodeID node_id, const UT_StringArray &tags)=0
 Set the list of tags associated with a node. More...
 
virtual void setParmValue (UNI_NodeID node_id, const UT_StringRef &parm_name, const UNI_ParmValue &value)=0
 Set the value of a parm on this node. More...
 
virtual void destroy (UNI_NodeID node_id)=0
 Destroy a node. More...
 
virtual void setContainerConnectPosition (UNI_NodeID parent_id, UNI_ContainerConnectType contype, const UT_Vector2D &pos)=0
 
virtual void setContainerConnectColor (UNI_NodeID parent_id, UNI_ContainerConnectType contype, const UT_Color &clr)=0
 
virtual void setName (UNI_PortID port_id, const UT_StringHolder &name)=0
 Set the name of the port. Some ports can be renamed. More...
 
virtual UNI_WireID createWire (UNI_PortID src, UNI_PortID dst)=0
 Connect two ports. More...
 
virtual void destroy (UNI_WireID wire_id)=0
 Disconnect two ports. More...
 
virtual UNI_StickyNoteID createStickyNote (UNI_NodeID parent_id, const UT_StringHolder &name)=0
 Create a new sticky note inside the provided node. More...
 
virtual void setName (UNI_StickyNoteID note_id, const UT_StringHolder &name)=0
 Set the name of a sticky note. More...
 
virtual void setPosition (UNI_StickyNoteID note_id, const UT_Vector2D &pos)=0
 Set the position of the sticky note in the graph editor. More...
 
virtual void setSize (UNI_StickyNoteID note_id, const UT_Vector2D &size)=0
 Set the size of the sticky note in the graph editor. More...
 
virtual void setColor (UNI_StickyNoteID note_id, const UT_Color &clr)=0
 Set the color of the sticky note background in the graph editor. More...
 
virtual void setText (UNI_StickyNoteID note_id, const UT_StringHolder &text)=0
 Set the sticky note text in the graph editor. More...
 
virtual void setTextColor (UNI_StickyNoteID note_id, const UT_Color &clr)=0
 Set the color of the sticky note text in the graph editor. More...
 
virtual void setTextSize (UNI_StickyNoteID note_id, const float size)=0
 Set the size of the sticky note text in the graph editor. More...
 
virtual void setCollapsed (UNI_StickyNoteID note_id, bool collapsed)=0
 Returns true if the sticky note is collapsed (minimized). More...
 
virtual void setBackgroundHidden (UNI_StickyNoteID note_id, bool hidden)=0
 
virtual void destroy (UNI_StickyNoteID note_id)=0
 Destroy a sticky note. More...
 
virtual bool pasteItems (UNI_NodeID parent_id, UNI_NodeIDList &node_ids, UNI_StickyNoteIDList &note_ids, std::istream &is, UT_StringMap< UT_StringHolder > *rename_map)=0
 
void forceTriggerChangeCallbacks (const UNI_GraphChangeType &add_change_type=UNI_GraphChangeType())
 
- Protected Member Functions inherited from UT_IntrusiveRefCounter< UNI_Graph, UNI_GraphDeleter >
SYS_FORCE_INLINE ~UT_IntrusiveRefCounter ()
 Destructor: Only derived classes can destruct this. More...
 

Friends

class UNI_Node
 
class UNI_Port
 
class UNI_Wire
 
class UNI_StickyNote
 

Detailed Description

A class that represents a UNI graph within the GUI layer, used by node network editor classes (FUSE/OPUI/HOMF) to implement user interactions. UNI graphs are available globally in a Houdini session, using graph ID and static method UNI_Graph::findGraph() in this class.

Definition at line 141 of file UNI_Graph.h.

Member Typedef Documentation

Callback method signature when a session graph changes. The third argument indicates whether it's the outermost block of nested change blocks. The callbacks are run on any change in the graph, whether it occurs in outermost or inner nested scopes. It's up to the callback to check and decide whether to handle the change immediately or postpone it until the outmost block is done. Each callback is invoked with the union of all change type that occured until then, including any nested change blocks.

Definition at line 432 of file UNI_Graph.h.

Definition at line 433 of file UNI_Graph.h.

Constructor & Destructor Documentation

UNI_Graph::UNI_Graph ( )
protected

Constructor. Intended to be used by only the (static) factory functions in the sub-classes, which create UNI_Graph instances. The constructor assigns a unique session ID to the graph and registers it in the internal look-up table; the destructor removes it from there. Subclass factory functions wrap the created graph in a UNI_GraphHandle, which takes ownership of it.

virtual UNI_Graph::~UNI_Graph ( )
virtual

Destructor.

Non-copyable. An internal map should be the sole owner of graph objects, since we are using ID and handles to identify them and track life span.

Member Function Documentation

ChangeCallbackID UNI_Graph::addChangeCallback ( const UNI_Graph::ChangeCallback cb)

Functions for managing callbacks that are invoked when this graph changes.

void UNI_Graph::addSelectedItem ( UNI_SelectableItemID  id)

Functions for tracking the current and selected nodes and wires.

virtual bool UNI_Graph::canSetName ( UNI_PortID  port_id) const
pure virtual

Some graphs support setting port names.

Implemented in UN_UniGraph.

virtual UT_StringHolder UNI_Graph::categoryName ( UNI_NodeID  node_id) const
pure virtual

The category name of the node.

Implemented in UN_UniGraph.

virtual UNI_NodeIDList UNI_Graph::childNodes ( UNI_NodeID  parent_id) const
pure virtual

Returns the children nodes that live inside the given parent node.

Implemented in UN_UniGraph.

virtual UNI_StickyNoteIDList UNI_Graph::childStickyNotes ( UNI_NodeID  parent_id) const
pure virtual

APIs for dealing with Sticky Notes. Returns the sticky notes that live inside the given parent node.

Implemented in UN_UniGraph.

virtual UNI_WireIDList UNI_Graph::childWires ( UNI_NodeID  parent_id) const
pure virtual

Returns the wires that live directly inside the given parent node.

Implemented in UN_UniGraph.

void UNI_Graph::clearSelection ( )

Functions for tracking the current and selected nodes and wires.

virtual UT_Color UNI_Graph::color ( UNI_NodeID  node_id) const
pure virtual

The color tint of the node in the graph editor.

Implemented in UN_UniGraph.

virtual UT_Color UNI_Graph::color ( UNI_StickyNoteID  note_id) const
pure virtual

Returns the sticky note's (background) color.

Implemented in UN_UniGraph.

virtual UT_StringHolder UNI_Graph::colorName ( UNI_PortID  port_id) const
pure virtual

Returns the UI color name for the given port. The color name should adhere to the UIgetMiscColor() conventions. This method allows for color scheme adjustment of the actual color.

Implemented in UN_UniGraph.

virtual UT_StringHolder UNI_Graph::comment ( UNI_NodeID  node_id) const
pure virtual

The user-authored comment for a node.

Implemented in UN_UniGraph.

virtual UT_Color UNI_Graph::containerConnectColor ( UNI_NodeID  parent_id,
UNI_ContainerConnectType  contype 
) const
pure virtual

Some graphs allow wiring directly from a container node to nodes inside the container. In this case, wireDirectlyToContainer will return true. The other methods here are for controlling the appearance of the UI for making connections to the container node when inside that container.

Implemented in UN_UniGraph.

virtual UT_Vector2D UNI_Graph::containerConnectPosition ( UNI_NodeID  parent_id,
UNI_ContainerConnectType  contype 
) const
pure virtual

Some graphs allow wiring directly from a container node to nodes inside the container. In this case, wireDirectlyToContainer will return true. The other methods here are for controlling the appearance of the UI for making connections to the container node when inside that container.

Implemented in UN_UniGraph.

virtual bool UNI_Graph::copyItems ( UNI_NodeID  parent_id,
const UNI_NodeIDList &  node_ids,
const UNI_StickyNoteIDList &  note_ids,
std::ostream &  os 
) const
pure virtual

Fill the supplied output stream with data that can be used to make copies of the specified items.

Implemented in UN_UniGraph, and HUSD_MaterialUniGraph.

virtual UNI_NodeID UNI_Graph::createNode ( UNI_NodeID  parent_id,
const UT_StringHolder node_name,
const UT_StringHolder node_type_name,
const UT_StringHolder signature_name = UT_StringHolder() 
)
protectedpure virtual

Create a new node inside the provided node.

Implemented in UN_UniGraph, and HUSD_MaterialUniGraph.

virtual UNI_StickyNoteID UNI_Graph::createStickyNote ( UNI_NodeID  parent_id,
const UT_StringHolder name 
)
protectedpure virtual

Create a new sticky note inside the provided node.

Implemented in UN_UniGraph, and HUSD_MaterialUniGraph.

virtual UNI_NodeID UNI_Graph::createSubnet ( UNI_NodeID  parent_id,
const UT_StringHolder subnet_node_name,
const UNI_PortIDList &  create_input_ports,
const UNI_PortIDList &  create_output_ports 
)
protectedpure virtual

Create a subnet inside the provided node, and pre-populates it with input and output ports that match the supplied port ids. The subnet input and output ports will be ordered the same way they are in the provided arrays.

Implemented in UN_UniGraph.

virtual UNI_WireID UNI_Graph::createWire ( UNI_PortID  src,
UNI_PortID  dst 
)
protectedpure virtual

Connect two ports.

Implemented in UN_UniGraph, and HUSD_MaterialUniGraph.

UNI_NodeID UNI_Graph::currentChildNode ( UNI_NodeID  parent_id)

Functions for tracking the current and selected nodes and wires.

virtual void UNI_Graph::destroy ( UNI_NodeID  node_id)
protectedpure virtual

Destroy a node.

Implemented in UN_UniGraph, and HUSD_MaterialUniGraph.

virtual void UNI_Graph::destroy ( UNI_WireID  wire_id)
protectedpure virtual

Disconnect two ports.

Implemented in UN_UniGraph, and HUSD_MaterialUniGraph.

virtual void UNI_Graph::destroy ( UNI_StickyNoteID  note_id)
protectedpure virtual

Destroy a sticky note.

Implemented in UN_UniGraph, and HUSD_MaterialUniGraph.

virtual UNI_PortID UNI_Graph::dstPort ( UNI_WireID  wire_id) const
pure virtual

Get the start (src) and end (dst) ports for a wire. Note that either an input or output port may be the start or end point of a wire. The permissibility and meaning of this will depend on the specific graph implementation.

Implemented in UN_UniGraph.

virtual UNI_WireIDList UNI_Graph::dstWires ( UNI_PortID  port_id) const
pure virtual

Return the wires that connect to a given port.

Implemented in UN_UniGraph.

static UNI_Graph* UNI_Graph::findGraph ( UNI_GraphID  id)
static

Returns a UNI graph given its ID. Returns a null if not found.

virtual int UNI_Graph::findInputPortIndex ( UNI_NodeID  node_id,
UNI_PortID  port_id 
) const
pure virtual

Input ports of a node.

Implemented in UN_UniGraph.

virtual UNI_NodeID UNI_Graph::findNode ( UNI_NodeID  from_id,
const UT_StringRef path 
) const
pure virtual

Finds the node at the specified path relative to the given node. If the path is an absolute path, the from_id isn't used.

Implemented in UN_UniGraph.

virtual int UNI_Graph::findOutputPortIndex ( UNI_NodeID  node_id,
UNI_PortID  port_id 
) const
pure virtual

Output ports of a node.

Implemented in UN_UniGraph.

virtual UNI_StickyNoteID UNI_Graph::findStickyNote ( UNI_NodeID  from_id,
const UT_StringRef path 
) const
pure virtual

Find the sticky note at a path relative to a starting node.

Implemented in UN_UniGraph.

virtual UT_StringHolder UNI_Graph::findUniqueName ( UNI_NodeID  parent_id,
const UT_StringHolder name 
) const
pure virtual

Generic functions related to entity naming.

Implemented in UN_UniGraph.

void UNI_Graph::forceTriggerChangeCallbacks ( const UNI_GraphChangeType add_change_type = UNI_GraphChangeType())
protected

Force handling of any pending change callbacks. We may need to do this in cases where the implementation of a subclass function requires an immediate update to the data that drives the graph. One example is HUSD_MaterialUniGraph::pasteItems.

UNI_GraphID UNI_Graph::graphID ( ) const
inline

Returns the unique ID of this graph in the current Houdini session. Note, this ID can change from session to session, so should not be serialized or saved for persistence outside of the session.

Definition at line 175 of file UNI_Graph.h.

virtual bool UNI_Graph::hasDynamicPorts ( UNI_NodeID  node_id) const
pure virtual

Return true if a node has a variable number of inputs or outputs. This does not include "subports" in APEX, which are not individually named and are not "real" ports.

Implemented in UN_UniGraph.

virtual UT_StringHolder UNI_Graph::helpURL ( UNI_NodeID  node_id) const
pure virtual

The help URL for the node. Used for UT_HelpManager::openURL() which accepts protocols such as "http://u.r.l", "hdox://u.r.l", "operator:category/name", etc.

Implemented in UN_UniGraph.

virtual UT_StringHolder UNI_Graph::iconName ( UNI_NodeID  node_id) const
pure virtual

Returns the icon name for the given node.

Implemented in UN_UniGraph.

virtual UNI_PortID UNI_Graph::inputPort ( UNI_NodeID  node_id,
int  port_index 
) const
pure virtual

Input ports of a node.

Implemented in UN_UniGraph.

virtual UNI_PortIDList UNI_Graph::inputPorts ( UNI_NodeID  node_id) const
pure virtual

Input ports of a node.

Implemented in UN_UniGraph.

virtual bool UNI_Graph::isBackgroundHidden ( UNI_StickyNoteID  note_id) const
pure virtual

Returns true if the background of the sticky note is not drawn, effectively making it transparent.

Implemented in UN_UniGraph.

virtual bool UNI_Graph::isCollapsed ( UNI_StickyNoteID  note_id) const
pure virtual

Returns true if the sticky note is collapsed (minimized).

Implemented in UN_UniGraph.

bool UNI_Graph::isEditable ( ) const
inline

Control whether this graph is editable.

Definition at line 179 of file UNI_Graph.h.

virtual bool UNI_Graph::isEditable ( UNI_NodeID  node_id) const
pure virtual

Returns true if the given node can be modified (ie, is inside an editable subnet). Ie, it can be connected to a new source, and its parameters can be set.

Implemented in UN_UniGraph.

virtual bool UNI_Graph::isEditableSubnet ( UNI_NodeID  parent_id) const
pure virtual

Returns true if the subnet inside the given parent node can be modified. Eg, new connections can be made between children, their parameters can be set, etc.

Implemented in UN_UniGraph.

virtual bool UNI_Graph::isEmpty ( ) const
pure virtual

Returns true if the graph has no nodes.

Implemented in UN_UniGraph.

bool UNI_Graph::isItemSelected ( UNI_SelectableItemID  id)

Functions for tracking the current and selected nodes and wires.

virtual bool UNI_Graph::isMultiSignature ( UNI_NodeID  node_id) const
pure virtual

Returns true if the node has many signatures to choose from.

Implemented in UN_UniGraph.

virtual bool UNI_Graph::isNameInUse ( UNI_NodeID  parent_id,
const UT_StringRef name 
) const
pure virtual

Generic functions related to entity naming.

Implemented in UN_UniGraph.

virtual bool UNI_Graph::isSubnet ( UNI_NodeID  node_id) const
pure virtual

Returns true if the given node is a subnet (can have child nodes).

Implemented in UN_UniGraph.

virtual bool UNI_Graph::isValid ( UNI_NodeID  node_id) const
pure virtual

Returns true if the given ID refers to a valid item in this graph.

Implemented in UN_UniGraph.

virtual bool UNI_Graph::isValid ( UNI_PortID  port_id) const
pure virtual

Returns true if the given ID refers to a valid item in this graph.

Implemented in UN_UniGraph.

virtual bool UNI_Graph::isValid ( UNI_WireID  wire_id) const
pure virtual

Returns true if the given ID refers to a valid item in this graph.

Implemented in UN_UniGraph.

virtual bool UNI_Graph::isValid ( UNI_StickyNoteID  note_id) const
pure virtual

Returns true if the given ID refers to a valid item in this graph.

Implemented in UN_UniGraph.

virtual bool UNI_Graph::isValidName ( const UT_StringRef name) const
pure virtual

Generic functions related to entity naming.

Implemented in UN_UniGraph.

virtual UT_StringHolder UNI_Graph::label ( UNI_PortID  port_id) const
pure virtual

The label of the port. Some ports can be renamed.

Implemented in UN_UniGraph.

virtual UT_StringHolder UNI_Graph::name ( ) const
pure virtual

Returns the name of the graph. Used for human readability and UI presentation.

Implemented in UN_UniGraph.

virtual UT_StringHolder UNI_Graph::name ( UNI_NodeID  node_id) const
pure virtual

The name of a node.

Implemented in UN_UniGraph.

virtual UT_StringHolder UNI_Graph::name ( UNI_PortID  port_id) const
pure virtual

The name of the port. Some ports can be renamed.

Implemented in UN_UniGraph.

virtual UT_StringHolder UNI_Graph::name ( UNI_StickyNoteID  note_id) const
pure virtual

The name of a sticky note.

Implemented in UN_UniGraph.

virtual int UNI_Graph::numberOfInputPorts ( UNI_NodeID  node_id) const
pure virtual

Input ports of a node.

Implemented in UN_UniGraph.

virtual int UNI_Graph::numberOfOutputPorts ( UNI_NodeID  node_id) const
pure virtual

Output ports of a node.

Implemented in UN_UniGraph.

virtual UNI_PortID UNI_Graph::outerPort ( UNI_PortID  port_id) const
pure virtual

Returns the "outer port" of a subport.

Implemented in UN_UniGraph.

virtual UNI_PortID UNI_Graph::outputPort ( UNI_NodeID  node_id,
int  port_index 
) const
pure virtual

Output ports of a node.

Implemented in UN_UniGraph.

virtual UNI_PortIDList UNI_Graph::outputPorts ( UNI_NodeID  node_id) const
pure virtual

Output ports of a node.

Implemented in UN_UniGraph.

virtual UNI_NodeID UNI_Graph::ownerNode ( UNI_PortID  port_id) const
pure virtual

APIs for dealing with Ports. Returns the node that owns the specified port.

Implemented in UN_UniGraph.

virtual UNI_NodeID UNI_Graph::ownerNode ( UNI_StickyNoteID  note_id) const
pure virtual

Returns the id of the node that contains this sticky note.

Implemented in UN_UniGraph.

virtual UNI_NodeID UNI_Graph::parentNode ( UNI_NodeID  node_id) const
pure virtual

APIs for getting information about a node. Returns the parent of the given node. Ie, nodes can be nested, so this returns the node inside which the given child node lives.

Implemented in UN_UniGraph.

virtual UT_StringHolder UNI_Graph::parmDialogScript ( UNI_NodeID  node_id) const
pure virtual

The parameter descriptions for the specified node. This is used to build a parm dialog.

Implemented in UN_UniGraph, and HUSD_MaterialUniGraph.

virtual bool UNI_Graph::parmOverriddenByConnection ( UNI_NodeID  node_id,
const UT_StringRef parm_name 
) const
pure virtual

Return true if there is a port corresponding to this parm, and that port is connected, resulting in this parm having no effect.

Implemented in UN_UniGraph.

virtual UNI_ParmValue UNI_Graph::parmValue ( UNI_NodeID  node_id,
const UT_StringRef parm_name 
) const
pure virtual

Get the value of a parm on this node.

Implemented in UN_UniGraph, and HUSD_MaterialUniGraph.

virtual bool UNI_Graph::pasteItems ( UNI_NodeID  parent_id,
UNI_NodeIDList &  node_ids,
UNI_StickyNoteIDList &  note_ids,
std::istream &  is,
UT_StringMap< UT_StringHolder > *  rename_map 
)
protectedpure virtual

Paste the contents of the supplied stream (generated by calling copyItems) into the specified parent network.

Implemented in UN_UniGraph, and HUSD_MaterialUniGraph.

virtual UT_StringHolder UNI_Graph::path ( UNI_NodeID  node_id) const
pure virtual

The full path of the node.

Implemented in UN_UniGraph.

virtual UT_StringHolder UNI_Graph::path ( UNI_StickyNoteID  note_id) const
pure virtual

The full path of the sticky note.

Implemented in UN_UniGraph.

virtual bool UNI_Graph::portAcceptsSubPorts ( UNI_PortID  port_id) const
pure virtual

Returns whether the port accepts subports.

Implemented in UN_UniGraph.

virtual bool UNI_Graph::portIsSubPort ( UNI_PortID  port_id) const
pure virtual

Returns whether the port is a subport.

Implemented in UN_UniGraph.

virtual UNI_PortKind UNI_Graph::portKind ( UNI_PortID  port_id) const
pure virtual

Returns what kind of a port this is: input or output.

Implemented in UN_UniGraph.

virtual UT_Vector2D UNI_Graph::position ( UNI_NodeID  node_id) const
pure virtual

The position of the node in the graph editor.

Implemented in UN_UniGraph.

virtual UT_Vector2D UNI_Graph::position ( UNI_StickyNoteID  note_id) const
pure virtual

Returns the sticky note's position in the graph editor.

Implemented in UN_UniGraph.

void UNI_Graph::removeChangeCallback ( ChangeCallbackID  id)

Functions for managing callbacks that are invoked when this graph changes.

void UNI_Graph::removeSelectedItem ( UNI_SelectableItemID  id)

Functions for tracking the current and selected nodes and wires.

virtual UNI_NodeID UNI_Graph::rootNode ( ) const
pure virtual

Returns the ID of the root node. Ie, the ID of the parent of the top-level nodes in the graph.

Implemented in UN_UniGraph.

const UT_Array<UNI_SelectableItemID>& UNI_Graph::selectedItems ( ) const

Functions for tracking the current and selected nodes and wires.

template<typename T >
UT_Array<T> UNI_Graph::selectedItemsOfType ( ) const
inline

Functions for tracking the current and selected nodes and wires.

Definition at line 408 of file UNI_Graph.h.

virtual void UNI_Graph::setBackgroundHidden ( UNI_StickyNoteID  note_id,
bool  hidden 
)
protectedpure virtual

Returns true if the background of the sticky note is not drawn, effectively making it transparent.

Implemented in UN_UniGraph, and HUSD_MaterialUniGraph.

virtual void UNI_Graph::setCollapsed ( UNI_StickyNoteID  note_id,
bool  collapsed 
)
protectedpure virtual

Returns true if the sticky note is collapsed (minimized).

Implemented in UN_UniGraph, and HUSD_MaterialUniGraph.

virtual void UNI_Graph::setColor ( UNI_NodeID  node_id,
const UT_Color clr 
)
protectedpure virtual

Set the color tint of the node in the graph editor.

Implemented in UN_UniGraph, and HUSD_MaterialUniGraph.

virtual void UNI_Graph::setColor ( UNI_StickyNoteID  note_id,
const UT_Color clr 
)
protectedpure virtual

Set the color of the sticky note background in the graph editor.

Implemented in UN_UniGraph, and HUSD_MaterialUniGraph.

virtual void UNI_Graph::setComment ( UNI_NodeID  node_id,
const UT_StringHolder comment 
)
protectedpure virtual

Set the user-authored comment for a node.

Implemented in UN_UniGraph, and HUSD_MaterialUniGraph.

virtual void UNI_Graph::setContainerConnectColor ( UNI_NodeID  parent_id,
UNI_ContainerConnectType  contype,
const UT_Color clr 
)
protectedpure virtual

Set the color of the special "connect to my container" UI element in the graph editor.

Implemented in UN_UniGraph, and HUSD_MaterialUniGraph.

virtual void UNI_Graph::setContainerConnectPosition ( UNI_NodeID  parent_id,
UNI_ContainerConnectType  contype,
const UT_Vector2D pos 
)
protectedpure virtual

Set the position of the special "connect to my container" UI element in the graph editor.

Implemented in UN_UniGraph, and HUSD_MaterialUniGraph.

void UNI_Graph::setEditable ( bool  editable)
inline

Control whether this graph is editable.

Definition at line 181 of file UNI_Graph.h.

virtual void UNI_Graph::setName ( UNI_NodeID  node_id,
const UT_StringHolder name 
)
protectedpure virtual

Set the name of a node.

Implemented in UN_UniGraph, and HUSD_MaterialUniGraph.

virtual void UNI_Graph::setName ( UNI_PortID  port_id,
const UT_StringHolder name 
)
protectedpure virtual

Set the name of the port. Some ports can be renamed.

Implemented in UN_UniGraph.

virtual void UNI_Graph::setName ( UNI_StickyNoteID  note_id,
const UT_StringHolder name 
)
protectedpure virtual

Set the name of a sticky note.

Implemented in UN_UniGraph, and HUSD_MaterialUniGraph.

virtual void UNI_Graph::setParmValue ( UNI_NodeID  node_id,
const UT_StringRef parm_name,
const UNI_ParmValue value 
)
protectedpure virtual

Set the value of a parm on this node.

Implemented in UN_UniGraph, and HUSD_MaterialUniGraph.

virtual void UNI_Graph::setPosition ( UNI_NodeID  node_id,
const UT_Vector2D pos 
)
protectedpure virtual

Set the position of the node in the graph editor.

Implemented in UN_UniGraph, and HUSD_MaterialUniGraph.

virtual void UNI_Graph::setPosition ( UNI_StickyNoteID  note_id,
const UT_Vector2D pos 
)
protectedpure virtual

Set the position of the sticky note in the graph editor.

Implemented in UN_UniGraph, and HUSD_MaterialUniGraph.

virtual void UNI_Graph::setSignature ( UNI_NodeID  node_id,
const UT_StringHolder signature_name 
)
protectedpure virtual

Sets the new signature on a node.

Implemented in UN_UniGraph, and HUSD_MaterialUniGraph.

virtual void UNI_Graph::setSize ( UNI_StickyNoteID  note_id,
const UT_Vector2D size 
)
protectedpure virtual

Set the size of the sticky note in the graph editor.

Implemented in UN_UniGraph, and HUSD_MaterialUniGraph.

virtual void UNI_Graph::setTags ( UNI_NodeID  node_id,
const UT_StringArray tags 
)
protectedpure virtual

Set the list of tags associated with a node.

Implemented in UN_UniGraph, and HUSD_MaterialUniGraph.

virtual void UNI_Graph::setText ( UNI_StickyNoteID  note_id,
const UT_StringHolder text 
)
protectedpure virtual

Set the sticky note text in the graph editor.

Implemented in UN_UniGraph, and HUSD_MaterialUniGraph.

virtual void UNI_Graph::setTextColor ( UNI_StickyNoteID  note_id,
const UT_Color clr 
)
protectedpure virtual

Set the color of the sticky note text in the graph editor.

Implemented in UN_UniGraph, and HUSD_MaterialUniGraph.

virtual void UNI_Graph::setTextSize ( UNI_StickyNoteID  note_id,
const float  size 
)
protectedpure virtual

Set the size of the sticky note text in the graph editor.

Implemented in UN_UniGraph, and HUSD_MaterialUniGraph.

virtual void UNI_Graph::setWireStyle ( UNI_WireStyle  wire_style)
pure virtual

The drawing style of the connection wires in the graph.

Implemented in HUSD_MaterialUniGraph, and UN_UniGraph.

virtual UNI_PortShape UNI_Graph::shape ( UNI_PortID  port_id) const
pure virtual

Returns the visual shape of the port in the UI.

Implemented in UN_UniGraph.

virtual UT_StringHolder UNI_Graph::signatureName ( UNI_NodeID  node_id) const
pure virtual

The name of the current signature of the given node.

Implemented in UN_UniGraph.

virtual UT_Array<UNI_Signature> UNI_Graph::signatures ( UNI_NodeID  node_id,
bool  compatible_only,
bool  force_include_current 
) const
pure virtual

The list of function signature names this node (or node's type) offers. If compatible_only is true, the list contains signatures whose input/output types are compatible with current wire connections on the node; otherwise, resturns all available signatures. If force_include_current is true, the list will include the current node signature name eve if it may not be part of official list.

Implemented in UN_UniGraph.

virtual UT_Vector2D UNI_Graph::size ( UNI_StickyNoteID  note_id) const
pure virtual

Returns the sticky note's size (width & height).

Implemented in UN_UniGraph.

virtual UNI_PortID UNI_Graph::srcPort ( UNI_WireID  wire_id) const
pure virtual

Get the start (src) and end (dst) ports for a wire. Note that either an input or output port may be the start or end point of a wire. The permissibility and meaning of this will depend on the specific graph implementation.

Implemented in UN_UniGraph.

virtual UNI_WireIDList UNI_Graph::srcWires ( UNI_PortID  port_id) const
pure virtual

Return the wires that connect to a given port.

Implemented in UN_UniGraph.

virtual UNI_PortIDList UNI_Graph::subnetInputPorts ( UNI_PortID  port_id) const
pure virtual

Returns the port to which wires must connect in order to act as a dst wire from a subnet's input port. Returns an empty list if the provided port isn't an input port of a subnet node.

Implemented in UN_UniGraph.

virtual UNI_PortIDList UNI_Graph::subnetOutputPorts ( UNI_PortID  port_id) const
pure virtual

Returns the port to which wires must connect in order to serve as the src wire for a subnet's output port. Returns an empty list if the provided port isn't an output port of a subnet node.

Implemented in UN_UniGraph.

virtual UT_StringArray UNI_Graph::tags ( UNI_NodeID  node_id) const
pure virtual

The list of tags associated with a node.

Implemented in UN_UniGraph.

virtual UT_StringHolder UNI_Graph::text ( UNI_StickyNoteID  note_id) const
pure virtual

Returns the sticky note's contents.

Implemented in UN_UniGraph.

virtual UT_Color UNI_Graph::textColor ( UNI_StickyNoteID  note_id) const
pure virtual

Returns the sticky note's text (foreground) color.

Implemented in UN_UniGraph.

virtual float UNI_Graph::textSize ( UNI_StickyNoteID  note_id) const
pure virtual

Returns the sticky note's text size.

Implemented in UN_UniGraph.

virtual UT_StringHolder UNI_Graph::typeName ( UNI_NodeID  node_id) const
pure virtual

The type name of the node.

Implemented in UN_UniGraph.

virtual UT_StringHolder UNI_Graph::typeName ( UNI_PortID  port_id) const
pure virtual

Returns the data type name for the given port.

Implemented in UN_UniGraph.

virtual void UNI_Graph::updateDownstreamPortTypes ( UNI_NodeID  node_id,
bool  update_node 
)
protectedpure virtual

Ensures the signatures and port types are up-to-date for all the nodes downstream of the given node. If update_node is true, the given node and its ports are updated too.

Implemented in UN_UniGraph.

virtual void UNI_Graph::updateDownstreamPortTypes ( UNI_PortID  port_id,
bool  update_port 
)
protectedpure virtual

Ensures the node signatures and port types are up-to-date for all the nodes downstream of the given port. If update_port is true, the given port is updated too.

Implemented in UN_UniGraph.

virtual bool UNI_Graph::wireDirectlyToContainer ( ) const
pure virtual

Some graphs allow wiring directly from a container node to nodes inside the container. In this case, wireDirectlyToContainer will return true. The other methods here are for controlling the appearance of the UI for making connections to the container node when inside that container.

Implemented in UN_UniGraph.

virtual UNI_WireStyle UNI_Graph::wireStyle ( ) const
pure virtual

The drawing style of the connection wires in the graph.

Implemented in UN_UniGraph.

Friends And Related Function Documentation

friend class UNI_Node
friend

All non-const methods are protected, and should only be called by these friend classes. This ensures that the proper change notifications are sent out without subclasses ever having to worry about them.

Definition at line 477 of file UNI_Graph.h.

friend class UNI_Port
friend

Definition at line 478 of file UNI_Graph.h.

friend class UNI_StickyNote
friend

Definition at line 480 of file UNI_Graph.h.

friend class UNI_Wire
friend

Definition at line 479 of file UNI_Graph.h.


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