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

The command for deselection the global selection of KisImage. More...

#include <kis_reselect_global_selection_command.h>

+ Inheritance diagram for KisReselectGlobalSelectionCommand:

Public Member Functions

 KisReselectGlobalSelectionCommand (KisImageWSP image, KUndo2Command *parent=nullptr)
 
void populateChildCommands () override
 
 ~KisReselectGlobalSelectionCommand () override
 
- Public Member Functions inherited from KisCommandUtils::AggregateCommand
 AggregateCommand (const KUndo2MagicString &text, KUndo2Command *parent=0)
 
 AggregateCommand (KUndo2Command *parent=0)
 
void redo () override
 
void undo () override
 
- Public Member Functions inherited from KUndo2Command
QString actionText () const
 
virtual bool canAnnihilateWith (const KUndo2Command *other) const
 
const KUndo2Commandchild (int index) const
 
int childCount () const
 
virtual QTime endTime () const
 
KUndo2CommandExtraDataextraData () const
 
bool hasParent () const
 
virtual int id () const
 
virtual bool isMerged () const
 
 KUndo2Command (const KUndo2MagicString &text, KUndo2Command *parent=0)
 
 KUndo2Command (KUndo2Command *parent=0)
 
virtual QVector< KUndo2Command * > mergeCommandsVector () const
 
virtual bool mergeWith (const KUndo2Command *other)
 
virtual void redoMergedCommands ()
 
void setEndTime ()
 
virtual void setEndTime (const QTime &time)
 
void setExtraData (KUndo2CommandExtraData *data)
 
void setText (const KUndo2MagicString &text)
 
void setTime ()
 
virtual void setTime (const QTime &time)
 
virtual void setTimedID (int timedID)
 
KUndo2MagicString text () const
 
virtual QTime time () const
 
virtual int timedId () const
 
virtual bool timedMergeWith (KUndo2Command *other)
 
virtual void undoMergedCommands ()
 
virtual ~KUndo2Command ()
 

Protected Attributes

KisImageWSP m_image
 

Additional Inherited Members

- Protected Member Functions inherited from KisCommandUtils::AggregateCommand
void addCommand (KUndo2Command *cmd)
 

Detailed Description

The command for deselection the global selection of KisImage.

Definition at line 14 of file kis_reselect_global_selection_command.h.

Constructor & Destructor Documentation

◆ KisReselectGlobalSelectionCommand()

KisReselectGlobalSelectionCommand::KisReselectGlobalSelectionCommand ( KisImageWSP image,
KUndo2Command * parent = nullptr )

Constructor

Parameters
imagethe image
parentthe parent command

Definition at line 20 of file kis_reselect_global_selection_command.cpp.

22 , m_image(image)
23{
24}
KUndo2MagicString kundo2_i18n(const char *text)
The AggregateCommand struct is a command with delayed initialization. On first redo() populateChildCo...

◆ ~KisReselectGlobalSelectionCommand()

KisReselectGlobalSelectionCommand::~KisReselectGlobalSelectionCommand ( )
override

Definition at line 26 of file kis_reselect_global_selection_command.cpp.

27{
28}

Member Function Documentation

◆ populateChildCommands()

void KisReselectGlobalSelectionCommand::populateChildCommands ( )
overridevirtual

Implements KisCommandUtils::AggregateCommand.

Definition at line 30 of file kis_reselect_global_selection_command.cpp.

31{
34
36
38 if (selectionMask) {
39 KisSelectionMaskSP activeSelectionMask = image->rootLayer()->selectionMask();
40 if (activeSelectionMask) {
41 addCommand(new KisImageLayerRemoveCommand(image, activeSelectionMask, false, false));
42 }
43
44 addCommand(new KisChangeDeselectedMaskCommand(image, nullptr));
45 addCommand(new KisImageLayerAddCommand(image, selectionMask, image->root(), image->root()->lastChild(), false, false));
46 }
47
49}
KisSelectionMaskSP deselectedGlobalSelection() const
Definition kis_image.cc:305
The command for adding a layer.
KisImageGlobalSelectionManagementInterface * globalSelectionManagementInterface() const
Definition kis_image.cc:710
KisGroupLayerSP rootLayer() const
KisSharedPtr< T > toStrongRef() const
toStrongRef returns a KisSharedPtr which may be dereferenced.
#define KIS_SAFE_ASSERT_RECOVER_RETURN(cond)
Definition kis_assert.h:128
void addCommand(KUndo2Command *cmd)
virtual KisSelectionMaskSP selectionMask() const
Definition kis_layer.cc:498
KisNodeSP lastChild() const
Definition kis_node.cpp:367

References KisCommandUtils::AggregateCommand::addCommand(), KisImageGlobalSelectionManagementInterface::deselectedGlobalSelection(), KisCommandUtils::FlipFlopCommand::FINALIZING, KisImage::globalSelectionManagementInterface(), KisCommandUtils::FlipFlopCommand::INITIALIZING, KIS_SAFE_ASSERT_RECOVER_RETURN, KisNode::lastChild(), m_image, KisNodeFacade::root, KisImage::rootLayer(), KisLayer::selectionMask(), and KisWeakSharedPtr< T >::toStrongRef().

Member Data Documentation

◆ m_image

KisImageWSP KisReselectGlobalSelectionCommand::m_image
protected

Definition at line 28 of file kis_reselect_global_selection_command.h.


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