示例#1
0
        public override void OnDraw(object dc, double zoom)
        {
            var canvas = dc as SKCanvas;

            if (Line.IsStroked)
            {
                if (Style.LineStyle.IsCurved)
                {
                    canvas.DrawPath(CurveGeometry, Stroke);
                }
                else
                {
                    canvas.DrawLine(P0, P1, Stroke);
                }

                if (Style.StartArrowStyle.ArrowType != ArrowType.None)
                {
                    StartMarker?.Draw(dc);
                }

                if (Style.EndArrowStyle.ArrowType != ArrowType.None)
                {
                    EndMarker?.Draw(dc);
                }
            }
        }
示例#2
0
        private void UpdateMarkers()
        {
            double x1 = Line.Start.X;
            double y1 = Line.Start.Y;
            double x2 = Line.End.X;
            double y2 = Line.End.Y;

            if (Style.Stroke.StartArrow.ArrowType != ArrowType.None)
            {
                double a1 = Math.Atan2(y1 - y2, x1 - x2);
                StartMarker = CreateArrowMarker(x1, y1, a1, Style, Style.Stroke.StartArrow);
                StartMarker.UpdateStyle();
                P0 = (StartMarker as MarkerBase).Point;
            }
            else
            {
                StartMarker = null;
                P0          = new SKPoint((float)x1, (float)y1);
            }

            if (Style.Stroke.EndArrow.ArrowType != ArrowType.None)
            {
                double a2 = Math.Atan2(y2 - y1, x2 - x1);
                EndMarker = CreateArrowMarker(x2, y2, a2, Style, Style.Stroke.EndArrow);
                EndMarker.UpdateStyle();
                P1 = (EndMarker as MarkerBase).Point;
            }
            else
            {
                EndMarker = null;
                P1        = new SKPoint((float)x2, (float)y2);
            }
        }
示例#3
0
        public override void OnDraw(object dc, double zoom)
        {
            var context = dc as AM.DrawingContext;

            if (Line.IsStroked)
            {
                if (Style.LineStyle.IsCurved)
                {
                    context.DrawGeometry(null, Stroke, CurveGeometry);
                }
                else
                {
                    context.DrawLine(Stroke, P0, P1);
                }

                if (Style.StartArrowStyle.ArrowType != ArrowType.None)
                {
                    StartMarker?.Draw(dc);
                }

                if (Style.EndArrowStyle.ArrowType != ArrowType.None)
                {
                    EndMarker?.Draw(dc);
                }
            }
        }
示例#4
0
        private void UpdateMarkers()
        {
            double x1 = Line.Start.X;
            double y1 = Line.Start.Y;
            double x2 = Line.End.X;
            double y2 = Line.End.Y;

            Line.GetMaxLength(ref x1, ref y1, ref x2, ref y2);

            if (Style.StartArrowStyle.ArrowType != ArrowType.None)
            {
                double a1 = Math.Atan2(y1 - y2, x1 - x2);
                StartMarker = CreatArrowMarker(x1, y1, a1, Style.StartArrowStyle);
                StartMarker.UpdateStyle();
                P0 = (StartMarker as Marker).Point;
            }
            else
            {
                StartMarker = null;
                P0          = new A.Point(x1, y1);
            }

            if (Style.EndArrowStyle.ArrowType != ArrowType.None)
            {
                double a2 = Math.Atan2(y2 - y1, x2 - x1);
                EndMarker = CreatArrowMarker(x2, y2, a2, Style.EndArrowStyle);
                EndMarker.UpdateStyle();
                P1 = (EndMarker as Marker).Point;
            }
            else
            {
                EndMarker = null;
                P1        = new A.Point(x2, y2);
            }
        }
            public override void UpdateInterpolatedMarker(float interp)
            {
                InterpolatedMarker = StartMarker.Lerp(EndMarker, interp);
                Vector pos = StartMarker.Lerp(EndMarker, 0.5f);

                _triangulationPosition[0] = pos.X;
                _triangulationPosition[1] = pos.Y;
            }
示例#6
0
    public void AddMarker(Coordinate coords)
    {
        StartMarker marker = Instantiate(markerPrefab, transform, true);

        marker.Init(coords);
        marker.UpdatePosition(map, mapCamera.transform.rotation);
        markers.Add(marker);
    }
示例#7
0
    void Start()
    {
        initialPosition = transform.position;
        initialRotation = transform.rotation;

        startMarker = Instantiate(carStartPrefab, transform.position, Quaternion.identity).GetComponent <StartMarker>();
        startMarker.transform.Rotate(new Vector3(90f, 0, 0));
        startMarker.Init(this, color);

        trail = Instantiate(trailPrefab, Vector3.zero, Quaternion.identity).GetComponent <Trail>();
        trail.Init(this, plane, linkedParking);
    }
示例#8
0
        public override void UpdateStyle()
        {
            base.UpdateStyle();

            if (Style.Stroke.StartArrow.ArrowType != ArrowType.None)
            {
                StartMarker?.UpdateStyle();
            }

            if (Style.Stroke.EndArrow.ArrowType != ArrowType.None)
            {
                EndMarker?.UpdateStyle();
            }
        }
示例#9
0
        public override void OnDraw(object dc, double zoom)
        {
            var canvas = dc as SKCanvas;

            if (Line.IsStroked)
            {
                canvas.DrawLine(P0, P1, Stroke);

                if (Style.Stroke.StartArrow.ArrowType != ArrowType.None)
                {
                    StartMarker?.Draw(dc);
                }

                if (Style.Stroke.EndArrow.ArrowType != ArrowType.None)
                {
                    EndMarker?.Draw(dc);
                }
            }
        }
示例#10
0
        public override void OnDraw(object dc, double zoom)
        {
            var context = dc as AM.DrawingContext;

            if (Line.IsStroked)
            {
                context.DrawLine(Stroke, P0, P1);

                if (Style.Stroke.StartArrow.ArrowType != ArrowType.None)
                {
                    StartMarker?.Draw(dc);
                }

                if (Style.Stroke.EndArrow.ArrowType != ArrowType.None)
                {
                    EndMarker?.Draw(dc);
                }
            }
        }
示例#11
0
 public string ToWorkshop(OutputLanguage language) => StartMarker.NumberOfActionsToMarker(EndMarker).ToString();
示例#12
0
 public override void UpdateInterpolatedMarker(float interp)
 {
     InterpolatedMarker = StartMarker.Lerp(EndMarker, interp);
 }