|
Krita Source Code Documentation
|
The undo / redo command for inserting path points. More...
#include <KoPathPointInsertCommand.h>
Inheritance diagram for KoPathPointInsertCommand:Public Member Functions | |
| QList< KoPathPoint * > | insertedPoints () const |
| Returns list of inserted points. | |
| KoPathPointInsertCommand (const QList< KoPathPointData > &pointDataList, qreal insertPosition, KUndo2Command *parent=0) | |
| void | redo () override |
| redo the command | |
| void | undo () override |
| revert the actions done in redo | |
| ~KoPathPointInsertCommand () 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 | |
| KoPathPointInsertCommandPrivate *const | d |
The undo / redo command for inserting path points.
Definition at line 20 of file KoPathPointInsertCommand.h.
| KoPathPointInsertCommand::KoPathPointInsertCommand | ( | const QList< KoPathPointData > & | pointDataList, |
| qreal | insertPosition, | ||
| KUndo2Command * | parent = 0 ) |
Command to insert path points.
This splits the segments at the given position by inserting new points. The De Casteljau algorithm is used for calculating the position of the new points.
| pointDataList | describing the segments to split |
| insertPosition | the position to insert at [0..1] |
| parent | the parent command used for macro commands |
Definition at line 29 of file KoPathPointInsertCommand.cpp.
References KoPathPoint::activeControlPoint1, KoPathPoint::activeControlPoint2, KoPathPoint::controlPoint1, KoPathPoint::controlPoint2, KoPathPointInsertCommandPrivate::controlPoints, d, KoPathSegment::isValid(), kundo2_i18n(), KoPathPoint::point, KoPathPointInsertCommandPrivate::pointDataList, KoPathPointInsertCommandPrivate::points, KoPathShape::segmentByIndex(), KoPathPoint::setControlPoint1(), KoPathPoint::setControlPoint2(), KUndo2Command::setText(), and KoPathSegment::splitAt().
|
override |
| QList< KoPathPoint * > KoPathPointInsertCommand::insertedPoints | ( | ) | const |
Returns list of inserted points.
Definition at line 150 of file KoPathPointInsertCommand.cpp.
References d, and KoPathPointInsertCommandPrivate::points.
|
overridevirtual |
redo the command
Reimplemented from KUndo2Command.
Definition at line 75 of file KoPathPointInsertCommand.cpp.
References KoPathPoint::activeControlPoint1, KoPathPoint::activeControlPoint2, KoPathPoint::controlPoint1, KoPathPoint::controlPoint2, KoPathPointInsertCommandPrivate::controlPoints, d, KoPathPointInsertCommandPrivate::deletePoints, KoPathSegment::first, KoPathShape::insertPoint(), KoPathPointData::pathShape, KoPathPointInsertCommandPrivate::pointDataList, KoPathPointData::pointIndex, KoPathPointInsertCommandPrivate::points, KoPathShape::recommendPointSelectionChange(), KUndo2Command::redo(), KoPathSegment::second, KoPathShape::segmentByIndex(), KoPathPoint::setControlPoint1(), KoPathPoint::setControlPoint2(), and KoShapeContainer::update().
|
overridevirtual |
revert the actions done in redo
Reimplemented from KUndo2Command.
Definition at line 105 of file KoPathPointInsertCommand.cpp.
References KoPathPoint::activeControlPoint1, KoPathPoint::activeControlPoint2, KoPathPoint::CloseSubpath, KoPathPoint::controlPoint1, KoPathPoint::controlPoint2, KoPathPointInsertCommandPrivate::controlPoints, d, KoPathPointInsertCommandPrivate::deletePoints, KoPathPointData::pathShape, KoPathShape::pointByIndex(), KoPathPointInsertCommandPrivate::pointDataList, KoPathPointData::pointIndex, KoPathPointInsertCommandPrivate::points, KoPathShape::recommendPointSelectionChange(), KoPathShape::removePoint(), KoPathPoint::setControlPoint1(), KoPathPoint::setControlPoint2(), KUndo2Command::undo(), and KoShapeContainer::update().
|
private |
Definition at line 46 of file KoPathPointInsertCommand.h.