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 )
82 void setFlags( QgsRenderContext::Flags flags );
88 void setFlag(
Flag flag,
bool on =
true );
100 bool testFlag(
Flag flag )
const;
188 bool forceVectorOutput()
const;
193 bool useAdvancedEffects()
const;
198 void setUseAdvancedEffects(
bool enabled );
200 bool drawEditingInformation()
const;
224 bool showSelection()
const;
233 void setDrawEditingInformation(
bool b );
267 void setForceVectorOutput(
bool force );
283 void setShowSelection(
const bool showSelection );
288 bool useRenderingOptimization()
const;
290 void setUseRenderingOptimization(
bool enabled );
387 double convertMetersToMapUnits(
double meters )
const;
394 QPainter *mPainter =
nullptr;
411 bool mRenderingStopped =
false;
414 double mScaleFactor = 1.0;
417 double mRendererScale = 1.0;
423 QColor mSelectionColor;
435 std::unique_ptr< QgsFeatureFilterProvider > mFeatureFilterProvider;
437 double mSegmentationTolerance = M_PI_2 / 90;
446 bool mHasTransformContext =
false;
450 Q_DECLARE_OPERATORS_FOR_FLAGS( QgsRenderContext::Flags )
void setRenderingStopped(bool stopped)
A rectangle specified with double values.
double rendererScale() const
Returns the renderer map scale.
const QgsPathResolver & pathResolver() const
Returns the path resolver for conversion between relative and absolute paths during rendering operati...
const QgsVectorSimplifyMethod & vectorSimplifyMethod() const
Added in QGIS v2.4.
void setLabelingEngine(QgsLabelingEngine *engine2)
Assign new labeling engine.
Maximum angle between generating radii (lines from arc center to output vertices) ...
QgsLabelingEngine * labelingEngine() const
Get access to new labeling engine (may be nullptr)
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...
bool renderingStopped() const
void setVectorSimplifyMethod(const QgsVectorSimplifyMethod &simplifyMethod)
SegmentationToleranceType
Segmentation tolerance as maximum angle or maximum difference between approximation and circle...
QgsAbstractGeometry::SegmentationToleranceType segmentationToleranceType() const
Gets segmentation tolerance type (maximum angle or maximum difference between curve and approximation...
void setExtent(const QgsRectangle &extent)
The QgsMapSettings class contains configuration for rendering of the map.
Perform transforms between map coordinates and device coordinates.
void setSelectionColor(const QColor &color)
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.
const QgsRectangle & extent() const
const QgsAbstractGeometry * geometry() const
Returns pointer to the unsegmentized geometry.
Expression contexts are used to encapsulate the parameters around which a QgsExpression should be eva...
QColor selectionColor() const
void setPainter(QPainter *p)
Sets the destination QPainter for the render operation.
QgsCoordinateTransform coordinateTransform() const
Returns the current coordinate transform for the context, or an invalid transform is no coordinate tr...
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.
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.
double segmentationTolerance() const
Gets the segmentation tolerance applied when rendering curved geometries.
QPainter * painter()
Returns the destination QPainter for the render operation.
const QgsMapToPixel & mapToPixel() const
Struct for storing maximum and minimum scales for measurements in map units.
const QgsDistanceArea & distanceArea() const
A general purpose distance and area calculator, capable of performing ellipsoid based calculations...
void setMapToPixel(const QgsMapToPixel &mtp)
void setDistanceArea(const QgsDistanceArea &distanceArea)
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.
double scaleFactor() const
Returns the scaling factor for the render to convert painter units to physical sizes.
const QgsExpressionContext & expressionContext() const
Gets the expression context (const version).
RenderUnit
Rendering size units.
void setExpressionContext(const QgsExpressionContext &context)
Sets the expression context.