00001 using System;
00002 using System.Collections.Generic;
00003 using System.ComponentModel;
00004 using System.Data;
00005 using System.Drawing;
00006 using System.Linq;
00007 using System.Text;
00008 using System.Windows.Forms;
00009
00010 namespace system_controller {
00011 public partial class RacePlotterForm : Form {
00012 bool _selectFiducials = false;
00013 RacePlotterStrategy _strategy;
00014
00015 public RacePlotterForm() {
00016 InitializeComponent();
00017 _strategy = new RacePlotterStrategy();
00018 }
00019
00020 private void fiducialsToolStripMenuItem_Click(object sender, EventArgs e) {
00021 _selectFiducials = true;
00022 }
00023
00024 private void raceMapPictureBox_Click(object sender, EventArgs e) {
00025 if (_selectFiducials == true) {
00026 Bitmap b = new Bitmap(mapPictureBox.Image);
00027 _strategy.drawClickedWaypoint(ref b, (int)(e.X * ((double)(b.Width)
00028 / (double)(mapPictureBox.Width)))
00029 , (int)(e.Y * ((double)(b.Height) / (double)(raceMapPictureBox.Height))));
00030 raceMapPictureBox.Image = b;
00031 raceMapPictureBox.Invalidate();
00032 _pointPicker = new PointPickerForm(_data.Parser.UtmPointSetList);
00033 _pointPicker.waypointSelectEvent += onWaypointSelect;
00034 _pointPicker.waypointSelectCancelEvent += onWaypointSelectCancel;
00035 _pointPicker.Show();
00036 }
00037 }
00038 }
00039 }