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 (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 212 of file move_stroke_strategy.cpp.

216 m_d(new Private()),
217 m_requestedNodeSelection(nodeSelection),
218 m_updatesFacade(updatesFacade),
219 m_updatesEnabled(true)
220{
222
224}
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 226 of file move_stroke_strategy.cpp.

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

◆ ~MoveStrokeStrategy()

MoveStrokeStrategy::~MoveStrokeStrategy ( )
override

Definition at line 231 of file move_stroke_strategy.cpp.

232{
233}

◆ MoveStrokeStrategy() [3/3]

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

Definition at line 235 of file move_stroke_strategy.cpp.

236 : QObject(),
238 m_d(new Private()),
240 m_nodes(rhs.m_nodes),
246{
247 KIS_SAFE_ASSERT_RECOVER_NOOP(rhs.m_d->strategy.empty());
248}
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 415 of file move_stroke_strategy.cpp.

416{
417 if (!m_nodes.isEmpty()) {
418 m_finalOffset = QPoint();
419 m_hasPostponedJob = true;
420
422
424 Q_FOREACH (KisNodeSP node, m_nodes) {
425 QRect dirtyRect;
426
427 recursiveApplyNodes({node},
428 [this, &dirtyRect] (KisNodeSP node) {
429 MoveNodeStrategyBase *strategy =
430 m_d->strategy[node].get();
432
433 dirtyRect |= strategy->cancelMove();
434 });
435
436 m_dirtyRects[node] |= dirtyRect;
437
441 m_updatesFacade->refreshGraphAsync(node, dirtyRect);
442 }
443 });
444
446 }
447
449}
KisRunnableStrokeJobsInterface * runnableJobsInterface() const
virtual void addRunnableJobs(const QVector< KisRunnableStrokeJobDataBase * > &list)=0
void refreshGraphAsync(KisNodeSP root=nullptr, KisProjectionUpdateFlags flags=KisProjectionUpdateFlag::None)
void recursiveApplyNodes(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 548 of file move_stroke_strategy.cpp.

549{
550 KisNodeList nodesToCheck;
551
554 } else if (!m_requestedNodeSelection.selectedNodes.isEmpty()){
561 }
562
563 Q_FOREACH (KisNodeSP node, nodesToCheck) {
564 if (!checkSupportsLodMoves(node)) return 0;
565 }
566
567 MoveStrokeStrategy *clone = new MoveStrokeStrategy(*this, levelOfDetail);
568 connect(clone, SIGNAL(sigHandlesRectCalculated(QRect)), this, SIGNAL(sigHandlesRectCalculated(QRect)));
569 connect(clone, SIGNAL(sigStrokeStartedEmpty()), this, SIGNAL(sigStrokeStartedEmpty()));
570 connect(clone, SIGNAL(sigLayersPicked(const KisNodeList&)), this, SIGNAL(sigLayersPicked(const KisNodeList&)));
571 this->setUpdatesEnabled(false);
572 m_sharedNodes.reset(new std::pair<KisNodeList, QSet<KisNodeSP>>());
574 return clone;
575}
connect(this, SIGNAL(optionsChanged()), this, SLOT(saveOptions()))
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(), connect(), 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 498 of file move_stroke_strategy.cpp.

