26 std::unique_ptr< QgsProcessingParameterNumber > param = std::make_unique< QgsProcessingParameterNumber >( QStringLiteral(
"INTERVAL" ), QObject::tr(
"Interval size" ),
Qgis::ProcessingNumberParameterType::Double, 1,
false, 0.000000000001 );
39 return QObject::tr(
"Fixed Interval" );
44 return QStringLiteral(
"Fixed" );
52QList<double> QgsClassificationFixedInterval::calculateBreaks(
double &minimum,
double &maximum,
const QList<double> &,
int, QString &error )
65 double value = minimum;
66 while ( value < maximum )
71 if ( breaks.length() >= 999 )
73 error = QObject::tr(
"The specified interval would generate too many classes.\nOnly the first 999 classes have been generated." );
@ Double
Double/float values.
static QIcon getThemeIcon(const QString &name, const QColor &fillColor=QColor(), const QColor &strokeColor=QColor())
Helper to get a theme icon.
Implementation of a fixed interval classification.
QgsClassificationMethod * clone() const override
Returns a clone of the method.
QIcon icon() const override
The icon of the method.
QString name() const override
The readable and translate name of the method.
QString id() const override
The id of the method as saved in the project, must be unique in registry.
bool valuesRequired() const override
Returns if the method requires values to calculate the classes If not, bounds are sufficient.
QgsClassificationFixedInterval()
QgsClassificationMethod is an abstract class for implementations of classification methods.
QVariantMap parameterValues() const
Returns the values of the processing parameters.
void addParameter(QgsProcessingParameterDefinition *definition)
Add a parameter to the method.
const QgsProcessingParameterDefinition * parameterDefinition(const QString ¶meterName) const
Returns the parameter from its name.
void copyBase(QgsClassificationMethod *c) const
Copy the parameters (shall be used in clone implementation)
Contains information about the context in which a processing algorithm is executed.
Base class for the definition of processing parameters.
static double parameterAsDouble(const QgsProcessingParameterDefinition *definition, const QVariantMap ¶meters, const QgsProcessingContext &context)
Evaluates the parameter with matching definition to a static double value.
As part of the API refactoring and improvements which landed in the Processing API was substantially reworked from the x version This was done in order to allow much of the underlying Processing framework to be ported into c
bool qgsDoubleNear(double a, double b, double epsilon=4 *std::numeric_limits< double >::epsilon())
Compare two doubles (but allow some difference)