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 QMap< QString, QgsSymbolV2 * > QgsSymbolV2Map
virtual ~QgsFeatureRendererV2()
virtual bool willRenderFeature(QgsFeature &feat)
return whether the renderer will render a feature or not.
A rectangle specified with double values.
virtual QgsSymbolV2 * originalSymbolForFeature(QgsFeature &feature)
Return symbol for feature.
virtual void setRotationField(QString fieldName)
sets rotation field of renderer (if supported by the renderer)
QList< QgsSymbolV2 * > QgsSymbolV2List
QList< QPair< QString, QPixmap > > QgsLegendSymbologyList
virtual void modifyRequestExtent(QgsRectangle &extent, QgsRenderContext &context)
Allows for a renderer to modify the extent of a feature request prior to rendering.
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) ...
virtual QString legendClassificationAttribute() const
If supported by the renderer, return classification attribute for the use in legend.
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
QList< QgsLegendSymbolItemV2 > QgsLegendSymbolListV2
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