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

#include <move_stroke_strategy.h>

+ Inheritance diagram for MoveStrokeStrategy:

Classes

struct  BarrierUpdateData
 
class  Data
 
class  PickLayerData
 
struct  Private
 

Signals

void sigHandlesRectCalculated (const QRect &handlesRect)
 
void sigLayersPicked (const KisNodeList &nodes)
 
void sigStrokeStartedEmpty ()
 

Public Member Functions

void cancelStrokeCallback () override
 
KisStrokeStrategycreateLodClone (int levelOfDetail) override
 
void doStrokeCallback (KisStrokeJobData *data) override
 
void finishStrokeCallback () override
 
void initStrokeCallback () override
 
 MoveStrokeStrategy (KisNodeList nodes, KisUpdatesFacade *updatesFacade, KisStrokeUndoFacade *undoFacade)
 
 MoveStrokeStrategy (KisNodeSelectionRecipe nodeSelection, KisUpdatesFacade *updatesFacade, KisStrokeUndoFacade *undoFacade)
 
 ~MoveStrokeStrategy () override
 
- Public Member Functions inherited from KisStrokeStrategyUndoCommandBased
 KisStrokeStrategyUndoCommandBased (const KUndo2MagicString &name, bool undo, KisStrokeUndoFacade *undoFacade, KUndo2CommandSP initCommand=KUndo2CommandSP(0), KUndo2CommandSP finishCommand=KUndo2CommandSP(0))
 
void setCommandExtraData (KUndo2CommandExtraData *data)
 
void setMacroId (int value)
 
void setSupportsWrapAroundMode (bool value)
 
void setUsedWhileUndoRedo (bool value)
 
- Public Member Functions inherited from KisRunnableBasedStrokeStrategy
 KisRunnableBasedStrokeStrategy (const KisRunnableBasedStrokeStrategy &rhs)
 
 KisRunnableBasedStrokeStrategy (const QLatin1String &id, const KUndo2MagicString &name=KUndo2MagicString())
 
KisRunnableStrokeJobsInterfacerunnableJobsInterface () const
 
 ~KisRunnableBasedStrokeStrategy ()
 
- Public Member Functions inherited from KisSimpleStrokeStrategy
KisStrokeJobDatacreateCancelData () override
 
KisStrokeJobStrategycreateCancelStrategy () override
 
KisStrokeJobStrategycreateDabStrategy () override
 
KisStrokeJobDatacreateFinishData () override
 
KisStrokeJobStrategycreateFinishStrategy () override
 
KisStrokeJobDatacreateInitData () override
 
KisStrokeJobStrategycreateInitStrategy () override
 
KisStrokeJobDatacreateResumeData () override
 
KisStrokeJobStrategycreateResumeStrategy () override
 
KisStrokeJobDatacreateSuspendData () override
 
KisStrokeJobStrategycreateSuspendStrategy () override
 
 KisSimpleStrokeStrategy (const QLatin1String &id, const KUndo2MagicString &name=KUndo2MagicString())
 
virtual void resumeStrokeCallback ()
 
virtual void suspendStrokeCallback ()
 
- Public Member Functions inherited from KisStrokeStrategy
qreal balancingRatioOverride () const
 
bool canForgetAboutMe () const
 
bool clearsRedoOnStart () const
 
KisLodPreferences currentLodPreferences () const
 
bool forceLodModeIfPossible () const
 
QString id () const
 
bool isAsynchronouslyCancellable () const
 
bool isExclusive () const
 
 KisStrokeStrategy (const QLatin1String &id, const KUndo2MagicString &name=KUndo2MagicString())
 
KUndo2MagicString name () const
 
bool needsExplicitCancel () const
 
virtual void notifyUserEndedStroke ()
 
virtual void notifyUserStartedStroke ()
 
bool requestsOtherStrokesToEnd () const
 
void setForceLodModeIfPossible (bool forceLodModeIfPossible)
 
void setMutatedJobsInterface (KisStrokesQueueMutatedJobInterface *mutatedJobsInterface, KisStrokeId strokeId)
 
