29#include <QDomDocument>
55#define RENDERER_TAG_NAME "renderer-v2"
114 const QString
type = sipCpp->type();
116 if (
type == QLatin1String(
"singleSymbol" ) )
117 sipType = sipType_QgsSingleSymbolRenderer;
118 else if (
type == QLatin1String(
"categorizedSymbol" ) )
119 sipType = sipType_QgsCategorizedSymbolRenderer;
120 else if (
type == QLatin1String(
"graduatedSymbol" ) )
121 sipType = sipType_QgsGraduatedSymbolRenderer;
122 else if (
type == QLatin1String(
"RuleRenderer" ) )
123 sipType = sipType_QgsRuleBasedRenderer;
124 else if (
type == QLatin1String(
"heatmapRenderer" ) )
125 sipType = sipType_QgsHeatmapRenderer;
126 else if (
type == QLatin1String(
"invertedPolygonRenderer" ) )
127 sipType = sipType_QgsInvertedPolygonRenderer;
128 else if (
type == QLatin1String(
"pointCluster" ) )
129 sipType = sipType_QgsPointClusterRenderer;
130 else if (
type == QLatin1String(
"pointDisplacement" ) )
131 sipType = sipType_QgsPointDisplacementRenderer;
132 else if (
type == QLatin1String(
"25dRenderer" ) )
133 sipType = sipType_Qgs25DRenderer;
134 else if (
type == QLatin1String(
"nullSymbol" ) )
135 sipType = sipType_QgsNullSymbolRenderer;
136 else if (
type == QLatin1String(
"embeddedSymbol" ) )
137 sipType = sipType_QgsEmbeddedSymbolRenderer;
287 virtual QString
dump() const;
347 virtual QDomElement writeSld( QDomDocument &doc,
const QString &styleName,
const QVariantMap &props = QVariantMap() )
const;
367 Q_DECL_DEPRECATED
virtual void toSld( QDomDocument &doc, QDomElement &element,
const QVariantMap &props = QVariantMap() ) const
SIP_DEPRECATED;
376 virtual
bool toSld( QDomDocument &doc, QDomElement &element,
QgsSldExportContext &context ) const;
385 QSet< QString > legendKeys() const;
391 virtual
bool legendSymbolItemsCheckable() const;
400 virtual
bool legendSymbolItemChecked( const QString &key );
409 virtual
void checkLegendSymbolItem( const QString &key,
bool state = true );
435 virtual QString legendKeyToExpression( const QString &key,
QgsVectorLayer *layer,
bool &ok
SIP_OUT ) const;
532 void setDataDefinedProperty( Property key,
const QgsProperty &property );
615 bool orderByEnabled()
const;
623 void setOrderByEnabled(
bool enabled );
690 void renderVertexMarkerPolyline( QPolygonF &pts,
QgsRenderContext &context );
692 void renderVertexMarkerPolygon( QPolygonF &pts, QList<QPolygonF> *rings,
QgsRenderContext &context );
708 void saveRendererData( QDomDocument &doc, QDomElement &element,
const QgsReadWriteContext &context );
746 static void initPropertyDefinitions();
752 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