private void GraphView_MouseMove(object sender, Vector3 position, int button) { if (_interactedNode == null) { return; } _interactedNode.Position = this.transform.InverseTransformPoint(position); _graphView.UpdateNodes(UpdateNodeInfo <BaseNodePresenter> .UpdateNodes(_interactedNode)); Node_MouseMove(_interactedNode, button); }
private void GraphView_MouseMove(object sender, Vector3 position, int button) { if (_interactedNode == null) { return; } _interactedNode.Position = position; _interactedNode.FirstPosition = position; _interactedNode.selected = true; GraphView.UpdateNodes(UpdateNodeInfo <BaseNodePresenter> .UpdateNodes(_interactedNode)); parentChunkedGraphPresenter.Node_MouseMove(_interactedNode, button); }
private void GraphView_MouseMove(object sender, Vector3 position, int button) { if (_interactedNode == null) { return; } _interactedNode.Position = this.transform.InverseTransformPoint(position); //update positions in graph model _forceDirected2D.UpdatePositionInteracted(_interactedNode._nodeModel, position / 0.01f); _graphView.UpdateNodes(UpdateNodeInfo <BaseNodePresenter> .UpdateNodes(_interactedNode)); Node_MouseMove(_interactedNode, button); }
//calls the force directed graph object, to calculate the movement, then applies it private void CalculateForceAndUpdate(float time) { _forceDirected2D.Calculate(time); //get new positions from model and apply to view Dictionary <int, Vector3> positionDict = _forceDirected2D.ApplyCalculation(); foreach (var pos in positionDict) { BaseNodePresenter node = IDToNode(pos.Key); // if (!(node ==_interactedNode)) node.Position = pos.Value * 0.01f; } _graphView.UpdateNodes(UpdateNodeInfo <BaseNodePresenter> .UpdateNodes(_nodePresenters.ToArray())); }