bool supportsWrapAroundMode () const
 
virtual void tryCancelCurrentStrokeJobAsync ()
 tryCancelCurrentStrokeJobAsync is called by the strokes queue when the stroke is being cancelled. The stroke strategy may or may not handle this request and cancel the currently running long action.
 
virtual ~KisStrokeStrategy ()
 

Private Member Functions

void doCanvasUpdate (bool forceUpdate=false)
 
 MoveStrokeStrategy (const MoveStrokeStrategy &rhs, int lod)
 
template<typename Functor >
void recursiveApplyNodes (const KisNodeList &nodes, Functor &&func)
 
void setUndoEnabled (bool value)
 
void setUpdatesEnabled (bool value)
 
void tryPostUpdateJob (bool forceUpdate)
 

Private Attributes

QSet< KisNodeSPm_blacklistedNodes
 
QScopedPointer< Privatem_d
 
QHash< KisNodeSP, QRect > m_dirtyRects
 
QPoint m_finalOffset
 
bool m_hasPostponedJob {false}
 
KisNodeList m_nodes
 
KisNodeSelectionRecipe m_requestedNodeSelection
 
QSharedPointer< std::pair< KisNodeList, QSet< KisNodeSP > > > m_sharedNodes
 
const int m_updateInterval {30}
 
bool m_updatesEnabled {true}
 
KisUpdatesFacadem_updatesFacade {nullptr}
 
QElapsedTimer m_updateTimer
 

Additional Inherited Members

- Public Types inherited from KisSimpleStrokeStrategy
enum  JobType {
  JOB_INIT = 0 , JOB_CANCEL , JOB_FINISH , JOB_DOSTROKE ,
  JOB_SUSPEND , JOB_RESUME , NJOBS
}
 
- Static Public Member Functions inherited from KisSimpleStrokeStrategy
static QLatin1String jobTypeToString (JobType type)
 
- Protected Member Functions inherited from KisStrokeStrategyUndoCommandBased
void cancelStrokeCallbackImpl (QVector< KisStrokeJobData * > &mutatedJobs)
 
void executeCommand (KUndo2CommandSP command, bool undo)
 
 KisStrokeStrategyUndoCommandBased (const KisStrokeStrategyUndoCommandBased &rhs)
 
void notifyCommandDone (KUndo2CommandSP command, KisStrokeJobData::Sequentiality sequentiality, KisStrokeJobData::Exclusivity exclusivity)
 
virtual void postProcessToplevelCommand (KUndo2Command *command)
 Applies some modifications (e.g. assigning extra data) to the toplevel command.
 
void runAndSaveCommand (KUndo2CommandSP command, KisStrokeJobData::Sequentiality sequentiality, KisStrokeJobData::Exclusivity exclusivity)
 
KisStrokeUndoFacadeundoFacade () const
 
- Protected Member Functions inherited from KisSimpleStrokeStrategy
void enableJob (JobType type, bool enable=true, KisStrokeJobData::Sequentiality sequentiality=KisStrokeJobData::SEQUENTIAL, KisStrokeJobData::Exclusivity exclusivity=KisStrokeJobData::NORMAL)
 
 KisSimpleStrokeStrategy (const KisSimpleStrokeStrategy &rhs)
 
- Protected Member Functions inherited from KisStrokeStrategy
void addMutatedJob (KisStrokeJobData *data)
 
void addMutatedJobs (const QVector< KisStrokeJobData * > list)
 
 KisStrokeStrategy (const KisStrokeStrategy &rhs)
 
void setAsynchronouslyCancellable (bool value)
 
void setBalancingRatioOverride (qreal value)
 
void setCanForgetAboutMe (bool value)
 
void setClearsRedoOnStart (bool value)
 
void setExclusive (bool value)
 
void setNeedsExplicitCancel (bool value)
 
void setRequestsOtherStrokesToEnd (bool value)
 
void setSupportsWrapAroundMode (bool value)
 

