#include <KoParameterShape.h>
Inheritance diagram for KoParameterShape:

Public Member Functions | |
| virtual void | moveHandle (int handleId, const QPointF &point, Qt::KeyboardModifiers modifiers=Qt::NoModifier) |
| Move handle to point. | |
| virtual int | handleIdAt (const QRectF &rect) const |
| Get the handleId in the rect. | |
| virtual QPointF | handlePosition (int handleId) |
| Get the handle position. | |
| virtual void | paintHandles (QPainter &painter, const KoViewConverter &converter, int handleRadius) |
| Paint the handles. | |
| virtual void | paintHandle (QPainter &painter, const KoViewConverter &converter, int handleId, int handleRadius) |
| Paint the given handles. | |
| virtual void | setSize (const QSizeF &size) |
| reimplemented | |
| bool | isParametricShape () const |
| Check if object is a parametric shape. | |
| void | setModified (bool modified) |
| Set the modified status. | |
| virtual QPointF | normalize () |
| Normalizes the path data. | |
Protected Member Functions | |
| 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. | |
Protected Attributes | |
| QList< QPointF > | m_handles |
| the handles that the user can grab and change | |
Parametric shapes are those whose appearance can be completely defined by a few numerical parameters. Rectangle, ellipse and star are examples of parametric shapes. In flake, these shape parameters can be manipulated visually by means of control points. These control points can be moved with the mouse on the canvas which changes the shapes parameter values and hence the shapes apperance in realtime. KoParameterShape is derived from the KoPathShape class that means by changing the shape parameters, the underlying path is manipulated. A parametric shape can be converted into a path shape by simply calling the setModified method. This makes the path tool know that it can handle the shape like a path shape, so that modifying the single path points is possible.
| int KoParameterShape::handleIdAt | ( | const QRectF & | rect | ) | const [virtual] |
Get the handleId in the rect.
| rect | in shape coordinates |
| QPointF KoParameterShape::handlePosition | ( | int | handleId | ) | [virtual] |
Get the handle position.
| handleId | for which ti get the position in shape coordinates |
| bool KoParameterShape::isParametricShape | ( | ) | const |
Check if object is a parametric shape.
It is no longer a parametric shape when the path was manipulated
| void KoParameterShape::moveHandle | ( | int | handleId, | |
| const QPointF & | point, | |||
| Qt::KeyboardModifiers | modifiers = Qt::NoModifier | |||
| ) | [virtual] |
Move handle to point.
This method calls moveHandleAction. Overload moveHandleAction to get the behaviour you want. After that updatePath and a repaint is called.
| handleId | of the handle | |
| point | to move the handle to in document coordinates | |
| modifiers | used during move to point |
| virtual void KoParameterShape::moveHandleAction | ( | int | handleId, | |
| const QPointF & | point, | |||
| Qt::KeyboardModifiers | modifiers = Qt::NoModifier | |||
| ) | [protected, pure virtual] |
Updates the internal state of a KoParameterShape.
This method is called from moveHandle.
| handleId | of the handle | |
| point | to move the handle to in shape coordinates | |
| modifiers | used during move to point |
| QPointF KoParameterShape::normalize | ( | ) | [virtual] |
Normalizes the path data.
The path points are transformed so that the top-left corner of the bounding rect is (0,0). This should be called after adding points to the path.
Reimplemented from KoPathShape.
| void KoParameterShape::paintHandle | ( | QPainter & | painter, | |
| const KoViewConverter & | converter, | |||
| int | handleId, | |||
| int | handleRadius | |||
| ) | [virtual] |
Paint the given handles.
| painter | the painter to paint the handles on | |
| converter | the view converter for applying the actual zoom | |
| handleId | of the handle which should be repainted | |
| handleRadius | the radius of the handle used for painting |
| void KoParameterShape::paintHandles | ( | QPainter & | painter, | |
| const KoViewConverter & | converter, | |||
| int | handleRadius | |||
| ) | [virtual] |
Paint the handles.
| painter | the painter to paint the handles on | |
| converter | the view converter for applying the actual zoom | |
| handleRadius | the radius of the handles used for painting |
| void KoParameterShape::setModified | ( | bool | modified | ) |
Set the modified status.
After the state is set to modified it is no longer possible to work with parameters on this shape.
| modified | the modification state |
| virtual void KoParameterShape::updatePath | ( | const QSizeF & | size | ) | [protected, pure virtual] |
Update the path of the parameter shape.
| size | of the shape |
1.4.7