16 #ifndef QGSRENDERERV2_H
17 #define QGSRENDERERV2_H
26 #include <QDomDocument>
27 #include <QDomElement>
42 #define RENDERER_TAG_NAME "renderer-v2"
76 QString
type()
const {
return mType; }
88 virtual QList<QString> usedAttributes() = 0;
94 virtual bool renderFeature(
QgsFeature& feature,
QgsRenderContext& context,
int layer = -1,
bool selected =
false,
bool drawVertexMarker =
false );
97 virtual QString dump()
const;
102 RotationField = 1 << 1,
103 MoreSymbolsPerFeature = 1 << 2,
105 ScaleDependent = 1 << 4
122 virtual QDomElement save( QDomDocument& doc );
126 virtual QDomElement writeSld( QDomDocument& doc,
const QgsVectorLayer &layer )
const;
143 virtual void toSld( QDomDocument& doc, QDomElement &element )
const
144 { element.appendChild( doc.createComment( QString(
"FeatureRendererV2 %1 not implemented yet" ).arg( type() ) ) ); }
152 virtual QgsLegendSymbolList legendSymbolItems(
double scaleDenominator = -1, QString rule =
"" );
155 void setVertexMarkerAppearance(
int type,
int size );
179 void renderFeatureWithSymbol(
QgsFeature& feature,
184 bool drawVertexMarker );
189 void renderVertexMarkerPolyline( QPolygonF& pts,
QgsRenderContext& context );
191 void renderVertexMarkerPolygon( QPolygonF& pts, QList<QPolygonF>* rings,
QgsRenderContext& context );
193 static const unsigned char* _getPoint( QPointF& pt,
QgsRenderContext& context,
const unsigned char* wkb );
194 static const unsigned char* _getLineString( QPolygonF& pts,
QgsRenderContext& context,
const unsigned char* wkb );
195 static const unsigned char* _getPolygon( QPolygonF& pts, QList<QPolygonF>& holes,
QgsRenderContext& context,
const unsigned char* wkb );
197 void setScaleMethodToSymbol(
QgsSymbolV2* symbol,
int scaleMethod );
212 class QgsRendererV2Widget;
214 #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
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