16 #ifndef QGSRENDERERV2_H
17 #define QGSRENDERERV2_H
26 #include <QDomDocument>
27 #include <QDomElement>
43 #define RENDERER_TAG_NAME "renderer-v2"
77 QString
type()
const {
return mType; }
92 virtual QList<QString> usedAttributes() = 0;
98 virtual bool renderFeature(
QgsFeature& feature,
QgsRenderContext& context,
int layer = -1,
bool selected =
false,
bool drawVertexMarker =
false );
101 virtual QString dump()
const;
106 RotationField = 1 << 1,
107 MoreSymbolsPerFeature = 1 << 2,
109 ScaleDependent = 1 << 4
126 virtual QDomElement save( QDomDocument& doc );
130 virtual QDomElement writeSld( QDomDocument& doc,
const QgsVectorLayer &layer )
const;
147 virtual void toSld( QDomDocument& doc, QDomElement &element )
const
148 { element.appendChild( doc.createComment( QString(
"FeatureRendererV2 %1 not implemented yet" ).arg( type() ) ) ); }
156 virtual QgsLegendSymbolList legendSymbolItems(
double scaleDenominator = -1, QString rule =
"" );
159 void setVertexMarkerAppearance(
int type,
int size );
183 void renderFeatureWithSymbol(
QgsFeature& feature,
188 bool drawVertexMarker );
193 void renderVertexMarkerPolyline( QPolygonF& pts,
QgsRenderContext& context );
195 void renderVertexMarkerPolygon( QPolygonF& pts, QList<QPolygonF>* rings,
QgsRenderContext& context );
197 static const unsigned char* _getPoint( QPointF& pt,
QgsRenderContext& context,
const unsigned char* wkb );
198 static const unsigned char* _getLineString( QPolygonF& pts,
QgsRenderContext& context,
const unsigned char* wkb );
199 static const unsigned char* _getPolygon( QPolygonF& pts, QList<QPolygonF>& holes,
QgsRenderContext& context,
const unsigned char* wkb );
201 void setScaleMethodToSymbol(
QgsSymbolV2* symbol,
int scaleMethod );
216 class QgsRendererV2Widget;
218 #endif // QGSRENDERERV2_H
QMap< QString, QgsSymbolV2 * > QgsSymbolV2Map
virtual ~QgsFeatureRendererV2()
virtual bool willRenderFeature(QgsFeature &feat)
return whether the renderer will render a feature or not.
virtual void setRotationField(QString fieldName)
sets rotation field of renderer (if supported by the renderer)
QList< QgsSymbolV2 * > QgsSymbolV2List
QList< QPair< QString, QPixmap > > QgsLegendSymbologyList
Container of fields for a vector layer.
The feature class encapsulates a single feature including its id, geometry and a list of field/values...
virtual QString rotationField() const
return rotation field name (or empty string if not set or not supported by renderer) ...
int mCurrentVertexMarkerSize
The current size of editing marker.
int mCurrentVertexMarkerType
The current type of editing marker.
QList< QPair< QString, QPixmap > > QgsLegendSymbologyList
QList< QgsSymbolV2LevelItem > QgsSymbolV2Level
virtual void toSld(QDomDocument &doc, QDomElement &element) const
used from subclasses to create SLD Rule elements following SLD v1.1 specs
QgsSymbolV2LevelItem(QgsSymbolV2 *symbol, int layer)
void setUsingSymbolLevels(bool usingSymbolLevels)
Contains information about the context of a rendering operation.
bool usingSymbolLevels() const
QList< QgsSymbolV2Level > QgsSymbolV2LevelOrder
virtual int capabilities()
returns bitwise OR-ed capabilities of the renderer
Represents a vector layer which manages a vector based data sets.
QList< QPair< QString, QgsSymbolV2 * > > QgsLegendSymbolList
QMap< QString, QString > QgsStringMap