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); } } }
//private double GetPositionAngle(StationStat forecast, ISSPosition position) //{ //} private void AddMarker(StationStat forecast, ISSPosition startPosition, Color color) { SpotData spotData; // ArrorMarkerControl rectangle; Point point; spotData = this.GetSpotData(forecast.Start, forecast.Brightness); var rectangle = new ArrorMarkerControl { Width = 120, Height = 450 }; // new Rectangle { Width = 90, Height = 90, RadiusX = 90, RadiusY = 60, Fill = new SolidColorBrush(color) }; // var rectangle =new Rectangle { Width = 90, Height = 90, RadiusX = 90, RadiusY = 60, Fill = new SolidColorBrush(color) }; arPanel.Children.Add(rectangle); point = new Point(startPosition.Altitute, startPosition.Azimuth); ARPanel.SetDirection(rectangle, point); rectangle.DataContext = spotData; //rectangle.Tap += (s, e) => //{ //}; }
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); } } }