plugins/paintops/libpaintop
#include <kis_dynamic_sensor.h>

Public Types | |
enum | ParameterSign { NegativeParameter = -1, UnSignedParameter = 0, PositiveParameter = 1 } |
Public Member Functions | |
~KisDynamicSensor () override | |
virtual QWidget * | createConfigurationWidget (QWidget *parent, QWidget *selector) |
const KisCubicCurve & | curve () const |
virtual bool | dependsOnCanvasRotation () const |
void | fromXML (const QDomElement &) override |
bool | hasCustomCurve () const |
QString | identifier () |
virtual bool | isAbsoluteRotation () const |
bool | isActive () const |
virtual bool | isAdditive () const |
int | length () |
virtual QString | maximumLabel (DynamicSensorType sensorType, int max=-1) |
virtual int | maximumValue (DynamicSensorType sensorType, int max=-1) |
virtual QString | minimumLabel (DynamicSensorType sensorType) |
virtual int | minimumValue (DynamicSensorType sensorType) |
qreal | parameter (const KisPaintInformation &info) |
qreal | parameter (const KisPaintInformation &info, const KisCubicCurve curve, const bool customCurve) |
void | removeCurve () |
virtual void | reset () |
DynamicSensorType | sensorType () const |
void | setActive (bool active) |
void | setCurve (const KisCubicCurve &curve) |
void | toXML (QDomDocument &, QDomElement &) const override |
virtual QString | valueSuffix (DynamicSensorType sensorType) |
Static Public Member Functions | |
static qreal | additiveToScaling (qreal x) |
static KisDynamicSensorSP | createFromXML (const QDomElement &, const QString &parentOptionName) |
static KisDynamicSensorSP | createFromXML (const QString &, const QString &parentOptionName) |
static QString | id (DynamicSensorType sensorType) |
static KisDynamicSensorSP | id2Sensor (const KoID &id, const QString &parentOptionName) |
static KisDynamicSensorSP | id2Sensor (const QString &s, const QString &parentOptionName) |
static qreal | scalingToAdditive (qreal x) |
Protected Member Functions | |
KisDynamicSensor (DynamicSensorType type) | |
virtual qreal | value (const KisPaintInformation &info)=0 |
Protected Attributes | |
bool | m_active {false} |
KisCubicCurve | m_curve |
bool | m_customCurve {false} |
QString | m_id |
int | m_length {-1} |
DynamicSensorType | m_type |
Detailed Description
Sensors are used to extract from KisPaintInformation a single double value which can be used to control the parameters of a brush.
Definition at line 95 of file kis_dynamic_sensor.h.
Member Enumeration Documentation
◆ ParameterSign
Enumerator | |
---|---|
NegativeParameter | |
UnSignedParameter | |
PositiveParameter |
Definition at line 99 of file kis_dynamic_sensor.h.
Constructor & Destructor Documentation
◆ KisDynamicSensor()
|
protected |
Definition at line 20 of file kis_dynamic_sensor.cc.
◆ ~KisDynamicSensor()
|
override |
Definition at line 26 of file kis_dynamic_sensor.cc.
Member Function Documentation
◆ additiveToScaling()
|
inlinestatic |
Definition at line 193 of file kis_dynamic_sensor.h.
◆ createConfigurationWidget()
|
virtual |
- Parameters
-
parent the parent QWidget selector is a QWidget that contains a signal called "parametersChanged()"
Reimplemented in KisDynamicSensorDrawingAngle, KisDynamicSensorTime, KisDynamicSensorDistance, and KisDynamicSensorFade.
Definition at line 30 of file kis_dynamic_sensor.cc.
◆ createFromXML() [1/2]
|
static |
Definition at line 287 of file kis_dynamic_sensor.cc.
◆ createFromXML() [2/2]
|
static |
Definition at line 279 of file kis_dynamic_sensor.cc.
◆ curve()
const KisCubicCurve & KisDynamicSensor::curve | ( | ) | const |
Definition at line 391 of file kis_dynamic_sensor.cc.
◆ dependsOnCanvasRotation()
|
virtual |
Reimplemented in KisDynamicSensorFuzzy, and KisDynamicSensorDrawingAngle.
Definition at line 406 of file kis_dynamic_sensor.cc.
◆ fromXML()
|
override |
Definition at line 351 of file kis_dynamic_sensor.cc.
◆ hasCustomCurve()
bool KisDynamicSensor::hasCustomCurve | ( | ) | const |
Definition at line 401 of file kis_dynamic_sensor.cc.
◆ id()
|
static |
- Returns
- the identifier of this sensor
Definition at line 297 of file kis_dynamic_sensor.cc.
◆ id2Sensor() [1/2]
|
static |
Creates a sensor from its identifier.
Definition at line 40 of file kis_dynamic_sensor.cc.
◆ id2Sensor() [2/2]
|
inlinestatic |
Definition at line 140 of file kis_dynamic_sensor.h.
◆ identifier()
QString KisDynamicSensor::identifier | ( | ) |
Definition at line 431 of file kis_dynamic_sensor.cc.
◆ isAbsoluteRotation()
|
virtual |
Reimplemented in KisDynamicSensorDrawingAngle.
Definition at line 416 of file kis_dynamic_sensor.cc.
◆ isActive()
bool KisDynamicSensor::isActive | ( | ) | const |
Definition at line 426 of file kis_dynamic_sensor.cc.
◆ isAdditive()
|
virtual |
Reimplemented in KisDynamicSensorTiltDirection, KisDynamicSensorRotation, and KisDynamicSensorFuzzy.
Definition at line 411 of file kis_dynamic_sensor.cc.
◆ length()
|
inline |
- Returns
- the currently set length or -1 if not relevant
Definition at line 184 of file kis_dynamic_sensor.h.
◆ maximumLabel()
|
virtual |
Definition at line 132 of file kis_dynamic_sensor.cc.
◆ maximumValue()
|
virtual |
Definition at line 207 of file kis_dynamic_sensor.cc.
◆ minimumLabel()
|
virtual |
Definition at line 94 of file kis_dynamic_sensor.cc.
◆ minimumValue()
|
virtual |
Definition at line 179 of file kis_dynamic_sensor.cc.
◆ parameter() [1/2]
qreal KisDynamicSensor::parameter | ( | const KisPaintInformation & | info | ) |
- Returns
- the value of this sensor for the given KisPaintInformation
Definition at line 362 of file kis_dynamic_sensor.cc.
◆ parameter() [2/2]
qreal KisDynamicSensor::parameter | ( | const KisPaintInformation & | info, |
const KisCubicCurve | curve, | ||
const bool | customCurve | ||
) |
- Returns
- the value of this sensor for the given KisPaintInformation curve – a custom, temporary curve that should be used instead of the one for the sensor customCurve – if it's a new curve or not; should always be true if the function is called from outside (aka not in parameter(info) function)
Definition at line 367 of file kis_dynamic_sensor.cc.
◆ removeCurve()
void KisDynamicSensor::removeCurve | ( | ) |
Definition at line 396 of file kis_dynamic_sensor.cc.
◆ reset()
|
virtual |
This function is call before beginning a stroke to reset the sensor.
Default implementation does nothing.
Reimplemented in KisDynamicSensorDrawingAngle, KisDynamicSensorFuzzy, KisDynamicSensorTime, and KisDynamicSensorSpeed.
Definition at line 36 of file kis_dynamic_sensor.cc.
◆ scalingToAdditive()
|
inlinestatic |
Definition at line 189 of file kis_dynamic_sensor.h.
◆ sensorType()
|
inline |
Definition at line 178 of file kis_dynamic_sensor.h.
◆ setActive()
void KisDynamicSensor::setActive | ( | bool | active | ) |
Definition at line 421 of file kis_dynamic_sensor.cc.
◆ setCurve()
void KisDynamicSensor::setCurve | ( | const KisCubicCurve & | curve | ) |
Definition at line 385 of file kis_dynamic_sensor.cc.
◆ toXML()
|
override |
Definition at line 340 of file kis_dynamic_sensor.cc.
◆ value()
|
protectedpure virtual |
Implemented in KisDynamicSensorTangentialPressure, KisDynamicSensorPerspective, KisDynamicSensorTiltElevation, KisDynamicSensorTiltDirection, KisDynamicSensorYTilt, KisDynamicSensorXTilt, KisDynamicSensorPressureIn, KisDynamicSensorPressure, KisDynamicSensorRotation, KisDynamicSensorFuzzy, KisDynamicSensorDrawingAngle, KisDynamicSensorSpeed, KisDynamicSensorTangentialPressure, KisDynamicSensorPerspective, KisDynamicSensorTiltElevation, KisDynamicSensorTiltDirection, KisDynamicSensorYTilt, KisDynamicSensorXTilt, KisDynamicSensorPressureIn, KisDynamicSensorPressure, KisDynamicSensorRotation, KisDynamicSensorSpeed, KisDynamicSensorDistance, KisDynamicSensorFade, and KisDynamicSensorTime.
◆ valueSuffix()
|
virtual |
Definition at line 250 of file kis_dynamic_sensor.cc.
Member Data Documentation
◆ m_active
|
protected |
Definition at line 207 of file kis_dynamic_sensor.h.
◆ m_curve
|
protected |
Definition at line 206 of file kis_dynamic_sensor.h.
◆ m_customCurve
|
protected |
Definition at line 205 of file kis_dynamic_sensor.h.
◆ m_id
|
protected |
Definition at line 202 of file kis_dynamic_sensor.h.
◆ m_length
|
protected |
Definition at line 204 of file kis_dynamic_sensor.h.
◆ m_type
|
protected |
Definition at line 201 of file kis_dynamic_sensor.h.
The documentation for this class was generated from the following files:
Documentation copyright © 1996-2021 The KDE developers.
Generated on Fri Apr 9 2021 23:38:03 by doxygen 1.8.16 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.