15 #ifndef QGSGRADUATEDSYMBOLRENDERERV2_H 16 #define QGSGRADUATEDSYMBOLRENDERERV2_H 18 #include "qgis_core.h" 23 #include "qgsexpression.h" 49 double lowerValue()
const;
50 double upperValue()
const;
53 QString label()
const;
55 void setSymbol(
QgsSymbol *s SIP_TRANSFER );
56 void setLabel(
const QString &label );
57 void setLowerValue(
double lowerValue );
58 void setUpperValue(
double upperValue );
61 bool renderState()
const;
62 void setRenderState(
bool render );
75 void toSld( QDomDocument &doc, QDomElement &element,
QgsStringMap props,
bool firstRange =
false )
const;
78 double mLowerValue = 0, mUpperValue = 0;
104 QString
format()
const {
return mFormat; }
105 void setFormat(
const QString &format ) { mFormat = format; }
108 void setPrecision(
int precision );
114 QString labelForRange(
double lower,
double upper )
const SIP_PYNAME( labelForLowerUpper );
116 QString formatNumber(
double value )
const;
118 void setFromDomElement( QDomElement &element );
119 void saveToDomElement( QDomElement &element );
127 bool mTrimTrailingZeroes =
false;
129 double mNumberScale = 1.0;
155 QString
dump()
const override;
167 bool updateRangeLabel(
int rangeIndex,
const QString &label );
168 bool updateRangeUpperValue(
int rangeIndex,
double value );
169 bool updateRangeLowerValue(
int rangeIndex,
double value );
171 bool updateRangeRenderState(
int rangeIndex,
bool render );
177 void addClass(
double lower,
double upper )
SIP_PYNAME( addClassLowerUpper );
187 void addBreak(
double breakValue,
bool updateSymbols =
true );
189 void deleteClass(
int idx );
190 void deleteAllClasses();
193 void moveClass(
int from,
int to );
200 bool rangesOverlap()
const;
207 bool rangesHaveGaps()
const;
209 void sortByValue( Qt::SortOrder order = Qt::AscendingOrder );
210 void sortByLabel( Qt::SortOrder order = Qt::AscendingOrder );
253 void calculateLabelPrecision(
bool updateRanges =
true );
267 const QString &attrName,
296 void setSourceSymbol(
QgsSymbol *sym SIP_TRANSFER );
309 void setSourceColorRamp(
QgsColorRamp *ramp SIP_TRANSFER );
316 void updateColorRamp(
QgsColorRamp *ramp SIP_TRANSFER =
nullptr );
331 void setSymbolSizes(
double minSize,
double maxSize );
337 double minSymbolSize()
const;
343 double maxSymbolSize()
const;
407 bool mCounting =
false;
411 QgsSymbol *symbolForValue(
double value );
416 QString legendKeyForValue(
double value )
const;
438 #endif // QGSGRADUATEDSYMBOLRENDERERV2_H const QgsRendererRangeLabelFormat & labelFormat() const
Return the label format used to generate default classification labels.
The class is used as a container of context for various read/write operations on other objects...
virtual QgsLegendSymbolList legendSymbolItems() const
Returns a list of symbology items for the legend.
std::unique_ptr< QgsSymbol > mSourceSymbol
QList< QgsLegendSymbolItem > QgsLegendSymbolList
QList< QgsRendererRange > QgsRangeList
virtual void toSld(QDomDocument &doc, QDomElement &element, const QgsStringMap &props=QgsStringMap()) const
used from subclasses to create SLD Rule elements following SLD v1.1 specs
bool operator==(const QgsFeatureIterator &fi1, const QgsFeatureIterator &fi2)
Features may be filtered, i.e. some features may not be rendered (categorized, rule based ...
bool operator!=(const QgsFeatureIterator &fi1, const QgsFeatureIterator &fi2)
QString classAttribute() const
virtual QDomElement save(QDomDocument &doc, const QgsReadWriteContext &context)
store renderer info to XML element
Abstract base class for color ramps.
virtual QgsSymbol * originalSymbolForFeature(QgsFeature &feature, QgsRenderContext &context)
Return symbol for feature.
void setGraduatedMethod(GraduatedMethod method)
set the method used for graduation (either size or color)
Container of fields for a vector layer.
The feature class encapsulates a single feature including its id, geometry and a list of field/values...
std::unique_ptr< QgsExpression > mExpression
QMap< QString, QString > QgsStringMap
virtual QSet< QString > usedAttributes(const QgsRenderContext &context) const =0
Return a list of attributes required by this renderer.
QList< QgsSymbol * > QgsSymbolList
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 void setLegendSymbolItem(const QString &key, QgsSymbol *symbol)
Sets the symbol to be used for a legend symbol item.
virtual QgsSymbolList symbols(QgsRenderContext &context)
Returns list of symbols used by the renderer.
virtual QgsSymbol * symbolForFeature(QgsFeature &feature, QgsRenderContext &context)=0
To be overridden.
Contains information about the context of a rendering operation.
QgsRendererRangeLabelFormat mLabelFormat
GraduatedMethod graduatedMethod() const
return the method used for graduation (either size or color)
virtual void startRender(QgsRenderContext &context, const QgsFields &fields)
Must be called when a new render cycle is started.
virtual void stopRender(QgsRenderContext &context)
Must be called when a render cycle has finished, to allow the renderer to clean up.
std::unique_ptr< QgsSymbol > mSymbol
virtual QSet< QString > legendKeysForFeature(QgsFeature &feature, QgsRenderContext &context)
Return legend keys matching a specified feature.
QString legendClassificationAttribute() const override
If supported by the renderer, return classification attribute for the use in legend.
virtual bool legendSymbolItemsCheckable() const
items of symbology items in legend should be checkable
int ANALYSIS_EXPORT lower(int n, int i)
Lower function.
std::unique_ptr< QgsColorRamp > mSourceColorRamp
void setClassAttribute(const QString &attr)
Represents a vector layer which manages a vector based data sets.
Object that keeps configuration of appearance of marker symbol's data-defined size in legend...
std::unique_ptr< QgsDataDefinedSizeLegend > mDataDefinedSizeLegend
QgsFeatureRenderer::Capabilities capabilities() override
Returns details about internals of this renderer.
const QgsRangeList & ranges() const
virtual QgsFeatureRenderer * clone() const =0
Create a deep copy of this renderer.
virtual QString dump() const
Returns debug information about this renderer.