Beispiel #1
0
        private void AddFuncletLink(Funclet subParent, int iLineParent, Funclet subChild, int iLineChild,
            ConnectionType linetype, int dis_turn)
        {
            if ((subParent == null) || (subChild == null))
            {
                return;
            }

            int iLink = lstFuncsLink.Count;
            int nPoints = (linetype == ConnectionType.StraightLine) ? 2 : 3;
            Point[] pts = new Point[nPoints];

            pts[0] = subParent.OutPoint(iLineParent);
            pts[nPoints - 1] = subChild.InPoint(iLineChild);
            if (nPoints == 3)
            {
                pts[1] = new Point(pts[2].X - dis_turn, pts[2].Y);
            }
            lstFuncsLink.Add(new LinkDot(pts, penLinks, false));
            subParent.OutConnectionOrder(iLineParent, iLink);
            subChild.InConnectionOrder(iLineChild, iLink);

            if (subParent is GraphConcat)
            {
                GraphConcat graphConcatTmp = (GraphConcat)subParent;

                if (graphConcatTmp != null)
                {
                    for (int i = 0; i < graphConcatTmp.InputFunclets.Count; i++)
                    {
                        AddFuncletLink(graphConcatTmp.InputFunclets[i], 0, subParent, i + 1, ConnectionType.Polyline, LinkDot.DISTURN);
                    }
                }
            }

            if (subParent.InputFunclets.Count == 1)
            {
                AddFuncletLink(subParent.InputFunclets[0], 0, subParent, 0, ConnectionType.Polyline, LinkDot.DISTURN);
            }
        }