AbstractGraphNodeDelegate

class omni.kit.widget.graph.AbstractGraphNodeDelegate

Bases: object

The delegate generates widgets that together form the node using the model. The following figure shows the LIST layout of the node. For every zone, there is a method that is called to build this zone.

+-------------------------+
|     node_background     |
| +---+-------------+---+ |
| |[A]| node_header |[B]| |
| +---+-------------+---+ |
| |[C]|    port     |[D]| |
| +---+-------------+---+ |
| |[D]|    port     |[D]| |
| +---+-------------+---+ |
| |[E]| node_footer |[F]| |
| +---+-------------+---+ |
+-------------------------+

COLUMN layout allows to put input and output ports at the same line:

+-------------------------+
|     node_background     |
| +---+-------------+---+ |
| |[A]| node_header |[B]| |
| +---+------+------+---+ |
| |[C]| port | port |[D]| |
| |   |      |------+---| |
| |---+------| port |[D]| |
| |[D]| port |      |   | |
| +---+------+------+---+ |
| |[E]| node_footer |[F]| |
| +---+-------------+---+ |
+-------------------------+
[A] node_header_input
[B] node_header_output
[C] port_input
[D] port_output
[E] node_footer_input (TODO)
[F] node_footer_output (TODO)

Methods

connection(model, source_desc, target_desc)

Called to create the connection between ports.

destroy()

Performs any necessary cleanup before the object is destroyed.

get_node_layout(model, node_desc)

Called to determine the node layout.

node_background(model, node_desc)

Called to create widgets of the node background.

node_footer(model, node_desc)

Called to create widgets of the bottom of the node.

node_header(model, node_desc)

Called to create widgets of the top of the node.

node_header_input(model, node_desc)

Called to create the left part of the header that will be used as input when the node is collapsed.

node_header_output(model, node_desc)

Called to create the right part of the header that will be used as output when the node is collapsed.

port(model, node_desc, port_desc)

Called to create the middle part of the port.

port_input(model, node_desc, port_desc)

Called to create the left part of the port that will be used as input.

port_output(model, node_desc, port_desc)

Called to create the right part of the port that will be used as output.

__init__()
connection(model, source_desc: GraphConnectionDescription, target_desc: GraphConnectionDescription, foreground: bool = False)

Called to create the connection between ports.

Parameters
  • model – The model associated with the graph.

  • source_desc (GraphConnectionDescription) – The description of the source connection.

  • target_desc (GraphConnectionDescription) – The description of the target connection.

  • foreground (bool, optional) – If True, the connection is drawn in the foreground. Defaults to False.

destroy()

Performs any necessary cleanup before the object is destroyed.

get_node_layout(model, node_desc: GraphNodeDescription)

Called to determine the node layout.

Parameters
  • model – The model associated with the graph.

  • node_desc (GraphNodeDescription) – The description of the node.

Returns

The layout of the node.

Return type

GraphNodeLayout

node_background(model, node_desc: GraphNodeDescription)

Called to create widgets of the node background.

Parameters
  • model – The model associated with the graph.

  • node_desc (GraphNodeDescription) – The description of the node.

Called to create widgets of the bottom of the node.

Parameters
  • model – The model associated with the graph.

  • node_desc (GraphNodeDescription) – The description of the node.

node_header(model, node_desc: GraphNodeDescription)

Called to create widgets of the top of the node.

Parameters
  • model – The model associated with the graph.

  • node_desc (GraphNodeDescription) – The description of the node.

node_header_input(model, node_desc: GraphNodeDescription)

Called to create the left part of the header that will be used as input when the node is collapsed.

Parameters
  • model – The model associated with the graph.

  • node_desc (GraphNodeDescription) – The description of the node.

node_header_output(model, node_desc: GraphNodeDescription)

Called to create the right part of the header that will be used as output when the node is collapsed.

Parameters
  • model – The model associated with the graph.

  • node_desc (GraphNodeDescription) – The description of the node.

port(model, node_desc: GraphNodeDescription, port_desc: GraphPortDescription)

Called to create the middle part of the port.

Parameters
port_input(model, node_desc: GraphNodeDescription, port_desc: GraphPortDescription)

Called to create the left part of the port that will be used as input.

Parameters
port_output(model, node_desc: GraphNodeDescription, port_desc: GraphPortDescription)

Called to create the right part of the port that will be used as output.

Parameters