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

The undo / redo command for configuring a spiral shape. More...

#include <SpiralShapeConfigCommand.h>

+ Inheritance diagram for SpiralShapeConfigCommand:

Public Member Functions

void redo () override
 redo the command
 
 SpiralShapeConfigCommand (SpiralShape *spiral, SpiralShape::SpiralType type, bool clockWise, qreal fade, KUndo2Command *parent=0)
 
void undo () override
 revert the actions done in redo
 
- 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 ()
 

Private Attributes

bool m_newClockWise
 
qreal m_newFade
 
SpiralShape::SpiralType m_newType
 
bool m_oldClockWise
 
qreal m_oldFade
 
SpiralShape::SpiralType m_oldType
 
SpiralShapem_spiral
 

Detailed Description

The undo / redo command for configuring a spiral shape.

Definition at line 14 of file SpiralShapeConfigCommand.h.

Constructor & Destructor Documentation

◆ SpiralShapeConfigCommand()

SpiralShapeConfigCommand::SpiralShapeConfigCommand ( SpiralShape * spiral,
SpiralShape::SpiralType type,
bool clockWise,
qreal fade,
KUndo2Command * parent = 0 )

Configures an spiral shape

Parameters
spiralthe spiral shape to configure
typethe spiral type
fadethe fade parameter
parentthe optional parent command

Definition at line 10 of file SpiralShapeConfigCommand.cpp.

11 : KUndo2Command(parent)
12 , m_spiral(spiral)
13 , m_newType(type)
14 , m_newClockWise(clockWise)
15 , m_newFade(fade)
16{
17 Q_ASSERT(m_spiral);
18
19 setText(kundo2_i18n("Change spiral"));
20
24}
void setText(const KUndo2MagicString &text)
KUndo2Command(KUndo2Command *parent=0)
SpiralShape::SpiralType m_oldType
SpiralShape::SpiralType m_newType
bool clockWise() const
qreal fade() const
Returns the actual fade parameter.
SpiralType type() const
Returns the actual spiral type.
KUndo2MagicString kundo2_i18n(const char *text)

References SpiralShape::clockWise(), SpiralShape::fade(), kundo2_i18n(), m_oldClockWise, m_oldFade, m_oldType, m_spiral, KUndo2Command::setText(), and SpiralShape::type().

Member Function Documentation

◆ redo()

void SpiralShapeConfigCommand::redo ( )
overridevirtual

redo the command

Reimplemented from KUndo2Command.

Definition at line 26 of file SpiralShapeConfigCommand.cpp.

27{
29
31
32 if (m_oldType != m_newType) {
34 }
37 }
38 if (m_oldFade != m_newFade) {
40 }
41
43}
virtual void redo()
void update() const override
reimplemented
void setType(SpiralType type)
void setClockWise(bool clockwise)
void setFade(qreal fade)

References m_newClockWise, m_newFade, m_newType, m_oldClockWise, m_oldFade, m_oldType, m_spiral, KUndo2Command::redo(), SpiralShape::setClockWise(), SpiralShape::setFade(), SpiralShape::setType(), and KoShapeContainer::update().

◆ undo()

void SpiralShapeConfigCommand::undo ( )
overridevirtual

Member Data Documentation

◆ m_newClockWise

bool SpiralShapeConfigCommand::m_newClockWise
private

Definition at line 35 of file SpiralShapeConfigCommand.h.

◆ m_newFade

qreal SpiralShapeConfigCommand::m_newFade
private

Definition at line 36 of file SpiralShapeConfigCommand.h.

◆ m_newType

SpiralShape::SpiralType SpiralShapeConfigCommand::m_newType
private

Definition at line 34 of file SpiralShapeConfigCommand.h.

◆ m_oldClockWise

bool SpiralShapeConfigCommand::m_oldClockWise
private

Definition at line 32 of file SpiralShapeConfigCommand.h.

◆ m_oldFade

qreal SpiralShapeConfigCommand::m_oldFade
private

Definition at line 33 of file SpiralShapeConfigCommand.h.

◆ m_oldType

SpiralShape::SpiralType SpiralShapeConfigCommand::m_oldType
private

Definition at line 31 of file SpiralShapeConfigCommand.h.

◆ m_spiral

SpiralShape* SpiralShapeConfigCommand::m_spiral
private

Definition at line 30 of file SpiralShapeConfigCommand.h.


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