public IEnumerable <Point> ComputeLinePoints(Point start, Point end, LineType lineType, double middlePosition, out double startAngle, out double endAngle) { ConnectorDocking startPointDocking = (ConnectorDocking)((int)lineType >> 8); ConnectorDocking endPointDocking = (ConnectorDocking)((int)lineType & 0xFF); //var pf = ConnectorUtilities.GetPathFigureFromPoints(new Point[] { start, end }); startAngle = ConnectorUtilities.ComputeAngle(startPointDocking, end - start); endAngle = ConnectorUtilities.ComputeAngle(endPointDocking, end - start); return(new[] { start, end }); }
public IEnumerable <Point> ComputeLinePoints(Point start, Point end, LineType lineType, double middlePosition, out double startAngle, out double endAngle) { //var lineType = (LineType)((int)startDocking << 8 | (int)endDocking); var linePoints = _routingAssistent.GetLinePoints(lineType, start, end, middlePosition); var inVector = new Vector { X = linePoints.ElementAt(1).X - linePoints.ElementAt(0).X, Y = linePoints.ElementAt(1).Y - linePoints.ElementAt(0).Y }; startAngle = ConnectorUtilities.ComputeAngle(_model.StartPointDocking, inVector); var outVector = new Vector { X = linePoints.Last().X - linePoints.ElementAt(linePoints.Count() - 2).X, Y = linePoints.Last().Y - linePoints.ElementAt(linePoints.Count() - 2).Y }; endAngle = ConnectorUtilities.ComputeAngle(_model.EndPointDocking, outVector); return(linePoints); }