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

415{
416 if (!m_nodes.isEmpty()) {
417 m_finalOffset = QPoint();
418 m_hasPostponedJob = true;
419
421
423 Q_FOREACH (KisNodeSP node, m_nodes) {
424 QRect dirtyRect;
425
426 recursiveApplyNodes({node},
427 [this, &dirtyRect] (KisNodeSP node) {
428 MoveNodeStrategyBase *strategy =
429 m_d->strategy[node].get();
431
432 dirtyRect |= strategy->cancelMove();
433 });
434
435 m_dirtyRects[node] |= dirtyRect;
436
440 m_updatesFacade->refreshGraphAsync(node, dirtyRect);
441 }
442 });
443
445 }
446
448}
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 547 of file move_stroke_strategy.cpp.

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

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

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

387{
388 Q_FOREACH (KisNodeSP node, m_nodes) {
389 KUndo2Command *updateCommand =
390 new KisUpdateCommand(node, m_dirtyRects[node], m_updatesFacade, true);
391
392 recursiveApplyNodes({node}, [this, updateCommand](KisNodeSP node) {
393 KIS_SAFE_ASSERT_RECOVER_RETURN(m_d->strategy.find(node) != m_d->strategy.end());
394
395 MoveNodeStrategyBase *strategy = m_d->strategy[node].get();
396
397 strategy->finishMove(updateCommand);
398 });
399
400 notifyCommandDone(KUndo2CommandSP(updateCommand),
403 }
404
405 if (!m_updatesEnabled) {
406 Q_FOREACH (KisNodeSP node, m_nodes) {
408 }
409 }
410
412}
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 return !isEmptyFilterMask &&
274 node->isEditable(true);
275 });
276 Q_FOREACH(KisNodeSP subtree, m_nodes) {
278 subtree,
279 [this](KisNodeSP node) {
281 !node->isEditable(false) ||
282 (dynamic_cast<KisTransformMask*>(node.data()) &&
284
285 m_blacklistedNodes.insert(node);
286 }
287 });
288 }
289
290 if (m_sharedNodes) {
291 *m_sharedNodes = std::make_pair(m_nodes, m_blacklistedNodes);
292 }
293 } else {
296 }
297
298 if (m_nodes.isEmpty()) {
299 Q_EMIT sigStrokeStartedEmpty();
300 return;
301 }
302
304
305 KritaUtils::addJobBarrier(jobs, [this]() {
306 Q_FOREACH(KisNodeSP node, m_nodes) {
308 }
309 });
310
311 KritaUtils::addJobBarrier(jobs, [this]() {
312 Q_FOREACH(KisNodeSP node, m_nodes) {
314 }
315 });
316
317 KritaUtils::addJobBarrier(jobs, [this]() {
318 QRect handlesRect;
319
324 [&handlesRect, this] (KisNodeSP node) {
325 if (node->inherits("KisFilterMask") && m_nodes.contains(node)) {
332 if (node->paintDevice()) {
333 handlesRect |= node->paintDevice()->nonDefaultPixelArea();
334 }
335 } else {
336 handlesRect |= node->projectionPlane()->tightUserVisibleBounds();
337 }
338 });
339
341
342 Q_FOREACH(KisNodeSP node, m_nodes) {
343 if (node->hasEditablePaintDevice()) {
344 KUndo2Command *autoKeyframeCommand =
347 if (autoKeyframeCommand) {
349 }
350 } else if (KisTransformMask *mask = dynamic_cast<KisTransformMask*>(node.data())) {
352
353 if (maskAnimated) {
355 }
356 }
357 }
358
363 [this] (KisNodeSP node) {
364 if (dynamic_cast<KisTransformMask*>(node.data())) {
365 m_d->strategy.emplace(node, new MoveTransformMaskStrategy(node));
366 } else if (node->paintDevice()) {
367 m_d->strategy.emplace(node, new MovePaintableNodeStrategy(node));
368 } else {
369 m_d->strategy.emplace(node, new MoveNormalNodeStrategy(node));
370 }
371 });
372
373 if (m_updatesEnabled) {
374 KisLodTransform t(m_nodes.first()->image()->currentLevelOfDetail());
375 handlesRect = t.mapInverted(handlesRect);
376
377 Q_EMIT this->sigHandlesRectCalculated(handlesRect);
378 }
379
380 m_updateTimer.start();
381 });
382
384}
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 531 of file move_stroke_strategy.cpp.

532{
534}
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 450 of file move_stroke_strategy.cpp.

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