19 #include "qgis_core.h"
32 #include <QDomDocument>
33 #include <QDomElement>
49 #define RENDERER_TAG_NAME "renderer-v2"
106 const QString type = sipCpp->type();
108 if ( type == QLatin1String(
"singleSymbol" ) )
109 sipType = sipType_QgsSingleSymbolRenderer;
110 else if ( type == QLatin1String(
"categorizedSymbol" ) )
111 sipType = sipType_QgsCategorizedSymbolRenderer;
112 else if ( type == QLatin1String(
"graduatedSymbol" ) )
113 sipType = sipType_QgsGraduatedSymbolRenderer;
114 else if ( type == QLatin1String(
"RuleRenderer" ) )
115 sipType = sipType_QgsRuleBasedRenderer;
116 else if ( type == QLatin1String(
"heatmapRenderer" ) )
117 sipType = sipType_QgsHeatmapRenderer;
118 else if ( type == QLatin1String(
"invertedPolygonRenderer" ) )
119 sipType = sipType_QgsInvertedPolygonRenderer;
120 else if ( type == QLatin1String(
"pointCluster" ) )
121 sipType = sipType_QgsPointClusterRenderer;
122 else if ( type == QLatin1String(
"pointDisplacement" ) )
123 sipType = sipType_QgsPointDisplacementRenderer;
124 else if ( type == QLatin1String(
"25dRenderer" ) )
125 sipType = sipType_Qgs25DRenderer;
126 else if ( type == QLatin1String(
"nullSymbol" ) )
127 sipType = sipType_QgsNullSymbolRenderer;
128 else if ( type == QLatin1String(
"embeddedSymbol" ) )
129 sipType = sipType_QgsEmbeddedSymbolRenderer;
141 QString
type()
const {
return mType; }
221 virtual bool usesEmbeddedSymbols()
const;
226 virtual bool filterNeedsGeometry()
const;
254 virtual QString dump() const;
263 MoreSymbolsPerFeature = 1 << 2,
265 ScaleDependent = 1 << 4
268 Q_DECLARE_FLAGS( Capabilities, Capability )
282 virtual
QgsFeatureRenderer::Capabilities capabilities() {
return QgsFeatureRenderer::Capabilities(); }
304 virtual QDomElement writeSld( QDomDocument &doc,
const QString &styleName,
const QVariantMap &props = QVariantMap() )
const;
320 virtual void toSld( QDomDocument &doc, QDomElement &element,
const QVariantMap &props = QVariantMap() )
const
322 element.appendChild( doc.createComment( QStringLiteral(
"FeatureRenderer %1 not implemented yet" ).arg( type() ) ) );
330 virtual bool legendSymbolItemsCheckable()
const;
336 virtual bool legendSymbolItemChecked(
const QString &key );
342 virtual void checkLegendSymbolItem(
const QString &key,
bool state =
true );
365 void setVertexMarkerAppearance(
int type,
double size );
454 bool orderByEnabled()
const;
463 void setOrderByEnabled(
bool enabled );
507 void renderVertexMarkerPolyline( QPolygonF &pts,
QgsRenderContext &context );
509 void renderVertexMarkerPolygon( QPolygonF &pts, QList<QPolygonF> *rings,
QgsRenderContext &context );
530 bool mUsingSymbolLevels =
false;
535 double mCurrentVertexMarkerSize = 2;
539 bool mForceRaster =
false;
551 static void convertSymbolRotation(
QgsSymbol *symbol,
const QString &
field );
555 bool mOrderByEnabled =
false;
565 QThread *mThread =
nullptr;
ScaleMethod
Scale methods.
Custom exception class for Coordinate Reference System related exceptions.
virtual QgsFeatureRenderer * clone() const =0
Create a deep copy of this renderer.
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.
virtual QgsSymbol * symbolForFeature(const QgsFeature &feature, QgsRenderContext &context) const =0
To be overridden.
bool usingSymbolLevels() const
void setUsingSymbolLevels(bool usingSymbolLevels)
Capability
Used to specify details about a renderer.
virtual QSet< QString > usedAttributes(const QgsRenderContext &context) const =0
Returns a list of attributes required by this renderer.
int mCurrentVertexMarkerType
The current type of editing marker.
QgsFeatureRequest::OrderBy mOrderBy
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.
GeometryType
The geometry types are used to group QgsWkbTypes::Type in a coarse way.
QMap< QString, QString > QgsStringMap
#define SIP_CONVERT_TO_SUBCLASS_CODE(code)
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