public void OnUnLinked(Graph graph, AbstractSocket s01, AbstractSocket s02) { Log.Info("OnUnLinked: Socket " + s02 + " and Socket " + s02); var input = s01.IsInput() ? s01 : s02; graph.UpdateDependingNodes(input.Parent); }
public void UnLink(AbstractSocket socket) { if (socket == null || !socket.IsConnected()) { return; } if (socket.IsInput()) { InputSocket inputSocket = (InputSocket)socket; if (inputSocket.Edge != null) { UnLink(inputSocket, inputSocket.Edge.Output); } } if (socket.IsOutput()) { OutputSocket outputSocket = (OutputSocket)socket; Edge[] edgeCopy = new Edge[outputSocket.Edges.Count]; outputSocket.Edges.CopyTo(edgeCopy); foreach (var edge in edgeCopy) { UnLink(edge.Input, outputSocket); } } }
public static Vector2 GetTangentPosition(AbstractSocket socket, Vector2 position) { if (socket.IsInput()) { return(position + Vector2.left * BonConfig.EdgeTangent); } return(position + Vector2.right * BonConfig.EdgeTangent); }
public AbstractSocket GetOtherSocket(AbstractSocket socket) { if (socket == Input) { return(Output); } return(Input); }
public static Vector2 GetEdgePosition(AbstractSocket socket, Vector2 position) { if (socket.Parent.Collapsed) { float width = BonConfig.SocketSize; if (socket.IsOutput()) { width = 0; } position.Set(socket.X + width, socket.Parent.WindowRect.y + 8); } else { float width = 0; if (socket.IsOutput()) { width = BonConfig.SocketSize; } position.Set(socket.X + width, socket.Y + BonConfig.SocketSize / 2f); } return(position); }
/// <summary> Returns true if this node contains the assigned socket.</summary> /// <param name="socket"> The socket to use.</param> /// <returns>True if this node contains the assigned socket.</returns> public bool ContainsSocket(AbstractSocket socket) { return(Sockets.Contains(socket)); }
public void OnUnLink(Graph graph, AbstractSocket s01, AbstractSocket s02) { // Log.Info("OnUnLink: Node " + s01.Edge.Output.Parent.Id + " from Node " + s02.Edge.Input.Parent.Id); }