QGIS API Documentation  2.11.0-Master
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Static Protected Member Functions | Protected Attributes | List of all members
QgsGraduatedSymbolRendererV2 Class Reference

#include <qgsgraduatedsymbolrendererv2.h>

Inheritance diagram for QgsGraduatedSymbolRendererV2:
Inheritance graph
[legend]

Public Types

enum  GraduatedMethod { GraduatedColor = 0, GraduatedSize = 1 }
 
enum  Mode {
  EqualInterval, Quantile, Jenks, StdDev,
  Pretty, Custom
}
 
- Public Types inherited from QgsFeatureRendererV2
enum  Capabilities {
  SymbolLevels = 1, RotationField = 1 << 1, MoreSymbolsPerFeature = 1 << 2, Filter = 1 << 3,
  ScaleDependent = 1 << 4
}
 

Public Member Functions

 QgsGraduatedSymbolRendererV2 (QString attrName=QString(), QgsRangeList ranges=QgsRangeList())
 
 QgsGraduatedSymbolRendererV2 (const QgsGraduatedSymbolRendererV2 &other)
 
virtual ~QgsGraduatedSymbolRendererV2 ()
 
void addBreak (double breakValue, bool updateSymbols=true)
 Add a breakpoint by splitting existing classes so that the specified value becomes a break between two classes. More...
 
void addClass (QgsSymbolV2 *symbol)
 
void addClass (QgsRendererRangeV2 range)
 
void addClass (double lower, double upper)
 
void calculateLabelPrecision (bool updateRanges=true)
 Reset the label decimal places to a numberbased on the minimum class interval. More...
 
virtual int capabilities () override
 returns bitwise OR-ed capabilities of the renderer More...
 
virtual void checkLegendSymbolItem (QString key, bool state=true) override
 item in symbology was checked More...
 
QString classAttribute () const
 
virtual QgsFeatureRendererV2clone () const override
 
void deleteAllClasses ()
 
void deleteClass (int idx)
 
virtual QString dump () const override
 for debugging More...
 
Q_DECL_DEPRECATED QList< double > getDataValues (QgsVectorLayer *vlayer)
 Evaluates the data expression and returns the list of values from the layer. More...
 
GraduatedMethod graduatedMethod () const
 return the method used for graduation (either size or color) More...
 
bool invertedColorRamp ()
 
const
QgsRendererRangeV2LabelFormat
labelFormat () const
 Return the label format used to generate default classification labels. More...
 
virtual QString legendClassificationAttribute () const override
 If supported by the renderer, return classification attribute for the use in legend. More...
 
virtual bool legendSymbolItemChecked (QString key) override
 item in symbology was checked More...
 
virtual QgsLegendSymbolList legendSymbolItems (double scaleDenominator=-1, QString rule=QString()) override
 return a list of item text / symbol More...
 
virtual bool legendSymbolItemsCheckable () const override
 items of symbology items in legend should be checkable More...
 
QgsLegendSymbolListV2 legendSymbolItemsV2 () const override
 
virtual QgsLegendSymbologyList legendSymbologyItems (QSize iconSize) override
 return a list of symbology items for the legend More...
 
double maxSymbolSize () const
 return the max symbol size when graduated by size More...
 
double minSymbolSize () const
 return the min symbol size when graduated by size More...
 
Mode mode () const
 
void moveClass (int from, int to)
 Moves the category at index position from to index position to. More...
 
virtual QgsSymbolV2originalSymbolForFeature (QgsFeature &feature, QgsRenderContext &context) override
 Return symbol for feature. More...
 
const QgsRangeListranges () const
 
bool rangesHaveGaps () const
 Tests whether classes assigned to the renderer have gaps between the ranges. More...
 
bool rangesOverlap () const
 Tests whether classes assigned to the renderer have ranges which overlap. More...
 
Q_DECL_DEPRECATED QString rotationField () const override
 return rotation field name (or empty string if not set or not supported by renderer) More...
 
virtual QDomElement save (QDomDocument &doc) override
 store renderer info to XML element More...
 
QgsSymbolV2::ScaleMethod scaleMethod () const
 
void setClassAttribute (QString attr)
 
void setGraduatedMethod (GraduatedMethod method)
 set the method used for graduation (either size or color) More...
 
void setInvertedColorRamp (bool inverted)
 
void setLabelFormat (const QgsRendererRangeV2LabelFormat &labelFormat, bool updateRanges=false)
 Set the label format used to generate default classification labels. More...
 
void setMode (Mode mode)
 
Q_DECL_DEPRECATED void setRotationField (QString fieldOrExpression) override
 sets rotation field of renderer (if supported by the renderer) More...
 
