mirror of
https://github.com/qgis/QGIS.git
synced 2025-10-05 00:09:32 -04:00
102 lines
3.1 KiB
Plaintext
102 lines
3.1 KiB
Plaintext
/************************************************************************
|
|
* 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
|
|
{
|
|
%Docstring(signature="appended")
|
|
Calculates scale for a given combination of canvas size, map extent,
|
|
and monitor dpi.
|
|
%End
|
|
|
|
%TypeHeaderCode
|
|
#include "qgsscalecalculator.h"
|
|
%End
|
|
public:
|
|
|
|
QgsScaleCalculator( double dpi = 0,
|
|
Qgis::DistanceUnit mapUnits = Qgis::DistanceUnit::Meters );
|
|
%Docstring
|
|
Constructor
|
|
|
|
:param dpi: Monitor resolution in dots per inch
|
|
:param mapUnits: Units of the data on the map
|
|
%End
|
|
|
|
void setDpi( double dpi );
|
|
%Docstring
|
|
Sets the ``dpi`` (dots per inch) for the output resolution, to be used in scale calculations.
|
|
|
|
.. seealso:: :py:func:`dpi`
|
|
%End
|
|
|
|
double dpi() const;
|
|
%Docstring
|
|
Returns the DPI (dots per inch) used in scale calculations.
|
|
|
|
.. seealso:: :py:func:`setDpi`
|
|
%End
|
|
|
|
void setMapUnits( Qgis::DistanceUnit mapUnits );
|
|
%Docstring
|
|
Set the map units.
|
|
|
|
.. seealso:: :py:func:`mapUnits`
|
|
%End
|
|
|
|
Qgis::DistanceUnit mapUnits() const;
|
|
%Docstring
|
|
Returns current map units.
|
|
|
|
.. seealso:: :py:func:`setMapUnits`
|
|
%End
|
|
|
|
double calculate( const QgsRectangle &mapExtent, double canvasWidth ) const;
|
|
%Docstring
|
|
Calculate the scale denominator.
|
|
|
|
:param mapExtent: :py:class:`QgsRectangle` containing the current map extent. Units are specified by :py:func:`~QgsScaleCalculator.mapUnits`.
|
|
: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.
|
|
%End
|
|
|
|
QSizeF calculateImageSize( const QgsRectangle &mapExtent, double scale ) const;
|
|
%Docstring
|
|
Calculate the image size in pixel (physical) units.
|
|
|
|
:param mapExtent: :py:class:`QgsRectangle` containing the current map extent. Units are specified by :py:func:`~QgsScaleCalculator.mapUnits`
|
|
:param scale: Scale denominator, e.g. 1000.0 for a 1:1000 map
|
|
|
|
:return: image size
|
|
|
|
.. versionadded:: 3.24
|
|
%End
|
|
|
|
double calculateGeographicDistance( const QgsRectangle &mapExtent ) const;
|
|
%Docstring
|
|
Calculate the distance between two points in geographic coordinates.
|
|
Used to calculate scale for map views with geographic (decimal degree)
|
|
data.
|
|
|
|
:param mapExtent: :py:class:`QgsRectangle` containing the current map extent
|
|
%End
|
|
|
|
};
|
|
|
|
/************************************************************************
|
|
* This file has been generated automatically from *
|
|
* *
|
|
* src/core/qgsscalecalculator.h *
|
|
* *
|
|
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
|
|
************************************************************************/
|