Krita Source Code Documentation
Loading...
Searching...
No Matches
KisLiquifyPaintHelper Class Reference

#include <kis_liquify_paint_helper.h>

Classes

struct  Private
 

Public Member Functions

QPainterPath brushOutline (const KisLiquifyProperties &props)
 
void configurePaintOp (const KisLiquifyProperties &_props, KisLiquifyTransformWorker *worker)
 
void continuePaint (KoPointerEvent *event)
 
bool endPaint (KoPointerEvent *event)
 
void hoverPaint (KoPointerEvent *event)
 
 KisLiquifyPaintHelper (const KisCoordinatesConverter *converter)
 
void startPaint (KoPointerEvent *event, const KoCanvasResourceProvider *manager)
 
 ~KisLiquifyPaintHelper ()
 

Private Attributes

const QScopedPointer< Privatem_d
 

Detailed Description

Definition at line 19 of file kis_liquify_paint_helper.h.

Constructor & Destructor Documentation

◆ KisLiquifyPaintHelper()

KisLiquifyPaintHelper::KisLiquifyPaintHelper ( const KisCoordinatesConverter * converter)

Definition at line 47 of file kis_liquify_paint_helper.cpp.

48 : m_d(new Private(converter))
49{
50}
const QScopedPointer< Private > m_d

◆ ~KisLiquifyPaintHelper()

KisLiquifyPaintHelper::~KisLiquifyPaintHelper ( )

Definition at line 52 of file kis_liquify_paint_helper.cpp.

53{
54}

Member Function Documentation

◆ brushOutline()

QPainterPath KisLiquifyPaintHelper::brushOutline ( const KisLiquifyProperties & props)

Definition at line 67 of file kis_liquify_paint_helper.cpp.

68{
70 m_d->previousPaintInfo.registerDistanceInformation(&m_d->previousDistanceInfo);
71
72 return KisLiquifyPaintop::brushOutline(props, m_d->previousPaintInfo);
73}
static QPainterPath brushOutline(const KisLiquifyProperties &props, const KisPaintInformation &info)

References KisLiquifyPaintop::brushOutline(), and m_d.

◆ configurePaintOp()

void KisLiquifyPaintHelper::configurePaintOp ( const KisLiquifyProperties & _props,
KisLiquifyTransformWorker * worker )

Definition at line 75 of file kis_liquify_paint_helper.cpp.

77{
78 m_d->paintOp.reset(new KisLiquifyPaintop(props, worker));
79}

References m_d.

◆ continuePaint()

void KisLiquifyPaintHelper::continuePaint ( KoPointerEvent * event)

Definition at line 93 of file kis_liquify_paint_helper.cpp.

94{
96
98 m_d->infoBuilder->continueStroke(event, m_d->strokeTime.elapsed());
99
100 KisPaintOpUtils::paintLine(*m_d->paintOp.data(),
101 m_d->previousPaintInfo,
102 pi,
103 &m_d->currentDistance,
104 false, false);
105
106 m_d->updatePreviousPaintInfo(pi);
107 m_d->hasPaintedAtLeastOnce = true;
108}
#define KIS_ASSERT_RECOVER_RETURN(cond)
Definition kis_assert.h:75
void paintLine(PaintOp &op, const KisPaintInformation &pi1, const KisPaintInformation &pi2, KisDistanceInformation *currentDistance, bool fanCornersEnabled, qreal fanCornersStep)

References KIS_ASSERT_RECOVER_RETURN, m_d, and KisPaintOpUtils::paintLine().

◆ endPaint()

bool KisLiquifyPaintHelper::endPaint ( KoPointerEvent * event)

Definition at line 110 of file kis_liquify_paint_helper.cpp.

111{
112 KIS_ASSERT_RECOVER(m_d->paintOp) { return false; }
113
114 if (!m_d->hasPaintedAtLeastOnce) {
116 m_d->infoBuilder->continueStroke(event, m_d->strokeTime.elapsed());
117
118 pi.paintAt(*m_d->paintOp.data(), &m_d->previousDistanceInfo);
119 }
120
121 m_d->paintOp.reset();
122
123 return !m_d->hasPaintedAtLeastOnce;
124}
void paintAt(PaintOp &op, KisDistanceInformation *distanceInfo)
#define KIS_ASSERT_RECOVER(cond)
Definition kis_assert.h:55

References KIS_ASSERT_RECOVER, m_d, and KisPaintInformation::paintAt().

◆ hoverPaint()

void KisLiquifyPaintHelper::hoverPaint ( KoPointerEvent * event)

Definition at line 126 of file kis_liquify_paint_helper.cpp.

127{
128 QPointF imagePoint = m_d->converter->documentToImage(event->pos());
129 KisPaintInformation pi = m_d->infoBuilder->hover(imagePoint, event, bool(m_d->paintOp));
130
131 m_d->updatePreviousPaintInfo(pi);
132}
QPoint pos() const
return the position in widget coordinates

References m_d, and KoPointerEvent::pos().

◆ startPaint()

void KisLiquifyPaintHelper::startPaint ( KoPointerEvent * event,
const KoCanvasResourceProvider * manager )

Definition at line 81 of file kis_liquify_paint_helper.cpp.

82{
84
85 m_d->strokeTime.start();
87 m_d->infoBuilder->startStroke(event, m_d->strokeTime.elapsed(), manager);
88
89 m_d->updatePreviousPaintInfo(pi);
90 m_d->hasPaintedAtLeastOnce = false;
91}

References KIS_ASSERT_RECOVER_RETURN, and m_d.

Member Data Documentation

◆ m_d

const QScopedPointer<Private> KisLiquifyPaintHelper::m_d
private

Definition at line 38 of file kis_liquify_paint_helper.h.


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