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

Implementation of threaded rendering for vector layers. More...

#include <qgsvectorlayerrenderer.h>

Inheritance diagram for QgsVectorLayerRenderer:
Inheritance graph
[legend]
Collaboration diagram for QgsVectorLayerRenderer:
Collaboration graph
[legend]

Public Member Functions

 QgsVectorLayerRenderer (QgsVectorLayer *layer, QgsRenderContext &context)
 
 ~QgsVectorLayerRenderer ()
 
virtual bool render ()
 Do the rendering (based on data stored in the class) More...
 
void setGeometryCachePointer (QgsGeometryCache *cache)
 where to save the cached geometries More...
 
- Public Member Functions inherited from QgsMapLayerRenderer
 QgsMapLayerRenderer (const QString &layerID)
 
virtual ~QgsMapLayerRenderer ()
 
QStringList errors () const
 Return list of errors (problems) that happened during the rendering. More...
 
QString layerID () const
 Get access to the ID of the layer rendered by this class. More...
 

Protected Attributes

QgsRenderContextmContext
 
QgsFields mFields
 
QgsFeatureIds mSelectedFeatureIds
 
QgsVectorLayerFeatureSourcemSource
 
QgsFeatureRendererV2mRendererV2
 
bool mCacheFeatures
 
QgsGeometryCachemCache
 
bool mDrawVertexMarkers
 
bool mVertexMarkerOnlyForSelection
 
int mVertexMarkerStyle
 
int mVertexMarkerSize
 
QGis::GeometryType mGeometryType
 
QStringList mAttrNames
 
bool mLabeling
 
bool mDiagrams
 
int mLayerTransparency
 
QPainter::CompositionMode mFeatureBlendMode
 
QgsVectorSimplifyMethod mSimplifyMethod
 
bool mSimplifyGeometry
 
- Protected Attributes inherited from QgsMapLayerRenderer
QStringList mErrors
 
QString mLayerID
 

Private Member Functions

void prepareLabeling (QgsVectorLayer *layer, QStringList &attributeNames)
 Registers label and diagram layer. More...
 
void prepareDiagrams (QgsVectorLayer *layer, QStringList &attributeNames)
 
void drawRendererV2 (QgsFeatureIterator &fit)
 Draw layer with renderer V2. More...
 
void drawRendererV2Levels (QgsFeatureIterator &fit)
 Draw layer with renderer V2 using symbol levels. More...
 
void stopRendererV2 (QgsSingleSymbolRendererV2 *selRenderer)
 Stop version 2 renderer and selected renderer (if required) More...
 

Detailed Description

Implementation of threaded rendering for vector layers.

Note
added in 2.4

Definition at line 50 of file qgsvectorlayerrenderer.h.

Constructor & Destructor Documentation

QgsVectorLayerRenderer::QgsVectorLayerRenderer ( QgsVectorLayer layer,
QgsRenderContext context 
)
QgsVectorLayerRenderer::~QgsVectorLayerRenderer ( )

Definition at line 102 of file qgsvectorlayerrenderer.cpp.

References mRendererV2, and mSource.

Member Function Documentation

void QgsVectorLayerRenderer::drawRendererV2 ( QgsFeatureIterator fit)
private
void QgsVectorLayerRenderer::drawRendererV2Levels ( QgsFeatureIterator fit)
private
void QgsVectorLayerRenderer::prepareDiagrams ( QgsVectorLayer layer,
QStringList &  attributeNames 
)
private
void QgsVectorLayerRenderer::prepareLabeling ( QgsVectorLayer layer,
QStringList &  attributeNames 
)
private
bool QgsVectorLayerRenderer::render ( )
virtual

Do the rendering (based on data stored in the class)

Implements QgsMapLayerRenderer.

Definition at line 109 of file qgsvectorlayerrenderer.cpp.

References QgsFeatureRendererV2::capabilities(), QgsRectangle::center(), QgsRenderContext::coordinateTransform(), drawRendererV2(), drawRendererV2Levels(), QgsRenderContext::extent(), QgsVectorSimplifyMethod::forceLocalOptimization(), QgsCoordinateReferenceSystem::geographicFlag(), QgsVectorLayerFeatureSource::getFeatures(), QgsRectangle::isEmpty(), QgsRectangle::isFinite(), QgsMessageLog::logMessage(), QgsRenderContext::mapToPixel(), QgsMapToPixel::mapUnitsPerPixel(), mAttrNames, mContext, QgsMapLayerRenderer::mErrors, mFeatureBlendMode, mFields, mGeometryType, mLayerTransparency, mRendererV2, mSimplifyGeometry, mSimplifyMethod, mSource, QGis::NoGeometry, QgsVectorSimplifyMethod::NoSimplification, QgsSimplifyMethod::OptimizeForRendering, QgsRenderContext::painter(), QgsDebugMsg, QgsFeatureRequest::setFilterRect(), QgsSimplifyMethod::setForceLocalOptimization(), QgsSimplifyMethod::setMethodType(), QgsVectorSimplifyMethod::setSimplifyHints(), QgsFeatureRequest::setSimplifyMethod(), QgsSimplifyMethod::setTolerance(), QgsRenderContext::setVectorSimplifyMethod(), QgsCoordinateTransform::sourceCrs(), QgsFeatureRendererV2::startRender(), QgsFeatureRendererV2::SymbolLevels, QgsVectorSimplifyMethod::threshold(), QgsRectangle::toString(), tr, QgsCoordinateTransform::transform(), QGis::UnknownGeometry, QgsRenderContext::useAdvancedEffects(), QgsFeatureRendererV2::usingSymbolLevels(), QgsException::what(), QgsPoint::x(), QgsRectangle::xMaximum(), QgsRectangle::xMinimum(), QgsPoint::y(), QgsRectangle::yMaximum(), and QgsRectangle::yMinimum().

