2015-12-04 11:33:39 +01:00
|
|
|
/***************************************************************************
|
2015-12-04 13:20:23 +01:00
|
|
|
qgsgeometrygeneratorsymbollayerv2.sip
|
2015-12-04 11:33:39 +01:00
|
|
|
---------------------
|
|
|
|
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. *
|
|
|
|
* *
|
|
|
|
***************************************************************************/
|
2015-12-04 13:20:23 +01:00
|
|
|
class QgsGeometryGeneratorSymbolLayerV2 : QgsSymbolLayerV2
|
2015-12-04 11:33:39 +01:00
|
|
|
{
|
|
|
|
%TypeHeaderCode
|
2015-12-04 13:20:23 +01:00
|
|
|
#include "qgsgeometrygeneratorsymbollayerv2.h"
|
2015-12-04 11:33:39 +01:00
|
|
|
%End
|
|
|
|
public:
|
|
|
|
static QgsSymbolLayerV2* create( const QgsStringMap& properties = QgsStringMap() );
|
|
|
|
|
|
|
|
QString layerType() const;
|
|
|
|
|
2015-12-04 13:20:23 +01:00
|
|
|
/**
|
|
|
|
* 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.
|
|
|
|
*/
|
|
|
|
void setSymbolType( QgsSymbolV2::SymbolType symbolType );
|
|
|
|
|
|
|
|
QgsSymbolV2::SymbolType symbolType() const;
|
|
|
|
|
2015-12-04 11:33:39 +01:00
|
|
|
void startRender( QgsSymbolV2RenderContext& context );
|
|
|
|
|
|
|
|
void stopRender( QgsSymbolV2RenderContext& context );
|
|
|
|
|
|
|
|
QgsSymbolLayerV2* clone() const;
|
|
|
|
|
|
|
|
QgsStringMap properties() const;
|
|
|
|
|
|
|
|
void drawPreviewIcon( QgsSymbolV2RenderContext& context, QSize size );
|
|
|
|
|
|
|
|
void setGeometryExpression( const QString& exp );
|
|
|
|
|
2015-12-04 13:20:23 +01:00
|
|
|
/**
|
|
|
|
* Get the expression to generate this geometry.
|
|
|
|
*/
|
2015-12-04 11:33:39 +01:00
|
|
|
QString geometryExpression() const;
|
|
|
|
|
|
|
|
virtual QgsSymbolV2* subSymbol();
|
|
|
|
|
|
|
|
virtual bool setSubSymbol( QgsSymbolV2* 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.
|
|
|
|
bool isCompatibleWithSymbol( QgsSymbolV2* symbol );
|
|
|
|
|
2015-12-04 13:20:23 +01:00
|
|
|
virtual void render( QgsSymbolV2RenderContext& context );
|
2015-12-04 11:33:39 +01:00
|
|
|
|
|
|
|
private:
|
2015-12-04 13:20:23 +01:00
|
|
|
QgsGeometryGeneratorSymbolLayerV2( const QgsGeometryGeneratorSymbolLayerV2& copy );
|
2015-12-04 11:33:39 +01:00
|
|
|
};
|