Ejemplo n.º 1
0
        private static void OnFieldOfViewChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            ARPanel panel = (ARPanel)d;

            panel._cameraProjection = null;
            panel.InvalidateArrange();
        }
Ejemplo n.º 2
0
        private void AddHeadingDots(ARPanel panel)
        {
            var textForeground = new SolidColorBrush(Color.FromArgb(255, 96, 96, 96));

            //Go 360 along the horizon to display heading text
            for (double azimuth = 20; azimuth < 360; azimuth += 20)
            {
                if (azimuth % 90 == 0) continue; //skip cardinal directions, since we already added markers for those in xaml
                TextBlock tb = new TextBlock() { Text = string.Format("{0}°", azimuth), Foreground = textForeground };
                ARPanel.SetDirection(tb, new Point(0, azimuth));
                panel.Children.Add(tb);
            }
            //Display an up/down angle for each cardinal direction
            for (int i = 0; i < 360; i += 180)
            {
                for (int alt = -80; alt < 90; alt += 10)
                {
                    if (alt == 0) continue; //skip cardinal directions, since we already added markers for those in xaml
                    TextBlock tb = new TextBlock() { Text = string.Format("{0}", alt), Foreground = textForeground };
                    ARPanel.SetDirection(tb, new Point(alt, i));
                    panel.Children.Add(tb);
                }
            }
        }
Ejemplo n.º 3
0
        private void PositionStation(ARPanel arPanel)
        {
            this.Model.Positions = new List<StationStat>(this.Model.Positions.Where(c => c.End.Time > DateTime.Now));

            var forecast = this.Model.Positions[0];
            var startPosition = forecast.Start;
            var topPosition = forecast.Top;
            var endPosition = forecast.End;

            //  double angle = GetPositionAngle(forecast, startPosition);
            AddMarker(forecast, startPosition, Color.FromArgb(100, 0, 200, 0));
            AddMarker(forecast, topPosition, Color.FromArgb(100, 255, 255, 0));
            AddMarker(forecast, endPosition, Color.FromArgb(100, 200, 0, 0));
        }
Ejemplo n.º 4
0
        private void PositionStars(ARPanel arPanel, GeoCoordinate coordinates)
        {
            foreach (var star in Model.Data.Data)
            {

                var point = StarUtils.CalculatePosition(coordinates, star);

                if (point.X > 0)
                {
                    var starBightness = 6 - star.Mag;
                    Color color = StarUtils.GetStarColor(star.Color);
                    var ellipse = new Ellipse { Fill = new SolidColorBrush(color), Width = starBightness, Height = starBightness, Stroke = new SolidColorBrush(color) { Opacity = 0.5 }, StrokeThickness = 1 };

                    arPanel.Children.Add(ellipse);
                    ARPanel.SetDirection(ellipse, point);
                }
            }
        }