18 #ifndef QGSRENDERCONTEXT_H 19 #define QGSRENDERCONTEXT_H 21 #include "qgis_core.h" 65 DrawEditingInfo = 0x01,
66 ForceVectorOutput = 0x02,
67 UseAdvancedEffects = 0x04,
68 UseRenderingOptimization = 0x08,
70 DrawSymbolBounds = 0x20,
73 RenderPartialOutput = 0x100,
74 RenderPreviewJob = 0x200,
76 Q_DECLARE_FLAGS( Flags,
Flag )
126 void setFlags( QgsRenderContext::Flags flags );
132 void setFlag(
Flag flag,
bool on =
true );
144 bool testFlag(
Flag flag )
const;
282 bool forceVectorOutput()
const;
287 bool useAdvancedEffects()
const;
292 void setUseAdvancedEffects(
bool enabled );
299 bool drawEditingInformation()
const;
328 bool showSelection()
const;
382 void setDrawEditingInformation(
bool b );
428 void setForceVectorOutput(
bool force );
450 void setShowSelection(
bool showSelection );
455 bool useRenderingOptimization()
const;
457 void setUseRenderingOptimization(
bool enabled );
554 double convertMetersToMapUnits(
double meters )
const;
564 return mTextRenderFormat;
575 mTextRenderFormat = format;
583 QPainter *mPainter =
nullptr;
601 bool mRenderingStopped =
false;
604 double mScaleFactor = 1.0;
607 double mRendererScale = 1.0;
613 QColor mSelectionColor;
625 std::unique_ptr< QgsFeatureFilterProvider > mFeatureFilterProvider;
627 double mSegmentationTolerance = M_PI_2 / 90;
638 bool mHasTransformContext =
false;
642 Q_DECLARE_OPERATORS_FOR_FLAGS( QgsRenderContext::Flags )
void setRenderingStopped(bool stopped)
Sets whether the rendering operation has been stopped and any ongoing rendering should be canceled im...
A rectangle specified with double values.
void setLabelingEngine(QgsLabelingEngine *engine2)
Assign new labeling engine.
Maximum angle between generating radii (lines from arc center to output vertices) ...
QColor selectionColor() const
Returns the color to use when rendering selected features.
const QgsVectorSimplifyMethod & vectorSimplifyMethod() const
Added in QGIS v2.4.
Always render text as text objects.
double rendererScale() const
Returns the renderer map scale.
void setRendererScale(double scale)
Sets the renderer map scale.
void setPathResolver(const QgsPathResolver &resolver)
Sets the path resolver for conversion between relative and absolute paths during rendering operations...
QgsLabelingEngine * labelingEngine() const
Gets access to new labeling engine (may be nullptr)
QgsRectangle mapExtent() const
Returns the original extent of the map being rendered.
void setVectorSimplifyMethod(const QgsVectorSimplifyMethod &simplifyMethod)
const QgsRectangle & extent() const
When rendering a map layer, calling this method returns the "clipping" extent for the layer (in the l...
double scaleFactor() const
Returns the scaling factor for the render to convert painter units to physical sizes.
SegmentationToleranceType
Segmentation tolerance as maximum angle or maximum difference between approximation and circle...
TextRenderFormat textRenderFormat() const
Returns the text render format, which dictates how text is rendered (e.g.
void setTextRenderFormat(TextRenderFormat format)
Sets the text render format, which dictates how text is rendered (e.g.
void setExtent(const QgsRectangle &extent)
When rendering a map layer, calling this method sets the "clipping" extent for the layer (in the laye...
void setMapExtent(const QgsRectangle &extent)
Sets the original extent of the map being rendered.
The QgsMapSettings class contains configuration for rendering of the map.
QgsAbstractGeometry::SegmentationToleranceType segmentationToleranceType() const
Gets segmentation tolerance type (maximum angle or maximum difference between curve and approximation...
Perform transforms between map coordinates and device coordinates.
void setSelectionColor(const QColor &color)
Sets the color to use when rendering selected features.
void setScaleFactor(double factor)
Sets the scaling factor for the render to convert painter units to physical sizes.
void setGeometry(const QgsAbstractGeometry *geometry)
Sets pointer to original (unsegmentized) geometry.
bool renderingStopped() const
Returns TRUE if the rendering operation has been stopped and any ongoing rendering should be canceled...
Always render text using path objects (AKA outlines/curves).
Expression contexts are used to encapsulate the parameters around which a QgsExpression should be eva...
double segmentationTolerance() const
Gets the segmentation tolerance applied when rendering curved geometries.
void setPainter(QPainter *p)
Sets the destination QPainter for the render operation.
Abstract interface for use by classes that filter the features of a layer.
void setSegmentationToleranceType(QgsAbstractGeometry::SegmentationToleranceType type)
Sets segmentation tolerance type (maximum angle or maximum difference between curve and approximation...
Abstract base class for all geometries.
Contains information about the context in which a coordinate transform is executed.
TextRenderFormat
Options for rendering text.
QgsExpressionContext & expressionContext()
Gets the expression context.
void setSegmentationTolerance(double tolerance)
Sets the segmentation tolerance applied when rendering curved geometries.
A general purpose distance and area calculator, capable of performing ellipsoid based calculations...
The QgsLabelingEngine class provides map labeling functionality.
This class contains information how to simplify geometries fetched from a vector layer.
Contains information about the context of a rendering operation.
QPainter * painter()
Returns the destination QPainter for the render operation.
Struct for storing maximum and minimum scales for measurements in map units.
const QgsAbstractGeometry * geometry() const
Returns pointer to the unsegmentized geometry.
const QgsExpressionContext & expressionContext() const
Gets the expression context (const version).
void setMapToPixel(const QgsMapToPixel &mtp)
Sets the context's map to pixel transform, which transforms between map coordinates and device coordi...
void setDistanceArea(const QgsDistanceArea &distanceArea)
A general purpose distance and area calculator, capable of performing ellipsoid based calculations...
const QgsMapToPixel & mapToPixel() const
Returns the context's map to pixel transform, which transforms between map coordinates and device coo...
QgsCoordinateTransform coordinateTransform() const
Returns the current coordinate transform for the context.
const QgsDistanceArea & distanceArea() const
A general purpose distance and area calculator, capable of performing ellipsoid based calculations...
Resolves relative paths into absolute paths and vice versa.
Flag
Enumeration of flags that affect rendering operations.
const QgsPathResolver & pathResolver() const
Returns the path resolver for conversion between relative and absolute paths during rendering operati...
RenderUnit
Rendering size units.
void setExpressionContext(const QgsExpressionContext &context)
Sets the expression context.