|
Krita Source Code Documentation
|
#include <EnhancedPathHandle.h>
Public Member Functions | |
| void | changePosition (const QPointF &position) |
| EnhancedPathHandle (EnhancedPathShape *parent) | |
| bool | hasPosition () const |
| Returns if the handle has valid positional parameters.S. | |
| QPointF | position () |
| void | setPolarCenter (EnhancedPathParameter *polarX, EnhancedPathParameter *polarY) |
| void | setPosition (EnhancedPathParameter *positionX, EnhancedPathParameter *positionY) |
| void | setRadiusRange (EnhancedPathParameter *minRadius, EnhancedPathParameter *maxRadius) |
| void | setRangeX (EnhancedPathParameter *minX, EnhancedPathParameter *maxX) |
| void | setRangeY (EnhancedPathParameter *minY, EnhancedPathParameter *maxY) |
| ~EnhancedPathHandle () | |
| Destroys the handle. | |
Private Member Functions | |
| bool | isPolar () const |
| Returns if handle is polar. | |
Private Attributes | |
| EnhancedPathParameter * | m_maximumX |
| the maximum x-coordinate | |
| EnhancedPathParameter * | m_maximumY |
| the maximum y-coordinate | |
| EnhancedPathParameter * | m_maxRadius |
| the maximum polar radius | |
| EnhancedPathParameter * | m_minimumX |
| the minimum x-coordinate | |
| EnhancedPathParameter * | m_minimumY |
| the minimum y-coordinate | |
| EnhancedPathParameter * | m_minRadius |
| the minimum polar radius | |
| EnhancedPathShape * | m_parent |
| the enhanced path shape owning this handle | |
| EnhancedPathParameter * | m_polarX |
| the polar center x-coordinate | |
| EnhancedPathParameter * | m_polarY |
| the polar center y-coordinate | |
| EnhancedPathParameter * | m_positionX |
| the position x-coordinate | |
| EnhancedPathParameter * | m_positionY |
| the position y-coordinate | |
An interaction handle used by the EnhancedPathShape for changing the shape interactively.
Definition at line 22 of file EnhancedPathHandle.h.
|
explicit |
Constructs a new empty handle;
Note that an empty handle is not valid, as long as there are no positional parameters set with setPosition.
Definition at line 17 of file EnhancedPathHandle.cpp.
References m_parent.
| EnhancedPathHandle::~EnhancedPathHandle | ( | ) |
| void EnhancedPathHandle::changePosition | ( | const QPointF & | position | ) |
Attempts to changes the position of the handle. Only the coordinates of the handle which reference a modifier can be changed. The new position is automatically stored into the modifier of the given enhanced path.
| position | the new position the handle to set |
| path | the enhanced path the handle is referenced from |
Definition at line 65 of file EnhancedPathHandle.cpp.
References EnhancedPathParameter::evaluate(), hasPosition(), isPolar(), m_maximumX, m_maximumY, m_maxRadius, m_minimumX, m_minimumY, m_minRadius, M_PI, m_polarX, m_polarY, m_positionX, m_positionY, EnhancedPathParameter::modify(), and position().
| bool EnhancedPathHandle::hasPosition | ( | ) | const |
Returns if the handle has valid positional parameters.S.
Definition at line 37 of file EnhancedPathHandle.cpp.
References m_positionX, and m_positionY.
|
private |
| QPointF EnhancedPathHandle::position | ( | ) |
Evaluates the position of the handle.
Definition at line 48 of file EnhancedPathHandle.cpp.
References EnhancedPathParameter::evaluate(), hasPosition(), isPolar(), M_PI, m_polarX, m_polarY, m_positionX, m_positionY, and position().
| void EnhancedPathHandle::setPolarCenter | ( | EnhancedPathParameter * | polarX, |
| EnhancedPathParameter * | polarY ) |
Sets the center of a polar handle.
If both parameters are valid pointers, then the handle behaves like a polar handle. This means the x-coordinate of the position represents an angle in degree and the y-coordinate a radius.
| polarX | the polar center x-coordinate |
| polarY | the polar center y-coordinate |
Definition at line 129 of file EnhancedPathHandle.cpp.
| void EnhancedPathHandle::setPosition | ( | EnhancedPathParameter * | positionX, |
| EnhancedPathParameter * | positionY ) |
Sets the positional parameters, making the handle valid.
It replaces the actual positional parameters.
| positionX | the x-coordinate of the handle position |
| positionY | the y-coordinate of the handle position |
Definition at line 42 of file EnhancedPathHandle.cpp.
References m_positionX, and m_positionY.
| void EnhancedPathHandle::setRadiusRange | ( | EnhancedPathParameter * | minRadius, |
| EnhancedPathParameter * | maxRadius ) |
Sets the range of the radius for polar handles.
| minRadius | the minimum polar radius |
| maxRadius | the maximum polar radius |
Definition at line 135 of file EnhancedPathHandle.cpp.
References m_maxRadius, and m_minRadius.
| void EnhancedPathHandle::setRangeX | ( | EnhancedPathParameter * | minX, |
| EnhancedPathParameter * | maxX ) |
Sets the range of the handles x-coordinate.
A zero pointer has the effect of no maximum/minimum value.
| minX | the minimum x-coordinate |
| maxX | the maximum x-coordinate |
Definition at line 117 of file EnhancedPathHandle.cpp.
References m_maximumX, and m_minimumX.
| void EnhancedPathHandle::setRangeY | ( | EnhancedPathParameter * | minY, |
| EnhancedPathParameter * | maxY ) |
Sets the range of the handles y-coordinate.
A zero pointer has the effect of no maximum/minimum value.
| minY | the minimum y-coordinate |
| maxY | the maximum y-coordinate |
Definition at line 123 of file EnhancedPathHandle.cpp.
References m_maximumY, and m_minimumY.
|
private |
the maximum x-coordinate
Definition at line 113 of file EnhancedPathHandle.h.
|
private |
the maximum y-coordinate
Definition at line 114 of file EnhancedPathHandle.h.
|
private |
the maximum polar radius
Definition at line 118 of file EnhancedPathHandle.h.
|
private |
the minimum x-coordinate
Definition at line 111 of file EnhancedPathHandle.h.
|
private |
the minimum y-coordinate
Definition at line 112 of file EnhancedPathHandle.h.
|
private |
the minimum polar radius
Definition at line 117 of file EnhancedPathHandle.h.
|
private |
the enhanced path shape owning this handle
Definition at line 108 of file EnhancedPathHandle.h.
|
private |
the polar center x-coordinate
Definition at line 115 of file EnhancedPathHandle.h.
|
private |
the polar center y-coordinate
Definition at line 116 of file EnhancedPathHandle.h.
|
private |
the position x-coordinate
Definition at line 109 of file EnhancedPathHandle.h.
|
private |
the position y-coordinate
Definition at line 110 of file EnhancedPathHandle.h.