15 #ifndef QGSGRADUATEDSYMBOLRENDERERV2_H
16 #define QGSGRADUATEDSYMBOLRENDERERV2_H
21 #include <QScopedPointer>
36 double lowerValue()
const;
37 double upperValue()
const;
43 void setLabel(
const QString& label );
44 void setLowerValue(
double lowerValue );
45 void setUpperValue(
double upperValue );
48 bool renderState()
const;
49 void setRenderState(
bool render );
83 void setPrecision(
int precision );
89 QString labelForRange(
double lower,
double upper )
const;
91 QString formatNumber(
double value )
const;
149 bool updateRangeSymbol(
int rangeIndex,
QgsSymbolV2* symbol );
150 bool updateRangeLabel(
int rangeIndex,
const QString& label );
151 bool updateRangeUpperValue(
int rangeIndex,
double value );
152 bool updateRangeLowerValue(
int rangeIndex,
double value );
154 bool updateRangeRenderState(
int rangeIndex,
bool render );
160 void addClass(
double lower,
double upper );
169 void addBreak(
double breakValue,
bool updateSymbols =
true );
171 void deleteClass(
int idx );
172 void deleteAllClasses();
175 void moveClass(
int from,
int to );
181 bool rangesOverlap()
const;
187 bool rangesHaveGaps()
const;
189 void sortByValue( Qt::SortOrder order = Qt::AscendingOrder );
190 void sortByLabel( Qt::SortOrder order = Qt::AscendingOrder );
209 void updateClasses(
QgsVectorLayer *vlayer, Mode mode,
int nclasses );
229 void calculateLabelPrecision(
bool updateRanges =
true );
237 bool inverted =
false,
285 void setSymbolSizes(
double minSize,
double maxSize );
289 double minSymbolSize()
const;
293 double maxSymbolSize()
const;
308 void setSizeScaleField(
const QString& fieldOrExpression );
309 QString sizeScaleField()
const;
363 #endif // QGSGRADUATEDSYMBOLRENDERERV2_H
QList< QgsRendererRangeV2 > QgsRangeList
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
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
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.