public static bool FromXml(XElement config, Markup makrup, ObjectsMap map, out MarkupLine line, out bool invert) { var lineId = config.GetAttrValue <ulong>(nameof(Id)); if (!MarkupPointPair.FromHash(lineId, makrup, map, out MarkupPointPair pointPair, out invert)) { line = null; return(false); } if (!makrup.TryGetLine(pointPair, out line)) { var type = (LineType)config.GetAttrValue("T", (int)pointPair.DefaultType); switch (type) { case LineType.Regular: line = new MarkupRegularLine(makrup, pointPair); break; case LineType.Stop: line = new MarkupStopLine(makrup, pointPair); break; case LineType.Crosswalk: line = new MarkupCrosswalkLine(makrup, pointPair); break; default: return(false); } } return(true); }
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); }
public CrosswalkBorderEdge(MarkupCrosswalkLine crosswalkLine, BorderPosition border) : base() { CrosswalkLine = crosswalkLine; Border = border; Update(); }
public CrosswalkBorderEdge(MarkupCrosswalkLine crosswalkLine, BorderPosition border) : base(crosswalkLine.Trajectory.Position(crosswalkLine.GetT(border))) { CrosswalkLine = crosswalkLine; Border = border; }