15 #ifndef QGSGRADUATEDSYMBOLRENDERERV2_H 16 #define QGSGRADUATEDSYMBOLRENDERERV2_H 18 #include "qgis_core.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; }
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;
156 QString
dump()
const override;
168 bool updateRangeLabel(
int rangeIndex,
const QString &label );
169 bool updateRangeUpperValue(
int rangeIndex,
double value );
170 bool updateRangeLowerValue(
int rangeIndex,
double value );
172 bool updateRangeRenderState(
int rangeIndex,
bool render );
178 void addClass(
double lower,
double upper )
SIP_PYNAME( addClassLowerUpper );
188 void addBreak(
double breakValue,
bool updateSymbols =
true );
190 void deleteClass(
int idx );
191 void deleteAllClasses();
194 void moveClass(
int from,
int to );
201 bool rangesOverlap()
const;
208 bool rangesHaveGaps()
const;
210 void sortByValue( Qt::SortOrder order = Qt::AscendingOrder );
211 void sortByLabel( Qt::SortOrder order = Qt::AscendingOrder );
284 static void makeBreaksSymmetric( QList<double> &breaks
SIP_INOUT,
double symmetryPoint,
bool astride );
295 static QList<double> calcEqualIntervalBreaks(
double minimum,
double maximum,
int classes,
bool useSymmetricMode,
double symmetryPoint,
bool astride );
307 void updateClasses(
QgsVectorLayer *vlayer,
Mode mode,
int nclasses,
bool useSymmetricMode =
false,
double symmetryPoint = 0.0,
bool astride =
false );
328 void calculateLabelPrecision(
bool updateRanges =
true );
346 const QString &attrName,
352 bool useSymmetricMode =
false,
353 double symmetryPoint = 0.0,
354 QStringList listForCboPrettyBreaks = QStringList(),
355 bool astride =
false );
379 void setSourceSymbol(
QgsSymbol *sym SIP_TRANSFER );
392 void setSourceColorRamp(
QgsColorRamp *ramp SIP_TRANSFER );
399 void updateColorRamp(
QgsColorRamp *ramp SIP_TRANSFER =
nullptr );
414 void setSymbolSizes(
double minSize,
double maxSize );
420 double minSymbolSize()
const;
426 double maxSymbolSize()
const;
491 bool mCounting =
false;
498 QgsSymbol *symbolForValue(
double value )
const;
503 QString legendKeyForValue(
double value )
const;
508 bool mUseSymmetricMode =
false;
509 double mSymmetryPoint = 0.0;
510 QStringList mListForCboPrettyBreaks = QStringList();
511 bool mAstride =
false;
530 #endif // QGSGRADUATEDSYMBOLRENDERERV2_H The class is used as a container of context for various read/write operations on other objects...
std::unique_ptr< QgsSymbol > mSourceSymbol
QList< QgsLegendSymbolItem > QgsLegendSymbolList
Abstract base class for all rendered symbols.
virtual bool legendSymbolItemsCheckable() const
items of symbology items in legend should be checkable
QList< QgsRendererRange > QgsRangeList
bool operator==(const QgsFeatureIterator &fi1, const QgsFeatureIterator &fi2)
Features may be filtered, i.e. some features may not be rendered (categorized, rule based ...
void setSymmetryPoint(double symmetryPoint)
Set the pivot point.
virtual QgsSymbolList symbols(QgsRenderContext &context) const
Returns list of symbols used by the renderer.
bool operator!=(const QgsFeatureIterator &fi1, const QgsFeatureIterator &fi2)
virtual QDomElement save(QDomDocument &doc, const QgsReadWriteContext &context)
store renderer info to XML element
Abstract base class for color ramps.
QString classAttribute() const
bool astride() const
Returns if we want to have a central class astride the pivot value.
virtual QgsLegendSymbolList legendSymbolItems() const
Returns a list of symbology items for the legend.
void setGraduatedMethod(GraduatedMethod method)
set the method used for graduation (either size or color)
Container of fields for a vector layer.
void setAstride(bool astride)
Set if we want a central class astride the pivot value.
The feature class encapsulates a single feature including its id, geometry and a list of field/values...
bool useSymmetricMode() const
Returns if we want to classify symmetric around a given value.
std::unique_ptr< QgsExpression > mExpression
virtual QgsSymbol * originalSymbolForFeature(const QgsFeature &feature, QgsRenderContext &context) const
Returns symbol for feature.
QMap< QString, QString > QgsStringMap
virtual QgsSymbol * symbolForFeature(const QgsFeature &feature, QgsRenderContext &context) const =0
To be overridden.
void setUseSymmetricMode(bool useSymmetricMode)
Set if we want to classify symmetric around a given value.
virtual QSet< QString > usedAttributes(const QgsRenderContext &context) const =0
Returns a list of attributes required by this renderer.
QList< QgsSymbol * > QgsSymbolList
void setListForCboPrettyBreaks(const QStringList &listForCboPrettyBreaks)
Set the list of breaks used in the prettybreaks mode, which is needed to recover this list in saved c...
double symmetryPoint() const
Returns the pivot value for symmetric classification.
virtual bool legendSymbolItemChecked(const QString &key)
items of symbology items in legend is checked
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
const QgsRangeList & ranges() const
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.
const QgsRendererRangeLabelFormat & labelFormat() const
Returns the label format used to generate default classification labels.
Contains information about the context of a rendering operation.
QgsRendererRangeLabelFormat mLabelFormat
virtual QString dump() const
Returns debug information about this renderer.
virtual void startRender(QgsRenderContext &context, const QgsFields &fields)
Must be called when a new render cycle is started.
GraduatedMethod graduatedMethod() const
Returns the method used for graduation (either size or color)
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
QStringList listForCboPrettyBreaks() const
Returns the list of breaks used in the prettybreaks mode.
QString legendClassificationAttribute() const override
If supported by the renderer, return classification attribute for the use in legend.
virtual QSet< QString > legendKeysForFeature(const QgsFeature &feature, QgsRenderContext &context) const
Returns legend keys matching a specified feature.
int ANALYSIS_EXPORT lower(int n, int i)
Lower function.
std::unique_ptr< QgsColorRamp > mSourceColorRamp
void setClassAttribute(const QString &attr)
virtual bool filterNeedsGeometry() const
Returns true if this renderer requires the geometry to apply the filter.
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.
virtual QgsFeatureRenderer * clone() const =0
Create a deep copy of this renderer.