LuciadCPillar 2024.0.08
|
This class represents a map scale, a ratio of a distance on the map to the corresponding actual distance. More...
#include <luciad/maps/MapScale.h>
Public Member Functions | |
constexpr | MapScale (double value) |
Creates a new MapScale based on the given ratio. More... | |
double | getDenominator () const |
Returns the denominator of this map scale. More... | |
double | getValue () const |
Returns the scale value. More... | |
operator double () const | |
Returns this map scale value as a double value. More... | |
bool | operator!= (const MapScale &other) const |
bool | operator< (const MapScale &other) const |
bool | operator<= (const MapScale &other) const |
bool | operator== (const MapScale &other) const |
bool | operator> (const MapScale &other) const |
bool | operator>= (const MapScale &other) const |
MapScale | zoomIn (double factor) const |
Creates a new MapScale which is zoomed in with a given factor. More... | |
MapScale | zoomOut (double factor) const |
Creates a new MapScale which is zoomed outn with a given factor. More... | |
Static Public Member Functions | |
static constexpr MapScale | fromDenominator (double denominator) |
Creates a map scale from a denominator value. More... | |
static const MapScale & | maxZoomedIn () |
The value that represents a maximally zoomed in map scale (1:0 ≈ the maximum double value) More... | |
static const MapScale & | maxZoomedOut () |
The value that represents a maximally zoomed out map scale (1:inf == 0) More... | |
This class represents a map scale, a ratio of a distance on the map to the corresponding actual distance.
For example: a map scale of 1:50000 means that 1 centimeter on a map corresponds with 500 meters on the ground.
This class gives a natural ordering to map scales, from zoomed out to zoomed in. When a part of the API takes an ordered collection as input, it must be ordered according to this natural ordering (unless stated otherwise).
In order for a Map instance to interpret MapScale values correctly, it needs to know the DPI (see Map::getDpi) value of the screen on which it is rendered.
See also the related article
|
inlineconstexpr |
Creates a new MapScale based on the given ratio.
value | a value that represents 1 / denominator. For example: a MapScale of 1:50000 can be created using 0.00002 (=1/50000) as value. |
luciad::InvalidArgumentException | when the map scale is smaller than 0. |
|
inlinestaticconstexpr |
Creates a map scale from a denominator value.
For example when using 1:50000 as map scale, the denominator is 50000.
denominator | the scale denominator. |
luciad::InvalidArgumentException | when the denominator is negative. |
|
inline |
Returns the denominator of this map scale.
For example when the Map Scale is 1:50000
, this method returns 50000
.
|
inline |
Returns the scale value.
|
static |
The value that represents a maximally zoomed in map scale (1:0 ≈ the maximum double value)
|
static |
The value that represents a maximally zoomed out map scale (1:inf == 0)
|
inline |
Returns this map scale value as a double value.
For example when the map scale is 1:50000
, this method returns 0.00002
.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Creates a new MapScale which is zoomed in with a given factor.
For example, when applying this method on a 1:50000 scale, with a factor or 2, the resulting map scale will be 1:25000.
factor | the factor using which to zoom in |
|
inline |
Creates a new MapScale which is zoomed outn with a given factor.
For example, when applying this method on a 1:50000 scale, with a factor or 2, the resulting map scale will be 1:100000.
factor | the factor using which to zoom out |