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

the base command for commands altering a path shape More...

#include <KoPathBaseCommand.h>

+ Inheritance diagram for KoPathBaseCommand:

Public Member Functions

 KoPathBaseCommand (KoPathShape *shape, KUndo2Command *parent=0)
 
 KoPathBaseCommand (KUndo2Command *parent=0)
 
- 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 redo ()
 
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 undo ()
 
virtual void undoMergedCommands ()
 
virtual ~KUndo2Command ()
 

Protected Member Functions

void repaint (bool normalizeShapes)
 

Protected Attributes

QSet< KoPathShape * > m_shapes
 the shapes the command operates on
 

Detailed Description

the base command for commands altering a path shape

Definition at line 17 of file KoPathBaseCommand.h.

Constructor & Destructor Documentation

◆ KoPathBaseCommand() [1/2]

KoPathBaseCommand::KoPathBaseCommand ( KUndo2Command * parent = 0)
explicit
Parameters
parentthe parent command used for macro commands

Definition at line 11 of file KoPathBaseCommand.cpp.

12 : KUndo2Command(parent)
13{
14}
KUndo2Command(KUndo2Command *parent=0)

◆ KoPathBaseCommand() [2/2]

KoPathBaseCommand::KoPathBaseCommand ( KoPathShape * shape,
KUndo2Command * parent = 0 )
explicit

initialize the base command with a single shape

Parameters
shapethe shape
parentthe parent command used for macro commands

Definition at line 16 of file KoPathBaseCommand.cpp.

17 : KUndo2Command(parent)
18{
19 m_shapes.insert(shape);
20}
QSet< KoPathShape * > m_shapes
the shapes the command operates on

References m_shapes.

Member Function Documentation

◆ repaint()

void KoPathBaseCommand::repaint ( bool normalizeShapes)
protected

Schedules repainting of all shapes control point rects.

Parameters
normalizeShapescontrols if paths are normalized before painting

Definition at line 22 of file KoPathBaseCommand.cpp.

23{
24 Q_FOREACH (KoPathShape *shape, m_shapes) {
25 if (normalizeShapes)
26 shape->normalize();
27 shape->update();
28 }
29}
The position of a path point within a path shape.
Definition KoPathShape.h:63
virtual QPointF normalize()
Normalizes the path data.
void update() const override
reimplemented

References m_shapes, KoPathShape::normalize(), and KoShapeContainer::update().

Member Data Documentation

◆ m_shapes

QSet<KoPathShape*> KoPathBaseCommand::m_shapes
protected

the shapes the command operates on

Definition at line 38 of file KoPathBaseCommand.h.


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