QGIS API Documentation  2.5.0-Master
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
Public Member Functions | Static Public Member Functions | Private Attributes | List of all members
QgsRenderContext Class Reference

Contains information about the context of a rendering operation. More...

#include <qgsrendercontext.h>

Collaboration diagram for QgsRenderContext:
Collaboration graph
[legend]

Public Member Functions

 QgsRenderContext ()
 
 ~QgsRenderContext ()
 
QPainter * painter ()
 
const QPainter * constPainter () const
 
const QgsCoordinateTransformcoordinateTransform () const
 
const QgsRectangleextent () const
 
const QgsMapToPixelmapToPixel () 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. More...
 
void setUseAdvancedEffects (bool enabled)
 Used to enable or disable advanced effects such as blend modes. More...
 
bool drawEditingInformation () const
 
double rendererScale () const
 
QgsLabelingEngineInterfacelabelingEngine () const
 Added in QGIS v1.4. More...
 
QColor selectionColor () const
 Added in QGIS v2.0. More...
 
bool showSelection () const
 Returns true if vector selections should be shown in the rendered map. More...
 
void setCoordinateTransform (const QgsCoordinateTransform *t)
 Sets coordinate transformation. More...
 
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. More...
 
void setLabelingEngine (QgsLabelingEngineInterface *iface)
 Added in QGIS v1.4. More...
 
void setSelectionColor (const QColor &color)
 Added in QGIS v2.0. More...
 
void setShowSelection (const bool showSelection)
 Sets whether vector selections should be shown in the rendered map. More...
 
bool useRenderingOptimization () const
 Returns true if the rendering optimization (geometry simplification) can be executed. More...
 
void setUseRenderingOptimization (bool enabled)
 
const QgsVectorSimplifyMethodvectorSimplifyMethod () const
 Added in QGIS v2.4. More...
 
void setVectorSimplifyMethod (const QgsVectorSimplifyMethod &simplifyMethod)
 

Static Public Member Functions

static QgsRenderContext fromMapSettings (const QgsMapSettings &mapSettings)
 create initialized QgsRenderContext instance from given QgsMapSettings More...
 

Private Attributes

QPainter * mPainter
 Painter for rendering operations. More...
 
const QgsCoordinateTransformmCoordTransform
 For transformation between coordinate systems. More...
 
bool mDrawEditingInformation
 True if vertex markers for editing should be drawn. More...
 
QgsRectangle mExtent
 
bool mForceVectorOutput
 If true then no rendered vector elements should be cached as image. More...
 
bool mUseAdvancedEffects
 Flag if advanced visual effects such as blend modes should be used. More...
 
QgsMapToPixel mMapToPixel
 
bool mRenderingStopped
 True if the rendering has been canceled. More...
 
double mScaleFactor
 Factor to scale line widths and point marker sizes. More...
 
double mRasterScaleFactor
 Factor to scale rasters. More...
 
double mRendererScale
 Map scale. More...
 
QgsLabelingEngineInterfacemLabelingEngine
 Labeling engine (can be NULL) More...
 
bool mShowSelection
 Whether selection should be shown. More...
 
QColor mSelectionColor
 Color used for features that are marked as selected. More...
 
bool mUseRenderingOptimization
 True if the rendering optimization (geometry simplification) can be executed. More...
 
QgsVectorSimplifyMethod mVectorSimplifyMethod
 Simplification object which holds the information about how to simplify the features for fast rendering. More...
 

Detailed Description

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 39 of file qgsrendercontext.h.

Constructor & Destructor Documentation

QgsRenderContext::QgsRenderContext ( )
QgsRenderContext::~QgsRenderContext ( )

Definition at line 40 of file qgsrendercontext.cpp.

Member Function Documentation

const QPainter* QgsRenderContext::constPainter ( ) const
inline

Definition at line 52 of file qgsrendercontext.h.

const QgsCoordinateTransform* QgsRenderContext::coordinateTransform ( ) const
inline
bool QgsRenderContext::drawEditingInformation ( ) const
inline
const QgsRectangle& QgsRenderContext::extent ( ) const
inline
bool QgsRenderContext::forceVectorOutput ( ) const
inline
QgsRenderContext QgsRenderContext::fromMapSettings ( const QgsMapSettings mapSettings)
static
QgsLabelingEngineInterface* QgsRenderContext::labelingEngine ( ) const
inline
const QgsMapToPixel& QgsRenderContext::mapToPixel ( ) const
inline
QPainter* QgsRenderContext::painter ( )
inline
double QgsRenderContext::rasterScaleFactor ( ) const
inline
double QgsRenderContext::rendererScale ( ) const
inline
bool QgsRenderContext::renderingStopped ( ) const
inline
double QgsRenderContext::scaleFactor ( ) const
inline
QColor QgsRenderContext::selectionColor ( ) const
inline
void QgsRenderContext::setCoordinateTransform ( const QgsCoordinateTransform t)
void QgsRenderContext::setDrawEditingInformation ( bool  b)
inline

Definition at line 99 of file qgsrendercontext.h.

Referenced by fromMapSettings(), and QgsMapRenderer::render().

void QgsRenderContext::setExtent ( const QgsRectangle extent)
inline
void QgsRenderContext::setForceVectorOutput ( bool  force)
inline
void QgsRenderContext::setLabelingEngine ( QgsLabelingEngineInterface iface)
inline

Added in QGIS v1.4.

Definition at line 108 of file qgsrendercontext.h.

