Track Planner Class Structure

The following diagram shows the basic class structure of the application.

As can be seen, a Layout is the top level object. It has a collection of Track Elements and a collection of Points. Track Elements are joined through their TrackEndPoints by Points.

A Track Element has a minimum of 2 TrackEndPoints. A straight or curving section of track is an example of a Track Element with two TrackEndPoints. A 'point', or 'cross-over', or 'slip' are examples of a Track Element with more than two EndPoints.

A Point maintains a link to TrackEndPoints that reference it.

A Point or a Track Element can be selected. It can be moved, deleted, or have its properties altered. A single mouse-click at a Point selects the Point. A single mouse-click on the body of a Track Element selects the Track Element.

All of these objects have a Dispose method, which cascades the disposal of referenced objects.

The Layout object has a Render method which calls the Render method of all the Track Elements in its collection. The Render method of each Track Element in turn calls the Render method of each TrackEndPoint in its collection.

Track Planner - Home
8th July 2008
1