private void OnMouseDown(object sender, MouseButtonEventArgs e) { var pt = view1.FindNearestPoint(e.GetPosition(view1)); if (pt.HasValue) { points.Add(pt.Value); } if (points.Count > 1) { var ftv = new FlightVisual3D(points[0], points[1]); view1.Children.Add(ftv); Flights.Add(ftv); points.Clear(); text1.Text = ftv.ToString(); // todo: // zoom the flight path into the view without changing // camera target //var bounds = Visual3DHelper.FindBounds(ftv, Transform3D.Identity); //view1.ZoomExtents(bounds); //view1.Camera.Position=new Point3D()-view1.Camera.LookDirection; //view1.ZoomExtents(bounds,0,false); } }
private void OnMouseMove(object sender, MouseEventArgs e) { var pt = view1.FindNearestPoint(e.GetPosition(view1)); if (pt.HasValue) { double lat, lon; FlightVisual3D.PointToLatLon(pt.Value, out lat, out lon); text2.Text = String.Format("Lat: {0:0.00} Lon: {1:0.00}", lat, lon); } }
private void AddFlight(Airport a, Airport b) { var from = FlightVisual3D.LatLonToPoint(a.Latitude, a.Longitude); var to = FlightVisual3D.LatLonToPoint(b.Latitude, b.Longitude); double lat, lon; FlightVisual3D.PointToLatLon(from, out lat, out lon); var ftv = new FlightVisual3D(from, to) { From = a.City, To = b.City }; view1.Children.Add(ftv); Flights.Add(ftv); }
private void OnMouseDown(object sender, MouseButtonEventArgs e) { var pt = view1.FindNearestPoint(e.GetPosition(view1)); if (pt.HasValue) points.Add(pt.Value); if (points.Count > 1) { var ftv = new FlightVisual3D(points[0], points[1]); view1.Children.Add(ftv); Flights.Add(ftv); points.Clear(); text1.Text = ftv.ToString(); // todo: // zoom the flight path into the view without changing // camera target //var bounds = Visual3DHelper.FindBounds(ftv, Transform3D.Identity); //view1.ZoomExtents(bounds); //view1.Camera.Position=new Point3D()-view1.Camera.LookDirection; //view1.ZoomExtents(bounds,0,false); } }