Detailed Description

Definition at line 29 of file move_stroke_strategy.h.

Constructor & Destructor Documentation

◆ MoveStrokeStrategy() [1/3]

MoveStrokeStrategy::MoveStrokeStrategy ( KisNodeSelectionRecipe nodeSelection,
KisUpdatesFacade * updatesFacade,
KisStrokeUndoFacade * undoFacade )

Definition at line 211 of file move_stroke_strategy.cpp.

215 m_d(new Private()),
216 m_requestedNodeSelection(nodeSelection),
217 m_updatesFacade(updatesFacade),
218 m_updatesEnabled(true)
219{
221
223}
void enableJob(JobType type, bool enable=true, KisStrokeJobData::Sequentiality sequentiality=KisStrokeJobData::SEQUENTIAL, KisStrokeJobData::Exclusivity exclusivity=KisStrokeJobData::NORMAL)
KisStrokeStrategyUndoCommandBased(const KUndo2MagicString &name, bool undo, KisStrokeUndoFacade *undoFacade, KUndo2CommandSP initCommand=KUndo2CommandSP(0), KUndo2CommandSP finishCommand=KUndo2CommandSP(0))
KisNodeSelectionRecipe m_requestedNodeSelection
KisUpdatesFacade * m_updatesFacade
QScopedPointer< Private > m_d
KUndo2MagicString kundo2_i18n(const char *text)

References KisStrokeJobData::BARRIER, KisSimpleStrokeStrategy::enableJob(), KisSimpleStrokeStrategy::JOB_INIT, and KisStrokeStrategyUndoCommandBased::setSupportsWrapAroundMode().

◆ MoveStrokeStrategy() [2/3]

MoveStrokeStrategy::MoveStrokeStrategy ( KisNodeList nodes,
KisUpdatesFacade * updatesFacade,
KisStrokeUndoFacade * undoFacade )

Definition at line 225 of file move_stroke_strategy.cpp.

227{
228}
MoveStrokeStrategy(KisNodeSelectionRecipe nodeSelection, KisUpdatesFacade *updatesFacade, KisStrokeUndoFacade *undoFacade)

◆ ~MoveStrokeStrategy()

MoveStrokeStrategy::~MoveStrokeStrategy ( )
override

Definition at line 230 of file move_stroke_strategy.cpp.

231{
232}

◆ MoveStrokeStrategy() [3/3]

MoveStrokeStrategy::MoveStrokeStrategy ( const MoveStrokeStrategy & rhs,
int lod )
private

Definition at line 234 of file move_stroke_strategy.cpp.

235 : QObject(),
237 m_d(new Private()),
239 m_nodes(rhs.m_nodes),
245{
246 KIS_SAFE_ASSERT_RECOVER_NOOP(rhs.m_d->strategy.empty());
247}
QHash< KisNodeSP, QRect > m_dirtyRects
QSet< KisNodeSP > m_blacklistedNodes
#define KIS_SAFE_ASSERT_RECOVER_NOOP(cond)
Definition kis_assert.h:130

References KIS_SAFE_ASSERT_RECOVER_NOOP, and m_d.

Member Function Documentation

◆ cancelStrokeCallback()

void MoveStrokeStrategy::cancelStrokeCallback ( )
overridevirtual

Q_EMIT updates not looking onto the updatesEnabled switch, since that is the end of the stroke

Reimplemented from KisStrokeStrategyUndoCommandBased.

Definition at line 413 of file move_stroke_strategy.cpp.

