15#ifndef QGSGRADUATEDSYMBOLRENDERER_H
16#define QGSGRADUATEDSYMBOLRENDERER_H
51 QString
dump()
const override;
53 void toSld( QDomDocument &doc, QDomElement &element,
const QVariantMap &props = QVariantMap() )
const override;
78 bool updateRangeLabel(
int rangeIndex,
const QString &label );
79 bool updateRangeUpperValue(
int rangeIndex,
double value );
80 bool updateRangeLowerValue(
int rangeIndex,
double value );
81 bool updateRangeRenderState(
int rangeIndex,
bool render );
87 void addClass(
double lower,
double upper )
SIP_PYNAME( addClassLowerUpper );
96 void addBreak(
double breakValue,
bool updateSymbols =
true );
98 void deleteClass(
int idx );
99 void deleteAllClasses();
102 void moveClass(
int from,
int to );
108 bool rangesOverlap()
const;
114 bool rangesHaveGaps()
const;
116 void sortByValue( Qt::SortOrder order = Qt::AscendingOrder );
117 void sortByLabel( Qt::SortOrder order = Qt::AscendingOrder );
167 Q_DECL_DEPRECATED
void setUseSymmetricMode(
bool useSymmetricMode )
SIP_DEPRECATED;
181 Q_DECL_DEPRECATED
void setSymmetryPoint(
double symmetryPoint )
SIP_DEPRECATED;
207 Q_DECL_DEPRECATED
static void makeBreaksSymmetric( QList<double> &breaks
SIP_INOUT,
double symmetryPoint,
bool astride )
SIP_DEPRECATED;
219 Q_DECL_DEPRECATED
static QList<double> calcEqualIntervalBreaks(
double minimum,
double maximum,
int classes,
bool useSymmetricMode,
double symmetryPoint,
bool astride )
SIP_DEPRECATED;
231 Q_DECL_DEPRECATED
void updateClasses(
QgsVectorLayer *vlayer, Mode mode,
int nclasses,
bool useSymmetricMode =
false,
double symmetryPoint = 0.0,
bool astride =
false )
SIP_DEPRECATED;
263 void calculateLabelPrecision(
bool updateRanges = true );
284 const QString &attrName,
290 bool useSymmetricMode = false,
291 double symmetryPoint = 0.0,
292 const QStringList &listForCboPrettyBreaks = QStringList(),
302 QString legendKeyToExpression( const QString &key,
QgsVectorLayer *layer,
bool &ok ) const override;
370 void setSymbolSizes(
double minSize,
double maxSize );
375 double minSymbolSize() const;
380 double maxSymbolSize() const;
387 Qgis::GraduatedMethod graduatedMethod()
const {
return mGraduatedMethod; }
429 void updateRangeLabels();
450 bool mCounting =
false;
457 QgsSymbol *symbolForValue(
double value )
const;
462 QString legendKeyForValue(
double value )
const;
490 friend class TestQgsGraduatedSymbolRenderer;
The Qgis class provides global constants for use throughout the application.
QFlags< FeatureRendererFlag > FeatureRendererFlags
Flags controlling behavior of vector feature renderers.
GraduatedMethod
Methods for modifying symbols by range in a graduated symbol renderer.
@ Color
Alter color of symbols.
QgsClassificationMethod is an abstract class for implementations of classification methods.
Abstract base class for color ramps.
Object that keeps configuration of appearance of marker symbol's data-defined size in legend.
Class for parsing and evaluation of expressions (formerly called "search strings").
Abstract base class for all 2D vector feature renderers.
virtual bool legendSymbolItemsCheckable() const
Returns true if symbology items in legend are checkable.
virtual bool legendSymbolItemChecked(const QString &key)
Returns true if the legend symbology item with the specified key is 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) const
Returns list of symbols used by the renderer.
virtual Qgis::FeatureRendererFlags flags() const
Returns flags associated with the renderer.
virtual void stopRender(QgsRenderContext &context)
Must be called when a render cycle has finished, to allow the renderer to clean up.
QFlags< Capability > Capabilities
virtual void toSld(QDomDocument &doc, QDomElement &element, const QVariantMap &props=QVariantMap()) const
used from subclasses to create SLD Rule elements following SLD v1.1 specs
virtual QString dump() const
Returns debug information about this renderer.
virtual QSet< QString > usedAttributes(const QgsRenderContext &context) const =0
Returns a list of attributes required by this renderer.
virtual QgsSymbol * symbolForFeature(const QgsFeature &feature, QgsRenderContext &context) const =0
To be overridden.
virtual void checkLegendSymbolItem(const QString &key, bool state=true)
Sets whether the legend symbology item with the specified ley should be checked.
@ Filter
Features may be filtered, i.e. some features may not be rendered (categorized, rule based ....
virtual bool filterNeedsGeometry() const
Returns true if this renderer requires the geometry to apply the filter.
virtual bool accept(QgsStyleEntityVisitorInterface *visitor) const
Accepts the specified symbology visitor, causing it to visit all symbols associated with the renderer...
virtual QgsSymbol * originalSymbolForFeature(const QgsFeature &feature, QgsRenderContext &context) const
Returns symbol for feature.
virtual void startRender(QgsRenderContext &context, const QgsFields &fields)
Must be called when a new render cycle is started.
virtual QgsFeatureRenderer * clone() const =0
Create a deep copy of this renderer.
The feature class encapsulates a single feature including its unique ID, geometry and a list of field...
Container of fields for a vector layer.
A vector feature renderer which uses numeric attributes to classify features into different ranges.
QString legendClassificationAttribute() const override
If supported by the renderer, return classification attribute for the use in legend.
std::unique_ptr< QgsDataDefinedSizeLegend > mDataDefinedSizeLegend
Q_DECL_DEPRECATED bool useSymmetricMode() const
Returns if we want to classify symmetric around a given value.
std::unique_ptr< QgsSymbol > mSourceSymbol
void setGraduatedMethod(Qgis::GraduatedMethod method)
Set the method used for graduation (either size or color).
std::shared_ptr< QgsClassificationMethod > mClassificationMethod
Q_DECL_DEPRECATED bool astride() const
Returns if we want to have a central class astride the pivot value.
QgsFeatureRenderer::Capabilities capabilities() override
Returns details about internals of this renderer.
QString classAttribute() const
Returns the attribute name (or expression) used for the classification.
std::unique_ptr< QgsColorRamp > mSourceColorRamp
Q_DECL_DEPRECATED Mode mode() const
void setClassAttribute(const QString &attr)
Sets the attribute name (or expression) used for the classification.
std::unique_ptr< QgsExpression > mExpression
const QgsRangeList & ranges() const
Returns a list of all ranges used in the classification.
Q_DECL_DEPRECATED double symmetryPoint() const
Returns the pivot value for symmetric classification.
The class is used as a container of context for various read/write operations on other objects.
Contains information about the context of a rendering operation.
An interface for classes which can visit style entity (e.g.
Abstract base class for all rendered symbols.
Represents a vector layer which manages a vector based data sets.
#define Q_NOWARN_DEPRECATED_POP
#define Q_NOWARN_DEPRECATED_PUSH
QList< QgsLegendSymbolItem > QgsLegendSymbolList
QList< QgsSymbol * > QgsSymbolList
QList< QgsRendererRange > QgsRangeList