15 #ifndef QGSPROPERTYTRANSFORMER_H 16 #define QGSPROPERTYTRANSFORMER_H 18 #include "qgis_core.h" 25 #include <QStringList> 26 #include <QDomElement> 27 #include <QDomDocument> 93 void setControlPoints(
const QList< QgsPointXY > &points );
100 void addControlPoint(
double x,
double y );
107 void removeControlPoint(
double x,
double y );
112 double y(
double x )
const;
119 QVector< double > y(
const QVector< double > &x )
const;
127 bool readXml(
const QDomElement &elem,
const QDomDocument &doc );
135 bool writeXml( QDomElement &transformElem, QDomDocument &doc )
const;
143 QVariant toVariant()
const;
151 bool loadVariant(
const QVariant &transformer );
155 void calcSecondDerivativeArray();
157 QList< QgsPointXY > mControlPoints;
159 double *mSecondDerivativeArray =
nullptr;
176 sipType = sipType_QgsGenericNumericTransformer;
178 sipType = sipType_QgsSizeScaleTransformer;
180 sipType = sipType_QgsColorRampTransformer;
182 sipType = sipType_QgsPropertyTransformer;
220 virtual Type transformerType()
const = 0;
233 virtual bool loadVariant(
const QVariant &transformer );
241 virtual QVariant toVariant()
const;
294 virtual QVariant transform(
const QgsExpressionContext &context,
const QVariant &value )
const = 0;
300 virtual QString toExpression(
const QString &baseExpression )
const = 0;
323 double transformNumeric(
double input )
const;
357 double maxValue = 1.0,
358 double minOutput = 0.0,
359 double maxOutput = 1.0,
360 double nullOutput = 0.0,
361 double exponent = 1.0 );
366 bool loadVariant(
const QVariant &definition )
override;
368 QString
toExpression(
const QString &baseExpression )
const override;
388 double value(
double input )
const;
485 double minValue = 0.0,
486 double maxValue = 1.0,
487 double minSize = 0.0,
488 double maxSize = 1.0,
489 double nullSize = 0.0,
490 double exponent = 1.0 );
495 bool loadVariant(
const QVariant &definition )
override;
497 QString
toExpression(
const QString &baseExpression )
const override;
518 double size(
double value )
const;
620 double maxValue = 1.0,
622 const QColor &nullColor = QColor( 0, 0, 0, 0 ) );
632 bool loadVariant(
const QVariant &definition )
override;
634 QString
toExpression(
const QString &baseExpression )
const override;
641 QColor color(
double value )
const;
686 std::unique_ptr< QgsColorRamp > mGradientRamp;
692 #endif // QGSPROPERTYTRANSFORMER_H
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)