Пример #1
0
 /// <summary>
 /// 为某个指定的目标连接器进行导航
 /// </summary>
 /// <param name="source">起始连接器</param>
 /// <param name="sink">终止位置</param>
 /// <returns></returns>
 internal List<Point> Route(ConnectorInfo source, Point sinkPoint)
 {
     return new List<Point>
     {
         source.Position,
         sinkPoint
     };
 }
Пример #2
0
        /// <summary>
        /// 为某个指定的目标位置导航
        /// </summary>
        /// <param name="source">起始连接器</param>
        /// <param name="sinkPoint">目标位置</param>
        /// <param name="preferredOrientation">目标连接器的方向</param>
        /// <returns></returns>
        internal List<Point> Route(ConnectorInfo source, ConnectorInfo sink)
        {
            var linePoints = new List<Point>();

            var start = RectAlgorithm.CalcCrossPoint(source.DesignerItemRect, sink.Position);

            var end = RectAlgorithm.CalcCrossPoint(sink.DesignerItemRect, source.Position);

            linePoints.Insert(0, start);
            linePoints.Add(end);

            return linePoints;
        }
Пример #3
0
 private static ConnectorInfo GetConnectorInfo(DesignerItemContainer item, Point relative)
 {
     var info = new ConnectorInfo();
     info.DesignerItemRect = item.GetRect();
     info.Position = RectAlgorithm.GetRectAbsolute(info.DesignerItemRect, relative);
     return info;
 }
Пример #4
0
 /// <summary>
 /// 为某个指定的目标位置导航
 /// </summary>
 /// <param name="source">起始连接器</param>
 /// <param name="sinkPoint">目标位置</param>
 /// <param name="preferredOrientation">目标连接器的方向</param>
 /// <returns></returns>
 internal static PathGeometry DarwGeometry(ConnectorInfo source, Point sinkPoint)
 {
     var points = _router.Route(source, sinkPoint);
     var res = GenerateGeometry(points);
     return res;
 }
Пример #5
0
        internal ConnectorInfo GetInfo()
        {
            var info = new ConnectorInfo();

            info.DesignerItemRect = this.ParentDesignerItem.GetRect();
            info.Position = this.Position;

            return info;
        }