414{
415 if (!m_nodes.isEmpty()) {
416 m_finalOffset = QPoint();
417 m_hasPostponedJob = true;
418
420
422 Q_FOREACH (KisNodeSP node, m_nodes) {
423 QRect dirtyRect;
424
425 recursiveApplyNodes({node},
426 [this, &dirtyRect] (KisNodeSP node) {
427 MoveNodeStrategyBase *strategy =
428 m_d->strategy[node].get();
430
431 dirtyRect |= strategy->cancelMove();
432 });
433
434 m_dirtyRects[node] |= dirtyRect;
435
439 m_updatesFacade->refreshGraphAsync(node, dirtyRect);
440 }
441 });
442
444 }
445
447}
KisRunnableStrokeJobsInterface * runnableJobsInterface() const
virtual void addRunnableJobs(const QVector< KisRunnableStrokeJobDataBase * > &list)=0
void refreshGraphAsync(KisNodeSP root=nullptr, KisProjectionUpdateFlags flags=KisProjectionUpdateFlag::None)
void recursiveApplyNodes(const KisNodeList &nodes, Functor &&func)
#define KIS_SAFE_ASSERT_RECOVER_RETURN(cond)
Definition kis_assert.h:128
void addJobBarrierExclusive(QVector< Job * > &jobs, Func func)
virtual QRect cancelMove()=0

References KritaUtils::addJobBarrierExclusive(), KisRunnableStrokeJobsInterface::addRunnableJobs(), MoveNodeStrategyBase::cancelMove(), KisStrokeStrategyUndoCommandBased::cancelStrokeCallback(), KIS_SAFE_ASSERT_RECOVER_RETURN, m_d, m_dirtyRects, m_finalOffset, m_hasPostponedJob, m_nodes, m_updatesFacade, recursiveApplyNodes(), KisUpdatesFacade::refreshGraphAsync(), and KisRunnableBasedStrokeStrategy::runnableJobsInterface().

◆ createLodClone()

KisStrokeStrategy * MoveStrokeStrategy::createLodClone ( int levelOfDetail)
overridevirtual

Since this function is executed in the GUI thread, we cannot properly pick the layers. Therefore we should use pessimistic approach and check if there are non-lodn-capable nodes in the entire image.

Reimplemented from KisStrokeStrategy.

Definition at line 546 of file move_stroke_strategy.cpp.

547{
548 KisNodeList nodesToCheck;
549
552 } else if (!m_requestedNodeSelection.selectedNodes.isEmpty()){
559 }
560
561 Q_FOREACH (KisNodeSP node, nodesToCheck) {
562 if (!checkSupportsLodMoves(node)) return 0;
563 }
564
565 MoveStrokeStrategy *clone = new MoveStrokeStrategy(*this, levelOfDetail);
566 connect(clone, SIGNAL(sigHandlesRectCalculated(QRect)), this, SIGNAL(sigHandlesRectCalculated(QRect)));
567 connect(clone, SIGNAL(sigStrokeStartedEmpty()), this, SIGNAL(sigStrokeStartedEmpty()));
568 connect(clone, SIGNAL(sigLayersPicked(const KisNodeList&)), this, SIGNAL(sigLayersPicked(const KisNodeList&)));
569 this->setUpdatesEnabled(false);
570 m_sharedNodes.reset(new std::pair<KisNodeList, QSet<KisNodeSP>>());
572 return clone;
573}
void sigStrokeStartedEmpty()
void sigLayersPicked(const KisNodeList &nodes)
void setUpdatesEnabled(bool value)
void sigHandlesRectCalculated(const QRect &handlesRect)
QSharedPointer< std::pair< KisNodeList, QSet< KisNodeSP > > > m_sharedNodes
bool checkSupportsLodMoves(KisNodeSP subtree)
KisNodeSP findRoot(KisNodeSP node)

References checkSupportsLodMoves(), KisLayerUtils::findRoot(), m_requestedNodeSelection, m_sharedNodes, KisNodeSelectionRecipe::mode, MoveStrokeStrategy(), KisNodeSelectionRecipe::SelectedLayer, KisNodeSelectionRecipe::selectedNodes, setUpdatesEnabled(), sigHandlesRectCalculated(), sigLayersPicked(), and sigStrokeStartedEmpty().

◆ doCanvasUpdate()

void MoveStrokeStrategy::doCanvasUpdate ( bool forceUpdate = false)
private

Definition at line 496 of file move_stroke_strategy.cpp.

