QGIS API Documentation
2.18.21-Las Palmas (9fba24a)
|
Contains information about the context of a rendering operation. More...
#include <qgsrendercontext.h>
Public Types | |
enum | Flag { DrawEditingInfo = 0x01, ForceVectorOutput = 0x02, UseAdvancedEffects = 0x04, UseRenderingOptimization = 0x08, DrawSelection = 0x10, DrawSymbolBounds = 0x20, RenderMapTile = 0x40, Antialiasing = 0x80, RenderPartialOutput = 0x100 } |
Enumeration of flags that affect rendering operations. More... | |
Public Member Functions | |
QgsRenderContext () | |
QgsRenderContext (const QgsRenderContext &rh) | |
~QgsRenderContext () | |
const QPainter * | constPainter () const |
const QgsCoordinateTransform * | coordinateTransform () const |
bool | drawEditingInformation () const |
QgsExpressionContext & | expressionContext () |
Gets the expression context. More... | |
const QgsExpressionContext & | expressionContext () const |
Gets the expression context (const version). More... | |
const QgsRectangle & | extent () const |
const QgsFeatureFilterProvider * | featureFilterProvider () const |
Get the filter feature provider used for additional filtering of rendered features. More... | |
Flags | flags () const |
Return combination of flags used for rendering. More... | |
bool | forceVectorOutput () const |
const QgsAbstractGeometryV2 * | geometry () const |
Returns pointer to the unsegmentized geometry. More... | |
QgsLabelingEngineInterface * | labelingEngine () const |
QgsLabelingEngineV2 * | labelingEngineV2 () const |
Get access to new labeling engine (may be nullptr) More... | |
const QgsMapToPixel & | mapToPixel () const |
QgsRenderContext & | operator= (const QgsRenderContext &rh) |
QPainter * | painter () |
double | rasterScaleFactor () const |
double | rendererScale () const |
bool | renderingStopped () const |
double | scaleFactor () const |
double | segmentationTolerance () const |
Gets the segmentation tolerance applied when rendering curved geometries. More... | |
QgsAbstractGeometryV2::SegmentationToleranceType | segmentationToleranceType () const |
Gets segmentation tolerance type (maximum angle or maximum difference between curve and approximation) More... | |
QColor | selectionColor () const |
void | setCoordinateTransform (const QgsCoordinateTransform *t) |
Sets coordinate transformation. More... | |
void | setDrawEditingInformation (bool b) |
void | setExpressionContext (const QgsExpressionContext &context) |
Sets the expression context. More... | |
void | setExtent (const QgsRectangle &extent) |
void | setFeatureFilterProvider (const QgsFeatureFilterProvider *ffp) |
Set a filter feature provider used for additional filtering of rendered features. More... | |
void | setFlag (Flag flag, bool on=true) |
Enable or disable a particular flag (other flags are not affected) More... | |
void | setFlags (const QgsRenderContext::Flags &flags) |
Set combination of flags that will be used for rendering. More... | |
void | setForceVectorOutput (bool force) |
void | setGeometry (const QgsAbstractGeometryV2 *geometry) |
Sets pointer to original (unsegmentized) geometry. More... | |
void | setLabelingEngine (QgsLabelingEngineInterface *iface) |
void | setLabelingEngineV2 (QgsLabelingEngineV2 *engine2) |
Assign new labeling engine. More... | |
void | setMapToPixel (const QgsMapToPixel &mtp) |
void | setPainter (QPainter *p) |
void | setRasterScaleFactor (double factor) |
void | setRendererScale (double scale) |
void | setRenderingStopped (bool stopped) |
void | setScaleFactor (double factor) |
void | setSegmentationTolerance (double tolerance) |
Sets the segmentation tolerance applied when rendering curved geometries. More... | |
void | setSegmentationToleranceType (QgsAbstractGeometryV2::SegmentationToleranceType type) |
Sets segmentation tolerance type (maximum angle or maximum difference between curve and approximation) More... | |
void | setSelectionColor (const QColor &color) |
void | setShowSelection (const bool showSelection) |
Sets whether vector selections should be shown in the rendered map. More... | |
void | setUseAdvancedEffects (bool enabled) |
Used to enable or disable advanced effects such as blend modes. More... | |
void | setUseRenderingOptimization (bool enabled) |
void | setVectorSimplifyMethod (const QgsVectorSimplifyMethod &simplifyMethod) |
bool | showSelection () const |
Returns true if vector selections should be shown in the rendered map. More... | |
bool | testFlag (Flag flag) const |
Check whether a particular flag is enabled. More... | |
bool | useAdvancedEffects () const |
Returns true if advanced effects such as blend modes such be used. More... | |
bool | useRenderingOptimization () const |
Returns true if the rendering optimization (geometry simplification) can be executed. More... | |
const QgsVectorSimplifyMethod & | vectorSimplifyMethod () const |
Added in QGIS v2.4. More... | |
Static Public Member Functions | |
static QgsRenderContext | fromMapSettings (const QgsMapSettings &mapSettings) |
create initialized QgsRenderContext instance from given QgsMapSettings More... | |
Contains information about the context of a rendering operation.
The context of a rendering operation defines properties such as the conversion ratio between screen and map units, the extents / bounding box to be rendered etc.
Definition at line 45 of file qgsrendercontext.h.
Enumeration of flags that affect rendering operations.
Definition at line 58 of file qgsrendercontext.h.
QgsRenderContext::QgsRenderContext | ( | ) |
Definition at line 26 of file qgsrendercontext.cpp.
QgsRenderContext::QgsRenderContext | ( | const QgsRenderContext & | rh | ) |
Definition at line 44 of file qgsrendercontext.cpp.
QgsRenderContext::~QgsRenderContext | ( | ) |
Definition at line 89 of file qgsrendercontext.cpp.
|
inline |
Definition at line 99 of file qgsrendercontext.h.
|
inline |
Definition at line 101 of file qgsrendercontext.h.
bool QgsRenderContext::drawEditingInformation | ( | ) | const |
Definition at line 163 of file qgsrendercontext.cpp.
|
inline |
Gets the expression context.
This context should be used for all expression evaluation associated with this render context.
Definition at line 196 of file qgsrendercontext.h.
|
inline |
Gets the expression context (const version).
This context should be used for all expression evaluation associated with this render context.
Definition at line 204 of file qgsrendercontext.h.
|
inline |
Definition at line 103 of file qgsrendercontext.h.
|
inline |
Get the filter feature provider used for additional filtering of rendered features.
Definition at line 223 of file qgsrendercontext.h.
QgsRenderContext::Flags QgsRenderContext::flags | ( | ) | const |
Return combination of flags used for rendering.
Definition at line 108 of file qgsrendercontext.cpp.
bool QgsRenderContext::forceVectorOutput | ( | ) | const |
Definition at line 148 of file qgsrendercontext.cpp.
|
static |
create initialized QgsRenderContext instance from given QgsMapSettings
Definition at line 118 of file qgsrendercontext.cpp.
|
inline |
Returns pointer to the unsegmentized geometry.
Definition at line 207 of file qgsrendercontext.h.
|
inline |
Definition at line 127 of file qgsrendercontext.h.
|
inline |
Get access to new labeling engine (may be nullptr)
Definition at line 131 of file qgsrendercontext.h.
|
inline |
Definition at line 105 of file qgsrendercontext.h.
QgsRenderContext & QgsRenderContext::operator= | ( | const QgsRenderContext & | rh | ) |
Definition at line 66 of file qgsrendercontext.cpp.
|
inline |
Definition at line 98 of file qgsrendercontext.h.
|
inline |
Definition at line 109 of file qgsrendercontext.h.
|
inline |
Definition at line 125 of file qgsrendercontext.h.
|
inline |
Definition at line 111 of file qgsrendercontext.h.
|
inline |
Definition at line 107 of file qgsrendercontext.h.
|
inline |
Gets the segmentation tolerance applied when rendering curved geometries.
Definition at line 229 of file qgsrendercontext.h.
|
inline |
Gets segmentation tolerance type (maximum angle or maximum difference between curve and approximation)
Definition at line 235 of file qgsrendercontext.h.
|
inline |
Definition at line 133 of file qgsrendercontext.h.
void QgsRenderContext::setCoordinateTransform | ( | const QgsCoordinateTransform * | t | ) |
Sets coordinate transformation.
QgsRenderContext does not take ownership
Definition at line 173 of file qgsrendercontext.cpp.
void QgsRenderContext::setDrawEditingInformation | ( | bool | b | ) |
Definition at line 178 of file qgsrendercontext.cpp.
|
inline |
Sets the expression context.
This context is used for all expression evaluation associated with this render context.
Definition at line 189 of file qgsrendercontext.h.
|
inline |
Definition at line 148 of file qgsrendercontext.h.
void QgsRenderContext::setFeatureFilterProvider | ( | const QgsFeatureFilterProvider * | ffp | ) |
Set a filter feature provider used for additional filtering of rendered features.
ffp | the filter feature provider |
Definition at line 203 of file qgsrendercontext.cpp.
void QgsRenderContext::setFlag | ( | QgsRenderContext::Flag | flag, |
bool | on = true |
||
) |
Enable or disable a particular flag (other flags are not affected)
Definition at line 100 of file qgsrendercontext.cpp.
void QgsRenderContext::setFlags | ( | const QgsRenderContext::Flags & | flags | ) |
Set combination of flags that will be used for rendering.
Definition at line 95 of file qgsrendercontext.cpp.
void QgsRenderContext::setForceVectorOutput | ( | bool | force | ) |
Definition at line 183 of file qgsrendercontext.cpp.
|
inline |
Sets pointer to original (unsegmentized) geometry.
Definition at line 209 of file qgsrendercontext.h.
|
inline |
Definition at line 160 of file qgsrendercontext.h.
|
inline |
Assign new labeling engine.
Definition at line 163 of file qgsrendercontext.h.
|
inline |
Definition at line 147 of file qgsrendercontext.h.
|
inline |
Definition at line 156 of file qgsrendercontext.h.
|
inline |
Definition at line 154 of file qgsrendercontext.h.
|
inline |
Definition at line 155 of file qgsrendercontext.h.
|
inline |
Definition at line 152 of file qgsrendercontext.h.
|
inline |
Definition at line 153 of file qgsrendercontext.h.
|
inline |
Sets the segmentation tolerance applied when rendering curved geometries.
tolerance | the segmentation tolerance |
Definition at line 227 of file qgsrendercontext.h.
|
inline |
Sets segmentation tolerance type (maximum angle or maximum difference between curve and approximation)
type | the segmentation tolerance typename |
Definition at line 233 of file qgsrendercontext.h.
|
inline |
Definition at line 164 of file qgsrendercontext.h.
void QgsRenderContext::setShowSelection | ( | const bool | showSelection | ) |
Sets whether vector selections should be shown in the rendered map.
showSelection | set to true if selections should be shown |
Definition at line 188 of file qgsrendercontext.cpp.
void QgsRenderContext::setUseAdvancedEffects | ( | bool | enabled | ) |
Used to enable or disable advanced effects such as blend modes.
Definition at line 158 of file qgsrendercontext.cpp.
void QgsRenderContext::setUseRenderingOptimization | ( | bool | enabled | ) |
Definition at line 198 of file qgsrendercontext.cpp.
|
inline |
Definition at line 182 of file qgsrendercontext.h.
bool QgsRenderContext::showSelection | ( | ) | const |
Returns true if vector selections should be shown in the rendered map.
Definition at line 168 of file qgsrendercontext.cpp.
bool QgsRenderContext::testFlag | ( | QgsRenderContext::Flag | flag | ) | const |
Check whether a particular flag is enabled.
Definition at line 113 of file qgsrendercontext.cpp.
bool QgsRenderContext::useAdvancedEffects | ( | ) | const |
Returns true if advanced effects such as blend modes such be used.
Definition at line 153 of file qgsrendercontext.cpp.
bool QgsRenderContext::useRenderingOptimization | ( | ) | const |
Returns true if the rendering optimization (geometry simplification) can be executed.
Definition at line 193 of file qgsrendercontext.cpp.
|
inline |
Added in QGIS v2.4.
Definition at line 181 of file qgsrendercontext.h.