Referenced by QgsMapRendererJob::drawLabeling(), QgsMapRendererJob::prepareJobs(), and QgsMapRenderer::render().

void QgsRenderContext::setMapToPixel ( const QgsMapToPixel mtp)
inline
void QgsRenderContext::setPainter ( QPainter *  p)
inline
void QgsRenderContext::setRasterScaleFactor ( double  factor)
inline
void QgsRenderContext::setRendererScale ( double  scale)
inline
void QgsRenderContext::setRenderingStopped ( bool  stopped)
inline
void QgsRenderContext::setScaleFactor ( double  factor)
inline
void QgsRenderContext::setSelectionColor ( const QColor &  color)
inline

Added in QGIS v2.0.

Definition at line 110 of file qgsrendercontext.h.

Referenced by fromMapSettings(), and QgsMapRenderer::render().

void QgsRenderContext::setShowSelection ( const bool  showSelection)
inline

Sets whether vector selections should be shown in the rendered map.

Parameters
showSelectionset to true if selections should be shown
See also
showSelection
setSelectionColor
Note
Added in QGIS v2.4

Definition at line 118 of file qgsrendercontext.h.

Referenced by fromMapSettings().

void QgsRenderContext::setUseAdvancedEffects ( bool  enabled)
inline

Used to enable or disable advanced effects such as blend modes.

Note
: added in version 1.9

Definition at line 73 of file qgsrendercontext.h.

Referenced by fromMapSettings().

void QgsRenderContext::setUseRenderingOptimization ( bool  enabled)
inline

Definition at line 122 of file qgsrendercontext.h.

Referenced by fromMapSettings().

void QgsRenderContext::setVectorSimplifyMethod ( const QgsVectorSimplifyMethod simplifyMethod)
inline

Definition at line 126 of file qgsrendercontext.h.

Referenced by QgsVectorLayerRenderer::render().

bool QgsRenderContext::showSelection ( ) const
inline

Returns true if vector selections should be shown in the rendered map.

Returns
true if selections should be shown
See also
setShowSelection
selectionColor
Note
Added in QGIS v2.4

Definition at line 91 of file qgsrendercontext.h.

Referenced by QgsVectorLayerRenderer::drawRendererV2().

bool QgsRenderContext::useAdvancedEffects ( ) const
inline
bool QgsRenderContext::useRenderingOptimization ( ) const
inline

Returns true if the rendering optimization (geometry simplification) can be executed.

Definition at line 121 of file qgsrendercontext.h.

Referenced by QgsVectorLayer::simplifyDrawingCanbeApplied().

const QgsVectorSimplifyMethod& QgsRenderContext::vectorSimplifyMethod ( ) const
inline

Added in QGIS v2.4.

Definition at line 125 of file qgsrendercontext.h.

Referenced by QgsFillSymbolLayerV2::_renderPolygon(), and QgsSimpleLineSymbolLayerV2::renderPolyline().

Member Data Documentation

const QgsCoordinateTransform* QgsRenderContext::mCoordTransform
private

For transformation between coordinate systems.

Can be 0 if on-the-fly reprojection is not used

Definition at line 134 of file qgsrendercontext.h.

Referenced by setCoordinateTransform().

bool QgsRenderContext::mDrawEditingInformation
private

True if vertex markers for editing should be drawn.

Definition at line 137 of file qgsrendercontext.h.

QgsRectangle QgsRenderContext::mExtent
private

Definition at line 139 of file qgsrendercontext.h.

bool QgsRenderContext::mForceVectorOutput
private

If true then no rendered vector elements should be cached as image.

Definition at line 142 of file qgsrendercontext.h.

QgsLabelingEngineInterface* QgsRenderContext::mLabelingEngine
private

Labeling engine (can be NULL)

Definition at line 162 of file qgsrendercontext.h.

QgsMapToPixel QgsRenderContext::mMapToPixel
private

Definition at line 147 of file qgsrendercontext.h.

QPainter* QgsRenderContext::mPainter
private

Painter for rendering operations.

Definition at line 131 of file qgsrendercontext.h.

double QgsRenderContext::mRasterScaleFactor
private

Factor to scale rasters.

Definition at line 156 of file qgsrendercontext.h.

double QgsRenderContext::mRendererScale
private

Map scale.

Definition at line 159 of file qgsrendercontext.h.

bool QgsRenderContext::mRenderingStopped
private

True if the rendering has been canceled.

Definition at line 150 of file qgsrendercontext.h.

double QgsRenderContext::mScaleFactor
private

Factor to scale line widths and point marker sizes.

Definition at line 153 of file qgsrendercontext.h.

QColor QgsRenderContext::mSelectionColor
private

Color used for features that are marked as selected.

Definition at line 168 of file qgsrendercontext.h.

bool QgsRenderContext::mShowSelection
private

Whether selection should be shown.

Definition at line 165 of file qgsrendercontext.h.

bool QgsRenderContext::mUseAdvancedEffects
private

Flag if advanced visual effects such as blend modes should be used.

True by default

Definition at line 145 of file qgsrendercontext.h.

bool QgsRenderContext::mUseRenderingOptimization
private

True if the rendering optimization (geometry simplification) can be executed.

Definition at line 171 of file qgsrendercontext.h.

QgsVectorSimplifyMethod QgsRenderContext::mVectorSimplifyMethod
private

Simplification object which holds the information about how to simplify the features for fast rendering.

Definition at line 174 of file qgsrendercontext.h.

Referenced by QgsRenderContext().


The documentation for this class was generated from the following files: