|
Krita Source Code Documentation
|
#include <EnhancedPathCommand.h>
Public Member Functions | |
| void | addParameter (EnhancedPathParameter *parameter) |
| Adds a new parameter to the command. | |
| EnhancedPathCommand (const QChar &command, EnhancedPathShape *parent) | |
| Constructs a new command from the given command type. | |
| bool | execute () |
| Executes the command on the specified path shape. | |
| QString | toString () const |
| Returns a string representation of the command. | |
| ~EnhancedPathCommand () | |
Private Member Functions | |
| qreal | angleFromPoint (const QPointF &point) const |
| Calculates angle from given point. | |
| qreal | degSweepAngle (qreal start, qreal stop, bool clockwise) const |
| Returns sweep angle from start to stop and given direction. | |
| KoPathPoint * | lastPathPoint () const |
| Returns the last path point of given path. | |
| QList< QPointF > | pointsFromParameters () |
| Returns a list of points, created from the parameter list. | |
| qreal | radSweepAngle (qreal start, qreal stop, bool clockwise) const |
| Returns sweep angle from start to stop and given direction. | |
| QRectF | rectFromPoints (const QPointF &tl, const QPointF &br) const |
| Returns rectangle from given points. | |
Private Attributes | |
| QChar | m_command |
| the actual command | |
| QList< EnhancedPathParameter * > | m_parameters |
| the commands parameters | |
| EnhancedPathShape * | m_parent |
| the enhanced path owning the command | |
A EnhancedPathCommand is a command like moveto, curveto, etc. that directly modifies an enhanced paths outline.
Definition at line 23 of file EnhancedPathCommand.h.
| EnhancedPathCommand::EnhancedPathCommand | ( | const QChar & | command, |
| EnhancedPathShape * | parent ) |
Constructs a new command from the given command type.
Definition at line 18 of file EnhancedPathCommand.cpp.
References m_parent.
| EnhancedPathCommand::~EnhancedPathCommand | ( | ) |
Definition at line 25 of file EnhancedPathCommand.cpp.
| void EnhancedPathCommand::addParameter | ( | EnhancedPathParameter * | parameter | ) |
Adds a new parameter to the command.
Definition at line 234 of file EnhancedPathCommand.cpp.
References m_parameters.
|
private |
Calculates angle from given point.
Definition at line 241 of file EnhancedPathCommand.cpp.
References M_PI.
|
private |
Returns sweep angle from start to stop and given direction.
Definition at line 272 of file EnhancedPathCommand.cpp.
| bool EnhancedPathCommand::execute | ( | ) |
Executes the command on the specified path shape.
Definition at line 29 of file EnhancedPathCommand.cpp.
References angleFromPoint(), KoPathShape::arcTo(), KoPathShape::close(), KoPathShape::curveTo(), degSweepAngle(), KoPathShape::isClosedSubpath(), lastPathPoint(), KoPathShape::lineTo(), m_command, m_parent, M_PI, KoPathShape::moveTo(), KoPathPoint::point, pointsFromParameters(), rad2deg, radSweepAngle(), rectFromPoints(), and KoPathShape::subpathCount().
|
private |
Returns the last path point of given path.
Definition at line 293 of file EnhancedPathCommand.cpp.
References m_parent, KoPathShape::pointByIndex(), KoPathShape::subpathCount(), and KoPathShape::subpathPointCount().
|
private |
Returns a list of points, created from the parameter list.
Definition at line 204 of file EnhancedPathCommand.cpp.
References m_command, m_parameters, and p.
|
private |
Returns sweep angle from start to stop and given direction.
Definition at line 251 of file EnhancedPathCommand.cpp.
References M_PI.
|
private |
Returns rectangle from given points.
Definition at line 304 of file EnhancedPathCommand.cpp.
| QString EnhancedPathCommand::toString | ( | ) | const |
Returns a string representation of the command.
Definition at line 309 of file EnhancedPathCommand.cpp.
References m_command, m_parameters, and p.
|
private |
the actual command
Definition at line 49 of file EnhancedPathCommand.h.
|
private |
the commands parameters
Definition at line 50 of file EnhancedPathCommand.h.
|
private |
the enhanced path owning the command
Definition at line 51 of file EnhancedPathCommand.h.