QGIS API Documentation 3.41.0-Master (3c143d501a8)
Loading...
Searching...
No Matches
Public Member Functions | Static Public Attributes | Protected Member Functions | List of all members
QgsLinearlyInterpolatedDiagramRenderer Class Reference

Alters the size of rendered diagrams using a linear scaling. More...

#include <qgsdiagramrenderer.h>

Inheritance diagram for QgsLinearlyInterpolatedDiagramRenderer:
Inheritance graph
[legend]

Public Member Functions

 QgsLinearlyInterpolatedDiagramRenderer ()
 
 QgsLinearlyInterpolatedDiagramRenderer (const QgsLinearlyInterpolatedDiagramRenderer &other)
 
 ~QgsLinearlyInterpolatedDiagramRenderer () override
 
QString classificationAttributeExpression () const
 
bool classificationAttributeIsExpression () const
 
QString classificationField () const
 Returns the field name used for interpolating the diagram size.
 
QgsLinearlyInterpolatedDiagramRendererclone () const override
 Returns new instance that is equivalent to this one.
 
QgsDataDefinedSizeLegenddataDefinedSizeLegend () const
 Returns configuration of appearance of legend.
 
QList< QString > diagramAttributes () const override
 Returns attribute indices needed for diagram rendering.
 
QList< QgsDiagramSettingsdiagramSettings () 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
 
