-
-
Notifications
You must be signed in to change notification settings - Fork 3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Hugo Mercier
committed
May 23, 2014
1 parent
0ff587c
commit 66ac1ed
Showing
4 changed files
with
95 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
class QgsInvertedPolygonRenderer : public QgsFeatureRendererV2 | ||
{ | ||
%TypeHeaderCode | ||
#include <qgsinvertedpolygonrenderer.h> | ||
%End | ||
public: | ||
|
||
/** Constructor | ||
* @param embeddedRenderer optional embeddedRenderer. If null, a default one will be assigned | ||
*/ | ||
QgsInvertedPolygonRenderer( const QgsFeatureRendererV2* embeddedRenderer = 0 ); | ||
virtual ~QgsInvertedPolygonRenderer(); | ||
|
||
/** Used to clone this feature renderer.*/ | ||
virtual QgsFeatureRendererV2* clone(); | ||
|
||
virtual void startRender( QgsRenderContext& context, const QgsFields& fields ); | ||
|
||
/** Renders a given feature. | ||
* This will here collect features. The actual rendering will be postponed to stopRender() | ||
* @param feature the feature to render | ||
* @param context the rendering context | ||
* @param layer the symbol layer to render, if that makes sense | ||
* @param selected whether this feature has been selected (this will add decorations) | ||
* @param drawVertexMarker whether this feature has vertex markers (in edit mode usually) | ||
* @returns true if the rendering was ok | ||
*/ | ||
virtual bool renderFeature( QgsFeature& feature, QgsRenderContext& context, int layer = -1, bool selected = false, bool drawVertexMarker = false ); | ||
|
||
/** | ||
* The actual rendering will take place here. | ||
* Features collected during renderFeature() are rendered using the embedded feature renderer | ||
*/ | ||
virtual void stopRender( QgsRenderContext& context ); | ||
|
||
/** @returns a textual reprensation of the renderer */ | ||
virtual QString dump() const; | ||
|
||
/** Proxy that will call this method on the embedded renderer. */ | ||
virtual QList<QString> usedAttributes(); | ||
/** Proxy that will call this method on the embedded renderer. */ | ||
virtual int capabilities(); | ||
/** Proxy that will call this method on the embedded renderer. */ | ||
virtual QgsSymbolV2List symbols(); | ||
/** Proxy that will call this method on the embedded renderer. */ | ||
virtual QgsSymbolV2* symbolForFeature( QgsFeature& feature ); | ||
/** Proxy that will call this method on the embedded renderer. */ | ||
virtual QgsSymbolV2List symbolsForFeature( QgsFeature& feat ); | ||
/** Proxy that will call this method on the embedded renderer. */ | ||
virtual QgsLegendSymbologyList legendSymbologyItems( QSize iconSize ); | ||
/** Proxy that will call this method on the embedded renderer. */ | ||
virtual bool willRenderFeature( QgsFeature& feat ); | ||
|
||
/** Creates a renderer out of an XML, for loading*/ | ||
static QgsFeatureRendererV2* create( QDomElement& element ); | ||
|
||
/** Creates an XML representation of the renderer. Used for saving purpose | ||
* @param doc the XML document where to create the XML subtree | ||
* @returns the created XML subtree | ||
*/ | ||
virtual QDomElement save( QDomDocument& doc ); | ||
|
||
/** sets the embedded renderer | ||
* @param subRenderer the embedded renderer (will be cloned) | ||
*/ | ||
void setEmbeddedRenderer( const QgsFeatureRendererV2* subRenderer ); | ||
/** @returns the current embedded renderer | ||
*/ | ||
const QgsFeatureRendererV2* embeddedRenderer() const; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
python/gui/symbology-ng/qgsinvertedpolygonrendererwidget.sip
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
class QgsInvertedPolygonRendererWidget : public QgsRendererV2Widget, private Ui::QgsInvertedPolygonRendererWidgetBase | ||
{ | ||
%TypeHeaderCode | ||
#include <qgsinvertedpolygonrendererwidget.h> | ||
%End | ||
public: | ||
/** static creation method | ||
* @param layer the layer where this renderer is applied | ||
* @param style | ||
* @param renderer the mask renderer (will take ownership) | ||
*/ | ||
static QgsRendererV2Widget* create( QgsVectorLayer* layer, QgsStyleV2* style, QgsFeatureRendererV2* renderer ); | ||
|
||
/** Constructor | ||
* @param layer the layer where this renderer is applied | ||
* @param style | ||
* @param renderer the mask renderer (will take ownership) | ||
*/ | ||
QgsInvertedPolygonRendererWidget( QgsVectorLayer* layer, QgsStyleV2* style, QgsFeatureRendererV2* renderer ); | ||
|
||
/** @returns the current feature renderer */ | ||
virtual QgsFeatureRendererV2* renderer(); | ||
}; |