|
Quantum GIS API Documentation
1.8
|
Returns diagram settings for a feature. More...
#include <qgsdiagramrendererv2.h>


Public Member Functions | |
| QgsDiagramRendererV2 () | |
| virtual | ~QgsDiagramRendererV2 () |
| virtual QSizeF | sizeMapUnits (const QgsAttributeMap &attributes, const QgsRenderContext &c) |
| Returns size of the diagram for feature f in map units. | |
| virtual QString | rendererName () const =0 |
| virtual QList< int > | diagramAttributes () const =0 |
| Returns attribute indices needed for diagram rendering. | |
| void | renderDiagram (const QgsAttributeMap &att, QgsRenderContext &c, const QPointF &pos) |
| void | setDiagram (QgsDiagram *d) |
| const QgsDiagram * | diagram () const |
| virtual QList< QgsDiagramSettings > | diagramSettings () const =0 |
| Returns list with all diagram settings in the renderer. | |
| virtual void | readXML (const QDomElement &elem)=0 |
| virtual void | writeXML (QDomElement &layerElem, QDomDocument &doc) const =0 |
Protected Member Functions | |
| virtual bool | diagramSettings (const QgsAttributeMap &att, 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). | |
| virtual QSizeF | diagramSize (const QgsAttributeMap &attributes, const QgsRenderContext &c)=0 |
| Returns size of the diagram (in painter units) or an invalid size in case of error. | |
| void | convertSizeToMapUnits (QSizeF &size, const QgsRenderContext &context) const |
| Converts size from mm to map units. | |
| void | _readXML (const QDomElement &elem) |
| void | _writeXML (QDomElement &rendererElem, QDomDocument &doc) const |
Static Protected Member Functions | |
| static int | dpiPaintDevice (const QPainter *) |
| Returns the paint device dpi (or -1 in case of error. | |
Protected Attributes | |
| QgsDiagram * | mDiagram |
| Reference to the object that does the real diagram rendering. | |
Returns diagram settings for a feature.
Definition at line 119 of file qgsdiagramrendererv2.h.
Definition at line 133 of file qgsdiagramrendererv2.cpp.
| QgsDiagramRendererV2::~QgsDiagramRendererV2 | ( | ) | [virtual] |
Definition at line 137 of file qgsdiagramrendererv2.cpp.
References mDiagram.
| void QgsDiagramRendererV2::_readXML | ( | const QDomElement & | elem | ) | [protected] |
Definition at line 211 of file qgsdiagramrendererv2.cpp.
References mDiagram.
Referenced by QgsSingleCategoryDiagramRenderer::readXML(), and QgsLinearlyInterpolatedDiagramRenderer::readXML().
| void QgsDiagramRendererV2::_writeXML | ( | QDomElement & | rendererElem, |
| QDomDocument & | doc | ||
| ) | const [protected] |
Definition at line 229 of file qgsdiagramrendererv2.cpp.
References QgsDiagram::diagramName(), and mDiagram.
Referenced by QgsSingleCategoryDiagramRenderer::writeXML(), and QgsLinearlyInterpolatedDiagramRenderer::writeXML().
| void QgsDiagramRendererV2::convertSizeToMapUnits | ( | QSizeF & | size, |
| const QgsRenderContext & | context | ||
| ) | const [protected] |
Converts size from mm to map units.
Definition at line 180 of file qgsdiagramrendererv2.cpp.
References QgsRenderContext::constPainter(), dpiPaintDevice(), QgsRenderContext::mapToPixel(), and QgsMapToPixel::mapUnitsPerPixel().
Referenced by sizeMapUnits().
| const QgsDiagram* QgsDiagramRendererV2::diagram | ( | ) | const [inline] |
Definition at line 137 of file qgsdiagramrendererv2.h.
| virtual QList<int> QgsDiagramRendererV2::diagramAttributes | ( | ) | const [pure virtual] |
Returns attribute indices needed for diagram rendering.
Implemented in QgsLinearlyInterpolatedDiagramRenderer, and QgsSingleCategoryDiagramRenderer.
Referenced by QgsVectorLayer::prepareLabelingAndDiagrams(), and QgsPalLabeling::registerDiagramFeature().
| virtual QList<QgsDiagramSettings> QgsDiagramRendererV2::diagramSettings | ( | ) | const [pure virtual] |
Returns list with all diagram settings in the renderer.
Implemented in QgsLinearlyInterpolatedDiagramRenderer, and QgsSingleCategoryDiagramRenderer.
Referenced by renderDiagram(), and sizeMapUnits().
| virtual bool QgsDiagramRendererV2::diagramSettings | ( | const QgsAttributeMap & | att, |
| const QgsRenderContext & | c, | ||
| QgsDiagramSettings & | s | ||
| ) | [protected, pure virtual] |
Returns diagram settings for a feature (or false if the diagram for the feature is not to be rendered).
Used internally within renderDiagram()
| att | attribute map |
| c | render context |
| s | out: diagram settings for the feature |
Implemented in QgsLinearlyInterpolatedDiagramRenderer, and QgsSingleCategoryDiagramRenderer.
| virtual QSizeF QgsDiagramRendererV2::diagramSize | ( | const QgsAttributeMap & | attributes, |
| const QgsRenderContext & | c | ||
| ) | [protected, pure virtual] |
Returns size of the diagram (in painter units) or an invalid size in case of error.
Implemented in QgsLinearlyInterpolatedDiagramRenderer, and QgsSingleCategoryDiagramRenderer.
Referenced by sizeMapUnits().
| int QgsDiagramRendererV2::dpiPaintDevice | ( | const QPainter * | painter | ) | [static, protected] |
Returns the paint device dpi (or -1 in case of error.
Definition at line 198 of file qgsdiagramrendererv2.cpp.
Referenced by convertSizeToMapUnits().
| virtual void QgsDiagramRendererV2::readXML | ( | const QDomElement & | elem | ) | [pure virtual] |
Implemented in QgsLinearlyInterpolatedDiagramRenderer, and QgsSingleCategoryDiagramRenderer.
Referenced by QgsVectorLayer::readSymbology().
| void QgsDiagramRendererV2::renderDiagram | ( | const QgsAttributeMap & | att, |
| QgsRenderContext & | c, | ||
| const QPointF & | pos | ||
| ) |
Definition at line 148 of file qgsdiagramrendererv2.cpp.
References diagramSettings(), mDiagram, and QgsDiagram::renderDiagram().
| virtual QString QgsDiagramRendererV2::rendererName | ( | ) | const [pure virtual] |
Implemented in QgsLinearlyInterpolatedDiagramRenderer, and QgsSingleCategoryDiagramRenderer.
| void QgsDiagramRendererV2::setDiagram | ( | QgsDiagram * | d | ) |
Definition at line 142 of file qgsdiagramrendererv2.cpp.
References mDiagram.
| QSizeF QgsDiagramRendererV2::sizeMapUnits | ( | const QgsAttributeMap & | attributes, |
| const QgsRenderContext & | c | ||
| ) | [virtual] |
Returns size of the diagram for feature f in map units.
Returns an invalid QSizeF in case of error
Definition at line 164 of file qgsdiagramrendererv2.cpp.
References convertSizeToMapUnits(), diagramSettings(), diagramSize(), QgsDiagramSettings::MM, size, and QgsDiagramSettings::sizeType.
Referenced by QgsPalLabeling::registerDiagramFeature().
| virtual void QgsDiagramRendererV2::writeXML | ( | QDomElement & | layerElem, |
| QDomDocument & | doc | ||
| ) | const [pure virtual] |
Implemented in QgsLinearlyInterpolatedDiagramRenderer, and QgsSingleCategoryDiagramRenderer.
Referenced by QgsVectorLayer::writeSymbology().
QgsDiagram* QgsDiagramRendererV2::mDiagram [protected] |
Reference to the object that does the real diagram rendering.
Definition at line 168 of file qgsdiagramrendererv2.h.
Referenced by _readXML(), _writeXML(), renderDiagram(), setDiagram(), and ~QgsDiagramRendererV2().
1.7.6.1