void setScaleMethod (QgsSymbolV2::ScaleMethod scaleMethod)
 
void setSizeScaleField (QString fieldOrExpression)
 
void setSourceColorRamp (QgsVectorColorRampV2 *ramp)
 
void setSourceSymbol (QgsSymbolV2 *sym)
 
void setSymbolSizes (double minSize, double maxSize)
 set varying symbol size for classes More...
 
QString sizeScaleField () const
 
void sortByLabel (Qt::SortOrder order=Qt::AscendingOrder)
 
void sortByValue (Qt::SortOrder order=Qt::AscendingOrder)
 
QgsVectorColorRampV2sourceColorRamp ()
 
QgsSymbolV2sourceSymbol ()
 
virtual void startRender (QgsRenderContext &context, const QgsFields &fields) override
 Needs to be called when a new render cycle is started. More...
 
virtual void stopRender (QgsRenderContext &context) override
 
virtual QgsSymbolV2symbolForFeature (QgsFeature &feature, QgsRenderContext &context) override
 To be overridden. More...
 
virtual QgsSymbolV2List symbols (QgsRenderContext &context) override
 Returns list of symbols used by the renderer. More...
 
virtual void toSld (QDomDocument &doc, QDomElement &element) const override
 used from subclasses to create SLD Rule elements following SLD v1.1 specs More...
 
void updateClasses (QgsVectorLayer *vlayer, Mode mode, int nclasses)
 Recalculate classes for a layer. More...
 
void updateColorRamp (QgsVectorColorRampV2 *ramp=0, bool inverted=false)
 Update the color ramp used. More...
 
bool updateRangeLabel (int rangeIndex, QString label)
 
bool updateRangeLowerValue (int rangeIndex, double value)
 
bool updateRangeRenderState (int rangeIndex, bool render)
 
bool updateRangeSymbol (int rangeIndex, QgsSymbolV2 *symbol)
 
bool updateRangeUpperValue (int rangeIndex, double value)
 
void updateSymbols (QgsSymbolV2 *sym)
 Update all the symbols but leave breaks and colors. More...
 
virtual QList< QStringusedAttributes () override
 
- Public Member Functions inherited from QgsFeatureRendererV2
virtual ~QgsFeatureRendererV2 ()
 
virtual QString filter ()
 If a renderer does not require all the features this method may be overridden and return an expression used as where clause. More...
 
bool forceRasterRender () const
 Returns whether the renderer must render as a raster. More...
 
virtual void modifyRequestExtent (QgsRectangle &extent, QgsRenderContext &context)
 Allows for a renderer to modify the extent of a feature request prior to rendering. More...
 
virtual Q_DECL_DEPRECATED
QgsSymbolV2
originalSymbolForFeature (QgsFeature &feature)
 Return symbol for feature. More...
 
virtual Q_DECL_DEPRECATED
QgsSymbolV2List 
originalSymbolsForFeature (QgsFeature &feat)
 Equivalent of originalSymbolsForFeature() call extended to support renderers that may use more symbols per feature - similar to symbolsForFeature() More...
 
virtual QgsSymbolV2List originalSymbolsForFeature (QgsFeature &feat, QgsRenderContext &context)
 Equivalent of originalSymbolsForFeature() call extended to support renderers that may use more symbols per feature - similar to symbolsForFeature() More...
 
QgsPaintEffectpaintEffect () const
 Returns the current paint effect for the renderer. More...
 
virtual bool renderFeature (QgsFeature &feature, QgsRenderContext &context, int layer=-1, bool selected=false, bool drawVertexMarker=false)
 
void setForceRasterRender (bool forceRaster)
 Sets whether the renderer should be rendered to a raster destination. More...
 
void setPaintEffect (QgsPaintEffect *effect)
 Sets the current paint effect for the renderer. More...
 
void setUsingSymbolLevels (bool usingSymbolLevels)
 
void setVertexMarkerAppearance (int type, int size)
 set type and size of editing vertex markers for subsequent rendering More...
 
virtual Q_DECL_DEPRECATED void startRender (QgsRenderContext &context, const QgsVectorLayer *vlayer)
 
virtual Q_DECL_DEPRECATED
QgsSymbolV2
symbolForFeature (QgsFeature &feature)
 To be overridden. More...
 
virtual Q_DECL_DEPRECATED
QgsSymbolV2List 
symbols ()
 for symbol levels More...
 
virtual Q_DECL_DEPRECATED
QgsSymbolV2List 
symbolsForFeature (QgsFeature &feat)
 return list of symbols used for rendering the feature. More...
 
