private void numPosZ_TextChanged(object sender, EventArgs e) { if (_updating) { return; } if (_targetVertices != null) { _mainWindow.VertexChange(_targetVertices); if (_targetVertices.Count == 1) { TargetVertex._weightedPosition._z = numPosZ.Value; TargetVertex.Unweight(); } else { foreach (Vertex3 v in _targetVertices) { v._weightedPosition._z += numPosZ.Value - numPosZ._previousValue; v.Unweight(); } } _mainWindow.VertexChange(_targetVertices); _mainWindow.UpdateModel(); } }
private void numPosY_TextChanged(object sender, EventArgs e) { if (_updating) { return; } if (_targetVertices != null) { if (_targetVertices.Count == 1) { TargetVertex._weightedPosition._y = numPosY.Value; TargetVertex.Unweight(); } else { foreach (Vertex3 v in _targetVertices) { v._weightedPosition._y += numPosY.Value; v.Unweight(); } numPosY.Value = 0; } _mainWindow.UpdateModel(); } }
/// <inheritdoc /> public override int GetHashCode() { var hashCode = 0; unchecked { hashCode ^= SourceVertex.GetHashCode() * 31; hashCode ^= TargetVertex.GetHashCode() * 31; hashCode ^= Weight.GetHashCode() * 31; } return(hashCode); }
/// <inheritdoc /> public override string ToString() { return(string.Format("{0}.{1}[Source={2}, Target={3}, Weight={4}]", GetType().Namespace, GetType().Name, SourceVertex?.ToString(), TargetVertex?.ToString(), Weight?.ToString())); }