![]() |
Mapper
0.9.0
API documentation
|
Class for displaying a grid on a map. More...
#include <map_grid.h>
Public Types | |
| enum | Alignment { MagneticNorth = 0, GridNorth = 1, TrueNorth = 2 } |
| Options for aligning the grid with different north concepts. More... | |
| enum | Unit { MillimetersOnMap = 0, MetersInTerrain = 1 } |
| Different units for specifying the grid interval. More... | |
| enum | DisplayMode { AllLines = 0, HorizontalLines = 1, VerticalLines = 2 } |
| Different display modes for map grids. More... | |
Public Member Functions | |
| MapGrid () | |
| Creates a new map grid with default settings. More... | |
| void | save (QXmlStreamWriter &xml) const |
| Saves the grid in xml format to the given stream. More... | |
| const MapGrid & | load (QXmlStreamReader &xml) |
| Loads the grid in xml format from the given stream. More... | |
| void | draw (QPainter *painter, const QRectF &bounding_box, Map *map, qreal scale_adjustment=0) const |
| Draws the map grid. More... | |
| void | draw (QPainter *painter, const QRectF &bounding_box, Map *map, bool) const =delete |
| void | calculateFinalParameters (double &final_horz_spacing, double &final_vert_spacing, double &final_horz_offset, double &final_vert_offset, double &final_rotation, Map *map) const |
| Calculates the "final" parameters with the following properties: More... | |
| MapCoordF | getClosestPointOnGrid (MapCoordF position, Map *map) const |
| Returns the grid point which is closest to the given position. More... | |
| bool | isSnappingEnabled () const |
| void | setSnappingEnabled (bool enable) |
| QRgb | getColor () const |
| void | setColor (QRgb color) |
| bool | hasAlpha () const |
| Returns true if the grid is not opaque. More... | |
| DisplayMode | getDisplayMode () const |
| void | setDisplayMode (DisplayMode mode) |
| Alignment | getAlignment () const |
| void | setAlignment (Alignment alignment) |
| double | getAdditionalRotation () const |
| void | setAdditionalRotation (double rotation) |
| Unit | getUnit () const |
| void | setUnit (Unit unit) |
| double | getHorizontalSpacing () const |
| void | setHorizontalSpacing (double spacing) |
| double | getVerticalSpacing () const |
| void | setVerticalSpacing (double spacing) |
| double | getHorizontalOffset () const |
| void | setHorizontalOffset (double offset) |
| double | getVerticalOffset () const |
| void | setVerticalOffset (double offset) |
Friends | |
| bool | operator== (const MapGrid &lhs, const MapGrid &rhs) |
| Compares two map grid objects. More... | |
Class for displaying a grid on a map.
Each map has an instance of this class which can be retrieved with map->getGrid(). The grid's visibility is defined per MapView.
Grid lines are thin. They are either drawn using a cosmetic pen (usually on screen) or with 0.1 mm (usually on paper).
| OpenOrienteering::MapGrid::MapGrid | ( | ) |
Creates a new map grid with default settings.
| void OpenOrienteering::MapGrid::calculateFinalParameters | ( | double & | final_horz_spacing, |
| double & | final_vert_spacing, | ||
| double & | final_horz_offset, | ||
| double & | final_vert_offset, | ||
| double & | final_rotation, | ||
| Map * | map | ||
| ) | const |
Calculates the "final" parameters with the following properties:
| void OpenOrienteering::MapGrid::draw | ( | QPainter * | painter, |
| const QRectF & | bounding_box, | ||
| Map * | map, | ||
| qreal | scale_adjustment = 0 |
||
| ) | const |
Draws the map grid.
|
delete |
|
inline |
|
inline |
Returns the grid point which is closest to the given position.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
| bool OpenOrienteering::MapGrid::hasAlpha | ( | ) | const |
Returns true if the grid is not opaque.
|
inline |
| const MapGrid & OpenOrienteering::MapGrid::load | ( | QXmlStreamReader & | xml | ) |
Loads the grid in xml format from the given stream.
| void OpenOrienteering::MapGrid::save | ( | QXmlStreamWriter & | xml | ) | const |
Saves the grid in xml format to the given stream.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Compares two map grid objects.
1.8.13