Krita Source Code Documentation
Loading...
Searching...
No Matches
EnhancedPathCommand.h
Go to the documentation of this file.
1/* This file is part of the KDE project
2 * SPDX-FileCopyrightText: 2007 Jan Hambrecht <jaham@gmx.net>
3 *
4 * SPDX-License-Identifier: LGPL-2.0-or-later
5 */
6
7#ifndef KOENHANCEDPATHCOMMAND_H
8#define KOENHANCEDPATHCOMMAND_H
9
10#include <QChar>
11#include <QList>
12#include <QPointF>
13#include <QRectF>
14
17class KoPathPoint;
18
24{
25public:
27 EnhancedPathCommand(const QChar &command, EnhancedPathShape *parent);
30 bool execute();
32 void addParameter(EnhancedPathParameter *parameter);
34 QString toString() const;
35private:
39 qreal angleFromPoint(const QPointF &point) const;
41 qreal radSweepAngle(qreal start, qreal stop, bool clockwise) const;
43 qreal degSweepAngle(qreal start, qreal stop, bool clockwise) const;
47 QRectF rectFromPoints(const QPointF &tl, const QPointF &br) const;
48
49 QChar m_command;
52};
53
54#endif // KOENHANCEDPATHCOMMAND_H
bool execute()
Executes the command on the specified path shape.
QString toString() const
Returns a string representation of the command.
QChar m_command
the actual command
QRectF rectFromPoints(const QPointF &tl, const QPointF &br) const
Returns rectangle from given points.
EnhancedPathShape * m_parent
the enhanced path owning the command
KoPathPoint * lastPathPoint() const
Returns the last path point of given path.
EnhancedPathCommand(const QChar &command, EnhancedPathShape *parent)
Constructs a new command from the given command type.
QList< QPointF > pointsFromParameters()
Returns a list of points, created from the parameter list.
QList< EnhancedPathParameter * > m_parameters
the commands parameters
void addParameter(EnhancedPathParameter *parameter)
Adds a new parameter to the command.
qreal radSweepAngle(qreal start, qreal stop, bool clockwise) const
Returns sweep angle from start to stop and given direction.
qreal degSweepAngle(qreal start, qreal stop, bool clockwise) const
Returns sweep angle from start to stop and given direction.
qreal angleFromPoint(const QPointF &point) const
Calculates angle from given point.
The abstract parameter class.
A KoPathPoint represents a point in a path.