QGIS/python/core/auto_generated/symbology/qgsgraduatedsymbolrenderer.sip.in

539 lines
16 KiB
Plaintext
Raw Normal View History

2017-06-06 11:03:05 +02:00
/************************************************************************
* This file has been generated automatically from *
* *
2017-08-06 13:39:03 +02:00
* src/core/symbology/qgsgraduatedsymbolrenderer.h *
2017-06-06 11:03:05 +02:00
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/
2017-09-12 00:48:40 +02:00
2016-08-06 11:01:42 +02:00
class QgsGraduatedSymbolRenderer : QgsFeatureRenderer
{
2017-06-06 11:03:05 +02:00
%TypeHeaderCode
2017-06-06 11:03:05 +02:00
#include "qgsgraduatedsymbolrenderer.h"
%End
public:
2015-05-03 17:10:32 +02:00
QgsGraduatedSymbolRenderer( const QString &attrName = QString(), const QgsRangeList &ranges = QgsRangeList() );
~QgsGraduatedSymbolRenderer();
virtual QgsSymbol *symbolForFeature( const QgsFeature &feature, QgsRenderContext &context ) const;
virtual QgsSymbol *originalSymbolForFeature( const QgsFeature &feature, QgsRenderContext &context ) const;
virtual void startRender( QgsRenderContext &context, const QgsFields &fields );
virtual void stopRender( QgsRenderContext &context );
virtual QSet<QString> usedAttributes( const QgsRenderContext &context ) const;
virtual bool filterNeedsGeometry() const;
virtual QString dump() const;
virtual QgsGraduatedSymbolRenderer *clone() const /Factory/;
2017-06-06 11:03:05 +02:00
virtual void toSld( QDomDocument &doc, QDomElement &element, const QgsStringMap &props = QgsStringMap() ) const;
2016-08-06 11:01:42 +02:00
virtual QgsFeatureRenderer::Capabilities capabilities();
2018-04-18 12:51:48 +02:00
virtual QgsSymbolList symbols( QgsRenderContext &context ) const;
virtual bool accept( QgsStyleEntityVisitorInterface *visitor ) const;
QString classAttribute() const;
void setClassAttribute( const QString &attr );
2017-06-06 11:03:05 +02:00
const QgsRangeList &ranges() const;
bool updateRangeSymbol( int rangeIndex, QgsSymbol *symbol /Transfer/ );
bool updateRangeLabel( int rangeIndex, const QString &label );
bool updateRangeUpperValue( int rangeIndex, double value );
bool updateRangeLowerValue( int rangeIndex, double value );
bool updateRangeRenderState( int rangeIndex, bool render );
2017-06-06 11:03:05 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
2017-06-06 11:03:05 +02:00
.. versionadded:: 2.5
%End
void addClass( QgsSymbol *symbol );
void addClass( const QgsRendererRange &range ) /PyName=addClassRange/;
2017-06-06 11:03:05 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
2017-06-06 11:03:05 +02:00
.. note::
available in Python bindings as addClassRange
%End
void addClass( double lower, double upper ) /PyName=addClassLowerUpper/;
2017-06-06 11:03:05 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
2017-06-06 11:03:05 +02:00
.. note::
available in Python bindings as addClassLowerUpper
%End
void addBreak( double breakValue, bool updateSymbols = true );
2017-06-06 11:03:05 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
Add a breakpoint by splitting existing classes so that the specified
value becomes a break between two classes.
2017-12-15 21:36:08 -04:00
2017-12-15 10:36:55 -04:00
:param breakValue: position to insert break
2019-02-26 19:54:09 +10:00
:param updateSymbols: set to ``True`` to reapply ramp colors to the new
symbol ranges
2017-12-15 10:36:55 -04:00
2017-06-06 11:03:05 +02:00
.. versionadded:: 2.9
%End
void deleteClass( int idx );
2013-06-23 16:00:16 +02:00
void deleteAllClasses();
void moveClass( int from, int to );
2017-06-06 11:03:05 +02:00
%Docstring
Moves the category at index position from to index position to.
%End
2013-06-23 16:00:16 +02:00
bool rangesOverlap() const;
2017-06-06 11:03:05 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
Tests whether classes assigned to the renderer have ranges which overlap.
2019-02-26 19:54:09 +10:00
:return: ``True`` if ranges overlap
2017-12-15 10:36:55 -04:00
2017-06-06 11:03:05 +02:00
.. versionadded:: 2.10
%End
bool rangesHaveGaps() const;
2017-06-06 11:03:05 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
Tests whether classes assigned to the renderer have gaps between the ranges.
2019-02-26 19:54:09 +10:00
:return: ``True`` if ranges have gaps
2017-12-15 10:36:55 -04:00
2017-06-06 11:03:05 +02:00
.. versionadded:: 2.10
%End
2013-06-23 16:00:16 +02:00
void sortByValue( Qt::SortOrder order = Qt::AscendingOrder );
void sortByLabel( Qt::SortOrder order = Qt::AscendingOrder );
2019-08-30 12:14:59 +02:00
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,
Quantile,
Jenks,
StdDev,
Pretty,
Custom
};
2019-08-30 12:14:59 +02:00
Mode mode() const /Deprecated/;
%Docstring
.. deprecated:: QGIS 3.10
use classficationMethod instead
2019-08-30 12:14:59 +02:00
%End
void setMode( Mode mode ) /Deprecated/;
%Docstring
.. deprecated:: QGIS 3.10
use classficationMethod instead
2019-08-30 12:14:59 +02:00
%End
2019-08-30 12:14:59 +02:00
bool useSymmetricMode() const /Deprecated/;
%Docstring
2018-07-20 00:31:05 +02:00
Returns if we want to classify symmetric around a given value
2018-07-20 00:31:05 +02:00
.. versionadded:: 3.4
2019-08-30 12:14:59 +02:00
.. deprecated:: QGIS 3.10
use classficationMethod instead
%End
2019-08-30 12:14:59 +02:00
void setUseSymmetricMode( bool useSymmetricMode ) /Deprecated/;
%Docstring
2018-07-20 00:31:05 +02:00
Set if we want to classify symmetric around a given value
2018-07-20 00:31:05 +02:00
.. versionadded:: 3.4
2019-08-30 12:14:59 +02:00
.. deprecated:: QGIS 3.10
use classficationMethod instead
%End
2019-08-30 12:14:59 +02:00
double symmetryPoint() const /Deprecated/;
%Docstring
2018-07-20 00:31:05 +02:00
Returns the pivot value for symmetric classification
2018-07-20 00:31:05 +02:00
.. versionadded:: 3.4
2019-08-30 12:14:59 +02:00
.. deprecated:: QGIS 3.10
use classficationMethod instead
%End
2019-08-30 12:14:59 +02:00
void setSymmetryPoint( double symmetryPoint ) /Deprecated/;
%Docstring
2018-07-20 00:31:05 +02:00
Set the pivot point
2018-07-20 00:31:05 +02:00
.. versionadded:: 3.4
2019-08-30 12:14:59 +02:00
.. deprecated:: QGIS 3.10
use classficationMethod instead
%End
2019-08-30 12:14:59 +02:00
bool astride() const /Deprecated/;
%Docstring
2018-07-20 00:31:05 +02:00
Returns if we want to have a central class astride the pivot value
2018-07-20 00:31:05 +02:00
.. versionadded:: 3.4
2019-08-30 12:14:59 +02:00
.. deprecated:: QGIS 3.10
use classficationMethod instead
%End
2019-08-30 12:14:59 +02:00
void setAstride( bool astride ) /Deprecated/;
%Docstring
2018-07-20 00:31:05 +02:00
Set if we want a central class astride the pivot value
2018-07-20 00:31:05 +02:00
.. versionadded:: 3.4
2019-08-30 12:14:59 +02:00
.. deprecated:: QGIS 3.10
use classficationMethod instead
2018-09-07 09:35:18 +02:00
%End
2019-08-30 12:14:59 +02:00
static void makeBreaksSymmetric( QList<double> &breaks /In,Out/, double symmetryPoint, bool astride ) /Deprecated/;
2018-09-07 09:35:18 +02:00
%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] )
.. versionadded:: 3.4
2019-08-30 12:14:59 +02:00
.. deprecated:: QGIS 3.10
use QgsClassificationMethod.makeBreaksSymmetric instead
2018-09-07 09:35:18 +02:00
%End
2019-09-03 09:05:16 +10:00
static QList<double> calcEqualIntervalBreaks( double minimum, double maximum, int classes, bool useSymmetricMode, double symmetryPoint, bool astride ) /Deprecated/;
2018-09-07 09:35:18 +02:00
%Docstring
Compute the equal interval classification
:param minimum: The minimum value of the distribution
:param maximum: The maximum value of the distribution
:param classes: The number of classes desired
: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] )
2019-08-30 12:14:59 +02:00
.. deprecated:: QGIS 3.10
use QgsClassificationEqualInterval class instead
%End
2019-08-30 12:14:59 +02:00
void updateClasses( QgsVectorLayer *vlayer, Mode mode, int nclasses, bool useSymmetricMode = false, double symmetryPoint = 0.0, bool astride = false ) /Deprecated/;
2017-06-06 11:03:05 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
Recalculate classes for a layer
2017-12-15 21:36:08 -04:00
:param vlayer: The layer being rendered (from which data values are calculated)
:param mode: The calculation mode
2017-12-15 10:36:55 -04:00
:param nclasses: The number of classes to calculate (approximate for some modes)
:param useSymmetricMode: A bool indicating if we want to have classes and hence colors ramp symmetric around a value
:param symmetryPoint: The value around which the classes will be symmetric if useSymmetricMode is checked
:param astride: A bool indicating if the symmetry is made astride the symmetryPoint or not ( [-1,1] vs. [-1,0][0,1] )
2018-07-20 00:31:05 +02:00
.. versionadded:: 2.6
2019-08-30 12:14:59 +02:00
.. deprecated:: QGIS 3.10
2019-08-30 12:14:59 +02:00
%End
void updateClasses( const QgsVectorLayer *vl, int nclasses );
2019-08-30 12:14:59 +02:00
%Docstring
Recalculate classes for a layer
:param vl: The layer being rendered (from which data values are calculated)
:param nclasses: the number of classes
2017-06-06 11:03:05 +02:00
%End
2015-05-03 17:10:32 +02:00
2019-09-03 09:05:56 +10:00
QgsRendererRangeLabelFormat labelFormat() const /Deprecated/;
2017-06-06 11:03:05 +02:00
%Docstring
Returns the label format used to generate default classification labels
2017-12-15 10:36:55 -04:00
2017-06-06 11:03:05 +02:00
.. versionadded:: 2.6
2019-08-30 12:14:59 +02:00
.. deprecated:: QGIS 3.10
use classificationMethod() and QgsClassificationMethod.setLabelFormat instead
2017-06-06 11:03:05 +02:00
%End
2019-08-30 12:14:59 +02:00
void setLabelFormat( const QgsRendererRangeLabelFormat &labelFormat, bool updateRanges = false ) /Deprecated/;
2017-06-06 11:03:05 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
Set the label format used to generate default classification labels
2017-12-15 21:36:08 -04:00
2017-12-15 10:36:55 -04:00
:param labelFormat: The string appended to classification labels
2019-02-26 19:54:09 +10:00
:param updateRanges: If ``True`` then ranges ending with the old unit string are updated to the new.
2017-12-15 10:36:55 -04:00
2017-06-06 11:03:05 +02:00
.. versionadded:: 2.6
2019-08-30 12:14:59 +02:00
.. deprecated:: QGIS 3.10
use classificationMethod() and QgsClassificationMethod.setLabelFormat instead
2017-06-06 11:03:05 +02:00
%End
2019-09-03 09:33:58 +10:00
void calculateLabelPrecision( bool updateRanges = true );
2017-06-06 11:03:05 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
Reset the label decimal places to a numberbased on the minimum class interval
2017-12-15 21:36:08 -04:00
2019-02-26 19:54:09 +10:00
:param updateRanges: if ``True`` then ranges currently using the default label will be updated
2017-12-15 10:36:55 -04:00
2017-06-06 11:03:05 +02:00
.. versionadded:: 2.6
%End
2019-08-30 12:14:59 +02:00
static QgsGraduatedSymbolRenderer *createRenderer( QgsVectorLayer *vlayer,
2017-06-06 11:03:05 +02:00
const QString &attrName,
int classes,
Mode mode,
QgsSymbol *symbol /Transfer/,
QgsColorRamp *ramp /Transfer/,
2018-08-11 16:53:07 +02:00
const QgsRendererRangeLabelFormat &legendFormat = QgsRendererRangeLabelFormat(),
bool useSymmetricMode = false,
double symmetryPoint = 0.0,
const QStringList &listForCboPrettyBreaks = QStringList(),
2019-08-30 12:14:59 +02:00
bool astride = false ) /Deprecated/;
2017-06-06 11:03:05 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
Creates a new graduated renderer.
2017-12-15 21:36:08 -04:00
2017-12-15 10:36:55 -04:00
:param vlayer: vector layer
:param attrName: attribute to classify
:param classes: number of classes
:param mode: classification mode
2018-08-11 16:53:07 +02:00
:param symbol: base symbol
:param ramp: color ramp for classes
:param legendFormat:
:param useSymmetricMode: A bool indicating if we want to have classes and hence colors ramp symmetric around a value
:param symmetryPoint: The value around which the classes will be symmetric if useSymmetricMode is checked
:param listForCboPrettyBreaks: The list of potential pivot values for symmetric mode with prettybreaks mode
:param astride: A bool indicating if the symmetry is made astride the symmetryPoint or not ( [-1,1] vs. [-1,0][0,1] )
2017-12-15 10:36:55 -04:00
:return: new QgsGraduatedSymbolRenderer object
2019-08-30 12:14:59 +02:00
.. deprecated:: QGIS 3.10
2017-06-06 11:03:05 +02:00
%End
2017-06-06 11:03:05 +02:00
static QgsFeatureRenderer *create( QDomElement &element, const QgsReadWriteContext &context ) /Factory/;
%Docstring
create renderer from XML element
%End
2017-06-06 11:03:05 +02:00
virtual QDomElement save( QDomDocument &doc, const QgsReadWriteContext &context );
virtual QgsLegendSymbolList legendSymbolItems() const;
virtual QSet< QString > legendKeysForFeature( const QgsFeature &feature, QgsRenderContext &context ) const;
QgsSymbol *sourceSymbol();
2017-06-06 11:03:05 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
Returns the renderer's source symbol, which is the base symbol used for the each classes' symbol before applying
the classes' color.
.. seealso:: :py:func:`setSourceSymbol`
2017-12-15 10:36:55 -04:00
.. seealso:: :py:func:`sourceColorRamp`
2017-06-06 11:03:05 +02:00
%End
void setSourceSymbol( QgsSymbol *sym /Transfer/ );
2017-06-06 11:03:05 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
Sets the source symbol for the renderer, which is the base symbol used for the each classes' symbol before applying
the classes' color.
2017-12-15 21:36:08 -04:00
2017-12-15 10:36:55 -04:00
:param sym: source symbol, ownership is transferred to the renderer
.. seealso:: :py:func:`sourceSymbol`
2017-12-15 10:36:55 -04:00
.. seealso:: :py:func:`setSourceColorRamp`
2017-06-06 11:03:05 +02:00
%End
QgsColorRamp *sourceColorRamp();
2017-06-06 11:03:05 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
Returns the source color ramp, from which each classes' color is derived.
.. seealso:: :py:func:`setSourceColorRamp`
2017-12-15 10:36:55 -04:00
.. seealso:: :py:func:`sourceSymbol`
2017-06-06 11:03:05 +02:00
%End
2015-09-01 16:06:35 +10:00
void setSourceColorRamp( QgsColorRamp *ramp /Transfer/ );
2017-06-06 11:03:05 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
Sets the source color ramp.
2017-12-15 21:36:08 -04:00
2017-12-15 10:36:55 -04:00
:param ramp: color ramp. Ownership is transferred to the renderer
2017-06-06 11:03:05 +02:00
%End
2015-09-01 16:06:35 +10:00
void updateColorRamp( QgsColorRamp *ramp /Transfer/ = 0 );
2017-06-06 11:03:05 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
Update the color ramp used. Also updates all symbols colors.
Doesn't alter current breaks.
2017-12-15 21:36:08 -04:00
2017-12-15 10:36:55 -04:00
:param ramp: color ramp. Ownership is transferred to the renderer
2017-06-06 11:03:05 +02:00
%End
void updateSymbols( QgsSymbol *sym );
2017-06-06 11:03:05 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
Update all the symbols but leave breaks and colors. This method also sets the source
symbol for the renderer.
2017-12-15 21:36:08 -04:00
2017-12-15 10:36:55 -04:00
:param sym: source symbol to use for classes. Ownership is not transferred.
.. seealso:: :py:func:`setSourceSymbol`
2017-06-06 11:03:05 +02:00
%End
void setSymbolSizes( double minSize, double maxSize );
2017-06-06 11:03:05 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
set varying symbol size for classes
.. note::
the classes must already be set so that symbols exist
2017-12-15 10:36:55 -04:00
2017-06-06 11:03:05 +02:00
.. versionadded:: 2.10
%End
double minSymbolSize() const;
2017-06-06 11:03:05 +02:00
%Docstring
Returns the min symbol size when graduated by size
2017-12-15 10:36:55 -04:00
2017-06-06 11:03:05 +02:00
.. versionadded:: 2.10
%End
double maxSymbolSize() const;
2017-06-06 11:03:05 +02:00
%Docstring
Returns the max symbol size when graduated by size
2017-12-15 10:36:55 -04:00
2017-06-06 11:03:05 +02:00
.. versionadded:: 2.10
%End
2017-06-06 11:03:05 +02:00
enum GraduatedMethod
{
GraduatedColor,
GraduatedSize
};
GraduatedMethod graduatedMethod() const;
2017-06-06 11:03:05 +02:00
%Docstring
Returns the method used for graduation (either size or color)
2017-12-15 10:36:55 -04:00
2017-06-06 11:03:05 +02:00
.. versionadded:: 2.10
%End
void setGraduatedMethod( GraduatedMethod method );
2017-06-06 11:03:05 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
set the method used for graduation (either size or color)
2017-06-06 11:03:05 +02:00
.. versionadded:: 2.10
%End
virtual bool legendSymbolItemsCheckable() const;
virtual bool legendSymbolItemChecked( const QString &key );
virtual void checkLegendSymbolItem( const QString &key, bool state = true );
virtual void setLegendSymbolItem( const QString &key, QgsSymbol *symbol /Transfer/ );
2017-06-06 11:03:05 +02:00
virtual QString legendClassificationAttribute() const;
static QgsGraduatedSymbolRenderer *convertFromRenderer( const QgsFeatureRenderer *renderer ) /Factory/;
2017-06-06 11:03:05 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
creates a QgsGraduatedSymbolRenderer from an existing renderer.
:return: a new renderer if the conversion was possible, otherwise 0.
2017-12-16 10:38:54 -04:00
.. versionadded:: 2.6
2017-06-06 11:03:05 +02:00
%End
void setDataDefinedSizeLegend( QgsDataDefinedSizeLegend *settings /Transfer/ );
%Docstring
2017-12-15 10:36:55 -04:00
Configures appearance of legend when renderer is configured to use data-defined size for marker symbols.
This allows configuring for which values (symbol sizes) should be shown in the legend, whether to display
different symbol sizes collapsed in one legend node or separated across multiple legend nodes etc.
When renderer does not use data-defined size or does not use marker symbols, these settings will be ignored.
Takes ownership of the passed settings objects. ``None`` is a valid input that disables data-defined
2017-12-15 10:36:55 -04:00
size legend.
.. versionadded:: 3.0
%End
QgsDataDefinedSizeLegend *dataDefinedSizeLegend() const;
%Docstring
2017-12-15 10:36:55 -04:00
Returns configuration of appearance of legend when using data-defined size for marker symbols.
Will return ``None`` if the functionality is disabled.
2017-12-15 10:36:55 -04:00
.. versionadded:: 3.0
2019-08-30 12:14:59 +02:00
%End
void updateRangeLabels();
%Docstring
Updates the labels of the ranges
.. versionadded:: 3.10
%End
const QgsRendererRange *rangeForValue( double value ) const;
%Docstring
Returns the renderer range matching the provided ``value``, or ``None`` if no
range matches the value.
.. versionadded:: 3.10.1
%End
protected:
2017-06-06 11:03:05 +02:00
2018-04-18 12:51:48 +02:00
QgsSymbol *symbolForValue( double value ) const;
2017-06-06 11:03:05 +02:00
%Docstring
Gets the symbol which is used to represent ``value``.
2017-06-06 11:03:05 +02:00
%End
QString legendKeyForValue( double value ) const;
2017-06-06 11:03:05 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
Returns the matching legend key for a value.
2017-06-06 11:03:05 +02:00
%End
private:
2016-08-06 11:01:42 +02:00
QgsGraduatedSymbolRenderer( const QgsGraduatedSymbolRenderer & );
QgsGraduatedSymbolRenderer &operator=( const QgsGraduatedSymbolRenderer & );
};
2017-06-06 11:03:05 +02:00
/************************************************************************
* This file has been generated automatically from *
* *
2017-08-06 13:39:03 +02:00
* src/core/symbology/qgsgraduatedsymbolrenderer.h *
2017-06-06 11:03:05 +02:00
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/