26 #include <QDomDocument>
27 #include <QDomElement>
34 : mLowerValue( 0 ), mUpperValue( 0 ), mSymbol( 0 ), mLabel()
39 : mLowerValue( lowerValue )
40 , mUpperValue( upperValue )
47 : mLowerValue( range.mLowerValue )
48 , mUpperValue( range.mUpperValue )
49 , mSymbol( range.mSymbol.data() ? range.mSymbol->clone() : NULL )
50 , mLabel( range.mLabel )
116 if ( !
mSymbol.data() || props.value(
"attribute",
"" ).isEmpty() )
119 QString attrName = props[
"attribute" ];
121 QDomElement ruleElem = doc.createElement(
"se:Rule" );
122 element.appendChild( ruleElem );
124 QDomElement nameElem = doc.createElement(
"se:Name" );
125 nameElem.appendChild( doc.createTextNode(
mLabel ) );
126 ruleElem.appendChild( nameElem );
128 QDomElement descrElem = doc.createElement(
"se:Description" );
129 QDomElement titleElem = doc.createElement(
"se:Title" );
131 titleElem.appendChild( doc.createTextNode( !
mLabel.isEmpty() ?
mLabel : descrStr ) );
132 descrElem.appendChild( titleElem );
133 ruleElem.appendChild( descrElem );
136 QString filterFunc = QString(
"%1 > %2 AND %1 <= %3" )
137 .arg( attrName.replace(
"\"",
"\"\"" ) )
141 mSymbol->toSld( doc, ruleElem, props );
148 mAttrName( attrName ),
151 mInvertedColorRamp( false ),
164 for ( QgsRangeList::iterator it =
mRanges.begin(); it !=
mRanges.end(); ++it )
166 if ( it->lowerValue() <= value && it->upperValue() >= value )
177 if ( mAttrNum < 0 || mAttrNum >= attrs.count() )
187 if ( value.isNull() )
192 if ( symbol == NULL )
199 const double rotation =
mRotation.data() ?
mRotation->evaluate( feature ).toDouble() : 0;
210 markerSymbol->
setSize( sizeScale * static_cast<QgsMarkerSymbolV2*>( symbol )->
size() );
216 lineSymbol->
setWidth( sizeScale * static_cast<QgsLineSymbolV2*>( symbol )->width() );
232 QgsRangeList::iterator it =
mRanges.begin();
233 for ( ; it !=
mRanges.end(); ++it )
235 it->symbol()->startRender( context, &fields );
250 QgsRangeList::iterator it =
mRanges.begin();
251 for ( ; it !=
mRanges.end(); ++it )
252 it->symbol()->stopRender( context );
255 QHash<QgsSymbolV2*, QgsSymbolV2*>::iterator it2 =
mTempSymbols.begin();
258 it2.value()->stopRender( context );
266 QSet<QString> attributes;
281 QgsRangeList::const_iterator range_it =
mRanges.constBegin();
282 for ( ; range_it !=
mRanges.constEnd(); ++range_it )
290 return attributes.toList();
295 if ( rangeIndex < 0 || rangeIndex >=
mRanges.size() )
297 mRanges[rangeIndex].setSymbol( symbol );
303 if ( rangeIndex < 0 || rangeIndex >=
mRanges.size() )
305 mRanges[rangeIndex].setLabel( label );
311 if ( rangeIndex < 0 || rangeIndex >=
mRanges.size() )
313 mRanges[rangeIndex].setUpperValue( value );
319 if ( rangeIndex < 0 || rangeIndex >=
mRanges.size() )
321 mRanges[rangeIndex].setLowerValue( value );
327 QString s = QString(
"GRADUATED: attr %1\n" ).arg(
mAttrName );
328 for (
int i = 0; i <
mRanges.count(); i++ )
356 props[
"angle" ] =
mRotation->expression();
361 for ( QgsRangeList::const_iterator it =
mRanges.constBegin(); it !=
mRanges.constEnd(); ++it )
364 it->toSld( doc, element, catProps );
371 for (
int i = 0; i <
mRanges.count(); i++ )
372 lst.append(
mRanges[i].symbol() );
384 double step = ( maximum - minimum ) / classes;
386 QList<double> breaks;
387 double value = minimum;
388 for (
int i = 0; i < classes; i++ )
391 breaks.append( value );
396 breaks[classes-1] = maximum;
414 QList<double> breaks;
417 if ( !values.count() )
420 int n = values.count();
421 double Xq = n > 0 ? values[0] : 0.0;
423 for (
int i = 1; i < classes; i++ )
427 double q = i / ( double ) classes;
428 double a = q * ( n - 1 );
429 int aa = ( int )( a );
432 Xq = ( 1 - r ) * values[aa] + r * values[aa+1];
437 breaks.append( values[ n-1 ] );
454 QList<double> breaks;
457 breaks.append( maximum );
461 int minimumCount = ( int ) classes / 3;
462 double shrink = 0.75;
463 double highBias = 1.5;
464 double adjustBias = 0.5 + 1.5 * highBias;
465 int divisions = classes;
470 double dx = maximum - minimum;
472 if ( dx == 0 && maximum == 0 )
480 cell = qMax( qAbs( minimum ), qAbs( maximum ) );
481 if ( adjustBias >= 1.5 * h + 0.5 )
483 U = 1 + ( 1.0 / ( 1 + h ) );
487 U = 1 + ( 1.5 / ( 1 + adjustBias ) );
489 small = dx < ( cell * U * qMax( 1, divisions ) * 1e-07 * 3.0 );
496 cell = 9 + cell / 10;
497 cell = cell * shrink;
499 if ( minimumCount > 1 )
501 cell = cell / minimumCount;
509 cell = cell / divisions;
512 if ( cell < 20 * 1e-07 )
517 double base = pow( 10.0, floor( log10( cell ) ) );
519 if (( 2 * base ) - cell < h *( cell - unit ) )
522 if (( 5 * base ) - cell < adjustBias *( cell - unit ) )
525 if (( 10.0 * base ) - cell < h *( cell - unit ) )
532 int start = floor( minimum / unit + 1e-07 );
533 int end = ceil( maximum / unit - 1e-07 );
536 while ( start * unit > minimum + ( 1e-07 * unit ) )
540 while ( end * unit < maximum - ( 1e-07 * unit ) )
544 QgsDebugMsg( QString(
"pretty classes: %1" ).arg( end ) );
548 int k = floor( 0.5 + end - start );
549 if ( k < minimumCount )
551 k = minimumCount - k;
555 start = start - k / 2 + k % 2;
559 start = start - k / 2;
560 end = end + k / 2 + k % 2;
563 double minimumBreak = start * unit;
565 int count = end - start;
567 for (
int i = 1; i < count + 1; i++ )
569 breaks.append( minimumBreak + i * unit );
572 if ( breaks.isEmpty() )
575 if ( breaks.first() < minimum )
579 if ( breaks.last() > maximum )
581 breaks[breaks.count()-1] = maximum;
599 if ( !values.count() )
600 return QList<double>();
604 int n = values.count();
605 double minimum = values[0];
606 double maximum = values[0];
608 for (
int i = 0; i < n; i++ )
611 minimum = qMin( values[i], minimum );
612 maximum = qMax( values[i], maximum );
614 mean = mean / ( double ) n;
617 for (
int i = 0; i < n; i++ )
619 sd = values[i] - mean;
622 stdDev = sqrt( stdDev / n );
624 QList<double> breaks =
_calcPrettyBreaks(( minimum - mean ) / stdDev, ( maximum - mean ) / stdDev, classes );
625 for (
int i = 0; i < breaks.count(); i++ )
627 labels.append((
int ) breaks[i] );
628 breaks[i] = ( breaks[i] * stdDev ) + mean;
635 double minimum,
double maximum,
636 int maximumSize = 1000 )
648 if ( !values.count() )
649 return QList<double>();
653 return QList<double>() << maximum;
656 if ( classes >= values.size() )
661 QVector<double> sample;
664 if ( values.size() > maximumSize )
672 sample.resize( qMax( maximumSize, values.size() / 10 ) );
674 QgsDebugMsg( QString(
"natural breaks (jenks) sample size: %1" ).arg( sample.size() ) );
675 QgsDebugMsg( QString(
"values:%1" ).arg( values.size() ) );
677 sample[ 0 ] = minimum;
678 sample[ 1 ] = maximum;;
679 for (
int i = 2; i < sample.size(); i++ )
683 int j = floor( r / RAND_MAX * ( values.size() - 1 ) );
684 sample[ i ] = values[ j ];
689 sample = values.toVector();
692 int n = sample.size();
697 QVector< QVector<int> > matrixOne( n + 1 );
698 QVector< QVector<double> > matrixTwo( n + 1 );
700 for (
int i = 0; i <= n; i++ )
702 matrixOne[i].resize( classes + 1 );
703 matrixTwo[i].resize( classes + 1 );
706 for (
int i = 1; i <= classes; i++ )
710 matrixTwo[0][i] = 0.0;
711 for (
int j = 2; j <= n; j++ )
717 for (
int l = 2; l <= n; l++ )
725 for (
int m = 1; m <= l; m++ )
729 double val = sample[ i3 - 1 ];
735 v = s2 - ( s1 * s1 ) / (
double ) w;
739 for (
int j = 2; j <= classes; j++ )
741 if ( matrixTwo[l][j] >= v + matrixTwo[i4][j - 1] )
743 matrixOne[l][j] = i4;
744 matrixTwo[l][j] = v + matrixTwo[i4][j - 1];
753 QVector<double> breaks( classes );
754 breaks[classes-1] = sample[n-1];
756 for (
int j = classes, k = n; j >= 2; j-- )
758 int id = matrixOne[k][j] - 1;
759 breaks[j - 2] = sample[id];
760 k = matrixOne[k][j] - 1;
763 return breaks.toList();
783 QScopedPointer<QgsExpression> expression;
789 if ( expression->hasParserError() || !expression->prepare( vlayer->
pendingFields() ) )
792 QList<double> values;
797 values << expression->evaluate( feature ).toDouble();
800 minimum = values.first();
801 maximum = values.last();
809 QgsDebugMsg( QString(
"min %1 // max %2" ).arg( minimum ).arg( maximum ) );
810 QList<double> breaks;
816 else if ( mode ==
Pretty )
823 QList<double> values;
826 if ( expression.isNull() )
827 lst.append( attrName );
829 lst = expression->referencedColumns();
836 QVariant v = expression.isNull() ? f.
attribute( attrNum ) : expression->evaluate( f );
838 values.append( v.toDouble() );
846 else if ( mode ==
Jenks )
850 else if ( mode ==
StdDev )
861 double lower, upper = minimum;
866 for ( QList<double>::iterator it = breaks.begin(); it != breaks.end(); ++it, ++i )
874 label =
"< " + QString::number( labels[i],
'i', 0 ) +
" Std Dev";
876 else if ( i == labels.count() - 1 )
878 label =
">= " + QString::number( labels[i-1],
'i', 0 ) +
" Std Dev";
882 label = QString::number( labels[i-1],
'i', 0 ) +
" Std Dev" +
" - " + QString::number( labels[i],
'i', 0 ) +
" Std Dev";
887 label = QString::number( lower,
'f', 4 ) +
" - " + QString::number( upper,
'f', 4 );
892 if ( inverted ) colorValue = ( breaks.count() > 1 ? ( double )( breaks.count() - i - 1 ) / ( breaks.count() - 1 ) : 0 );
893 else colorValue = ( breaks.count() > 1 ? ( double ) i / ( breaks.count() - 1 ) : 0 );
909 QDomElement symbolsElem = element.firstChildElement(
"symbols" );
910 if ( symbolsElem.isNull() )
913 QDomElement rangesElem = element.firstChildElement(
"ranges" );
914 if ( rangesElem.isNull() )
920 QDomElement rangeElem = rangesElem.firstChildElement();
921 while ( !rangeElem.isNull() )
923 if ( rangeElem.tagName() ==
"range" )
925 double lowerValue = rangeElem.attribute(
"lower" ).toDouble();
926 double upperValue = rangeElem.attribute(
"upper" ).toDouble();
927 QString symbolName = rangeElem.attribute(
"symbol" );
928 QString label = rangeElem.attribute(
"label" );
929 if ( symbolMap.contains( symbolName ) )
931 QgsSymbolV2* symbol = symbolMap.take( symbolName );
935 rangeElem = rangeElem.nextSiblingElement();
938 QString attrName = element.attribute(
"attr" );
946 QDomElement sourceSymbolElem = element.firstChildElement(
"source-symbol" );
947 if ( !sourceSymbolElem.isNull() )
950 if ( sourceSymbolMap.contains(
"0" ) )
958 QDomElement sourceColorRampElem = element.firstChildElement(
"colorramp" );
959 if ( !sourceColorRampElem.isNull() && sourceColorRampElem.attribute(
"name" ) ==
"[source]" )
962 QDomElement invertedColorRampElem = element.firstChildElement(
"invertedcolorramp" );
963 if ( !invertedColorRampElem.isNull() )
968 QDomElement modeElem = element.firstChildElement(
"mode" );
969 if ( !modeElem.isNull() )
971 QString modeString = modeElem.attribute(
"name" );
972 if ( modeString ==
"equal" )
974 else if ( modeString ==
"quantile" )
976 else if ( modeString ==
"jenks" )
978 else if ( modeString ==
"stddev" )
980 else if ( modeString ==
"pretty" )
984 QDomElement rotationElem = element.firstChildElement(
"rotation" );
985 if ( !rotationElem.isNull() )
988 QDomElement sizeScaleElem = element.firstChildElement(
"sizescale" );
989 if ( !sizeScaleElem.isNull() )
1000 rendererElem.setAttribute(
"type",
"graduatedSymbol" );
1002 rendererElem.setAttribute(
"attr",
mAttrName );
1007 QDomElement rangesElem = doc.createElement(
"ranges" );
1008 QgsRangeList::const_iterator it =
mRanges.constBegin();
1009 for ( ; it !=
mRanges.constEnd(); ++it )
1012 QString symbolName = QString::number( i );
1013 symbols.insert( symbolName, range.
symbol() );
1015 QDomElement rangeElem = doc.createElement(
"range" );
1016 rangeElem.setAttribute(
"lower", QString::number( range.
lowerValue(),
'f' ) );
1017 rangeElem.setAttribute(
"upper", QString::number( range.
upperValue(),
'f' ) );
1018 rangeElem.setAttribute(
"symbol", symbolName );
1019 rangeElem.setAttribute(
"label", range.
label() );
1020 rangesElem.appendChild( rangeElem );
1024 rendererElem.appendChild( rangesElem );
1028 rendererElem.appendChild( symbolsElem );
1036 rendererElem.appendChild( sourceSymbolElem );
1043 rendererElem.appendChild( colorRampElem );
1044 QDomElement invertedElem = doc.createElement(
"invertedcolorramp" );
1046 rendererElem.appendChild( invertedElem );
1052 modeString =
"equal";
1054 modeString =
"quantile";
1056 modeString =
"jenks";
1058 modeString =
"stddev";
1060 modeString =
"pretty";
1061 if ( !modeString.isEmpty() )
1063 QDomElement modeElem = doc.createElement(
"mode" );
1064 modeElem.setAttribute(
"name", modeString );
1065 rendererElem.appendChild( modeElem );
1068 QDomElement rotationElem = doc.createElement(
"rotation" );
1071 rendererElem.appendChild( rotationElem );
1073 QDomElement sizeScaleElem = doc.createElement(
"sizescale" );
1077 rendererElem.appendChild( sizeScaleElem );
1079 return rendererElem;
1085 bool showClassifiers = settings.value(
"/qgis/showLegendClassifiers",
false ).toBool();
1088 if ( showClassifiers )
1093 int count =
ranges().count();
1094 for (
int i = 0; i < count; i++ )
1098 lst << qMakePair( range.
label(), pix );
1105 Q_UNUSED( scaleDenominator );
1107 bool showClassifiers = settings.value(
"/qgis/showLegendClassifiers",
false ).toBool();
1110 if ( showClassifiers )
1117 if ( rule.isEmpty() || range.
label() == rule )
1119 lst << qMakePair( range.
label(), range.
symbol() );
1151 if ( inverted ) colorValue = (
mRanges.count() > 1 ? ( double )(
mRanges.count() - i - 1 ) / (
mRanges.count() - 1 ) : 0 );
1152 else colorValue = (
mRanges.count() > 1 ? ( double ) i / (
mRanges.count() - 1 ) : 0 );
1197 for ( QgsRangeList::iterator it =
mRanges.begin(); it !=
mRanges.end(); ++it )
1206 QString label =
"0.0 - 0.0";
1228 if ( from < 0 || from >=
mRanges.size() || to < 0 || to >=
mRanges.size() )
return;
1245 if ( order == Qt::AscendingOrder )
1257 return QString::localeAwareCompare( r1.
label(), r2.
label() ) < 0;
1267 if ( order == Qt::AscendingOrder )
QMap< QString, QgsSymbolV2 * > QgsSymbolV2Map
Class for parsing and evaluation of expressions (formerly called "search strings").
QList< QgsRendererRangeV2 > QgsRangeList
Wrapper for iterator of features from vector data provider or vector layer.
static QgsSymbolV2Map loadSymbols(QDomElement &element)
static QList< double > _calcJenksBreaks(QList< double > values, int classes, double minimum, double maximum, int maximumSize=1000)
#define RENDERER_TAG_NAME
void setLowerValue(double lowerValue)
bool hasParserError() const
Returns true if an error occurred when parsing the input expression.
void setInvertedColorRamp(bool inverted)
virtual QDomElement save(QDomDocument &doc)
store renderer info to XML element
bool labelLessThan(const QgsRendererRangeV2 &r1, const QgsRendererRangeV2 &r2)
QString rotationField() const
static QgsVectorColorRampV2 * loadColorRamp(QDomElement &element)
bool updateRangeLabel(int rangeIndex, QString label)
QList< QgsSymbolV2 * > QgsSymbolV2List
static QList< double > _calcPrettyBreaks(double minimum, double maximum, int classes)
void setLabel(QString label)
QScopedPointer< QgsVectorColorRampV2 > mSourceColorRamp
QVariant maximumValue(int index)
Returns maximum value for an attribute column or invalid variant in case of error.
QSet< QString > usedAttributes() const
void updateSymbols(QgsSymbolV2 *sym)
Update the all symbols but leave breaks and colors.
QString classAttribute() const
int fieldNameIndex(const QString &fieldName) const
Look up field's index from name - case insensitive TODO: sort out case sensitive (indexFromName()) vs...
virtual QgsSymbolV2 * clone() const =0
QgsFeatureIterator getFeatures(const QgsFeatureRequest &request=QgsFeatureRequest())
Query the provider for features specified in request.
void updateColorRamp(QgsVectorColorRampV2 *ramp, bool inverted=false)
Update the color ramp used.
static QgsGraduatedSymbolRendererV2 * createRenderer(QgsVectorLayer *vlayer, QString attrName, int classes, Mode mode, QgsSymbolV2 *symbol, QgsVectorColorRampV2 *ramp, bool inverted=false)
void setSizeScaleField(QString fieldOrExpression)
virtual QString dump() const
for debugging
Container of fields for a vector layer.
virtual QgsSymbolV2 * symbolForFeature(QgsFeature &feature)
to be overridden
virtual QgsLegendSymbolList legendSymbolItems(double scaleDenominator=-1, QString rule=QString())
return a list of item text / symbol
virtual ~QgsGraduatedSymbolRendererV2()
QHash< QgsSymbolV2 *, QgsSymbolV2 * > mTempSymbols
temporary symbols, used for data-defined rotation and scaling
The feature class encapsulates a single feature including its id, geometry and a list of field/values...
void setScaleMethod(QgsSymbolV2::ScaleMethod scaleMethod)
virtual QgsSymbolV2List symbols()
for symbol levels
QVariant minimumValue(int index)
Returns minimum value for an attribute column or invalid variant in case of error.
QMap< QString, QString > QgsStringMap
QgsVectorColorRampV2 * sourceColorRamp()
void setWidth(double width)
QScopedPointer< QgsSymbolV2 > mSymbol
double ANALYSIS_EXPORT max(double x, double y)
returns the maximum of two doubles or the first argument if both are equal
void setRotationField(QString fieldOrExpression)
double upperValue() const
QScopedPointer< QgsExpression > mExpression
void setColor(const QColor &color)
static QDomElement saveColorRamp(QString name, QgsVectorColorRampV2 *ramp, QDomDocument &doc)
QgsSymbolV2::ScaleMethod scaleMethod() const
void sortByLabel(Qt::SortOrder order=Qt::AscendingOrder)
static QList< double > _calcQuantileBreaks(QList< double > values, int classes)
void startRender(QgsRenderContext &context, const QgsFields *fields=0)
const QgsRangeList & ranges()
#define DEFAULT_SCALE_METHOD
virtual QgsVectorColorRampV2 * clone() const =0
void swap(QgsRendererRangeV2 &other)
static bool createFunctionElement(QDomDocument &doc, QDomElement &element, QString function)
static QDomElement saveSymbols(QgsSymbolV2Map &symbols, QString tagName, QDomDocument &doc)
QgsSymbolV2 * sourceSymbol()
QStringList referencedColumns()
Get list of columns referenced by the expression.
QgsSymbolV2 * symbol() const
void setAngle(double angle)
This class wraps a request for features to a vector layer (or directly its vector data provider)...
void setSourceSymbol(QgsSymbolV2 *sym)
bool updateRangeLowerValue(int rangeIndex, double value)
const QgsAttributes & attributes() const
void setSize(double size)
void toSld(QDomDocument &doc, QDomElement &element, QgsStringMap props) const
virtual QList< QString > usedAttributes()
QgsGraduatedSymbolRendererV2(QString attrName=QString(), QgsRangeList ranges=QgsRangeList())
void setUpperValue(double upperValue)
QgsSymbolV2 * symbolForValue(double value)
bool labelGreaterThan(const QgsRendererRangeV2 &r1, const QgsRendererRangeV2 &r2)
QList< QPair< QString, QPixmap > > QgsLegendSymbologyList
virtual QColor color(double value) const =0
bool valueLessThan(const QgsRendererRangeV2 &r1, const QgsRendererRangeV2 &r2)
void sortByValue(Qt::SortOrder order=Qt::AscendingOrder)
void setUsingSymbolLevels(bool usingSymbolLevels)
static QList< double > _calcEqualIntervalBreaks(double minimum, double maximum, int classes)
virtual QgsLegendSymbologyList legendSymbologyItems(QSize iconSize)
return a list of symbology items for the legend
int ANALYSIS_EXPORT lower(int n, int i)
lower function
void moveClass(int from, int to)
Moves the category at index position from to index position to.
Contains information about the context of a rendering operation.
int mAttrNum
attribute index (derived from attribute name in startRender)
QVariant attribute(const QString &name) const
Lookup attribute value from attribute name.
static QgsExpression * fieldOrExpressionToExpression(const QString &fieldOrExpression)
Return a new valid expression instance for given field or expression string.
QVector< QVariant > QgsAttributes
double lowerValue() const
QString sizeScaleField() const
static QString encodeScaleMethod(QgsSymbolV2::ScaleMethod scaleMethod)
static QString fieldOrExpressionFromExpression(QgsExpression *expression)
Return a field name if the whole expression is just a name of the field .
bool usingSymbolLevels() const
void setScaleMethodToSymbol(QgsSymbolV2 *symbol, int scaleMethod)
virtual void stopRender(QgsRenderContext &context)
virtual void startRender(QgsRenderContext &context, const QgsFields &fields)
void setSymbol(QgsSymbolV2 *s)
bool updateRangeSymbol(int rangeIndex, QgsSymbolV2 *symbol)
void setSourceColorRamp(QgsVectorColorRampV2 *ramp)
static QPixmap symbolPreviewPixmap(QgsSymbolV2 *symbol, QSize size)
QScopedPointer< QgsSymbolV2 > mSourceSymbol
void setRenderHints(int hints)
static void clearSymbolMap(QgsSymbolV2Map &symbols)
bool updateRangeUpperValue(int rangeIndex, double value)
static QgsSymbolV2::ScaleMethod decodeScaleMethod(QString str)
QScopedPointer< QgsExpression > mRotation
QgsSymbolV2::ScaleMethod mScaleMethod
static QgsFeatureRendererV2 * create(QDomElement &element)
create renderer from XML element
const QgsFields & pendingFields() const
returns field list in the to-be-committed state
QScopedPointer< QgsExpression > mSizeScale
bool nextFeature(QgsFeature &f)
QgsRendererRangeV2 & operator=(QgsRendererRangeV2 range)
Geometry is not required. It may still be returned if e.g. required for a filter condition.
virtual void toSld(QDomDocument &doc, QDomElement &element) const
used from subclasses to create SLD Rule elements following SLD v1.1 specs
static QList< double > _calcStdDevBreaks(QList< double > values, int classes, QList< int > &labels)
Represents a vector layer which manages a vector based data sets.
int fieldNameIndex(const QString &fieldName) const
Returns the index of a field name or -1 if the field does not exist.
void deleteClass(int idx)
QList< QPair< QString, QgsSymbolV2 * > > QgsLegendSymbolList
virtual QgsFeatureRendererV2 * clone()
void setScaleMethod(QgsSymbolV2::ScaleMethod scaleMethod)
void addClass(QgsSymbolV2 *symbol)
bool valueGreaterThan(const QgsRendererRangeV2 &r1, const QgsRendererRangeV2 &r2)