16 #ifndef QGSMAPSETTINGS_H 17 #define QGSMAPSETTINGS_H 19 #include "qgis_core.h" 25 #include <QStringList> 79 void setExtent(
const QgsRectangle &rect,
bool magnified =
true );
82 QSize outputSize()
const;
84 void setOutputSize( QSize size );
91 float devicePixelRatio()
const;
98 void setDevicePixelRatio(
float dpr );
106 QSize deviceOutputSize()
const;
113 double rotation()
const;
120 void setRotation(
double rotation );
126 double outputDpi()
const;
128 void setOutputDpi(
double dpi );
136 void setMagnificationFactor(
double factor );
143 double magnificationFactor()
const;
149 QStringList layerIds()
const;
155 QList<QgsMapLayer *> layers()
const;
163 void setLayers(
const QList<QgsMapLayer *> &layers );
169 QMap<QString, QString> layerStyleOverrides()
const;
175 void setLayerStyleOverrides(
const QMap<QString, QString> &overrides );
209 bool setEllipsoid(
const QString &ellipsoid );
233 DrawEditingInfo = 0x02,
234 ForceVectorOutput = 0x04,
235 UseAdvancedEffects = 0x08,
237 UseRenderingOptimization = 0x20,
238 DrawSelection = 0x40,
239 DrawSymbolBounds = 0x80,
240 RenderMapTile = 0x100,
241 RenderPartialOutput = 0x200,
242 RenderPreviewJob = 0x400,
245 Q_DECLARE_FLAGS( Flags,
Flag )
250 void setFlag(
Flag flag,
bool on = true );
254 bool testFlag(
Flag flag ) const;
264 return mTextRenderFormat;
278 mTextRenderFormat = format;
281 mLabelingEngineSettings.setDefaultTextRenderFormat( format );
290 bool hasValidSettings()
const;
298 QPolygonF visiblePolygon()
const;
300 double mapUnitsPerPixel()
const;
306 double scale()
const;
423 void readXml( QDomNode &node );
425 void writeXml( QDomNode &node, QDomDocument &doc );
453 mLabelingEngineSettings = settings;
471 float mDevicePixelRatio = 1.0;
475 double mRotation = 0.0;
476 double mMagnificationFactor = 1.0;
493 QImage::Format mImageFormat = QImage::Format_ARGB32_Premultiplied;
503 double mMapUnitsPerPixel = 1;
517 bool mHasTransformContext =
false;
520 void updateDerived();
523 Q_DECLARE_OPERATORS_FOR_FLAGS( QgsMapSettings::Flags )
526 #endif // QGSMAPSETTINGS_H A rectangle specified with double values.
Base class for all map layer types.
const QgsLabelingEngineSettings & labelingEngineSettings() const
Returns the global configuration of the labeling engine.
QgsRectangle mVisibleExtent
Extent with some additional white space that matches the output aspect ratio.
void setSegmentationToleranceType(QgsAbstractGeometry::SegmentationToleranceType type)
Sets segmentation tolerance type (maximum angle or maximum difference between curve and approximation...
QgsMapToPixel mMapToPixel
Abstract base class for map rendering implementations.
void setExpressionContext(const QgsExpressionContext &context)
Sets the expression context.
Maximum angle between generating radii (lines from arc center to output vertices) ...
QColor selectionColor() const
Gets color that is used for drawing of selected vector features.
QgsCoordinateReferenceSystem mDestCRS
QgsCoordinateTransformContext mTransformContext
A class to represent a 2D point.
QMap< QString, QString > mLayerStyleOverrides
void setCustomRenderFlags(const QString &customRenderFlags)
Sets the custom rendering flags.
const QgsMapToPixel & mapToPixel() const
SegmentationToleranceType
Segmentation tolerance as maximum angle or maximum difference between approximation and circle...
const QgsCoordinateReferenceSystem & crs
QgsRenderContext::TextRenderFormat defaultTextRenderFormat() const
Returns the default text rendering format for the labels.
QgsLabelingEngineSettings mLabelingEngineSettings
The QgsMapSettings class contains configuration for rendering of the map.
Perform transforms between map coordinates and device coordinates.
void setTextRenderFormat(QgsRenderContext::TextRenderFormat format)
Sets the text render format, which dictates how text is rendered (e.g.
double segmentationTolerance() const
Gets the segmentation tolerance applied when rendering curved geometries.
Flag
Enumeration of flags that adjust the way the map is rendered.
Always render text using path objects (AKA outlines/curves).
Expression contexts are used to encapsulate the parameters around which a QgsExpression should be eva...
void setSegmentationTolerance(double tolerance)
Sets the segmentation tolerance applied when rendering curved geometries.
QgsPathResolver mPathResolver
QString customRenderFlags() const
Gets custom rendering flags.
void setOutputImageFormat(QImage::Format format)
sets format of internal QImage
Contains information about the context in which a coordinate transform is executed.
QgsExpressionContext mExpressionContext
TextRenderFormat
Options for rendering text.
QgsScaleCalculator mScaleCalculator
QgsAbstractGeometry::SegmentationToleranceType segmentationToleranceType() const
Gets segmentation tolerance type (maximum angle or maximum difference between curve and approximation...
QColor backgroundColor() const
Gets the background color of the map.
Calculates scale for a given combination of canvas size, map extent, and monitor dpi.
DistanceUnit
Units of distance.
QString mEllipsoid
ellipsoid acronym (from table tbl_ellipsoids)
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 setLabelingEngineSettings(const QgsLabelingEngineSettings &settings)
Sets the global configuration of the labeling engine.
Contains information about the context of a rendering operation.
QString ellipsoid() const
Returns ellipsoid's acronym.
double mSegmentationTolerance
void setSelectionColor(const QColor &color)
Sets color that is used for drawing of selected vector features.
QList< QgsWeakMapLayerPointer > QgsWeakMapLayerPointerList
A list of weak pointers to QgsMapLayers.
QgsWeakMapLayerPointerList mLayers
list of layers to be rendered (stored as weak pointers)
Stores global configuration for labeling engine.
QImage::Format outputImageFormat() const
format of internal QImage, default QImage::Format_ARGB32_Premultiplied
This class represents a coordinate reference system (CRS).
void setPathResolver(const QgsPathResolver &resolver)
Sets the path resolver for conversion between relative and absolute paths during rendering operations...
Resolves relative paths into absolute paths and vice versa.
QString mCustomRenderFlags
const QgsExpressionContext & expressionContext() const
Gets the expression context.