2016-08-06 11:01:42 +02:00
|
|
|
class QgsSingleSymbolRenderer : QgsFeatureRenderer
|
2012-09-24 02:28:15 +02:00
|
|
|
{
|
|
|
|
%TypeHeaderCode
|
2016-08-07 17:33:22 +02:00
|
|
|
#include <qgssinglesymbolrenderer.h>
|
2012-09-24 02:28:15 +02:00
|
|
|
%End
|
|
|
|
public:
|
|
|
|
|
2017-05-01 18:13:15 +02:00
|
|
|
QgsSingleSymbolRenderer( QgsSymbol *symbol /Transfer/ );
|
2012-09-24 02:28:15 +02:00
|
|
|
|
2016-08-06 11:01:42 +02:00
|
|
|
virtual ~QgsSingleSymbolRenderer();
|
2012-09-24 02:28:15 +02:00
|
|
|
|
2015-11-08 19:18:00 +00:00
|
|
|
//! @note available in python as symbolForFeature2
|
2017-05-01 18:13:15 +02:00
|
|
|
virtual QgsSymbol *symbolForFeature( QgsFeature &feature, QgsRenderContext &context );
|
2012-09-24 02:28:15 +02:00
|
|
|
|
2015-11-08 19:18:00 +00:00
|
|
|
//! @note available in python as originalSymbolForFeature2
|
2017-05-01 18:13:15 +02:00
|
|
|
virtual QgsSymbol *originalSymbolForFeature( QgsFeature &feature, QgsRenderContext &context );
|
2014-09-25 12:00:45 +02:00
|
|
|
|
2017-05-01 18:13:15 +02:00
|
|
|
virtual void startRender( QgsRenderContext &context, const QgsFields &fields );
|
2012-09-24 02:28:15 +02:00
|
|
|
|
2017-05-01 18:13:15 +02:00
|
|
|
virtual void stopRender( QgsRenderContext &context );
|
2012-09-24 02:28:15 +02:00
|
|
|
|
2017-05-01 18:13:15 +02:00
|
|
|
virtual QSet<QString> usedAttributes( const QgsRenderContext &context ) const;
|
2012-09-24 02:28:15 +02:00
|
|
|
|
2017-05-01 18:13:15 +02:00
|
|
|
QgsSymbol *symbol() const;
|
|
|
|
void setSymbol( QgsSymbol *s /Transfer/ );
|
2012-09-24 02:28:15 +02:00
|
|
|
|
2013-07-22 21:41:44 +02:00
|
|
|
virtual QString dump() const;
|
2012-09-24 02:28:15 +02:00
|
|
|
|
2017-05-01 18:13:15 +02:00
|
|
|
virtual QgsSingleSymbolRenderer *clone() const /Factory/;
|
2012-09-24 02:28:15 +02:00
|
|
|
|
2017-05-01 18:13:15 +02:00
|
|
|
virtual void toSld( QDomDocument &doc, QDomElement &element ) const;
|
|
|
|
static QgsFeatureRenderer *createFromSld( QDomElement &element, QgsWkbTypes::GeometryType geomType );
|
2012-09-24 02:28:15 +02:00
|
|
|
|
|
|
|
//! returns bitwise OR-ed capabilities of the renderer
|
2016-08-06 11:01:42 +02:00
|
|
|
virtual QgsFeatureRenderer::Capabilities capabilities();
|
2012-09-24 02:28:15 +02:00
|
|
|
|
2015-11-08 19:18:00 +00:00
|
|
|
//! @note available in python as symbol2
|
2017-05-01 18:13:15 +02:00
|
|
|
virtual QgsSymbolList symbols( QgsRenderContext &context );
|
2012-09-24 02:28:15 +02:00
|
|
|
|
|
|
|
//! create renderer from XML element
|
2017-05-12 17:31:01 +08:00
|
|
|
static QgsFeatureRenderer* create( QDomElement& element, const QgsReadWriteContext &context ) /Factory/;
|
2012-09-24 02:28:15 +02:00
|
|
|
|
|
|
|
//! store renderer info to XML element
|
2017-05-12 17:31:01 +08:00
|
|
|
virtual QDomElement save( QDomDocument& doc, const QgsReadWriteContext &context );
|
2012-09-24 02:28:15 +02:00
|
|
|
|
|
|
|
//! return a list of symbology items for the legend
|
|
|
|
virtual QgsLegendSymbologyList legendSymbologyItems( QSize iconSize );
|
|
|
|
|
|
|
|
//! return a list of item text / symbol
|
2014-01-26 18:35:21 +01:00
|
|
|
//! @note not available in python bindings
|
2017-05-01 18:13:15 +02:00
|
|
|
// virtual QgsLegendSymbolList legendSymbolItems( double scaleDenominator = -1, const QString &rule = QString() );
|
2014-01-14 17:23:16 +01:00
|
|
|
|
2014-09-01 11:05:51 +07:00
|
|
|
//! Return a list of symbology items for the legend. Better choice than legendSymbolItems().
|
|
|
|
//! @note added in 2.6
|
|
|
|
virtual QgsLegendSymbolListV2 legendSymbolItemsV2() const;
|
|
|
|
|
2017-05-01 18:13:15 +02:00
|
|
|
virtual QSet< QString > legendKeysForFeature( QgsFeature &feature, QgsRenderContext &context );
|
2016-01-25 13:05:36 +11:00
|
|
|
|
2017-05-01 18:13:15 +02:00
|
|
|
virtual void setLegendSymbolItem( const QString &key, QgsSymbol *symbol /Transfer/ );
|
2016-03-01 15:30:23 +11:00
|
|
|
|
2016-08-06 11:01:42 +02:00
|
|
|
//! creates a QgsSingleSymbolRenderer from an existing renderer.
|
2014-08-24 08:31:36 +08:00
|
|
|
//! @note added in 2.5
|
2014-08-30 10:16:23 -06:00
|
|
|
//! @returns a new renderer if the conversion was possible, otherwise 0.
|
2017-05-01 18:13:15 +02:00
|
|
|
static QgsSingleSymbolRenderer *convertFromRenderer( const QgsFeatureRenderer *renderer ) /Factory/;
|
2014-08-24 08:31:36 +08:00
|
|
|
|
2014-01-14 17:23:16 +01:00
|
|
|
private:
|
2016-08-06 11:01:42 +02:00
|
|
|
QgsSingleSymbolRenderer( const QgsSingleSymbolRenderer & );
|
2017-05-03 07:45:22 +02:00
|
|
|
QgsSingleSymbolRenderer &operator=( const QgsSingleSymbolRenderer & );
|
2012-09-24 02:28:15 +02:00
|
|
|
};
|