QGIS API Documentation
2.2.0-Valmiera
|
Returns diagram settings for a feature. More...
#include <qgsdiagramrendererv2.h>
Public Member Functions | |
QgsDiagramRendererV2 () | |
virtual | ~QgsDiagramRendererV2 () |
virtual QSizeF | sizeMapUnits (const QgsFeature &feature, const QgsRenderContext &c) |
Returns size of the diagram for a feature in map units. | |
virtual QString | rendererName () const =0 |
virtual QList< QString > | diagramAttributes () const =0 |
Returns attribute indices needed for diagram rendering. | |
void | renderDiagram (const QgsFeature &feature, QgsRenderContext &c, const QPointF &pos) |
void | setDiagram (QgsDiagram *d) |
QgsDiagram * | diagram () const |
virtual QList< QgsDiagramSettings > | diagramSettings () const =0 |
Returns list with all diagram settings in the renderer. | |
virtual void | readXML (const QDomElement &elem, const QgsVectorLayer *layer)=0 |
virtual void | writeXML (QDomElement &layerElem, QDomDocument &doc, const QgsVectorLayer *layer) const =0 |
Protected Member Functions | |
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). | |
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. | |
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 |
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 165 of file qgsdiagramrendererv2.h.
QgsDiagramRendererV2::QgsDiagramRendererV2 | ( | ) |
Definition at line 252 of file qgsdiagramrendererv2.cpp.
|
virtual |
Definition at line 256 of file qgsdiagramrendererv2.cpp.
References mDiagram.
|
protected |
Definition at line 324 of file qgsdiagramrendererv2.cpp.
References mDiagram.
Referenced by QgsSingleCategoryDiagramRenderer::readXML(), and QgsLinearlyInterpolatedDiagramRenderer::readXML().
|
protected |
Definition at line 348 of file qgsdiagramrendererv2.cpp.
References mDiagram.
Referenced by QgsSingleCategoryDiagramRenderer::writeXML(), and QgsLinearlyInterpolatedDiagramRenderer::writeXML().
|
protected |
Converts size from mm to map units.
Definition at line 299 of file qgsdiagramrendererv2.cpp.
References QgsRenderContext::mapToPixel(), QgsMapToPixel::mapUnitsPerPixel(), and QgsRenderContext::scaleFactor().
Referenced by sizeMapUnits().
|
inline |
Definition at line 183 of file qgsdiagramrendererv2.h.
Referenced by QgsVectorLayer::prepareLabelingAndDiagrams().
|
pure virtual |
Returns attribute indices needed for diagram rendering.
Implemented in QgsLinearlyInterpolatedDiagramRenderer, and QgsSingleCategoryDiagramRenderer.
Referenced by QgsVectorLayer::prepareLabelingAndDiagrams().
|
pure virtual |
Returns list with all diagram settings in the renderer.
Implemented in QgsLinearlyInterpolatedDiagramRenderer, and QgsSingleCategoryDiagramRenderer.
Referenced by renderDiagram(), and sizeMapUnits().
|
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()
feature | the feature |
c | render context |
s | out: diagram settings for the feature |
Implemented in QgsLinearlyInterpolatedDiagramRenderer, and QgsSingleCategoryDiagramRenderer.
|
protectedpure 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().
|
staticprotected |
Returns the paint device dpi (or -1 in case of error.
Definition at line 311 of file qgsdiagramrendererv2.cpp.
|
pure virtual |
Implemented in QgsLinearlyInterpolatedDiagramRenderer, and QgsSingleCategoryDiagramRenderer.
Referenced by QgsVectorLayer::readSymbology().
void QgsDiagramRendererV2::renderDiagram | ( | const QgsFeature & | feature, |
QgsRenderContext & | c, | ||
const QPointF & | pos | ||
) |
Definition at line 267 of file qgsdiagramrendererv2.cpp.
References diagramSettings(), and mDiagram.
|
pure virtual |
Implemented in QgsLinearlyInterpolatedDiagramRenderer, and QgsSingleCategoryDiagramRenderer.
void QgsDiagramRendererV2::setDiagram | ( | QgsDiagram * | d | ) |
Definition at line 261 of file qgsdiagramrendererv2.cpp.
References mDiagram.
|
virtual |
Returns size of the diagram for a feature in map units.
Returns an invalid QSizeF in case of error
Definition at line 283 of file qgsdiagramrendererv2.cpp.
References convertSizeToMapUnits(), diagramSettings(), diagramSize(), QgsDiagramSettings::MM, size, and QgsDiagramSettings::sizeType.
Referenced by QgsPalLabeling::registerDiagramFeature().
|
pure virtual |
Implemented in QgsLinearlyInterpolatedDiagramRenderer, and QgsSingleCategoryDiagramRenderer.
Referenced by QgsVectorLayer::writeSymbology().
|
protected |
Reference to the object that does the real diagram rendering.
Definition at line 214 of file qgsdiagramrendererv2.h.
Referenced by _readXML(), _writeXML(), QgsSingleCategoryDiagramRenderer::diagramSize(), QgsLinearlyInterpolatedDiagramRenderer::diagramSize(), renderDiagram(), setDiagram(), and ~QgsDiagramRendererV2().