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

508 lines
14 KiB
Plaintext
Raw Normal View History

2017-05-14 09:48:41 +02:00
/************************************************************************
* This file has been generated automatically from *
* *
* src/core/qgsmapsettings.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/
class QgsMapSettings
{
2017-05-14 09:48:41 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
The QgsMapSettings class contains configuration for rendering of the map.
The rendering itself is done by QgsMapRendererJob subclasses.
2017-05-14 09:48:41 +02:00
2017-12-15 10:36:55 -04:00
In order to set up QgsMapSettings instance, it is necessary to set at least
few members: extent, output size and layers.
2017-05-14 09:48:41 +02:00
2017-12-15 10:36:55 -04:00
QgsMapSettings and QgsMapRendererJob (+subclasses) are intended to replace
QgsMapRenderer class that existed before QGIS 2.4. The advantage of the new
classes is that they separate the settings from the rendering and provide
asynchronous API for map rendering.
2017-05-14 09:48:41 +02:00
.. versionadded:: 2.4
%End
2017-05-14 09:48:41 +02:00
%TypeHeaderCode
#include "qgsmapsettings.h"
%End
2014-05-27 23:22:50 +02:00
public:
QgsMapSettings();
QgsRectangle extent() const;
2017-05-14 09:48:41 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
Return geographical coordinates of the rectangle that should be rendered.
The actual visible extent used for rendering could be slightly different
since the given extent may be expanded in order to fit the aspect ratio
of output size. Use visibleExtent() to get the resulting extent.
2017-05-14 09:48:41 +02:00
%End
void setExtent( const QgsRectangle &rect, bool magnified = true );
2017-05-14 09:48:41 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
Set coordinates of the rectangle which should be rendered.
The actual visible extent used for rendering could be slightly different
since the given extent may be expanded in order to fit the aspect ratio
of output size. Use visibleExtent() to get the resulting extent.
2017-05-14 09:48:41 +02:00
%End
2014-05-27 23:22:50 +02:00
QSize outputSize() const;
2017-05-14 09:48:41 +02:00
%Docstring
Return the size of the resulting map image
%End
void setOutputSize( QSize size );
2017-05-14 09:48:41 +02:00
%Docstring
Set the size of the resulting map image
%End
2014-05-27 23:22:50 +02:00
double rotation() const;
2017-05-14 09:48:41 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
Returns the rotation of the resulting map image, in degrees clockwise.
2017-05-14 09:48:41 +02:00
.. versionadded:: 2.8
2017-12-15 10:36:55 -04:00
.. seealso:: :py:func:`setRotation`
2017-05-14 09:48:41 +02:00
%End
void setRotation( double rotation );
2017-05-14 09:48:41 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
Sets the ``rotation`` of the resulting map image, in degrees clockwise.
2017-05-14 09:48:41 +02:00
.. versionadded:: 2.8
2017-12-15 10:36:55 -04:00
.. seealso:: :py:func:`rotation`
2017-05-14 09:48:41 +02:00
%End
2016-05-28 17:22:22 +02:00
double outputDpi() const;
2017-05-14 09:48:41 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
Return DPI used for conversion between real world units (e.g. mm) and pixels
Default value is 96
2017-05-14 09:48:41 +02:00
%End
2016-05-28 17:22:22 +02:00
void setOutputDpi( double dpi );
2017-05-14 09:48:41 +02:00
%Docstring
Set DPI used for conversion between real world units (e.g. mm) and pixels
%End
2016-05-29 08:10:23 +10:00
void setMagnificationFactor( double factor );
2017-05-14 09:48:41 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
Set the magnification factor.
2017-12-15 21:36:08 -04:00
2017-12-15 10:36:55 -04:00
:param factor: the factor of magnification
2017-05-14 09:48:41 +02:00
.. versionadded:: 2.16
2017-12-15 10:36:55 -04:00
.. seealso:: :py:func:`magnificationFactor`
2017-05-14 09:48:41 +02:00
%End
2016-05-29 08:10:23 +10:00
double magnificationFactor() const;
2017-05-14 09:48:41 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
Return the magnification factor.
.. versionadded:: 2.16
2017-12-15 10:36:55 -04:00
.. seealso:: :py:func:`setMagnificationFactor`
2017-05-14 09:48:41 +02:00
%End
2016-05-18 14:36:02 +02:00
QStringList layerIds() const;
2017-05-14 09:48:41 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
Get list of layer IDs for map rendering
The layers are stored in the reverse order of how they are rendered (layer with index 0 will be on top)
2017-05-14 09:48:41 +02:00
%End
2017-05-14 09:48:41 +02:00
QList<QgsMapLayer *> layers() const;
%Docstring
2017-12-15 10:36:55 -04:00
Get list of layers for map rendering
The layers are stored in the reverse order of how they are rendered (layer with index 0 will be on top)
2017-05-14 09:48:41 +02:00
%End
2017-05-14 09:48:41 +02:00
void setLayers( const QList<QgsMapLayer *> &layers );
%Docstring
2017-12-19 11:43:52 -04:00
Set list of layers for map rendering. The layers must be registered in :py:class:`QgsProject`.
2017-12-15 10:36:55 -04:00
The layers are stored in the reverse order of how they are rendered (layer with index 0 will be on top)
.. note::
Any non-spatial layers will be automatically stripped from the list (since they cannot be rendered!).
2017-05-14 09:48:41 +02:00
%End
QMap<QString, QString> layerStyleOverrides() const;
2017-05-14 09:48:41 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
Get map of map layer style overrides (key: layer ID, value: style name) where a different style should be used instead of the current one
2017-05-14 09:48:41 +02:00
.. versionadded:: 2.8
%End
void setLayerStyleOverrides( const QMap<QString, QString> &overrides );
2017-05-14 09:48:41 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
Set map of map layer style overrides (key: layer ID, value: style name) where a different style should be used instead of the current one
2017-05-14 09:48:41 +02:00
.. versionadded:: 2.8
%End
QString customRenderFlags() const;
2017-05-14 09:48:41 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
Get custom rendering flags. Layers might honour these to alter their rendering.
:return: custom flags strings, separated by ';'
2017-05-14 09:48:41 +02:00
.. versionadded:: 2.16
2017-12-15 10:36:55 -04:00
.. seealso:: :py:func:`setCustomRenderFlags`
2017-05-14 09:48:41 +02:00
%End
void setCustomRenderFlags( const QString &customRenderFlags );
2017-05-14 09:48:41 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
Sets the custom rendering flags. Layers might honour these to alter their rendering.
2017-12-15 21:36:08 -04:00
2017-12-15 10:36:55 -04:00
:param customRenderFlags: custom flags strings, separated by ';'
2017-05-14 09:48:41 +02:00
.. versionadded:: 2.16
2017-12-15 10:36:55 -04:00
.. seealso:: :py:func:`customRenderFlags`
2017-05-14 09:48:41 +02:00
%End
void setDestinationCrs( const QgsCoordinateReferenceSystem &crs );
2017-05-14 09:48:41 +02:00
%Docstring
sets destination coordinate reference system
%End
QgsCoordinateReferenceSystem destinationCrs() const;
2017-05-14 09:48:41 +02:00
%Docstring
returns CRS of destination coordinate reference system
%End
QgsUnitTypes::DistanceUnit mapUnits() const;
2017-05-14 09:48:41 +02:00
%Docstring
Get units of map's geographical coordinates - used for scale calculation
%End
bool setEllipsoid( const QString &ellipsoid );
%Docstring
2017-12-15 10:36:55 -04:00
Sets the ``ellipsoid`` by its acronym. Known ellipsoid acronyms can be
2017-12-19 11:43:52 -04:00
retrieved using :py:func:`QgsEllipsoidUtils.acronyms()`
2017-12-15 10:36:55 -04:00
Calculations will only use the ellipsoid if a valid ellipsoid has been set.
:return: true if ellipsoid was successfully set
.. versionadded:: 3.0
2017-12-15 10:36:55 -04:00
.. seealso:: :py:func:`ellipsoid`
%End
QString ellipsoid() const;
%Docstring
2017-12-15 10:36:55 -04:00
Returns ellipsoid's acronym. Calculations will only use the
ellipsoid if a valid ellipsoid has been set.
.. versionadded:: 3.0
2017-12-15 10:36:55 -04:00
.. seealso:: :py:func:`setEllipsoid`
%End
void setBackgroundColor( const QColor &color );
2017-05-14 09:48:41 +02:00
%Docstring
Set the background color of the map
%End
2014-05-27 23:22:50 +02:00
QColor backgroundColor() const;
2017-05-14 09:48:41 +02:00
%Docstring
Get the background color of the map
%End
void setSelectionColor( const QColor &color );
2017-05-14 09:48:41 +02:00
%Docstring
Set color that is used for drawing of selected vector features
%End
2014-05-27 23:22:50 +02:00
QColor selectionColor() const;
2017-05-14 09:48:41 +02:00
%Docstring
Get color that is used for drawing of selected vector features
%End
2014-06-02 21:00:51 +02:00
2014-05-27 23:22:50 +02:00
enum Flag
{
2017-05-14 09:48:41 +02:00
Antialiasing,
DrawEditingInfo,
ForceVectorOutput,
UseAdvancedEffects,
DrawLabeling,
UseRenderingOptimization,
DrawSelection,
DrawSymbolBounds,
RenderMapTile,
RenderPartialOutput,
RenderPreviewJob,
2017-05-14 09:48:41 +02:00
// TODO
2014-05-27 23:22:50 +02:00
};
typedef QFlags<QgsMapSettings::Flag> Flags;
2017-05-14 09:48:41 +02:00
void setFlags( QgsMapSettings::Flags flags );
%Docstring
Set combination of flags that will be used for rendering
%End
2014-05-27 23:22:50 +02:00
void setFlag( Flag flag, bool on = true );
2017-05-14 09:48:41 +02:00
%Docstring
Enable or disable a particular flag (other flags are not affected)
%End
2014-05-27 23:22:50 +02:00
Flags flags() const;
2017-05-14 09:48:41 +02:00
%Docstring
Return combination of flags used for rendering
%End
2014-05-27 23:22:50 +02:00
bool testFlag( Flag flag ) const;
2017-05-14 09:48:41 +02:00
%Docstring
Check whether a particular flag is enabled
%End
void setOutputImageFormat( QImage::Format format );
2017-05-14 09:48:41 +02:00
%Docstring
sets format of internal QImage
%End
QImage::Format outputImageFormat() const;
2017-05-14 09:48:41 +02:00
%Docstring
format of internal QImage, default QImage.Format_ARGB32_Premultiplied
%End
2014-05-27 23:22:50 +02:00
bool hasValidSettings() const;
2017-05-14 09:48:41 +02:00
%Docstring
Check whether the map settings are valid and can be used for rendering
%End
2014-05-27 23:22:50 +02:00
QgsRectangle visibleExtent() const;
2017-05-14 09:48:41 +02:00
%Docstring
Return the actual extent derived from requested extent that takes takes output image size into account
%End
QPolygonF visiblePolygon() const;
2017-05-14 09:48:41 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
Return the visible area as a polygon (may be rotated)
2017-05-14 09:48:41 +02:00
.. versionadded:: 2.8
%End
2014-05-27 23:22:50 +02:00
double mapUnitsPerPixel() const;
2017-05-14 09:48:41 +02:00
%Docstring
Return the distance in geographical coordinates that equals to one pixel in the map
%End
2014-05-27 23:22:50 +02:00
double scale() const;
2017-05-14 09:48:41 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
Returns the calculated map scale.
The scale value indicates the scale denominator, e.g. 1000.0 for a 1:1000 map.
2017-05-14 09:48:41 +02:00
%End
void setExpressionContext( const QgsExpressionContext &context );
2017-05-14 09:48:41 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
Sets the expression context. This context is used for all expression evaluation
associated with this map settings.
.. seealso:: :py:func:`expressionContext`
2017-12-15 10:36:55 -04:00
2017-05-14 09:48:41 +02:00
.. versionadded:: 2.12
%End
const QgsExpressionContext &expressionContext() const;
2017-05-14 09:48:41 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
Gets the expression context. This context should be used for all expression evaluation
associated with this map settings.
.. seealso:: :py:func:`setExpressionContext`
2017-12-15 10:36:55 -04:00
2017-05-14 09:48:41 +02:00
.. versionadded:: 2.12
%End
QgsCoordinateTransformContext transformContext() const;
%Docstring
2017-12-15 10:36:55 -04:00
Returns the coordinate transform context, which stores various
information regarding which datum transforms should be used when transforming points
from a source to destination coordinate reference system.
.. versionadded:: 3.0
2017-12-15 10:36:55 -04:00
.. seealso:: :py:func:`setTransformContext`
%End
void setTransformContext( const QgsCoordinateTransformContext &context );
%Docstring
2017-12-15 10:36:55 -04:00
Sets the coordinate transform ``context``, which stores various
information regarding which datum transforms should be used when transforming points
from a source to destination coordinate reference system.
.. versionadded:: 3.0
2017-12-15 10:36:55 -04:00
.. seealso:: :py:func:`transformContext`
%End
const QgsPathResolver &pathResolver() const;
%Docstring
Returns the path resolver for conversion between relative and absolute paths
during rendering operations, e.g. for resolving relative symbol paths.
.. versionadded:: 3.0
.. seealso:: :py:func:`setPathResolver`
%End
void setPathResolver( const QgsPathResolver &resolver );
%Docstring
Sets the path ``resolver`` for conversion between relative and absolute paths
during rendering operations, e.g. for resolving relative symbol paths.
.. versionadded:: 3.0
.. seealso:: :py:func:`pathResolver`
%End
const QgsMapToPixel &mapToPixel() const;
double layerToMapUnits( const QgsMapLayer *layer, const QgsRectangle &referenceExtent = QgsRectangle() ) const;
2017-05-14 09:48:41 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
Computes an *estimated* conversion factor between layer and map units: layerUnits * layerToMapUnits = mapUnits
2017-12-15 21:36:08 -04:00
2017-12-15 10:36:55 -04:00
:param layer: The layer
:param referenceExtent: A reference extent based on which to perform the computation. If not specified, the layer extent is used
2017-05-14 09:48:41 +02:00
.. versionadded:: 2.12
%End
QgsRectangle layerExtentToOutputExtent( const QgsMapLayer *layer, QgsRectangle extent ) const;
2017-05-14 09:48:41 +02:00
%Docstring
transform bounding box from layer's CRS to output CRS
2017-12-15 10:36:55 -04:00
2017-12-05 20:04:14 -04:00
.. seealso:: :py:func:`layerToMapCoordinates`
2017-12-15 10:36:55 -04:00
:return: a bounding box (aligned rectangle) containing the transformed extent
2017-05-14 09:48:41 +02:00
%End
QgsRectangle outputExtentToLayerExtent( const QgsMapLayer *layer, QgsRectangle extent ) const;
2017-05-14 09:48:41 +02:00
%Docstring
transform bounding box from output CRS to layer's CRS
2017-12-15 10:36:55 -04:00
2017-12-05 20:04:14 -04:00
.. seealso:: :py:func:`mapToLayerCoordinates`
2017-12-15 10:36:55 -04:00
:return: a bounding box (aligned rectangle) containing the transformed extent
2017-05-14 09:48:41 +02:00
%End
QgsPointXY layerToMapCoordinates( const QgsMapLayer *layer, QgsPointXY point ) const;
2017-05-14 09:48:41 +02:00
%Docstring
transform point coordinates from layer's CRS to output CRS
2017-12-15 10:36:55 -04:00
:return: the transformed point
2017-05-14 09:48:41 +02:00
%End
QgsRectangle layerToMapCoordinates( const QgsMapLayer *layer, QgsRectangle rect ) const;
2017-05-14 09:48:41 +02:00
%Docstring
transform rectangle from layer's CRS to output CRS
2017-12-15 10:36:55 -04:00
.. seealso:: :py:func:`layerExtentToOutputExtent`
2017-12-15 10:36:55 -04:00
:return: the transformed rectangle
2017-05-14 09:48:41 +02:00
%End
QgsPointXY mapToLayerCoordinates( const QgsMapLayer *layer, QgsPointXY point ) const;
2017-05-14 09:48:41 +02:00
%Docstring
transform point coordinates from output CRS to layer's CRS
2017-12-15 10:36:55 -04:00
:return: the transformed point
2017-05-14 09:48:41 +02:00
%End
QgsRectangle mapToLayerCoordinates( const QgsMapLayer *layer, QgsRectangle rect ) const;
2017-05-14 09:48:41 +02:00
%Docstring
transform rectangle from output CRS to layer's CRS
2017-12-15 10:36:55 -04:00
.. seealso:: :py:func:`outputExtentToLayerExtent`
2017-12-15 10:36:55 -04:00
:return: the transformed rectangle
2017-05-14 09:48:41 +02:00
%End
QgsCoordinateTransform layerTransform( const QgsMapLayer *layer ) const;
2017-05-14 09:48:41 +02:00
%Docstring
Return coordinate transform from layer's CRS to destination CRS
2017-12-15 21:36:08 -04:00
2017-12-15 10:36:55 -04:00
:param layer:
:return: transform - may be invalid if the transform is not needed
2017-05-14 09:48:41 +02:00
%End
2014-05-27 23:22:50 +02:00
QgsRectangle fullExtent() const;
2017-05-14 09:48:41 +02:00
%Docstring
returns current extent of layer set
%End
void readXml( QDomNode &node );
2017-05-14 09:48:41 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
serialization */
2017-05-14 09:48:41 +02:00
%End
2014-05-27 23:22:50 +02:00
void writeXml( QDomNode &node, QDomDocument &doc );
void setSegmentationTolerance( double tolerance );
2017-05-14 09:48:41 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
Sets the segmentation tolerance applied when rendering curved geometries
2017-12-15 21:36:08 -04:00
2017-12-15 10:36:55 -04:00
:param tolerance: the segmentation tolerance*
2017-05-14 09:48:41 +02:00
%End
double segmentationTolerance() const;
2017-05-14 09:48:41 +02:00
%Docstring
Gets the segmentation tolerance applied when rendering curved geometries
%End
2016-08-06 11:01:42 +02:00
void setSegmentationToleranceType( QgsAbstractGeometry::SegmentationToleranceType type );
2017-05-14 09:48:41 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
Sets segmentation tolerance type (maximum angle or maximum difference between curve and approximation)
2017-12-15 21:36:08 -04:00
2017-12-15 10:36:55 -04:00
:param type: the segmentation tolerance typename*
2017-05-14 09:48:41 +02:00
%End
2016-08-06 11:01:42 +02:00
QgsAbstractGeometry::SegmentationToleranceType segmentationToleranceType() const;
2017-05-14 09:48:41 +02:00
%Docstring
Gets segmentation tolerance type (maximum angle or maximum difference between curve and approximation)
%End
void setLabelingEngineSettings( const QgsLabelingEngineSettings &settings );
2017-05-14 09:48:41 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
Sets global configuration of the labeling engine
2017-05-14 09:48:41 +02:00
.. versionadded:: 3.0
%End
const QgsLabelingEngineSettings &labelingEngineSettings() const;
2017-05-14 09:48:41 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
Returns global configuration of the labeling engine
2017-05-14 09:48:41 +02:00
.. versionadded:: 3.0
%End
protected:
2017-05-14 09:48:41 +02:00
void updateDerived();
};
QFlags<QgsMapSettings::Flag> operator|(QgsMapSettings::Flag f1, QFlags<QgsMapSettings::Flag> f2);
2017-05-14 09:48:41 +02:00
/************************************************************************
* This file has been generated automatically from *
* *
* src/core/qgsmapsettings.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/