33 #include <QDomDocument> 34 #include <QDomElement> 149 QString attrName = props[
"attribute" ];
168 firstRange ?
">=" :
">",
173 mSymbol->toSld( doc, ruleElem, props );
182 : mFormat(
" %1 - %2 " )
184 , mTrimTrailingZeroes( false )
185 , mNumberScale( 1.0 )
186 , mNumberSuffix(
"" )
187 , mReTrailingZeroes(
"[.,]?0*$" )
188 , mReNegativeZero(
"^\\-0(?:[.,]0*)?$" )
212 return !( *
this == other );
222 while ( precision < 0 )
243 valueStr = valueStr.
mid( 1 );
249 if ( valueStr ==
"-0" )
251 if ( valueStr !=
"0" )
263 return legend.
replace(
"%1", lowerStr ).
replace(
"%2", upperStr );
269 element.
attribute(
"prefix",
" " ) +
"%1" +
270 element.
attribute(
"separator",
" - " ) +
"%2" +
288 , mAttrName( attrName )
290 , mInvertedColorRamp( false )
292 , mGraduatedMethod( GraduatedColor )
340 return QString::null;
345 return QString::null;
369 markerSymbol->
setSize( sizeScale * static_cast<QgsMarkerSymbolV2*>( symbol )->size() );
375 lineSymbol->
setWidth( sizeScale * static_cast<QgsLineSymbolV2*>( symbol )->width() );
384 if ( mAttrNum < 0 || mAttrNum >= attrs.
count() )
398 QVariant value = valueForFeature( feature, context );
454 it2.
value()->stopRender( context );
486 return attributes.
toList();
491 if ( rangeIndex < 0 || rangeIndex >=
mRanges.
size() )
493 mRanges[rangeIndex].setSymbol( symbol );
499 if ( rangeIndex < 0 || rangeIndex >=
mRanges.
size() )
501 mRanges[rangeIndex].setLabel( label );
507 if ( rangeIndex < 0 || rangeIndex >=
mRanges.
size() )
518 if ( rangeIndex < 0 || rangeIndex >=
mRanges.
size() )
529 if ( rangeIndex < 0 || rangeIndex >=
mRanges.
size() )
531 mRanges[rangeIndex].setRenderState( value );
573 locProps[
"angle" ] =
mRotation->expression();
575 locProps[
"scale" ] =
mSizeScale->expression();
582 it->toSld( doc, element, catProps, first );
607 double step = ( maximum - minimum ) / classes;
610 double value = minimum;
612 for (
int i = 0; i < classes; i++ )
620 breaks[classes-1] = maximum;
644 int n = values.
count();
645 double Xq = n > 0 ? values[0] : 0.0;
648 for (
int i = 1; i < classes; i++ )
652 double q = i /
static_cast< double >( classes );
653 double a = q * ( n - 1 );
654 int aa =
static_cast< int >( a );
657 Xq = ( 1 - r ) * values[aa] + r * values[aa+1];
662 breaks.
append( values[ n-1 ] );
683 int n = values.
count();
684 double minimum = values[0];
685 double maximum = values[0];
687 for (
int i = 0; i < n; i++ )
690 minimum = qMin( values[i], minimum );
691 maximum = qMax( values[i], maximum );
693 mean = mean /
static_cast< double >( n );
696 for (
int i = 0; i < n; i++ )
698 sd = values[i] - mean;
701 stdDev = sqrt( stdDev / n );
704 for (
int i = 0; i < breaks.
count(); i++ )
706 labels.
append( breaks[i] );
707 breaks[i] = ( breaks[i] * stdDev ) + mean;
714 double minimum,
double maximum,
715 int maximumSize = 3000 )
735 if ( classes >= values.
size() )
743 if ( values.
size() > maximumSize )
749 sample.
resize( qMax( maximumSize, values.
size() / 10 ) );
754 sample[ 0 ] = minimum;
755 sample[ 1 ] = maximum;
756 for (
int i = 2; i < sample.
size(); i++ )
760 int j = floor( r / RAND_MAX * ( values.
size() - 1 ) );
761 sample[ i ] = values[ j ];
769 int n = sample.
size();
777 for (
int i = 0; i <= n; i++ )
779 matrixOne[i].
resize( classes + 1 );
780 matrixTwo[i].
resize( classes + 1 );
783 for (
int i = 1; i <= classes; i++ )
787 matrixTwo[0][i] = 0.0;
788 for (
int j = 2; j <= n; j++ )
794 for (
int l = 2; l <= n; l++ )
802 for (
int m = 1; m <= l; m++ )
806 double val = sample[ i3 - 1 ];
812 v = s2 - ( s1 * s1 ) / static_cast< double >( w );
816 for (
int j = 2; j <= classes; j++ )
818 if ( matrixTwo[l][j] >= v + matrixTwo[i4][j - 1] )
820 matrixOne[l][j] = i4;
821 matrixTwo[l][j] = v + matrixTwo[i4][j - 1];
831 breaks[classes-1] = sample[n-1];
833 for (
int j = classes, k = n; j >= 2; j-- )
835 int id = matrixOne[k][j] - 1;
836 breaks[j - 2] = sample[id];
837 k = matrixOne[k][j] - 1;
886 bool valuesLoaded =
false;
900 minimum = values.
first();
901 maximum = values.
last();
917 else if ( mode ==
Pretty )
934 else if ( mode ==
Jenks )
938 else if ( mode ==
StdDev )
948 double lower, upper = minimum;
967 else if ( i == labels.
count() - 1 )
989 if ( symbolsElem.
isNull() )
993 if ( rangesElem.
isNull() )
1000 while ( !rangeElem.
isNull() )
1002 if ( rangeElem.
tagName() ==
"range" )
1008 bool render = rangeElem.
attribute(
"render",
"true" ) !=
"false";
1009 if ( symbolMap.
contains( symbolName ) )
1037 if ( !sourceSymbolElem.
isNull() )
1040 if ( sourceSymbolMap.
contains(
"0" ) )
1049 if ( !sourceColorRampElem.
isNull() && sourceColorRampElem.
attribute(
"name" ) ==
"[source]" )
1053 if ( !invertedColorRampElem.
isNull() )
1059 if ( !modeElem.
isNull() )
1062 if ( modeString ==
"equal" )
1064 else if ( modeString ==
"quantile" )
1066 else if ( modeString ==
"jenks" )
1068 else if ( modeString ==
"stddev" )
1070 else if ( modeString ==
"pretty" )
1088 if ( !sizeScaleElem.isNull() && !sizeScaleElem.attribute(
"field" ).isEmpty() )
1094 sizeScaleElem.attribute(
"field" ) );
1100 sizeScaleElem.attribute(
"field" ) );
1105 if ( ! labelFormatElem.isNull() )
1118 rendererElem.
setAttribute(
"type",
"graduatedSymbol" );
1173 modeString =
"equal";
1175 modeString =
"quantile";
1177 modeString =
"jenks";
1179 modeString =
"stddev";
1181 modeString =
"pretty";
1215 return rendererElem;
1223 for (
int i = 0; i < count; i++ )
1227 lst << qMakePair( range.
label(), pix );
1268 s->setSize( exp.size( v ) );
1284 QVariant value = valueForFeature( feature, context );
1300 Q_UNUSED( scaleDenominator );
1307 lst << qMakePair( range.
label(), range.
symbol() );
1334 double min = DBL_MAX;
1339 sz = static_cast< QgsMarkerSymbolV2 * >(
mRanges[i].symbol() )->size();
1341 sz = static_cast< QgsLineSymbolV2 * >(
mRanges[i].symbol() )->width();
1342 min = qMin( sz, min );
1349 double max = DBL_MIN;
1354 sz = static_cast< QgsMarkerSymbolV2 * >(
mRanges[i].symbol() )->size();
1356 sz = static_cast< QgsLineSymbolV2 * >(
mRanges[i].symbol() )->width();
1357 max = qMax( sz, max );
1368 ? minSize + i * ( maxSize - minSize ) / (
mRanges.
count() - 1 )
1369 : .5 * ( maxSize + minSize );
1371 static_cast< QgsMarkerSymbolV2 * >( symbol.data() )->setSize( size );
1373 static_cast< QgsLineSymbolV2 * >( symbol.data() )->setWidth( size );
1424 static_cast<QgsMarkerSymbolV2 *>( symbol.data() )->setSize(
1425 static_cast<QgsMarkerSymbolV2 *>( range.
symbol() )->size() );
1427 static_cast<QgsLineSymbolV2 *>( symbol.data() )->setWidth(
1428 static_cast<QgsLineSymbolV2 *>( range.
symbol() )->width() );
1488 return mRanges.
at( index ).renderState();
1550 if ( updateSymbols )
1595 double minClassRange = 0.0;
1601 if ( minClassRange == 0.0 || range < minClassRange )
1602 minClassRange = range;
1604 if ( minClassRange <= 0.0 )
1611 double nextDpMinRange = 0.0000000099;
1612 while ( ndp > 0 && nextDpMinRange < minClassRange )
1615 nextDpMinRange *= 10.0;
1640 if ( order == Qt::AscendingOrder )
1656 if ( it == sortedRanges.
constEnd() )
1659 if (( *it ).upperValue() < ( *it ).lowerValue() )
1662 double prevMax = ( *it ).upperValue();
1665 for ( ; it != sortedRanges.
constEnd(); ++it )
1667 if (( *it ).upperValue() < ( *it ).lowerValue() )
1670 if (( *it ).lowerValue() < prevMax )
1673 prevMax = ( *it ).upperValue();
1684 if ( it == sortedRanges.
constEnd() )
1687 double prevMax = ( *it ).upperValue();
1690 for ( ; it != sortedRanges.
constEnd(); ++it )
1695 prevMax = ( *it ).upperValue();
1712 if ( order == Qt::AscendingOrder )
1725 if ( renderer->
type() ==
"graduatedSymbol" )
1729 else if ( renderer->
type() ==
"pointDisplacement" )
1732 if ( pointDisplacementRenderer )
1735 else if ( renderer->
type() ==
"invertedPolygonRenderer" )
1738 if ( invertedPolygonRenderer )
1767 return "GraduatedColor";
1769 return "GraduatedSize";
QgsDataDefined dataDefinedAngle() const
Returns data defined angle for whole symbol (including all symbol layers).
QgsSymbolV2::ScaleMethod scaleMethod() const
static QDomElement saveSymbols(QgsSymbolV2Map &symbols, const QString &tagName, QDomDocument &doc)
Class for parsing and evaluation of expressions (formerly called "search strings").
QList< QgsRendererRangeV2 > QgsRangeList
bool hasParserError() const
Returns true if an error occurred when parsing the input expression.
static QgsSymbolV2Map loadSymbols(QDomElement &element)
#define RENDERER_TAG_NAME
double rendererScale() const
virtual void toSld(QDomDocument &doc, QDomElement &element) const override
Writes the SLD element following the SLD v1.1 specs.
QString & append(QChar ch)
void setLowerValue(double lowerValue)
QgsGraduatedSymbolRendererV2(const QString &attrName=QString(), const QgsRangeList &ranges=QgsRangeList())
void setSymbolSizes(double minSize, double maxSize)
set varying symbol size for classes
void setInvertedColorRamp(bool inverted)
QgsAttributes attributes() const
Returns the feature's attributes.
void addBreak(double breakValue, bool updateSymbols=true)
Add a breakpoint by splitting existing classes so that the specified value becomes a break between tw...
void setDataDefinedAngle(const QgsDataDefined &dd)
Set data defined angle for whole symbol (including all symbol layers).
A container class for data source field mapping or expression.
void setLabelFormat(const QgsRendererRangeV2LabelFormat &labelFormat, bool updateRanges=false)
Set the label format used to generate default classification labels.
static QList< double > prettyBreaks(double minimum, double maximum, int classes)
Computes a sequence of about 'classes' equally spaced round values which cover the range of values fr...
bool labelLessThan(const QgsRendererRangeV2 &r1, const QgsRendererRangeV2 &r2)
bool contains(const Key &key) const
static QgsGraduatedSymbolRendererV2 * convertFromRenderer(const QgsFeatureRendererV2 *renderer)
creates a QgsGraduatedSymbolRendererV2 from an existing renderer.
static QgsVectorColorRampV2 * loadColorRamp(QDomElement &element)
int localeAwareCompare(const QString &other) const
void updateClasses(QgsVectorLayer *vlayer, Mode mode, int nclasses)
Recalculate classes for a layer.
static QList< double > _calcStdDevBreaks(QList< double > values, int classes, QList< double > &labels)
virtual QString dump() const override
for debugging
QDomNode appendChild(const QDomNode &newChild)
QScopedPointer< QgsVectorColorRampV2 > mSourceColorRamp
QVariant maximumValue(int index)
Returns the maximum value for an attribute column or an invalid variant in case of error...
QgsSymbolV2 * symbol() const
QString attribute(const QString &name, const QString &defValue) const
void updateSymbols(QgsSymbolV2 *sym)
Update all the symbols but leave breaks and colors.
void setDataDefinedSize(const QgsDataDefined &dd)
Set data defined size for whole symbol (including all symbol layers).
QString sizeScaleField() const
static QDomElement saveColorRamp(const QString &name, QgsVectorColorRampV2 *ramp, QDomDocument &doc)
QStringList referencedColumns() const
Get list of columns referenced by the expression.
GraduatedMethod graduatedMethod() const
return the method used for graduation (either size or color)
virtual QgsSymbolV2 * clone() const =0
Class storing parameters of a scale expression, which is a subclass of QgsExpression for expressions ...
static QgsSymbolV2::ScaleMethod decodeScaleMethod(const QString &str)
virtual bool legendSymbolItemChecked(const QString &key) override
item in symbology was checked
bool updateRangeRenderState(int rangeIndex, bool render)
virtual QgsSymbolV2 * symbolForFeature(QgsFeature &feature, QgsRenderContext &context) override
const T & at(int i) const
static bool isDefaultStack(QgsPaintEffect *effect)
Tests whether a paint effect matches the default effects stack.
void setSizeScaleField(const QString &fieldOrExpression)
QDomElement nextSiblingElement(const QString &tagName) const
Container of fields for a vector layer.
void updateColorRamp(QgsVectorColorRampV2 *ramp=nullptr, bool inverted=false)
Update the color ramp used.
void move(int from, int to)
QVector< T > toVector() const
virtual ~QgsGraduatedSymbolRendererV2()
QHash< QgsSymbolV2 *, QgsSymbolV2 * > mTempSymbols
temporary symbols, used for data-defined rotation and scaling
virtual QgsLegendSymbolListV2 legendSymbolItemsV2() const
Return a list of symbology items for the legend.
void calculateLabelPrecision(bool updateRanges=true)
Reset the label decimal places to a numberbased on the minimum class interval.
QList< double > getDoubleValues(const QString &fieldOrExpression, bool &ok, bool selectedOnly=false, int *nullCount=nullptr)
Fetches all double values from a specified field name or expression.
The feature class encapsulates a single feature including its id, geometry and a list of field/values...
QString & remove(int position, int n)
virtual QgsLegendSymbolList legendSymbolItems(double scaleDenominator=-1, const QString &rule=QString()) override
return a list of item text / symbol
void setScaleMethod(QgsSymbolV2::ScaleMethod scaleMethod)
double toDouble(bool *ok) const
QVariant minimumValue(int index)
Returns the minimum value for an attribute column or an invalid variant in case of error...
QMap< QString, QString > QgsStringMap
void setValue(const T &value) const
bool qgsDoubleNear(double a, double b, double epsilon=4 *DBL_EPSILON)
Compare two doubles (but allow some difference)
static const char * graduatedMethodStr(GraduatedMethod method)
QgsVectorColorRampV2 * sourceColorRamp()
Returns the source color ramp, from which each classes' color is derived.
QgsPaintEffect * mPaintEffect
void setWidth(double width)
void setRenderState(bool render)
bool useExpression() const
Returns if the field or the expression part is active.
Q_DECL_DEPRECATED QList< double > getDataValues(QgsVectorLayer *vlayer)
Evaluates the data expression and returns the list of values from the layer.
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.
virtual void stopRender(QgsRenderContext &context) override
Needs to be called when a render cycle has finished to clean up.
GraduatedMethod mGraduatedMethod
QScopedPointer< QgsExpression > mExpression
void setColor(const QColor &color)
virtual QgsFeatureRendererV2 * clone() const =0
QString number(int n, int base)
int count(const T &value) const
static QgsGraduatedSymbolRendererV2 * createRenderer(QgsVectorLayer *vlayer, const QString &attrName, int classes, Mode mode, QgsSymbolV2 *symbol, QgsVectorColorRampV2 *ramp, bool inverted=false, const QgsRendererRangeV2LabelFormat &legendFormat=QgsRendererRangeV2LabelFormat())
void setGraduatedMethod(GraduatedMethod method)
set the method used for graduation (either size or color)
void append(const T &value)
const QgsFeatureRendererV2 * embeddedRenderer() const override
Returns the current embedded renderer (subrenderer) for this feature renderer.
const_iterator constEnd() const
void startRender(QgsRenderContext &context, const QgsFields *fields=nullptr)
void sortByLabel(Qt::SortOrder order=Qt::AscendingOrder)
static QList< double > _calcQuantileBreaks(QList< double > values, int classes)
QgsInvertedPolygonRenderer is a polygon-only feature renderer used to display features inverted...
const QgsRangeList & ranges() const
void setAttribute(const QString &name, const QString &value)
#define DEFAULT_SCALE_METHOD
void setOrderByEnabled(bool enabled)
Sets whether custom ordering should be applied before features are processed by this renderer...
virtual QgsVectorColorRampV2 * clone() const =0
Creates a clone of the color ramp.
void swap(QgsRendererRangeV2 &other)
QString expressionString() const
Returns the expression string of this QgsDataDefined.
int toInt(bool *ok, int base) const
QString qgsDoubleToString(double a, int precision=17)
Returns a string representation of a double.
void toSld(QDomDocument &doc, QDomElement &element, QgsStringMap props, bool firstRange=false) const
Creates a DOM element representing the range in SLD format.
bool operator<(const QgsRendererRangeV2 &other) const
QgsSymbolV2 * sourceSymbol()
Returns the renderer's source symbol, which is the base symbol used for the each classes' symbol befo...
Q_DECL_DEPRECATED QString rotationField() const override
return rotation field name (or empty string if not set or not supported by renderer) ...
void setAngle(double angle)
Sets the angle for the whole symbol.
static QList< double > _calcJenksBreaks(QList< double > values, int classes, double minimum, double maximum, int maximumSize=3000)
bool rangesHaveGaps() const
Tests whether classes assigned to the renderer have gaps between the ranges.
void setSourceSymbol(QgsSymbolV2 *sym)
Sets the source symbol for the renderer, which is the base symbol used for the each classes' symbol b...
bool updateRangeLowerValue(int rangeIndex, double value)
void setSize(double size)
Sets the size for the whole symbol.
QgsRendererRangeV2LabelFormat mLabelFormat
QGis::GeometryType geometryType() const
Returns point, line or polygon.
bool rangesOverlap() const
Tests whether classes assigned to the renderer have ranges which overlap.
bool usingSymbolLevels() const
virtual Q_DECL_DEPRECATED QgsSymbolV2List symbols()
For symbol levels.
void setUpperValue(double upperValue)
virtual QDomElement save(QDomDocument &doc) override
store renderer info to XML element
QgsSymbolV2 * symbolForValue(double value)
static void convertSymbolSizeScale(QgsSymbolV2 *symbol, QgsSymbolV2::ScaleMethod method, const QString &field)
bool labelGreaterThan(const QgsRendererRangeV2 &r1, const QgsRendererRangeV2 &r2)
QDomText createTextNode(const QString &value)
bool valueLessThan(const QgsRendererRangeV2 &r1, const QgsRendererRangeV2 &r2)
int fieldNameIndex(const QString &fieldName) const
Look up field's index from name also looks up case-insensitive if there is no match otherwise...
virtual QgsGraduatedSymbolRendererV2 * clone() const override
void sortByValue(Qt::SortOrder order=Qt::AscendingOrder)
QgsExpressionContext & expressionContext()
Gets the expression context.
QString field() const
Get the field which this QgsDataDefined represents.
A renderer that automatically displaces points with the same position.
virtual bool legendSymbolItemsCheckable() const override
items of symbology items in legend should be checkable
void setUsingSymbolLevels(bool usingSymbolLevels)
QString & replace(int position, int n, QChar after)
static QList< double > _calcEqualIntervalBreaks(double minimum, double maximum, int classes)
const T & at(int i) const
QgsFeatureRequest::OrderBy orderBy() const
Get the order in which features shall be processed by this renderer.
const_iterator constBegin() const
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.
void copyRendererData(QgsFeatureRendererV2 *destRenderer) const
Clones generic renderer data to another renderer.
Contains information about the context of a rendering operation.
void setOrderBy(const QgsFeatureRequest::OrderBy &orderBy)
Define the order in which features shall be processed by this renderer.
bool orderByEnabled() const
Returns whether custom ordering will be applied before features are processed by this renderer...
int mAttrNum
attribute index (derived from attribute name in startRender)
QList< T > toList() const
void stopRender(QgsRenderContext &context)
QString mid(int position, int n) const
const QgsRendererRangeV2LabelFormat & labelFormat() const
Return the label format used to generate default classification labels.
static bool createFunctionElement(QDomDocument &doc, QDomElement &element, const QString &function)
QSet< T > & unite(const QSet< T > &other)
static QgsSymbolV2 * defaultSymbol(QGis::GeometryType geomType)
return new default symbol for specified geometry type
static QgsExpression * fieldOrExpressionToExpression(const QString &fieldOrExpression)
Return a new valid expression instance for given field or expression string.
Q_DECL_DEPRECATED void setRotationField(const QString &fieldOrExpression) override
sets rotation field of renderer (if supported by the renderer)
QgsDataDefined dataDefinedSize() const
Returns data defined size for whole symbol (including all symbol layers).
void insert(int i, const T &value)
static QPixmap symbolPreviewPixmap(QgsSymbolV2 *symbol, QSize size, QgsRenderContext *customContext=nullptr)
QgsFeatureRequest::OrderBy mOrderBy
QString legendKeyForValue(double value) const
Returns the matching legend key for a value.
static QString encodeScaleMethod(QgsSymbolV2::ScaleMethod scaleMethod)
double minSymbolSize() const
return the min symbol size when graduated by size
QDomElement firstChildElement(const QString &tagName) const
static QString fieldOrExpressionFromExpression(QgsExpression *expression)
Return a field name if the whole expression is just a name of the field .
void setScaleMethodToSymbol(QgsSymbolV2 *symbol, int scaleMethod)
void CORE_EXPORT save(QDomElement &elem) const
Serialize to XML.
virtual void setLegendSymbolItem(const QString &key, QgsSymbolV2 *symbol) override
Sets the symbol to be used for a legend symbol item.
void setSymbol(QgsSymbolV2 *s)
int count(const T &value) const
bool updateRangeSymbol(int rangeIndex, QgsSymbolV2 *symbol)
virtual void checkLegendSymbolItem(const QString &key, bool state=true) override
item in symbology was checked
double maxSymbolSize() const
return the max symbol size when graduated by size
void setSourceColorRamp(QgsVectorColorRampV2 *ramp)
Sets the source color ramp.
QScopedPointer< QgsSymbolV2 > mSourceSymbol
QList< T > toList() const
void setRenderHints(int hints)
static void clearSymbolMap(QgsSymbolV2Map &symbols)
bool updateRangeUpperValue(int rangeIndex, double value)
QScopedPointer< QgsExpression > mRotation
virtual QSet< QString > legendKeysForFeature(QgsFeature &feature, QgsRenderContext &context) override
Return legend keys matching a specified feature.
double toDouble(bool *ok) const
virtual QgsSymbolV2 * originalSymbolForFeature(QgsFeature &feature, QgsRenderContext &context) override
iterator insert(const Key &key, const T &value)
QgsSymbolV2::ScaleMethod mScaleMethod
static QgsFeatureRendererV2 * create(QDomElement &element)
create renderer from XML element
virtual QgsLegendSymbologyList legendSymbologyItems(QSize iconSize) override
return a list of symbology items for the legend
void setLabel(const QString &label)
double lowerValue() const
virtual QList< QString > usedAttributes() override
Returns a set of attributes required for this renderer.
double ANALYSIS_EXPORT min(double x, double y)
Returns the minimum of two doubles or the first argument if both are equal.
const_iterator constEnd() const
QScopedPointer< QgsExpression > mSizeScale
QDomElement createElement(const QString &tagName)
const_iterator constBegin() const
QSet< QString > usedAttributes() const
Return a list of attributes required to render this feature.
QgsRendererRangeV2 & operator=(QgsRendererRangeV2 range)
bool hasDefaultValues() const
Returns whether the data defined container is set to all the default values, ie, disabled, with empty expression and no assigned field.
void insert(const T &value)
Represents a vector layer which manages a vector based data sets.
void deleteClass(int idx)
Abstract base class for color ramps.
bool exactMatch(const QString &str) const
The class stores information about one class/rule of a vector layer renderer in a unified way that ca...
QString arg(qlonglong a, int fieldWidth, int base, const QChar &fillChar) const
void setScaleMethod(QgsSymbolV2::ScaleMethod scaleMethod)
const QgsFeatureRendererV2 * embeddedRenderer() const override
Returns the current embedded renderer (subrenderer) for this feature renderer.
QgsLegendSymbolListV2 legendSymbolItemsV2() const override
int fieldNameIndex(const QString &fieldName) const
Returns the index of a field name or -1 if the field does not exist.
void addClass(QgsSymbolV2 *symbol)
bool valueGreaterThan(const QgsRendererRangeV2 &r1, const QgsRendererRangeV2 &r2)
double upperValue() const
const T value(const Key &key) const
virtual void startRender(QgsRenderContext &context, const QgsFields &fields) override
Needs to be called when a new render cycle is started.
static void convertSymbolRotation(QgsSymbolV2 *symbol, const QString &field)
bool updateRangeLabel(int rangeIndex, const QString &label)
virtual bool saveProperties(QDomDocument &doc, QDomElement &element) const
Saves the current state of the effect to a DOM element.