QGIS/python/core/symbology-ng/qgsinvertedpolygonrenderer.sip

107 lines
5.1 KiB
Plaintext
Raw Normal View History

2014-05-24 12:00:44 +07:00
class QgsInvertedPolygonRenderer : QgsFeatureRendererV2
2014-05-23 19:56:18 +02:00
{
%TypeHeaderCode
#include <qgsinvertedpolygonrenderer.h>
%End
public:
2014-05-24 12:07:23 +02:00
/** Constructor
* @param embeddedRenderer optional embeddedRenderer. If null, a default one will be assigned
*/
QgsInvertedPolygonRenderer( const QgsFeatureRendererV2* embeddedRenderer /Transfer/ = 0 );
virtual ~QgsInvertedPolygonRenderer();
2014-05-23 19:56:18 +02:00
2014-05-24 12:07:23 +02:00
/** Used to clone this feature renderer.*/
virtual QgsInvertedPolygonRenderer* clone() const /Factory/;
2014-05-23 19:56:18 +02:00
virtual void startRender( QgsRenderContext& context, const QgsFields& fields );
2014-05-23 19:56:18 +02:00
2014-05-24 12:07:23 +02:00
/** 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 );
2014-05-23 19:56:18 +02:00
2014-05-24 12:07:23 +02:00
/**
* The actual rendering will take place here.
* Features collected during renderFeature() are rendered using the embedded feature renderer
*/
virtual void stopRender( QgsRenderContext& context );
2014-05-23 19:56:18 +02:00
2014-05-24 12:07:23 +02:00
/** @returns a textual representation of the renderer */
virtual QString dump() const;
2014-05-23 19:56:18 +02:00
2014-05-24 12:07:23 +02:00
/** 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.
2016-02-14 03:50:23 +01:00
* @note available in python bindings as symbol2
*/
virtual QgsSymbolV2List symbols( QgsRenderContext& context ) /PyName=symbols2/;
/** Proxy that will call this method on the embedded renderer.
2016-02-14 03:50:23 +01:00
* @note available in python bindings as symbolForFeature2
*/
virtual QgsSymbolV2* symbolForFeature( QgsFeature& feature, QgsRenderContext& context ) /PyName=symbolForFeature2/;
/** Proxy that will call this method on the embedded renderer.
2016-02-14 03:50:23 +01:00
* @note available in python bindings as originalSymbolForFeature2
*/
virtual QgsSymbolV2* originalSymbolForFeature( QgsFeature& feat, QgsRenderContext& context ) /PyName=originalSymbolForFeature2/;
/** Proxy that will call this method on the embedded renderer.
2016-02-14 03:50:23 +01:00
* @note available in python bindings as symbolsForFeature
*/
virtual QgsSymbolV2List symbolsForFeature( QgsFeature& feat, QgsRenderContext& context ) /PyName=symbolsForFeature/;
/** Proxy that will call this method on the embedded renderer.
2016-02-14 03:50:23 +01:00
* @note available in python bindings as originalSymbolsForFeature2
*/
virtual QgsSymbolV2List originalSymbolsForFeature( QgsFeature& feat, QgsRenderContext& context ) /PyName=originalSymbolsForFeature2/;
2014-05-24 12:07:23 +02:00
/** 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.
2016-02-14 03:50:23 +01:00
* @note not available in python bindings
2014-05-24 12:07:23 +02:00
*/
// virtual QgsLegendSymbolList legendSymbolItems( double scaleDenominator = -1, const QString& rule = "" );
/** Proxy that will call this method on the embedded renderer.
2016-02-14 03:50:23 +01:00
* @note available in python bindings as willRenderFeature2
*/
virtual bool willRenderFeature( QgsFeature& feat, QgsRenderContext& context ) /PyName=willRenderFeature2/;
2014-05-23 19:56:18 +02:00
2014-05-24 12:07:23 +02:00
/** Creates a renderer out of an XML, for loading*/
static QgsFeatureRendererV2* create( QDomElement& element ) /Factory/;
2014-05-23 19:56:18 +02:00
2014-05-24 12:07:23 +02:00
/** 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 );
2014-05-23 19:56:18 +02:00
2015-07-29 11:52:14 +02:00
/** Sets the embedded renderer
2014-05-24 12:07:23 +02:00
* @param subRenderer the embedded renderer (will be cloned)
*/
void setEmbeddedRenderer( const QgsFeatureRendererV2* subRenderer );
/** @returns the current embedded renderer
*/
const QgsFeatureRendererV2* embeddedRenderer() const;
2014-05-27 09:11:13 +02:00
/** @returns true if the geometries are to be preprocessed (merged with an union) before rendering.*/
2014-06-10 11:10:42 +07:00
bool preprocessingEnabled() const;
/**
2016-02-14 03:50:23 +01:00
* @param enabled enables or disables the preprocessing.
* When enabled, geometries will be merged with an union before being rendered.
* It allows fixing some rendering artifacts (when rendering overlapping polygons for instance).
* This will involve some CPU-demanding computations and is thus disabled by default.
*/
2014-06-10 11:10:42 +07:00
void setPreprocessingEnabled( bool enabled );
2015-07-29 11:52:14 +02:00
/** Creates a QgsInvertedPolygonRenderer by a conversion from an existing renderer.
2016-02-14 03:50:23 +01:00
* @note added in 2.5
* @returns a new renderer if the conversion was possible, otherwise 0.
*/
static QgsInvertedPolygonRenderer* convertFromRenderer( const QgsFeatureRendererV2* renderer ) /Factory/;
2014-05-23 19:56:18 +02:00
};