29#include <QDomDocument>
37using namespace Qt::StringLiterals;
57#define RENDERER_TAG_NAME "renderer-v2"
115 const QString
type = sipCpp->type();
117 if (
type ==
"singleSymbol"_L1 )
118 sipType = sipType_QgsSingleSymbolRenderer;
119 else if (
type ==
"categorizedSymbol"_L1 )
120 sipType = sipType_QgsCategorizedSymbolRenderer;
121 else if (
type ==
"graduatedSymbol"_L1 )
122 sipType = sipType_QgsGraduatedSymbolRenderer;
123 else if (
type ==
"RuleRenderer"_L1 )
124 sipType = sipType_QgsRuleBasedRenderer;
125 else if (
type ==
"heatmapRenderer"_L1 )
126 sipType = sipType_QgsHeatmapRenderer;
127 else if (
type ==
"invertedPolygonRenderer"_L1 )
128 sipType = sipType_QgsInvertedPolygonRenderer;
129 else if (
type ==
"pointCluster"_L1 )
130 sipType = sipType_QgsPointClusterRenderer;
131 else if (
type ==
"pointDisplacement"_L1 )
132 sipType = sipType_QgsPointDisplacementRenderer;
133 else if (
type ==
"25dRenderer"_L1 )
134 sipType = sipType_Qgs25DRenderer;
135 else if (
type ==
"nullSymbol"_L1 )
136 sipType = sipType_QgsNullSymbolRenderer;
137 else if (
type ==
"embeddedSymbol"_L1 )
138 sipType = sipType_QgsEmbeddedSymbolRenderer;
292 virtual QString
dump() const;
352 virtual QDomElement writeSld( QDomDocument &doc,
const QString &styleName,
const QVariantMap &props = QVariantMap() )
const;
372 Q_DECL_DEPRECATED
virtual void toSld( QDomDocument &doc, QDomElement &element,
const QVariantMap &props = QVariantMap() ) const
SIP_DEPRECATED;
381 virtual
bool toSld( QDomDocument &doc, QDomElement &element,
QgsSldExportContext &context ) const;
390 QSet< QString > legendKeys() const;
396 virtual
bool legendSymbolItemsCheckable() const;
405 virtual
bool legendSymbolItemChecked( const QString &key );
414 virtual
void checkLegendSymbolItem( const QString &key,
bool state = true );
440 virtual QString legendKeyToExpression( const QString &key,
QgsVectorLayer *layer,
bool &ok
SIP_OUT ) const;
537 void setDataDefinedProperty( Property key,
const QgsProperty &property );
620 bool orderByEnabled()
const;
628 void setOrderByEnabled(
bool enabled );
695 void renderVertexMarkerPolyline( QPolygonF &pts,
QgsRenderContext &context );
697 void renderVertexMarkerPolygon( QPolygonF &pts, QList<QPolygonF> *rings,
QgsRenderContext &context );
713 void saveRendererData( QDomDocument &doc, QDomElement &element,
const QgsReadWriteContext &context );
751 static void initPropertyDefinitions();
757 QThread *mThread =
nullptr;
ScaleMethod
Scale methods.
QFlags< FeatureRendererFlag > FeatureRendererFlags
Flags controlling behavior of vector feature renderers.
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.
Abstract base class for all 2D vector feature renderers.
virtual bool canSkipRender()
Returns true if the renderer can be entirely skipped, i.e.
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.
QgsFeatureRenderer(const QString &type)
void setForceRasterRender(bool forceRaster)
Sets whether the renderer should be rendered to a raster destination.
virtual void stopRender(QgsRenderContext &context)
Must be called when a render cycle has finished, to allow the renderer to clean up.
Property
Data definable properties for renderers.
QFlags< Capability > Capabilities
virtual QString legendClassificationAttribute() const
If supported by the renderer, return classification attribute for the use in legend.
virtual QSet< QString > legendKeysForFeature(const QgsFeature &feature, QgsRenderContext &context) const
Returns legend keys matching a specified feature.
virtual bool usesEmbeddedSymbols() const
Returns true if the renderer uses embedded symbols for features.
virtual bool renderFeature(const QgsFeature &feature, QgsRenderContext &context, int layer=-1, bool selected=false, bool drawVertexMarker=false)
Render a feature using this renderer in the given context.
double referenceScale() const
Returns the symbology reference scale.
void setReferenceScale(double scale)
Sets the symbology reference scale.
bool usingSymbolLevels() const
virtual QString dump() const
Returns debug information about this renderer.
virtual QgsFeatureRenderer::Capabilities capabilities()
Returns details about internals of this renderer.
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.
@ MoreSymbolsPerFeature
May use more than one symbol to render a feature: symbolsForFeature() will return them.
@ ScaleDependent
Depends on scale if feature will be rendered (rule based ).
@ SymbolLevels
Rendering with symbol levels (i.e. implements symbols(), symbolForFeature()).
@ Filter
Features may be filtered, i.e. some features may not be rendered (categorized, rule based ....
const QgsPropertyCollection & dataDefinedProperties() const
Returns a reference to the renderer's property collection, used for data defined overrides.
virtual bool filterNeedsGeometry() const
Returns true if this renderer requires the geometry to apply the filter.
static void convertSymbolRotation(QgsSymbol *symbol, const QString &field)
Converts old rotation expressions to symbol level data defined angles.
QgsFeatureRequest::OrderBy mOrderBy
virtual QgsSymbol * originalSymbolForFeature(const QgsFeature &feature, QgsRenderContext &context) const
Returns symbol for feature.
Qgis::VertexMarkerType mCurrentVertexMarkerType
The current type of editing marker.
void setDataDefinedProperties(const QgsPropertyCollection &collection)
Sets the renderer's property collection, used for data defined overrides.
double mCurrentVertexMarkerSize
The current size of editing marker.
std::unique_ptr< QgsPaintEffect > mPaintEffect
virtual void startRender(QgsRenderContext &context, const QgsFields &fields)
Must be called when a new render cycle is started.
static void convertSymbolSizeScale(QgsSymbol *symbol, Qgis::ScaleMethod method, const QString &field)
Converts old sizeScale expressions to symbol level data defined sizes.
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.
An abstract interface for legend items returned from QgsMapLayerLegend implementation.
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 an integer key value.
A store for object properties.
A container for the context for various read/write operations on objects.
A rectangle specified with double values.
Contains information about the context of a rendering operation.
Holds SLD export options and other information related to SLD export of a QGIS layer style.
An interface for classes which can visit style entity (e.g.
int layer() const
The layer of this symbol level.
QgsSymbolLevelItem(QgsSymbol *symbol, int layer)
QgsSymbol * symbol() const
The symbol of this symbol level.
Abstract base class for all rendered symbols.
Represents a vector layer which manages a vector based dataset.
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