15 #ifndef QGSGRADUATEDSYMBOLRENDERERV2_H 16 #define QGSGRADUATEDSYMBOLRENDERERV2_H 21 #include <QScopedPointer> 38 double lowerValue()
const;
39 double upperValue()
const;
45 void setLabel(
const QString& label );
46 void setLowerValue(
double lowerValue );
47 void setUpperValue(
double upperValue );
50 bool renderState()
const;
51 void setRenderState(
bool render );
85 void setPrecision(
int precision );
91 QString labelForRange(
double lower,
double upper )
const;
93 QString formatNumber(
double value )
const;
152 bool updateRangeSymbol(
int rangeIndex,
QgsSymbolV2* symbol );
153 bool updateRangeLabel(
int rangeIndex,
const QString& label );
154 bool updateRangeUpperValue(
int rangeIndex,
double value );
155 bool updateRangeLowerValue(
int rangeIndex,
double value );
157 bool updateRangeRenderState(
int rangeIndex,
bool render );
163 void addClass(
double lower,
double upper );
172 void addBreak(
double breakValue,
bool updateSymbols =
true );
174 void deleteClass(
int idx );
175 void deleteAllClasses();
178 void moveClass(
int from,
int to );
184 bool rangesOverlap()
const;
190 bool rangesHaveGaps()
const;
192 void sortByValue( Qt::SortOrder order = Qt::AscendingOrder );
193 void sortByLabel( Qt::SortOrder order = Qt::AscendingOrder );
232 void calculateLabelPrecision(
bool updateRanges =
true );
241 bool inverted =
false,
310 void setSymbolSizes(
double minSize,
double maxSize );
314 double minSymbolSize()
const;
318 double maxSymbolSize()
const;
333 void setSizeScaleField(
const QString& fieldOrExpression );
334 QString sizeScaleField()
const;
387 QString legendKeyForValue(
double value )
const;
401 #endif // QGSGRADUATEDSYMBOLRENDERERV2_H QList< QgsRendererRangeV2 > QgsRangeList
virtual QSet< QString > legendKeysForFeature(QgsFeature &feature, QgsRenderContext &context)
Return legend keys matching a specified feature.
void setInvertedColorRamp(bool inverted)
QScopedPointer< QgsVectorColorRampV2 > mSourceColorRamp
virtual QString dump() const
for debugging
bool operator==(const QgsFeatureIterator &fi1, const QgsFeatureIterator &fi2)
virtual Q_DECL_DEPRECATED QgsSymbolV2 * originalSymbolForFeature(QgsFeature &feature)
Return symbol for feature.
QString classAttribute() const
bool operator!=(const QgsFeatureIterator &fi1, const QgsFeatureIterator &fi2)
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 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 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)
QgsSymbolV2::ScaleMethod scaleMethod() const
virtual QgsLegendSymbolList legendSymbolItems(double scaleDenominator=-1, const QString &rule="")
return a list of item text / symbol
virtual Q_DECL_DEPRECATED QString rotationField() const
return rotation field name (or empty string if not set or not supported by renderer) ...
GraduatedMethod graduatedMethod() const
return the method used for graduation (either size or color)
QgsRendererRangeV2LabelFormat mLabelFormat
virtual Q_DECL_DEPRECATED QgsSymbolV2List symbols()
For symbol levels.
const QgsRendererRangeV2LabelFormat & labelFormat() const
Return the label format used to generate default classification labels.
virtual void toSld(QDomDocument &doc, QDomElement &element) const
used from subclasses to create SLD Rule elements following SLD v1.1 specs
#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 QgsRangeList & ranges() const
virtual QgsLegendSymbolListV2 legendSymbolItemsV2() const
Return a list of symbology items for the legend.
virtual bool legendSymbolItemsCheckable() const
items of symbology items in legend should be checkable
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
QScopedPointer< QgsExpression > mSizeScale
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.
virtual void setLegendSymbolItem(const QString &key, QgsSymbolV2 *symbol)
Sets the symbol to be used for a legend symbol item.