Referenced by QgsVectorLayer::draw().

void QgsVectorLayerRenderer::setGeometryCachePointer ( QgsGeometryCache cache)

where to save the cached geometries

Note
The way how geometries are cached is really suboptimal - this method may be removed in future releases

Definition at line 219 of file qgsvectorlayerrenderer.cpp.

References QgsRenderContext::extent(), mCache, mContext, and QgsGeometryCache::setCachedGeometriesRect().

void QgsVectorLayerRenderer::stopRendererV2 ( QgsSingleSymbolRendererV2 selRenderer)
private

Stop version 2 renderer and selected renderer (if required)

Definition at line 406 of file qgsvectorlayerrenderer.cpp.

References mContext, mRendererV2, QgsSingleSymbolRendererV2::stopRender(), and QgsFeatureRendererV2::stopRender().

Referenced by drawRendererV2(), and drawRendererV2Levels().

Member Data Documentation

QStringList QgsVectorLayerRenderer::mAttrNames
protected

Definition at line 104 of file qgsvectorlayerrenderer.h.

Referenced by QgsVectorLayerRenderer(), and render().

QgsGeometryCache* QgsVectorLayerRenderer::mCache
protected
bool QgsVectorLayerRenderer::mCacheFeatures
protected

Definition at line 95 of file qgsvectorlayerrenderer.h.

QgsRenderContext& QgsVectorLayerRenderer::mContext
protected
bool QgsVectorLayerRenderer::mDiagrams
protected

Definition at line 107 of file qgsvectorlayerrenderer.h.

Referenced by drawRendererV2(), drawRendererV2Levels(), and prepareDiagrams().

bool QgsVectorLayerRenderer::mDrawVertexMarkers
protected
QPainter::CompositionMode QgsVectorLayerRenderer::mFeatureBlendMode
protected

Definition at line 110 of file qgsvectorlayerrenderer.h.

Referenced by QgsVectorLayerRenderer(), and render().

QgsFields QgsVectorLayerRenderer::mFields
protected

Definition at line 87 of file qgsvectorlayerrenderer.h.

Referenced by drawRendererV2Levels(), prepareDiagrams(), and render().

QGis::GeometryType QgsVectorLayerRenderer::mGeometryType
protected

Definition at line 102 of file qgsvectorlayerrenderer.h.

Referenced by drawRendererV2Levels(), QgsVectorLayerRenderer(), and render().

bool QgsVectorLayerRenderer::mLabeling
protected

Definition at line 106 of file qgsvectorlayerrenderer.h.

Referenced by drawRendererV2(), drawRendererV2Levels(), and prepareLabeling().

int QgsVectorLayerRenderer::mLayerTransparency
protected

Definition at line 109 of file qgsvectorlayerrenderer.h.

Referenced by QgsVectorLayerRenderer(), and render().

QgsFeatureRendererV2* QgsVectorLayerRenderer::mRendererV2
protected
QgsFeatureIds QgsVectorLayerRenderer::mSelectedFeatureIds
protected
bool QgsVectorLayerRenderer::mSimplifyGeometry
protected

Definition at line 113 of file qgsvectorlayerrenderer.h.

Referenced by QgsVectorLayerRenderer(), and render().

QgsVectorSimplifyMethod QgsVectorLayerRenderer::mSimplifyMethod
protected

Definition at line 112 of file qgsvectorlayerrenderer.h.

Referenced by QgsVectorLayerRenderer(), and render().

QgsVectorLayerFeatureSource* QgsVectorLayerRenderer::mSource
protected
bool QgsVectorLayerRenderer::mVertexMarkerOnlyForSelection
protected
int QgsVectorLayerRenderer::mVertexMarkerSize
protected

Definition at line 100 of file qgsvectorlayerrenderer.h.

Referenced by drawRendererV2Levels(), and QgsVectorLayerRenderer().

int QgsVectorLayerRenderer::mVertexMarkerStyle
protected

Definition at line 100 of file qgsvectorlayerrenderer.h.

Referenced by drawRendererV2Levels(), and QgsVectorLayerRenderer().


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