Krita Source Code Documentation
Loading...
Searching...
No Matches
MyPaintSensorDataWithRange Struct Reference

#include <MyPaintSensorPack.h>

+ Inheritance diagram for MyPaintSensorDataWithRange:

Public Member Functions

QRectF baseCurveRange () const override
 
 MyPaintSensorDataWithRange (const KoID &id)
 
void reset () override
 
void reshapeCurve ()
 
void setBaseCurveRange (const QRectF &rect) override
 
- Public Member Functions inherited from KisSensorData
 KisSensorData (const KoID &sensorId)
 
virtual void read (const QDomElement &e)
 
virtual void write (QDomDocument &doc, QDomElement &e) const
 
virtual ~KisSensorData ()
 

Public Attributes

QRectF curveRange {0,-1,1,2}
 
- Public Attributes inherited from KisSensorData
QString curve
 
KoID id
 
bool isActive = false
 

Friends

bool operator== (const MyPaintSensorDataWithRange &lhs, const MyPaintSensorDataWithRange &rhs)
 

Detailed Description

Definition at line 27 of file MyPaintSensorPack.h.

Constructor & Destructor Documentation

◆ MyPaintSensorDataWithRange()

MyPaintSensorDataWithRange::MyPaintSensorDataWithRange ( const KoID & id)

Definition at line 78 of file MyPaintSensorPack.cpp.

79 : KisSensorData(id)
80{
81 QList<QPointF> points;
82
83 if (id == MyPaintPressureId) {
84 points = {{0,0}, {1,1}};
85 } else if (id == MyPaintFineSpeedId) {
86 points = {{0,0}, {4,1}};
87 } else if (id == MyPaintGrossSpeedId) {
88 points = {{0,0}, {4,1}};
89 } else if (id == MyPaintRandomId) {
90 points = {{0,0}, {1,1}};
91 } else if (id == MyPaintStrokeId) {
92 points = {{0,0}, {1,1}};
93 } else if (id == MyPaintDirectionId) {
94 points = {{0,0}, {180,1}};
95 } else if (id == MyPaintDeclinationId) {
96 points = {{0,0}, {90,1}};
97 } else if (id == MyPaintAscensionId) {
98 points = {{-180,0}, {180,1}};
99 } else if (id == MyPaintCustomId) {
100 points = {{-10,0}, {10,1}};
101 } else {
102 qWarning() << "MyPaintSensorDataWithRange: unknown sensor type:" << id;
103 points = {{0,0}, {1,1}};
104 }
105
106 curve = KisCubicCurve(points).toString();
108 reshapeCurve();
109}
const KoID MyPaintDeclinationId("mypaint_tilt_declination", ki18nc("Pen tilt declination", "Declination"))
const KoID MyPaintCustomId("mypaint_custom", ki18n("Custom"))
const KoID MyPaintDirectionId("mypaint_direction", ki18nc("Drawing Angle", "Direction"))
const KoID MyPaintAscensionId("mypaint_tilt_ascension", ki18nc("Pen tilt ascension", "Ascension"))
const KoID MyPaintPressureId("mypaint_pressure", ki18n("Pressure"))
const KoID MyPaintStrokeId("mypaint_stroke", ki18nc("The duration of a brush stroke", "Stroke"))
const KoID MyPaintRandomId("mypaint_random", ki18n("Random"))
const KoID MyPaintGrossSpeedId("mypaint_speed2", ki18n("Gross Speed"))
const KoID MyPaintFineSpeedId("mypaint_speed1", ki18n("Fine Speed"))
void accumulateBounds(const Point &pt, Rect *bounds)
QString toString() const
KisSensorData(const KoID &sensorId)

References KisAlgebra2D::accumulateBounds(), KisSensorData::curve, curveRange, KisSensorData::id, MyPaintAscensionId(), MyPaintCustomId(), MyPaintDeclinationId(), MyPaintDirectionId(), MyPaintFineSpeedId(), MyPaintGrossSpeedId(), MyPaintPressureId(), MyPaintRandomId(), MyPaintStrokeId(), reshapeCurve(), and KisCubicCurve::toString().

Member Function Documentation

◆ baseCurveRange()

QRectF MyPaintSensorDataWithRange::baseCurveRange ( ) const
overridevirtual

Reimplemented from KisSensorData.

Definition at line 111 of file MyPaintSensorPack.cpp.

112{
113 return curveRange;
114}

References curveRange.

◆ reset()

void MyPaintSensorDataWithRange::reset ( )
overridevirtual

Reimplemented from KisSensorData.

Definition at line 121 of file MyPaintSensorPack.cpp.

122{
123 *this = MyPaintSensorDataWithRange(id);
124}
MyPaintSensorDataWithRange(const KoID &id)

References MyPaintSensorDataWithRange().

◆ reshapeCurve()

void MyPaintSensorDataWithRange::reshapeCurve ( )

Definition at line 126 of file MyPaintSensorPack.cpp.

127{
129}
static std::tuple< QString, QRectF > reshapeCurve(std::tuple< QString, QRectF > curve)

References KisSensorData::curve, curveRange, and MyPaintCurveRangeModel::reshapeCurve().

◆ setBaseCurveRange()

void MyPaintSensorDataWithRange::setBaseCurveRange ( const QRectF & rect)
overridevirtual

Reimplemented from KisSensorData.

Definition at line 116 of file MyPaintSensorPack.cpp.

117{
119}

References curveRange.

Friends And Related Symbol Documentation

◆ operator==

bool operator== ( const MyPaintSensorDataWithRange & lhs,
const MyPaintSensorDataWithRange & rhs )
friend

Definition at line 31 of file MyPaintSensorPack.h.

31 {
32 return lhs.curveRange == rhs.curveRange &&
33 static_cast<const KisSensorData&>(lhs) == static_cast<const KisSensorData&>(rhs);
34 }

Member Data Documentation

◆ curveRange

QRectF MyPaintSensorDataWithRange::curveRange {0,-1,1,2}

Definition at line 42 of file MyPaintSensorPack.h.

42{0,-1,1,2};

The documentation for this struct was generated from the following files: