Example #1
0
        public MarkupCrosswalk(Markup markup, MarkupCrosswalkLine line, CrosswalkStyle style, MarkupRegularLine rightBorder = null, MarkupRegularLine leftBorder = null)
        {
            Markup        = markup;
            CrosswalkLine = line;
            CrosswalkLine.TrajectoryGetter = GetTrajectory;

            RightBorder          = new PropertyClassValue <MarkupRegularLine>("RB", CrosswalkChanged, rightBorder);
            LeftBorder           = new PropertyClassValue <MarkupRegularLine>("LB", CrosswalkChanged, leftBorder);
            style.OnStyleChanged = CrosswalkChanged;
            Style = new PropertyClassValue <CrosswalkStyle>(StyleChanged, style);

            CrosswalkLine.Start.Enter.TryGetPoint(CrosswalkLine.Start.Num, MarkupPoint.PointType.Enter, out MarkupPoint startPoint);
            CrosswalkLine.End.Enter.TryGetPoint(CrosswalkLine.End.Num, MarkupPoint.PointType.Enter, out MarkupPoint endPoint);
            EnterLine = new MarkupEnterLine(Markup, startPoint, endPoint);
        }
Example #2
0
        public MarkupLine GetCommonLine(IFillerVertex other)
        {
            switch (other)
            {
            case EnterSupportPoint otherE:
                if (Enter == otherE.Enter || !(Point.Lines.Intersect(otherE.Point.Lines).FirstOrDefault() is MarkupLine line))
                {
                    line = new MarkupEnterLine(Point.Markup, Point, otherE.Point);
                }
                return(line);

            case IntersectSupportPoint otherI:
                return(otherI.LinePair.First.ContainsPoint(Point) ? otherI.LinePair.First : otherI.LinePair.Second);

            default:
                return(null);
            }
        }