virtual QgsSymbolV2List symbolsForFeature (QgsFeature &feat, QgsRenderContext &context)
 return list of symbols used for rendering the feature. More...
 
QString type () const
 
bool usingSymbolLevels () const
 
virtual Q_DECL_DEPRECATED bool willRenderFeature (QgsFeature &feat)
 return whether the renderer will render a feature or not. More...
 
virtual bool willRenderFeature (QgsFeature &feat, QgsRenderContext &context)
 Returns whether the renderer will render a feature or not. More...
 
virtual Q_DECL_DEPRECATED
QDomElement 
writeSld (QDomDocument &doc, const QgsVectorLayer &layer) const
 create the SLD UserStyle element following the SLD v1.1 specs More...
 
virtual QDomElement writeSld (QDomDocument &doc, const QString &styleName) const
 create the SLD UserStyle element following the SLD v1.1 specs with the given name More...
 

Static Public Member Functions

static
QgsGraduatedSymbolRendererV2
convertFromRenderer (const QgsFeatureRendererV2 *renderer)
 creates a QgsGraduatedSymbolRendererV2 from an existing renderer. More...
 
static QgsFeatureRendererV2create (QDomElement &element)
 create renderer from XML element More...
 
static
QgsGraduatedSymbolRendererV2
createRenderer (QgsVectorLayer *vlayer, QString attrName, int classes, Mode mode, QgsSymbolV2 *symbol, QgsVectorColorRampV2 *ramp, bool inverted=false, QgsRendererRangeV2LabelFormat legendFormat=QgsRendererRangeV2LabelFormat())
 
- Static Public Member Functions inherited from QgsFeatureRendererV2
static QgsFeatureRendererV2defaultRenderer (QGis::GeometryType geomType)
 return a new renderer - used by default in vector layers More...
 
static QgsFeatureRendererV2load (QDomElement &symbologyElem)
 create a renderer from XML element More...
 
static QgsFeatureRendererV2loadSld (const QDomNode &node, QGis::GeometryType geomType, QString &errorMessage)
 Create a new renderer according to the information contained in the UserStyle element of a SLD style document. More...
 

Protected Member Functions

QgsSymbolV2symbolForValue (double value)
 
- Protected Member Functions inherited from QgsFeatureRendererV2
 QgsFeatureRendererV2 (QString type)
 
void copyPaintEffect (QgsFeatureRendererV2 *destRenderer) const
 Copies paint effect of this renderer to another renderer. More...
 
void renderFeatureWithSymbol (QgsFeature &feature, QgsSymbolV2 *symbol, QgsRenderContext &context, int layer, bool selected, bool drawVertexMarker)
 
void renderVertexMarker (QPointF &pt, QgsRenderContext &context)
 render editing vertex marker at specified point More...
 
void renderVertexMarkerPolygon (QPolygonF &pts, QList< QPolygonF > *rings, QgsRenderContext &context)
 render editing vertex marker for a polygon More...
 
void renderVertexMarkerPolyline (QPolygonF &pts, QgsRenderContext &context)
 render editing vertex marker for a polyline More...
 
void setScaleMethodToSymbol (QgsSymbolV2 *symbol, int scaleMethod)
 

Static Protected Member Functions

static const char * graduatedMethodStr (GraduatedMethod method)
 
- Static Protected Member Functions inherited from QgsFeatureRendererV2
static const unsigned char * _getLineString (QPolygonF &pts, QgsRenderContext &context, const unsigned char *wkb, bool clipToExtent=true)
 
static const unsigned char * _getPoint (QPointF &pt, QgsRenderContext &context, const unsigned char *wkb)
 
static const unsigned char * _getPolygon (QPolygonF &pts, QList< QPolygonF > &holes, QgsRenderContext &context, const unsigned char *wkb, bool clipToExtent=true)
 
static void convertSymbolRotation (QgsSymbolV2 *symbol, const QString &field)
 
static void convertSymbolSizeScale (QgsSymbolV2 *symbol, QgsSymbolV2::ScaleMethod method, const QString &field)
 

Protected Attributes

QString mAttrName
 
int mAttrNum
 attribute index (derived from attribute name in startRender) More...
 
bool mCounting
 
QScopedPointer< QgsExpressionmExpression
 
GraduatedMethod mGraduatedMethod
 
bool mInvertedColorRamp
 
QgsRendererRangeV2LabelFormat mLabelFormat
 
Mode mMode
 
QgsRangeList mRanges
 
QScopedPointer< QgsExpressionmRotation
 
QgsSymbolV2::ScaleMethod mScaleMethod
 
QScopedPointer< QgsExpressionmSizeScale
 
