|
| 1 | +class QgsHeatmapRenderer : QgsFeatureRendererV2 |
| 2 | +{ |
| 3 | +%TypeHeaderCode |
| 4 | +#include <qgsheatmaprenderer.h> |
| 5 | +%End |
| 6 | + public: |
| 7 | + |
| 8 | + QgsHeatmapRenderer(); |
| 9 | + virtual ~QgsHeatmapRenderer(); |
| 10 | + |
| 11 | + //reimplemented methods |
| 12 | + virtual QgsFeatureRendererV2* clone() const /Factory/; |
| 13 | + virtual void startRender( QgsRenderContext& context, const QgsFields& fields ); |
| 14 | + virtual bool renderFeature( QgsFeature& feature, QgsRenderContext& context, int layer = -1, bool selected = false, bool drawVertexMarker = false ); |
| 15 | + virtual void stopRender( QgsRenderContext& context ); |
| 16 | + virtual QgsSymbolV2* symbolForFeature( QgsFeature& feature ); |
| 17 | + virtual QgsSymbolV2List symbols(); |
| 18 | + virtual QString dump() const; |
| 19 | + virtual QList<QString> usedAttributes(); |
| 20 | + static QgsFeatureRendererV2* create( QDomElement& element ) /Factory/; |
| 21 | + virtual QDomElement save( QDomDocument& doc ); |
| 22 | + static QgsHeatmapRenderer* convertFromRenderer( const QgsFeatureRendererV2* renderer ) /Factory/; |
| 23 | + |
| 24 | + //reimplemented to extent the request so that points up to heatmap's radius distance outside |
| 25 | + //visible area are included |
| 26 | + virtual void modifyRequestExtent( QgsRectangle& extent, QgsRenderContext& context ); |
| 27 | + |
| 28 | + //heatmap specific methods |
| 29 | + |
| 30 | + /**Returns the color ramp used for shading the heatmap. |
| 31 | + * @returns color ramp for heatmap |
| 32 | + * @see setColorRamp |
| 33 | + */ |
| 34 | + QgsVectorColorRampV2* colorRamp() const; |
| 35 | + /**Sets the color ramp to use for shading the heatmap. |
| 36 | + * @param ramp color ramp for heatmap. Ownership of ramp is transferred to the renderer. |
| 37 | + * @see colorRamp |
| 38 | + */ |
| 39 | + void setColorRamp( QgsVectorColorRampV2* ramp /Transfer/ ); |
| 40 | + |
| 41 | + /**Returns the radius for the heatmap |
| 42 | + * @returns heatmap radius |
| 43 | + * @see setRadius |
| 44 | + * @see radiusUnit |
| 45 | + * @see radiusMapUnitScale |
| 46 | + */ |
| 47 | + double radius() const; |
| 48 | + /**Sets the radius for the heatmap |
| 49 | + * @param radius heatmap radius |
| 50 | + * @see radius |
| 51 | + * @see setRadiusUnit |
| 52 | + * @see setRadiusMapUnitScale |
| 53 | + */ |
| 54 | + void setRadius( const double radius ); |
| 55 | + |
| 56 | + /**Returns the units used for the heatmap's radius |
| 57 | + * @returns units for heatmap radius |
| 58 | + * @see radius |
| 59 | + * @see setRadiusUnit |
| 60 | + * @see radiusMapUnitScale |
| 61 | + */ |
| 62 | + QgsSymbolV2::OutputUnit radiusUnit() const; |
| 63 | + /**Sets the units used for the heatmap's radius |
| 64 | + * @param unit units for heatmap radius |
| 65 | + * @see radiusUnit |
| 66 | + * @see setRadius |
| 67 | + * @see radiusMapUnitScale |
| 68 | + */ |
| 69 | + void setRadiusUnit( const QgsSymbolV2::OutputUnit unit ); |
| 70 | + |
| 71 | + /**Returns the map unit scale used for the heatmap's radius |
| 72 | + * @returns map unit scale for heatmap's radius |
| 73 | + * @see radius |
| 74 | + * @see radiusUnit |
| 75 | + * @see setRadiusMapUnitScale |
| 76 | + */ |
| 77 | + const QgsMapUnitScale& radiusMapUnitScale() const; |
| 78 | + /**Sets the map unit scale used for the heatmap's radius |
| 79 | + * @param scale map unit scale for heatmap's radius |
| 80 | + * @see setRadius |
| 81 | + * @see setRadiusUnit |
| 82 | + * @see radiusMapUnitScale |
| 83 | + */ |
| 84 | + void setRadiusMapUnitScale( const QgsMapUnitScale& scale ); |
| 85 | + |
| 86 | + /**Returns the maximum value used for shading the heatmap. |
| 87 | + * @returns maximum value for heatmap shading. If 0, then maximum value will be automatically |
| 88 | + * calculated. |
| 89 | + * @see setMaximumValue |
| 90 | + */ |
| 91 | + double maximumValue() const; |
| 92 | + /**Sets the maximum value used for shading the heatmap. |
| 93 | + * @param value maximum value for heatmap shading. Set to 0 for automatic calculation of |
| 94 | + * maximum value. |
| 95 | + * @see maximumValue |
| 96 | + */ |
| 97 | + void setMaximumValue( const double value ); |
| 98 | + |
| 99 | + /**Returns the render quality used for drawing the heatmap. |
| 100 | + * @returns render quality. A value of 1 indicates maximum quality, and increasing the |
| 101 | + * value will result in faster drawing but lower quality rendering. |
| 102 | + * @see setRenderQuality |
| 103 | + */ |
| 104 | + double renderQuality() const; |
| 105 | + /**Sets the render quality used for drawing the heatmap. |
| 106 | + * @param quality render quality. A value of 1 indicates maximum quality, and increasing the |
| 107 | + * value will result in faster drawing but lower quality rendering. |
| 108 | + * @see renderQuality |
| 109 | + */ |
| 110 | + void setRenderQuality( const int quality ); |
| 111 | + |
| 112 | +}; |
0 commit comments