QGIS API Documentation  2.11.0-Master
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Public Member Functions | Protected Member Functions | List of all members
QgsSingleCategoryDiagramRenderer Class Reference

Renders the diagrams for all features with the same settings. More...

#include <qgsdiagramrendererv2.h>

Inheritance diagram for QgsSingleCategoryDiagramRenderer:
Inheritance graph
[legend]

Public Member Functions

 QgsSingleCategoryDiagramRenderer ()
 
 ~QgsSingleCategoryDiagramRenderer ()
 
QgsDiagramRendererV2clone () const override
 Returns new instance that is equivalent to this one. More...
 
QList< QStringdiagramAttributes () 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...
 
void readXML (const QDomElement &elem, const QgsVectorLayer *layer) override
 
QString rendererName () const override
 
void setDiagramSettings (const QgsDiagramSettings &s)
 
void writeXML (QDomElement &layerElem, QDomDocument &doc, const QgsVectorLayer *layer) const override
 
- Public Member Functions inherited from QgsDiagramRendererV2
 QgsDiagramRendererV2 ()
 
virtual ~QgsDiagramRendererV2 ()
 
QgsDiagramdiagram () const
 
void renderDiagram (const QgsFeature &feature, QgsRenderContext &c, const QPointF &pos)
 
void setDiagram (QgsDiagram *d)
 
virtual QSizeF sizeMapUnits (const QgsFeature &feature, const QgsRenderContext &c)
 Returns size of the diagram for a feature in map units. More...
 

Protected Member Functions

bool diagramSettings (const QgsFeature &feature, const QgsRenderContext &c, QgsDiagramSettings &s) 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) override
 Returns size of the diagram (in painter units) or an invalid size in case of error. More...
 
- Protected Member Functions inherited from QgsDiagramRendererV2
 QgsDiagramRendererV2 (const QgsDiagramRendererV2 &other)
 
void _readXML (const QDomElement &elem, const QgsVectorLayer *layer)
 
void _writeXML (QDomElement &rendererElem, QDomDocument &doc, const QgsVectorLayer *layer) const
 
void convertSizeToMapUnits (QSizeF &size, const QgsRenderContext &context) const
 Converts size from mm to map units. More...
 

Additional Inherited Members

- Static Protected Member Functions inherited from QgsDiagramRendererV2
static int dpiPaintDevice (const QPainter *)
 Returns the paint device dpi (or -1 in case of error. More...
 
- Protected Attributes inherited from QgsDiagramRendererV2
QgsDiagrammDiagram
 Reference to the object that does the real diagram rendering. More...
 

Detailed Description

Renders the diagrams for all features with the same settings.

Definition at line 246 of file qgsdiagramrendererv2.h.

Constructor & Destructor Documentation

QgsSingleCategoryDiagramRenderer::QgsSingleCategoryDiagramRenderer ( )

Definition at line 411 of file qgsdiagramrendererv2.cpp.

QgsSingleCategoryDiagramRenderer::~QgsSingleCategoryDiagramRenderer ( )

Definition at line 415 of file qgsdiagramrendererv2.cpp.

Member Function Documentation

QgsDiagramRendererV2 * QgsSingleCategoryDiagramRenderer::clone ( ) const
overridevirtual

Returns new instance that is equivalent to this one.

Note
added in 2.4

Implements QgsDiagramRendererV2.

Definition at line 419 of file qgsdiagramrendererv2.cpp.

QList<QString> QgsSingleCategoryDiagramRenderer::diagramAttributes ( ) const
inlineoverridevirtual

Returns attribute indices needed for diagram rendering.

Implements QgsDiagramRendererV2.

Definition at line 256 of file qgsdiagramrendererv2.h.

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

Returns list with all diagram settings in the renderer.

Implements QgsDiagramRendererV2.

Definition at line 436 of file qgsdiagramrendererv2.cpp.

bool QgsSingleCategoryDiagramRenderer::diagramSettings ( const QgsFeature feature,
const QgsRenderContext c,
QgsDiagramSettings s 
)
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 QgsDiagramRendererV2.

Definition at line 424 of file qgsdiagramrendererv2.cpp.

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

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

Implements QgsDiagramRendererV2.

Definition at line 431 of file qgsdiagramrendererv2.cpp.

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

Returns list of legend nodes for the diagram.

Note
caller is responsible for deletion of QgsLayerTreeModelLegendNodes
added in 2.10

Reimplemented from QgsDiagramRendererV2.

Definition at line 566 of file qgsdiagramrendererv2.cpp.

void QgsSingleCategoryDiagramRenderer::readXML ( const QDomElement elem,
const QgsVectorLayer layer 
)
overridevirtual

Implements QgsDiagramRendererV2.

Definition at line 443 of file qgsdiagramrendererv2.cpp.

QString QgsSingleCategoryDiagramRenderer::rendererName ( ) const
inlineoverridevirtual

Implements QgsDiagramRendererV2.

Definition at line 254 of file qgsdiagramrendererv2.h.

void QgsSingleCategoryDiagramRenderer::setDiagramSettings ( const QgsDiagramSettings s)
inline

Definition at line 258 of file qgsdiagramrendererv2.h.

void QgsSingleCategoryDiagramRenderer::writeXML ( QDomElement layerElem,
QDomDocument doc,
const QgsVectorLayer layer 
) const
overridevirtual

Implements QgsDiagramRendererV2.

Definition at line 455 of file qgsdiagramrendererv2.cpp.


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