QScopedPointer
< QgsVectorColorRampV2
mSourceColorRamp
 
QScopedPointer< QgsSymbolV2mSourceSymbol
 
QHash< QgsSymbolV2
*, QgsSymbolV2 * > 
mTempSymbols
 temporary symbols, used for data-defined rotation and scaling More...
 
- Protected Attributes inherited from QgsFeatureRendererV2
int mCurrentVertexMarkerSize
 The current size of editing marker. More...
 
int mCurrentVertexMarkerType
 The current type of editing marker. More...
 
bool mForceRaster
 
QgsPaintEffectmPaintEffect
 
QString mType
 
bool mUsingSymbolLevels
 

Detailed Description

Definition at line 113 of file qgsgraduatedsymbolrendererv2.h.

Member Enumeration Documentation

Enumerator
GraduatedColor 
GraduatedSize 

Definition at line 288 of file qgsgraduatedsymbolrendererv2.h.

Enumerator
EqualInterval 
Quantile 
Jenks 
StdDev 
Pretty 
Custom 

Definition at line 191 of file qgsgraduatedsymbolrendererv2.h.

Constructor & Destructor Documentation

QgsGraduatedSymbolRendererV2::QgsGraduatedSymbolRendererV2 ( QString  attrName = QString(),
QgsRangeList  ranges = QgsRangeList() 
)

Definition at line 283 of file qgsgraduatedsymbolrendererv2.cpp.

QgsGraduatedSymbolRendererV2::QgsGraduatedSymbolRendererV2 ( const QgsGraduatedSymbolRendererV2 other)
QgsGraduatedSymbolRendererV2::~QgsGraduatedSymbolRendererV2 ( )
virtual

Definition at line 298 of file qgsgraduatedsymbolrendererv2.cpp.

Member Function Documentation

void QgsGraduatedSymbolRendererV2::addBreak ( double  breakValue,
bool  updateSymbols = true 
)

Add a breakpoint by splitting existing classes so that the specified value becomes a break between two classes.

Parameters
breakValueposition to insert break
updateSymbolsset to true to reapply ramp colors to the new symbol ranges
Note
added in QGIS 2.9

Definition at line 1446 of file qgsgraduatedsymbolrendererv2.cpp.

void QgsGraduatedSymbolRendererV2::addClass ( QgsSymbolV2 symbol)

Definition at line 1432 of file qgsgraduatedsymbolrendererv2.cpp.

void QgsGraduatedSymbolRendererV2::addClass ( QgsRendererRangeV2  range)
Note
available in python bindings as addClassRange

Definition at line 1485 of file qgsgraduatedsymbolrendererv2.cpp.

void QgsGraduatedSymbolRendererV2::addClass ( double  lower,
double  upper 
)
Note
available in python bindings as addClassLowerUpper

Definition at line 1439 of file qgsgraduatedsymbolrendererv2.cpp.

void QgsGraduatedSymbolRendererV2::calculateLabelPrecision ( bool  updateRanges = true)

Reset the label decimal places to a numberbased on the minimum class interval.

Parameters
updateRangesif true then ranges currently using the default label will be updated
Note
Added in 2.6

Definition at line 1513 of file qgsgraduatedsymbolrendererv2.cpp.

virtual int QgsGraduatedSymbolRendererV2::capabilities ( )
inlineoverridevirtual

returns bitwise OR-ed capabilities of the renderer

Reimplemented from QgsFeatureRendererV2.

Definition at line 139 of file qgsgraduatedsymbolrendererv2.h.

void QgsGraduatedSymbolRendererV2::checkLegendSymbolItem ( QString  key,
bool  state = true 
)
overridevirtual

item in symbology was checked

Note
added in 2.6

Reimplemented from QgsFeatureRendererV2.

Definition at line 1423 of file qgsgraduatedsymbolrendererv2.cpp.

QString QgsGraduatedSymbolRendererV2::classAttribute ( ) const
inline

Definition at line 143 of file qgsgraduatedsymbolrendererv2.h.

QgsFeatureRendererV2 * QgsGraduatedSymbolRendererV2::clone ( ) const
overridevirtual

Implements QgsFeatureRendererV2.

Definition at line 510 of file qgsgraduatedsymbolrendererv2.cpp.

QgsGraduatedSymbolRendererV2 * QgsGraduatedSymbolRendererV2::convertFromRenderer ( const QgsFeatureRendererV2 renderer)
static

creates a QgsGraduatedSymbolRendererV2 from an existing renderer.

Note
added in 2.6
Returns
a new renderer if the conversion was possible, otherwise 0.

Definition at line 1644 of file qgsgraduatedsymbolrendererv2.cpp.

QgsFeatureRendererV2 * QgsGraduatedSymbolRendererV2::create ( QDomElement element)
static

create renderer from XML element

Definition at line 941 of file qgsgraduatedsymbolrendererv2.cpp.

QgsGraduatedSymbolRendererV2 * QgsGraduatedSymbolRendererV2::createRenderer ( QgsVectorLayer vlayer,
QString  attrName,
int  classes,
Mode  mode,
QgsSymbolV2 symbol,
QgsVectorColorRampV2 ramp,
bool  inverted = false,
QgsRendererRangeV2LabelFormat  legendFormat = QgsRendererRangeV2LabelFormat() 
)
static

Definition at line 799 of file qgsgraduatedsymbolrendererv2.cpp.

void QgsGraduatedSymbolRendererV2::deleteAllClasses ( )

Definition at line 1495 of file qgsgraduatedsymbolrendererv2.cpp.

void QgsGraduatedSymbolRendererV2::deleteClass ( int  idx)

Definition at line 1490 of file qgsgraduatedsymbolrendererv2.cpp.

QString QgsGraduatedSymbolRendererV2::dump ( ) const
overridevirtual

for debugging

Reimplemented from QgsFeatureRendererV2.

Definition at line 502 of file qgsgraduatedsymbolrendererv2.cpp.

QList< double > QgsGraduatedSymbolRendererV2::getDataValues ( QgsVectorLayer vlayer)

Evaluates the data expression and returns the list of values from the layer.

Parameters
vlayerThe layer for which to evaluate the expression
Note
Added in 2.6
Deprecated:
use QgsVectorLayer::getDoubleValues instead

Definition at line 821 of file qgsgraduatedsymbolrendererv2.cpp.

GraduatedMethod QgsGraduatedSymbolRendererV2::graduatedMethod ( ) const
inline

return the method used for graduation (either size or color)

Note
added in 2.10

Definition at line 292 of file qgsgraduatedsymbolrendererv2.h.

const char * QgsGraduatedSymbolRendererV2::graduatedMethodStr ( GraduatedMethod  method)
staticprotected

Definition at line 1677 of file qgsgraduatedsymbolrendererv2.cpp.

bool QgsGraduatedSymbolRendererV2::invertedColorRamp ( )
inline
Note
added in 2.1

Definition at line 264 of file qgsgraduatedsymbolrendererv2.h.

const QgsRendererRangeV2LabelFormat& QgsGraduatedSymbolRendererV2::labelFormat ( ) const
inline

Return the label format used to generate default classification labels.

Note
Added in 2.6

Definition at line 218 of file qgsgraduatedsymbolrendererv2.h.

virtual QString QgsGraduatedSymbolRendererV2::legendClassificationAttribute ( ) const
inlineoverridevirtual

If supported by the renderer, return classification attribute for the use in legend.

Note
added in 2.6

Reimplemented from QgsFeatureRendererV2.

Definition at line 321 of file qgsgraduatedsymbolrendererv2.h.

bool QgsGraduatedSymbolRendererV2::legendSymbolItemChecked ( QString  key)
overridevirtual

item in symbology was checked

Note
added in 2.6

Reimplemented from QgsFeatureRendererV2.

Definition at line 1413 of file qgsgraduatedsymbolrendererv2.cpp.

QgsLegendSymbolList QgsGraduatedSymbolRendererV2::legendSymbolItems ( double  scaleDenominator = -1,
QString  rule = QString() 
)
overridevirtual

return a list of item text / symbol

Note
not available in python bindings

Reimplemented from QgsFeatureRendererV2.

Definition at line 1228 of file qgsgraduatedsymbolrendererv2.cpp.

bool QgsGraduatedSymbolRendererV2::legendSymbolItemsCheckable ( ) const
overridevirtual

items of symbology items in legend should be checkable

Note
added in 2.5

Reimplemented from QgsFeatureRendererV2.

Definition at line 1408 of file qgsgraduatedsymbolrendererv2.cpp.

QgsLegendSymbolListV2 QgsGraduatedSymbolRendererV2::legendSymbolItemsV2 ( ) const
overridevirtual
Note
added in 2.10

Reimplemented from QgsFeatureRendererV2.

Definition at line 1178 of file qgsgraduatedsymbolrendererv2.cpp.

QgsLegendSymbologyList QgsGraduatedSymbolRendererV2::legendSymbologyItems ( QSize  iconSize)
overridevirtual

return a list of symbology items for the legend

Reimplemented from QgsFeatureRendererV2.

Definition at line 1165 of file qgsgraduatedsymbolrendererv2.cpp.

double QgsGraduatedSymbolRendererV2::maxSymbolSize ( ) const

return the max symbol size when graduated by size

Note
added in 2.10

Definition at line 1277 of file qgsgraduatedsymbolrendererv2.cpp.

double QgsGraduatedSymbolRendererV2::minSymbolSize ( ) const

return the min symbol size when graduated by size

Note
added in 2.10

Definition at line 1262 of file qgsgraduatedsymbolrendererv2.cpp.

Mode QgsGraduatedSymbolRendererV2::mode ( ) const
inline

Definition at line 201 of file qgsgraduatedsymbolrendererv2.h.

void QgsGraduatedSymbolRendererV2::moveClass ( int  from,
int  to 
)

Moves the category at index position from to index position to.

Definition at line 1542 of file qgsgraduatedsymbolrendererv2.cpp.

QgsSymbolV2 * QgsGraduatedSymbolRendererV2::originalSymbolForFeature ( QgsFeature feature,
QgsRenderContext context 
)
overridevirtual

Return symbol for feature.

The difference compared to symbolForFeature() is that it returns original symbol which can be used as an identifier for renderer's rule - the former may return a temporary replacement of a symbol for use in rendering.

Note
added in 2.12

Reimplemented from QgsFeatureRendererV2.

Definition at line 351 of file qgsgraduatedsymbolrendererv2.cpp.

const QgsRangeList& QgsGraduatedSymbolRendererV2::ranges ( ) const
inline

Definition at line 146 of file qgsgraduatedsymbolrendererv2.h.

bool QgsGraduatedSymbolRendererV2::rangesHaveGaps ( ) const

Tests whether classes assigned to the renderer have gaps between the ranges.

Returns
true if ranges have gaps
Note
added in QGIS 2.10

Definition at line 1600 of file qgsgraduatedsymbolrendererv2.cpp.

bool QgsGraduatedSymbolRendererV2::rangesOverlap ( ) const

Tests whether classes assigned to the renderer have ranges which overlap.

Returns
true if ranges overlap
Note
added in QGIS 2.10

Definition at line 1572 of file qgsgraduatedsymbolrendererv2.cpp.

QString QgsGraduatedSymbolRendererV2::rotationField ( ) const
overridevirtual

return rotation field name (or empty string if not set or not supported by renderer)

Deprecated:
use the symbol's methods instead

Reimplemented from QgsFeatureRendererV2.

Definition at line 1376 of file qgsgraduatedsymbolrendererv2.cpp.

QDomElement QgsGraduatedSymbolRendererV2::save ( QDomDocument doc)
overridevirtual

store renderer info to XML element

Reimplemented from QgsFeatureRendererV2.

Definition at line 1070 of file qgsgraduatedsymbolrendererv2.cpp.

QgsSymbolV2::ScaleMethod QgsGraduatedSymbolRendererV2::scaleMethod ( ) const
inline

Definition at line 305 of file qgsgraduatedsymbolrendererv2.h.

void QgsGraduatedSymbolRendererV2::setClassAttribute ( QString  attr)
inline

Definition at line 144 of file qgsgraduatedsymbolrendererv2.h.

void QgsGraduatedSymbolRendererV2::setGraduatedMethod ( GraduatedMethod  method)
inline

set the method used for graduation (either size or color)

Note
added in 2.10

Definition at line 296 of file qgsgraduatedsymbolrendererv2.h.

void QgsGraduatedSymbolRendererV2::setInvertedColorRamp ( bool  inverted)
inline

Definition at line 265 of file qgsgraduatedsymbolrendererv2.h.

void QgsGraduatedSymbolRendererV2::setLabelFormat ( const QgsRendererRangeV2LabelFormat labelFormat,
bool  updateRanges = false 
)

Set the label format used to generate default classification labels.

Parameters
labelFormatThe string appended to classification labels
updateRangesIf true then ranges ending with the old unit string are updated to the new.
Note
Added in 2.6

Definition at line 1500 of file qgsgraduatedsymbolrendererv2.cpp.

void QgsGraduatedSymbolRendererV2::setMode ( Mode  mode)
inline

Definition at line 202 of file qgsgraduatedsymbolrendererv2.h.

void QgsGraduatedSymbolRendererV2::setRotationField ( QString  fieldName)
overridevirtual

sets rotation field of renderer (if supported by the renderer)

Deprecated:
use the symbol's methods instead

Reimplemented from QgsFeatureRendererV2.

Definition at line 1366 of file qgsgraduatedsymbolrendererv2.cpp.

void QgsGraduatedSymbolRendererV2::setScaleMethod ( QgsSymbolV2::ScaleMethod  scaleMethod)

Definition at line 1398 of file qgsgraduatedsymbolrendererv2.cpp.

void QgsGraduatedSymbolRendererV2::setSizeScaleField ( QString  fieldOrExpression)

Definition at line 1388 of file qgsgraduatedsymbolrendererv2.cpp.

void QgsGraduatedSymbolRendererV2::setSourceColorRamp ( QgsVectorColorRampV2 ramp)

Definition at line 1257 of file qgsgraduatedsymbolrendererv2.cpp.

void QgsGraduatedSymbolRendererV2::setSourceSymbol ( QgsSymbolV2 sym)

Definition at line 1247 of file qgsgraduatedsymbolrendererv2.cpp.

void QgsGraduatedSymbolRendererV2::setSymbolSizes ( double  minSize,
double  maxSize 
)

set varying symbol size for classes

Note
the classes must already be set so that symbols exist
added in 2.10

Definition at line 1292 of file qgsgraduatedsymbolrendererv2.cpp.

QString QgsGraduatedSymbolRendererV2::sizeScaleField ( ) const

Definition at line 1393 of file qgsgraduatedsymbolrendererv2.cpp.

void QgsGraduatedSymbolRendererV2::sortByLabel ( Qt::SortOrder  order = Qt::AscendingOrder)

Definition at line 1632 of file qgsgraduatedsymbolrendererv2.cpp.

void QgsGraduatedSymbolRendererV2::sortByValue ( Qt::SortOrder  order = Qt::AscendingOrder)

Definition at line 1559 of file qgsgraduatedsymbolrendererv2.cpp.

QgsVectorColorRampV2 * QgsGraduatedSymbolRendererV2::sourceColorRamp ( )

Definition at line 1252 of file qgsgraduatedsymbolrendererv2.cpp.

QgsSymbolV2 * QgsGraduatedSymbolRendererV2::sourceSymbol ( )

Definition at line 1243 of file qgsgraduatedsymbolrendererv2.cpp.

void QgsGraduatedSymbolRendererV2::startRender ( QgsRenderContext context,
const QgsFields fields 
)
overridevirtual

Needs to be called when a new render cycle is started.

Parameters
contextAdditional information passed to the renderer about the job which will be rendered
fieldsThe fields available for rendering
Returns
Information passed back from the renderer that can e.g. be used to reduce the amount of requested features

Implements QgsFeatureRendererV2.

Definition at line 373 of file qgsgraduatedsymbolrendererv2.cpp.

void QgsGraduatedSymbolRendererV2::stopRender ( QgsRenderContext context)
overridevirtual

Implements QgsFeatureRendererV2.

Definition at line 406 of file qgsgraduatedsymbolrendererv2.cpp.

QgsSymbolV2 * QgsGraduatedSymbolRendererV2::symbolForFeature ( QgsFeature feature,
QgsRenderContext context 
)
overridevirtual

To be overridden.

Parameters
featurefeature
contextrender context
Returns
returns pointer to symbol or 0 if symbol was not found
Note
added in QGIS 2.12

Reimplemented from QgsFeatureRendererV2.

Definition at line 319 of file qgsgraduatedsymbolrendererv2.cpp.

QgsSymbolV2 * QgsGraduatedSymbolRendererV2::symbolForValue ( double  value)
protected

Definition at line 303 of file qgsgraduatedsymbolrendererv2.cpp.

QgsSymbolV2List QgsGraduatedSymbolRendererV2::symbols ( QgsRenderContext context)
overridevirtual

Returns list of symbols used by the renderer.

Parameters
contextrender context
Note
added in QGIS 2.12

Reimplemented from QgsFeatureRendererV2.

Definition at line 547 of file qgsgraduatedsymbolrendererv2.cpp.

void QgsGraduatedSymbolRendererV2::toSld ( QDomDocument doc,
QDomElement element 
) const
overridevirtual

used from subclasses to create SLD Rule elements following SLD v1.1 specs

Reimplemented from QgsFeatureRendererV2.

Definition at line 529 of file qgsgraduatedsymbolrendererv2.cpp.

void QgsGraduatedSymbolRendererV2::updateClasses ( QgsVectorLayer vlayer,
Mode  mode,
int  nclasses 
)

Recalculate classes for a layer.

Parameters
vlayerThe layer being rendered (from which data values are calculated)
modeThe calculation mode
nclassesThe number of classes to calculate (approximate for some modes)
Note
Added in 2.6

Definition at line 827 of file qgsgraduatedsymbolrendererv2.cpp.

void QgsGraduatedSymbolRendererV2::updateColorRamp ( QgsVectorColorRampV2 ramp = 0,
bool  inverted = false 
)

Update the color ramp used.

Also updates all symbols colors. Doesn't alter current breaks.

Definition at line 1308 of file qgsgraduatedsymbolrendererv2.cpp.

bool QgsGraduatedSymbolRendererV2::updateRangeLabel ( int  rangeIndex,
QString  label 
)

Definition at line 464 of file qgsgraduatedsymbolrendererv2.cpp.

bool QgsGraduatedSymbolRendererV2::updateRangeLowerValue ( int  rangeIndex,
double  value 
)

Definition at line 483 of file qgsgraduatedsymbolrendererv2.cpp.

bool QgsGraduatedSymbolRendererV2::updateRangeRenderState ( int  rangeIndex,
bool  render 
)
Note
added in 2.5

Definition at line 494 of file qgsgraduatedsymbolrendererv2.cpp.

bool QgsGraduatedSymbolRendererV2::updateRangeSymbol ( int  rangeIndex,
QgsSymbolV2 symbol 
)

Definition at line 456 of file qgsgraduatedsymbolrendererv2.cpp.

bool QgsGraduatedSymbolRendererV2::updateRangeUpperValue ( int  rangeIndex,
double  value 
)

Definition at line 472 of file qgsgraduatedsymbolrendererv2.cpp.

void QgsGraduatedSymbolRendererV2::updateSymbols ( QgsSymbolV2 sym)

Update all the symbols but leave breaks and colors.

Definition at line 1338 of file qgsgraduatedsymbolrendererv2.cpp.

QList< QString > QgsGraduatedSymbolRendererV2::usedAttributes ( )
overridevirtual

Implements QgsFeatureRendererV2.

Definition at line 427 of file qgsgraduatedsymbolrendererv2.cpp.

Member Data Documentation

QString QgsGraduatedSymbolRendererV2::mAttrName
protected

Definition at line 329 of file qgsgraduatedsymbolrendererv2.h.

int QgsGraduatedSymbolRendererV2::mAttrNum
protected

attribute index (derived from attribute name in startRender)

Definition at line 343 of file qgsgraduatedsymbolrendererv2.h.

bool QgsGraduatedSymbolRendererV2::mCounting
protected

Definition at line 344 of file qgsgraduatedsymbolrendererv2.h.

QScopedPointer<QgsExpression> QgsGraduatedSymbolRendererV2::mExpression
protected

Definition at line 340 of file qgsgraduatedsymbolrendererv2.h.

GraduatedMethod QgsGraduatedSymbolRendererV2::mGraduatedMethod
protected

Definition at line 341 of file qgsgraduatedsymbolrendererv2.h.

bool QgsGraduatedSymbolRendererV2::mInvertedColorRamp
protected

Definition at line 334 of file qgsgraduatedsymbolrendererv2.h.

QgsRendererRangeV2LabelFormat QgsGraduatedSymbolRendererV2::mLabelFormat
protected

Definition at line 335 of file qgsgraduatedsymbolrendererv2.h.

Mode QgsGraduatedSymbolRendererV2::mMode
protected

Definition at line 331 of file qgsgraduatedsymbolrendererv2.h.

QgsRangeList QgsGraduatedSymbolRendererV2::mRanges
protected

Definition at line 330 of file qgsgraduatedsymbolrendererv2.h.

QScopedPointer<QgsExpression> QgsGraduatedSymbolRendererV2::mRotation
protected

Definition at line 337 of file qgsgraduatedsymbolrendererv2.h.

QgsSymbolV2::ScaleMethod QgsGraduatedSymbolRendererV2::mScaleMethod
protected

Definition at line 339 of file qgsgraduatedsymbolrendererv2.h.

QScopedPointer<QgsExpression> QgsGraduatedSymbolRendererV2::mSizeScale
protected

Definition at line 338 of file qgsgraduatedsymbolrendererv2.h.

QScopedPointer<QgsVectorColorRampV2> QgsGraduatedSymbolRendererV2::mSourceColorRamp
protected

Definition at line 333 of file qgsgraduatedsymbolrendererv2.h.

QScopedPointer<QgsSymbolV2> QgsGraduatedSymbolRendererV2::mSourceSymbol
protected

Definition at line 332 of file qgsgraduatedsymbolrendererv2.h.

QHash<QgsSymbolV2*, QgsSymbolV2*> QgsGraduatedSymbolRendererV2::mTempSymbols
protected

temporary symbols, used for data-defined rotation and scaling

Definition at line 347 of file qgsgraduatedsymbolrendererv2.h.


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