15#ifndef QGSPROPERTYTRANSFORMER_H
16#define QGSPROPERTYTRANSFORMER_H
27#include <QDomDocument>
89 void setControlPoints(
const QList< QgsPointXY > &points );
96 void addControlPoint(
double x,
double y );
103 void removeControlPoint(
double x,
double y );
108 double y(
double x )
const;
115 QVector< double > y(
const QVector< double > &x )
const;
123 bool readXml(
const QDomElement &elem,
const QDomDocument &doc );
131 bool writeXml( QDomElement &transformElem, QDomDocument &doc )
const;
139 QVariant toVariant()
const;
147 bool loadVariant(
const QVariant &transformer );
151 void calcSecondDerivativeArray();
153 QList< QgsPointXY > mControlPoints;
155 double *mSecondDerivativeArray =
nullptr;
171 sipType = sipType_QgsGenericNumericTransformer;
173 sipType = sipType_QgsSizeScaleTransformer;
175 sipType = sipType_QgsColorRampTransformer;
177 sipType = sipType_QgsPropertyTransformer;
225 virtual bool loadVariant(
const QVariant &transformer );
233 virtual QVariant toVariant()
const;
292 virtual QString
toExpression(
const QString &baseExpression )
const = 0;
310 double transformNumeric(
double input )
const;
343 double maxValue = 1.0,
344 double minOutput = 0.0,
345 double maxOutput = 1.0,
346 double nullOutput = 0.0,
347 double exponent = 1.0 );
351 QVariant toVariant() const override;
352 bool loadVariant( const QVariant &definition ) override;
353 QVariant transform( const
QgsExpressionContext &context, const QVariant &value ) const override;
354 QString toExpression( const QString &baseExpression ) const override;
374 double value(
double input ) const;
381 double minOutputValue()
const {
return mMinOutput; }
470 double minValue = 0.0,
471 double maxValue = 1.0,
472 double minSize = 0.0,
473 double maxSize = 1.0,
474 double nullSize = 0.0,
475 double exponent = 1.0 );
479 QVariant toVariant() const override;
480 bool loadVariant( const QVariant &definition ) override;
481 QVariant transform( const
QgsExpressionContext &context, const QVariant &value ) const override;
482 QString toExpression( const QString &baseExpression ) const override;
498 double size(
double value ) const;
505 double minSize()
const {
return mMinSize; }
569 void setType( ScaleType type );
572 ScaleType mType = Linear;
600 double maxValue = 1.0,
602 const QColor &nullColor = QColor( 0, 0, 0, 0 ),
603 const QString &rampName = QString() );
610 QVariant toVariant() const override;
611 bool loadVariant( const QVariant &definition ) override;
612 QVariant transform( const
QgsExpressionContext &context, const QVariant &value ) const override;
613 QString toExpression( const QString &baseExpression ) const override;
620 QColor color(
double value ) const;
640 QColor nullColor()
const {
return mNullColor; }
665 std::unique_ptr< QgsColorRamp > mGradientRamp;
Abstract base class for color ramps.
Expression contexts are used to encapsulate the parameters around which a QgsExpression should be eva...
#define SIP_CONVERT_TO_SUBCLASS_CODE(code)