Exemplo n.º 1
0
        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);
        }
Exemplo n.º 2
0
        public static bool FromXml(XElement config, Markup markup, Dictionary <ObjectId, ObjectId> map, out IntersectFillerVertex linePoint)
        {
            var lineId1 = config.GetAttrValue <ulong>(MarkupPointPair.XmlName1);
            var lineId2 = config.GetAttrValue <ulong>(MarkupPointPair.XmlName2);

            if (markup.TryGetLine(lineId1, map, out MarkupLine line1) && markup.TryGetLine(lineId2, map, out MarkupLine line2))
            {
                linePoint = new IntersectFillerVertex(line1, line2);
                return(true);
            }
            else
            {
                linePoint = null;
                return(false);
            }
        }
Exemplo n.º 3
0
        public static bool FromXml(XElement config, Markup makrup, Dictionary <ObjectId, ObjectId> map, out MarkupLine line)
        {
            var lineId = config.GetAttrValue <ulong>(nameof(Id));

            MarkupPointPair.FromHash(lineId, makrup, map, out MarkupPointPair pointPair);
            if (!makrup.TryGetLine(pointPair.Hash, out line))
            {
                line = new MarkupLine(makrup, pointPair);
                return(true);
            }
            else
            {
                return(false);
            }
        }
Exemplo n.º 4
0
        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);
            }
        }