499{
500 if (!forceUpdate &&
501 (m_updateTimer.elapsed() < m_updateInterval ||
503
504 return;
505 }
506
507 if (!m_hasPostponedJob) return;
508
509 Q_FOREACH (KisNodeSP node, m_nodes) {
510 QRect dirtyRect;
511
512 recursiveApplyNodes({node},
513 [this, &dirtyRect] (KisNodeSP node) {
514 MoveNodeStrategyBase *strategy =
515 m_d->strategy[node].get();
517
518 dirtyRect |= strategy->moveNode(m_finalOffset);
519 });
520
521 m_dirtyRects[node] |= dirtyRect;
522
523 if (m_updatesEnabled) {
524 m_updatesFacade->refreshGraphAsync(node, dirtyRect);
525 }
526 }
527
528 m_hasPostponedJob = false;
529 m_updateTimer.restart();
530}
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 463 of file move_stroke_strategy.cpp.

464{
465 if (PickLayerData *pickData = dynamic_cast<PickLayerData*>(data)) {
467 clone.pickPoint = pickData->pos;
469 return;
470 }
471
472 Data *d = dynamic_cast<Data*>(data);
473
474 if (!m_nodes.isEmpty() && d) {
479 m_finalOffset = d->offset;
480 m_hasPostponedJob = true;
481 tryPostUpdateJob(false);
482
483 } else if (BarrierUpdateData *barrierData =
484 dynamic_cast<BarrierUpdateData*>(data)) {
485
486 doCanvasUpdate(barrierData->forceUpdate);
487
488 } else if (KisAsynchronousStrokeUpdateHelper::UpdateData *updateData =
490
491 tryPostUpdateJob(updateData->forceUpdate);
492
493 } else {
495 }
496}
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 387 of file move_stroke_strategy.cpp.

388{
389 Q_FOREACH (KisNodeSP node, m_nodes) {
390 KUndo2Command *updateCommand =
391 new KisUpdateCommand(node, m_dirtyRects[node], m_updatesFacade, true);
392
393 recursiveApplyNodes({node}, [this, updateCommand](KisNodeSP node) {
394 KIS_SAFE_ASSERT_RECOVER_RETURN(m_d->strategy.find(node) != m_d->strategy.end());
395
396 MoveNodeStrategyBase *strategy = m_d->strategy[node].get();
397
398 strategy->finishMove(updateCommand);
399 });
400
401 notifyCommandDone(KUndo2CommandSP(updateCommand),
404 }
405
406 if (!m_updatesEnabled) {
407 Q_FOREACH (KisNodeSP node, m_nodes) {
409 }
410 }
411
413}
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 250 of file move_stroke_strategy.cpp.

251{
257 if (m_updatesEnabled) {
259
260 if (!m_nodes.isEmpty()) {
262 }
263
264 KritaUtils::filterContainer<KisNodeList>(m_nodes, [this](KisNodeSP node) {
269 const bool isEmptyFilterMask = node->inherits("KisFilterMask") && node->paintDevice()
270 && node->paintDevice()->nonDefaultPixelArea().isEmpty();
271
272 // TODO: check isolation
273 return !isEmptyFilterMask &&
275 node->isEditable(true);
276 });
277 Q_FOREACH(KisNodeSP subtree, m_nodes) {
279 subtree,
280 [this](KisNodeSP node) {
282 !node->isEditable(false) ||
283 (dynamic_cast<KisTransformMask*>(node.data()) &&
285
286 m_blacklistedNodes.insert(node);
287 }
288 });
289 }
290
291 if (m_sharedNodes) {
292 *m_sharedNodes = std::make_pair(m_nodes, m_blacklistedNodes);
293 }
294 } else {
297 }
298
299 if (m_nodes.isEmpty()) {
300 Q_EMIT sigStrokeStartedEmpty();
301 return;
302 }
303
305
306 KritaUtils::addJobBarrier(jobs, [this]() {
307 Q_FOREACH(KisNodeSP node, m_nodes) {
309 }
310 });
311
312 KritaUtils::addJobBarrier(jobs, [this]() {
313 Q_FOREACH(KisNodeSP node, m_nodes) {
315 }
316 });
317
318 KritaUtils::addJobBarrier(jobs, [this]() {
319 QRect handlesRect;
320
325 [&handlesRect, this] (KisNodeSP node) {
326 if (node->inherits("KisFilterMask") && m_nodes.contains(node)) {
333 if (node->paintDevice()) {
334 handlesRect |= node->paintDevice()->nonDefaultPixelArea();
335 }
336 } else {
337 handlesRect |= node->projectionPlane()->tightUserVisibleBounds();
338 }
339 });
340
342
343 Q_FOREACH(KisNodeSP node, m_nodes) {
344 if (node->hasEditablePaintDevice()) {
345 KUndo2Command *autoKeyframeCommand =
348 if (autoKeyframeCommand) {
350 }
351 } else if (KisTransformMask *mask = dynamic_cast<KisTransformMask*>(node.data())) {
353
354 if (maskAnimated) {
356 }
357 }
358 }
359
364 [this] (KisNodeSP node) {
365 if (dynamic_cast<KisTransformMask*>(node.data())) {
366 m_d->strategy.emplace(node, new MoveTransformMaskStrategy(node));
367 } else if (node->paintDevice()) {
368 m_d->strategy.emplace(node, new MovePaintableNodeStrategy(node));
369 } else {
370 m_d->strategy.emplace(node, new MoveNormalNodeStrategy(node));
371 }
372 });
373
374 if (m_updatesEnabled) {
375 KisLodTransform t(m_nodes.first()->image()->currentLevelOfDetail());
376 handlesRect = t.mapInverted(handlesRect);
377
378 Q_EMIT this->sigHandlesRectCalculated(handlesRect);
379 }
380
381 m_updateTimer.start();
382 });
383
385}
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 ( KisNodeList nodes,
Functor && func )
private

Definition at line 197 of file move_stroke_strategy.cpp.

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

References m_blacklistedNodes, and KisLayerUtils::recursiveApplyNodes().

◆ setUndoEnabled()

void MoveStrokeStrategy::setUndoEnabled ( bool value)
private

◆ setUpdatesEnabled()

void MoveStrokeStrategy::setUpdatesEnabled ( bool value)
private

Definition at line 532 of file move_stroke_strategy.cpp.

533{
535}
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 451 of file move_stroke_strategy.cpp.

452{
453 if (!m_hasPostponedJob) return;
454
455 if (forceUpdate ||
456 (m_updateTimer.elapsed() > m_updateInterval &&
458
459 addMutatedJob(new BarrierUpdateData(forceUpdate));
460 }
461}
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: