QGIS API Documentation
3.26.3-Buenos Aires (65e4edfdad)
|
Go to the documentation of this file.
16 #ifndef QGSMAPSETTINGS_H
17 #define QGSMAPSETTINGS_H
19 #include "qgis_core.h"
25 #include <QStringList>
62 : 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;
183 double rotation()
const;
190 void setRotation(
double rotation );
199 double outputDpi()
const;
206 void setOutputDpi(
double dpi );
216 double dpiTarget()
const;
224 void setDpiTarget(
double dpi );
233 void setMagnificationFactor(
double factor,
const QgsPointXY *center =
nullptr );
240 double magnificationFactor()
const;
253 QStringList layerIds(
bool expandGroupLayers =
false )
const;
266 QList<QgsMapLayer *> layers(
bool expandGroupLayers =
false )
const;
278 void setLayers(
const QList<QgsMapLayer *> &layers );
286 QMap<QString, QString> layerStyleOverrides()
const;
294 void setLayerStyleOverrides(
const QMap<QString, QString> &overrides );
312 Q_DECL_DEPRECATED
void setCustomRenderFlags(
const QString &customRenderFlags ) { mCustomRenderFlags = customRenderFlags; }
366 bool setEllipsoid(
const QString &ellipsoid );
405 void setFlags( Qgis::MapSettingsFlags flags );
409 Qgis::MapSettingsFlags flags()
const;
421 return mTextRenderFormat;
435 mTextRenderFormat = format;
438 mLabelingEngineSettings.setDefaultTextRenderFormat( format );
447 bool hasValidSettings()
const;
455 QPolygonF visiblePolygon()
const;
462 QPolygonF visiblePolygonWithBuffer()
const;
465 double mapUnitsPerPixel()
const;
471 double scale()
const;
617 double computeScaleForExtent(
const QgsRectangle &extent )
const;
624 void readXml( QDomNode &node );
626 void writeXml( QDomNode &node, QDomDocument &doc );
656 mLabelingEngineSettings = settings;
695 void setLabelBoundaryGeometry(
const QgsGeometry &boundary );
731 void setClippingRegions(
const QList< QgsMapClippingRegion > ®ions );
741 QList< QgsMapClippingRegion > clippingRegions()
const;
790 QList< QgsRenderedFeatureHandlerInterface * > renderedFeatureHandlers()
const;
835 double frameRate()
const;
845 void setFrameRate(
double rate );
855 long long currentFrame()
const;
865 void setCurrentFrame(
long long frame );
870 double mDpiTarget = -1;
873 float mDevicePixelRatio = 1.0;
876 double mExtentBuffer = 0.0;
878 double mRotation = 0.0;
879 double mMagnificationFactor = 1.0;
897 QImage::Format mImageFormat = QImage::Format_ARGB32_Premultiplied;
909 double mMapUnitsPerPixel = 1;
928 double mFrameRate = -1;
929 long long mCurrentFrame = -1;
932 bool mHasTransformContext =
false;
935 void updateDerived();
939 QList< QgsLabelBlockingRegion > mLabelBlockingRegions;
940 QList< QgsMapClippingRegion > mClippingRegions;
941 QList< QgsRenderedFeatureHandlerInterface * > mRenderedFeatureHandlers;
947 #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.
This class contains information how to simplify geometries fetched from a vector layer.
Contains information about the context in which a coordinate transform is executed.
A map clipping region (in map coordinates and CRS).
TextRenderFormat
Options for rendering text.
QList< QgsWeakMapLayerPointer > QgsWeakMapLayerPointerList
A list of weak pointers to QgsMapLayers.
QgsExpressionContext mExpressionContext
QgsGeometry geometry
Geometry of region to avoid placing labels within (in destination map coordinates and CRS)
Point geometry type, with support for z-dimension and m-values.
QgsLabelBlockingRegion(const QgsGeometry &geometry)
Constructor for a label blocking region.
MapSettingsFlag
Coordinate transformation flags.
const QgsCoordinateReferenceSystem & crs
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.
QImage::Format outputImageFormat() const
format of internal QImage, default QImage::Format_ARGB32_Premultiplied
QVariantMap customRenderingFlags() const
Returns any 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.
A rectangle specified with double values.
An interface for classes which provider custom handlers for features rendered as part of a map render...
QString mEllipsoid
ellipsoid acronym (from table tbl_ellipsoids)
QgsPathResolver mPathResolver
void setTextRenderFormat(Qgis::TextRenderFormat format)
Sets the text render format, which dictates how text is rendered (e.g.
Qgis::TextRenderFormat defaultTextRenderFormat() const
Returns the default text rendering format for the labels.
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...
Calculates scale for a given combination of canvas size, map extent, and monitor dpi.
Stores global configuration for labeling engine.
QgsCoordinateTransformContext mTransformContext
QColor backgroundColor() const
Returns the background color of the map.
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.
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.
This class represents a coordinate reference system (CRS).
QColor selectionColor() const
Returns the color that is used for drawing of selected vector features.
@ Unknown
Renderer used for unknown usage.
Qgis::TextRenderFormat textRenderFormat() const
Returns the text render format, which dictates how text is rendered (e.g.
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.
A class to represent a 2D point.
void setExpressionContext(const QgsExpressionContext &context)
Sets the expression context.
QgsGeometry mLabelBoundaryGeometry
QgsRange which stores a range of double values.
QgsScaleCalculator mScaleCalculator
A geometry is the spatial representation of a feature.
Perform transforms between map coordinates and device coordinates.
QVariantMap mCustomRenderingFlags
Base class for all map layer types. This is the base class for all map layer types (vector,...
const QgsPathResolver & pathResolver() const
Returns the path resolver for conversion between relative and absolute paths during rendering operati...
Qgis::MapSettingsFlags mFlags
Abstract base class for map rendering implementations.
void setOutputImageFormat(QImage::Format format)
sets format of internal QImage
RendererUsage
Usage of the renderer.
QgsMapToPixel mMapToPixel
void setLabelBlockingRegions(const QList< QgsLabelBlockingRegion > ®ions)
Sets a list of regions to avoid placing labels within.
Label blocking region (in map coordinates and CRS).
Q_DECL_DEPRECATED QString customRenderFlags() const
Returns custom rendering flags.
Q_DECL_DEPRECATED void setCustomRenderFlags(const QString &customRenderFlags)
Sets the custom rendering flags.
void setPathResolver(const QgsPathResolver &resolver)
Sets the path resolver for conversion between relative and absolute paths during rendering operations...
The QgsMapSettings class contains configuration for rendering of the map. The rendering itself is don...
void setCustomRenderingFlag(const QString &flag, const QVariant &value)
Sets a custom rendering flag.
const QgsMapToPixel & mapToPixel() const
Resolves relative paths into absolute paths and vice versa. Used for writing.
Base class for objects with an associated (optional) temporal range.
QgsLabelingEngineSettings mLabelingEngineSettings