16 #ifndef QGSMAPSETTINGS_H
17 #define QGSMAPSETTINGS_H
19 #include "qgis_core.h"
25 #include <QStringList>
61 : geometry( geometry )
114 void setExtent(
const QgsRectangle &rect,
bool magnified =
true );
122 double extentBuffer()
const;
130 void setExtentBuffer(
double buffer );
138 QSize outputSize()
const;
145 void setOutputSize( QSize size );
153 float devicePixelRatio()
const;
161 void setDevicePixelRatio(
float dpr );
175 QSize deviceOutputSize()
const;
182 double rotation()
const;
189 void setRotation(
double rotation );
198 double outputDpi()
const;
205 void setOutputDpi(
double dpi );
215 double dpiTarget()
const;
223 void setDpiTarget(
double dpi );
232 void setMagnificationFactor(
double factor,
const QgsPointXY *center =
nullptr );
239 double magnificationFactor()
const;
249 QStringList layerIds()
const;
259 QList<QgsMapLayer *> layers()
const;
271 void setLayers(
const QList<QgsMapLayer *> &layers );
279 QMap<QString, QString> layerStyleOverrides()
const;
287 void setLayerStyleOverrides(
const QMap<QString, QString> &overrides );
305 Q_DECL_DEPRECATED
void setCustomRenderFlags(
const QString &customRenderFlags ) { mCustomRenderFlags = customRenderFlags; }
359 bool setEllipsoid(
const QString &ellipsoid );
401 DrawEditingInfo = 0x02,
402 ForceVectorOutput = 0x04,
403 UseAdvancedEffects = 0x08,
405 UseRenderingOptimization = 0x20,
406 DrawSelection = 0x40,
407 DrawSymbolBounds = 0x80,
408 RenderMapTile = 0x100,
409 RenderPartialOutput = 0x200,
410 RenderPreviewJob = 0x400,
411 RenderBlocking = 0x800,
412 LosslessImageRendering = 0x1000,
413 Render3DMap = 0x2000,
416 Q_DECLARE_FLAGS( Flags, Flag )
419 void setFlags( QgsMapSettings::Flags flags );
421 void setFlag( Flag flag,
bool on =
true );
425 bool testFlag( Flag flag )
const;
435 return mTextRenderFormat;
449 mTextRenderFormat = format;
452 mLabelingEngineSettings.setDefaultTextRenderFormat( format );
461 bool hasValidSettings()
const;
469 QPolygonF visiblePolygon()
const;
471 double mapUnitsPerPixel()
const;
477 double scale()
const;
608 void readXml( QDomNode &node );
610 void writeXml( QDomNode &node, QDomDocument &doc );
640 mLabelingEngineSettings = settings;
679 void setLabelBoundaryGeometry(
const QgsGeometry &boundary );
715 void setClippingRegions(
const QList< QgsMapClippingRegion > ®ions );
725 QList< QgsMapClippingRegion > clippingRegions()
const;
774 QList< QgsRenderedFeatureHandlerInterface * > renderedFeatureHandlers()
const;
795 double mDpiTarget = -1;
798 float mDevicePixelRatio = 1.0;
801 double mExtentBuffer = 0.0;
803 double mRotation = 0.0;
804 double mMagnificationFactor = 1.0;
822 QImage::Format mImageFormat = QImage::Format_ARGB32_Premultiplied;
832 double mMapUnitsPerPixel = 1;
850 bool mHasTransformContext =
false;
853 void updateDerived();
857 QList< QgsLabelBlockingRegion > mLabelBlockingRegions;
858 QList< QgsMapClippingRegion > mClippingRegions;
859 QList< QgsRenderedFeatureHandlerInterface * > mRenderedFeatureHandlers;
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.
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.
QgsRenderContext::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
void setTextRenderFormat(QgsRenderContext::TextRenderFormat format)
Sets the text render format, which dictates how text is rendered (e.g.
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.
QgsRenderContext::TextRenderFormat textRenderFormat() const
Returns 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.
QString mCustomRenderFlags
Flag
Enumeration of flags that adjust the way the map is rendered.
QgsLabelingEngineSettings mLabelingEngineSettings
QString mEllipsoid
ellipsoid acronym (from table tbl_ellipsoids)
QColor backgroundColor() const
Returns the background color of the map.
const QgsExpressionContext & expressionContext() const
Gets the expression context.
void setCustomRenderingFlag(const QString &flag, const QVariant &value)
Sets a custom rendering flag.
void setOutputImageFormat(QImage::Format format)
sets format of internal QImage
const QgsPathResolver & pathResolver() const
Returns the path resolver for conversion between relative and absolute paths during rendering operati...
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
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
const QgsMapToPixel & mapToPixel() const
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...
const QgsVectorSimplifyMethod & simplifyMethod() const
Returns the simplification settings to use when rendering vector layers.
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...
const QgsLabelingEngineSettings & labelingEngineSettings() const
Returns the global configuration of the labeling engine.
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.
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...
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.
TextRenderFormat
Options for rendering text.
@ TextFormatAlwaysOutlines
Always render text using path objects (AKA outlines/curves).
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.
DistanceUnit
Units of distance.
This class contains information how to simplify geometries fetched from a vector layer.
Q_DECLARE_OPERATORS_FOR_FLAGS(QgsField::ConfigurationFlags) CORE_EXPORT QDataStream &operator<<(QDataStream &out
Writes the field to stream out. QGIS version compatibility is not guaranteed.
QList< QgsWeakMapLayerPointer > QgsWeakMapLayerPointerList
A list of weak pointers to QgsMapLayers.
const QgsCoordinateReferenceSystem & crs