QGIS API Documentation
3.40.0-Bratislava (b56115d8743)
Loading...
Searching...
No Matches
src
core
qgsscalecalculator.h
Go to the documentation of this file.
1
/***************************************************************************
2
qgsscalecalculator.h
3
Calculates scale based on map extent and units
4
-------------------
5
begin : May 18, 2004
6
copyright : (C) 2004 by Gary E.Sherman
7
email : sherman at mrcc.com
8
***************************************************************************/
9
10
/***************************************************************************
11
* *
12
* This program is free software; you can redistribute it and/or modify *
13
* it under the terms of the GNU General Public License as published by *
14
* the Free Software Foundation; either version 2 of the License, or *
15
* (at your option) any later version. *
16
* *
17
***************************************************************************/
18
19
#ifndef QGSSCALECALCULATOR_H
20
#define QGSSCALECALCULATOR_H
21
22
#include "qgis_core.h"
23
#include "
qgis_sip.h
"
24
#include "
qgis.h
"
25
26
class
QString;
27
class
QgsRectangle
;
28
34
class
CORE_EXPORT
QgsScaleCalculator
35
{
36
public
:
37
43
QgsScaleCalculator
(
double
dpi = 0,
44
Qgis::DistanceUnit
mapUnits =
Qgis::DistanceUnit::Meters
);
45
50
void
setDpi(
double
dpi );
51
56
double
dpi()
const
;
57
63
void
setMapUnits(
Qgis::DistanceUnit
mapUnits );
64
70
Qgis::DistanceUnit
mapUnits()
const
;
71
80
double
calculate(
const
QgsRectangle
&mapExtent,
double
canvasWidth )
const
;
81
91
QSizeF calculateImageSize(
const
QgsRectangle
&mapExtent,
double
scale )
const
;
92
99
double
calculateGeographicDistance(
const
QgsRectangle
&mapExtent )
const
;
100
101
private
:
102
104
void
calculateMetrics(
const
QgsRectangle
&mapExtent,
double
&delta,
double
&conversionFactor )
const
;
105
107
double
mDpi = 96;
108
110
Qgis::DistanceUnit
mMapUnits =
Qgis::DistanceUnit::Unknown
;
111
};
112
113
#endif
// #ifndef QGSSCALECALCULATOR_H
Qgis::DistanceUnit
DistanceUnit
Units of distance.
Definition
qgis.h:4669
Qgis::DistanceUnit::Meters
@ Meters
Meters.
Qgis::DistanceUnit::Unknown
@ Unknown
Unknown distance unit.
QgsRectangle
A rectangle specified with double values.
Definition
qgsrectangle.h:42
QgsScaleCalculator
Calculates scale for a given combination of canvas size, map extent, and monitor dpi.
Definition
qgsscalecalculator.h:35
qgis.h
qgis_sip.h
Generated on Mon Oct 28 2024 22:06:03 for QGIS API Documentation by
1.9.8