QGIS API Documentation 3.39.0-Master (d85f3c2a281)
|
The QgsMapSettings class contains configuration for rendering of the map. More...
#include <qgsmapsettings.h>
Public Member Functions | |
QgsMapSettings () | |
void | addClippingRegion (const QgsMapClippingRegion ®ion) |
Adds a new clipping region to the map settings. | |
void | addRenderedFeatureHandler (QgsRenderedFeatureHandlerInterface *handler) |
Adds a rendered feature handler to use while rendering the map settings. | |
QColor | backgroundColor () const |
Returns the background color of the map. | |
void | clearCustomRenderingFlag (const QString &flag) |
Clears the specified custom rendering flag. | |
QList< QgsMapClippingRegion > | clippingRegions () const |
Returns the list of clipping regions to apply to the map. | |
QgsRectangle | computeExtentForScale (const QgsPointXY ¢er, double scale) const |
Compute the extent such that its center is at the specified position (mapped to the destinatonCrs) and the zoom factor corresponds to the specified scale. | |
double | computeScaleForExtent (const QgsRectangle &extent) const |
Compute the scale that corresponds to the specified extent. | |
long long | currentFrame () const |
Returns the current frame number of the map, for maps which are part of an animation. | |
Q_DECL_DEPRECATED QString | customRenderFlags () const |
Returns custom rendering flags. | |
QVariantMap | customRenderingFlags () const |
Returns any custom rendering flags. | |
QgsCoordinateReferenceSystem | destinationCrs () const |
Returns the destination coordinate reference system for the map render. | |
QSize | deviceOutputSize () const |
Returns the device output size of the map render. | |
float | devicePixelRatio () const |
Returns the device pixel ratio. | |
double | dpiTarget () const |
Returns the target DPI (dots per inch) to be taken into consideration when rendering. | |
const QgsElevationShadingRenderer & | elevationShadingRenderer () const |
Returns the shading renderer used to render shading on the entire map. | |
QString | ellipsoid () const |
Returns ellipsoid's acronym. | |
const QgsExpressionContext & | expressionContext () const |
Gets the expression context. | |
QgsRectangle | extent () const |
Returns geographical coordinates of the rectangle that should be rendered. | |
double | extentBuffer () const |
Returns the buffer in map units to use around the visible extent for rendering symbols whose corresponding geometries are outside the visible extent. | |
Qgis::MapSettingsFlags | flags () const |
Returns combination of flags used for rendering. | |
double | frameRate () const |
Returns the frame rate of the map (in frames per second), for maps which are part of an animation. | |
QgsRectangle | fullExtent () const |
returns current extent of layer set | |
bool | hasValidSettings () const |
Check whether the map settings are valid and can be used for rendering. | |
QList< QgsLabelBlockingRegion > | labelBlockingRegions () const |
Returns the list of regions to avoid placing labels within. | |
QgsGeometry | labelBoundaryGeometry () const |
Returns the label boundary geometry, which restricts where in the rendered map labels are permitted to be placed. | |
const QgsLabelingEngineSettings & | labelingEngineSettings () const |
Returns the global configuration of the labeling engine. | |
QgsRectangle | layerExtentToOutputExtent (const QgsMapLayer *layer, QgsRectangle extent) const |
transform bounding box from layer's CRS to output CRS | |
QStringList | layerIds (bool expandGroupLayers=false) const |
Returns the list of layer IDs which will be rendered in the map. | |
QList< QgsMapLayer * > | layers (bool expandGroupLayers=false) const |
Returns the list of layers which will be rendered in the map. | |
QMap< QString, QString > | layerStyleOverrides () const |
Returns the map of map layer style overrides (key: layer ID, value: style name) where a different style should be used instead of the current one. | |
QgsPoint | layerToMapCoordinates (const QgsMapLayer *layer, const QgsPoint &point) const |
transform point coordinates from layer's CRS to output CRS | |
QgsPointXY | layerToMapCoordinates (const QgsMapLayer *layer, QgsPointXY point) const |
transform point coordinates from layer's CRS to output CRS | |
QgsRectangle | layerToMapCoordinates (const QgsMapLayer *layer, QgsRectangle rect) const |
transform rectangle from layer's CRS to output CRS | |
double | layerToMapUnits (const QgsMapLayer *layer, const QgsRectangle &referenceExtent=QgsRectangle()) const |
Computes an estimated conversion factor between layer and map units, where layerUnits × layerToMapUnits = mapUnits | |
QgsCoordinateTransform | layerTransform (const QgsMapLayer *layer) const |
Returns the coordinate transform from layer's CRS to destination CRS. | |
double | magnificationFactor () const |
Returns the magnification factor. | |
QgsPoint | mapToLayerCoordinates (const QgsMapLayer *layer, const QgsPoint &point) const |
transform point coordinates from output CRS to layer's CRS | |
QgsPointXY | mapToLayerCoordinates (const QgsMapLayer *layer, QgsPointXY point) const |
transform point coordinates from output CRS to layer's CRS | |
QgsRectangle | mapToLayerCoordinates (const QgsMapLayer *layer, QgsRectangle rect) const |
transform rectangle from output CRS to layer's CRS | |
const QgsMapToPixel & | mapToPixel () const |
Qgis::DistanceUnit | mapUnits () const |
Returns the units of the map's geographical coordinates - used for scale calculation. | |
double | mapUnitsPerPixel () const |
Returns the distance in geographical coordinates that equals to one pixel in the map. | |
QgsMaskRenderSettings & | maskSettings () |
Returns a reference to the mask render settings, which control how masks are drawn and behave during the map render. | |
const QgsMaskRenderSettings & | maskSettings () const |
Returns a reference to the mask render settings, which control how masks are drawn and behave during the map render. | |
double | outputDpi () const |
Returns the DPI (dots per inch) used for conversion between real world units (e.g. | |
QgsRectangle | outputExtentToLayerExtent (const QgsMapLayer *layer, QgsRectangle extent) const |
transform bounding box from output CRS to layer's CRS | |
QImage::Format | outputImageFormat () const |
format of internal QImage, default QImage::Format_ARGB32_Premultiplied | |
QSize | outputSize () const |
Returns the size of the resulting map image, in pixels. | |
const QgsPathResolver & | pathResolver () const |
Returns the path resolver for conversion between relative and absolute paths during rendering operations, e.g. | |
void | readXml (QDomNode &node) |
Restore the map settings from a XML node. | |
QList< QgsRenderedFeatureHandlerInterface * > | renderedFeatureHandlers () const |
Returns the list of rendered feature handlers to use while rendering the map settings. | |
Qgis::RendererUsage | rendererUsage () const |
Returns the rendering usage. | |
double | rotation () const |
Returns the rotation of the resulting map image, in degrees clockwise. | |
double | scale () const |
Returns the calculated map scale. | |
double | segmentationTolerance () const |
Gets the segmentation tolerance applied when rendering curved geometries. | |
QgsAbstractGeometry::SegmentationToleranceType | segmentationToleranceType () const |
Gets segmentation tolerance type (maximum angle or maximum difference between curve and approximation) | |
QColor | selectionColor () const |
Returns the color that is used for drawing of selected vector features. | |
void | setBackgroundColor (const QColor &color) |
Sets the background color of the map. | |
void | setClippingRegions (const QList< QgsMapClippingRegion > ®ions) |
Sets the list of clipping regions to apply to the map. | |
void | setCurrentFrame (long long frame) |
Sets the current frame of the map, for maps which are part of an animation. | |
Q_DECL_DEPRECATED void | setCustomRenderFlags (const QString &customRenderFlags) |
Sets the custom rendering flags. | |
void | setCustomRenderingFlag (const QString &flag, const QVariant &value) |
Sets a custom rendering flag. | |
void | setDestinationCrs (const QgsCoordinateReferenceSystem &crs) |
Sets the destination crs (coordinate reference system) for the map render. | |
void | setDevicePixelRatio (float dpr) |
Sets the device pixel ratio. | |
void | setDpiTarget (double dpi) |
Sets the target dpi (dots per inch) to be taken into consideration when rendering. | |
void | setElevationShadingRenderer (const QgsElevationShadingRenderer &renderer) |
Sets the shading renderer used to render shading on the entire map. | |
bool | setEllipsoid (const QString &ellipsoid) |
Sets the ellipsoid by its acronym. | |
void | setExpressionContext (const QgsExpressionContext &context) |
Sets the expression context. | |
void | setExtent (const QgsRectangle &rect, bool magnified=true) |
Sets the coordinates of the rectangle which should be rendered. | |
void | setExtentBuffer (double buffer) |
Sets the buffer in map units to use around the visible extent for rendering symbols whose corresponding geometries are outside the visible extent. | |
void | setFlag (Qgis::MapSettingsFlag flag, bool on=true) |
Enable or disable a particular flag (other flags are not affected) | |
void | setFlags (Qgis::MapSettingsFlags flags) |
Sets combination of flags that will be used for rendering. | |
void | setFrameRate (double rate) |
Sets the frame rate of the map (in frames per second), for maps which are part of an animation. | |
void | setLabelBlockingRegions (const QList< QgsLabelBlockingRegion > ®ions) |
Sets a list of regions to avoid placing labels within. | |
void | setLabelBoundaryGeometry (const QgsGeometry &boundary) |
Sets the label boundary geometry, which restricts where in the rendered map labels are permitted to be placed. | |
void | setLabelingEngineSettings (const QgsLabelingEngineSettings &settings) |
Sets the global configuration of the labeling engine. | |
void | setLayers (const QList< QgsMapLayer * > &layers) |
Sets the list of layers to render in the map. | |
void | setLayerStyleOverrides (const QMap< QString, QString > &overrides) |
Sets the map of map layer style overrides (key: layer ID, value: style name) where a different style should be used instead of the current one. | |
void | setMagnificationFactor (double factor, const QgsPointXY *center=nullptr) |
Set the magnification factor. | |
void | setMaskSettings (const QgsMaskRenderSettings &settings) |
Sets the mask render settings, which control how masks are drawn and behave during the map render. | |
void | setOutputDpi (double dpi) |
Sets the dpi (dots per inch) used for conversion between real world units (e.g. | |
void | setOutputImageFormat (QImage::Format format) |
sets format of internal QImage | |
void | setOutputSize (QSize size) |
Sets the size of the resulting map image, in pixels. | |
void | setPathResolver (const QgsPathResolver &resolver) |
Sets the path resolver for conversion between relative and absolute paths during rendering operations, e.g. | |
void | setRendererUsage (Qgis::RendererUsage rendererUsage) |
Sets the rendering usage. | |
void | setRotation (double rotation) |
Sets the rotation of the resulting map image, in degrees clockwise. | |
void | setSegmentationTolerance (double tolerance) |
Sets the segmentation tolerance applied when rendering curved geometries. | |
void | setSegmentationToleranceType (QgsAbstractGeometry::SegmentationToleranceType type) |
Sets segmentation tolerance type (maximum angle or maximum difference between curve and approximation) | |
void | setSelectionColor (const QColor &color) |
Sets the color that is used for drawing of selected vector features. | |
void | setSimplifyMethod (const QgsVectorSimplifyMethod &method) |
Sets the simplification setting to use when rendering vector layers. | |
void | setTextRenderFormat (Qgis::TextRenderFormat format) |
Sets the text render format, which dictates how text is rendered (e.g. | |
void | setTransformContext (const QgsCoordinateTransformContext &context) |
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. | |
void | setZRange (const QgsDoubleRange &range) |
Sets the range of z-values which will be visible in the map. | |
const QgsVectorSimplifyMethod & | simplifyMethod () const |
Returns the simplification settings to use when rendering vector layers. | |
bool | testFlag (Qgis::MapSettingsFlag flag) const |
Check whether a particular flag is enabled. | |
Qgis::TextRenderFormat | textRenderFormat () const |
Returns the text render format, which dictates how text is rendered (e.g. | |
QgsCoordinateTransformContext | transformContext () const |
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. | |
QgsRectangle | visibleExtent () const |
Returns the actual extent derived from requested extent that takes output image size into account. | |
QPolygonF | visiblePolygon () const |
Returns the visible area as a polygon (may be rotated) | |
QPolygonF | visiblePolygonWithBuffer () const |
Returns the visible area as a polygon (may be rotated) with extent buffer included. | |
void | writeXml (QDomNode &node, QDomDocument &doc) |
Writes the map settings to an XML node. | |
QgsDoubleRange | zRange () const |
Returns the range of z-values which will be visible in the map. | |
Public Member Functions inherited from QgsTemporalRangeObject | |
QgsTemporalRangeObject (bool enabled=false) | |
Constructor QgsTemporalRangeObject. | |
virtual | ~QgsTemporalRangeObject ()=default |
bool | isTemporal () const |
Returns true if the object's temporal range is enabled, and the object will be filtered when rendering maps with a specific time range set. | |
void | setIsTemporal (bool enabled) |
Sets whether the temporal range is enabled (i.e. | |
void | setTemporalRange (const QgsDateTimeRange &range) |
Sets the temporal range for the object. | |
const QgsDateTimeRange & | temporalRange () const |
Returns the datetime range for the object. | |
Protected Member Functions | |
void | updateDerived () |
The QgsMapSettings class contains configuration for rendering of the map.
The rendering itself is done by QgsMapRendererJob subclasses.
In order to set up QgsMapSettings instance, it is necessary to set at least few members: extent, output size and layers.
Some systems use high DPI scaling that is an alternative to the traditional DPI scaling. The operating system provides Qt with a scaling ratio and it scales window, event, and desktop geometry. The Cocoa platform plugin sets the scaling ratio as QWindow::devicePixelRatio(). To properly render the map on such systems, the map settings device pixel ratio shall be set accordingly.
Definition at line 90 of file qgsmapsettings.h.
QgsMapSettings::QgsMapSettings | ( | ) |
Definition at line 34 of file qgsmapsettings.cpp.
void QgsMapSettings::addClippingRegion | ( | const QgsMapClippingRegion & | region | ) |
Adds a new clipping region to the map settings.
Definition at line 822 of file qgsmapsettings.cpp.
void QgsMapSettings::addRenderedFeatureHandler | ( | QgsRenderedFeatureHandlerInterface * | handler | ) |
Adds a rendered feature handler to use while rendering the map settings.
Ownership of handler is NOT transferred, and it is the caller's responsibility to ensure that the handler exists for the lifetime of the map render job.
Definition at line 842 of file qgsmapsettings.cpp.
|
inline |
Returns the background color of the map.
Definition at line 380 of file qgsmapsettings.h.
|
inline |
Clears the specified custom rendering flag.
flag | the flag name |
Definition at line 331 of file qgsmapsettings.h.
QList< QgsMapClippingRegion > QgsMapSettings::clippingRegions | ( | ) | const |
Returns the list of clipping regions to apply to the map.
Definition at line 832 of file qgsmapsettings.cpp.
QgsRectangle QgsMapSettings::computeExtentForScale | ( | const QgsPointXY & | center, |
double | scale | ||
) | const |
Compute the extent such that its center is at the specified position (mapped to the destinatonCrs) and the zoom factor corresponds to the specified scale.
center | the center, in map coordinates |
scale | the desired zoom factor (the x part of 1:x) |
Definition at line 488 of file qgsmapsettings.cpp.
double QgsMapSettings::computeScaleForExtent | ( | const QgsRectangle & | extent | ) | const |
Compute the scale that corresponds to the specified extent.
extent | the extent, as passed to |
Definition at line 516 of file qgsmapsettings.cpp.
long long QgsMapSettings::currentFrame | ( | ) | const |
Returns the current frame number of the map, for maps which are part of an animation.
Returns -1 if the map is not associated with an animation.
Definition at line 882 of file qgsmapsettings.cpp.
|
inline |
Returns custom rendering flags.
Layers might honour these to alter their rendering.
Definition at line 298 of file qgsmapsettings.h.
|
inline |
Returns any custom rendering flags.
Layers might honour these to alter their rendering.
Definition at line 314 of file qgsmapsettings.h.
QgsCoordinateReferenceSystem QgsMapSettings::destinationCrs | ( | ) | const |
Returns the destination coordinate reference system for the map render.
Definition at line 357 of file qgsmapsettings.cpp.
QSize QgsMapSettings::deviceOutputSize | ( | ) | const |
Returns the device output size of the map render.
This is equivalent to the output size multiplicated by the device pixel ratio.
Definition at line 261 of file qgsmapsettings.cpp.
float QgsMapSettings::devicePixelRatio | ( | ) | const |
Returns the device pixel ratio.
Common values are 1 for normal-dpi displays and 2 for high-dpi "retina" displays.
Definition at line 250 of file qgsmapsettings.cpp.
double QgsMapSettings::dpiTarget | ( | ) | const |
Returns the target DPI (dots per inch) to be taken into consideration when rendering.
The default value is -1, which states no DPI target is provided.
Definition at line 278 of file qgsmapsettings.cpp.
const QgsElevationShadingRenderer & QgsMapSettings::elevationShadingRenderer | ( | ) | const |
Returns the shading renderer used to render shading on the entire map.
Definition at line 892 of file qgsmapsettings.cpp.
|
inline |
Returns ellipsoid's acronym.
Calculations will only use the ellipsoid if a valid ellipsoid has been set.
Definition at line 366 of file qgsmapsettings.h.
|
inline |
Gets the expression context.
This context should be used for all expression evaluation associated with this map settings.
Definition at line 476 of file qgsmapsettings.h.
QgsRectangle QgsMapSettings::extent | ( | ) | const |
Returns geographical coordinates of the rectangle that should be rendered.
Definition at line 74 of file qgsmapsettings.cpp.
double QgsMapSettings::extentBuffer | ( | ) | const |
Returns the buffer in map units to use around the visible extent for rendering symbols whose corresponding geometries are outside the visible extent.
Definition at line 91 of file qgsmapsettings.cpp.
Qgis::MapSettingsFlags QgsMapSettings::flags | ( | ) | const |
Returns combination of flags used for rendering.
Definition at line 389 of file qgsmapsettings.cpp.
double QgsMapSettings::frameRate | ( | ) | const |
Returns the frame rate of the map (in frames per second), for maps which are part of an animation.
Returns -1 if the map is not associated with an animation.
Definition at line 872 of file qgsmapsettings.cpp.
QgsRectangle QgsMapSettings::fullExtent | ( | ) | const |
returns current extent of layer set
Definition at line 688 of file qgsmapsettings.cpp.
bool QgsMapSettings::hasValidSettings | ( | ) | const |
Check whether the map settings are valid and can be used for rendering.
Definition at line 405 of file qgsmapsettings.cpp.
|
inline |
Returns the list of regions to avoid placing labels within.
Definition at line 701 of file qgsmapsettings.h.
QgsGeometry QgsMapSettings::labelBoundaryGeometry | ( | ) | const |
Returns the label boundary geometry, which restricts where in the rendered map labels are permitted to be placed.
By default this is a null geometry, which indicates that labels can be placed anywhere within the map's visiblePolygon().
The geometry is specified using the map's destinationCrs().
Definition at line 812 of file qgsmapsettings.cpp.
|
inline |
Returns the global configuration of the labeling engine.
Definition at line 657 of file qgsmapsettings.h.
QgsRectangle QgsMapSettings::layerExtentToOutputExtent | ( | const QgsMapLayer * | layer, |
QgsRectangle | extent | ||
) | const |
transform bounding box from layer's CRS to output CRS
Definition at line 527 of file qgsmapsettings.cpp.
QStringList QgsMapSettings::layerIds | ( | bool | expandGroupLayers = false | ) | const |
Returns the list of layer IDs which will be rendered in the map.
The layers are stored in the reverse order of how they are rendered (layer with index 0 will be on top).
Since QGIS 3.24, if the expandGroupLayers option is true
then group layers will be converted to all their child layers.
Definition at line 288 of file qgsmapsettings.cpp.
QList< QgsMapLayer * > QgsMapSettings::layers | ( | bool | expandGroupLayers = false | ) | const |
Returns the list of layers which will be rendered in the map.
The layers are stored in the reverse order of how they are rendered (layer with index 0 will be on top)
Since QGIS 3.24, if the expandGroupLayers option is true
then group layers will be converted to all their child layers.
Definition at line 298 of file qgsmapsettings.cpp.
QMap< QString, QString > QgsMapSettings::layerStyleOverrides | ( | ) | const |
Returns the map of map layer style overrides (key: layer ID, value: style name) where a different style should be used instead of the current one.
Definition at line 339 of file qgsmapsettings.cpp.
QgsPoint QgsMapSettings::layerToMapCoordinates | ( | const QgsMapLayer * | layer, |
const QgsPoint & | point | ||
) | const |
transform point coordinates from layer's CRS to output CRS
Definition at line 593 of file qgsmapsettings.cpp.
QgsPointXY QgsMapSettings::layerToMapCoordinates | ( | const QgsMapLayer * | layer, |
QgsPointXY | point | ||
) | const |
transform point coordinates from layer's CRS to output CRS
Definition at line 577 of file qgsmapsettings.cpp.
QgsRectangle QgsMapSettings::layerToMapCoordinates | ( | const QgsMapLayer * | layer, |
QgsRectangle | rect | ||
) | const |
transform rectangle from layer's CRS to output CRS
Definition at line 615 of file qgsmapsettings.cpp.
double QgsMapSettings::layerToMapUnits | ( | const QgsMapLayer * | layer, |
const QgsRectangle & | referenceExtent = QgsRectangle() |
||
) | const |
Computes an estimated conversion factor between layer and map units, where layerUnits × layerToMapUnits = mapUnits
layer | The layer |
referenceExtent | A reference extent based on which to perform the computation. If not specified, the layer extent is used |
Definition at line 521 of file qgsmapsettings.cpp.
QgsCoordinateTransform QgsMapSettings::layerTransform | ( | const QgsMapLayer * | layer | ) | const |
Returns the coordinate transform from layer's CRS to destination CRS.
Definition at line 480 of file qgsmapsettings.cpp.
double QgsMapSettings::magnificationFactor | ( | ) | const |
Returns the magnification factor.
Definition at line 69 of file qgsmapsettings.cpp.
QgsPoint QgsMapSettings::mapToLayerCoordinates | ( | const QgsMapLayer * | layer, |
const QgsPoint & | point | ||
) | const |
transform point coordinates from output CRS to layer's CRS
Definition at line 648 of file qgsmapsettings.cpp.
QgsPointXY QgsMapSettings::mapToLayerCoordinates | ( | const QgsMapLayer * | layer, |
QgsPointXY | point | ||
) | const |
transform point coordinates from output CRS to layer's CRS
Definition at line 632 of file qgsmapsettings.cpp.
QgsRectangle QgsMapSettings::mapToLayerCoordinates | ( | const QgsMapLayer * | layer, |
QgsRectangle | rect | ||
) | const |
transform rectangle from output CRS to layer's CRS
Definition at line 670 of file qgsmapsettings.cpp.
|
inline |
Definition at line 512 of file qgsmapsettings.h.
Qgis::DistanceUnit QgsMapSettings::mapUnits | ( | ) | const |
Returns the units of the map's geographical coordinates - used for scale calculation.
Definition at line 399 of file qgsmapsettings.cpp.
double QgsMapSettings::mapUnitsPerPixel | ( | ) | const |
Returns the distance in geographical coordinates that equals to one pixel in the map.
Definition at line 452 of file qgsmapsettings.cpp.
|
inline |
Returns a reference to the mask render settings, which control how masks are drawn and behave during the map render.
Definition at line 780 of file qgsmapsettings.h.
|
inline |
Returns a reference to the mask render settings, which control how masks are drawn and behave during the map render.
Definition at line 771 of file qgsmapsettings.h.
double QgsMapSettings::outputDpi | ( | ) | const |
Returns the DPI (dots per inch) used for conversion between real world units (e.g.
mm) and pixels.
The default value is 96 dpi.
Definition at line 266 of file qgsmapsettings.cpp.
QgsRectangle QgsMapSettings::outputExtentToLayerExtent | ( | const QgsMapLayer * | layer, |
QgsRectangle | extent | ||
) | const |
transform bounding box from output CRS to layer's CRS
Definition at line 552 of file qgsmapsettings.cpp.
|
inline |
format of internal QImage, default QImage::Format_ARGB32_Premultiplied
Definition at line 436 of file qgsmapsettings.h.
QSize QgsMapSettings::outputSize | ( | ) | const |
Returns the size of the resulting map image, in pixels.
Definition at line 238 of file qgsmapsettings.cpp.
|
inline |
Returns the path resolver for conversion between relative and absolute paths during rendering operations, e.g.
for resolving relative symbol paths.
Definition at line 502 of file qgsmapsettings.h.
void QgsMapSettings::readXml | ( | QDomNode & | node | ) |
Restore the map settings from a XML node.
Definition at line 747 of file qgsmapsettings.cpp.
QList< QgsRenderedFeatureHandlerInterface * > QgsMapSettings::renderedFeatureHandlers | ( | ) | const |
Returns the list of rendered feature handlers to use while rendering the map settings.
Definition at line 847 of file qgsmapsettings.cpp.
Qgis::RendererUsage QgsMapSettings::rendererUsage | ( | ) | const |
Returns the rendering usage.
Definition at line 862 of file qgsmapsettings.cpp.
double QgsMapSettings::rotation | ( | ) | const |
Returns the rotation of the resulting map image, in degrees clockwise.
Definition at line 101 of file qgsmapsettings.cpp.
double QgsMapSettings::scale | ( | ) | const |
Returns the calculated map scale.
The scale value indicates the scale denominator, e.g. 1000.0 for a 1:1000 map.
Definition at line 457 of file qgsmapsettings.cpp.
|
inline |
Gets the segmentation tolerance applied when rendering curved geometries.
Definition at line 626 of file qgsmapsettings.h.
|
inline |
Gets segmentation tolerance type (maximum angle or maximum difference between curve and approximation)
Definition at line 634 of file qgsmapsettings.h.
|
inline |
Returns the color that is used for drawing of selected vector features.
Definition at line 394 of file qgsmapsettings.h.
|
inline |
Sets the background color of the map.
Definition at line 373 of file qgsmapsettings.h.
void QgsMapSettings::setClippingRegions | ( | const QList< QgsMapClippingRegion > & | regions | ) |
Sets the list of clipping regions to apply to the map.
Definition at line 827 of file qgsmapsettings.cpp.
void QgsMapSettings::setCurrentFrame | ( | long long | frame | ) |
Sets the current frame of the map, for maps which are part of an animation.
Defaults to -1 if the map is not associated with an animation.
Definition at line 887 of file qgsmapsettings.cpp.
|
inline |
Sets the custom rendering flags.
Layers might honour these to alter their rendering.
customRenderFlags | custom flags strings, separated by ';' |
Definition at line 306 of file qgsmapsettings.h.
|
inline |
Sets a custom rendering flag.
Layers might honour these to alter their rendering.
flag | the flag name |
value | the flag value |
Definition at line 323 of file qgsmapsettings.h.
void QgsMapSettings::setDestinationCrs | ( | const QgsCoordinateReferenceSystem & | crs | ) |
Sets the destination crs (coordinate reference system) for the map render.
Definition at line 349 of file qgsmapsettings.cpp.
void QgsMapSettings::setDevicePixelRatio | ( | float | dpr | ) |
Sets the device pixel ratio.
Common values are 1 for normal-dpi displays and 2 for high-dpi "retina" displays.
Definition at line 255 of file qgsmapsettings.cpp.
void QgsMapSettings::setDpiTarget | ( | double | dpi | ) |
Sets the target dpi (dots per inch) to be taken into consideration when rendering.
Definition at line 283 of file qgsmapsettings.cpp.
void QgsMapSettings::setElevationShadingRenderer | ( | const QgsElevationShadingRenderer & | renderer | ) |
Sets the shading renderer used to render shading on the entire map.
Definition at line 897 of file qgsmapsettings.cpp.
bool QgsMapSettings::setEllipsoid | ( | const QString & | ellipsoid | ) |
Sets the ellipsoid by its acronym.
Known ellipsoid acronyms can be retrieved using QgsEllipsoidUtils::acronyms(). Calculations will only use the ellipsoid if a valid ellipsoid has been set.
true
if ellipsoid was successfully set Definition at line 362 of file qgsmapsettings.cpp.
|
inline |
Sets the expression context.
This context is used for all expression evaluation associated with this map settings.
Definition at line 469 of file qgsmapsettings.h.
void QgsMapSettings::setExtent | ( | const QgsRectangle & | rect, |
bool | magnified = true |
||
) |
Sets the coordinates of the rectangle which should be rendered.
Definition at line 79 of file qgsmapsettings.cpp.
void QgsMapSettings::setExtentBuffer | ( | double | buffer | ) |
Sets the buffer in map units to use around the visible extent for rendering symbols whose corresponding geometries are outside the visible extent.
This is useful when using tiles to avoid cut symbols at tile boundaries.
Definition at line 96 of file qgsmapsettings.cpp.
void QgsMapSettings::setFlag | ( | Qgis::MapSettingsFlag | flag, |
bool | on = true |
||
) |
Enable or disable a particular flag (other flags are not affected)
Definition at line 381 of file qgsmapsettings.cpp.
void QgsMapSettings::setFlags | ( | Qgis::MapSettingsFlags | flags | ) |
Sets combination of flags that will be used for rendering.
Definition at line 376 of file qgsmapsettings.cpp.
void QgsMapSettings::setFrameRate | ( | double | rate | ) |
Sets the frame rate of the map (in frames per second), for maps which are part of an animation.
Defaults to -1 if the map is not associated with an animation.
Definition at line 877 of file qgsmapsettings.cpp.
|
inline |
Sets a list of regions to avoid placing labels within.
Definition at line 693 of file qgsmapsettings.h.
void QgsMapSettings::setLabelBoundaryGeometry | ( | const QgsGeometry & | boundary | ) |
Sets the label boundary geometry, which restricts where in the rendered map labels are permitted to be placed.
A null boundary geometry (the default) indicates that labels can be placed anywhere within the map's visiblePolygon().
The geometry is specified using the map's destinationCrs().
Definition at line 817 of file qgsmapsettings.cpp.
|
inline |
Sets the global configuration of the labeling engine.
Definition at line 645 of file qgsmapsettings.h.
void QgsMapSettings::setLayers | ( | const QList< QgsMapLayer * > & | layers | ) |
Sets the list of layers to render in the map.
The layers are stored in the reverse order of how they are rendered (layer with index 0 will be on top)
Definition at line 326 of file qgsmapsettings.cpp.
void QgsMapSettings::setLayerStyleOverrides | ( | const QMap< QString, QString > & | overrides | ) |
Sets the map of map layer style overrides (key: layer ID, value: style name) where a different style should be used instead of the current one.
Definition at line 344 of file qgsmapsettings.cpp.
void QgsMapSettings::setMagnificationFactor | ( | double | factor, |
const QgsPointXY * | center = nullptr |
||
) |
Set the magnification factor.
factor | the factor of magnification |
center | optional point to re-center the map |
Definition at line 48 of file qgsmapsettings.cpp.
void QgsMapSettings::setMaskSettings | ( | const QgsMaskRenderSettings & | settings | ) |
Sets the mask render settings, which control how masks are drawn and behave during the map render.
Definition at line 837 of file qgsmapsettings.cpp.
void QgsMapSettings::setOutputDpi | ( | double | dpi | ) |
Sets the dpi (dots per inch) used for conversion between real world units (e.g.
mm) and pixels.
Definition at line 271 of file qgsmapsettings.cpp.
|
inline |
sets format of internal QImage
Definition at line 434 of file qgsmapsettings.h.
void QgsMapSettings::setOutputSize | ( | QSize | size | ) |
Sets the size of the resulting map image, in pixels.
Definition at line 243 of file qgsmapsettings.cpp.
|
inline |
Sets the path resolver for conversion between relative and absolute paths during rendering operations, e.g.
for resolving relative symbol paths.
Definition at line 510 of file qgsmapsettings.h.
void QgsMapSettings::setRendererUsage | ( | Qgis::RendererUsage | rendererUsage | ) |
Sets the rendering usage.
Definition at line 867 of file qgsmapsettings.cpp.
void QgsMapSettings::setRotation | ( | double | rotation | ) |
Sets the rotation of the resulting map image, in degrees clockwise.
Definition at line 106 of file qgsmapsettings.cpp.
|
inline |
Sets the segmentation tolerance applied when rendering curved geometries.
tolerance | the segmentation tolerance |
Definition at line 624 of file qgsmapsettings.h.
|
inline |
Sets segmentation tolerance type (maximum angle or maximum difference between curve and approximation)
type | the segmentation tolerance typename |
Definition at line 632 of file qgsmapsettings.h.
|
inline |
Sets the color that is used for drawing of selected vector features.
Definition at line 387 of file qgsmapsettings.h.
|
inline |
Sets the simplification setting to use when rendering vector layers.
If the simplify method is enabled, it will override all other layer-specific simplification settings and will apply to all vector layers rendered for the map.
This can be used to specify global simplification methods to apply during map exports, e.g. to allow vector layers to be simplified to an appropriate maximum level of detail during PDF exports.
The default is to use no global simplification, and fallback to individual layer's settings instead.
Definition at line 749 of file qgsmapsettings.h.
|
inline |
Sets the text render format, which dictates how text is rendered (e.g.
as paths or real text objects).
Definition at line 425 of file qgsmapsettings.h.
void QgsMapSettings::setTransformContext | ( | const QgsCoordinateTransformContext & | context | ) |
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.
Definition at line 472 of file qgsmapsettings.cpp.
void QgsMapSettings::setZRange | ( | const QgsDoubleRange & | range | ) |
Sets the range of z-values which will be visible in the map.
Definition at line 857 of file qgsmapsettings.cpp.
|
inline |
Returns the simplification settings to use when rendering vector layers.
If enabled, it will override all other layer-specific simplification settings and will apply to all vector layers rendered for the map.
The default is to use no global simplification, and fallback to individual layer's settings instead.
Definition at line 762 of file qgsmapsettings.h.
bool QgsMapSettings::testFlag | ( | Qgis::MapSettingsFlag | flag | ) | const |
Check whether a particular flag is enabled.
Definition at line 394 of file qgsmapsettings.cpp.
|
inline |
Returns the text render format, which dictates how text is rendered (e.g.
as paths or real text objects).
Definition at line 411 of file qgsmapsettings.h.
QgsCoordinateTransformContext QgsMapSettings::transformContext | ( | ) | const |
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.
Definition at line 462 of file qgsmapsettings.cpp.
|
protected |
Definition at line 118 of file qgsmapsettings.cpp.
QgsRectangle QgsMapSettings::visibleExtent | ( | ) | const |
Returns the actual extent derived from requested extent that takes output image size into account.
Definition at line 410 of file qgsmapsettings.cpp.
QPolygonF QgsMapSettings::visiblePolygon | ( | ) | const |
Returns the visible area as a polygon (may be rotated)
Definition at line 415 of file qgsmapsettings.cpp.
QPolygonF QgsMapSettings::visiblePolygonWithBuffer | ( | ) | const |
Returns the visible area as a polygon (may be rotated) with extent buffer included.
Definition at line 430 of file qgsmapsettings.cpp.
void QgsMapSettings::writeXml | ( | QDomNode & | node, |
QDomDocument & | doc | ||
) |
Writes the map settings to an XML node.
Definition at line 782 of file qgsmapsettings.cpp.
QgsDoubleRange QgsMapSettings::zRange | ( | ) | const |
Returns the range of z-values which will be visible in the map.
Definition at line 852 of file qgsmapsettings.cpp.
|
protected |
Definition at line 925 of file qgsmapsettings.h.
|
protected |
Definition at line 964 of file qgsmapsettings.h.
|
protected |
Definition at line 917 of file qgsmapsettings.h.
|
protected |
Definition at line 918 of file qgsmapsettings.h.
|
protected |
Definition at line 921 of file qgsmapsettings.h.
|
protected |
Definition at line 906 of file qgsmapsettings.h.
|
protected |
Definition at line 902 of file qgsmapsettings.h.
|
protected |
Definition at line 903 of file qgsmapsettings.h.
|
protected |
ellipsoid acronym (from table tbl_ellipsoids)
Definition at line 923 of file qgsmapsettings.h.
|
protected |
Definition at line 919 of file qgsmapsettings.h.
|
protected |
Definition at line 908 of file qgsmapsettings.h.
|
protected |
Definition at line 909 of file qgsmapsettings.h.
|
protected |
Definition at line 928 of file qgsmapsettings.h.
|
protected |
Definition at line 963 of file qgsmapsettings.h.
|
protected |
Definition at line 930 of file qgsmapsettings.h.
|
protected |
Definition at line 955 of file qgsmapsettings.h.
|
protected |
Definition at line 935 of file qgsmapsettings.h.
|
protected |
list of layers to be rendered (stored as weak pointers)
Definition at line 915 of file qgsmapsettings.h.
|
protected |
Definition at line 916 of file qgsmapsettings.h.
|
protected |
Definition at line 912 of file qgsmapsettings.h.
|
protected |
Definition at line 947 of file qgsmapsettings.h.
|
protected |
Definition at line 942 of file qgsmapsettings.h.
|
protected |
Definition at line 966 of file qgsmapsettings.h.
|
protected |
Definition at line 951 of file qgsmapsettings.h.
|
protected |
Definition at line 959 of file qgsmapsettings.h.
|
protected |
Definition at line 911 of file qgsmapsettings.h.
|
protected |
Definition at line 943 of file qgsmapsettings.h.
|
protected |
Definition at line 946 of file qgsmapsettings.h.
|
protected |
Definition at line 932 of file qgsmapsettings.h.
|
protected |
Definition at line 933 of file qgsmapsettings.h.
|
protected |
Definition at line 926 of file qgsmapsettings.h.
|
protected |
Definition at line 961 of file qgsmapsettings.h.
|
protected |
Definition at line 957 of file qgsmapsettings.h.
|
protected |
Definition at line 905 of file qgsmapsettings.h.
|
protected |
Definition at line 953 of file qgsmapsettings.h.
|
protected |
Definition at line 949 of file qgsmapsettings.h.
|
protected |
Whether the actual settings are valid (set in updateDerived())
Definition at line 939 of file qgsmapsettings.h.
|
protected |
Extent with some additional white space that matches the output aspect ratio.
Definition at line 941 of file qgsmapsettings.h.