From 41495058d114165aa795e2baabdc7ff2b42385a6 Mon Sep 17 00:00:00 2001 From: Denis Rouzaud Date: Fri, 30 Aug 2019 12:14:59 +0200 Subject: [PATCH] run sipify --- python/CMakeLists.txt | 1 + .../core/auto_generated/qgsapplication.sip.in | 8 + .../qgsclassificationcustom.sip.in | 44 +++ .../qgsclassificationequalinterval.sip.in | 43 +++ .../qgsclassificationjenks.sip.in | 41 +++ .../qgsclassificationmethod.sip.in | 277 ++++++++++++++++++ .../qgsclassificationmethodregistry.sip.in | 54 ++++ .../qgsclassificationprettybreaks.sip.in | 41 +++ .../qgsclassificationquantile.sip.in | 42 +++ .../qgsclassificationstandarddeviation.sip.in | 49 ++++ .../qgsgraduatedsymbolrenderer.sip.in | 95 +++++- .../symbology/qgsrendererrange.sip.in | 6 +- python/core/core_auto.sip | 8 + 13 files changed, 693 insertions(+), 16 deletions(-) create mode 100644 python/core/auto_generated/symbology/classification/qgsclassificationcustom.sip.in create mode 100644 python/core/auto_generated/symbology/classification/qgsclassificationequalinterval.sip.in create mode 100644 python/core/auto_generated/symbology/classification/qgsclassificationjenks.sip.in create mode 100644 python/core/auto_generated/symbology/classification/qgsclassificationmethod.sip.in create mode 100644 python/core/auto_generated/symbology/classification/qgsclassificationmethodregistry.sip.in create mode 100644 python/core/auto_generated/symbology/classification/qgsclassificationprettybreaks.sip.in create mode 100644 python/core/auto_generated/symbology/classification/qgsclassificationquantile.sip.in create mode 100644 python/core/auto_generated/symbology/classification/qgsclassificationstandarddeviation.sip.in diff --git a/python/CMakeLists.txt b/python/CMakeLists.txt index 15482096a2e..03c0eb0a873 100644 --- a/python/CMakeLists.txt +++ b/python/CMakeLists.txt @@ -118,6 +118,7 @@ INCLUDE_DIRECTORIES( ${CMAKE_SOURCE_DIR}/src/core/raster ${CMAKE_SOURCE_DIR}/src/core/scalebar ${CMAKE_SOURCE_DIR}/src/core/symbology + ${CMAKE_SOURCE_DIR}/src/core/symbology/classification ${CMAKE_SOURCE_DIR}/src/core/validity ${CMAKE_SOURCE_DIR}/src/plugins ${CMAKE_SOURCE_DIR}/external diff --git a/python/core/auto_generated/qgsapplication.sip.in b/python/core/auto_generated/qgsapplication.sip.in index 4e129854448..18496b00121 100644 --- a/python/core/auto_generated/qgsapplication.sip.in +++ b/python/core/auto_generated/qgsapplication.sip.in @@ -711,6 +711,14 @@ Returns the application's plugin layer registry, used for managing plugin layer .. versionadded:: 3.0 %End + static QgsClassificationMethodRegistry *classificationMethodRegistry() /KeepReference/; +%Docstring +Returns the application's classification methods registry, used in graduated renderer + +.. versionadded:: 3.10 +%End + + static QgsMessageLog *messageLog(); %Docstring Returns the application's message log. diff --git a/python/core/auto_generated/symbology/classification/qgsclassificationcustom.sip.in b/python/core/auto_generated/symbology/classification/qgsclassificationcustom.sip.in new file mode 100644 index 00000000000..c0bf9b3723d --- /dev/null +++ b/python/core/auto_generated/symbology/classification/qgsclassificationcustom.sip.in @@ -0,0 +1,44 @@ +/************************************************************************ + * This file has been generated automatically from * + * * + * src/core/symbology/classification/qgsclassificationcustom.h * + * * + * Do not edit manually ! Edit header and run scripts/sipify.pl again * + ************************************************************************/ + + + + +class QgsClassificationCustom : QgsClassificationMethod +{ +%Docstring +QgsClassificationCustom is a dummy implementation of QgsClassification +which does not compute any break. + +.. versionadded:: 3.10 +%End + +%TypeHeaderCode +#include "qgsclassificationcustom.h" +%End + public: + QgsClassificationCustom(); + + virtual QgsClassificationMethod *clone() const; + + virtual QString name() const; + + virtual QString id() const; + + + static const QString METHOD_ID; + +}; + +/************************************************************************ + * This file has been generated automatically from * + * * + * src/core/symbology/classification/qgsclassificationcustom.h * + * * + * Do not edit manually ! Edit header and run scripts/sipify.pl again * + ************************************************************************/ diff --git a/python/core/auto_generated/symbology/classification/qgsclassificationequalinterval.sip.in b/python/core/auto_generated/symbology/classification/qgsclassificationequalinterval.sip.in new file mode 100644 index 00000000000..9e5de3bffe5 --- /dev/null +++ b/python/core/auto_generated/symbology/classification/qgsclassificationequalinterval.sip.in @@ -0,0 +1,43 @@ +/************************************************************************ + * This file has been generated automatically from * + * * + * src/core/symbology/classification/qgsclassificationequalinterval.h * + * * + * Do not edit manually ! Edit header and run scripts/sipify.pl again * + ************************************************************************/ + + + +class QgsClassificationEqualInterval : QgsClassificationMethod +{ +%Docstring +QgsClassificationCustom is an implementation of QgsClassification +for equal intervals + +.. versionadded:: 3.10 +%End + +%TypeHeaderCode +#include "qgsclassificationequalinterval.h" +%End + public: + QgsClassificationEqualInterval(); + + virtual QString name() const; + + virtual QString id() const; + + virtual QgsClassificationMethod *clone() const; + + + static const QString METHOD_ID; + +}; + +/************************************************************************ + * This file has been generated automatically from * + * * + * src/core/symbology/classification/qgsclassificationequalinterval.h * + * * + * Do not edit manually ! Edit header and run scripts/sipify.pl again * + ************************************************************************/ diff --git a/python/core/auto_generated/symbology/classification/qgsclassificationjenks.sip.in b/python/core/auto_generated/symbology/classification/qgsclassificationjenks.sip.in new file mode 100644 index 00000000000..f061631bfcd --- /dev/null +++ b/python/core/auto_generated/symbology/classification/qgsclassificationjenks.sip.in @@ -0,0 +1,41 @@ +/************************************************************************ + * This file has been generated automatically from * + * * + * src/core/symbology/classification/qgsclassificationjenks.h * + * * + * Do not edit manually ! Edit header and run scripts/sipify.pl again * + ************************************************************************/ + + + +class QgsClassificationJenks : QgsClassificationMethod +{ +%Docstring +QgsClassificationCustom is an implementation of QgsClassification +for natural breaks based on Jenks method + +.. versionadded:: 3.10 +%End + +%TypeHeaderCode +#include "qgsclassificationjenks.h" +%End + public: + QgsClassificationJenks(); + + virtual QString name() const; + + virtual QString id() const; + + virtual QgsClassificationMethod *clone() const; + + +}; + +/************************************************************************ + * This file has been generated automatically from * + * * + * src/core/symbology/classification/qgsclassificationjenks.h * + * * + * Do not edit manually ! Edit header and run scripts/sipify.pl again * + ************************************************************************/ diff --git a/python/core/auto_generated/symbology/classification/qgsclassificationmethod.sip.in b/python/core/auto_generated/symbology/classification/qgsclassificationmethod.sip.in new file mode 100644 index 00000000000..e903039b6a3 --- /dev/null +++ b/python/core/auto_generated/symbology/classification/qgsclassificationmethod.sip.in @@ -0,0 +1,277 @@ +/************************************************************************ + * This file has been generated automatically from * + * * + * src/core/symbology/classification/qgsclassificationmethod.h * + * * + * Do not edit manually ! Edit header and run scripts/sipify.pl again * + ************************************************************************/ + + + + + +// This is required for the ConvertToSubClassCode to work properly +// so RTTI for casting is available in the whole module. +%ModuleCode +#include "qgsclassificationequalinterval.h" +#include "qgsclassificationjenks.h" +#include "qgsclassificationprettybreaks.h" +#include "qgsclassificationquantile.h" +#include "qgsclassificationstandarddeviation.h" +%End + + + +class QgsClassificationRange +{ +%Docstring +QgsClassificationRange contains the information about a classification range +%End + +%TypeHeaderCode +#include "qgsclassificationmethod.h" +%End + public: + QgsClassificationRange( const QString &label, const double &lowerBound, const double &upperBound ); +%Docstring +Constructor +%End + double lowerBound() const; +%Docstring +Returns the lower bound +%End + double upperBound() const; +%Docstring +Returns the upper bound +%End + + QString label() const; +%Docstring +Returns the lower bound +%End + +}; + + + +class QgsClassificationMethod /Abstract/ +{ +%Docstring +QgsClassification is an abstract class for implementations of classification methods + +.. versionadded:: 3.10 +%End + +%TypeHeaderCode +#include "qgsclassificationmethod.h" +%End +%ConvertToSubClassCode + if ( dynamic_cast( sipCpp ) ) + sipType = sipType_QgsClassificationEqualInterval; + else if ( dynamic_cast( sipCpp ) ) + sipType = sipType_QgsClassificationJenks; + else if ( dynamic_cast( sipCpp ) ) + sipType = sipType_QgsClassificationPrettyBreaks; + else if ( dynamic_cast( sipCpp ) ) + sipType = sipType_QgsClassificationQuantile; + else if ( dynamic_cast( sipCpp ) ) + sipType = sipType_QgsClassificationStandardDeviation; + else + sipType = 0; +%End + public: + + enum ClassPosition + { + LowerBound, + Inner, + UpperBound + }; + + explicit QgsClassificationMethod( bool valuesRequired, bool symmetricModeAvailable, int codeComplexity = 1 ); +%Docstring +Creates a classification method. + +:param valuesRequired: if ``True``, this means that the method requires a set of values to determine the classes +:param symmetricModeAvailable: if ``True``, this allows using symmetric classification +:param codeCommplexity: as the exponent in the big O notation +\param +%End + + virtual ~QgsClassificationMethod(); + + virtual QgsClassificationMethod *clone() const = 0 /Factory/; + + virtual QString name() const = 0; +%Docstring +The readable and translate name of the method +%End + + virtual QString id() const = 0; // as saved in the project, must be unique in registry + + virtual QString labelForRange( const double &lowerValue, const double &upperValue, ClassPosition position = Inner ) const; +%Docstring +Returns the label for a range +%End + + + virtual void saveExtra( QDomElement &element, const QgsReadWriteContext &context ) const; +%Docstring +Writes extra information about the method +%End + virtual void readExtra( const QDomElement &element, const QgsReadWriteContext &context ); +%Docstring +Reads extra information to apply it to the method +%End + + + bool valuesRequired() const; +%Docstring +Returns if the method requires values to calculate the classes +If not, bounds are sufficient +%End + + int codeComplexity() const; +%Docstring +Code complexity as the exponent in Big O notation +%End + + bool symmetricModeAvailable() const; +%Docstring +Returns if the method supports symmetric calculation +%End + + bool symmetricModeEnabled() const; +%Docstring +Returns if the symmetric mode is enabled +%End + + double symmetryPoint() const; +%Docstring +Returns the symmetry point for symmetric mode +%End + + bool astride() const; +%Docstring +Returns if the symmetric mode is astride +if ``True``, it will remove the symmetry point break so that the 2 classes form only one +%End + + void setSymmetricMode( bool enabled, double symmetryPoint = 0, bool astride = false ); +%Docstring +Defines if the symmetric mode is enables and configures its parameters. +If the symmetric mode is not available in the current implementation, calling this method has no effect. + +:param enabled: if the symmetric mode is enabled +:param symmetryPoint: the value of the symmetry point +:param astride: if ``True``, it will remove the symmetry point break so that the 2 classes form only one +%End + + QString labelFormat() const; +%Docstring +Returns the format of the label for the classes +%End + void setLabelFormat( const QString &format ); +%Docstring +Defines the format of the labels for the classes, using %1 and %2 for the bounds +%End + int labelPrecision() const; +%Docstring +Returns the precision for the formatting of the labels +%End + void setLabelPrecision( int labelPrecision ); +%Docstring +Defines the precision for the formatting of the labels +%End + bool labelTrimTrailingZeroes() const; +%Docstring +Returns if the trailing 0 are trimmed in the label +%End + void setLabelTrimTrailingZeroes( bool trimTrailingZeroes ); +%Docstring +Defines if the trailing 0 are trimmed in the label +%End + + static QList listToValues( const QList classes ); +%Docstring +Transforms a list of classes to a list of breaks +%End + + QList classes( const QgsVectorLayer *vl, const QString &expression, int numberOfClasses ); +%Docstring +This will calculate the breaks for a given layer to define the classes. +The breaks do not contain the uppper and lower bounds (minimum and maximum values). + +:param vl: The vector layer +:param fieldName: The name of the field on which the classes are calculated +:param numberOfClasses: The number of classes to be returned +%End + + QList classes( const QList &values, int numberOfClasses ); +%Docstring +This will calculate the breaks for a list of values. +The breaks do not contain the uppper and lower bounds (minimum and maximum values) + +:param values: The list of values +:param numberOfClasses: The number of classes to be returned +%End + + QList classes( double minimum, double maximum, int numberOfClasses ); +%Docstring +This will calculate the classes for defined bounds without any values. +The breaks do not contain the uppper and lower bounds (minimum and maximum values) + +.. warning:: + + If the method implementation requires values, this will return an empty list. + +:param values: The list of values +:param numberOfClasses: The number of classes to be returned +%End + + QDomElement save( QDomDocument &doc, const QgsReadWriteContext &context ) const; + static QgsClassificationMethod *create( const QDomElement &element, const QgsReadWriteContext &context ) /Factory/; + + static void makeBreaksSymmetric( QList &breaks /In,Out/, double symmetryPoint, bool astride ); +%Docstring +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. This is done before. + +:param breaks: The breaks of an already-done classification +:param symmetryPoint: The point around which we want a symmetry +:param astride: A bool indicating if the symmetry is made astride the symmetryPoint or not ( [-1,1] vs. [-1,0][0,1] ) +%End + + QString labelForRange( const QgsRendererRange &range, ClassPosition position = Inner ) const; +%Docstring +Returns the label for a range +%End + + + + static const int MAX_PRECISION; + static const int MIN_PRECISION; + + protected: + + void copyBase( QgsClassificationMethod *c ) const; +%Docstring +Copy the parameters (shall be used in clone implementation) +%End + + QString formatNumber( double value ) const; +%Docstring +Format the number according to label properties +%End + + + +}; + +/************************************************************************ + * This file has been generated automatically from * + * * + * src/core/symbology/classification/qgsclassificationmethod.h * + * * + * Do not edit manually ! Edit header and run scripts/sipify.pl again * + ************************************************************************/ diff --git a/python/core/auto_generated/symbology/classification/qgsclassificationmethodregistry.sip.in b/python/core/auto_generated/symbology/classification/qgsclassificationmethodregistry.sip.in new file mode 100644 index 00000000000..d96c6a6ba54 --- /dev/null +++ b/python/core/auto_generated/symbology/classification/qgsclassificationmethodregistry.sip.in @@ -0,0 +1,54 @@ +/************************************************************************ + * This file has been generated automatically from * + * * + * src/core/symbology/classification/qgsclassificationmethodregistry.h * + * * + * Do not edit manually ! Edit header and run scripts/sipify.pl again * + ************************************************************************/ + + + + + + +class QgsClassificationMethodRegistry +{ +%Docstring +This class manages all known classification methods + +QgsClassificationMethodRegistry is not usually directly created, but rather accessed through +:py:func:`QgsApplication.classificationMethodRegistry()` + +.. versionadded:: 3.10 +%End + +%TypeHeaderCode +#include "qgsclassificationmethodregistry.h" +%End + public: + QgsClassificationMethodRegistry(); + + void addMethod( QgsClassificationMethod *method /Transfer/ ); +%Docstring +Adds a method to the registry +%End + + QgsClassificationMethod *method( const QString &id ); +%Docstring +Return a new instance of the method for the given id +%End + + QMap methodNames() const; +%Docstring +Returns a map of all registered methods +%End + +}; + +/************************************************************************ + * This file has been generated automatically from * + * * + * src/core/symbology/classification/qgsclassificationmethodregistry.h * + * * + * Do not edit manually ! Edit header and run scripts/sipify.pl again * + ************************************************************************/ diff --git a/python/core/auto_generated/symbology/classification/qgsclassificationprettybreaks.sip.in b/python/core/auto_generated/symbology/classification/qgsclassificationprettybreaks.sip.in new file mode 100644 index 00000000000..973ed1215ff --- /dev/null +++ b/python/core/auto_generated/symbology/classification/qgsclassificationprettybreaks.sip.in @@ -0,0 +1,41 @@ +/************************************************************************ + * This file has been generated automatically from * + * * + * src/core/symbology/classification/qgsclassificationprettybreaks.h * + * * + * Do not edit manually ! Edit header and run scripts/sipify.pl again * + ************************************************************************/ + + + +class QgsClassificationPrettyBreaks : QgsClassificationMethod +{ +%Docstring +QgsClassificationCustom is an implementation of QgsClassification +for pretty breaks + +.. versionadded:: 3.10 +%End + +%TypeHeaderCode +#include "qgsclassificationprettybreaks.h" +%End + public: + QgsClassificationPrettyBreaks(); + + virtual QString name() const; + + virtual QString id() const; + + virtual QgsClassificationMethod *clone() const; + + +}; + +/************************************************************************ + * This file has been generated automatically from * + * * + * src/core/symbology/classification/qgsclassificationprettybreaks.h * + * * + * Do not edit manually ! Edit header and run scripts/sipify.pl again * + ************************************************************************/ diff --git a/python/core/auto_generated/symbology/classification/qgsclassificationquantile.sip.in b/python/core/auto_generated/symbology/classification/qgsclassificationquantile.sip.in new file mode 100644 index 00000000000..bc03db4d69c --- /dev/null +++ b/python/core/auto_generated/symbology/classification/qgsclassificationquantile.sip.in @@ -0,0 +1,42 @@ +/************************************************************************ + * This file has been generated automatically from * + * * + * src/core/symbology/classification/qgsclassificationquantile.h * + * * + * Do not edit manually ! Edit header and run scripts/sipify.pl again * + ************************************************************************/ + + + + +class QgsClassificationQuantile : QgsClassificationMethod +{ +%Docstring +QgsClassificationCustom is an implementation of QgsClassification +based on quantiles + +.. versionadded:: 3.10 +%End + +%TypeHeaderCode +#include "qgsclassificationquantile.h" +%End + public: + QgsClassificationQuantile(); + + virtual QString name() const; + + virtual QString id() const; + + virtual QgsClassificationMethod *clone() const; + + +}; + +/************************************************************************ + * This file has been generated automatically from * + * * + * src/core/symbology/classification/qgsclassificationquantile.h * + * * + * Do not edit manually ! Edit header and run scripts/sipify.pl again * + ************************************************************************/ diff --git a/python/core/auto_generated/symbology/classification/qgsclassificationstandarddeviation.sip.in b/python/core/auto_generated/symbology/classification/qgsclassificationstandarddeviation.sip.in new file mode 100644 index 00000000000..90a35859a8f --- /dev/null +++ b/python/core/auto_generated/symbology/classification/qgsclassificationstandarddeviation.sip.in @@ -0,0 +1,49 @@ +/************************************************************************ + * This file has been generated automatically from * + * * + * src/core/symbology/classification/qgsclassificationstandarddeviation.h * + * * + * Do not edit manually ! Edit header and run scripts/sipify.pl again * + ************************************************************************/ + + + +class QgsClassificationStandardDeviation : QgsClassificationMethod +{ +%Docstring +QgsClassificationCustom is an implementation of QgsClassification +based on standard deviation + +.. versionadded:: 3.10 +%End + +%TypeHeaderCode +#include "qgsclassificationstandarddeviation.h" +%End + public: + QgsClassificationStandardDeviation(); + + virtual QString name() const; + + virtual QString id() const; + + virtual QgsClassificationMethod *clone() const; + + virtual QString labelForRange( const double &lowerValue, const double &upperValue, ClassPosition position ) const; + + virtual void saveExtra( QDomElement &element, const QgsReadWriteContext &context ) const; + + virtual void readExtra( const QDomElement &element, const QgsReadWriteContext &context ); + + + static const QString METHOD_ID; + +}; + +/************************************************************************ + * This file has been generated automatically from * + * * + * src/core/symbology/classification/qgsclassificationstandarddeviation.h * + * * + * Do not edit manually ! Edit header and run scripts/sipify.pl again * + ************************************************************************/ diff --git a/python/core/auto_generated/symbology/qgsgraduatedsymbolrenderer.sip.in b/python/core/auto_generated/symbology/qgsgraduatedsymbolrenderer.sip.in index 0f93a1ca0a6..d7245feb937 100644 --- a/python/core/auto_generated/symbology/qgsgraduatedsymbolrenderer.sip.in +++ b/python/core/auto_generated/symbology/qgsgraduatedsymbolrenderer.sip.in @@ -9,6 +9,8 @@ + + class QgsGraduatedSymbolRenderer : QgsFeatureRenderer { @@ -117,6 +119,21 @@ Tests whether classes assigned to the renderer have gaps between the ranges. void sortByValue( Qt::SortOrder order = Qt::AscendingOrder ); void sortByLabel( Qt::SortOrder order = Qt::AscendingOrder ); + QgsClassificationMethod *classificationMethod() const; +%Docstring +Returns the classification method + +.. versionadded:: 3.10 +%End + + void setClassificationMethod( QgsClassificationMethod *method /Transfer/ ); +%Docstring +Defines the classification method +This will take ownership of the method + +.. versionadded:: 3.10 +%End + enum Mode { EqualInterval, @@ -127,54 +144,74 @@ Tests whether classes assigned to the renderer have gaps between the ranges. Custom }; - Mode mode() const; - void setMode( Mode mode ); + Mode mode() const /Deprecated/; +%Docstring - bool useSymmetricMode() const; +.. deprecated:: since QGIS 3.10 use classficationMethod instead +%End + void setMode( Mode mode ) /Deprecated/; +%Docstring + +.. deprecated:: since QGIS 3.10 use classficationMethod instead +%End + + bool useSymmetricMode() const /Deprecated/; %Docstring Returns if we want to classify symmetric around a given value .. versionadded:: 3.4 + +.. deprecated:: since QGIS 3.10 use classficationMethod instead %End - void setUseSymmetricMode( bool useSymmetricMode ); + void setUseSymmetricMode( bool useSymmetricMode ) /Deprecated/; %Docstring Set if we want to classify symmetric around a given value .. versionadded:: 3.4 + +.. deprecated:: since QGIS 3.10 use classficationMethod instead %End - double symmetryPoint() const; + double symmetryPoint() const /Deprecated/; %Docstring Returns the pivot value for symmetric classification .. versionadded:: 3.4 + +.. deprecated:: since QGIS 3.10 use classficationMethod instead %End - void setSymmetryPoint( double symmetryPoint ); + void setSymmetryPoint( double symmetryPoint ) /Deprecated/; %Docstring Set the pivot point .. versionadded:: 3.4 + +.. deprecated:: since QGIS 3.10 use classficationMethod instead %End - bool astride() const; + bool astride() const /Deprecated/; %Docstring Returns if we want to have a central class astride the pivot value .. versionadded:: 3.4 + +.. deprecated:: since QGIS 3.10 use classficationMethod instead %End - void setAstride( bool astride ); + void setAstride( bool astride ) /Deprecated/; %Docstring Set if we want a central class astride the pivot value .. versionadded:: 3.4 + +.. deprecated:: since QGIS 3.10 use classficationMethod instead %End - static void makeBreaksSymmetric( QList &breaks /In,Out/, double symmetryPoint, bool astride ); + static void makeBreaksSymmetric( QList &breaks /In,Out/, double symmetryPoint, bool astride ) /Deprecated/; %Docstring 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. This is done before. @@ -184,9 +221,11 @@ Does not put a break on the symmetryPoint. This is done before. :param astride: A bool indicating if the symmetry is made astride the symmetryPoint or not ( [-1,1] vs. [-1,0][0,1] ) .. versionadded:: 3.4 + +.. deprecated:: since QGIS 3.10, use QgsClassificationMethod.makeBreaksSymmetric instead %End - static QList calcEqualIntervalBreaks( double minimum, double maximum, int classes, bool useSymmetricMode, double symmetryPoint, bool astride ); + static QList calcEqualIntervalBreaks( double minimum, double maximum, int classes, bool useSymmetricMode, double symmetryPoint, bool astride ); %Docstring Compute the equal interval classification @@ -196,9 +235,11 @@ Compute the equal interval classification :param useSymmetricMode: A bool indicating if we want to have classes and hence colors ramp symmetric around a value :param symmetryPoint: The point around which we want a symmetry :param astride: A bool indicating if the symmetry is made astride the symmetryPoint or not ( [-1,1] vs. [-1,0][0,1] ) + +.. deprecated:: since QGIS 3.10 use QgsClassificationEqualInterval class instead %End - void updateClasses( QgsVectorLayer *vlayer, Mode mode, int nclasses, bool useSymmetricMode = false, double symmetryPoint = 0.0, bool astride = false ); + void updateClasses( QgsVectorLayer *vlayer, Mode mode, int nclasses, bool useSymmetricMode = false, double symmetryPoint = 0.0, bool astride = false ) /Deprecated/; %Docstring Recalculate classes for a layer @@ -210,16 +251,27 @@ Recalculate classes for a layer :param astride: A bool indicating if the symmetry is made astride the symmetryPoint or not ( [-1,1] vs. [-1,0][0,1] ) .. versionadded:: 2.6 + +.. deprecated:: since QGIS 3.10 %End - const QgsRendererRangeLabelFormat &labelFormat() const; + void updateClasses( const QgsVectorLayer *vl, int numberOfClasses ); +%Docstring +Recalculate classes for a layer + +:param vlayer: The layer being rendered (from which data values are calculated) +%End + + const QgsRendererRangeLabelFormat &labelFormat() const; %Docstring Returns the label format used to generate default classification labels .. versionadded:: 2.6 + +.. deprecated:: since QGIS 3.10 use classificationMethod() and QgsClassificationMethod.setLabelFormat instead %End - void setLabelFormat( const QgsRendererRangeLabelFormat &labelFormat, bool updateRanges = false ); + void setLabelFormat( const QgsRendererRangeLabelFormat &labelFormat, bool updateRanges = false ) /Deprecated/; %Docstring Set the label format used to generate default classification labels @@ -227,6 +279,8 @@ Set the label format used to generate default classification labels :param updateRanges: If ``True`` then ranges ending with the old unit string are updated to the new. .. versionadded:: 2.6 + +.. deprecated:: since QGIS 3.10 use classificationMethod() and QgsClassificationMethod.setLabelFormat instead %End void calculateLabelPrecision( bool updateRanges = true ); @@ -238,7 +292,8 @@ Reset the label decimal places to a numberbased on the minimum class interval .. versionadded:: 2.6 %End - static QgsGraduatedSymbolRenderer *createRenderer( QgsVectorLayer *vlayer, + + static QgsGraduatedSymbolRenderer *createRenderer( QgsVectorLayer *vlayer, const QString &attrName, int classes, Mode mode, @@ -248,7 +303,7 @@ Reset the label decimal places to a numberbased on the minimum class interval bool useSymmetricMode = false, double symmetryPoint = 0.0, QStringList listForCboPrettyBreaks = QStringList(), - bool astride = false ); + bool astride = false ) /Deprecated/; %Docstring Creates a new graduated renderer. @@ -265,6 +320,8 @@ Creates a new graduated renderer. :param astride: A bool indicating if the symmetry is made astride the symmetryPoint or not ( [-1,1] vs. [-1,0][0,1] ) :return: new QgsGraduatedSymbolRenderer object + +.. deprecated:: since QGIS 3.10 %End static QgsFeatureRenderer *create( QDomElement &element, const QgsReadWriteContext &context ) /Factory/; @@ -418,6 +475,13 @@ Returns configuration of appearance of legend when using data-defined size for m Will return ``None`` if the functionality is disabled. .. versionadded:: 3.0 +%End + + void updateRangeLabels(); +%Docstring +Updates the labels of the ranges + +.. versionadded:: 3.10 %End protected: @@ -437,6 +501,7 @@ Returns the matching legend key for a value. + private: QgsGraduatedSymbolRenderer( const QgsGraduatedSymbolRenderer & ); QgsGraduatedSymbolRenderer &operator=( const QgsGraduatedSymbolRenderer & ); diff --git a/python/core/auto_generated/symbology/qgsrendererrange.sip.in b/python/core/auto_generated/symbology/qgsrendererrange.sip.in index 3a841004717..153d7e27fdb 100644 --- a/python/core/auto_generated/symbology/qgsrendererrange.sip.in +++ b/python/core/auto_generated/symbology/qgsrendererrange.sip.in @@ -24,6 +24,7 @@ class QgsRendererRange %Docstring Constructor for QgsRendererRange. %End + QgsRendererRange( const QgsClassificationRange &range, QgsSymbol *symbol /Transfer/, bool render = true ); QgsRendererRange( double lowerValue, double upperValue, QgsSymbol *symbol /Transfer/, const QString &label, bool render = true ); QgsRendererRange( const QgsRendererRange &range ); @@ -64,11 +65,14 @@ Creates a DOM element representing the range in SLD format. typedef QList QgsRangeList; -class QgsRendererRangeLabelFormat + +class QgsRendererRangeLabelFormat /Deprecated/ { %Docstring .. versionadded:: 2.6 + +.. deprecated:: since QGIS 3.10, use QgsClassificationMethod instead %End %TypeHeaderCode diff --git a/python/core/core_auto.sip b/python/core/core_auto.sip index 9953ffdeb05..2918f5520c7 100644 --- a/python/core/core_auto.sip +++ b/python/core/core_auto.sip @@ -255,6 +255,14 @@ %Include auto_generated/scalebar/qgsscalebarrenderer.sip %Include auto_generated/scalebar/qgssingleboxscalebarrenderer.sip %Include auto_generated/scalebar/qgsticksscalebarrenderer.sip +%Include auto_generated/symbology/classification/qgsclassificationmethodregistry.sip +%Include auto_generated/symbology/classification/qgsclassificationmethod.sip +%Include auto_generated/symbology/classification/qgsclassificationcustom.sip +%Include auto_generated/symbology/classification/qgsclassificationequalinterval.sip +%Include auto_generated/symbology/classification/qgsclassificationprettybreaks.sip +%Include auto_generated/symbology/classification/qgsclassificationquantile.sip +%Include auto_generated/symbology/classification/qgsclassificationjenks.sip +%Include auto_generated/symbology/classification/qgsclassificationstandarddeviation.sip %Include auto_generated/symbology/qgs25drenderer.sip %Include auto_generated/symbology/qgsarrowsymbollayer.sip %Include auto_generated/symbology/qgscategorizedsymbolrenderer.sip