Esempio n. 1
0
    void MakeVisualLine(Line line, LineType type, out int retLinkID)
    {
        retLinkID = -1;

        var startPos = GetUnityPosition(new VectorMapPosition()
        {
            Bx = points[line.BPID - 1].Bx, Ly = points[line.BPID - 1].Ly, H = points[line.BPID - 1].H
        });
        var endPos = GetUnityPosition(new VectorMapPosition()
        {
            Bx = points[line.FPID - 1].Bx, Ly = points[line.FPID - 1].Ly, H = points[line.FPID - 1].H
        });

        if (type == LineType.STOP) //If it is stopline
        {
            int LinkID = FindNearestLaneId(GetVectorMapPosition((startPos + endPos) / 2), true);
            retLinkID = LinkID;
            var vmStopline = StopLine.MakeStopLine(stoplines.Count + 1, line.LID, 0, 0, LinkID);
            stoplines.Add(vmStopline);
        }
        else if (type == LineType.WHITE || type == LineType.YELLOW) //if it is whiteline
        {
            int LinkID = FindNearestLaneId(GetVectorMapPosition((startPos + endPos) / 2));
            retLinkID = LinkID;
            string color = "W";
            switch (type)
            {
            case LineType.WHITE:
                color = "W";
                break;

            case LineType.YELLOW:
                color = "Y";
                break;
            }
            var vmWhiteline = WhiteLine.MakeWhiteLine(whiteLines.Count + 1, line.LID, .15, color, 0, LinkID);
            whiteLines.Add(vmWhiteline);
        }
    }
Esempio n. 2
0
        void MakeVisualLine(Line line, LineType type, out int retLinkID)
        {
            retLinkID = 0;

            var startPos = VectorMapUtility.GetUnityPosition(new VectorMapPosition()
            {
                Bx = Points[line.BPID - 1].Bx, Ly = Points[line.BPID - 1].Ly, H = Points[line.BPID - 1].H
            }, MapAnnotationTool.EXPORT_SCALE_FACTOR);
            var endPos = VectorMapUtility.GetUnityPosition(new VectorMapPosition()
            {
                Bx = Points[line.FPID - 1].Bx, Ly = Points[line.FPID - 1].Ly, H = Points[line.FPID - 1].H
            }, MapAnnotationTool.EXPORT_SCALE_FACTOR);

            if (type == LineType.STOP) //If it is stopline
            {
                int LinkID = FindNearestLaneId(VectorMapUtility.GetVectorMapPosition((startPos + endPos) / 2, MapAnnotationTool.EXPORT_SCALE_FACTOR), true);
                retLinkID = LinkID;
                var vmStopline = StopLine.MakeStopLine(StopLines.Count + 1, line.LID, 0, 0, LinkID);
                StopLines.Add(vmStopline);
            }
            else if (type == LineType.WHITE || type == LineType.YELLOW) //if it is whiteline
            {
                int LinkID = FindNearestLaneId(VectorMapUtility.GetVectorMapPosition((startPos + endPos) / 2, MapAnnotationTool.EXPORT_SCALE_FACTOR));
                retLinkID = LinkID;
                string color = "W";
                switch (type)
                {
                case LineType.WHITE:
                    color = "W";
                    break;

                case LineType.YELLOW:
                    color = "Y";
                    break;
                }
                var vmWhiteline = WhiteLine.MakeWhiteLine(WhiteLines.Count + 1, line.LID, .15, color, 0, LinkID);
                WhiteLines.Add(vmWhiteline);
            }
        }