16KoParameterShape::Private::Private()
22KoParameterShape::Private::Private(
const Private &rhs)
24 , parametric(rhs.parametric)
25 , handles(rhs.handles)
48 if (handleId >=
d->handles.size()) {
67 for (
int i = 0; i <
d->handles.size(); ++i) {
68 if (
rect.contains(
d->handles.at(i))) {
79 return d->handles.value(handleId);
87 for (; it !=
d->handles.constEnd(); ++it) {
103 for (
int i = 0; i <
d->handles.size(); ++i) {
104 d->handles[i] = matrix.map(
d->handles[i]);
115 matrix.translate(-offset.x(), -offset.y());
117 for (
int i = 0; i <
d->handles.size(); ++i) {
118 d->handles[i] = matrix.map(
d->handles[i]);
127 return d->parametric;
154 return d->handles.count();
The KisHandlePainterHelper class is a special helper for painting handles around objects....
void drawGradientHandle(const QPointF ¢er, qreal radius)
QSharedDataPointer< Private > d
QPointF normalize() override
Normalizes the path data.
void paintHandles(KisHandlePainterHelper &handlesHelper)
Paint the handles.
void paintHandle(KisHandlePainterHelper &handlesHelper, int handleId)
Paint the given handles.
void moveHandle(int handleId, const QPointF &point, Qt::KeyboardModifiers modifiers=Qt::NoModifier)
Move handle to point.
QList< QPointF > handles
the handles that the user can grab and change
~KoParameterShape() override
int handleCount() const
return the number of handles set on the shape
void setSize(const QSizeF &size) override
reimplemented from KoShape
QPointF handlePosition(int handleId) const
Get the handle position.
void setHandles(const QList< QPointF > &handles)
void setParametricShape(bool parametric)
Set if the shape can be modified using parameters.
virtual void moveHandleAction(int handleId, const QPointF &point, Qt::KeyboardModifiers modifiers=Qt::NoModifier)=0
Updates the internal state of a KoParameterShape.
virtual void updatePath(const QSizeF &size)=0
Update the path of the parameter shape.
bool isParametricShape() const
Check if object is a parametric shape.
int handleIdAt(const QRectF &rect) const
Get the id of the handle within the given rect.
The position of a path point within a path shape.
QTransform resizeMatrix(const QSizeF &newSize) const
virtual QPointF normalize()
Normalizes the path data.
QSizeF size() const override
reimplemented
void setSize(const QSizeF &size) override
QScopedPointer< Private > d
void update() const override
reimplemented
QPointF documentToShape(const QPointF &point) const
Transforms point from document coordinates to shape coordinates.
void shapeChangedPriv(KoShape::ChangeType type)
@ ParameterChanged
the shapes parameter has changed (KoParameterShape only)