|
Krita Source Code Documentation
|
#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 () |
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< KisNodeSP > | m_blacklistedNodes |
| QScopedPointer< Private > | m_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} |
| KisUpdatesFacade * | m_updatesFacade {nullptr} |
| QElapsedTimer | m_updateTimer |
Definition at line 29 of file move_stroke_strategy.h.
| MoveStrokeStrategy::MoveStrokeStrategy | ( | KisNodeSelectionRecipe | nodeSelection, |
| KisUpdatesFacade * | updatesFacade, | ||
| KisStrokeUndoFacade * | undoFacade ) |
Definition at line 212 of file move_stroke_strategy.cpp.
References KisStrokeJobData::BARRIER, KisSimpleStrokeStrategy::enableJob(), KisSimpleStrokeStrategy::JOB_INIT, and KisStrokeStrategyUndoCommandBased::setSupportsWrapAroundMode().
| MoveStrokeStrategy::MoveStrokeStrategy | ( | KisNodeList | nodes, |
| KisUpdatesFacade * | updatesFacade, | ||
| KisStrokeUndoFacade * | undoFacade ) |
Definition at line 226 of file move_stroke_strategy.cpp.
|
override |
Definition at line 231 of file move_stroke_strategy.cpp.
|
private |
Definition at line 235 of file move_stroke_strategy.cpp.
References KIS_SAFE_ASSERT_RECOVER_NOOP, and m_d.
|
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.
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().
|
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.
References checkSupportsLodMoves(), connect(), KisLayerUtils::findRoot(), m_requestedNodeSelection, m_sharedNodes, KisNodeSelectionRecipe::mode, MoveStrokeStrategy(), KisNodeSelectionRecipe::SelectedLayer, KisNodeSelectionRecipe::selectedNodes, setUpdatesEnabled(), sigHandlesRectCalculated(), sigLayersPicked(), and sigStrokeStartedEmpty().
|
private |
Definition at line 498 of file move_stroke_strategy.cpp.
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().
|
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.
References doCanvasUpdate(), KisStrokeStrategyUndoCommandBased::doStrokeCallback(), m_finalOffset, m_hasPostponedJob, m_nodes, m_requestedNodeSelection, KisNodeSelectionRecipe::pickPoint, KisNodeSelectionRecipe::selectNodesToProcess(), sigLayersPicked(), and tryPostUpdateJob().
|
overridevirtual |
Reimplemented from KisStrokeStrategyUndoCommandBased.
Definition at line 387 of file move_stroke_strategy.cpp.
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.
|
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.
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().
|
private |
Definition at line 197 of file move_stroke_strategy.cpp.
References m_blacklistedNodes, and KisLayerUtils::recursiveApplyNodes().
|
private |
|
private |
Definition at line 532 of file move_stroke_strategy.cpp.
References m_updatesEnabled, and value().
|
signal |
|
signal |
|
signal |
|
private |
Definition at line 451 of file move_stroke_strategy.cpp.
References KisStrokeStrategy::addMutatedJob(), KisUpdatesFacade::hasUpdatesRunning(), m_hasPostponedJob, m_updateInterval, m_updatesFacade, and m_updateTimer.
|
private |
Definition at line 103 of file move_stroke_strategy.h.
|
private |
Definition at line 98 of file move_stroke_strategy.h.
|
private |
Definition at line 106 of file move_stroke_strategy.h.
|
private |
Definition at line 105 of file move_stroke_strategy.h.
|
private |
Definition at line 110 of file move_stroke_strategy.h.
|
private |
Definition at line 101 of file move_stroke_strategy.h.
|
private |
Definition at line 100 of file move_stroke_strategy.h.
|
private |
Definition at line 102 of file move_stroke_strategy.h.
|
private |
Definition at line 111 of file move_stroke_strategy.h.
|
private |
Definition at line 107 of file move_stroke_strategy.h.
|
private |
Definition at line 104 of file move_stroke_strategy.h.
|
private |
Definition at line 109 of file move_stroke_strategy.h.