18 #ifndef QGSPOINTDISPLACEMENTRENDERER_H 19 #define QGSPOINTDISPLACEMENTRENDERER_H 39 virtual void toSld( QDomDocument& doc, QDomElement &element )
const override;
67 QDomElement
save( QDomDocument& doc )
override;
83 Q_DECL_DEPRECATED
void setDisplacementGroups(
const QList<QMap<QgsFeatureId, QgsFeature> >& list ) { Q_UNUSED( list ); }
122 QString mLabelAttributeName;
140 double mCircleRadiusAddition;
144 double mMaxLabelScaleDenominator;
146 typedef QMap<QgsFeatureId, QPair< QgsFeature, QgsSymbolV2* > > DisplacementGroup;
148 QList<DisplacementGroup> mDisplacementGroups;
150 QMap<QgsFeatureId, int> mGroupIndex;
154 QSet<QgsFeatureId> mSelectedFeatures;
159 void printInfoDisplacementGroups();
165 void renderPoint(
const QPointF& point,
QgsSymbolV2RenderContext& context,
const QList<QgsMarkerSymbolV2*>& symbols,
166 const QStringList& labels );
169 void calculateSymbolAndLabelPositions(
const QPointF& centerPoint,
int nPosition,
double radius,
double symbolDiagonal, QList<QPointF>& symbolPositions, QList<QPointF>& labelShifts )
const;
170 void drawGroup(
const DisplacementGroup& group,
QgsRenderContext& context );
171 void drawCircle(
double radiusPainterUnits,
QgsSymbolV2RenderContext& context,
const QPointF& centerPoint,
int nSymbols );
172 void drawSymbols(
const QgsFeature& f,
QgsRenderContext& context,
const QList<QgsMarkerSymbolV2*>& symbolList,
const QList<QPointF>& symbolPositions,
bool selected =
false );
173 void drawLabels(
const QPointF& centerPoint,
QgsSymbolV2RenderContext& context,
const QList<QPointF>& labelShifts,
const QStringList& labelList );
178 #endif // QGSPOINTDISPLACEMENTRENDERER_H 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.
QList< QgsSymbolV2 * > QgsSymbolV2List
double maxLabelScaleDenominator() const
void setLabelAttributeName(const QString &name)
void setLabelFont(const QFont &f)
virtual QDomElement save(QDomDocument &doc)
store renderer info to XML element
virtual QgsLegendSymbolList legendSymbolItems(double scaleDenominator=-1, QString rule="")
return a list of item text / symbol
void setMaxLabelScaleDenominator(double d)
Container of fields for a vector layer.
virtual QList< QString > usedAttributes()=0
double circleWidth() const
The feature class encapsulates a single feature including its id, geometry and a list of field/values...
virtual QgsLegendSymbologyList legendSymbologyItems(QSize iconSize)
return a list of symbology items for the legend
virtual void startRender(QgsRenderContext &context, const QgsFields &fields)=0
virtual void stopRender(QgsRenderContext &context)=0
virtual QgsSymbolV2List symbols()=0
for symbol levels
virtual QgsSymbolV2List originalSymbolsForFeature(QgsFeature &feat)
Equivalent of originalSymbolsForFeature() call extended to support renderers that may use more symbol...
virtual bool renderFeature(QgsFeature &feature, QgsRenderContext &context, int layer=-1, bool selected=false, bool drawVertexMarker=false)
virtual QgsFeatureRendererV2 * clone() const =0
QString labelAttributeName() const
void setLabelColor(const QColor &c)
A class to represent a point.
QList< QPair< QString, QPixmap > > QgsLegendSymbologyList
QgsFeatureRendererV2 * embeddedRenderer() const
void setCircleRadiusAddition(double d)
QColor circleColor() const
virtual void toSld(QDomDocument &doc, QDomElement &element) const
used from subclasses to create SLD Rule elements following SLD v1.1 specs
A renderer that automatically displaces points with the same position.
void setCircleWidth(double w)
Contains information about the context of a rendering operation.
virtual QgsSymbolV2List symbolsForFeature(QgsFeature &feat)
return list of symbols used for rendering the feature.
Q_DECL_DEPRECATED void setDisplacementGroups(const QList< QMap< QgsFeatureId, QgsFeature > > &list)
not available in python bindings
void setCircleColor(const QColor &c)
virtual int capabilities()
returns bitwise OR-ed capabilities of the renderer
QgsMarkerSymbolV2 * centerSymbol()
Returns the symbol for the center of a displacement group (but not ownership of the symbol) ...
QList< QPair< QString, QgsSymbolV2 * > > QgsLegendSymbolList
virtual QgsSymbolV2 * symbolForFeature(QgsFeature &feature)=0
to be overridden
QColor labelColor() const
void setTolerance(double t)
double circleRadiusAddition() const