Krita Source Code Documentation
Loading...
Searching...
No Matches
KisDlgChangeCloneSource::Private Struct Reference

Public Member Functions

void addToTargetListRecursively (KisNodeSP node, bool addSelf=true)
 
KUndo2CommandcreateCommand (KisLayerSP targetLayer)
 
void filterOutAncestorsAndClonesRecursively (KisLayerSP layer)
 
KisLayerSP getSelectedTargetLayer ()
 
 Private (QList< KisCloneLayerSP > layers, KisViewManager *view)
 

Public Attributes

QScopedPointer< KisProcessingApplicatorapplicator
 
QList< KisCloneLayerSPcloneLayers
 
KisImageSP image
 
bool modified
 
Ui::WdgChangeCloneSource ui
 
QList< KisLayerSPvalidTargets
 
KisViewManagerview
 

Detailed Description

Definition at line 19 of file KisDlgChangeCloneSource.cpp.

Constructor & Destructor Documentation

◆ Private()

KisDlgChangeCloneSource::Private::Private ( QList< KisCloneLayerSP > layers,
KisViewManager * view )
inline

Definition at line 21 of file KisDlgChangeCloneSource.cpp.

22 : cloneLayers(layers)
23 , view(view)
24 , image(view->image())
27 /* emitSignals = */ KisImageSignalVector(),
28 kundo2_i18n("Change Clone Layers")))
29 , modified(false) {}
QVector< KisImageSignalType > KisImageSignalVector
KisImageWSP image() const
Return the image this view is displaying.
KUndo2MagicString kundo2_i18n(const char *text)
QScopedPointer< KisProcessingApplicator > applicator

Member Function Documentation

◆ addToTargetListRecursively()

void KisDlgChangeCloneSource::Private::addToTargetListRecursively ( KisNodeSP node,
bool addSelf = true )

Definition at line 45 of file KisDlgChangeCloneSource.cpp.

46{
47 if (!node) {
48 return;
49 }
50 if (addSelf) {
51 KisLayerSP layer(qobject_cast<KisLayer *>(node.data()));
52 if (layer) {
53 validTargets << layer;
54 }
55 }
56 for (KisNodeSP childNode = node->lastChild(); childNode; childNode = childNode->prevSibling()) {
57 KisLayerSP childLayer(qobject_cast<KisLayer *>(childNode.data()));
58 if (childLayer) {
60 }
61 }
62
63}
void addToTargetListRecursively(KisNodeSP node, bool addSelf=true)
KisNodeSP lastChild() const
Definition kis_node.cpp:367

References addToTargetListRecursively(), KisSharedPtr< T >::data(), KisNode::lastChild(), and validTargets.

◆ createCommand()

KUndo2Command * KisDlgChangeCloneSource::Private::createCommand ( KisLayerSP targetLayer)

◆ filterOutAncestorsAndClonesRecursively()

void KisDlgChangeCloneSource::Private::filterOutAncestorsAndClonesRecursively ( KisLayerSP layer)

Definition at line 65 of file KisDlgChangeCloneSource.cpp.

66{
67 validTargets.removeOne(layer);
68 // remove `layer` and its ancestors
69 KisLayerSP parent = qobject_cast<KisLayer *>(layer->parent().data());
70 if (parent) {
72 }
73
74 // remove all clones of `layer`, and their ancestors
75 Q_FOREACH (KisCloneLayerSP clone, layer->registeredClones()) {
77 }
78}
ChildIterator< value_type, is_const > parent(const ChildIterator< value_type, is_const > &it)
Definition KisForest.h:327
void filterOutAncestorsAndClonesRecursively(KisLayerSP layer)
const QList< KisCloneLayerWSP > registeredClones() const
Definition kis_layer.cc:478
KisNodeWSP parent
Definition kis_node.cpp:86

References KisWeakSharedPtr< T >::data(), KisNode::parent, and KisLayer::registeredClones().

◆ getSelectedTargetLayer()

KisLayerSP KisDlgChangeCloneSource::Private::getSelectedTargetLayer ( )

Definition at line 80 of file KisDlgChangeCloneSource.cpp.

81{
82 int index = ui.cmbSourceLayer->currentIndex();
83 if (index != -1) {
84 return validTargets.at(index);
85 } else {
86 return 0;
87 }
88}

References KisNode::at().

Member Data Documentation

◆ applicator

QScopedPointer<KisProcessingApplicator> KisDlgChangeCloneSource::Private::applicator

Definition at line 36 of file KisDlgChangeCloneSource.cpp.

◆ cloneLayers

QList<KisCloneLayerSP> KisDlgChangeCloneSource::Private::cloneLayers

Definition at line 31 of file KisDlgChangeCloneSource.cpp.

◆ image

KisImageSP KisDlgChangeCloneSource::Private::image

Definition at line 33 of file KisDlgChangeCloneSource.cpp.

◆ modified

bool KisDlgChangeCloneSource::Private::modified

Definition at line 37 of file KisDlgChangeCloneSource.cpp.

◆ ui

Ui::WdgChangeCloneSource KisDlgChangeCloneSource::Private::ui

Definition at line 35 of file KisDlgChangeCloneSource.cpp.

◆ validTargets

QList<KisLayerSP> KisDlgChangeCloneSource::Private::validTargets

Definition at line 34 of file KisDlgChangeCloneSource.cpp.

◆ view

KisViewManager* KisDlgChangeCloneSource::Private::view

Definition at line 32 of file KisDlgChangeCloneSource.cpp.


The documentation for this struct was generated from the following file: