QGIS API Documentation  2.2.0-Valmiera
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Public Member Functions | Protected Member Functions | Private Attributes | 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]
Collaboration diagram for QgsSingleCategoryDiagramRenderer:
Collaboration graph
[legend]

Public Member Functions

 QgsSingleCategoryDiagramRenderer ()
 ~QgsSingleCategoryDiagramRenderer ()
QString rendererName () const
QList< QString > diagramAttributes () const
 Returns attribute indices needed for diagram rendering.
void setDiagramSettings (const QgsDiagramSettings &s)
QList< QgsDiagramSettingsdiagramSettings () const
 Returns list with all diagram settings in the renderer.
void readXML (const QDomElement &elem, const QgsVectorLayer *layer)
void writeXML (QDomElement &layerElem, QDomDocument &doc, const QgsVectorLayer *layer) const
- Public Member Functions inherited from QgsDiagramRendererV2
 QgsDiagramRendererV2 ()
virtual ~QgsDiagramRendererV2 ()
virtual QSizeF sizeMapUnits (const QgsFeature &feature, const QgsRenderContext &c)
 Returns size of the diagram for a feature in map units.
void renderDiagram (const QgsFeature &feature, QgsRenderContext &c, const QPointF &pos)
void setDiagram (QgsDiagram *d)
QgsDiagram * diagram () const

Protected Member Functions

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

Private Attributes

QgsDiagramSettings mSettings

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.
- Protected Attributes inherited from QgsDiagramRendererV2
QgsDiagram * mDiagram
 Reference to the object that does the real diagram rendering.

Detailed Description

Renders the diagrams for all features with the same settings.

Definition at line 218 of file qgsdiagramrendererv2.h.

Constructor & Destructor Documentation

QgsSingleCategoryDiagramRenderer::QgsSingleCategoryDiagramRenderer ( )

Definition at line 359 of file qgsdiagramrendererv2.cpp.

QgsSingleCategoryDiagramRenderer::~QgsSingleCategoryDiagramRenderer ( )

Definition at line 363 of file qgsdiagramrendererv2.cpp.

Member Function Documentation

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

Returns attribute indices needed for diagram rendering.

Implements QgsDiagramRendererV2.

Definition at line 226 of file qgsdiagramrendererv2.h.

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

Returns list with all diagram settings in the renderer.

Implements QgsDiagramRendererV2.

Definition at line 379 of file qgsdiagramrendererv2.cpp.

References mSettings.

bool QgsSingleCategoryDiagramRenderer::diagramSettings ( const QgsFeature feature,
const QgsRenderContext c,
QgsDiagramSettings s 
)
protectedvirtual

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 367 of file qgsdiagramrendererv2.cpp.

References mSettings.

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

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

Implements QgsDiagramRendererV2.

Definition at line 374 of file qgsdiagramrendererv2.cpp.

References QgsFeature::attributes(), QgsDiagramRendererV2::mDiagram, and mSettings.

void QgsSingleCategoryDiagramRenderer::readXML ( const QDomElement &  elem,
const QgsVectorLayer layer 
)
virtual
QString QgsSingleCategoryDiagramRenderer::rendererName ( ) const
inlinevirtual

Implements QgsDiagramRendererV2.

Definition at line 224 of file qgsdiagramrendererv2.h.

void QgsSingleCategoryDiagramRenderer::setDiagramSettings ( const QgsDiagramSettings s)
inline

Definition at line 228 of file qgsdiagramrendererv2.h.

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

Member Data Documentation

QgsDiagramSettings QgsSingleCategoryDiagramRenderer::mSettings
private

Definition at line 241 of file qgsdiagramrendererv2.h.

Referenced by diagramSettings(), diagramSize(), readXML(), and writeXML().


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