QGIS API Documentation  3.10.0-A Coruña (6c816b4204)
Public Member Functions | Static Public Attributes | List of all members
QgsClassificationEqualInterval Class Reference

QgsClassificationEqualInterval is an implementation of QgsClassificationMethod for equal intervals. More...

#include <qgsclassificationequalinterval.h>

Inheritance diagram for QgsClassificationEqualInterval:
Inheritance graph
[legend]

Public Member Functions

 QgsClassificationEqualInterval ()
 
QgsClassificationMethodclone () const override
 Returns a clone of the method. More...
 
QIcon icon () const override
 The icon of the method. More...
 
QString id () const override
 The id of the method as saved in the project, must be unique in registry. More...
 
QString name () const override
 The readable and translate name of the method. More...
 
- Public Member Functions inherited from QgsClassificationMethod
 QgsClassificationMethod (MethodProperties properties=NoFlag, int codeComplexity=1)
 Creates a classification method. More...
 
virtual ~QgsClassificationMethod ()=default
 
QList< QgsClassificationRangeclasses (const QgsVectorLayer *layer, const QString &expression, int nclasses)
 This will calculate the classes for a given layer to define the classes. More...
 
QList< QgsClassificationRangeclasses (const QList< double > &values, int nclasses)
 This will calculate the classes for a list of values. More...
 
QList< QgsClassificationRangeclasses (double minimum, double maximum, int nclasses)
 This will calculate the classes for defined bounds without any values. More...
 
int codeComplexity () const
 Code complexity as the exponent in Big O notation. More...
 
QString labelFormat () const
 Returns the format of the label for the classes. More...
 
virtual QString labelForRange (double lowerValue, double upperValue, ClassPosition position=Inner) const
 Returns the label for a range. More...
 
QString labelForRange (const QgsRendererRange &range, ClassPosition position=Inner) const
 Returns the label for a range. More...
 
int labelPrecision () const
 Returns the precision for the formatting of the labels. More...
 
bool labelTrimTrailingZeroes () const
 Returns if the trailing 0 are trimmed in the label. More...
 
virtual void readXml (const QDomElement &element, const QgsReadWriteContext &context)
 Reads extra information to apply it to the method. More...
 
QDomElement save (QDomDocument &doc, const QgsReadWriteContext &context) const
 Saves the method to a DOM element and return it. More...
 
void setLabelFormat (const QString &format)
 Defines the format of the labels for the classes, using %1 and %2 for the bounds. More...
 
void setLabelPrecision (int labelPrecision)
 Defines the precision for the formatting of the labels. More...
 
void setLabelTrimTrailingZeroes (bool trimTrailingZeroes)
 Defines if the trailing 0 are trimmed in the label. More...
 
void setSymmetricMode (bool enabled, double symmetryPoint=0, bool symmetryAstride=false)
 Defines if the symmetric mode is enables and configures its parameters. More...
 
bool symmetricModeAvailable () const
 Returns if the method supports symmetric calculation. More...
 
bool symmetricModeEnabled () const
 Returns if the symmetric mode is enabled. More...
 
bool symmetryAstride () const
 Returns if the symmetric mode is astride if true, it will remove the symmetry point break so that the 2 classes form only one. More...
 
double symmetryPoint () const
 Returns the symmetry point for symmetric mode. More...
 
bool valuesRequired () const
 Returns if the method requires values to calculate the classes If not, bounds are sufficient. More...
 
virtual void writeXml (QDomElement &element, const QgsReadWriteContext &context) const
 Writes extra information about the method. More...
 

Static Public Attributes

static const QString METHOD_ID = QStringLiteral( "EqualInterval" )
 
- Static Public Attributes inherited from QgsClassificationMethod
static const int MAX_PRECISION = 15
 
static const int MIN_PRECISION = -6
 

Additional Inherited Members

- Public Types inherited from QgsClassificationMethod
enum  ClassPosition { LowerBound, Inner, UpperBound }
 Defines the class position. More...
 
enum  MethodProperty { NoFlag = 0, ValuesNotRequired = 1 << 1, SymmetricModeAvailable = 1 << 2 }
 Flags for the classification method. More...
 
- Static Public Member Functions inherited from QgsClassificationMethod
static QgsClassificationMethodcreate (const QDomElement &element, const QgsReadWriteContext &context)
 Reads the DOM element and return a new classification method from it. More...
 
static void makeBreaksSymmetric (QList< double > &breaks, double symmetryPoint, bool astride)
 Remove the breaks that are above the existing opposite sign classes to keep colors symmetrically balanced around symmetryPoint Does not put a break on the symmetryPoint. More...
 
static QList< double > rangesToBreaks (const QList< QgsClassificationRange > &classes)
 Transforms a list of classes to a list of breaks. More...
 
- Protected Member Functions inherited from QgsClassificationMethod
void copyBase (QgsClassificationMethod *c) const
 Copy the parameters (shall be used in clone implementation) More...
 
QString formatNumber (double value) const
 Format the number according to label properties. More...
 

Detailed Description

QgsClassificationEqualInterval is an implementation of QgsClassificationMethod for equal intervals.

Since
QGIS 3.10

Definition at line 28 of file qgsclassificationequalinterval.h.

Constructor & Destructor Documentation

◆ QgsClassificationEqualInterval()

QgsClassificationEqualInterval::QgsClassificationEqualInterval ( )

Definition at line 23 of file qgsclassificationequalinterval.cpp.

Member Function Documentation

◆ clone()

QgsClassificationMethod * QgsClassificationEqualInterval::clone ( ) const
overridevirtual

Returns a clone of the method.

Implementation can take advantage of copyBase method which copies the parameters of the base class

Implements QgsClassificationMethod.

Definition at line 93 of file qgsclassificationequalinterval.cpp.

◆ icon()

QIcon QgsClassificationEqualInterval::icon ( ) const
overridevirtual

The icon of the method.

Reimplemented from QgsClassificationMethod.

Definition at line 100 of file qgsclassificationequalinterval.cpp.

◆ id()

QString QgsClassificationEqualInterval::id ( ) const
overridevirtual

The id of the method as saved in the project, must be unique in registry.

Implements QgsClassificationMethod.

Definition at line 33 of file qgsclassificationequalinterval.cpp.

◆ name()

QString QgsClassificationEqualInterval::name ( ) const
overridevirtual

The readable and translate name of the method.

Implements QgsClassificationMethod.

Definition at line 28 of file qgsclassificationequalinterval.cpp.

Member Data Documentation

◆ METHOD_ID

const QString QgsClassificationEqualInterval::METHOD_ID = QStringLiteral( "EqualInterval" )
static

Definition at line 38 of file qgsclassificationequalinterval.h.


The documentation for this class was generated from the following files: