19 #include "qgis_core.h"
25 #include "qgsconfig.h"
32 #include <QDomDocument>
33 #include <QDomElement>
50 #define RENDERER_TAG_NAME "renderer-v2"
107 const QString type = sipCpp->type();
109 if ( type == QLatin1String(
"singleSymbol" ) )
110 sipType = sipType_QgsSingleSymbolRenderer;
111 else if ( type == QLatin1String(
"categorizedSymbol" ) )
112 sipType = sipType_QgsCategorizedSymbolRenderer;
113 else if ( type == QLatin1String(
"graduatedSymbol" ) )
114 sipType = sipType_QgsGraduatedSymbolRenderer;
115 else if ( type == QLatin1String(
"RuleRenderer" ) )
116 sipType = sipType_QgsRuleBasedRenderer;
117 else if ( type == QLatin1String(
"heatmapRenderer" ) )
118 sipType = sipType_QgsHeatmapRenderer;
119 else if ( type == QLatin1String(
"invertedPolygonRenderer" ) )
120 sipType = sipType_QgsInvertedPolygonRenderer;
121 else if ( type == QLatin1String(
"pointCluster" ) )
122 sipType = sipType_QgsPointClusterRenderer;
123 else if ( type == QLatin1String(
"pointDisplacement" ) )
124 sipType = sipType_QgsPointDisplacementRenderer;
125 else if ( type == QLatin1String(
"25dRenderer" ) )
126 sipType = sipType_Qgs25DRenderer;
127 else if ( type == QLatin1String(
"nullSymbol" ) )
128 sipType = sipType_QgsNullSymbolRenderer;
129 else if ( type == QLatin1String(
"embeddedSymbol" ) )
130 sipType = sipType_QgsEmbeddedSymbolRenderer;
142 QString
type()
const {
return mType; }
214 virtual QSet<QString> usedAttributes(
const QgsRenderContext &context )
const = 0;
222 virtual bool usesEmbeddedSymbols()
const;
227 virtual bool filterNeedsGeometry()
const;
255 virtual QString dump() const;
264 MoreSymbolsPerFeature = 1 << 2,
266 ScaleDependent = 1 << 4
269 Q_DECLARE_FLAGS( Capabilities, Capability )
283 virtual
QgsFeatureRenderer::Capabilities capabilities() {
return QgsFeatureRenderer::Capabilities(); }
310 virtual QDomElement writeSld( QDomDocument &doc,
const QString &styleName,
const QVariantMap &props = QVariantMap() )
const;
326 virtual void toSld( QDomDocument &doc, QDomElement &element,
const QVariantMap &props = QVariantMap() )
const
328 element.appendChild( doc.createComment( QStringLiteral(
"FeatureRenderer %1 not implemented yet" ).arg( type() ) ) );
336 virtual bool legendSymbolItemsCheckable()
const;
342 virtual bool legendSymbolItemChecked(
const QString &key );
348 virtual void checkLegendSymbolItem(
const QString &key,
bool state =
true );
370 virtual QString legendKeyToExpression(
const QString &key,
QgsVectorLayer *layer,
bool &ok
SIP_OUT )
const;
506 bool orderByEnabled()
const;
515 void setOrderByEnabled(
bool enabled );
575 void renderVertexMarkerPolyline( QPolygonF &pts,
QgsRenderContext &context );
577 void renderVertexMarkerPolygon( QPolygonF &pts, QList<QPolygonF> *rings,
QgsRenderContext &context );
593 void saveRendererData( QDomDocument &doc, QDomElement &element,
const QgsReadWriteContext &context );
597 bool mUsingSymbolLevels =
false;
603 double mCurrentVertexMarkerSize = 2;
607 bool mForceRaster =
false;
609 double mReferenceScale = -1.0;
621 static void convertSymbolRotation(
QgsSymbol *symbol,
const QString &
field );
625 bool mOrderByEnabled =
false;
634 QThread *mThread =
nullptr;
647 #endif // QGSRENDERER_H