497{
498 if (!forceUpdate &&
499 (m_updateTimer.elapsed() < m_updateInterval ||
501
502 return;
503 }
504
505 if (!m_hasPostponedJob) return;
506
507 Q_FOREACH (KisNodeSP node, m_nodes) {
508 QRect dirtyRect;
509
510 recursiveApplyNodes({node},
511 [this, &dirtyRect] (KisNodeSP node) {
512 MoveNodeStrategyBase *strategy =
513 m_d->strategy[node].get();
515
516 dirtyRect |= strategy->moveNode(m_finalOffset);
517 });
518
519 m_dirtyRects[node] |= dirtyRect;
520
521 if (m_updatesEnabled) {
522 m_updatesFacade->refreshGraphAsync(node, dirtyRect);
523 }
524 }
525
526 m_hasPostponedJob = false;
527 m_updateTimer.restart();
528}
virtual bool hasUpdatesRunning() const =0
virtual QRect moveNode(const QPoint &offset)=0

References KisUpdatesFacade::hasUpdatesRunning(), KIS_SAFE_ASSERT_RECOVER_RETURN, m_d, m_dirtyRects, m_finalOffset, m_hasPostponedJob, m_nodes, m_updateInterval, m_updatesEnabled, m_updatesFacade, m_updateTimer, MoveNodeStrategyBase::moveNode(), recursiveApplyNodes(), and KisUpdatesFacade::refreshGraphAsync().

◆ doStrokeCallback()

void MoveStrokeStrategy::doStrokeCallback ( KisStrokeJobData * data)
overridevirtual

NOTE: we do not care about threading here, because all our jobs are declared sequential

Reimplemented from KisStrokeStrategyUndoCommandBased.

Definition at line 461 of file move_stroke_strategy.cpp.

462{
463 if (PickLayerData *pickData = dynamic_cast<PickLayerData*>(data)) {
465 clone.pickPoint = pickData->pos;
467 return;
468 }
469
470 Data *d = dynamic_cast<Data*>(data);
471
472 if (!m_nodes.isEmpty() && d) {
477 m_finalOffset = d->offset;
478 m_hasPostponedJob = true;
479 tryPostUpdateJob(false);
480
481 } else if (BarrierUpdateData *barrierData =
482 dynamic_cast<BarrierUpdateData*>(data)) {
483
484 doCanvasUpdate(barrierData->forceUpdate);
485
486 } else if (KisAsynchronousStrokeUpdateHelper::UpdateData *updateData =
488
489 tryPostUpdateJob(updateData->forceUpdate);
490
491 } else {
493 }
494}
KisNodeList selectNodesToProcess() const
void doStrokeCallback(KisStrokeJobData *data) override
void doCanvasUpdate(bool forceUpdate=false)
void tryPostUpdateJob(bool forceUpdate)

References doCanvasUpdate(), KisStrokeStrategyUndoCommandBased::doStrokeCallback(), m_finalOffset, m_hasPostponedJob, m_nodes, m_requestedNodeSelection, KisNodeSelectionRecipe::pickPoint, KisNodeSelectionRecipe::selectNodesToProcess(), sigLayersPicked(), and tryPostUpdateJob().

◆ finishStrokeCallback()

void MoveStrokeStrategy::finishStrokeCallback ( )
overridevirtual

Reimplemented from KisStrokeStrategyUndoCommandBased.

Definition at line 385 of file move_stroke_strategy.cpp.

386{
387 Q_FOREACH (KisNodeSP node, m_nodes) {
388 KUndo2Command *updateCommand =
389 new KisUpdateCommand(node, m_dirtyRects[node], m_updatesFacade, true);
390
391 recursiveApplyNodes({node}, [this, updateCommand](KisNodeSP node) {
392 KIS_SAFE_ASSERT_RECOVER_RETURN(m_d->strategy.find(node) != m_d->strategy.end());
393
394 MoveNodeStrategyBase *strategy = m_d->strategy[node].get();
395
396 strategy->finishMove(updateCommand);
397 });
398
399 notifyCommandDone(KUndo2CommandSP(updateCommand),
402 }
403
404 if (!m_updatesEnabled) {
405 Q_FOREACH (KisNodeSP node, m_nodes) {
407 }
408 }
409
411}
void notifyCommandDone(KUndo2CommandSP command, KisStrokeJobData::Sequentiality sequentiality, KisStrokeJobData::Exclusivity exclusivity)
QSharedPointer< KUndo2Command > KUndo2CommandSP
Definition kis_types.h:262
virtual void finishMove(KUndo2Command *parentCommand)=0

References KisStrokeJobData::EXCLUSIVE, MoveNodeStrategyBase::finishMove(), KisStrokeStrategyUndoCommandBased::finishStrokeCallback(), KIS_SAFE_ASSERT_RECOVER_RETURN, m_d, m_dirtyRects, m_nodes, m_updatesEnabled, m_updatesFacade, KisStrokeStrategyUndoCommandBased::notifyCommandDone(), recursiveApplyNodes(), KisUpdatesFacade::refreshGraphAsync(), and KisStrokeJobData::SEQUENTIAL.

◆ initStrokeCallback()

void MoveStrokeStrategy::initStrokeCallback ( )
overridevirtual

Our LodN might have already prepared the list of nodes for us, so we should reuse it to avoid different nodes to be moved in LodN and Lod0 modes.

We shouldn't try to transform standalone fully empty filter masks. That just doesn't make sense.

Collect handles rect

Since the mask is contained in m_nodes, we are explicitly asked to transform it by the user, we should show all the non- default pixels it has (since that is exactly what we are transforming)

Create strategies and start the transactions when necessary

Reimplemented from KisStrokeStrategyUndoCommandBased.

Definition at line 249 of file move_stroke_strategy.cpp.

250{
256 if (m_updatesEnabled) {
258
259 if (!m_nodes.isEmpty()) {
261 }
262
263 KritaUtils::filterContainer<KisNodeList>(m_nodes, [this](KisNodeSP node) {
268 const bool isEmptyFilterMask = node->inherits("KisFilterMask") && node->paintDevice()
269 && node->paintDevice()->nonDefaultPixelArea().isEmpty();
270
271 return !isEmptyFilterMask &&
273 node->isEditable(true);
274 });
275 Q_FOREACH(KisNodeSP subtree, m_nodes) {
277 subtree,
278 [this](KisNodeSP node) {
280 !node->isEditable(false) ||
281 (dynamic_cast<KisTransformMask*>(node.data()) &&
283
284 m_blacklistedNodes.insert(node);
285 }
286 });
287 }
288
289 if (m_sharedNodes) {
290 *m_sharedNodes = std::make_pair(m_nodes, m_blacklistedNodes);
291 }
292 } else {
295 }
296
297 if (m_nodes.isEmpty()) {
298 Q_EMIT sigStrokeStartedEmpty();
299 return;
300 }
301
303
304 KritaUtils::addJobBarrier(jobs, [this]() {
305 Q_FOREACH(KisNodeSP node, m_nodes) {
307 }
308 });
309
310 KritaUtils::addJobBarrier(jobs, [this]() {
311 Q_FOREACH(KisNodeSP node, m_nodes) {
313 }
314 });
315
316 KritaUtils::addJobBarrier(jobs, [this]() {
317 QRect handlesRect;
318
323 [&handlesRect, this] (KisNodeSP node) {
324 if (node->inherits("KisFilterMask") && m_nodes.contains(node)) {
331 if (node->paintDevice()) {
332 handlesRect |= node->paintDevice()->nonDefaultPixelArea();
333 }
334 } else {
335 handlesRect |= node->projectionPlane()->tightUserVisibleBounds();
336 }
337 });
338
340
341 Q_FOREACH(KisNodeSP node, m_nodes) {
342 if (node->hasEditablePaintDevice()) {
343 KUndo2Command *autoKeyframeCommand =
346 if (autoKeyframeCommand) {
348 }
349 } else if (KisTransformMask *mask = dynamic_cast<KisTransformMask*>(node.data())) {
351
352 if (maskAnimated) {
354 }
355 }
356 }
357
362 [this] (KisNodeSP node) {
363 if (dynamic_cast<KisTransformMask*>(node.data())) {
364 m_d->strategy.emplace(node, new MoveTransformMaskStrategy(node));
365 } else if (node->paintDevice()) {
366 m_d->strategy.emplace(node, new MovePaintableNodeStrategy(node));
367 } else {
368 m_d->strategy.emplace(node, new MoveNormalNodeStrategy(node));
369 }
370 });
371
372 if (m_updatesEnabled) {
373 KisLodTransform t(m_nodes.first()->image()->currentLevelOfDetail());
374 handlesRect = t.mapInverted(handlesRect);
375
376 Q_EMIT this->sigHandlesRectCalculated(handlesRect);
377 }
378
379 m_updateTimer.start();
380 });
381
383}
QRect nonDefaultPixelArea() const
void runAndSaveCommand(KUndo2CommandSP command, KisStrokeJobData::Sequentiality sequentiality, KisStrokeJobData::Exclusivity exclusivity)
QSharedPointer< T > toQShared(T *ptr)
KUndo2Command * tryAutoCreateDuplicatedFrame(KisPaintDeviceSP device, AutoCreateKeyframeFlags flags)
create a new duplicated keyframe if auto-keyframe mode is on
bool checkIsCloneOf(KisNodeSP node, const KisNodeList &nodes)
KisNodeList sortAndFilterMergeableInternalNodes(KisNodeList nodes, bool allowMasks)
void recursiveApplyNodes(NodePointer node, Functor func)
void forceAllHiddenOriginalsUpdate(KisNodeSP root)
bool checkIsChildOf(KisNodeSP node, const KisNodeList &parents)
void forceAllDelayedNodesUpdate(KisNodeSP root)
void addJobBarrier(QVector< Job * > &jobs, Func func)
bool isEditable(bool checkVisibility=true) const
virtual KisPaintDeviceSP paintDevice() const =0
bool hasEditablePaintDevice() const
virtual KisAbstractProjectionPlaneSP projectionPlane() const
Definition kis_node.cpp:240

