2017-05-18 16:39:21 +02:00
|
|
|
/************************************************************************
|
|
|
|
* This file has been generated automatically from *
|
|
|
|
* *
|
|
|
|
* src/core/qgsscalecalculator.h *
|
|
|
|
* *
|
|
|
|
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
|
|
|
|
************************************************************************/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2007-01-09 02:39:15 +00:00
|
|
|
|
|
|
|
class QgsScaleCalculator
|
|
|
|
{
|
2017-05-18 16:39:21 +02:00
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Calculates scale for a given combination of canvas size, map extent,
|
|
|
|
and monitor dpi.
|
2017-05-18 16:39:21 +02:00
|
|
|
%End
|
|
|
|
|
2007-01-09 02:39:15 +00:00
|
|
|
%TypeHeaderCode
|
2017-05-18 16:39:21 +02:00
|
|
|
#include "qgsscalecalculator.h"
|
2007-01-09 02:39:15 +00:00
|
|
|
%End
|
|
|
|
public:
|
|
|
|
|
2012-09-24 02:28:15 +02:00
|
|
|
QgsScaleCalculator( double dpi = 0,
|
2016-07-25 16:27:15 +10:00
|
|
|
QgsUnitTypes::DistanceUnit mapUnits = QgsUnitTypes::DistanceMeters );
|
2017-05-18 16:39:21 +02:00
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Constructor
|
2017-12-15 21:36:08 -04:00
|
|
|
|
2017-12-15 10:36:55 -04:00
|
|
|
:param dpi: Monitor resolution in dots per inch
|
|
|
|
:param mapUnits: Units of the data on the map
|
2017-05-18 16:39:21 +02:00
|
|
|
%End
|
2007-01-09 02:39:15 +00:00
|
|
|
|
2012-09-24 02:28:15 +02:00
|
|
|
void setDpi( double dpi );
|
2017-05-18 16:39:21 +02:00
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Set the dpi to be used in scale calculations
|
2017-12-15 21:36:08 -04:00
|
|
|
|
2017-12-15 10:36:55 -04:00
|
|
|
:param dpi: Dots per inch of monitor resolution
|
2017-05-18 16:39:21 +02:00
|
|
|
%End
|
2007-01-09 02:39:15 +00:00
|
|
|
|
2012-09-24 02:28:15 +02:00
|
|
|
double dpi();
|
2017-05-18 16:39:21 +02:00
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Accessor for dpi used in scale calculations
|
|
|
|
|
|
|
|
:return: int the dpi used for scale calculations.
|
2017-05-18 16:39:21 +02:00
|
|
|
%End
|
2012-09-24 02:28:15 +02:00
|
|
|
|
2016-07-17 14:56:05 +10:00
|
|
|
void setMapUnits( QgsUnitTypes::DistanceUnit mapUnits );
|
2017-05-18 16:39:21 +02:00
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Set the map units
|
2017-12-15 21:36:08 -04:00
|
|
|
|
2017-12-15 10:36:55 -04:00
|
|
|
:param mapUnits: Units of the data on the map. Must match a value from the
|
2017-05-18 16:39:21 +02:00
|
|
|
%End
|
2007-01-09 02:39:15 +00:00
|
|
|
|
2016-07-17 14:56:05 +10:00
|
|
|
QgsUnitTypes::DistanceUnit mapUnits() const;
|
2017-05-18 16:39:21 +02:00
|
|
|
%Docstring
|
|
|
|
Returns current map units
|
|
|
|
%End
|
2012-09-24 02:28:15 +02:00
|
|
|
|
|
|
|
double calculate( const QgsRectangle &mapExtent, int canvasWidth );
|
2017-05-18 16:39:21 +02:00
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Calculate the scale denominator
|
2017-12-15 21:36:08 -04:00
|
|
|
|
2017-12-15 10:36:55 -04:00
|
|
|
:param mapExtent: QgsRectangle containing the current map extent
|
|
|
|
:param canvasWidth: Width of the map canvas in pixel (physical) units
|
|
|
|
|
|
|
|
:return: scale denominator of current map view, e.g. 1000.0 for a 1:1000 map.
|
2017-05-18 16:39:21 +02:00
|
|
|
%End
|
2007-01-09 02:39:15 +00:00
|
|
|
|
2012-09-24 02:28:15 +02:00
|
|
|
double calculateGeographicDistance( const QgsRectangle &mapExtent );
|
2017-05-18 16:39:21 +02:00
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Calculate the distance between two points in geographic coordinates.
|
|
|
|
Used to calculate scale for map views with geographic (decimal degree)
|
|
|
|
data.
|
|
|
|
|
2017-12-15 21:36:08 -04:00
|
|
|
:param mapExtent: QgsRectangle containing the current map extent
|
2017-05-18 16:39:21 +02:00
|
|
|
%End
|
2007-01-09 02:39:15 +00:00
|
|
|
|
|
|
|
};
|
|
|
|
|
2017-05-18 16:39:21 +02:00
|
|
|
/************************************************************************
|
|
|
|
* This file has been generated automatically from *
|
|
|
|
* *
|
|
|
|
* src/core/qgsscalecalculator.h *
|
|
|
|
* *
|
|
|
|
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
|
|
|
|
************************************************************************/
|