QGIS API Documentation 3.36.0-Maidenhead (09951dc0acf)
|
#include <qgsdiagramrenderer.h>
Public Member Functions | |
QgsLinearlyInterpolatedDiagramRenderer () | |
QgsLinearlyInterpolatedDiagramRenderer (const QgsLinearlyInterpolatedDiagramRenderer &other) | |
Copy constructor. | |
~QgsLinearlyInterpolatedDiagramRenderer () override | |
QString | classificationAttributeExpression () const |
bool | classificationAttributeIsExpression () const |
QString | classificationField () const |
Returns the field name used for interpolating the diagram size. | |
QgsLinearlyInterpolatedDiagramRenderer * | clone () const override |
Returns new instance that is equivalent to this one. | |
QgsDataDefinedSizeLegend * | dataDefinedSizeLegend () const |
Returns configuration of appearance of legend. | |
QList< QString > | diagramAttributes () const override |
Returns attribute indices needed for diagram rendering. | |
QList< QgsDiagramSettings > | diagramSettings () const override |
Returns list with all diagram settings in the renderer. | |
QList< QgsLayerTreeModelLegendNode * > | legendItems (QgsLayerTreeLayer *nodeLayer) const override |
Returns list of legend nodes for the diagram. | |
QSizeF | lowerSize () const |
double | lowerValue () const |
QgsLinearlyInterpolatedDiagramRenderer & | operator= (const QgsLinearlyInterpolatedDiagramRenderer &other) |
void | readXml (const QDomElement &elem, const QgsReadWriteContext &context) override |
Reads diagram state from a DOM element. | |
QSet< QString > | referencedFields (const QgsExpressionContext &context=QgsExpressionContext()) const override |
Returns the set of any fields required for diagram rendering. | |
QString | rendererName () const override |
void | setClassificationAttributeExpression (const QString &expression) |
void | setClassificationAttributeIsExpression (bool isExpression) |
void | setClassificationField (const QString &field) |
Sets the field name used for interpolating the diagram size. | |
void | setDataDefinedSizeLegend (QgsDataDefinedSizeLegend *settings) |
Configures appearance of legend. | |
void | setDiagramSettings (const QgsDiagramSettings &s) |
void | setLowerSize (QSizeF s) |
void | setLowerValue (double val) |
void | setUpperSize (QSizeF s) |
void | setUpperValue (double val) |
QSizeF | upperSize () const |
double | upperValue () const |
void | writeXml (QDomElement &layerElem, QDomDocument &doc, const QgsReadWriteContext &context) const override |
Writes diagram state to a DOM element. | |
![]() | |
QgsDiagramRenderer ()=default | |
Constructor for QgsDiagramRenderer. | |
virtual | ~QgsDiagramRenderer ()=default |
bool | attributeLegend () const |
Returns true if renderer will show legend items for diagram attributes. | |
QgsDiagram * | diagram () const |
void | renderDiagram (const QgsFeature &feature, QgsRenderContext &c, QPointF pos, const QgsPropertyCollection &properties=QgsPropertyCollection()) const |
Renders the diagram for a specified feature at a specific position in the passed render context. | |
void | setAttributeLegend (bool enabled) |
Sets whether the renderer will show legend items for diagram attributes. | |
void | setDiagram (QgsDiagram *d) |
virtual QSizeF | sizeMapUnits (const QgsFeature &feature, const QgsRenderContext &c) const |
Returns size of the diagram for a feature in map units. Returns an invalid QSizeF in case of error. | |
Protected Member Functions | |
bool | diagramSettings (const QgsFeature &feature, const QgsRenderContext &c, QgsDiagramSettings &s) const override |
Returns diagram settings for a feature (or false if the diagram for the feature is not to be rendered). | |
QSizeF | diagramSize (const QgsFeature &, const QgsRenderContext &c) const override |
Returns size of the diagram (in painter units) or an invalid size in case of error. | |
![]() | |
QgsDiagramRenderer (const QgsDiagramRenderer &other) | |
void | _readXml (const QDomElement &elem, const QgsReadWriteContext &context) |
Reads internal QgsDiagramRenderer state from a DOM element. | |
void | _writeXml (QDomElement &rendererElem, QDomDocument &doc, const QgsReadWriteContext &context) const |
Writes internal QgsDiagramRenderer diagram state to a DOM element. | |
void | convertSizeToMapUnits (QSizeF &size, const QgsRenderContext &context) const |
Converts size from mm to map units. | |
QgsDiagramRenderer & | operator= (const QgsDiagramRenderer &other) |
Additional Inherited Members | |
![]() | |
static int | dpiPaintDevice (const QPainter *) |
Returns the paint device dpi (or -1 in case of error. | |
![]() | |
std::unique_ptr< QgsDiagram > | mDiagram |
Reference to the object that does the real diagram rendering. | |
bool | mShowAttributeLegend = true |
Whether to show an attribute legend for the diagrams. | |
Definition at line 819 of file qgsdiagramrenderer.h.
QgsLinearlyInterpolatedDiagramRenderer::QgsLinearlyInterpolatedDiagramRenderer | ( | ) |
Definition at line 647 of file qgsdiagramrenderer.cpp.
|
override |
Definition at line 660 of file qgsdiagramrenderer.cpp.
QgsLinearlyInterpolatedDiagramRenderer::QgsLinearlyInterpolatedDiagramRenderer | ( | const QgsLinearlyInterpolatedDiagramRenderer & | other | ) |
Copy constructor.
Definition at line 652 of file qgsdiagramrenderer.cpp.
|
inline |
Definition at line 866 of file qgsdiagramrenderer.h.
|
inline |
Definition at line 869 of file qgsdiagramrenderer.h.
|
inline |
Returns the field name used for interpolating the diagram size.
Definition at line 858 of file qgsdiagramrenderer.h.
|
overridevirtual |
Returns new instance that is equivalent to this one.
Implements QgsDiagramRenderer.
Definition at line 678 of file qgsdiagramrenderer.cpp.
QgsDataDefinedSizeLegend * QgsLinearlyInterpolatedDiagramRenderer::dataDefinedSizeLegend | ( | ) | const |
Returns configuration of appearance of legend.
Will return nullptr
if no configuration has been set.
Definition at line 1011 of file qgsdiagramrenderer.cpp.
|
overridevirtual |
Returns attribute indices needed for diagram rendering.
Implements QgsDiagramRenderer.
Definition at line 697 of file qgsdiagramrenderer.cpp.
|
overridevirtual |
Returns list with all diagram settings in the renderer.
Implements QgsDiagramRenderer.
Definition at line 683 of file qgsdiagramrenderer.cpp.
|
overrideprotectedvirtual |
Returns diagram settings for a feature (or false
if the diagram for the feature is not to be rendered).
Used internally within renderDiagram()
feature | the feature |
c | render context |
s | out: diagram settings for the feature |
Implements QgsDiagramRenderer.
Definition at line 690 of file qgsdiagramrenderer.cpp.
|
overrideprotectedvirtual |
Returns size of the diagram (in painter units) or an invalid size in case of error.
Implements QgsDiagramRenderer.
Definition at line 721 of file qgsdiagramrenderer.cpp.
|
overridevirtual |
Returns list of legend nodes for the diagram.
Reimplemented from QgsDiagramRenderer.
Definition at line 953 of file qgsdiagramrenderer.cpp.
|
inline |
Definition at line 849 of file qgsdiagramrenderer.h.
|
inline |
Definition at line 843 of file qgsdiagramrenderer.h.
QgsLinearlyInterpolatedDiagramRenderer & QgsLinearlyInterpolatedDiagramRenderer::operator= | ( | const QgsLinearlyInterpolatedDiagramRenderer & | other | ) |
Definition at line 665 of file qgsdiagramrenderer.cpp.
|
overridevirtual |
Reads diagram state from a DOM element.
Subclasses should ensure that _readXml() is called by their readXml implementation to restore the general QgsDiagramRenderer settings.
Implements QgsDiagramRenderer.
Definition at line 726 of file qgsdiagramrenderer.cpp.
|
overridevirtual |
Returns the set of any fields required for diagram rendering.
context | expression context the diagrams will be drawn using |
Reimplemented from QgsDiagramRenderer.
Definition at line 702 of file qgsdiagramrenderer.cpp.
|
inlineoverridevirtual |
Implements QgsDiagramRenderer.
Definition at line 840 of file qgsdiagramrenderer.h.
|
inline |
Definition at line 867 of file qgsdiagramrenderer.h.
|
inline |
Definition at line 870 of file qgsdiagramrenderer.h.
|
inline |
Sets the field name used for interpolating the diagram size.
Definition at line 864 of file qgsdiagramrenderer.h.
void QgsLinearlyInterpolatedDiagramRenderer::setDataDefinedSizeLegend | ( | QgsDataDefinedSizeLegend * | settings | ) |
Configures appearance of legend.
Takes ownership of the passed settings objects.
Definition at line 1005 of file qgsdiagramrenderer.cpp.
|
inline |
Definition at line 834 of file qgsdiagramrenderer.h.
|
inline |
Definition at line 848 of file qgsdiagramrenderer.h.
|
inline |
Definition at line 842 of file qgsdiagramrenderer.h.
|
inline |
Definition at line 851 of file qgsdiagramrenderer.h.
|
inline |
Definition at line 845 of file qgsdiagramrenderer.h.
|
inline |
Definition at line 852 of file qgsdiagramrenderer.h.
|
inline |
Definition at line 846 of file qgsdiagramrenderer.h.
|
overridevirtual |
Writes diagram state to a DOM element.
Subclasses should ensure that _writeXml() is called by their writeXml implementation to save the general QgsDiagramRenderer settings.
Implements QgsDiagramRenderer.
Definition at line 777 of file qgsdiagramrenderer.cpp.