16 #ifndef QGSRENDERERV2_H
17 #define QGSRENDERERV2_H
28 #include <QDomDocument>
29 #include <QDomElement>
47 #define RENDERER_TAG_NAME "renderer-v2"
81 QString
type()
const {
return mType; }
104 virtual QList<QString> usedAttributes() = 0;
110 virtual bool renderFeature(
QgsFeature& feature,
QgsRenderContext& context,
int layer = -1,
bool selected =
false,
bool drawVertexMarker =
false );
113 virtual QString dump()
const;
118 RotationField = 1 << 1,
119 MoreSymbolsPerFeature = 1 << 2,
121 ScaleDependent = 1 << 4
137 virtual QDomElement save( QDomDocument& doc );
141 Q_DECL_DEPRECATED
virtual QDomElement writeSld( QDomDocument& doc,
const QgsVectorLayer &layer )
const;
144 virtual QDomElement writeSld( QDomDocument& doc,
const QString& styleName )
const;
159 virtual void toSld( QDomDocument& doc, QDomElement &element )
const
160 { element.appendChild( doc.createComment( QString(
"FeatureRendererV2 %1 not implemented yet" ).arg( type() ) ) ); }
167 virtual bool legendSymbolItemsCheckable()
const;
171 virtual bool legendSymbolItemChecked( QString key );
175 virtual void checkLegendSymbolItem( QString key,
bool state =
true );
179 virtual QgsLegendSymbolList legendSymbolItems(
double scaleDenominator = -1, QString rule =
"" );
191 void setVertexMarkerAppearance(
int type,
int size );
224 void renderFeatureWithSymbol(
QgsFeature& feature,
229 bool drawVertexMarker );
234 void renderVertexMarkerPolyline( QPolygonF& pts,
QgsRenderContext& context );
236 void renderVertexMarkerPolygon( QPolygonF& pts, QList<QPolygonF>* rings,
QgsRenderContext& context );
238 static const unsigned char* _getPoint( QPointF& pt,
QgsRenderContext& context,
const unsigned char* wkb );
239 static const unsigned char* _getLineString( QPolygonF& pts,
QgsRenderContext& context,
const unsigned char* wkb );
240 static const unsigned char* _getPolygon( QPolygonF& pts, QList<QPolygonF>& holes,
QgsRenderContext& context,
const unsigned char* wkb );
242 void setScaleMethodToSymbol(
QgsSymbolV2* symbol,
int scaleMethod );
259 #endif // QGSRENDERERV2_H