Krita Source Code Documentation
Loading...
Searching...
No Matches
ActivateSelectionMasksCommand Class Reference
+ Inheritance diagram for ActivateSelectionMasksCommand:

Public Member Functions

 ActivateSelectionMasksCommand (const QList< KisSelectionMaskSP > &activeBefore, const QList< KisSelectionMaskSP > &activeAfter, bool finalize, KUndo2Command *parent=0)
 
void partA () override
 
void partB () override
 
- Public Member Functions inherited from KisCommandUtils::FlipFlopCommand
 FlipFlopCommand (bool finalizing=false, KUndo2Command *parent=0)
 
 FlipFlopCommand (State initialState, 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 KUndo2Command * child (int index) const
 
int childCount () const
 
virtual QTime endTime () const
 
KUndo2CommandExtraData * extraData () 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 ()
 

Private Attributes

QList< KisSelectionMaskSP > m_activeAfter
 
QList< KisSelectionMaskSP > m_activeBefore
 

Additional Inherited Members

- Public Types inherited from KisCommandUtils::FlipFlopCommand
enum  State { INITIALIZING , FINALIZING }
 
- Protected Member Functions inherited from KisCommandUtils::FlipFlopCommand
State getState () const
 
bool isFirstRedo () const
 

Detailed Description

A command to activate newly created selection masks after any action

Definition at line 280 of file kis_node_juggler_compressed.cpp.

Constructor & Destructor Documentation

◆ ActivateSelectionMasksCommand()

ActivateSelectionMasksCommand::ActivateSelectionMasksCommand ( const QList< KisSelectionMaskSP > & activeBefore,
const QList< KisSelectionMaskSP > & activeAfter,
bool finalize,
KUndo2Command * parent = 0 )
inline

Definition at line 283 of file kis_node_juggler_compressed.cpp.

286 : FlipFlopCommand(finalize, parent),
287 m_activeBefore(activeBefore),
288 m_activeAfter(activeAfter)
289 {
290 }
FlipFlopCommand(State initialState, KUndo2Command *parent=0)

Member Function Documentation

◆ partA()

void ActivateSelectionMasksCommand::partA ( )
inlineoverridevirtual

Reimplemented from KisCommandUtils::FlipFlopCommand.

Definition at line 292 of file kis_node_juggler_compressed.cpp.

292 {
293 QList<KisSelectionMaskSP> *newActiveMasks;
294
295 if (getState() == FINALIZING) {
296 newActiveMasks = &m_activeAfter;
297 } else {
298 newActiveMasks = &m_activeBefore;
299 }
300
301 Q_FOREACH (KisSelectionMaskSP mask, *newActiveMasks) {
302 mask->setActive(false);
303 }
304 }
void setActive(bool active)

References KisCommandUtils::FlipFlopCommand::FINALIZING, KisCommandUtils::FlipFlopCommand::getState(), m_activeAfter, m_activeBefore, and KisSelectionMask::setActive().

◆ partB()

void ActivateSelectionMasksCommand::partB ( )
inlineoverridevirtual

Reimplemented from KisCommandUtils::FlipFlopCommand.

Definition at line 306 of file kis_node_juggler_compressed.cpp.

306 {
307 QList<KisSelectionMaskSP> *newActiveMasks;
308
309 if (getState() == FINALIZING) {
310 newActiveMasks = &m_activeAfter;
311 } else {
312 newActiveMasks = &m_activeBefore;
313 }
314
315 Q_FOREACH (KisSelectionMaskSP mask, *newActiveMasks) {
316 mask->setActive(true);
317 }
318 }

References KisCommandUtils::FlipFlopCommand::FINALIZING, KisCommandUtils::FlipFlopCommand::getState(), m_activeAfter, m_activeBefore, and KisSelectionMask::setActive().

Member Data Documentation

◆ m_activeAfter

QList<KisSelectionMaskSP> ActivateSelectionMasksCommand::m_activeAfter
private

Definition at line 322 of file kis_node_juggler_compressed.cpp.

◆ m_activeBefore

QList<KisSelectionMaskSP> ActivateSelectionMasksCommand::m_activeBefore
private

Definition at line 321 of file kis_node_juggler_compressed.cpp.


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