References KritaUtils::addJobBarrier(), KisStrokeJobData::BARRIER, KisLayerUtils::checkIsChildOf(), KisLayerUtils::checkIsCloneOf(), KisSharedPtr< T >::data(), KisLayerUtils::forceAllDelayedNodesUpdate(), KisLayerUtils::forceAllHiddenOriginalsUpdate(), KisBaseNode::hasEditablePaintDevice(), KisStrokeStrategyUndoCommandBased::initStrokeCallback(), KisBaseNode::isEditable(), KIS_SAFE_ASSERT_RECOVER_RETURN, m_blacklistedNodes, m_nodes, m_requestedNodeSelection, m_sharedNodes, m_updatesEnabled, m_updateTimer, KisLodTransformBase::mapInverted(), KisLazyCreateTransformMaskKeyframesCommand::maskHasAnimation(), KisPaintDevice::nonDefaultPixelArea(), KisStrokeJobData::NORMAL, KisBaseNode::paintDevice(), KisNode::projectionPlane(), recursiveApplyNodes(), KisLayerUtils::recursiveApplyNodes(), KisStrokeStrategyUndoCommandBased::runAndSaveCommand(), KisNodeSelectionRecipe::selectNodesToProcess(), sigHandlesRectCalculated(), sigStrokeStartedEmpty(), KisLayerUtils::sortAndFilterMergeableInternalNodes(), KisAutoKey::SupportsLod, toQShared(), and KisAutoKey::tryAutoCreateDuplicatedFrame().

