16#ifndef QGSMAPSETTINGS_H
17#define QGSMAPSETTINGS_H
63 : geometry( geometry )
115 void setExtent(
const QgsRectangle &rect,
bool magnified =
true );
123 double extentBuffer()
const;
131 void setExtentBuffer(
double buffer );
139 QSize outputSize()
const;
146 void setOutputSize( QSize size );
154 float devicePixelRatio()
const;
162 void setDevicePixelRatio(
float dpr );
176 QSize deviceOutputSize()
const;
182 double rotation()
const;
188 void setRotation(
double rotation );
197 double outputDpi()
const;
204 void setOutputDpi(
double dpi );
214 double dpiTarget()
const;
222 void setDpiTarget(
double dpi );
230 void setMagnificationFactor(
double factor,
const QgsPointXY *center =
nullptr );
236 double magnificationFactor()
const;
249 QStringList layerIds(
bool expandGroupLayers =
false )
const;
262 QList<QgsMapLayer *> layers(
bool expandGroupLayers =
false )
const;
274 void setLayers(
const QList<QgsMapLayer *> &layers );
281 QMap<QString, QString> layerStyleOverrides()
const;
288 void setLayerStyleOverrides(
const QMap<QString, QString> &overrides );
304 Q_DECL_DEPRECATED
void setCustomRenderFlags(
const QString &customRenderFlags ) { mCustomRenderFlags = customRenderFlags; }
357 bool setEllipsoid(
const QString &ellipsoid );
395 void setFlags( Qgis::MapSettingsFlags flags );
399 Qgis::MapSettingsFlags flags()
const;
411 return mTextRenderFormat;
425 mTextRenderFormat = format;
428 mLabelingEngineSettings.setDefaultTextRenderFormat( format );
437 bool hasValidSettings()
const;
444 QPolygonF visiblePolygon()
const;
451 QPolygonF visiblePolygonWithBuffer()
const;
454 double mapUnitsPerPixel()
const;
460 double scale()
const;
599 double computeScaleForExtent(
const QgsRectangle &extent )
const;
606 void readXml( QDomNode &node );
608 void writeXml( QDomNode &node, QDomDocument &doc );
637 mLabelingEngineSettings = settings;
675 void setLabelBoundaryGeometry(
const QgsGeometry &boundary );
711 void setClippingRegions(
const QList< QgsMapClippingRegion > ®ions );
721 QList< QgsMapClippingRegion > clippingRegions()
const;
770 QList< QgsRenderedFeatureHandlerInterface * > renderedFeatureHandlers()
const;
815 double frameRate()
const;
825 void setFrameRate(
double rate );
835 long long currentFrame()
const;
845 void setCurrentFrame(
long long frame );
866 double mDpiTarget = -1;
869 float mDevicePixelRatio = 1.0;
872 double mExtentBuffer = 0.0;
874 double mRotation = 0.0;
875 double mMagnificationFactor = 1.0;
893 QImage::Format mImageFormat = QImage::Format_ARGB32_Premultiplied;
905 double mMapUnitsPerPixel = 1;
926 double mFrameRate = -1;
927 long long mCurrentFrame = -1;
930 bool mHasTransformContext =
false;
933 void updateDerived();
937 QList< QgsLabelBlockingRegion > mLabelBlockingRegions;
938 QList< QgsMapClippingRegion > mClippingRegions;
939 QList< QgsRenderedFeatureHandlerInterface * > mRenderedFeatureHandlers;
DistanceUnit
Units of distance.
TextRenderFormat
Flags which control how map layer renderers behave.
@ AlwaysOutlines
Always render text using path objects (AKA outlines/curves). This setting guarantees the best quality...
RendererUsage
Usage of the renderer.
@ Unknown
Renderer used for unknown usage.
MapSettingsFlag
Coordinate transformation flags.
SegmentationToleranceType
Segmentation tolerance as maximum angle or maximum difference between approximation and circle.
@ MaximumAngle
Maximum angle between generating radii (lines from arc center to output vertices)
This class represents a coordinate reference system (CRS).
Contains information about the context in which a coordinate transform is executed.
QgsRange which stores a range of double values.
This class can render elevation shading on an image with different methods (eye dome lighting,...
Expression contexts are used to encapsulate the parameters around which a QgsExpression should be eva...
A geometry is the spatial representation of a feature.
Label blocking region (in map coordinates and CRS).
QgsGeometry geometry
Geometry of region to avoid placing labels within (in destination map coordinates and CRS)
QgsLabelBlockingRegion(const QgsGeometry &geometry)
Constructor for a label blocking region.
Stores global configuration for labeling engine.
Qgis::TextRenderFormat defaultTextRenderFormat() const
Returns the default text rendering format for the labels.
A map clipping region (in map coordinates and CRS).
Base class for all map layer types.
Abstract base class for map rendering implementations.
The QgsMapSettings class contains configuration for rendering of the map.
QgsVectorSimplifyMethod mSimplifyMethod
const QgsLabelingEngineSettings & labelingEngineSettings() const
Returns the global configuration of the labeling engine.
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.
QgsRectangle mVisibleExtent
Extent with some additional white space that matches the output aspect ratio.
Q_DECL_DEPRECATED void setCustomRenderFlags(const QString &customRenderFlags)
Sets the custom rendering flags.
void setTextRenderFormat(Qgis::TextRenderFormat format)
Sets the text render format, which dictates how text is rendered (e.g.
void clearCustomRenderingFlag(const QString &flag)
Clears the specified custom rendering flag.
double segmentationTolerance() const
Gets the segmentation tolerance applied when rendering curved geometries.
Qgis::MapSettingsFlags mFlags
QString mCustomRenderFlags
const QgsVectorSimplifyMethod & simplifyMethod() const
Returns the simplification settings to use when rendering vector layers.
QgsLabelingEngineSettings mLabelingEngineSettings
QString mEllipsoid
ellipsoid acronym (from table tbl_ellipsoids)
QColor backgroundColor() const
Returns the background color of the map.
const QgsMapToPixel & mapToPixel() const
void setCustomRenderingFlag(const QString &flag, const QVariant &value)
Sets a custom rendering flag.
void setOutputImageFormat(QImage::Format format)
sets format of internal QImage
QMap< QString, QString > mLayerStyleOverrides
QList< QgsLabelBlockingRegion > labelBlockingRegions() const
Returns the list of regions to avoid placing labels within.
void setSegmentationTolerance(double tolerance)
Sets the segmentation tolerance applied when rendering curved geometries.
QgsGeometry mLabelBoundaryGeometry
QgsElevationShadingRenderer mShadingRenderer
QgsCoordinateTransformContext mTransformContext
QImage::Format outputImageFormat() const
format of internal QImage, default QImage::Format_ARGB32_Premultiplied
QgsPathResolver mPathResolver
QgsScaleCalculator mScaleCalculator
void setExpressionContext(const QgsExpressionContext &context)
Sets the expression context.
QVariantMap mCustomRenderingFlags
QgsExpressionContext mExpressionContext
QColor selectionColor() const
Returns the color that is used for drawing of selected vector features.
QgsAbstractGeometry::SegmentationToleranceType segmentationToleranceType() const
Gets segmentation tolerance type (maximum angle or maximum difference between curve and approximation...
QVariantMap customRenderingFlags() const
Returns any custom rendering flags.
void setLabelingEngineSettings(const QgsLabelingEngineSettings &settings)
Sets the global configuration of the labeling engine.
Q_DECL_DEPRECATED QString customRenderFlags() const
Returns custom rendering flags.
QString ellipsoid() const
Returns ellipsoid's acronym.
void setPathResolver(const QgsPathResolver &resolver)
Sets the path resolver for conversion between relative and absolute paths during rendering operations...
Qgis::TextRenderFormat textRenderFormat() const
Returns the text render format, which dictates how text is rendered (e.g.
QgsCoordinateReferenceSystem mDestCRS
QgsMapToPixel mMapToPixel
QgsWeakMapLayerPointerList mLayers
list of layers to be rendered (stored as weak pointers)
void setLabelBlockingRegions(const QList< QgsLabelBlockingRegion > ®ions)
Sets a list of regions to avoid placing labels within.
const QgsPathResolver & pathResolver() const
Returns the path resolver for conversion between relative and absolute paths during rendering operati...
void setBackgroundColor(const QColor &color)
Sets the background color of the map.
void setSegmentationToleranceType(QgsAbstractGeometry::SegmentationToleranceType type)
Sets segmentation tolerance type (maximum angle or maximum difference between curve and approximation...
const QgsExpressionContext & expressionContext() const
Gets the expression context.
double mSegmentationTolerance
Perform transforms between map coordinates and device coordinates.
Resolves relative paths into absolute paths and vice versa.
A class to represent a 2D point.
Point geometry type, with support for z-dimension and m-values.
A rectangle specified with double values.
An interface for classes which provider custom handlers for features rendered as part of a map render...
Calculates scale for a given combination of canvas size, map extent, and monitor dpi.
Base class for objects with an associated (optional) temporal range.
This class contains information how to simplify geometries fetched from a vector layer.
QList< QgsWeakMapLayerPointer > QgsWeakMapLayerPointerList
A list of weak pointers to QgsMapLayers.
const QgsCoordinateReferenceSystem & crs