示例#1
0
        public static IEnumerable <MarkupStylePart> CalculateDashed(ITrajectory trajectory, float dashLength, float spaceLength, DashedGetter calculateDashes)
        {
            List <PartT> partsT;

            switch (trajectory)
            {
            case BezierTrajectory bezierTrajectory:
                partsT = CalculateDashesBezierT(bezierTrajectory, dashLength, spaceLength);
                break;

            case StraightTrajectory straightTrajectory:
                partsT = CalculateDashesStraightT(straightTrajectory, dashLength, spaceLength);
                break;

            default:
                yield break;
            }

            foreach (var partT in partsT)
            {
                foreach (var part in calculateDashes(trajectory, partT.Start, partT.End))
                {
                    yield return(part);
                }
            }
        }
示例#2
0
        public static IEnumerable <MarkupStyleDash> CalculateDashed(ILineTrajectory trajectory, float dashLength, float spaceLength, DashedGetter calculateDashes)
        {
            List <DashT> dashesT;

            switch (trajectory)
            {
            case BezierTrajectory bezierTrajectory:
                dashesT = CalculateDashesBezierT(bezierTrajectory, dashLength, spaceLength);
                break;

            case StraightTrajectory straightTrajectory:
                dashesT = CalculateDashesStraightT(straightTrajectory, dashLength, spaceLength);
                break;

            default:
                yield break;
            }

            foreach (var dashT in dashesT)
            {
                foreach (var dash in calculateDashes(trajectory, dashT.Start, dashT.End))
                {
                    yield return(dash);
                }
            }
        }