◆ recursiveApplyNodes()

template<typename Functor >
void MoveStrokeStrategy::recursiveApplyNodes ( const KisNodeList & nodes,
Functor && func )
private

Definition at line 196 of file move_stroke_strategy.cpp.

196 {
197 Q_FOREACH(KisNodeSP subtree, nodes) {
199 [&] (KisNodeSP node) {
200 if (!m_blacklistedNodes.contains(node)) {
201 func(node);
202 }
203 });
204 }
205}

References m_blacklistedNodes, and KisLayerUtils::recursiveApplyNodes().

◆ setUndoEnabled()

void MoveStrokeStrategy::setUndoEnabled ( bool value)
private

◆ setUpdatesEnabled()

void MoveStrokeStrategy::setUpdatesEnabled ( bool value)
private

Definition at line 530 of file move_stroke_strategy.cpp.

531{
533}
float value(const T *src, size_t ch)

References m_updatesEnabled, and value().

◆ sigHandlesRectCalculated

void MoveStrokeStrategy::sigHandlesRectCalculated ( const QRect & handlesRect)
signal

◆ sigLayersPicked

void MoveStrokeStrategy::sigLayersPicked ( const KisNodeList & nodes)
signal

◆ sigStrokeStartedEmpty

void MoveStrokeStrategy::sigStrokeStartedEmpty ( )
signal

