QGIS API Documentation  3.4.15-Madeira (e83d02e274)
Public Member Functions | Protected Member Functions | List of all members
QgsLinearlyInterpolatedDiagramRenderer Class Reference

#include <qgsdiagramrenderer.h>

Inheritance diagram for QgsLinearlyInterpolatedDiagramRenderer:
Inheritance graph
[legend]

Public Member Functions

 QgsLinearlyInterpolatedDiagramRenderer ()
 
 ~QgsLinearlyInterpolatedDiagramRenderer () override
 
QString classificationAttributeExpression () const
 
bool classificationAttributeIsExpression () const
 
QString classificationField () const
 Returns the field name used for interpolating the diagram size. More...
 
QgsLinearlyInterpolatedDiagramRendererclone () const override
 Returns new instance that is equivalent to this one. More...
 
QgsDataDefinedSizeLegenddataDefinedSizeLegend () const
 Returns configuration of appearance of legend. More...
 
QList< QString > diagramAttributes () const override
 Returns attribute indices needed for diagram rendering. More...
 
QList< QgsDiagramSettingsdiagramSettings () const override
 Returns list with all diagram settings in the renderer. More...
 
QList< QgsLayerTreeModelLegendNode * > legendItems (QgsLayerTreeLayer *nodeLayer) const override
 Returns list of legend nodes for the diagram. More...
 
QSizeF lowerSize () const
 
double lowerValue () const
 
void readXml (const QDomElement &elem, const QgsReadWriteContext &context) override
 Reads diagram state from a DOM element. More...
 
QSet< QString > referencedFields (const QgsExpressionContext &context=QgsExpressionContext()) const override
 Returns the set of any fields required for diagram rendering. More...
 
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. More...
 
void setDataDefinedSizeLegend (QgsDataDefinedSizeLegend *settings)
 Configures appearance of legend. More...
 
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. More...
 
- Public Member Functions inherited from QgsDiagramRenderer
 QgsDiagramRenderer ()=default
 Constructor for QgsDiagramRenderer. More...
 
virtual ~QgsDiagramRenderer ()=default
 
bool attributeLegend () const
 Returns true if renderer will show legend items for diagram attributes. More...
 
QgsDiagramdiagram () 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. More...
 
void setAttributeLegend (bool enabled)
 Sets whether the renderer will show legend items for diagram attributes. More...
 
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. More...
 

Protected Member Functions

 QgsLinearlyInterpolatedDiagramRenderer (const QgsLinearlyInterpolatedDiagramRenderer &other)
 Copy constructor. More...
 
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). More...
 
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. More...
 
- 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. More...
 
void _writeXml (QDomElement &rendererElem, QDomDocument &doc, const QgsReadWriteContext &context) const
 Writes internal QgsDiagramRenderer diagram state to a DOM element. More...
 
void convertSizeToMapUnits (QSizeF &size, const QgsRenderContext &context) const
 Converts size from mm to map units. More...
 
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. More...
 
- Protected Attributes inherited from QgsDiagramRenderer
std::unique_ptr< QgsDiagrammDiagram
 Reference to the object that does the real diagram rendering. More...
 
bool mShowAttributeLegend = true
 Whether to show an attribute legend for the diagrams. More...
 

Detailed Description

Definition at line 681 of file qgsdiagramrenderer.h.

Constructor & Destructor Documentation

QgsLinearlyInterpolatedDiagramRenderer::QgsLinearlyInterpolatedDiagramRenderer ( )

Definition at line 587 of file qgsdiagramrenderer.cpp.

QgsLinearlyInterpolatedDiagramRenderer::~QgsLinearlyInterpolatedDiagramRenderer ( )
override

Definition at line 600 of file qgsdiagramrenderer.cpp.

QgsLinearlyInterpolatedDiagramRenderer::QgsLinearlyInterpolatedDiagramRenderer ( const QgsLinearlyInterpolatedDiagramRenderer other)
protected

Copy constructor.

Definition at line 592 of file qgsdiagramrenderer.cpp.

Member Function Documentation

QString QgsLinearlyInterpolatedDiagramRenderer::classificationAttributeExpression ( ) const
inline

Definition at line 726 of file qgsdiagramrenderer.h.

bool QgsLinearlyInterpolatedDiagramRenderer::classificationAttributeIsExpression ( ) const
inline

Definition at line 729 of file qgsdiagramrenderer.h.

