25 mCategoryBrush.
setStyle( Qt::SolidPattern );
51 attrVal = expression->
evaluate( &expressionContext );
59 double value = attrVal.
toDouble( &ok );
77 Q_UNUSED( attributes );
91 double currentVal = 0;
106 valSum += currentVal;
107 if ( currentVal ) valCount++;
111 double totalAngle = 0;
116 double w = spu.
width();
119 double baseX = position.
x();
120 double baseY = position.
y() - h;
131 for ( ; valIt != values.
constEnd(); ++valIt, ++colIt )
135 currentAngle = *valIt / valSum * 360 * 16;
147 totalAngle += currentAngle;
154 mCategoryBrush.
setColor( Qt::transparent );
QSizeF sizePainterUnits(QSizeF size, const QgsDiagramSettings &s, const QgsRenderContext &c)
Calculates a size to match the current settings and rendering context.
Class for parsing and evaluation of expressions (formerly called "search strings").
void setStyle(Qt::PenStyle style)
QgsAttributes attributes() const
Returns the feature's attributes.
Q_DECL_DEPRECATED QVariant evaluate(const QgsFeature *f)
Evaluate the feature and return the result.
void push_back(const T &value)
QList< QString > categoryAttributes
Q_DECL_DEPRECATED QgsExpression * getExpression(const QString &expression, const QgsFields *fields)
void setFeature(const QgsFeature &feature)
Convenience function for setting a feature for the context.
bool classificationAttributeIsExpression
The feature class encapsulates a single feature including its id, geometry and a list of field/values...
void setStyle(Qt::BrushStyle style)
virtual QgsPieDiagram * clone() const override
Returns an instance that is equivalent to this one.
double legendSize(double value, const QgsDiagramSettings &s, const QgsDiagramInterpolationSettings &is) const override
Returns the size of the legend item for the diagram corresponding to a specified value.
const QgsFields * fields() const
Returns the field map associated with the feature.
void setPen(const QColor &color)
void drawEllipse(const QRectF &rectangle)
QString classificationAttributeExpression
Expression contexts are used to encapsulate the parameters around which a QgsExpression should be eva...
void setBrush(const QBrush &brush)
void setColor(const QColor &color)
void setFields(const QgsFields &fields)
Convenience function for setting a fields for the context.
QSizeF sizeForValue(double value, const QgsDiagramSettings &s, const QgsDiagramInterpolationSettings &is) const
Returns the scaled size of a diagram for a value, respecting the specified diagram interpolation sett...
QgsExpressionContext & expressionContext()
Gets the expression context.
void drawPie(const QRectF &rectangle, int startAngle, int spanAngle)
const T & at(int i) const
Additional diagram settings for interpolated size rendering.
Contains information about the context of a rendering operation.
void renderDiagram(const QgsFeature &feature, QgsRenderContext &c, const QgsDiagramSettings &s, QPointF position) override
Draws the diagram at the given position (in pixel coordinates)
double toDouble(bool *ok) const
int classificationAttribute
Index of the classification attribute.
const_iterator constEnd() const
const_iterator constBegin() const
void setPenWidth(QPen &pen, const QgsDiagramSettings &s, const QgsRenderContext &c)
Changes the pen width to match the current settings and rendering context.
QList< QColor > categoryColors
void setColor(const QColor &color)
Stores the settings for rendering a single diagram.
QSizeF diagramSize(const QgsAttributes &attributes, const QgsRenderContext &c, const QgsDiagramSettings &s) override
Returns the size in map units the diagram will use to render.