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-06-15 16:47:56 +02:00
|
|
|
|
2017-09-12 00:48:40 +02:00
|
|
|
|
2016-08-06 11:01:42 +02:00
|
|
|
class QgsRendererRange
|
2012-09-24 02:28:15 +02:00
|
|
|
{
|
2017-06-06 11:03:05 +02:00
|
|
|
|
2012-09-24 02:28:15 +02:00
|
|
|
%TypeHeaderCode
|
2017-06-06 11:03:05 +02:00
|
|
|
#include "qgsgraduatedsymbolrenderer.h"
|
2012-09-24 02:28:15 +02:00
|
|
|
%End
|
|
|
|
public:
|
2017-09-28 08:17:06 +10:00
|
|
|
|
2016-08-06 11:01:42 +02:00
|
|
|
QgsRendererRange();
|
2017-09-28 08:17:06 +10:00
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Constructor for QgsRendererRange.
|
2017-09-28 08:17:06 +10:00
|
|
|
%End
|
2017-05-01 18:13:15 +02:00
|
|
|
QgsRendererRange( double lowerValue, double upperValue, QgsSymbol *symbol /Transfer/, const QString &label, bool render = true );
|
|
|
|
QgsRendererRange( const QgsRendererRange &range );
|
2012-09-24 02:28:15 +02:00
|
|
|
|
2017-06-06 11:03:05 +02:00
|
|
|
|
|
|
|
bool operator<( const QgsRendererRange &other ) const;
|
2012-09-24 02:28:15 +02:00
|
|
|
|
|
|
|
double lowerValue() const;
|
|
|
|
double upperValue() const;
|
|
|
|
|
2017-05-01 18:13:15 +02:00
|
|
|
QgsSymbol *symbol() const;
|
2012-09-24 02:28:15 +02:00
|
|
|
QString label() const;
|
|
|
|
|
2017-05-01 18:13:15 +02:00
|
|
|
void setSymbol( QgsSymbol *s /Transfer/ );
|
|
|
|
void setLabel( const QString &label );
|
2012-09-24 02:28:15 +02:00
|
|
|
void setLowerValue( double lowerValue );
|
|
|
|
void setUpperValue( double upperValue );
|
|
|
|
|
2014-07-06 16:32:00 +10:00
|
|
|
bool renderState() const;
|
|
|
|
void setRenderState( bool render );
|
|
|
|
|
2013-07-22 21:41:44 +02:00
|
|
|
QString dump() const;
|
2012-09-24 02:28:15 +02:00
|
|
|
|
2017-06-06 11:03:05 +02:00
|
|
|
void toSld( QDomDocument &doc, QDomElement &element, QgsStringMap props, bool firstRange = false ) const;
|
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Creates a DOM element representing the range in SLD format.
|
2017-12-15 21:36:08 -04:00
|
|
|
|
2017-12-15 10:36:55 -04:00
|
|
|
:param doc: DOM document
|
|
|
|
:param element: destination DOM element
|
|
|
|
:param props: graduated renderer properties
|
|
|
|
:param firstRange: set to true if the range is the first range, where the lower value uses a <= test
|
|
|
|
rather than a < test.
|
2017-06-06 11:03:05 +02:00
|
|
|
%End
|
2014-05-27 23:22:50 +02:00
|
|
|
|
|
|
|
protected:
|
2017-06-06 11:03:05 +02:00
|
|
|
|
2017-05-03 07:45:22 +02:00
|
|
|
void swap( QgsRendererRange &other );
|
2012-09-24 02:28:15 +02:00
|
|
|
};
|
|
|
|
|
2016-08-06 11:01:42 +02:00
|
|
|
typedef QList<QgsRendererRange> QgsRangeList;
|
2012-09-24 02:28:15 +02:00
|
|
|
|
2014-10-01 12:47:01 +13:00
|
|
|
|
2016-08-06 11:01:42 +02:00
|
|
|
class QgsRendererRangeLabelFormat
|
2014-09-26 14:47:46 +12:00
|
|
|
{
|
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.6
|
|
|
|
%End
|
|
|
|
|
2014-09-26 14:47:46 +12:00
|
|
|
%TypeHeaderCode
|
2017-06-06 11:03:05 +02:00
|
|
|
#include "qgsgraduatedsymbolrenderer.h"
|
2014-09-26 14:47:46 +12:00
|
|
|
%End
|
|
|
|
public:
|
2016-08-06 11:01:42 +02:00
|
|
|
QgsRendererRangeLabelFormat();
|
2017-05-01 18:13:15 +02:00
|
|
|
QgsRendererRangeLabelFormat( const QString &format, int precision = 4, bool trimTrailingZeroes = false );
|
2014-09-26 14:47:46 +12:00
|
|
|
|
2017-05-03 07:45:22 +02:00
|
|
|
bool operator==( const QgsRendererRangeLabelFormat &other ) const;
|
|
|
|
bool operator!=( const QgsRendererRangeLabelFormat &other ) const;
|
2014-09-26 14:47:46 +12:00
|
|
|
|
2014-09-28 17:24:10 +10:00
|
|
|
QString format() const;
|
2017-05-01 18:13:15 +02:00
|
|
|
void setFormat( const QString &format );
|
2014-09-26 14:47:46 +12:00
|
|
|
|
2017-06-06 11:03:05 +02:00
|
|
|
int precision() const;
|
2014-10-01 09:41:07 +13:00
|
|
|
void setPrecision( int precision );
|
2014-09-26 14:47:46 +12:00
|
|
|
|
|
|
|
bool trimTrailingZeroes() const;
|
|
|
|
void setTrimTrailingZeroes( bool trimTrailingZeroes );
|
|
|
|
|
2014-10-09 09:37:19 +13:00
|
|
|
QString labelForRange( double lower, double upper ) const /PyName=labelForLowerUpper/;
|
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::
|
|
|
|
|
|
|
|
labelForLowerUpper in Python bindings
|
|
|
|
%End
|
2016-08-06 11:01:42 +02:00
|
|
|
QString labelForRange( const QgsRendererRange &range ) const;
|
2014-10-01 12:47:01 +13:00
|
|
|
QString formatNumber( double value ) const;
|
2014-09-26 14:47:46 +12:00
|
|
|
|
|
|
|
void setFromDomElement( QDomElement &element );
|
|
|
|
void saveToDomElement( QDomElement &element );
|
2014-10-03 06:14:38 +13:00
|
|
|
|
2017-01-14 12:52:30 +10:00
|
|
|
static const int MAX_PRECISION;
|
|
|
|
static const int MIN_PRECISION;
|
2014-10-03 06:14:38 +13:00
|
|
|
|
2017-06-06 11:03:05 +02:00
|
|
|
protected:
|
2014-09-26 14:47:46 +12:00
|
|
|
};
|
|
|
|
|
|
|
|
|
2016-08-06 11:01:42 +02:00
|
|
|
class QgsGraduatedSymbolRenderer : QgsFeatureRenderer
|
2012-09-24 02:28:15 +02:00
|
|
|
{
|
2017-06-06 11:03:05 +02:00
|
|
|
|
2012-09-24 02:28:15 +02:00
|
|
|
%TypeHeaderCode
|
2017-06-06 11:03:05 +02:00
|
|
|
#include "qgsgraduatedsymbolrenderer.h"
|
2012-09-24 02:28:15 +02:00
|
|
|
%End
|
|
|
|
public:
|
2015-05-03 17:10:32 +02:00
|
|
|
|
2017-05-01 18:13:15 +02:00
|
|
|
QgsGraduatedSymbolRenderer( const QString &attrName = QString(), const QgsRangeList &ranges = QgsRangeList() );
|
2012-09-24 02:28:15 +02:00
|
|
|
|
2017-12-15 08:57:22 +10:00
|
|
|
~QgsGraduatedSymbolRenderer();
|
2012-09-24 02:28:15 +02:00
|
|
|
|
2018-04-18 12:51:48 +02:00
|
|
|
virtual QgsSymbol *symbolForFeature( QgsFeature &feature, QgsRenderContext &context ) const;
|
2017-12-15 08:57:22 +10:00
|
|
|
|
2018-04-18 12:51:48 +02:00
|
|
|
virtual QgsSymbol *originalSymbolForFeature( QgsFeature &feature, QgsRenderContext &context ) const;
|
2017-12-15 08:57:22 +10:00
|
|
|
|
2017-05-01 18:13:15 +02:00
|
|
|
virtual void startRender( QgsRenderContext &context, const QgsFields &fields );
|
2017-12-15 08:57:22 +10:00
|
|
|
|
2017-05-01 18:13:15 +02:00
|
|
|
virtual void stopRender( QgsRenderContext &context );
|
2017-12-15 08:57:22 +10:00
|
|
|
|
2017-05-01 18:13:15 +02:00
|
|
|
virtual QSet<QString> usedAttributes( const QgsRenderContext &context ) const;
|
2017-12-15 08:57:22 +10:00
|
|
|
|
2013-07-22 21:41:44 +02:00
|
|
|
virtual QString dump() const;
|
2017-12-15 08:57:22 +10:00
|
|
|
|
2017-05-01 18:13:15 +02:00
|
|
|
virtual QgsGraduatedSymbolRenderer *clone() const /Factory/;
|
2017-12-15 08:57:22 +10:00
|
|
|
|
2017-06-06 11:03:05 +02:00
|
|
|
virtual void toSld( QDomDocument &doc, QDomElement &element, const QgsStringMap &props = QgsStringMap() ) const;
|
2017-12-15 08:57:22 +10:00
|
|
|
|
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;
|
2012-09-24 02:28:15 +02:00
|
|
|
|
2017-12-15 08:57:22 +10:00
|
|
|
|
2012-09-24 02:28:15 +02:00
|
|
|
QString classAttribute() const;
|
2017-05-01 18:13:15 +02:00
|
|
|
void setClassAttribute( const QString &attr );
|
2012-09-24 02:28:15 +02:00
|
|
|
|
2017-06-06 11:03:05 +02:00
|
|
|
const QgsRangeList &ranges() const;
|
2012-09-24 02:28:15 +02:00
|
|
|
|
2017-05-01 18:13:15 +02:00
|
|
|
bool updateRangeSymbol( int rangeIndex, QgsSymbol *symbol /Transfer/ );
|
|
|
|
bool updateRangeLabel( int rangeIndex, const QString &label );
|
2012-09-24 02:28:15 +02:00
|
|
|
bool updateRangeUpperValue( int rangeIndex, double value );
|
|
|
|
bool updateRangeLowerValue( int rangeIndex, double value );
|
2014-07-06 16:32:00 +10:00
|
|
|
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
|
2012-09-24 02:28:15 +02:00
|
|
|
|
2017-05-01 18:13:15 +02:00
|
|
|
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
|
2014-09-26 14:47:46 +12:00
|
|
|
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
|
2016-01-04 22:51:18 +11:00
|
|
|
|
|
|
|
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
|
|
|
|
:param updateSymbols: set to true to reapply ramp colors to the new
|
|
|
|
symbol ranges
|
|
|
|
|
2017-06-06 11:03:05 +02:00
|
|
|
.. versionadded:: 2.9
|
|
|
|
%End
|
2016-01-04 22:51:18 +11:00
|
|
|
|
2012-09-24 02:28:15 +02:00
|
|
|
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
|
|
|
|
2015-06-11 06:01:26 +10: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.
|
|
|
|
|
|
|
|
:return: true if ranges overlap
|
|
|
|
|
2017-06-06 11:03:05 +02:00
|
|
|
.. versionadded:: 2.10
|
|
|
|
%End
|
2015-06-11 06:01:26 +10:00
|
|
|
|
|
|
|
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.
|
|
|
|
|
|
|
|
:return: true if ranges have gaps
|
|
|
|
|
2017-06-06 11:03:05 +02:00
|
|
|
.. versionadded:: 2.10
|
|
|
|
%End
|
2015-06-11 06:01:26 +10:00
|
|
|
|
2013-06-23 16:00:16 +02:00
|
|
|
void sortByValue( Qt::SortOrder order = Qt::AscendingOrder );
|
|
|
|
void sortByLabel( Qt::SortOrder order = Qt::AscendingOrder );
|
2012-09-24 02:28:15 +02:00
|
|
|
|
|
|
|
enum Mode
|
|
|
|
{
|
|
|
|
EqualInterval,
|
|
|
|
Quantile,
|
|
|
|
Jenks,
|
|
|
|
StdDev,
|
|
|
|
Pretty,
|
|
|
|
Custom
|
|
|
|
};
|
|
|
|
|
|
|
|
Mode mode() const;
|
|
|
|
void setMode( Mode mode );
|
2017-10-05 11:51:04 +10:00
|
|
|
|
2014-09-24 10:50:54 +12:00
|
|
|
void updateClasses( QgsVectorLayer *vlayer, Mode mode, int nclasses );
|
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
|
|
|
|
2017-12-15 10:36:55 -04:00
|
|
|
:param vlayer: The layer being rendered (from which data values are calculated)
|
|
|
|
:param mode: The calculation mode
|
|
|
|
:param nclasses: The number of classes to calculate (approximate for some modes)
|
|
|
|
|
2017-06-06 11:03:05 +02:00
|
|
|
.. versionadded:: 2.6
|
|
|
|
%End
|
2015-05-03 17:10:32 +02:00
|
|
|
|
2016-08-06 11:01:42 +02:00
|
|
|
const QgsRendererRangeLabelFormat &labelFormat() const;
|
2017-06-06 11:03:05 +02:00
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Return the label format used to generate default classification labels
|
|
|
|
|
2017-06-06 11:03:05 +02:00
|
|
|
.. versionadded:: 2.6
|
|
|
|
%End
|
2017-10-05 11:51:04 +10:00
|
|
|
|
2016-08-06 11:01:42 +02:00
|
|
|
void setLabelFormat( const QgsRendererRangeLabelFormat &labelFormat, bool updateRanges = false );
|
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
|
|
|
|
:param updateRanges: If true then ranges ending with the old unit string are updated to the new.
|
|
|
|
|
2017-06-06 11:03:05 +02:00
|
|
|
.. versionadded:: 2.6
|
|
|
|
%End
|
2014-09-20 18:30:12 +12:00
|
|
|
|
2014-10-01 12:47:01 +13: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
|
|
|
|
2017-12-15 10:36:55 -04:00
|
|
|
:param updateRanges: if true then ranges currently using the default label will be updated
|
|
|
|
|
2017-06-06 11:03:05 +02:00
|
|
|
.. versionadded:: 2.6
|
|
|
|
%End
|
2012-09-24 02:28:15 +02:00
|
|
|
|
2017-06-06 11:03:05 +02:00
|
|
|
static QgsGraduatedSymbolRenderer *createRenderer( QgsVectorLayer *vlayer,
|
|
|
|
const QString &attrName,
|
|
|
|
int classes,
|
|
|
|
Mode mode,
|
|
|
|
QgsSymbol *symbol /Transfer/,
|
|
|
|
QgsColorRamp *ramp /Transfer/,
|
|
|
|
const QgsRendererRangeLabelFormat &legendFormat = QgsRendererRangeLabelFormat() );
|
|
|
|
%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
|
|
|
|
:param symbol: base symbol
|
|
|
|
:param ramp: color ramp for classes
|
|
|
|
:param legendFormat:
|
|
|
|
|
|
|
|
:return: new QgsGraduatedSymbolRenderer object
|
2017-06-06 11:03:05 +02:00
|
|
|
%End
|
2012-09-24 02:28:15 +02:00
|
|
|
|
2017-06-06 11:03:05 +02:00
|
|
|
static QgsFeatureRenderer *create( QDomElement &element, const QgsReadWriteContext &context ) /Factory/;
|
|
|
|
%Docstring
|
|
|
|
create renderer from XML element
|
|
|
|
%End
|
2012-09-24 02:28:15 +02:00
|
|
|
|
2017-06-06 11:03:05 +02:00
|
|
|
virtual QDomElement save( QDomDocument &doc, const QgsReadWriteContext &context );
|
2017-12-15 08:57:22 +10:00
|
|
|
|
2017-06-09 17:22:59 +02:00
|
|
|
virtual QgsLegendSymbolList legendSymbolItems() const;
|
2015-10-08 23:47:51 +11:00
|
|
|
|
2018-04-18 12:51:48 +02:00
|
|
|
virtual QSet< QString > legendKeysForFeature( QgsFeature &feature, QgsRenderContext &context ) const;
|
2016-01-25 13:05:36 +11:00
|
|
|
|
2017-12-15 08:57:22 +10:00
|
|
|
|
2017-05-01 18:13:15 +02:00
|
|
|
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.
|
|
|
|
|
2018-01-09 17:26:37 -04:00
|
|
|
.. seealso:: :py:func:`setSourceSymbol`
|
2017-12-15 10:36:55 -04:00
|
|
|
|
2018-01-09 17:26:37 -04:00
|
|
|
.. seealso:: :py:func:`sourceColorRamp`
|
2017-06-06 11:03:05 +02:00
|
|
|
%End
|
2016-01-27 09:58:47 +11:00
|
|
|
|
2017-05-01 18:13:15 +02:00
|
|
|
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
|
|
|
|
|
2018-01-09 17:26:37 -04:00
|
|
|
.. seealso:: :py:func:`sourceSymbol`
|
2017-12-15 10:36:55 -04:00
|
|
|
|
2018-01-09 17:26:37 -04:00
|
|
|
.. seealso:: :py:func:`setSourceColorRamp`
|
2017-06-06 11:03:05 +02:00
|
|
|
%End
|
2012-09-24 02:28:15 +02:00
|
|
|
|
2017-05-01 18:13:15 +02:00
|
|
|
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.
|
|
|
|
|
2018-01-09 17:26:37 -04:00
|
|
|
.. seealso:: :py:func:`setSourceColorRamp`
|
2017-12-15 10:36:55 -04:00
|
|
|
|
2018-01-09 17:26:37 -04:00
|
|
|
.. seealso:: :py:func:`sourceSymbol`
|
2017-06-06 11:03:05 +02:00
|
|
|
%End
|
2015-09-01 16:06:35 +10:00
|
|
|
|
2017-05-01 18:13:15 +02: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
|
|
|
|
2017-05-01 18:13:15 +02: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
|
2012-09-24 02:28:15 +02:00
|
|
|
|
2017-05-01 18:13:15 +02:00
|
|
|
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.
|
|
|
|
|
2018-01-09 17:26:37 -04:00
|
|
|
.. seealso:: :py:func:`setSourceSymbol`
|
2017-06-06 11:03:05 +02:00
|
|
|
%End
|
2012-09-24 02:28:15 +02:00
|
|
|
|
2015-03-30 17:48:00 +02:00
|
|
|
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
|
|
|
|
|
2017-10-05 11:51:04 +10:00
|
|
|
.. 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
|
2015-03-30 17:48:00 +02:00
|
|
|
|
|
|
|
double minSymbolSize() const;
|
2017-06-06 11:03:05 +02:00
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
return the min symbol size when graduated by size
|
|
|
|
|
2017-06-06 11:03:05 +02:00
|
|
|
.. versionadded:: 2.10
|
|
|
|
%End
|
2015-03-30 17:48:00 +02:00
|
|
|
|
|
|
|
double maxSymbolSize() const;
|
2017-06-06 11:03:05 +02:00
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
return the max symbol size when graduated by size
|
|
|
|
|
2017-06-06 11:03:05 +02:00
|
|
|
.. versionadded:: 2.10
|
|
|
|
%End
|
2015-03-30 17:48:00 +02:00
|
|
|
|
2017-06-06 11:03:05 +02:00
|
|
|
enum GraduatedMethod
|
|
|
|
{
|
|
|
|
GraduatedColor,
|
|
|
|
GraduatedSize
|
|
|
|
};
|
2015-03-30 17:48:00 +02:00
|
|
|
|
|
|
|
GraduatedMethod graduatedMethod() const;
|
2017-06-06 11:03:05 +02:00
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
return the method used for graduation (either size or color)
|
|
|
|
|
2017-06-06 11:03:05 +02:00
|
|
|
.. versionadded:: 2.10
|
|
|
|
%End
|
2015-03-30 17:48:00 +02:00
|
|
|
|
|
|
|
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
|
2015-03-30 17:48:00 +02:00
|
|
|
|
2014-07-06 16:32:00 +10:00
|
|
|
virtual bool legendSymbolItemsCheckable() const;
|
2017-12-15 08:57:22 +10:00
|
|
|
|
2017-05-01 18:13:15 +02:00
|
|
|
virtual bool legendSymbolItemChecked( const QString &key );
|
2017-12-15 08:57:22 +10:00
|
|
|
|
2017-05-01 18:13:15 +02:00
|
|
|
virtual void checkLegendSymbolItem( const QString &key, bool state = true );
|
2017-12-15 08:57:22 +10:00
|
|
|
|
2017-05-01 18:13:15 +02:00
|
|
|
virtual void setLegendSymbolItem( const QString &key, QgsSymbol *symbol /Transfer/ );
|
2017-12-15 08:57:22 +10:00
|
|
|
|
2017-06-06 11:03:05 +02:00
|
|
|
virtual QString legendClassificationAttribute() const;
|
2015-12-08 06:32:23 +11:00
|
|
|
|
2017-05-01 18:13:15 +02:00
|
|
|
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
|
2012-09-24 02:28:15 +02:00
|
|
|
|
2017-06-15 16:47:56 +02:00
|
|
|
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. Null pointer is a valid input that disables data-defined
|
|
|
|
size legend.
|
2017-06-15 16:47:56 +02:00
|
|
|
|
|
|
|
.. 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 null if the functionality is disabled.
|
|
|
|
|
2017-06-15 16:47:56 +02:00
|
|
|
.. versionadded:: 3.0
|
|
|
|
%End
|
|
|
|
|
2012-09-24 02:28:15 +02:00
|
|
|
protected:
|
2017-06-06 11:03:05 +02:00
|
|
|
|
|
|
|
|
2017-06-15 16:47:56 +02:00
|
|
|
|
2018-04-18 12:51:48 +02:00
|
|
|
QgsSymbol *symbolForValue( double value ) const;
|
2017-06-06 11:03:05 +02:00
|
|
|
%Docstring
|
|
|
|
attribute index (derived from attribute name in startRender)
|
|
|
|
%End
|
2014-01-14 17:23:16 +01:00
|
|
|
|
2016-01-25 13:05:36 +11:00
|
|
|
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
|
2016-01-25 13:05:36 +11:00
|
|
|
|
|
|
|
|
2014-01-14 17:23:16 +01:00
|
|
|
private:
|
2016-08-06 11:01:42 +02:00
|
|
|
QgsGraduatedSymbolRenderer( const QgsGraduatedSymbolRenderer & );
|
2017-05-03 07:45:22 +02:00
|
|
|
QgsGraduatedSymbolRenderer &operator=( const QgsGraduatedSymbolRenderer & );
|
2012-09-24 02:28:15 +02:00
|
|
|
};
|
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 *
|
|
|
|
************************************************************************/
|