A class break object used to categorize a group of values that fall within a range of values. More...
Header: | #include <ClassBreak.h> |
Since: | Esri::ArcGISRuntime 100.0 |
Inherits: | Esri::ArcGISRuntime::Object and Esri::ArcGISRuntime::JsonSerializable |
Public Functions
ClassBreak(QObject *parent = nullptr) | |
ClassBreak(const QString &label, const QString &description, double minValue, double maxValue, Esri::ArcGISRuntime::Symbol *symbol, QObject *parent = nullptr) | |
ClassBreak(const QString &label, const QString &description, double minValue, double maxValue, Esri::ArcGISRuntime::Symbol *symbol, const QList<Esri::ArcGISRuntime::Symbol *> &alternateSymbols, QObject *parent = nullptr) | |
virtual | ~ClassBreak() override |
Esri::ArcGISRuntime::SymbolListModel * | alternateSymbols() const |
Esri::ArcGISRuntime::ClassBreak * | clone(QObject *parent = nullptr) const |
QString | description() const |
QString | label() const |
double | maxValue() const |
double | minValue() const |
void | setDescription(const QString &description) |
void | setLabel(const QString &label) |
void | setMaxValue(double maxValue) |
void | setMinValue(double minValue) |
void | setSymbol(Esri::ArcGISRuntime::Symbol *symbol) |
Esri::ArcGISRuntime::Symbol * | symbol() const |
bool | operator!=(const Esri::ArcGISRuntime::ClassBreak *other) const |
bool | operator==(const Esri::ArcGISRuntime::ClassBreak *other) const |
Reimplemented Public Functions
virtual QString | toJson() const override |
virtual QJsonObject | unknownJson() const override |
virtual QJsonObject | unsupportedJson() const override |
Static Public Members
Esri::ArcGISRuntime::ClassBreak * | fromJson(const QString &json, QObject *parent = nullptr) |
Detailed Description
The ClassBreak is used to categorize a group of values that fall within a range defined by minValue and maxValue properties. A value is determined to be within this range if it is greater than the minValue but less than or equal to the maxValue. When written as an algebraic equation, it would look like (minValue < value <= maxValue).
For example, assume you wanted to create a set of ClassBreak categories based on the following integers (0, 0, 1, 1, 2, 4, 6, 6, 7, 10).
The following table would be helpful in defining the ClassBreak range settings:
Categorized group of values | count | label | minValue | maxValue |
---|---|---|---|---|
0 | 2 | none | -1 | 0 |
1-2 | 3 | one to two | 0 | 2 |
3-5 | 1 | three to five | 2 | 5 |
6-10 | 4 | six to ten | 5 | 10 |
Relevant samples:
- Change sublayer renderer: Apply a renderer to a sublayer.
- Configure clusters: Add client side feature reduction on a point feature layer that is not pre-configured with clustering.
See also ClassBreaksRenderer.
Member Function Documentation
[explicit]
ClassBreak::ClassBreak (QObject *parent = nullptr)
Default constructor with an optional parent.
ClassBreak::ClassBreak (const QString &label, const QString &description, double minValue , double maxValue , Esri::ArcGISRuntime::Symbol *symbol, QObject *parent = nullptr)
Constructor that takes a label, description, minValue, maxValue, and symbol, with an optional parent.
[since Esri::ArcGISRuntime 100.13]
ClassBreak::ClassBreak (const QString &label, const QString &description, double minValue , double maxValue , Esri::ArcGISRuntime::Symbol *symbol, const QList<Esri::ArcGISRuntime::Symbol *> &alternateSymbols , QObject *parent = nullptr)
Creates a new class break object with alternate symbols.
- label - A label for the class break. "0 - 100,000", for example.
- description - A description of the class break. "Cities with a population under 100,000", for example.
- minValue - The minimum value of the range that defines the break.
- maxValue - The maximum value of the range that defines the break.
- symbol - A symbol used to represent elements in the class break.
- alternateSymbols - The alternate symbols for the class break. Only MultilayerSymbol are supported as alternates. Only MultilayerSymbol are supported as alternates.
- parent - The optional parent QObject.
A class break can have alternate symbols to the primary symbol. Alternate symbols allow you to tailor the visualization of class break at different scales by selecting different symbols for different scales. Alternate symbols are supported only when a class break's primary symbol and other symbols in the alternate symbol list are of type MultilayerSymbol and have SymbolReferenceProperties defining valid min and max scales at which the symbol becomes visible. The renderer will pick only one symbol at a given map scale. If the primary symbol's scale range falls within the map's scale, the primary symbol is used. If not, then symbols in the alternate symbols list are iterated through and the first symbol matching the current map scale is picked for rendering. A symbol becomes visible if the map scale is less than or equal to the symbol's minimum scale and greater than the symbol's maximum scale. For more information about Scale-based symbol classes and alternate symbols, see Use scale-based symbol classes.
This function was introduced in Esri::ArcGISRuntime 100.13.
[override virtual]
ClassBreak::~ClassBreak ()
Destructor.
[since Esri::ArcGISRuntime 100.13]
Esri::ArcGISRuntime::SymbolListModel *ClassBreak::alternateSymbols () const
Returns the alternate symbols for the class break's primary symbol.
Symbols in this list should be of type MultilayerSymbol and must have SymbolReferenceProperties set with valid minimum and maximum scale at which the symbol becomes visible. The renderer will pick only one symbol at a given map scale. If the primary symbol's scale range falls within the map's scale, the primary symbol is used. If not, then symbols in the alternate symbols list are iterated through and the first symbol matching the current map scale is picked for rendering. A symbol becomes visible if the map scale is less than or equal to the symbol's minimum scale and greater than symbol's maximum scale.
This function was introduced in Esri::ArcGISRuntime 100.13.
Esri::ArcGISRuntime::ClassBreak *ClassBreak::clone(QObject *parent = nullptr) const
Clones the class break to a new instance with an optional parent.
Returns a new instance of the class break.
QString ClassBreak::description() const
Returns the description of the class break.
"Cities with a population under 100,000", for example.
See also setDescription().
[static]
Esri::ArcGISRuntime::ClassBreak *ClassBreak::fromJson (const QString &json, QObject *parent = nullptr)
Creates and returns a new class break from the provided json, with an optional parent.
See also JsonSerializable.
QString ClassBreak::label() const
Returns the label for the class break.
"0 - 100000", for example.
See also setLabel().
double ClassBreak::maxValue () const
Returns the maximum value of the range that defines the break.
See also setMaxValue().
double ClassBreak::minValue () const
Returns the minimum value of the range that defines the break.
See also setMinValue().
void ClassBreak::setDescription (const QString &description)
Sets the description of the class break.
"Cities with a population under 100,000", for example.
See also description().
void ClassBreak::setLabel (const QString &label)
Sets the label for the class break.
"0 - 100000", for example.
See also label().
void ClassBreak::setMaxValue (double maxValue )
Sets the maxValue of the range that defines the break.
See also maxValue().
void ClassBreak::setMinValue (double minValue )
Sets the minValue of the range that defines the break.
See also minValue().
void ClassBreak::setSymbol (Esri::ArcGISRuntime::Symbol *symbol)
Sets the symbol used to represent elements in the class break.
See also symbol().
Esri::ArcGISRuntime::Symbol *ClassBreak::symbol() const
Returns the symbol used to represent elements in the class break.
See also setSymbol().
[override virtual]
QString ClassBreak::toJson () const
Reimplements: JsonSerializable::toJson() const.
Returns this class break as a JSON representation.
See also JsonSerializable.
[override virtual]
QJsonObject ClassBreak::unknownJson () const
Reimplements: JsonSerializable::unknownJson() const.
Gets the unknown JSON of this object.
See also JsonSerializable.
[override virtual]
QJsonObject ClassBreak::unsupportedJson () const
Reimplements: JsonSerializable::unsupportedJson() const.
Gets the unsupported JSON of this object.
See also JsonSerializable.
[since Esri::ArcGISRuntime 200.2]
bool ClassBreak::operator!=(const Esri::ArcGISRuntime::ClassBreak *other) const
Inequality operator.
Returns true
if this object and other are not equal.
This function was introduced in Esri::ArcGISRuntime 200.2.
See also ClassBreak::operator==.
bool ClassBreak::operator==(const Esri::ArcGISRuntime::ClassBreak *other) const
Equivalency operator
Returns true
if this object and other equal.