QgsLinearlyInterpolatedDiagramRendereroperator= (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.
 
- Public Member Functions inherited from QgsDiagramRenderer
 QgsDiagramRenderer ()=default
 
virtual ~QgsDiagramRenderer ()=default
 
bool attributeLegend () const
 Returns true if renderer will show legend items for diagram attributes.
 
QgsDiagramdiagram () const
 
virtual 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.
 

Static Public Attributes

static const QString DIAGRAM_RENDERER_NAME_LINEARLY_INTERPOLATED = QLatin1String( "LinearlyInterpolated" )
 

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.
 
- Protected Member Functions inherited from QgsDiagramRenderer
 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.
 
QgsDiagramRendereroperator= (const QgsDiagramRenderer &other)
 

Additional Inherited Members

- Static Protected Member Functions inherited from QgsDiagramRenderer
static int dpiPaintDevice (const QPainter *)
 Returns the paint device dpi (or -1 in case of error.
 
- Protected Attributes inherited from QgsDiagramRenderer
std::unique_ptr< QgsDiagrammDiagram
 Reference to the object that does the real diagram rendering.
 
bool mShowAttributeLegend = true
 Whether to show an attribute legend for the diagrams.
 

Detailed Description

Alters the size of rendered diagrams using a linear scaling.

Definition at line 910 of file qgsdiagramrenderer.h.

Constructor & Destructor Documentation

◆ QgsLinearlyInterpolatedDiagramRenderer() [1/2]

QgsLinearlyInterpolatedDiagramRenderer::QgsLinearlyInterpolatedDiagramRenderer ( )

Definition at line 705 of file qgsdiagramrenderer.cpp.

◆ ~QgsLinearlyInterpolatedDiagramRenderer()

QgsLinearlyInterpolatedDiagramRenderer::~QgsLinearlyInterpolatedDiagramRenderer ( )
override

Definition at line 718 of file qgsdiagramrenderer.cpp.

◆ QgsLinearlyInterpolatedDiagramRenderer() [2/2]

QgsLinearlyInterpolatedDiagramRenderer::QgsLinearlyInterpolatedDiagramRenderer ( const QgsLinearlyInterpolatedDiagramRenderer other)

Definition at line 710 of file qgsdiagramrenderer.cpp.

Member Function Documentation

◆ classificationAttributeExpression()

QString QgsLinearlyInterpolatedDiagramRenderer::classificationAttributeExpression ( ) const
inline

Definition at line 958 of file qgsdiagramrenderer.h.

◆ classificationAttributeIsExpression()

bool QgsLinearlyInterpolatedDiagramRenderer::classificationAttributeIsExpression ( ) const
inline

Definition at line 961 of file qgsdiagramrenderer.h.

◆ classificationField()

QString QgsLinearlyInterpolatedDiagramRenderer::classificationField ( ) const
inline

Returns the field name used for interpolating the diagram size.

See also
setClassificationField()

Definition at line 950 of file qgsdiagramrenderer.h.

◆ clone()

QgsLinearlyInterpolatedDiagramRenderer * QgsLinearlyInterpolatedDiagramRenderer::clone ( ) const
overridevirtual

Returns new instance that is equivalent to this one.

Implements QgsDiagramRenderer.

Definition at line 736 of file qgsdiagramrenderer.cpp.

◆ dataDefinedSizeLegend()

QgsDataDefinedSizeLegend * QgsLinearlyInterpolatedDiagramRenderer::dataDefinedSizeLegend ( ) const

Returns configuration of appearance of legend.

Will return nullptr if no configuration has been set.

Definition at line 1385 of file qgsdiagramrenderer.cpp.

◆ diagramAttributes()

QList< QString > QgsLinearlyInterpolatedDiagramRenderer::diagramAttributes ( ) const
overridevirtual

Returns attribute indices needed for diagram rendering.

Implements QgsDiagramRenderer.

Definition at line 755 of file qgsdiagramrenderer.cpp.

◆ diagramSettings() [1/2]

QList< QgsDiagramSettings > QgsLinearlyInterpolatedDiagramRenderer::diagramSettings ( ) const
overridevirtual

Returns list with all diagram settings in the renderer.

Implements QgsDiagramRenderer.

Definition at line 741 of file qgsdiagramrenderer.cpp.

◆ diagramSettings() [2/2]

bool QgsLinearlyInterpolatedDiagramRenderer::diagramSettings ( const QgsFeature feature,
const QgsRenderContext c,
QgsDiagramSettings s 
) const
overrideprotectedvirtual

Returns diagram settings for a feature (or false if the diagram for the feature is not to be rendered).

Used internally within renderDiagram()

Parameters
featurethe feature
crender context
sout: diagram settings for the feature

Implements QgsDiagramRenderer.

Definition at line 748 of file qgsdiagramrenderer.cpp.

◆ diagramSize()

QSizeF QgsLinearlyInterpolatedDiagramRenderer::diagramSize ( const QgsFeature feature,
const QgsRenderContext c 
) const
overrideprotectedvirtual

Returns size of the diagram (in painter units) or an invalid size in case of error.

Parameters
featurethe feature
crender context

Implements QgsDiagramRenderer.

Definition at line 779 of file qgsdiagramrenderer.cpp.

◆ legendItems()

QList< QgsLayerTreeModelLegendNode * > QgsLinearlyInterpolatedDiagramRenderer::legendItems ( QgsLayerTreeLayer nodeLayer) const
overridevirtual

Returns list of legend nodes for the diagram.

Note
caller is responsible for deletion of QgsLayerTreeModelLegendNodes

Reimplemented from QgsDiagramRenderer.

Definition at line 1322 of file qgsdiagramrenderer.cpp.

◆ lowerSize()

QSizeF QgsLinearlyInterpolatedDiagramRenderer::lowerSize ( ) const
inline

Definition at line 941 of file qgsdiagramrenderer.h.

◆ lowerValue()

double QgsLinearlyInterpolatedDiagramRenderer::lowerValue ( ) const
inline

Definition at line 935 of file qgsdiagramrenderer.h.

◆ operator=()

QgsLinearlyInterpolatedDiagramRenderer & QgsLinearlyInterpolatedDiagramRenderer::operator= ( const QgsLinearlyInterpolatedDiagramRenderer other)

Definition at line 723 of file qgsdiagramrenderer.cpp.

◆ readXml()

void QgsLinearlyInterpolatedDiagramRenderer::readXml ( const QDomElement &  elem,
const QgsReadWriteContext context 
)
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.

See also
writeXml()

Implements QgsDiagramRenderer.

Definition at line 784 of file qgsdiagramrenderer.cpp.

◆ referencedFields()

QSet< QString > QgsLinearlyInterpolatedDiagramRenderer::referencedFields ( const QgsExpressionContext context = QgsExpressionContext()) const
overridevirtual

Returns the set of any fields required for diagram rendering.

Parameters
contextexpression context the diagrams will be drawn using

Reimplemented from QgsDiagramRenderer.

Definition at line 760 of file qgsdiagramrenderer.cpp.

◆ rendererName()

QString QgsLinearlyInterpolatedDiagramRenderer::rendererName ( ) const
inlineoverridevirtual

Implements QgsDiagramRenderer.

Definition at line 932 of file qgsdiagramrenderer.h.

◆ setClassificationAttributeExpression()

void QgsLinearlyInterpolatedDiagramRenderer::setClassificationAttributeExpression ( const QString &  expression)
inline

Definition at line 959 of file qgsdiagramrenderer.h.

◆ setClassificationAttributeIsExpression()

void QgsLinearlyInterpolatedDiagramRenderer::setClassificationAttributeIsExpression ( bool  isExpression)
inline

Definition at line 962 of file qgsdiagramrenderer.h.

◆ setClassificationField()

void QgsLinearlyInterpolatedDiagramRenderer::setClassificationField ( const QString &  field)
inline

Sets the field name used for interpolating the diagram size.

See also
classificationField()

Definition at line 956 of file qgsdiagramrenderer.h.

◆ setDataDefinedSizeLegend()

void QgsLinearlyInterpolatedDiagramRenderer::setDataDefinedSizeLegend ( QgsDataDefinedSizeLegend settings)

Configures appearance of legend.

Takes ownership of the passed settings objects.

Definition at line 1379 of file qgsdiagramrenderer.cpp.

◆ setDiagramSettings()

void QgsLinearlyInterpolatedDiagramRenderer::setDiagramSettings ( const QgsDiagramSettings s)
inline

Definition at line 926 of file qgsdiagramrenderer.h.

◆ setLowerSize()

void QgsLinearlyInterpolatedDiagramRenderer::setLowerSize ( QSizeF  s)
inline

Definition at line 940 of file qgsdiagramrenderer.h.

◆ setLowerValue()

void QgsLinearlyInterpolatedDiagramRenderer::setLowerValue ( double  val)
inline

Definition at line 934 of file qgsdiagramrenderer.h.

◆ setUpperSize()

void QgsLinearlyInterpolatedDiagramRenderer::setUpperSize ( QSizeF  s)
inline

Definition at line 943 of file qgsdiagramrenderer.h.

◆ setUpperValue()

void QgsLinearlyInterpolatedDiagramRenderer::setUpperValue ( double  val)
inline

Definition at line 937 of file qgsdiagramrenderer.h.

◆ upperSize()

QSizeF QgsLinearlyInterpolatedDiagramRenderer::upperSize ( ) const
inline

Definition at line 944 of file qgsdiagramrenderer.h.

◆ upperValue()

double QgsLinearlyInterpolatedDiagramRenderer::upperValue ( ) const
inline

Definition at line 938 of file qgsdiagramrenderer.h.

◆ writeXml()

void QgsLinearlyInterpolatedDiagramRenderer::writeXml ( QDomElement &  layerElem,
QDomDocument &  doc,
const QgsReadWriteContext context 
) const
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.

See also
readXml()

Implements QgsDiagramRenderer.

Definition at line 835 of file qgsdiagramrenderer.cpp.

Member Data Documentation

◆ DIAGRAM_RENDERER_NAME_LINEARLY_INTERPOLATED

const QString QgsLinearlyInterpolatedDiagramRenderer::DIAGRAM_RENDERER_NAME_LINEARLY_INTERPOLATED = QLatin1String( "LinearlyInterpolated" )
static

Definition at line 913 of file qgsdiagramrenderer.h.


The documentation for this class was generated from the following files: