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); if ((type & makrup.SupportLines) == 0) { return(false); } 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 static IEnumerable <IFillerVertex> GetBeginCandidates(Markup markup) { foreach (var intersect in markup.Intersects) { yield return(new IntersectFillerVertex(intersect.Pair)); } foreach (var enter in markup.Enters) { foreach (var point in enter.Points) { yield return(new EnterFillerVertex(point, Alignment.Centre)); if (point.IsSplit) { yield return(new EnterFillerVertex(point, Alignment.Left)); yield return(new EnterFillerVertex(point, Alignment.Right)); } } } }
public static MarkupLine FromStyle(Markup markup, MarkupPointPair pointPair, Style.StyleType style) { switch (style & Style.StyleType.GroupMask) { case Style.StyleType.StopLine: return(new MarkupStopLine(markup, pointPair, (StopLineStyle.StopLineType)(int) style)); case Style.StyleType.Crosswalk: return(new MarkupCrosswalkLine(markup, pointPair, (CrosswalkStyle.CrosswalkType)(int) style)); case Style.StyleType.RegularLine: default: var regularStyle = (RegularLineStyle.RegularLineType)(int) style; if (regularStyle == RegularLineStyle.RegularLineType.Empty) { return(pointPair.IsNormal ? new MarkupNormalLine(markup, pointPair) : new MarkupRegularLine(markup, pointPair)); } else { return(pointPair.IsNormal ? new MarkupNormalLine(markup, pointPair, regularStyle) : new MarkupRegularLine(markup, pointPair, regularStyle)); } } }
public static bool FromXml(XElement config, Markup markup, ObjectsMap map, out EnterFillerVertexBase enterPoint) { var pointId = config.GetAttrValue <int>(MarkupPoint.XmlName); if (MarkupPoint.FromId(pointId, markup, map, out MarkupPoint point)) { var lineId = config.GetAttrValue <ulong>(MarkupLine.XmlName); if (markup.TryGetLine(lineId, map, out MarkupRegularLine line)) { enterPoint = new LineEndFillerVertex(point, line); } else { enterPoint = new EnterFillerVertex(point); } return(true); } else { enterPoint = null; return(false); } }
public static bool FromId(int id, Markup markup, ObjectsMap map, out MarkupPoint point) { point = null; var enterId = GetEnter(id); var num = GetNum(id); var type = GetType(id); switch (markup.Type) { case MarkupType.Node when map.TryGetValue(new ObjectId() { Segment = enterId }, out ObjectId targetSegment): enterId = targetSegment.Segment; break; case MarkupType.Segment when map.TryGetValue(new ObjectId() { Node = enterId }, out ObjectId targetNode): enterId = targetNode.Node; break; } if (map.TryGetValue(new ObjectId() { Point = GetId(enterId, num, type) }, out ObjectId targetPoint)) { num = GetNum(targetPoint.Point); } return(markup.TryGetEnter(enterId, out Enter enter) && enter.TryGetPoint(num, type, out point)); }
public static List <IFillerVertex> GetBeginCandidates(Markup markup) { var points = new List <IFillerVertex>(); foreach (var intersect in markup.Intersects) { points.Add(new IntersectFillerVertex(intersect.Pair)); } foreach (var enter in markup.Enters) { foreach (var point in enter.Points) { points.Add(new EnterFillerVertex(point, Alignment.Centre)); if (point.IsSplit) { points.Add(new EnterFillerVertex(point, Alignment.Left)); points.Add(new EnterFillerVertex(point, Alignment.Right)); } } } return(points); }
public MarkupRegularLine(Markup markup, MarkupPointPair pointPair) : base(markup, pointPair) { }
private void ClipSidewalkChanged() => Markup.Update(this, true, false);
private void AlignmentChanged() => Markup.Update(this, true, true);
public MarkupRegularLine(Markup markup, MarkupPoint first, MarkupPoint second, RegularLineStyle style = null, Alignment alignment = Alignment.Centre, bool update = true) : this(markup, MarkupPointPair.FromPoints(first, second, out bool invert), style, !invert ? alignment : alignment.Invert(), update) { }
public MarkupCrosswalkLine(Markup markup, MarkupPointPair pointPair, CrosswalkStyle.CrosswalkType crosswalkType = CrosswalkStyle.CrosswalkType.Existent) : base(markup, pointPair, false) { Crosswalk = new MarkupCrosswalk(Markup, this, crosswalkType); Update(true); Markup.AddCrosswalk(Crosswalk); }
public MarkupEnterLine(Markup markup, MarkupPoint first, MarkupPoint second) : base(markup, first, second, RegularLineStyle.RegularLineType.Dashed) { }
protected override void RuleChanged() => Markup.Update(this, true);
public MarkupStopLine(Markup markup, MarkupPointPair pointPair, StopLineStyle.StopLineType lineType = StopLineStyle.StopLineType.Solid) : base(markup, pointPair, lineType) { }
public static bool TryGetMarkup(ushort nodeId, out Markup markup) => NodesMarkup.TryGetValue(nodeId, out markup);
private void RuleChanged() => Markup.Update(this);
public MarkupLine(Markup markup, MarkupPointPair pointPair, Style.StyleType lineType) : this(markup, pointPair, TemplateManager.GetDefault <LineStyle>(lineType)) { }
public MarkupLine(Markup markup, MarkupPointPair pointPair, LineStyle lineStyle) : this(markup, pointPair) { AddRule(lineStyle, false, false); RecalculateDashes(); }
public MarkupLine(Markup markup, MarkupPoint first, MarkupPoint second) : this(markup, new MarkupPointPair(first, second)) { }
protected MarkupRegularLine(Markup markup, MarkupPointPair pointPair, bool update = true) : base(markup, pointPair, update) { }
protected MarkupLine(Markup markup, MarkupPoint first, MarkupPoint second, bool update = true) : this(markup, new MarkupPointPair(first, second), update) { }
public MarkupRegularLine(Markup markup, MarkupPointPair pointPair) : base(markup, pointPair) { RecalculateStyleData(); }
public Dependences GetDependences() => Markup.GetLineDependences(this);
protected virtual void RuleChanged() => Markup.Update(this, true);
protected MarkupStraightLine(Markup markup, MarkupPoint first, MarkupPoint second, StyleType styleType) : this(markup, new MarkupPointPair(first, second), styleType) { }
protected void CrosswalkChanged() => Markup.Update(this, true, true);
protected MarkupRegularLine(Markup markup, MarkupPointPair pointPair, bool update = true) : base(markup, pointPair, update) { RecalculateStyleData(); }
private void FillerChanged() => Markup?.Update(this, true);
public FillerContour(Markup markup) { Markup = markup; }
public MarkupNormalLine(Markup markup, MarkupPointPair pointPair, RegularLineStyle.RegularLineType lineType) : base(markup, pointPair, lineType) { }