QGIS API Documentation
3.16.0-Hannover (43b64b13f3)
|
Go to the documentation of this file.
19 #include "qgis_core.h"
34 #include <QDomDocument>
35 #include <QDomElement>
51 #define RENDERER_TAG_NAME "renderer-v2"
108 const QString type = sipCpp->type();
110 if ( type == QLatin1String(
"singleSymbol" ) )
111 sipType = sipType_QgsSingleSymbolRenderer;
112 else if ( type == QLatin1String(
"categorizedSymbol" ) )
113 sipType = sipType_QgsCategorizedSymbolRenderer;
114 else if ( type == QLatin1String(
"graduatedSymbol" ) )
115 sipType = sipType_QgsGraduatedSymbolRenderer;
116 else if ( type == QLatin1String(
"RuleRenderer" ) )
117 sipType = sipType_QgsRuleBasedRenderer;
118 else if ( type == QLatin1String(
"heatmapRenderer" ) )
119 sipType = sipType_QgsHeatmapRenderer;
120 else if ( type == QLatin1String(
"invertedPolygonRenderer" ) )
121 sipType = sipType_QgsInvertedPolygonRenderer;
122 else if ( type == QLatin1String(
"pointCluster" ) )
123 sipType = sipType_QgsPointClusterRenderer;
124 else if ( type == QLatin1String(
"pointDisplacement" ) )
125 sipType = sipType_QgsPointDisplacementRenderer;
126 else if ( type == QLatin1String(
"25dRenderer" ) )
127 sipType = sipType_Qgs25DRenderer;
128 else if ( type == QLatin1String(
"nullSymbol" ) )
129 sipType = sipType_QgsNullSymbolRenderer;
141 QString
type()
const {
return mType; }
218 virtual bool filterNeedsGeometry()
const;
246 virtual QString dump() const;
255 MoreSymbolsPerFeature = 1 << 2,
257 ScaleDependent = 1 << 4
260 Q_DECLARE_FLAGS( Capabilities, Capability )
274 virtual
QgsFeatureRenderer::Capabilities capabilities() {
return QgsFeatureRenderer::Capabilities(); }
296 virtual QDomElement writeSld( QDomDocument &doc,
const QString &styleName,
const QgsStringMap &props =
QgsStringMap() )
const;
314 element.appendChild( doc.createComment( QStringLiteral(
"FeatureRenderer %1 not implemented yet" ).arg( type() ) ) );
322 virtual bool legendSymbolItemsCheckable()
const;
328 virtual bool legendSymbolItemChecked(
const QString &key );
334 virtual void checkLegendSymbolItem(
const QString &key,
bool state =
true );
357 void setVertexMarkerAppearance(
int type,
double size );
446 bool orderByEnabled()
const;
455 void setOrderByEnabled(
bool enabled );
499 void renderVertexMarkerPolyline( QPolygonF &pts,
QgsRenderContext &context );
501 void renderVertexMarkerPolygon( QPolygonF &pts, QList<QPolygonF> *rings,
QgsRenderContext &context );
543 static void convertSymbolRotation(
QgsSymbol *symbol,
const QString &
field );
556 QThread *mThread =
nullptr;
569 #endif // QGSRENDERER_H
double mCurrentVertexMarkerSize
The current size of editing marker.
QList< QgsSymbolLevelItem > QgsSymbolLevel
The class is used as a container of context for various read/write operations on other objects.
Point geometry type, with support for z-dimension and m-values.
QMap< QString, QgsSymbol * > QgsSymbolMap
Container of fields for a vector layer.
Contains information about the context of a rendering operation.
virtual QSet< QString > usedAttributes(const QgsRenderContext &context) const =0
Returns a list of attributes required by this renderer.
An interface for classes which can visit style entity (e.g.
void setForceRasterRender(bool forceRaster)
Sets whether the renderer should be rendered to a raster destination.
Abstract base class for all rendered symbols.
virtual void toSld(QDomDocument &doc, QDomElement &element, const QgsStringMap &props=QgsStringMap()) const
used from subclasses to create SLD Rule elements following SLD v1.1 specs
A rectangle specified with double values.
virtual QString legendClassificationAttribute() const
If supported by the renderer, return classification attribute for the use in legend.
QgsSymbolLevelItem(QgsSymbol *symbol, int layer)
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...
int mCurrentVertexMarkerType
The current type of editing marker.
Capability
Used to specify details about a renderer.
#define SIP_CONVERT_TO_SUBCLASS_CODE(code)
Custom exception class for Coordinate Reference System related exceptions.
void setUsingSymbolLevels(bool usingSymbolLevels)
QList< QgsSymbol * > QgsSymbolList
virtual QgsFeatureRenderer * clone() const =0
Create a deep copy of this renderer.
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.
bool usingSymbolLevels() const
virtual QgsSymbol * symbolForFeature(const QgsFeature &feature, QgsRenderContext &context) const =0
To be overridden.
QgsFeatureRequest::OrderBy mOrderBy
bool forceRasterRender() const
Returns whether the renderer must render as a raster.
QMap< QString, QString > QgsStringMap
GeometryType
The geometry types are used to group QgsWkbTypes::Type in a coarse way.
Represents a list of OrderByClauses, with the most important first and the least important last.
Represents a vector layer which manages a vector based data sets.
Base class for visual effects which can be applied to QPicture drawings.
QList< QgsSymbolLevel > QgsSymbolLevelOrder
The feature class encapsulates a single feature including its id, geometry and a list of field/values...
QMap< QString, QString > QgsStringMap
QList< QgsLegendSymbolItem > QgsLegendSymbolList