16 #ifndef QGSRENDERERV2_H 17 #define QGSRENDERERV2_H 19 #include "qgis_core.h" 33 #include <QDomDocument> 34 #include <QDomElement> 49 #define RENDERER_TAG_NAME "renderer-v2" 95 if ( sipCpp->type() ==
"singleSymbol" )
96 sipType = sipType_QgsSingleSymbolRenderer;
97 else if ( sipCpp->type() ==
"categorizedSymbol" )
98 sipType = sipType_QgsCategorizedSymbolRenderer;
99 else if ( sipCpp->type() ==
"graduatedSymbol" )
100 sipType = sipType_QgsGraduatedSymbolRenderer;
101 else if ( sipCpp->type() ==
"RuleRenderer" )
102 sipType = sipType_QgsRuleBasedRenderer;
103 else if ( sipCpp->type() ==
"heatmapRenderer" )
104 sipType = sipType_QgsHeatmapRenderer;
105 else if ( sipCpp->type() ==
"invertedPolygonRenderer" )
106 sipType = sipType_QgsInvertedPolygonRenderer;
107 else if ( sipCpp->type() ==
"pointCluster" )
108 sipType = sipType_QgsPointClusterRenderer;
109 else if ( sipCpp->type() ==
"pointDisplacement" )
110 sipType = sipType_QgsPointDisplacementRenderer;
111 else if ( sipCpp->type() ==
"25dRenderer" )
112 sipType = sipType_Qgs25DRenderer;
113 else if ( sipCpp->type() ==
"nullSymbol" )
114 sipType = sipType_QgsNullSymbolRenderer;
126 QString
type()
const {
return mType; }
198 virtual QSet<QString> usedAttributes(
const QgsRenderContext &context )
const = 0;
203 virtual bool filterNeedsGeometry()
const;
228 virtual bool renderFeature(
QgsFeature &feature,
QgsRenderContext &context,
int layer = -1,
bool selected =
false,
bool drawVertexMarker =
false );
231 virtual QString dump()
const;
240 MoreSymbolsPerFeature = 1 << 2,
242 ScaleDependent = 1 << 4
281 virtual QDomElement writeSld( QDomDocument &doc,
const QString &styleName,
const QgsStringMap &props =
QgsStringMap() )
const;
299 element.appendChild( doc.createComment( QStringLiteral(
"FeatureRendererV2 %1 not implemented yet" ).arg( type() ) ) );
307 virtual bool legendSymbolItemsCheckable()
const;
313 virtual bool legendSymbolItemChecked(
const QString &key );
319 virtual void checkLegendSymbolItem(
const QString &key,
bool state =
true );
342 void setVertexMarkerAppearance(
int type,
int size );
431 bool orderByEnabled()
const;
440 void setOrderByEnabled(
bool enabled );
462 void renderFeatureWithSymbol(
QgsFeature &feature,
467 bool drawVertexMarker );
472 void renderVertexMarkerPolyline( QPolygonF &pts,
QgsRenderContext &context );
474 void renderVertexMarkerPolygon( QPolygonF &pts, QList<QPolygonF> *rings,
QgsRenderContext &context );
515 static void convertSymbolRotation(
QgsSymbol *symbol,
const QString &field );
528 QThread *mThread =
nullptr;
535 Q_DECLARE_OPERATORS_FOR_FLAGS( QgsFeatureRenderer::Capabilities )
541 #endif // QGSRENDERERV2_H The class is used as a container of context for various read/write operations on other objects...
QMap< QString, QString > QgsStringMap
A rectangle specified with double values.
QList< QgsLegendSymbolItem > QgsLegendSymbolList
QgsFeatureRequest::OrderBy mOrderBy
virtual QString legendClassificationAttribute() const
If supported by the renderer, return classification attribute for the use in legend.
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
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.
Base class for visual effects which can be applied to QPicture drawings.
Container of fields for a vector layer.
void setUsingSymbolLevels(bool usingSymbolLevels)
The feature class encapsulates a single feature including its id, geometry and a list of field/values...
QMap< QString, QString > QgsStringMap
QList< QgsSymbolLevel > QgsSymbolLevelOrder
QList< QgsSymbol * > QgsSymbolList
void setForceRasterRender(bool forceRaster)
Sets whether the renderer should be rendered to a raster destination.
QgsSymbolLevelItem(QgsSymbol *symbol, int layer)
Capability
Used to specify details about a renderer.
Point geometry type, with support for z-dimension and m-values.
virtual void setEmbeddedRenderer(QgsFeatureRenderer *subRenderer)
Sets an embedded renderer (subrenderer) for this feature renderer.
GeometryType
The geometry types are used to group QgsWkbTypes::Type in a coarse way.
virtual QgsSymbolList symbols(QgsRenderContext &context)
Returns list of symbols used by the renderer.
virtual const QgsFeatureRenderer * embeddedRenderer() const
Returns the current embedded renderer (subrenderer) for this feature renderer.
Contains information about the context of a rendering operation.
bool usingSymbolLevels() const
QList< QgsSymbolLevelItem > QgsSymbolLevel
int mCurrentVertexMarkerSize
The current size of editing marker.
#define SIP_CONVERT_TO_SUBCLASS_CODE(code)
QMap< QString, QgsSymbol *> QgsSymbolMap
virtual void modifyRequestExtent(QgsRectangle &extent, QgsRenderContext &context)
Allows for a renderer to modify the extent of a feature request prior to rendering.
int mCurrentVertexMarkerType
The current type of editing marker.
Represents a vector layer which manages a vector based data sets.
Represents a list of OrderByClauses, with the most important first and the least important last...