mirror of
https://github.com/qgis/QGIS.git
synced 2025-12-15 00:07:25 -05:00
Improve docs
This commit is contained in:
parent
28b11592b3
commit
492beeae6d
@ -47,21 +47,23 @@ Returns the DPI (dots per inch) used in scale calculations.
|
||||
|
||||
void setMapUnits( Qgis::DistanceUnit mapUnits );
|
||||
%Docstring
|
||||
Set the map units
|
||||
Set the map units.
|
||||
|
||||
:param mapUnits: Units of the data on the map. Must match a value from the
|
||||
.. seealso:: :py:func:`mapUnits`
|
||||
%End
|
||||
|
||||
Qgis::DistanceUnit mapUnits() const;
|
||||
%Docstring
|
||||
Returns current map units
|
||||
Returns current map units.
|
||||
|
||||
.. seealso:: :py:func:`setMapUnits`
|
||||
%End
|
||||
|
||||
double calculate( const QgsRectangle &mapExtent, double canvasWidth ) const;
|
||||
%Docstring
|
||||
Calculate the scale denominator
|
||||
Calculate the scale denominator.
|
||||
|
||||
:param mapExtent: :py:class:`QgsRectangle` containing the current map extent
|
||||
: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.
|
||||
@ -69,9 +71,9 @@ Calculate the scale denominator
|
||||
|
||||
QSizeF calculateImageSize( const QgsRectangle &mapExtent, double scale ) const;
|
||||
%Docstring
|
||||
Calculate the image size in pixel (physical) units
|
||||
Calculate the image size in pixel (physical) units.
|
||||
|
||||
:param mapExtent: :py:class:`QgsRectangle` containing the current map extent
|
||||
: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
|
||||
|
||||
@ -56,26 +56,35 @@ class CORE_EXPORT QgsScaleCalculator
|
||||
double dpi() const;
|
||||
|
||||
/**
|
||||
* Set the map units
|
||||
* \param mapUnits Units of the data on the map. Must match a value from the
|
||||
* Set the map units.
|
||||
*
|
||||
* \see mapUnits()
|
||||
*/
|
||||
void setMapUnits( Qgis::DistanceUnit mapUnits );
|
||||
|
||||
//! Returns current map units
|
||||
/**
|
||||
* Returns current map units.
|
||||
*
|
||||
* \see setMapUnits()
|
||||
*/
|
||||
Qgis::DistanceUnit mapUnits() const;
|
||||
|
||||
/**
|
||||
* Calculate the scale denominator
|
||||
* \param mapExtent QgsRectangle containing the current map extent
|
||||
* Calculate the scale denominator.
|
||||
*
|
||||
* \param mapExtent QgsRectangle containing the current map extent. Units are specified by mapUnits().
|
||||
* \param canvasWidth Width of the map canvas in pixel (physical) units
|
||||
*
|
||||
* \returns scale denominator of current map view, e.g. 1000.0 for a 1:1000 map.
|
||||
*/
|
||||
double calculate( const QgsRectangle &mapExtent, double canvasWidth ) const;
|
||||
|
||||
/**
|
||||
* Calculate the image size in pixel (physical) units
|
||||
* \param mapExtent QgsRectangle containing the current map extent
|
||||
* Calculate the image size in pixel (physical) units.
|
||||
*
|
||||
* \param mapExtent QgsRectangle containing the current map extent. Units are specified by mapUnits()
|
||||
* \param scale Scale denominator, e.g. 1000.0 for a 1:1000 map
|
||||
*
|
||||
* \returns image size
|
||||
* \since QGIS 3.24
|
||||
*/
|
||||
@ -95,10 +104,10 @@ class CORE_EXPORT QgsScaleCalculator
|
||||
void calculateMetrics( const QgsRectangle &mapExtent, double &delta, double &conversionFactor ) const;
|
||||
|
||||
//! dpi member
|
||||
double mDpi;
|
||||
double mDpi = 96;
|
||||
|
||||
//! map unit member
|
||||
Qgis::DistanceUnit mMapUnits;
|
||||
Qgis::DistanceUnit mMapUnits = Qgis::DistanceUnit::Unknown;
|
||||
};
|
||||
|
||||
#endif // #ifndef QGSSCALECALCULATOR_H
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user