node_edge_intersect Module

A module containing the intersecting nodes functionality. If a node gets dragged and dropped on an existing edge it will intersect that edge.

class nodeeditor.node_edge_intersect.EdgeIntersect(grView: PyQt5.QtWidgets.QGraphicsView)

Bases: object

enterState(node: Node)

Initialize when we enter the state

Parameters

node (Node) – Node which we started to drag

leaveState(scene_pos_x: float, scene_pos_y: float)

Deinit when we leave this state

Parameters
  • scene_pos_x (float) – scene position x

  • scene_pos_y (float) – scene position y

dropNode(node: Node, scene_pos_x: float, scene_pos_y: float)

Code handling the dropping of a node on an existing edge.

Parameters
  • scene_pos_x (float) – scene position x

  • scene_pos_y (float) – scene position y

hotZoneRect(node: Node)QRectF

Returns A QRectF of creating a box around a node

Parameters

node (Node) – Node for which we want to get QRectF describing its position and area

Returns

QRectF describing node’s position and area

Return type

QRectF

update(scene_pos_x: float, scene_pos_y: float)

Updating during mouse move when grView is in this state

Parameters
  • scene_pos_x (float) – scene position x

  • scene_pos_y (float) – scene position y

intersect(node_box: PyQt5.QtCore.QRectF)nodeeditor.node_edge.Edge

Checking for intersection of a rectangle (usually a Node) with edges in the scene

Parameters

node_box (QRectF) – QRectF for which we want find intersecting Edges

Returns

Edge or None if the node is being cut by an Edge

Return type

Edge

isConnected(node: Node)

Return True if node got any connections

Parameters

node (Node) – Node which connections to check

Returns