QGIS/python/core/auto_generated/qgsscalecalculator.sip.in

88 lines
2.7 KiB
Plaintext
Raw Normal View History

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 *
************************************************************************/
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
%TypeHeaderCode
2017-05-18 16:39:21 +02:00
#include "qgsscalecalculator.h"
%End
public:
QgsScaleCalculator( double dpi = 0,
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
void setDpi( double dpi );
2017-05-18 16:39:21 +02:00
%Docstring
Sets the ``dpi`` (dots per inch) for the output resolution, to be used in scale calculations.
2017-12-15 21:36:08 -04:00
.. seealso:: :py:func:`dpi`
2017-05-18 16:39:21 +02:00
%End
double dpi();
2017-05-18 16:39:21 +02:00
%Docstring
Returns the DPI (dots per inch) used in scale calculations.
2017-12-15 10:36:55 -04:00
.. seealso:: :py:func:`setDpi`
2017-05-18 16:39:21 +02:00
%End
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
QgsUnitTypes::DistanceUnit mapUnits() const;
2017-05-18 16:39:21 +02:00
%Docstring
Returns current map units
%End
2019-04-04 11:29:50 +02:00
double calculate( const QgsRectangle &mapExtent, double canvasWidth ) const;
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
2019-04-04 11:29:50 +02:00
double calculateGeographicDistance( const QgsRectangle &mapExtent ) const;
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
};
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 *
************************************************************************/