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

89 lines
3.1 KiB
Plaintext
Raw Normal View History

/***************************************************************************
qgsgeometrygeneratorsymbollayerv2.sip
---------------------
begin : November 2015
copyright : (C) 2015 by Matthias Kuhn
email : matthias at opengis dot ch
***************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
***************************************************************************/
2016-08-06 11:01:42 +02:00
class QgsGeometryGeneratorSymbolLayer : QgsSymbolLayer
{
%TypeHeaderCode
#include "qgsgeometrygeneratorsymbollayerv2.h"
%End
public:
2016-08-05 08:08:39 +02:00
static QgsSymbolLayer* create( const QgsStringMap& properties = QgsStringMap() );
QString layerType() const;
/**
* Set the type of symbol which should be created.
* Should match with the return type of the expression.
*
* @param symbolType The symbol type which shall be used below this symbol.
*/
2016-08-05 08:09:43 +02:00
void setSymbolType( QgsSymbol::SymbolType symbolType );
2016-02-14 03:50:23 +01:00
/**
* Access the symbol type. This defines the type of geometry
* that is created by this generator.
*
* @return Symbol type
*/
2016-08-05 08:09:43 +02:00
QgsSymbol::SymbolType symbolType() const;
2016-08-05 08:09:43 +02:00
void startRender( QgsSymbolRenderContext& context );
2016-08-05 08:09:43 +02:00
void stopRender( QgsSymbolRenderContext& context );
2016-08-05 08:08:39 +02:00
QgsSymbolLayer* clone() const;
QgsStringMap properties() const;
2016-08-05 08:09:43 +02:00
void drawPreviewIcon( QgsSymbolRenderContext& context, QSize size );
2016-02-14 03:50:23 +01:00
/**
* Set the expression to generate this geometry.
*/
void setGeometryExpression( const QString& exp );
/**
* Get the expression to generate this geometry.
*/
QString geometryExpression() const;
2016-08-05 08:09:43 +02:00
virtual QgsSymbol* subSymbol();
2016-08-05 08:09:43 +02:00
virtual bool setSubSymbol( QgsSymbol* symbol );
virtual QSet<QString> usedAttributes() const;
//! Will always return true.
//! This is a hybrid layer, it constructs its own geometry so it does not
//! care about the geometry of its parents.
2016-08-05 08:09:43 +02:00
bool isCompatibleWithSymbol( QgsSymbol* symbol );
2016-02-14 03:50:23 +01:00
/**
* Will render this symbol layer using the context.
* In comparison to other symbols there is no geometry passed in, since
* the geometry will be created based on information from the context
* which contains a QgsRenderContext which in turn contains an expression
* context which is available to the evaluated expression.
*
* @param context The rendering context which will be used to render and to
* construct a geometry.
*/
2016-08-05 08:09:43 +02:00
virtual void render( QgsSymbolRenderContext& context );
2016-02-14 03:50:23 +01:00
void setColor( const QColor& color );
private:
2016-08-06 11:01:42 +02:00
QgsGeometryGeneratorSymbolLayer( const QgsGeometryGeneratorSymbolLayer& copy );
};