16 #ifndef QGSRENDERERV2_H
17 #define QGSRENDERERV2_H
26 #include <QDomDocument>
27 #include <QDomElement>
46 #define RENDERER_TAG_NAME "renderer-v2"
80 QString
type()
const {
return mType; }
103 virtual QList<QString> usedAttributes() = 0;
109 virtual bool renderFeature(
QgsFeature& feature,
QgsRenderContext& context,
int layer = -1,
bool selected =
false,
bool drawVertexMarker =
false );
112 virtual QString dump()
const;
117 RotationField = 1 << 1,
118 MoreSymbolsPerFeature = 1 << 2,
120 ScaleDependent = 1 << 4
136 virtual QDomElement save( QDomDocument& doc );
139 virtual QDomElement writeSld( QDomDocument& doc,
const QgsVectorLayer &layer )
const;
154 virtual void toSld( QDomDocument& doc, QDomElement &element )
const
155 { element.appendChild( doc.createComment( QString(
"FeatureRendererV2 %1 not implemented yet" ).arg( type() ) ) ); }
162 virtual bool legendSymbolItemsCheckable()
const;
166 virtual bool legendSymbolItemChecked( QString key );
170 virtual void checkLegendSymbolItem( QString key,
bool state =
true );
174 virtual QgsLegendSymbolList legendSymbolItems(
double scaleDenominator = -1, QString rule =
"" );
186 void setVertexMarkerAppearance(
int type,
int size );
211 void renderFeatureWithSymbol(
QgsFeature& feature,
216 bool drawVertexMarker );
221 void renderVertexMarkerPolyline( QPolygonF& pts,
QgsRenderContext& context );
223 void renderVertexMarkerPolygon( QPolygonF& pts, QList<QPolygonF>* rings,
QgsRenderContext& context );
225 static const unsigned char* _getPoint( QPointF& pt,
QgsRenderContext& context,
const unsigned char* wkb );
226 static const unsigned char* _getLineString( QPolygonF& pts,
QgsRenderContext& context,
const unsigned char* wkb );
227 static const unsigned char* _getPolygon( QPolygonF& pts, QList<QPolygonF>& holes,
QgsRenderContext& context,
const unsigned char* wkb );
229 void setScaleMethodToSymbol(
QgsSymbolV2* symbol,
int scaleMethod );
246 #endif // QGSRENDERERV2_H