QString QgsLinearlyInterpolatedDiagramRenderer::classificationField ( ) const
inline

Returns the field name used for interpolating the diagram size.

See also
setClassificationField()
Since
QGIS 3.0

Definition at line 717 of file qgsdiagramrenderer.h.

QgsLinearlyInterpolatedDiagramRenderer * QgsLinearlyInterpolatedDiagramRenderer::clone ( ) const
overridevirtual

Returns new instance that is equivalent to this one.

Since
QGIS 2.4

Implements QgsDiagramRenderer.

Definition at line 605 of file qgsdiagramrenderer.cpp.

QgsDataDefinedSizeLegend * QgsLinearlyInterpolatedDiagramRenderer::dataDefinedSizeLegend ( ) const

Returns configuration of appearance of legend.

Will return null if no configuration has been set.

Since
QGIS 3.0

Definition at line 815 of file qgsdiagramrenderer.cpp.

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

Returns attribute indices needed for diagram rendering.

Implements QgsDiagramRenderer.

Definition at line 624 of file qgsdiagramrenderer.cpp.

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

Returns list with all diagram settings in the renderer.

Implements QgsDiagramRenderer.

Definition at line 610 of file qgsdiagramrenderer.cpp.

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 617 of file qgsdiagramrenderer.cpp.

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

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

Implements QgsDiagramRenderer.

Definition at line 647 of file qgsdiagramrenderer.cpp.

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

Returns list of legend nodes for the diagram.

Note
caller is responsible for deletion of QgsLayerTreeModelLegendNodes
Since
QGIS 2.10

Reimplemented from QgsDiagramRenderer.

Definition at line 760 of file qgsdiagramrenderer.cpp.

QSizeF QgsLinearlyInterpolatedDiagramRenderer::lowerSize ( ) const
inline

Definition at line 707 of file qgsdiagramrenderer.h.

double QgsLinearlyInterpolatedDiagramRenderer::lowerValue ( ) const
inline

Definition at line 701 of file qgsdiagramrenderer.h.

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 652 of file qgsdiagramrenderer.cpp.

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
Since
QGIS 2.16

Reimplemented from QgsDiagramRenderer.

Definition at line 629 of file qgsdiagramrenderer.cpp.

QString QgsLinearlyInterpolatedDiagramRenderer::rendererName ( ) const
inlineoverridevirtual

Implements QgsDiagramRenderer.

Definition at line 698 of file qgsdiagramrenderer.h.

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

Definition at line 727 of file qgsdiagramrenderer.h.

void QgsLinearlyInterpolatedDiagramRenderer::setClassificationAttributeIsExpression ( bool  isExpression)
inline

Definition at line 730 of file qgsdiagramrenderer.h.

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

Sets the field name used for interpolating the diagram size.

See also
classificationField()
Since
QGIS 3.0

Definition at line 724 of file qgsdiagramrenderer.h.

void QgsLinearlyInterpolatedDiagramRenderer::setDataDefinedSizeLegend ( QgsDataDefinedSizeLegend settings)

Configures appearance of legend.

Takes ownership of the passed settings objects.

Since
QGIS 3.0

Definition at line 809 of file qgsdiagramrenderer.cpp.

void QgsLinearlyInterpolatedDiagramRenderer::setDiagramSettings ( const QgsDiagramSettings s)
inline

Definition at line 692 of file qgsdiagramrenderer.h.

void QgsLinearlyInterpolatedDiagramRenderer::setLowerSize ( QSizeF  s)
inline

Definition at line 706 of file qgsdiagramrenderer.h.

void QgsLinearlyInterpolatedDiagramRenderer::setLowerValue ( double  val)
inline

Definition at line 700 of file qgsdiagramrenderer.h.

void QgsLinearlyInterpolatedDiagramRenderer::setUpperSize ( QSizeF  s)
inline

Definition at line 709 of file qgsdiagramrenderer.h.

void QgsLinearlyInterpolatedDiagramRenderer::setUpperValue ( double  val)
inline

Definition at line 703 of file qgsdiagramrenderer.h.

QSizeF QgsLinearlyInterpolatedDiagramRenderer::upperSize ( ) const
inline

Definition at line 710 of file qgsdiagramrenderer.h.

double QgsLinearlyInterpolatedDiagramRenderer::upperValue ( ) const
inline

Definition at line 704 of file qgsdiagramrenderer.h.

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 703 of file qgsdiagramrenderer.cpp.


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