QGIS API Documentation  2.14.0-Essen
Public Member Functions | Protected Member Functions | Static Protected Member Functions | Protected Attributes | List of all members
QgsDiagramRendererV2 Class Referenceabstract

Returns diagram settings for a feature. More...

#include <qgsdiagramrendererv2.h>

Inheritance diagram for QgsDiagramRendererV2:
Inheritance graph
[legend]

Public Member Functions

 QgsDiagramRendererV2 ()
 
virtual ~QgsDiagramRendererV2 ()
 
virtual QgsDiagramRendererV2clone () const =0
 Returns new instance that is equivalent to this one. More...
 
QgsDiagramdiagram () const
 
virtual QList< QStringdiagramAttributes () const =0
 Returns attribute indices needed for diagram rendering. More...
 
virtual QList< QgsDiagramSettingsdiagramSettings () const =0
 Returns list with all diagram settings in the renderer. More...
 
virtual QList< QgsLayerTreeModelLegendNode * > legendItems (QgsLayerTreeLayer *nodeLayer) const
 Returns list of legend nodes for the diagram. More...
 
virtual void readXML (const QDomElement &elem, const QgsVectorLayer *layer)=0
 
void renderDiagram (const QgsFeature &feature, QgsRenderContext &c, QPointF pos)
 
virtual QString rendererName () const =0
 
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...
 
virtual void writeXML (QDomElement &layerElem, QDomDocument &doc, const QgsVectorLayer *layer) const =0
 

Protected Member Functions

 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...
 
virtual bool diagramSettings (const QgsFeature &feature, const QgsRenderContext &c, QgsDiagramSettings &s)=0
 Returns diagram settings for a feature (or false if the diagram for the feature is not to be rendered). More...
 
virtual QSizeF diagramSize (const QgsFeature &features, const QgsRenderContext &c)=0
 Returns size of the diagram (in painter units) or an invalid size in case of error. More...
 

Static Protected Member Functions

static int dpiPaintDevice (const QPainter *)
 Returns the paint device dpi (or -1 in case of error. More...
 

Protected Attributes

QgsDiagrammDiagram
 Reference to the object that does the real diagram rendering. More...
 

Detailed Description

Returns diagram settings for a feature.

Definition at line 186 of file qgsdiagramrendererv2.h.

Constructor & Destructor Documentation

QgsDiagramRendererV2::QgsDiagramRendererV2 ( )

Definition at line 335 of file qgsdiagramrendererv2.cpp.

QgsDiagramRendererV2::~QgsDiagramRendererV2 ( )
virtual

Definition at line 340 of file qgsdiagramrendererv2.cpp.

QgsDiagramRendererV2::QgsDiagramRendererV2 ( const QgsDiagramRendererV2 other)
protected

Definition at line 351 of file qgsdiagramrendererv2.cpp.

Member Function Documentation

void QgsDiagramRendererV2::_readXML ( const QDomElement elem,
const QgsVectorLayer layer 
)
protected

Definition at line 413 of file qgsdiagramrendererv2.cpp.

void QgsDiagramRendererV2::_writeXML ( QDomElement rendererElem,
QDomDocument doc,
const QgsVectorLayer layer 
) const
protected

Definition at line 437 of file qgsdiagramrendererv2.cpp.

virtual QgsDiagramRendererV2* QgsDiagramRendererV2::clone ( ) const
pure virtual

Returns new instance that is equivalent to this one.

Note
added in 2.4

Implemented in QgsLinearlyInterpolatedDiagramRenderer, and QgsSingleCategoryDiagramRenderer.

void QgsDiagramRendererV2::convertSizeToMapUnits ( QSizeF size,
const QgsRenderContext context 
) const
protected

Converts size from mm to map units.

Definition at line 388 of file qgsdiagramrendererv2.cpp.

QgsDiagram* QgsDiagramRendererV2::diagram ( ) const
inline

Definition at line 208 of file qgsdiagramrendererv2.h.

virtual QList<QString> QgsDiagramRendererV2::diagramAttributes ( ) const
pure virtual

Returns attribute indices needed for diagram rendering.

Implemented in QgsLinearlyInterpolatedDiagramRenderer, and QgsSingleCategoryDiagramRenderer.

virtual QList<QgsDiagramSettings> QgsDiagramRendererV2::diagramSettings ( ) const
pure virtual

Returns list with all diagram settings in the renderer.

Implemented in QgsLinearlyInterpolatedDiagramRenderer, and QgsSingleCategoryDiagramRenderer.

virtual bool QgsDiagramRendererV2::diagramSettings ( const QgsFeature feature,
const QgsRenderContext c,
QgsDiagramSettings s 
)
protectedpure virtual

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

Implemented in QgsLinearlyInterpolatedDiagramRenderer, and QgsSingleCategoryDiagramRenderer.

virtual QSizeF QgsDiagramRendererV2::diagramSize ( const QgsFeature features,
const QgsRenderContext c 
)
protectedpure virtual

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

Implemented in QgsLinearlyInterpolatedDiagramRenderer, and QgsSingleCategoryDiagramRenderer.

int QgsDiagramRendererV2::dpiPaintDevice ( const QPainter painter)
staticprotected

Returns the paint device dpi (or -1 in case of error.

Definition at line 400 of file qgsdiagramrendererv2.cpp.

QList< QgsLayerTreeModelLegendNode * > QgsDiagramRendererV2::legendItems ( QgsLayerTreeLayer nodeLayer) const
virtual

Returns list of legend nodes for the diagram.

Note
caller is responsible for deletion of QgsLayerTreeModelLegendNodes
added in 2.10

Reimplemented in QgsLinearlyInterpolatedDiagramRenderer, and QgsSingleCategoryDiagramRenderer.

Definition at line 599 of file qgsdiagramrendererv2.cpp.

virtual void QgsDiagramRendererV2::readXML ( const QDomElement elem,
const QgsVectorLayer layer 
)
pure virtual
void QgsDiagramRendererV2::renderDiagram ( const QgsFeature feature,
QgsRenderContext c,
QPointF  pos 
)

Definition at line 356 of file qgsdiagramrendererv2.cpp.

virtual QString QgsDiagramRendererV2::rendererName ( ) const
pure virtual
void QgsDiagramRendererV2::setDiagram ( QgsDiagram d)

Definition at line 345 of file qgsdiagramrendererv2.cpp.

QSizeF QgsDiagramRendererV2::sizeMapUnits ( const QgsFeature feature,
const QgsRenderContext c 
)
virtual

Returns size of the diagram for a feature in map units.

Returns an invalid QSizeF in case of error

Definition at line 372 of file qgsdiagramrendererv2.cpp.

virtual void QgsDiagramRendererV2::writeXML ( QDomElement layerElem,
QDomDocument doc,
const QgsVectorLayer layer 
) const
pure virtual

Member Data Documentation

QgsDiagram* QgsDiagramRendererV2::mDiagram
protected

Reference to the object that does the real diagram rendering.

Definition at line 246 of file qgsdiagramrendererv2.h.


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