Mapper  0.9.0
API documentation
Code overview
Date
2013-08-31
Author
Kai Pastor
Thomas Schöps
Todo:
Review and update the code overview.

Core

Map is a (too) huge class which represents a complete map. It contains dynamic arrays of:

It also keeps track of the currently selected map objects and contains an UndoManager object.

Furthermore, it has a MapRenderables renderables whose purpose will be explained soon, and contains the settings for the georeferencing and for printing / exporting the map.

Most features of a map are represented by Object. All map objects have got coordinates, which are stored as a dynamic array of MapCoord. A PointObject has got a single coordinate. A TextObject has got either one coordinate (representing a single anchor point) or two coordinate (representing a text box). For a text box, the first coordinate gives the center of the box, and the second one its width and height. For a PathObject, the coordinates are interpreted as a path, i.e. a line consisting of polygonal and/or cubic bezier curve segments.

To define paths with different kind of segments, the MapCoord objects store extra flags:

For path objects, the coordinates are also processed into another form which approximates the path using only straight line segments: a vector of PathCoord. These coordinates also contain information about the cumulative path length, the parameter value if generated from a bezier curve, and from which segment of the original coordinates they were generated.

Rendering

The process to display map objects works like this:

GUI

The topmost application windows are provided by the MainWindow class. It is just responsible for the window itself; every MainWindow also has a subclass of MainWindowController which is responsible for the content. Currently, this can be the HomeScreenController or MapEditorController, but in the future there could also be a controller for course setting, for example.

The MapEditorController has as most important members