QGIS API Documentation
3.14.0-Pi (9f7028fd23)
|
Go to the documentation of this file.
16 #ifndef QGSMAPSETTINGS_H
17 #define QGSMAPSETTINGS_H
19 #include "qgis_core.h"
25 #include <QStringList>
60 : geometry( geometry )
105 void setExtent(
const QgsRectangle &rect,
bool magnified =
true );
113 double extentBuffer()
const;
121 void setExtentBuffer(
double buffer );
124 QSize outputSize()
const;
126 void setOutputSize( QSize size );
133 float devicePixelRatio()
const;
140 void setDevicePixelRatio(
float dpr );
148 QSize deviceOutputSize()
const;
155 double rotation()
const;
162 void setRotation(
double rotation );
168 double outputDpi()
const;
170 void setOutputDpi(
double dpi );
179 void setMagnificationFactor(
double factor,
const QgsPointXY *center =
nullptr );
186 double magnificationFactor()
const;
192 QStringList layerIds()
const;
198 QList<QgsMapLayer *> layers()
const;
206 void setLayers(
const QList<QgsMapLayer *> &layers );
212 QMap<QString, QString> layerStyleOverrides()
const;
218 void setLayerStyleOverrides(
const QMap<QString, QString> &overrides );
236 Q_DECL_DEPRECATED
void setCustomRenderFlags(
const QString &customRenderFlags ) { mCustomRenderFlags = customRenderFlags; }
279 bool setEllipsoid(
const QString &ellipsoid );
303 DrawEditingInfo = 0x02,
304 ForceVectorOutput = 0x04,
305 UseAdvancedEffects = 0x08,
307 UseRenderingOptimization = 0x20,
308 DrawSelection = 0x40,
309 DrawSymbolBounds = 0x80,
310 RenderMapTile = 0x100,
311 RenderPartialOutput = 0x200,
312 RenderPreviewJob = 0x400,
313 RenderBlocking = 0x800,
316 Q_DECLARE_FLAGS( Flags, Flag )
319 void setFlags( QgsMapSettings::Flags flags );
321 void setFlag( Flag flag,
bool on =
true );
325 bool testFlag( Flag flag )
const;
335 return mTextRenderFormat;
349 mTextRenderFormat = format;
352 mLabelingEngineSettings.setDefaultTextRenderFormat( format );
361 bool hasValidSettings()
const;
369 QPolygonF visiblePolygon()
const;
371 double mapUnitsPerPixel()
const;
377 double scale()
const;
494 void readXml( QDomNode &node );
496 void writeXml( QDomNode &node, QDomDocument &doc );
524 mLabelingEngineSettings = settings;
563 void setLabelBoundaryGeometry(
const QgsGeometry &boundary );
628 QList< QgsRenderedFeatureHandlerInterface * > renderedFeatureHandlers()
const;
635 float mDevicePixelRatio = 1.0;
638 double mExtentBuffer = 0.0;
640 double mRotation = 0.0;
641 double mMagnificationFactor = 1.0;
659 QImage::Format mImageFormat = QImage::Format_ARGB32_Premultiplied;
669 double mMapUnitsPerPixel = 1;
687 bool mHasTransformContext =
false;
690 void updateDerived();
694 QList< QgsLabelBlockingRegion > mLabelBlockingRegions;
695 QList< QgsRenderedFeatureHandlerInterface * > mRenderedFeatureHandlers;
698 Q_DECLARE_OPERATORS_FOR_FLAGS( QgsMapSettings::Flags )
701 #endif // QGSMAPSETTINGS_H
double mSegmentationTolerance
@ MaximumAngle
Maximum angle between generating radii (lines from arc center to output vertices)
Expression contexts are used to encapsulate the parameters around which a QgsExpression should be eva...
QgsWeakMapLayerPointerList mLayers
list of layers to be rendered (stored as weak pointers)
const QgsLabelingEngineSettings & labelingEngineSettings() const
Returns the global configuration of the labeling engine.
QList< QgsWeakMapLayerPointer > QgsWeakMapLayerPointerList
A list of weak pointers to QgsMapLayers.
QgsRenderContext::TextRenderFormat textRenderFormat() const
Returns the text render format, which dictates how text is rendered (e.g.
QgsExpressionContext mExpressionContext
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.
const QgsCoordinateReferenceSystem & crs
void setTextRenderFormat(QgsRenderContext::TextRenderFormat format)
Sets the text render format, which dictates how text is rendered (e.g.
QgsVectorSimplifyMethod mSimplifyMethod
void clearCustomRenderingFlag(const QString &flag)
Clears the specified custom rendering flag.
QString mCustomRenderFlags
void setSegmentationToleranceType(QgsAbstractGeometry::SegmentationToleranceType type)
Sets segmentation tolerance type (maximum angle or maximum difference between curve and approximation...
QString ellipsoid() const
Returns ellipsoid's acronym.
const QgsVectorSimplifyMethod & simplifyMethod() const
Returns the simplification settings to use when rendering vector layers.
TextRenderFormat
Options for rendering text.
QImage::Format outputImageFormat() const
format of internal QImage, default QImage::Format_ARGB32_Premultiplied
QVariantMap customRenderingFlags() const
Gets custom rendering flags.
SegmentationToleranceType
Segmentation tolerance as maximum angle or maximum difference between approximation and circle.
DistanceUnit
Units of distance.
void setSegmentationTolerance(double tolerance)
Sets the segmentation tolerance applied when rendering curved geometries.
QString mEllipsoid
ellipsoid acronym (from table tbl_ellipsoids)
QgsPathResolver mPathResolver
void setBackgroundColor(const QColor &color)
Sets the background color of the map.
QgsAbstractGeometry::SegmentationToleranceType segmentationToleranceType() const
Gets segmentation tolerance type (maximum angle or maximum difference between curve and approximation...
QgsCoordinateTransformContext mTransformContext
Flag
Enumeration of flags that adjust the way the map is rendered.
QColor backgroundColor() const
Gets the background color of the map.
void setSelectionColor(const QColor &color)
Sets 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.
QList< QgsLabelBlockingRegion > labelBlockingRegions() const
Returns the list of regions to avoid placing labels within.
QgsCoordinateReferenceSystem mDestCRS
QMap< QString, QString > mLayerStyleOverrides
QgsRectangle mVisibleExtent
Extent with some additional white space that matches the output aspect ratio.
const QgsExpressionContext & expressionContext() const
Gets the expression context.
QColor selectionColor() const
Gets color that is used for drawing of selected vector features.
double segmentationTolerance() const
Gets the segmentation tolerance applied when rendering curved geometries.
void setLabelingEngineSettings(const QgsLabelingEngineSettings &settings)
Sets the global configuration of the labeling engine.
QgsRenderContext::TextRenderFormat defaultTextRenderFormat() const
Returns the default text rendering format for the labels.
void setExpressionContext(const QgsExpressionContext &context)
Sets the expression context.
QgsGeometry mLabelBoundaryGeometry
QgsScaleCalculator mScaleCalculator
QVariantMap mCustomRenderingFlags
const QgsPathResolver & pathResolver() const
Returns the path resolver for conversion between relative and absolute paths during rendering operati...
void setOutputImageFormat(QImage::Format format)
sets format of internal QImage
QgsMapToPixel mMapToPixel
void setLabelBlockingRegions(const QList< QgsLabelBlockingRegion > ®ions)
Sets a list of regions to avoid placing labels within.
Q_DECL_DEPRECATED QString customRenderFlags() const
Gets custom rendering flags.
Q_DECL_DEPRECATED void setCustomRenderFlags(const QString &customRenderFlags)
Sets the custom rendering flags.
@ TextFormatAlwaysOutlines
Always render text using path objects (AKA outlines/curves).
void setPathResolver(const QgsPathResolver &resolver)
Sets the path resolver for conversion between relative and absolute paths during rendering operations...
void setCustomRenderingFlag(const QString &flag, const QVariant &value)
Sets a custom rendering flag.
const QgsMapToPixel & mapToPixel() const
QgsLabelingEngineSettings mLabelingEngineSettings