User selects menu item "Add Scan Pattern: Lawnmower" (or Interleaved, Creeping Line, etc...)
[write code for Interleaved now, defer others until later]
A new WaypointScanArea is generated using all defaults.
The WaypointScanArea.Outline is a simple square polygon oriented north-south with default dimensions = 1000 feet x 1000 feet. It is displayed as a wide semitransparent purple line.
A purple pentagon is displayed at each vertice of WaypointScanArea.Outline. The user will drag these pentagons to change the shape of the polygon.
If a waypoint was not selected by the user (Context.WaypointSelected==null), select the last waypoint in the WaypointList.
The corner of the WaypointScanArea will initially coincide with the selected waypoint. Which corner?: The user would probably like to keep the plane progressing in the same general direction as it was flying when it came to the selected waypoint. So, choose the corner which will put the scan area square as far as possible from the waypoint prior to the selected waypoint. For example, in this diagram, the waypoint is to the southeast of selected waypoint, so we locate the southeast corner of the scan area on top of the selected waypoint. The user will be able to drag the vertices if this isn't what he wants.
If there are no waypoints in the WaypointList, center the scan area on the current displayed area.
The WaypointScanArea.ScanDirection is represented by semitransparent wide arrow. The base of the arrow is located at the center of the WaypointScanArea. The length is fixed. (make always i.e. 1/5 of the position display window width/height?) The user may drag the tip of the arrow to change the scan direction.
In the WaypointScanArea structure, we set WaypointScanArea.WaypointPrevious to the selected waypoint (WaypointList[2] in this example), and WaypointScanArea.WaypointNext to the waypoint which followed the selected waypoint (WaypointList[3] in this example), or to null if the selected waypoint is the last in WaypointList. If there are no waypoints in the WaypointList, set both WaypointPrevious and WaypointNext to null.
This new WaypointScanArea is appended to WaypointList.WaypointScanAreaList.
|