16 #ifndef QGSMAPSETTINGS_H 17 #define QGSMAPSETTINGS_H 19 #include "qgis_core.h" 25 #include <QStringList> 59 : geometry( geometry )
104 void setExtent(
const QgsRectangle &rect,
bool magnified =
true );
112 double extentBuffer()
const;
120 void setExtentBuffer(
double buffer );
123 QSize outputSize()
const;
125 void setOutputSize( QSize size );
132 float devicePixelRatio()
const;
139 void setDevicePixelRatio(
float dpr );
147 QSize deviceOutputSize()
const;
154 double rotation()
const;
161 void setRotation(
double rotation );
167 double outputDpi()
const;
169 void setOutputDpi(
double dpi );
177 void setMagnificationFactor(
double factor );
184 double magnificationFactor()
const;
190 QStringList layerIds()
const;
196 QList<QgsMapLayer *> layers()
const;
204 void setLayers(
const QList<QgsMapLayer *> &layers );
210 QMap<QString, QString> layerStyleOverrides()
const;
216 void setLayerStyleOverrides(
const QMap<QString, QString> &overrides );
234 Q_DECL_DEPRECATED
void setCustomRenderFlags(
const QString &customRenderFlags ) { mCustomRenderFlags = customRenderFlags; }
277 bool setEllipsoid(
const QString &ellipsoid );
301 DrawEditingInfo = 0x02,
302 ForceVectorOutput = 0x04,
303 UseAdvancedEffects = 0x08,
305 UseRenderingOptimization = 0x20,
306 DrawSelection = 0x40,
307 DrawSymbolBounds = 0x80,
308 RenderMapTile = 0x100,
309 RenderPartialOutput = 0x200,
310 RenderPreviewJob = 0x400,
311 RenderBlocking = 0x800,
314 Q_DECLARE_FLAGS( Flags,
Flag )
317 void setFlags( QgsMapSettings::Flags flags );
319 void setFlag(
Flag flag,
bool on =
true );
323 bool testFlag(
Flag flag )
const;
333 return mTextRenderFormat;
347 mTextRenderFormat = format;
350 mLabelingEngineSettings.setDefaultTextRenderFormat( format );
359 bool hasValidSettings()
const;
367 QPolygonF visiblePolygon()
const;
369 double mapUnitsPerPixel()
const;
375 double scale()
const;
492 void readXml( QDomNode &node );
494 void writeXml( QDomNode &node, QDomDocument &doc );
522 mLabelingEngineSettings = settings;
561 void setLabelBoundaryGeometry(
const QgsGeometry &boundary );
626 QList< QgsRenderedFeatureHandlerInterface * > renderedFeatureHandlers()
const;
633 float mDevicePixelRatio = 1.0;
636 double mExtentBuffer = 0.0;
638 double mRotation = 0.0;
639 double mMagnificationFactor = 1.0;
657 QImage::Format mImageFormat = QImage::Format_ARGB32_Premultiplied;
667 double mMapUnitsPerPixel = 1;
685 bool mHasTransformContext =
false;
688 void updateDerived();
692 QList< QgsLabelBlockingRegion > mLabelBlockingRegions;
693 QList< QgsRenderedFeatureHandlerInterface * > mRenderedFeatureHandlers;
696 Q_DECLARE_OPERATORS_FOR_FLAGS( QgsMapSettings::Flags )
699 #endif // QGSMAPSETTINGS_H A rectangle specified with double values.
Base class for all map layer types.
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.
const QgsExpressionContext & expressionContext() const
Gets the expression context.
void setExpressionContext(const QgsExpressionContext &context)
Sets the expression context.
Maximum angle between generating radii (lines from arc center to output vertices) ...
QgsRenderContext::TextRenderFormat defaultTextRenderFormat() const
Returns the default text rendering format for the labels.
QgsCoordinateReferenceSystem mDestCRS
QgsCoordinateTransformContext mTransformContext
A class to represent a 2D point.
QMap< QString, QString > mLayerStyleOverrides
QColor backgroundColor() const
Gets the background color of the map.
QgsGeometry mLabelBoundaryGeometry
A geometry is the spatial representation of a feature.
SegmentationToleranceType
Segmentation tolerance as maximum angle or maximum difference between approximation and circle...
const QgsCoordinateReferenceSystem & crs
QgsLabelingEngineSettings mLabelingEngineSettings
The QgsMapSettings class contains configuration for rendering of the map.
Perform transforms between map coordinates and device coordinates.
Q_DECL_DEPRECATED QString customRenderFlags() const
Gets custom rendering flags.
Q_DECL_DEPRECATED void setCustomRenderFlags(const QString &customRenderFlags)
Sets the custom rendering flags.
const QgsVectorSimplifyMethod & simplifyMethod() const
Returns the simplification settings to use when rendering vector layers.
void setTextRenderFormat(QgsRenderContext::TextRenderFormat format)
Sets the text render format, which dictates how text is rendered (e.g.
Flag
Enumeration of flags that adjust the way the map is rendered.
void clearCustomRenderingFlag(const QString &flag)
Clears the specified custom rendering flag.
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.
An interface for classes which provider custom handlers for features rendered as part of a map render...
QgsPathResolver mPathResolver
QgsVectorSimplifyMethod mSimplifyMethod
QImage::Format outputImageFormat() const
format of internal QImage, default QImage::Format_ARGB32_Premultiplied
void setCustomRenderingFlag(const QString &flag, const QVariant &value)
Sets a custom rendering flag.
void setSimplifyMethod(const QgsVectorSimplifyMethod &method)
Sets the simplification setting to use when rendering vector layers.
void setOutputImageFormat(QImage::Format format)
sets format of internal QImage
Label blocking region (in map coordinates and CRS).
Contains information about the context in which a coordinate transform is executed.
QgsExpressionContext mExpressionContext
TextRenderFormat
Options for rendering text.
QgsScaleCalculator mScaleCalculator
const QgsMapToPixel & mapToPixel() const
QVariantMap mCustomRenderingFlags
QVariantMap customRenderingFlags() const
Gets custom rendering flags.
QgsAbstractGeometry::SegmentationToleranceType segmentationToleranceType() const
Gets segmentation tolerance type (maximum angle or maximum difference between curve and approximation...
const QgsPathResolver & pathResolver() const
Returns the path resolver for conversion between relative and absolute paths during rendering operati...
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)
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.
This class contains information how to simplify geometries fetched from a vector layer.
QString ellipsoid() const
Returns ellipsoid's acronym.
double segmentationTolerance() const
Gets the segmentation tolerance applied when rendering curved geometries.
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.
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...
QgsLabelBlockingRegion(const QgsGeometry &geometry)
Constructor for a label blocking region.
QgsGeometry geometry
Geometry of region to avoid placing labels within (in destination map coordinates and CRS) ...
QgsRenderContext::TextRenderFormat textRenderFormat() const
Returns the text render format, which dictates how text is rendered (e.g.
QColor selectionColor() const
Gets color that is used for drawing of selected vector features.
Resolves relative paths into absolute paths and vice versa.
QList< QgsLabelBlockingRegion > labelBlockingRegions() const
Returns the list of regions to avoid placing labels within.
QString mCustomRenderFlags
const QgsLabelingEngineSettings & labelingEngineSettings() const
Returns the global configuration of the labeling engine.
void setLabelBlockingRegions(const QList< QgsLabelBlockingRegion > ®ions)
Sets a list of regions to avoid placing labels within.