32#include <QDomDocument>
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; }
203 virtual bool canSkipRender();
232 virtual bool usesEmbeddedSymbols()
const;
237 virtual bool filterNeedsGeometry()
const;
265 virtual QString dump() const;
274 MoreSymbolsPerFeature = 1 << 2,
276 ScaleDependent = 1 << 4
279 Q_DECLARE_FLAGS( Capabilities, Capability )
293 virtual
QgsFeatureRenderer::Capabilities capabilities() {
return QgsFeatureRenderer::Capabilities(); }
320 virtual QDomElement writeSld( QDomDocument &doc,
const QString &styleName,
const QVariantMap &props = QVariantMap() )
const;
336 virtual void toSld( QDomDocument &doc, QDomElement &element,
const QVariantMap &props = QVariantMap() )
const
338 element.appendChild( doc.createComment( QStringLiteral(
"FeatureRenderer %1 not implemented yet" ).arg( type() ) ) );
349 QSet< QString > legendKeys()
const;
356 virtual bool legendSymbolItemsCheckable()
const;
366 virtual bool legendSymbolItemChecked(
const QString &key );
376 virtual void checkLegendSymbolItem(
const QString &key,
bool state =
true );
403 virtual QString legendKeyToExpression(
const QString &key,
QgsVectorLayer *layer,
bool &ok
SIP_OUT )
const;
542 bool orderByEnabled()
const;
551 void setOrderByEnabled(
bool enabled );
611 void renderVertexMarkerPolyline( QPolygonF &pts,
QgsRenderContext &context );
613 void renderVertexMarkerPolygon( QPolygonF &pts, QList<QPolygonF> *rings,
QgsRenderContext &context );
629 void saveRendererData( QDomDocument &doc, QDomElement &element,
const QgsReadWriteContext &context );
633 bool mUsingSymbolLevels =
false;
639 double mCurrentVertexMarkerSize = 2;
643 bool mForceRaster =
false;
645 double mReferenceScale = -1.0;
657 static void convertSymbolRotation(
QgsSymbol *symbol,
const QString &
field );
661 bool mOrderByEnabled =
false;
671 QThread *mThread =
nullptr;
ScaleMethod
Scale methods.
GeometryType
The geometry types are used to group Qgis::WkbType in a coarse way.
VertexMarkerType
Editing vertex markers, used for showing vertices during a edit operation.
Custom exception class for Coordinate Reference System related exceptions.
virtual QString filter(const QgsFields &fields=QgsFields())
If a renderer does not require all the features this method may be overridden and return an expressio...
bool forceRasterRender() const
Returns whether the renderer must render as a raster.
void setForceRasterRender(bool forceRaster)
Sets whether the renderer should be rendered to a raster destination.
virtual void toSld(QDomDocument &doc, QDomElement &element, const QVariantMap &props=QVariantMap()) const
used from subclasses to create SLD Rule elements following SLD v1.1 specs
virtual QString legendClassificationAttribute() const
If supported by the renderer, return classification attribute for the use in legend.
double referenceScale() const
Returns the symbology reference scale.
void setReferenceScale(double scale)
Sets the symbology reference scale.
bool usingSymbolLevels() const
virtual QSet< QString > usedAttributes(const QgsRenderContext &context) const =0
Returns a list of attributes required by this renderer.
void setUsingSymbolLevels(bool usingSymbolLevels)
virtual QgsSymbol * symbolForFeature(const QgsFeature &feature, QgsRenderContext &context) const =0
To be overridden.
Capability
Used to specify details about a renderer.
QgsFeatureRequest::OrderBy mOrderBy
virtual QgsFeatureRenderer * clone() const =0
Create a deep copy of this renderer.
Represents a list of OrderByClauses, with the most important first and the least important last.
The feature class encapsulates a single feature including its unique ID, geometry and a list of field...
Container of fields for a vector layer.
Base class for visual effects which can be applied to QPicture drawings.
Point geometry type, with support for z-dimension and m-values.
The class is used as a container of context for various read/write operations on other objects.
A rectangle specified with double values.
Contains information about the context of a rendering operation.
An interface for classes which can visit style entity (e.g.
QgsSymbolLevelItem(QgsSymbol *symbol, int layer)
Abstract base class for all rendered symbols.
Represents a vector layer which manages a vector based data sets.
QMap< QString, QString > QgsStringMap
#define SIP_CONVERT_TO_SUBCLASS_CODE(code)
#define SIP_THROW(name,...)
Q_DECLARE_OPERATORS_FOR_FLAGS(QgsField::ConfigurationFlags) CORE_EXPORT QDataStream &operator<<(QDataStream &out
Writes the field to stream out. QGIS version compatibility is not guaranteed.
QList< QgsLegendSymbolItem > QgsLegendSymbolList
QList< QgsSymbolLevel > QgsSymbolLevelOrder
QList< QgsSymbolLevelItem > QgsSymbolLevel
QMap< QString, QgsSymbol * > QgsSymbolMap
QList< QgsSymbol * > QgsSymbolList