QGIS/python/core/qgspropertytransformer.sip

691 lines
20 KiB
Plaintext
Raw Normal View History

2017-04-02 21:55:46 +02:00
/************************************************************************
* This file has been generated automatically from *
* *
* src/core/qgspropertytransformer.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/
class QgsCurveTransform
{
%Docstring
Handles scaling of input values to output values by using a curve created
from smoothly joining a number of set control points.
QgsCurveTransform assists in creation of curve type transforms, typically seen in
raster image editing software (eg the curves dialog in GIMP or Photoshop).
Transforms are created by passing a number of set control points through which
the transform curve must pass. The curve is guaranteed to exactly pass through
these control points. Between control points the curve is smoothly interpolated
so that no disjoint sections or "corners" are present.
If the first or last control point are not located at x = 0 and x = 1 respectively,
then values outside this range will be mapped to the y value of either the first
or last control point. In other words, the curve will have a flat segment
for values outside of the control point range.
.. versionadded:: 3.0
%End
2017-04-02 21:55:46 +02:00
%TypeHeaderCode
2017-04-02 21:55:46 +02:00
#include "qgspropertytransformer.h"
%End
public:
QgsCurveTransform();
2017-04-02 21:55:46 +02:00
%Docstring
Constructs a default QgsCurveTransform which linearly maps values
between 0 and 1 unchanged. I.e. y == x.
%End
QgsCurveTransform( const QList< QgsPoint > &controlPoints );
%Docstring
Constructs a QgsCurveTransform using a specified list of ``controlPoints``.
2017-04-02 21:55:46 +02:00
Behavior is undefined if duplicate x values exist in the control points
list.
%End
~QgsCurveTransform();
2017-04-02 21:55:46 +02:00
QgsCurveTransform( const QgsCurveTransform &other );
%Docstring
Copy constructor
%End
QList< QgsPoint > controlPoints() const;
2017-04-02 21:55:46 +02:00
%Docstring
Returns a list of the control points for the transform.
2017-04-03 11:59:45 +10:00
\see setControlPoints()
:rtype: list of QgsPoint
2017-04-02 21:55:46 +02:00
%End
2017-04-02 21:55:46 +02:00
void setControlPoints( const QList< QgsPoint > &points );
%Docstring
Sets the list of control points for the transform. Any existing
points are removed.
2017-04-03 11:59:45 +10:00
\see controlPoints()
2017-04-02 21:55:46 +02:00
%End
void addControlPoint( double x, double y );
2017-04-02 21:55:46 +02:00
%Docstring
Adds a control point to the transform. Behavior is undefined if duplicate
x values exist in the control points list.
2017-04-03 11:59:45 +10:00
\see removeControlPoint()
2017-04-02 21:55:46 +02:00
%End
void removeControlPoint( double x, double y );
2017-04-02 21:55:46 +02:00
%Docstring
Removes a control point from the transform. This will have no effect if a
matching control point does not exist.
2017-04-03 11:59:45 +10:00
\see addControlPoint()
2017-04-02 21:55:46 +02:00
%End
double y( double x ) const;
2017-04-02 21:55:46 +02:00
%Docstring
Returns the mapped y value corresponding to the specified ``x`` value.
:rtype: float
2017-04-02 21:55:46 +02:00
%End
2017-04-02 21:55:46 +02:00
QVector< double > y( const QVector< double > &x ) const;
%Docstring
Returns a list of y values corresponding to a list of ``x`` values.
2017-04-02 21:55:46 +02:00
Calling this method is faster then calling the double variant multiple
times.
:rtype: list of float
2017-04-02 21:55:46 +02:00
%End
2017-04-02 21:55:46 +02:00
bool readXml( const QDomElement &elem, const QDomDocument &doc );
%Docstring
Reads the curve's state from an XML element.
2017-04-03 11:59:45 +10:00
\param elem source DOM element for transform's state
\param doc DOM document
\see writeXml()
:rtype: bool
2017-04-02 21:55:46 +02:00
%End
2017-04-02 21:55:46 +02:00
bool writeXml( QDomElement &transformElem, QDomDocument &doc ) const;
%Docstring
Writes the current state of the transform into an XML element
2017-04-03 11:59:45 +10:00
\param transformElem destination element for the transform's state
\param doc DOM document
\see readXml()
:rtype: bool
2017-04-02 21:55:46 +02:00
%End
QVariant toVariant() const;
2017-04-02 21:55:46 +02:00
%Docstring
Saves this curve transformer to a QVariantMap, wrapped in a QVariant.
You can use QgsXmlUtils.writeVariant to save it to an XML document.
2017-04-02 21:55:46 +02:00
2017-04-03 11:59:45 +10:00
\see loadVariant()
:rtype: QVariant
2017-04-02 21:55:46 +02:00
%End
bool loadVariant( const QVariant &transformer );
2017-04-02 21:55:46 +02:00
%Docstring
Load this curve transformer from a QVariantMap, wrapped in a QVariant.
You can use QgsXmlUtils.writeVariant to load it from an XML document.
2017-04-02 21:55:46 +02:00
2017-04-03 11:59:45 +10:00
\see toVariant()
:rtype: bool
2017-04-02 21:55:46 +02:00
%End
};
2017-04-02 21:55:46 +02:00
class QgsPropertyTransformer
{
2017-04-02 21:55:46 +02:00
%Docstring
Abstract base class for objects which transform the calculated value of a property.
Possible uses include transformers which map a value into a scaled size or color from a gradient.
.. versionadded:: 3.0
%End
%TypeHeaderCode
2017-04-02 21:55:46 +02:00
#include "qgspropertytransformer.h"
%End
%ConvertToSubClassCode
2017-04-02 21:55:46 +02:00
if ( sipCpp->transformerType() == QgsPropertyTransformer::GenericNumericTransformer )
sipType = sipType_QgsGenericNumericTransformer;
else if ( sipCpp->transformerType() == QgsPropertyTransformer::SizeScaleTransformer )
sipType = sipType_QgsSizeScaleTransformer;
else if ( sipCpp->transformerType() == QgsPropertyTransformer::ColorRampTransformer )
sipType = sipType_QgsColorRampTransformer;
else
sipType = sipType_QgsPropertyTransformer;
%End
public:
enum Type
{
2017-02-14 08:32:01 +10:00
GenericNumericTransformer,
SizeScaleTransformer,
ColorRampTransformer,
};
2017-04-02 21:55:46 +02:00
static QgsPropertyTransformer *create( Type type ) /Factory/;
%Docstring
Factory method for creating a new property transformer of the specified type.
2017-04-03 11:59:45 +10:00
\param type transformer type to create
:rtype: QgsPropertyTransformer
2017-04-02 21:55:46 +02:00
%End
QgsPropertyTransformer( double minValue = 0.0, double maxValue = 1.0 );
2017-04-02 21:55:46 +02:00
%Docstring
Constructor for QgsPropertyTransformer
2017-04-03 11:59:45 +10:00
\param minValue minimum expected value from source property
\param maxValue maximum expected value from source property
2017-04-02 21:55:46 +02:00
%End
2017-04-02 21:55:46 +02:00
QgsPropertyTransformer( const QgsPropertyTransformer &other );
%Docstring
Copy constructor.
%End
virtual ~QgsPropertyTransformer();
virtual Type transformerType() const = 0;
2017-04-02 21:55:46 +02:00
%Docstring
Returns the transformer type.
:rtype: Type
2017-04-02 21:55:46 +02:00
%End
virtual QgsPropertyTransformer *clone() = 0 /Factory/;
%Docstring
Returns a clone of the transformer.
:rtype: QgsPropertyTransformer
2017-04-02 21:55:46 +02:00
%End
2017-04-02 21:55:46 +02:00
virtual bool loadVariant( const QVariant &transformer );
%Docstring
Loads this transformer from a QVariantMap, wrapped in a QVariant.
You can use QgsXmlUtils.writeVariant to save it to an XML document.
2017-04-02 21:55:46 +02:00
2017-04-03 11:59:45 +10:00
\see loadVariant()
:rtype: bool
2017-04-02 21:55:46 +02:00
%End
virtual QVariant toVariant() const;
2017-04-02 21:55:46 +02:00
%Docstring
Saves this transformer to a QVariantMap, wrapped in a QVariant.
You can use QgsXmlUtils.writeVariant to save it to an XML document.
2017-04-02 21:55:46 +02:00
2017-04-03 11:59:45 +10:00
\see toVariant()
:rtype: QVariant
2017-04-02 21:55:46 +02:00
%End
double minValue() const;
2017-04-02 21:55:46 +02:00
%Docstring
Returns the minimum value expected by the transformer.
2017-04-03 11:59:45 +10:00
\see maxValue()
\see setMinValue()
:rtype: float
2017-04-02 21:55:46 +02:00
%End
void setMinValue( double min );
2017-04-02 21:55:46 +02:00
%Docstring
Sets the minimum value expected by the transformer.
2017-04-03 11:59:45 +10:00
\param min minimum value
\see setMaxValue()
\see minValue()
2017-04-02 21:55:46 +02:00
%End
double maxValue() const;
2017-04-02 21:55:46 +02:00
%Docstring
Returns the maximum value expected by the transformer.
2017-04-03 11:59:45 +10:00
\see minValue()
\see setMaxValue()
:rtype: float
2017-04-02 21:55:46 +02:00
%End
void setMaxValue( double max );
2017-04-02 21:55:46 +02:00
%Docstring
Sets the maximum value expected by the transformer.
2017-04-03 11:59:45 +10:00
\param max maximum value
\see setMinValue()
\see maxValue()
2017-04-02 21:55:46 +02:00
%End
2017-04-02 21:55:46 +02:00
QgsCurveTransform *curveTransform() const;
%Docstring
Returns the curve transform applied to input values before they are transformed
by the individual transform subclasses.
2017-04-03 11:59:45 +10:00
\see setCurveTransform()
:rtype: QgsCurveTransform
2017-04-02 21:55:46 +02:00
%End
2017-04-02 21:55:46 +02:00
void setCurveTransform( QgsCurveTransform *transform /Transfer/ );
%Docstring
Sets a curve transform to apply to input values before they are transformed
by the individual transform subclasses. Ownership of ``transform`` is transferred
2017-04-02 21:55:46 +02:00
to the property transformer.
2017-04-03 11:59:45 +10:00
\see curveTransform()
2017-04-02 21:55:46 +02:00
%End
2017-04-02 21:55:46 +02:00
virtual QVariant transform( const QgsExpressionContext &context, const QVariant &value ) const = 0;
%Docstring
Calculates the transform of a value. Derived classes must implement this to perform their transformations
on input values
2017-04-03 11:59:45 +10:00
\param context expression context
\param value input value to transform
:rtype: QVariant
2017-04-02 21:55:46 +02:00
%End
2017-04-02 21:55:46 +02:00
virtual QString toExpression( const QString &baseExpression ) const = 0;
%Docstring
Converts the transformer to a QGIS expression string. The ``baseExpression`` string consists
2017-04-02 21:55:46 +02:00
of a sub-expression reflecting the parent property's state.
:rtype: str
2017-04-02 21:55:46 +02:00
%End
static QgsPropertyTransformer *fromExpression( const QString &expression, QString &baseExpression /Out/, QString &fieldName /Out/ ) /Factory/;
%Docstring
Attempts to parse an expression into a corresponding property transformer.
2017-04-03 11:59:45 +10:00
\param expression expression to parse
\param baseExpression will be set to the component of the source expression which
2017-04-02 21:55:46 +02:00
is used to calculate the input to the property transformer. This will be set to an
empty string if a field reference is the transformer input.
2017-04-03 11:59:45 +10:00
\param fieldName will be set to a field name which is used to calculate the input
2017-04-02 21:55:46 +02:00
to the property transformer. This will be set to an
empty string if an expression is the transformer input.
:return: corresponding property transformer, or None if expression could not
2017-04-02 21:55:46 +02:00
be parsed to a transformer.
:rtype: QgsPropertyTransformer
2017-04-02 21:55:46 +02:00
%End
protected:
double transformNumeric( double input ) const;
2017-04-02 21:55:46 +02:00
%Docstring
Applies base class numeric transformations. Derived classes should call this
to transform an ``input`` numeric value before they apply any transform to the result.
2017-04-02 21:55:46 +02:00
This applies any curve transforms which may exist on the transformer.
:rtype: float
2017-04-02 21:55:46 +02:00
%End
};
2017-04-02 21:55:46 +02:00
2017-02-14 08:32:01 +10:00
class QgsGenericNumericTransformer : QgsPropertyTransformer
{
%Docstring
QgsPropertyTransformer subclass for scaling an input numeric value into an output numeric value.
.. versionadded:: 3.0
%End
2017-04-02 21:55:46 +02:00
2017-02-14 08:32:01 +10:00
%TypeHeaderCode
2017-04-02 21:55:46 +02:00
#include "qgspropertytransformer.h"
2017-02-14 08:32:01 +10:00
%End
public:
2017-04-02 21:55:46 +02:00
2017-02-14 08:32:01 +10:00
QgsGenericNumericTransformer( double minValue = 0.0,
double maxValue = 1.0,
double minOutput = 0.0,
double maxOutput = 1.0,
double nullOutput = 0.0,
double exponent = 1.0 );
2017-04-02 21:55:46 +02:00
%Docstring
Constructor for QgsGenericNumericTransformer.
2017-04-03 11:59:45 +10:00
\param minValue minimum expected input value
\param maxValue maximum expected input value
\param minOutput minimum value to return
\param maxOutput maximum value to return
\param nullOutput value to return for null inputs
\param exponent optional exponential for non-linear scaling
2017-04-02 21:55:46 +02:00
%End
2017-02-14 08:32:01 +10:00
2017-04-02 21:55:46 +02:00
QgsGenericNumericTransformer( const QgsGenericNumericTransformer &other );
%Docstring
Copy constructor.
%End
2017-02-14 08:32:01 +10:00
virtual Type transformerType() const;
2017-04-02 21:55:46 +02:00
virtual QgsGenericNumericTransformer *clone();
virtual QVariant toVariant() const;
virtual bool loadVariant( const QVariant &definition );
2017-04-02 21:55:46 +02:00
virtual QVariant transform( const QgsExpressionContext &context, const QVariant &value ) const;
virtual QString toExpression( const QString &baseExpression ) const;
static QgsGenericNumericTransformer *fromExpression( const QString &expression, QString &baseExpression /Out/, QString &fieldName /Out/ ) /Factory/;
%Docstring
Attempts to parse an expression into a corresponding QgsSizeScaleTransformer.
2017-04-03 11:59:45 +10:00
\param expression expression to parse
\param baseExpression will be set to the component of the source expression which
2017-04-02 21:55:46 +02:00
is used to calculate the input to the property transformer. This will be set to an
empty string if a field reference is the transformer input.
2017-04-03 11:59:45 +10:00
\param fieldName will be set to a field name which is used to calculate the input
2017-04-02 21:55:46 +02:00
to the property transformer. This will be set to an
empty string if an expression is the transformer input.
:return: corresponding QgsSizeScaleTransformer, or None if expression could not
2017-04-02 21:55:46 +02:00
be parsed to a size scale transformer.
:rtype: QgsGenericNumericTransformer
2017-04-02 21:55:46 +02:00
%End
2017-02-14 08:32:01 +10:00
double value( double input ) const;
2017-04-02 21:55:46 +02:00
%Docstring
Calculates the size corresponding to a specific ``input`` value.
:return: calculated size using size scale transformer's parameters and type
:rtype: float
2017-04-02 21:55:46 +02:00
%End
2017-02-14 08:32:01 +10:00
double minOutputValue() const;
2017-04-02 21:55:46 +02:00
%Docstring
Returns the minimum calculated size.
2017-04-03 11:59:45 +10:00
\see setMinSize()
\see maxSize()
:rtype: float
2017-04-02 21:55:46 +02:00
%End
2017-02-14 08:32:01 +10:00
void setMinOutputValue( double size );
2017-04-02 21:55:46 +02:00
%Docstring
Sets the minimum calculated size.
2017-04-03 11:59:45 +10:00
\param size minimum size
\see minSize()
\see setMaxSize()
2017-04-02 21:55:46 +02:00
%End
2017-02-14 08:32:01 +10:00
double maxOutputValue() const;
2017-04-02 21:55:46 +02:00
%Docstring
Returns the maximum calculated size.
2017-04-03 11:59:45 +10:00
\see minSize()
:rtype: float
2017-04-02 21:55:46 +02:00
%End
2017-02-14 08:32:01 +10:00
void setMaxOutputValue( double size );
2017-04-02 21:55:46 +02:00
%Docstring
Sets the maximum calculated size.
2017-04-03 11:59:45 +10:00
\param size maximum size
\see maxSize()
\see setMinSize()
2017-04-02 21:55:46 +02:00
%End
2017-02-14 08:32:01 +10:00
double nullOutputValue() const;
2017-04-02 21:55:46 +02:00
%Docstring
Returns the size value when an expression evaluates to NULL.
2017-04-03 11:59:45 +10:00
\see setNullSize()
:rtype: float
2017-04-02 21:55:46 +02:00
%End
2017-02-14 08:32:01 +10:00
void setNullOutputValue( double size );
2017-04-02 21:55:46 +02:00
%Docstring
Sets the size value for when an expression evaluates to NULL.
2017-04-03 11:59:45 +10:00
\param size null size
\see nullSize()
2017-04-02 21:55:46 +02:00
%End
2017-02-14 08:32:01 +10:00
double exponent() const;
2017-04-02 21:55:46 +02:00
%Docstring
Returns the exponent for an exponential expression.
2017-04-03 11:59:45 +10:00
\see setExponent()
\see type()
:rtype: float
2017-04-02 21:55:46 +02:00
%End
2017-02-14 08:32:01 +10:00
void setExponent( double exponent );
2017-04-02 21:55:46 +02:00
%Docstring
Sets the exponent for an exponential expression.
2017-04-03 11:59:45 +10:00
\param exponent exponent
\see exponent()
2017-04-02 21:55:46 +02:00
%End
2017-02-14 08:32:01 +10:00
};
2017-04-02 21:55:46 +02:00
class QgsSizeScaleTransformer : QgsPropertyTransformer
{
%Docstring
QgsPropertyTransformer subclass for scaling a value into a size according to various
scaling methods.
.. versionadded:: 3.0
%End
2017-04-02 21:55:46 +02:00
%TypeHeaderCode
2017-04-02 21:55:46 +02:00
#include "qgspropertytransformer.h"
%End
public:
enum ScaleType
{
2017-04-02 21:55:46 +02:00
Linear,
Area,
Flannery,
Exponential,
};
QgsSizeScaleTransformer( ScaleType type = Linear,
double minValue = 0.0,
double maxValue = 1.0,
double minSize = 0.0,
double maxSize = 1.0,
double nullSize = 0.0,
double exponent = 1.0 );
2017-04-02 21:55:46 +02:00
%Docstring
Constructor for QgsSizeScaleTransformer.
2017-04-03 11:59:45 +10:00
\param type scaling type
\param minValue minimum expected value
\param maxValue maximum expected value
\param minSize minimum size to return
\param maxSize maximum size to return
\param nullSize size to return for null values
\param exponent exponent for Exponential scaling method
2017-04-02 21:55:46 +02:00
%End
2017-04-02 21:55:46 +02:00
QgsSizeScaleTransformer( const QgsSizeScaleTransformer &other );
%Docstring
Copy constructor.
%End
virtual Type transformerType() const;
2017-04-02 21:55:46 +02:00
virtual QgsSizeScaleTransformer *clone() /Factory/;
virtual QVariant toVariant() const;
virtual bool loadVariant( const QVariant &definition );
2017-04-02 21:55:46 +02:00
virtual QVariant transform( const QgsExpressionContext &context, const QVariant &value ) const;
virtual QString toExpression( const QString &baseExpression ) const;
static QgsSizeScaleTransformer *fromExpression( const QString &expression, QString &baseExpression /Out/, QString &fieldName /Out/ ) /Factory/;
%Docstring
Attempts to parse an expression into a corresponding QgsSizeScaleTransformer.
2017-04-03 11:59:45 +10:00
\param expression expression to parse
\param baseExpression will be set to the component of the source expression which
2017-04-02 21:55:46 +02:00
is used to calculate the input to the property transformer. This will be set to an
empty string if a field reference is the transformer input.
2017-04-03 11:59:45 +10:00
\param fieldName will be set to a field name which is used to calculate the input
2017-04-02 21:55:46 +02:00
to the property transformer. This will be set to an
empty string if an expression is the transformer input.
:return: corresponding QgsSizeScaleTransformer, or None if expression could not
2017-04-02 21:55:46 +02:00
be parsed to a size scale transformer.
:rtype: QgsSizeScaleTransformer
2017-04-02 21:55:46 +02:00
%End
double size( double value ) const;
2017-04-02 21:55:46 +02:00
%Docstring
Calculates the size corresponding to a specific value.
2017-04-03 11:59:45 +10:00
\param value value to calculate size for
:return: calculated size using size scale transformer's parameters and type
:rtype: float
2017-04-02 21:55:46 +02:00
%End
double minSize() const;
2017-04-02 21:55:46 +02:00
%Docstring
Returns the minimum calculated size.
2017-04-03 11:59:45 +10:00
\see setMinSize()
\see maxSize()
:rtype: float
2017-04-02 21:55:46 +02:00
%End
void setMinSize( double size );
2017-04-02 21:55:46 +02:00
%Docstring
Sets the minimum calculated size.
2017-04-03 11:59:45 +10:00
\param size minimum size
\see minSize()
\see setMaxSize()
2017-04-02 21:55:46 +02:00
%End
double maxSize() const;
2017-04-02 21:55:46 +02:00
%Docstring
Returns the maximum calculated size.
2017-04-03 11:59:45 +10:00
\see minSize()
:rtype: float
2017-04-02 21:55:46 +02:00
%End
void setMaxSize( double size );
2017-04-02 21:55:46 +02:00
%Docstring
Sets the maximum calculated size.
2017-04-03 11:59:45 +10:00
\param size maximum size
\see maxSize()
\see setMinSize()
2017-04-02 21:55:46 +02:00
%End
double nullSize() const;
2017-04-02 21:55:46 +02:00
%Docstring
Returns the size value when an expression evaluates to NULL.
2017-04-03 11:59:45 +10:00
\see setNullSize()
:rtype: float
2017-04-02 21:55:46 +02:00
%End
void setNullSize( double size );
2017-04-02 21:55:46 +02:00
%Docstring
Sets the size value for when an expression evaluates to NULL.
2017-04-03 11:59:45 +10:00
\param size null size
\see nullSize()
2017-04-02 21:55:46 +02:00
%End
double exponent() const;
2017-04-02 21:55:46 +02:00
%Docstring
Returns the exponent for an exponential expression.
2017-04-03 11:59:45 +10:00
\see setExponent()
\see type()
:rtype: float
2017-04-02 21:55:46 +02:00
%End
void setExponent( double exponent );
2017-04-02 21:55:46 +02:00
%Docstring
Sets the exponent for an exponential expression.
2017-04-03 11:59:45 +10:00
\param exponent exponent
\see exponent()
2017-04-02 21:55:46 +02:00
%End
ScaleType type() const;
2017-04-02 21:55:46 +02:00
%Docstring
Returns the size transformer's scaling type (the method used to calculate
the size from a value).
2017-04-03 11:59:45 +10:00
\see setType()
:rtype: ScaleType
2017-04-02 21:55:46 +02:00
%End
void setType( ScaleType type );
2017-04-02 21:55:46 +02:00
%Docstring
Sets the size transformer's scaling type (the method used to calculate
the size from a value).
2017-04-03 11:59:45 +10:00
\param type scale type
\see type()
2017-04-02 21:55:46 +02:00
%End
};
2017-04-02 21:55:46 +02:00
class QgsColorRampTransformer : QgsPropertyTransformer
{
%Docstring
QgsPropertyTransformer subclass for transforming a numeric value into a color from a
color ramp.
.. versionadded:: 3.0
%End
2017-04-02 21:55:46 +02:00
%TypeHeaderCode
2017-04-02 21:55:46 +02:00
#include "qgspropertytransformer.h"
%End
public:
QgsColorRampTransformer( double minValue = 0.0,
double maxValue = 1.0,
2017-04-02 21:55:46 +02:00
QgsColorRamp *ramp /Transfer/ = 0,
const QColor &nullColor = QColor( 0, 0, 0, 0 ) );
%Docstring
Constructor for QgsColorRampTransformer.
2017-04-03 11:59:45 +10:00
\param minValue minimum expected value
\param maxValue maximum expected value
\param ramp source color ramp. Ownership is transferred to the transformer.
\param nullColor color to return for null values
2017-04-02 21:55:46 +02:00
%End
2017-04-02 21:55:46 +02:00
QgsColorRampTransformer( const QgsColorRampTransformer &other );
%Docstring
Copy constructor
%End
virtual Type transformerType() const;
2017-04-02 21:55:46 +02:00
virtual QgsColorRampTransformer *clone() /Factory/;
virtual QVariant toVariant() const;
virtual bool loadVariant( const QVariant &definition );
2017-04-02 21:55:46 +02:00
virtual QVariant transform( const QgsExpressionContext &context, const QVariant &value ) const;
virtual QString toExpression( const QString &baseExpression ) const;
QColor color( double value ) const;
2017-04-02 21:55:46 +02:00
%Docstring
Calculates the color corresponding to a specific value.
2017-04-03 11:59:45 +10:00
\param value value to calculate color for
:return: calculated color using transformer's parameters and type
:rtype: QColor
2017-04-02 21:55:46 +02:00
%End
2017-04-02 21:55:46 +02:00
QgsColorRamp *colorRamp() const;
%Docstring
Returns the color ramp used for calculating property colors.
:return: color ramp
2017-04-03 11:59:45 +10:00
\see setColorRamp()
:rtype: QgsColorRamp
2017-04-02 21:55:46 +02:00
%End
2017-04-02 21:55:46 +02:00
void setColorRamp( QgsColorRamp *ramp /Transfer/ );
%Docstring
Sets the color ramp to use for calculating property colors.
2017-04-03 11:59:45 +10:00
\param ramp color ramp, ownership of ramp is transferred to the transformer.
\see colorRamp()
2017-04-02 21:55:46 +02:00
%End
QColor nullColor() const;
2017-04-02 21:55:46 +02:00
%Docstring
Returns the color corresponding to a null value.
2017-04-03 11:59:45 +10:00
\see setNullColor()
:rtype: QColor
2017-04-02 21:55:46 +02:00
%End
2017-04-02 21:55:46 +02:00
void setNullColor( const QColor &color );
%Docstring
Sets the color corresponding to a null value.
2017-04-03 11:59:45 +10:00
\param color null color
\see nullSize()
2017-04-02 21:55:46 +02:00
%End
QString rampName() const;
2017-04-02 21:55:46 +02:00
%Docstring
Returns the color ramp's name.
2017-04-03 11:59:45 +10:00
\see setRampName()
:rtype: str
2017-04-02 21:55:46 +02:00
%End
2017-04-02 21:55:46 +02:00
void setRampName( const QString &name );
%Docstring
Sets the color ramp's ``name``. The ramp name must be set to match
2017-04-02 21:55:46 +02:00
a color ramp available in the style database for conversion to expression
to work correctly.
2017-04-03 11:59:45 +10:00
\see rampName()
2017-04-02 21:55:46 +02:00
%End
};
2017-04-02 21:55:46 +02:00
/************************************************************************
* This file has been generated automatically from *
* *
* src/core/qgspropertytransformer.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/