◆ tryPostUpdateJob()

void MoveStrokeStrategy::tryPostUpdateJob ( bool forceUpdate)
private

Definition at line 449 of file move_stroke_strategy.cpp.

450{
451 if (!m_hasPostponedJob) return;
452
453 if (forceUpdate ||
454 (m_updateTimer.elapsed() > m_updateInterval &&
456
457 addMutatedJob(new BarrierUpdateData(forceUpdate));
458 }
459}
void addMutatedJob(KisStrokeJobData *data)

References KisStrokeStrategy::addMutatedJob(), KisUpdatesFacade::hasUpdatesRunning(), m_hasPostponedJob, m_updateInterval, m_updatesFacade, and m_updateTimer.

Member Data Documentation

◆ m_blacklistedNodes

QSet<KisNodeSP> MoveStrokeStrategy::m_blacklistedNodes
private

Definition at line 103 of file move_stroke_strategy.h.

◆ m_d

QScopedPointer<Private> MoveStrokeStrategy::m_d
private

Definition at line 98 of file move_stroke_strategy.h.

◆ m_dirtyRects

QHash<KisNodeSP, QRect> MoveStrokeStrategy::m_dirtyRects
private

Definition at line 106 of file move_stroke_strategy.h.

◆ m_finalOffset

QPoint MoveStrokeStrategy::m_finalOffset
private

Definition at line 105 of file move_stroke_strategy.h.

◆ m_hasPostponedJob

bool MoveStrokeStrategy::m_hasPostponedJob {false}
private

Definition at line 110 of file move_stroke_strategy.h.

110{false};

◆ m_nodes

KisNodeList MoveStrokeStrategy::m_nodes
private

Definition at line 101 of file move_stroke_strategy.h.

◆ m_requestedNodeSelection

KisNodeSelectionRecipe MoveStrokeStrategy::m_requestedNodeSelection
private

Definition at line 100 of file move_stroke_strategy.h.

◆ m_sharedNodes

QSharedPointer<std::pair<KisNodeList, QSet<KisNodeSP> > > MoveStrokeStrategy::m_sharedNodes
private

Definition at line 102 of file move_stroke_strategy.h.

◆ m_updateInterval

const int MoveStrokeStrategy::m_updateInterval {30}
private

Definition at line 111 of file move_stroke_strategy.h.

111{30};

◆ m_updatesEnabled

bool MoveStrokeStrategy::m_updatesEnabled {true}
private

Definition at line 107 of file move_stroke_strategy.h.

107{true};

◆ m_updatesFacade

KisUpdatesFacade* MoveStrokeStrategy::m_updatesFacade {nullptr}
private

Definition at line 104 of file move_stroke_strategy.h.

104{nullptr};

◆ m_updateTimer

QElapsedTimer MoveStrokeStrategy::m_updateTimer
private

Definition at line 109 of file move_stroke_strategy.h.


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