33#include <QDomDocument>
53#define RENDERER_TAG_NAME "renderer-v2"
110 const QString type = sipCpp->
type();
112 if ( type == QLatin1String(
"singleSymbol" ) )
113 sipType = sipType_QgsSingleSymbolRenderer;
114 else if ( type == QLatin1String(
"categorizedSymbol" ) )
115 sipType = sipType_QgsCategorizedSymbolRenderer;
116 else if ( type == QLatin1String(
"graduatedSymbol" ) )
117 sipType = sipType_QgsGraduatedSymbolRenderer;
118 else if ( type == QLatin1String(
"RuleRenderer" ) )
119 sipType = sipType_QgsRuleBasedRenderer;
120 else if ( type == QLatin1String(
"heatmapRenderer" ) )
121 sipType = sipType_QgsHeatmapRenderer;
122 else if ( type == QLatin1String(
"invertedPolygonRenderer" ) )
123 sipType = sipType_QgsInvertedPolygonRenderer;
124 else if ( type == QLatin1String(
"pointCluster" ) )
125 sipType = sipType_QgsPointClusterRenderer;
126 else if ( type == QLatin1String(
"pointDisplacement" ) )
127 sipType = sipType_QgsPointDisplacementRenderer;
128 else if ( type == QLatin1String(
"25dRenderer" ) )
129 sipType = sipType_Qgs25DRenderer;
130 else if ( type == QLatin1String(
"nullSymbol" ) )
131 sipType = sipType_QgsNullSymbolRenderer;
132 else if ( type == QLatin1String(
"embeddedSymbol" ) )
133 sipType = sipType_QgsEmbeddedSymbolRenderer;
163 QString
type()
const {
return mType; }
221 virtual bool canSkipRender();
250 virtual bool usesEmbeddedSymbols()
const;
255 virtual bool filterNeedsGeometry()
const;
283 virtual QString dump() const;
292 MoreSymbolsPerFeature = 1 << 2,
294 ScaleDependent = 1 << 4
336 virtual QDomElement writeSld( QDomDocument &doc,
const QString &styleName,
const QVariantMap &props = QVariantMap() )
const;
352 virtual void toSld( QDomDocument &doc, QDomElement &element,
const QVariantMap &props = QVariantMap() )
const
354 element.appendChild( doc.createComment( QStringLiteral(
"FeatureRenderer %1 not implemented yet" ).arg( type() ) ) );
365 QSet< QString > legendKeys()
const;
371 virtual bool legendSymbolItemsCheckable()
const;
380 virtual bool legendSymbolItemChecked(
const QString &key );
389 virtual void checkLegendSymbolItem(
const QString &key,
bool state =
true );
415 virtual QString legendKeyToExpression(
const QString &key,
QgsVectorLayer *layer,
bool &ok
SIP_OUT )
const;
512 void setDataDefinedProperty( Property key,
const QgsProperty &property );
595 bool orderByEnabled()
const;
603 void setOrderByEnabled(
bool enabled );
662 void renderVertexMarkerPolyline( QPolygonF &pts,
QgsRenderContext &context );
664 void renderVertexMarkerPolygon( QPolygonF &pts, QList<QPolygonF> *rings,
QgsRenderContext &context );
680 void saveRendererData( QDomDocument &doc, QDomElement &element,
const QgsReadWriteContext &context );
684 bool mUsingSymbolLevels =
false;
690 double mCurrentVertexMarkerSize = 2;
694 bool mForceRaster =
false;
696 double mReferenceScale = -1.0;
708 static void convertSymbolRotation(
QgsSymbol *symbol,
const QString &field );
712 bool mOrderByEnabled =
false;
720 static void initPropertyDefinitions();
726 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.
QgsPropertyCollection & dataDefinedProperties()
Returns a reference to the renderer's property collection, used for data defined overrides.
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.
Property
Data definable properties for renderers.
QFlags< Capability > Capabilities
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.
const QgsPropertyCollection & dataDefinedProperties() const
Returns a reference to the renderer's property collection, used for data defined overrides.
QgsFeatureRequest::OrderBy mOrderBy
void setDataDefinedProperties(const QgsPropertyCollection &collection)
Sets the renderer's property collection, used for data defined overrides.
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.
Layer tree node points to a map layer.
The QgsLegendRendererItem class is abstract interface for legend items returned from QgsMapLayerLegen...
Base class for visual effects which can be applied to QPicture drawings.
Point geometry type, with support for z-dimension and m-values.
A grouped map of multiple QgsProperty objects, each referenced by a integer key value.
A store for object properties.
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_ENUM_BASETYPE(type)
#define SIP_THROW(name,...)
QList< QgsLegendSymbolItem > QgsLegendSymbolList
QMap< int, QgsPropertyDefinition > QgsPropertiesDefinition
Definition of available properties.
QList< QgsSymbolLevel > QgsSymbolLevelOrder
QList< QgsSymbolLevelItem > QgsSymbolLevel
QMap< QString, QgsSymbol * > QgsSymbolMap
QList< QgsSymbol * > QgsSymbolList
Q_DECLARE_OPERATORS_FOR_FLAGS(QgsTextRendererUtils::CurvedTextFlags)