16 #ifndef QGSMAPSETTINGS_H 17 #define QGSMAPSETTINGS_H 19 #include "qgis_core.h" 25 #include <QStringList> 77 void setExtent(
const QgsRectangle &rect,
bool magnified =
true );
80 QSize outputSize()
const;
82 void setOutputSize( QSize size );
89 double rotation()
const;
96 void setRotation(
double rotation );
102 double outputDpi()
const;
104 void setOutputDpi(
double dpi );
112 void setMagnificationFactor(
double factor );
119 double magnificationFactor()
const;
125 QStringList layerIds()
const;
131 QList<QgsMapLayer *> layers()
const;
139 void setLayers(
const QList<QgsMapLayer *> &layers );
145 QMap<QString, QString> layerStyleOverrides()
const;
151 void setLayerStyleOverrides(
const QMap<QString, QString> &overrides );
185 bool setEllipsoid(
const QString &ellipsoid );
209 DrawEditingInfo = 0x02,
210 ForceVectorOutput = 0x04,
211 UseAdvancedEffects = 0x08,
213 UseRenderingOptimization = 0x20,
214 DrawSelection = 0x40,
215 DrawSymbolBounds = 0x80,
216 RenderMapTile = 0x100,
217 RenderPartialOutput = 0x200,
218 RenderPreviewJob = 0x400,
221 Q_DECLARE_FLAGS( Flags,
Flag )
224 void setFlags( QgsMapSettings::Flags flags );
226 void setFlag(
Flag flag,
bool on =
true );
230 bool testFlag(
Flag flag )
const;
238 bool hasValidSettings()
const;
246 QPolygonF visiblePolygon()
const;
248 double mapUnitsPerPixel()
const;
254 double scale()
const;
372 void readXml( QDomNode &node );
374 void writeXml( QDomNode &node, QDomDocument &doc );
410 double mRotation = 0.0;
411 double mMagnificationFactor = 1.0;
428 QImage::Format mImageFormat = QImage::Format_ARGB32_Premultiplied;
438 double mMapUnitsPerPixel = 1;
450 bool mHasTransformContext =
false;
453 void updateDerived();
456 Q_DECLARE_OPERATORS_FOR_FLAGS( QgsMapSettings::Flags )
459 #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) ...
QgsCoordinateReferenceSystem mDestCRS
QgsCoordinateTransformContext mTransformContext
A class to represent a 2D point.
QMap< QString, QString > mLayerStyleOverrides
QColor backgroundColor() const
Get the background color of the map.
void setCustomRenderFlags(const QString &customRenderFlags)
Sets the custom rendering flags.
SegmentationToleranceType
Segmentation tolerance as maximum angle or maximum difference between approximation and circle...
QgsLabelingEngineSettings mLabelingEngineSettings
The QgsMapSettings class contains configuration for rendering of the map.
QString customRenderFlags() const
Get custom rendering flags.
Perform transforms between map coordinates and device coordinates.
Flag
Enumeration of flags that adjust the way the map is rendered.
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
QImage::Format outputImageFormat() const
format of internal QImage, default QImage::Format_ARGB32_Premultiplied
void setOutputImageFormat(QImage::Format format)
sets format of internal QImage
Contains information about the context in which a coordinate transform is executed.
QgsExpressionContext mExpressionContext
QgsScaleCalculator mScaleCalculator
const QgsMapToPixel & mapToPixel() const
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)
Set the background color of the map.
void setLabelingEngineSettings(const QgsLabelingEngineSettings &settings)
Sets global configuration of the labeling engine.
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)
Set 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...
QColor selectionColor() const
Get color that is used for drawing of selected vector features.
Resolves relative paths into absolute paths and vice versa.
QString mCustomRenderFlags
const QgsLabelingEngineSettings & labelingEngineSettings() const
Returns global configuration of the labeling engine.