QGIS API Documentation
2.2.0-Valmiera
|
Contains information about the context of a rendering operation. More...
#include <qgsrendercontext.h>
Public Member Functions | |
QgsRenderContext () | |
~QgsRenderContext () | |
QPainter * | painter () |
const QPainter * | constPainter () const |
const QgsCoordinateTransform * | coordinateTransform () const |
const QgsRectangle & | extent () const |
const QgsMapToPixel & | mapToPixel () const |
double | scaleFactor () const |
double | rasterScaleFactor () const |
bool | renderingStopped () const |
bool | forceVectorOutput () const |
bool | useAdvancedEffects () const |
Returns true if advanced effects such as blend modes such be used. | |
void | setUseAdvancedEffects (bool enabled) |
Used to enable or disable advanced effects such as blend modes. | |
bool | drawEditingInformation () const |
double | rendererScale () const |
QgsLabelingEngineInterface * | labelingEngine () const |
Added in QGIS v1.4. | |
QColor | selectionColor () const |
Added in QGIS v2.0. | |
void | setCoordinateTransform (const QgsCoordinateTransform *t) |
Sets coordinate transformation. | |
void | setMapToPixel (const QgsMapToPixel &mtp) |
void | setExtent (const QgsRectangle &extent) |
void | setDrawEditingInformation (bool b) |
void | setRenderingStopped (bool stopped) |
void | setScaleFactor (double factor) |
void | setRasterScaleFactor (double factor) |
void | setRendererScale (double scale) |
void | setPainter (QPainter *p) |
void | setForceVectorOutput (bool force) |
Added in QGIS v1.5. | |
void | setLabelingEngine (QgsLabelingEngineInterface *iface) |
Added in QGIS v1.4. | |
void | setSelectionColor (const QColor &color) |
Added in QGIS v2.0. | |
bool | useRenderingOptimization () const |
Returns true if the rendering optimization (geometry simplification) can be executed. | |
void | setUseRenderingOptimization (bool enabled) |
Private Attributes | |
QPainter * | mPainter |
Painter for rendering operations. | |
const QgsCoordinateTransform * | mCoordTransform |
For transformation between coordinate systems. | |
bool | mDrawEditingInformation |
True if vertex markers for editing should be drawn. | |
QgsRectangle | mExtent |
bool | mForceVectorOutput |
If true then no rendered vector elements should be cached as image. | |
bool | mUseAdvancedEffects |
Flag if advanced visual effects such as blend modes should be used. | |
QgsMapToPixel | mMapToPixel |
bool | mRenderingStopped |
True if the rendering has been canceled. | |
double | mScaleFactor |
Factor to scale line widths and point marker sizes. | |
double | mRasterScaleFactor |
Factor to scale rasters. | |
double | mRendererScale |
Map scale. | |
QgsLabelingEngineInterface * | mLabelingEngine |
Labeling engine (can be NULL) | |
QColor | mSelectionColor |
Color used for features that are marked as selected. | |
bool | mUseRenderingOptimization |
True if the rendering optimization (geometry simplification) can be executed. |
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 37 of file qgsrendercontext.h.
QgsRenderContext::QgsRenderContext | ( | ) |
Definition at line 21 of file qgsrendercontext.cpp.
QgsRenderContext::~QgsRenderContext | ( | ) |
Definition at line 37 of file qgsrendercontext.cpp.
|
inline |
Definition at line 46 of file qgsrendercontext.h.
|
inline |
Definition at line 48 of file qgsrendercontext.h.
Referenced by QgsFeatureRendererV2::_getLineString(), QgsFeatureRendererV2::_getPoint(), QgsFeatureRendererV2::_getPolygon(), QgsRasterLayer::draw(), QgsVectorLayer::draw(), and QgsLabel::renderLabel().
|
inline |
Definition at line 69 of file qgsrendercontext.h.
|
inline |
Definition at line 50 of file qgsrendercontext.h.
Referenced by QgsFeatureRendererV2::_getLineString(), QgsFeatureRendererV2::_getPolygon(), QgsRasterLayer::draw(), QgsVectorLayer::draw(), QgsPalLabeling::drawLabeling(), QgsVectorLayer::drawLabels(), QgsAttributeTableFilterModel::generateListOfVisibleFeatures(), QgsVectorLayer::prepareLabelingAndDiagrams(), and QgsPointDisplacementRenderer::startRender().
|
inline |
Definition at line 60 of file qgsrendercontext.h.
Referenced by QgsSvgMarkerSymbolLayerV2::renderPoint(), and QgsSimpleMarkerSymbolLayerV2::startRender().
|
inline |
Added in QGIS v1.4.
Definition at line 74 of file qgsrendercontext.h.
Referenced by QgsVectorLayer::drawRendererV2(), QgsVectorLayer::drawRendererV2Levels(), QgsVectorLayer::prepareLabelingAndDiagrams(), and QgsMapRenderer::render().
|
inline |
Definition at line 52 of file qgsrendercontext.h.
Referenced by QgsFeatureRendererV2::_getLineString(), QgsFeatureRendererV2::_getPoint(), QgsFeatureRendererV2::_getPolygon(), QgsLinePatternFillSymbolLayer::applyPattern(), QgsPointPatternFillSymbolLayer::applyPattern(), QgsPalLayerSettings::checkMinimumSizeMM(), QgsDiagramRendererV2::convertSizeToMapUnits(), QgsRasterLayer::draw(), QgsVectorLayer::draw(), QgsPalLabeling::drawLabel(), QgsPalLabeling::drawLabelBackground(), QgsAttributeTableFilterModel::generateListOfVisibleFeatures(), QgsSymbolLayerV2Utils::lineWidthScaleFactor(), QgsSymbolLayerV2Utils::pixelSizeScaleFactor(), QgsPalLayerSettings::registerFeature(), QgsMapRenderer::render(), QgsLabel::renderLabel(), and QgsPalLayerSettings::scaleToPixelContext().
|
inline |
Definition at line 45 of file qgsrendercontext.h.
Referenced by QgsRasterLayer::draw(), QgsVectorLayer::draw(), QgsPointDisplacementRenderer::drawCircle(), QgsPalLabeling::drawLabel(), QgsPalLabeling::drawLabelBackground(), QgsPalLabeling::drawLabelBuffer(), QgsPalLabeling::drawLabeling(), QgsPointDisplacementRenderer::drawLabels(), QgsPalLabeling::drawLabelShadow(), QgsVectorFieldSymbolLayer::drawPreviewIcon(), QgsMapRenderer::render(), QgsPointDisplacementRenderer::renderFeature(), QgsLabel::renderLabel(), QgsEllipseSymbolLayerV2::renderPoint(), QgsSimpleMarkerSymbolLayerV2::renderPoint(), QgsSvgMarkerSymbolLayerV2::renderPoint(), QgsFontMarkerSymbolLayerV2::renderPoint(), QgsSimpleFillSymbolLayerV2::renderPolygon(), QgsGradientFillSymbolLayerV2::renderPolygon(), QgsImageFillSymbolLayer::renderPolygon(), QgsSimpleLineSymbolLayerV2::renderPolyline(), and QgsFeatureRendererV2::renderVertexMarker().
|
inline |
Definition at line 56 of file qgsrendercontext.h.
Referenced by QgsSVGFillSymbolLayer::applyPattern(), QgsLinePatternFillSymbolLayer::applyPattern(), QgsPointPatternFillSymbolLayer::applyPattern(), QgsRasterLayer::draw(), QgsPointDisplacementRenderer::drawLabels(), QgsSymbolLayerV2Utils::pixelSizeScaleFactor(), QgsPalLabeling::prepareLayer(), QgsMapRenderer::render(), QgsLabel::renderLabel(), QgsSimpleMarkerSymbolLayerV2::renderPoint(), QgsSvgMarkerSymbolLayerV2::renderPoint(), QgsPalLayerSettings::scaleToPixelContext(), QgsSimpleFillSymbolLayerV2::startRender(), QgsSimpleLineSymbolLayerV2::startRender(), and QgsSimpleMarkerSymbolLayerV2::startRender().
|
inline |
Definition at line 71 of file qgsrendercontext.h.
Referenced by QgsVectorLayer::drawLabels(), QgsPalLabeling::prepareLayer(), QgsPalLayerSettings::registerFeature(), QgsMapRenderer::render(), QgsVectorLayer::simplifyDrawingCanbeApplied(), QgsEllipseSymbolLayerV2::startRender(), QgsPointDisplacementRenderer::startRender(), QgsSimpleFillSymbolLayerV2::startRender(), QgsSimpleLineSymbolLayerV2::startRender(), QgsSimpleMarkerSymbolLayerV2::startRender(), QgsRuleBasedRendererV2::Rule::startRender(), QgsSvgMarkerSymbolLayerV2::startRender(), QgsMarkerLineSymbolLayerV2::startRender(), QgsSVGFillSymbolLayer::startRender(), QgsLinePatternFillSymbolLayer::startRender(), and QgsPointPatternFillSymbolLayer::startRender().
|
inline |
Definition at line 58 of file qgsrendercontext.h.
Referenced by QgsVectorLayer::drawRendererV2(), QgsVectorLayer::drawRendererV2Levels(), and QgsMapRenderer::render().
|
inline |
Definition at line 54 of file qgsrendercontext.h.
Referenced by QgsSVGFillSymbolLayer::applyPattern(), QgsLinePatternFillSymbolLayer::applyPattern(), QgsPointPatternFillSymbolLayer::applyPattern(), QgsPalLayerSettings::checkMinimumSizeMM(), QgsDiagramRendererV2::convertSizeToMapUnits(), QgsRasterLayer::draw(), QgsPalLabeling::drawLabelBackground(), QgsSymbolLayerV2Utils::lineWidthScaleFactor(), QgsSymbolLayerV2Utils::pixelSizeScaleFactor(), QgsPalLabeling::prepareLayer(), QgsPalLayerSettings::registerFeature(), QgsMapRenderer::render(), QgsLabel::renderLabel(), QgsSvgMarkerSymbolLayerV2::renderPoint(), and QgsPalLayerSettings::scaleToPixelContext().
|
inline |
Added in QGIS v2.0.
Definition at line 77 of file qgsrendercontext.h.
Referenced by QgsVectorLayer::drawRendererV2Levels(), QgsSimpleMarkerSymbolLayerV2::prepareCache(), QgsSvgMarkerSymbolLayerV2::renderPoint(), QgsFontMarkerSymbolLayerV2::renderPoint(), QgsImageFillSymbolLayer::renderPolygon(), QgsSimpleFillSymbolLayerV2::startRender(), QgsSimpleLineSymbolLayerV2::startRender(), QgsSimpleMarkerSymbolLayerV2::startRender(), and QgsGradientFillSymbolLayerV2::startRender().
void QgsRenderContext::setCoordinateTransform | ( | const QgsCoordinateTransform * | t | ) |
Sets coordinate transformation.
QgsRenderContext does not take ownership
Definition at line 41 of file qgsrendercontext.cpp.
References mCoordTransform.
Referenced by QgsHighlight::paint(), and QgsMapRenderer::render().
|
inline |
Definition at line 85 of file qgsrendercontext.h.
Referenced by QgsComposerMap::draw(), and QgsMapRenderer::render().
|
inline |
Definition at line 84 of file qgsrendercontext.h.
Referenced by QgsMapRenderer::adjustExtentToSize(), QgsAttributeTableFilterModel::generateListOfVisibleFeatures(), QgsHighlight::paint(), and QgsMapRenderer::render().
|
inline |
Added in QGIS v1.5.
Definition at line 92 of file qgsrendercontext.h.
Referenced by QgsLinePatternFillSymbolLayer::applyPattern(), QgsPointPatternFillSymbolLayer::applyPattern(), QgsComposerMap::draw(), and QgsMapCanvasItem::setRenderContextVariables().
|
inline |
Added in QGIS v1.4.
Definition at line 94 of file qgsrendercontext.h.
Referenced by QgsMapRenderer::render().
|
inline |
Definition at line 83 of file qgsrendercontext.h.
Referenced by QgsMapRenderer::adjustExtentToSize(), QgsLinePatternFillSymbolLayer::applyPattern(), QgsPointPatternFillSymbolLayer::applyPattern(), QgsPalLabeling::drawLabelBackground(), QgsAttributeTableFilterModel::generateListOfVisibleFeatures(), QgsHighlight::paint(), and QgsMapRenderer::render().
|
inline |
Definition at line 90 of file qgsrendercontext.h.
Referenced by QgsLinePatternFillSymbolLayer::applyPattern(), QgsPointPatternFillSymbolLayer::applyPattern(), QgsSymbolLayerV2Utils::createRenderContext(), QgsComposerMap::drawGridLine(), QgsPalLabeling::drawLabelBackground(), QgsComposerMap::drawOverviewMapExtent(), QgsComposerShape::drawShapeUsingSymbol(), QgsPaperItem::paint(), QgsHighlight::paint(), QgsMapRenderer::render(), and QgsMapCanvasItem::setRenderContextVariables().
|
inline |
Definition at line 88 of file qgsrendercontext.h.
Referenced by QgsLinePatternFillSymbolLayer::applyPattern(), QgsPointPatternFillSymbolLayer::applyPattern(), QgsSymbolLayerV2Utils::createRenderContext(), QgsComposerMap::drawGridLine(), QgsComposerMap::drawOverviewMapExtent(), QgsComposerShape::drawShapeUsingSymbol(), QgsPaperItem::paint(), QgsMapRenderer::render(), and QgsMapCanvasItem::setRenderContextVariables().
|
inline |
Definition at line 89 of file qgsrendercontext.h.
Referenced by QgsVectorLayer::countSymbolFeatures(), QgsAttributeTableFilterModel::generateListOfVisibleFeatures(), QgsMapRenderer::render(), QgsVectorFileWriter::renderContext(), and QgsMapCanvasItem::setRenderContextVariables().
|
inline |
Definition at line 86 of file qgsrendercontext.h.
Referenced by QgsComposerMap::draw(), QgsVectorLayer::onCacheImageDelete(), QgsMapCanvas::paintEvent(), QgsMapRenderer::render(), and QgsMapCanvas::setRenderFlag().
|
inline |
Definition at line 87 of file qgsrendercontext.h.
Referenced by QgsLinePatternFillSymbolLayer::applyPattern(), QgsPointPatternFillSymbolLayer::applyPattern(), QgsSymbolLayerV2Utils::createRenderContext(), QgsComposerMap::drawGridLine(), QgsPalLabeling::drawLabelBackground(), QgsComposerMap::drawOverviewMapExtent(), QgsComposerShape::drawShapeUsingSymbol(), QgsPaperItem::paint(), QgsMapRenderer::render(), and QgsMapCanvasItem::setRenderContextVariables().
|
inline |
Added in QGIS v2.0.
Definition at line 96 of file qgsrendercontext.h.
Referenced by QgsMapRenderer::render().
|
inline |
Used to enable or disable advanced effects such as blend modes.
Definition at line 67 of file qgsrendercontext.h.
Referenced by QgsComposerMap::draw().
|
inline |
Definition at line 100 of file qgsrendercontext.h.
Referenced by QgsComposerMap::draw().
|
inline |
Returns true if advanced effects such as blend modes such be used.
Definition at line 64 of file qgsrendercontext.h.
Referenced by QgsPalLabeling::drawLabel(), QgsPalLabeling::drawLabelBackground(), QgsPalLabeling::drawLabelBuffer(), QgsPalLabeling::drawLabelShadow(), and QgsMapRenderer::render().
|
inline |
Returns true if the rendering optimization (geometry simplification) can be executed.
Definition at line 99 of file qgsrendercontext.h.
Referenced by QgsVectorLayer::simplifyDrawingCanbeApplied().
|
private |
For transformation between coordinate systems.
Can be 0 if on-the-fly reprojection is not used
Definition at line 108 of file qgsrendercontext.h.
Referenced by setCoordinateTransform().
|
private |
True if vertex markers for editing should be drawn.
Definition at line 111 of file qgsrendercontext.h.
|
private |
Definition at line 113 of file qgsrendercontext.h.
|
private |
If true then no rendered vector elements should be cached as image.
Definition at line 116 of file qgsrendercontext.h.
|
private |
Labeling engine (can be NULL)
Definition at line 136 of file qgsrendercontext.h.
|
private |
Definition at line 121 of file qgsrendercontext.h.
|
private |
Painter for rendering operations.
Definition at line 105 of file qgsrendercontext.h.
|
private |
Factor to scale rasters.
Definition at line 130 of file qgsrendercontext.h.
|
private |
Map scale.
Definition at line 133 of file qgsrendercontext.h.
|
private |
True if the rendering has been canceled.
Definition at line 124 of file qgsrendercontext.h.
|
private |
Factor to scale line widths and point marker sizes.
Definition at line 127 of file qgsrendercontext.h.
|
private |
Color used for features that are marked as selected.
Definition at line 139 of file qgsrendercontext.h.
|
private |
Flag if advanced visual effects such as blend modes should be used.
True by default
Definition at line 119 of file qgsrendercontext.h.
|
private |
True if the rendering optimization (geometry simplification) can be executed.
Definition at line 142 of file qgsrendercontext.h.