Skip to content
Permalink
Browse files
Introduce capabilities for renderers (now only symbol levels capability)
  • Loading branch information
wonder-sk committed Nov 26, 2011
1 parent 4a5d442 commit 56525c2
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 1 deletion.
@@ -987,7 +987,8 @@ bool QgsVectorLayer::draw( QgsRenderContext& rendererContext )

select( attributes, rendererContext.extent() );

if ( mRendererV2->usingSymbolLevels() )
if ( ( mRendererV2->capabilities() & QgsFeatureRendererV2::SymbolLevels )
&& mRendererV2->usingSymbolLevels() )
drawRendererV2Levels( rendererContext, labeling );
else
drawRendererV2( rendererContext, labeling );
@@ -60,6 +60,10 @@ class CORE_EXPORT QgsCategorizedSymbolRendererV2 : public QgsFeatureRendererV2

virtual QgsFeatureRendererV2* clone();

//! returns bitwise OR-ed capabilities of the renderer
//! \note added in 2.0
virtual int capabilities() { return SymbolLevels; }

virtual QgsSymbolV2List symbols();

const QgsCategoryList& categories() { return mCategories; }
@@ -55,6 +55,10 @@ class CORE_EXPORT QgsGraduatedSymbolRendererV2 : public QgsFeatureRendererV2

virtual QgsFeatureRendererV2* clone();

//! returns bitwise OR-ed capabilities of the renderer
//! \note added in 2.0
virtual int capabilities() { return SymbolLevels; }

virtual QgsSymbolV2List symbols();

QString classAttribute() const { return mAttrName; }
@@ -78,6 +78,14 @@ class CORE_EXPORT QgsFeatureRendererV2
//! for debugging
virtual QString dump();

enum Capabilities {
SymbolLevels = 1 // rendering with symbol levels (i.e. implements symbols(), symbolForFeature())
};

//! returns bitwise OR-ed capabilities of the renderer
//! \note added in 2.0
virtual int capabilities() { return 0; }

//! for symbol levels
virtual QgsSymbolV2List symbols() = 0;

@@ -36,6 +36,10 @@ class CORE_EXPORT QgsSingleSymbolRendererV2 : public QgsFeatureRendererV2

virtual QgsFeatureRendererV2* clone();

//! returns bitwise OR-ed capabilities of the renderer
//! \note added in 2.0
virtual int capabilities() { return SymbolLevels; }

virtual QgsSymbolV2List symbols();

//! create renderer from XML element

0 comments on commit 56525c2

Please sign in to comment.