15 #ifndef QGSGRADUATEDSYMBOLRENDERERV2_H 16 #define QGSGRADUATEDSYMBOLRENDERERV2_H 21 #include <QScopedPointer> 41 double lowerValue()
const;
42 double upperValue()
const;
48 void setLabel(
const QString& label );
49 void setLowerValue(
double lowerValue );
50 void setUpperValue(
double upperValue );
53 bool renderState()
const;
54 void setRenderState(
bool render );
98 void setPrecision(
int precision );
104 QString labelForRange(
double lower,
double upper )
const;
106 QString formatNumber(
double value )
const;
171 bool updateRangeSymbol(
int rangeIndex,
QgsSymbolV2* symbol );
172 bool updateRangeLabel(
int rangeIndex,
const QString& label );
173 bool updateRangeUpperValue(
int rangeIndex,
double value );
174 bool updateRangeLowerValue(
int rangeIndex,
double value );
176 bool updateRangeRenderState(
int rangeIndex,
bool render );
182 void addClass(
double lower,
double upper );
191 void addBreak(
double breakValue,
bool updateSymbols =
true );
193 void deleteClass(
int idx );
194 void deleteAllClasses();
197 void moveClass(
int from,
int to );
203 bool rangesOverlap()
const;
209 bool rangesHaveGaps()
const;
211 void sortByValue( Qt::SortOrder order = Qt::AscendingOrder );
212 void sortByLabel( Qt::SortOrder order = Qt::AscendingOrder );
251 void calculateLabelPrecision(
bool updateRanges =
true );
260 bool inverted =
false,
329 void setSymbolSizes(
double minSize,
double maxSize );
333 double minSymbolSize()
const;
337 double maxSymbolSize()
const;
352 void setSizeScaleField(
const QString& fieldOrExpression );
353 QString sizeScaleField()
const;
406 QString legendKeyForValue(
double value )
const;
420 #endif // QGSGRADUATEDSYMBOLRENDERERV2_H QgsSymbolV2::ScaleMethod scaleMethod() const
QList< QgsRendererRangeV2 > QgsRangeList
virtual Q_DECL_DEPRECATED QString rotationField() const
return rotation field name (or empty string if not set or not supported by renderer) ...
virtual QSet< QString > legendKeysForFeature(QgsFeature &feature, QgsRenderContext &context)
Return legend keys matching a specified feature.
void setInvertedColorRamp(bool inverted)
QScopedPointer< QgsVectorColorRampV2 > mSourceColorRamp
bool operator==(const QgsFeatureIterator &fi1, const QgsFeatureIterator &fi2)
virtual Q_DECL_DEPRECATED QgsSymbolV2 * originalSymbolForFeature(QgsFeature &feature)
Return symbol for feature.
bool operator!=(const QgsFeatureIterator &fi1, const QgsFeatureIterator &fi2)
GraduatedMethod graduatedMethod() const
return the method used for graduation (either size or color)
virtual QDomElement save(QDomDocument &doc)
store renderer info to XML element
#define Q_NOWARN_DEPRECATED_PUSH
Container of fields for a vector layer.
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.
virtual QList< QString > usedAttributes()=0
Returns a set of attributes required for this renderer.
The feature class encapsulates a single feature including its id, geometry and a list of field/values...
virtual void toSld(QDomDocument &doc, QDomElement &element) const
used from subclasses to create SLD Rule elements following SLD v1.1 specs
virtual bool legendSymbolItemChecked(const QString &key)
items of symbology items in legend is checked
virtual void checkLegendSymbolItem(const QString &key, bool state=true)
item in symbology was checked
virtual QgsLegendSymbologyList legendSymbologyItems(QSize iconSize)
return a list of symbology items for the legend
virtual void startRender(QgsRenderContext &context, const QgsFields &fields)=0
Needs to be called when a new render cycle is started.
virtual void stopRender(QgsRenderContext &context)=0
Needs to be called when a render cycle has finished to clean up.
QScopedPointer< QgsSymbolV2 > mSymbol
GraduatedMethod mGraduatedMethod
QScopedPointer< QgsExpression > mExpression
virtual int capabilities() override
returns bitwise OR-ed capabilities of the renderer
virtual QgsFeatureRendererV2 * clone() const =0
virtual Q_DECL_DEPRECATED QgsSymbolV2 * symbolForFeature(QgsFeature &feature)
To be overridden.
void setGraduatedMethod(GraduatedMethod method)
set the method used for graduation (either size or color)
virtual QString dump() const
for debugging
QString classAttribute() const
const QgsRangeList & ranges() const
virtual QgsLegendSymbolList legendSymbolItems(double scaleDenominator=-1, const QString &rule="")
return a list of item text / symbol
QgsRendererRangeV2LabelFormat mLabelFormat
virtual Q_DECL_DEPRECATED QgsSymbolV2List symbols()
For symbol levels.
#define Q_NOWARN_DEPRECATED_POP
int ANALYSIS_EXPORT lower(int n, int i)
Lower function.
Contains information about the context of a rendering operation.
int mAttrNum
attribute index (derived from attribute name in startRender)
const QgsRendererRangeV2LabelFormat & labelFormat() const
Return the label format used to generate default classification labels.
void setClassAttribute(const QString &attr)
QScopedPointer< QgsSymbolV2 > mSourceSymbol
virtual QString legendClassificationAttribute() const override
If supported by the renderer, return classification attribute for the use in legend.
QScopedPointer< QgsExpression > mRotation
QgsSymbolV2::ScaleMethod mScaleMethod
virtual bool legendSymbolItemsCheckable() const
items of symbology items in legend should be checkable
QScopedPointer< QgsExpression > mSizeScale
features may be filtered, i.e. some features may not be rendered (categorized, rule based ...
virtual Q_DECL_DEPRECATED void setRotationField(const QString &fieldName)
sets rotation field of renderer (if supported by the renderer)
Represents a vector layer which manages a vector based data sets.
Abstract base class for color ramps.
virtual void setLegendSymbolItem(const QString &key, QgsSymbolV2 *symbol)
Sets the symbol to be used for a legend symbol item.