59 position = center +
position.y() * QPointF(cos(angleInRadian), sin(angleInRadian));
71 QPointF constrainedPosition(
position);
76 QPointF diff = constrainedPosition - polarCenter;
78 qreal radius = sqrt(diff.x() * diff.x() + diff.y() * diff.y());
80 qreal angle = atan2(diff.y(), diff.x());
93 constrainedPosition.setX(angle * 180.0 /
M_PI);
94 constrainedPosition.setY(radius);
EnhancedPathParameter * m_positionY
the position y-coordinate
bool hasPosition() const
Returns if the handle has valid positional parameters.S.
void setPolarCenter(EnhancedPathParameter *polarX, EnhancedPathParameter *polarY)
EnhancedPathParameter * m_polarY
the polar center y-coordinate
~EnhancedPathHandle()
Destroys the handle.
void changePosition(const QPointF &position)
EnhancedPathParameter * m_minRadius
the minimum polar radius
void setPosition(EnhancedPathParameter *positionX, EnhancedPathParameter *positionY)
bool isPolar() const
Returns if handle is polar.
EnhancedPathParameter * m_positionX
the position x-coordinate
EnhancedPathParameter * m_maximumX
the maximum x-coordinate
void setRangeX(EnhancedPathParameter *minX, EnhancedPathParameter *maxX)
void setRangeY(EnhancedPathParameter *minY, EnhancedPathParameter *maxY)
EnhancedPathShape * m_parent
the enhanced path shape owning this handle
void setRadiusRange(EnhancedPathParameter *minRadius, EnhancedPathParameter *maxRadius)
EnhancedPathParameter * m_minimumY
the minimum y-coordinate
EnhancedPathHandle(EnhancedPathShape *parent)
EnhancedPathParameter * m_polarX
the polar center x-coordinate
EnhancedPathParameter * m_maxRadius
the maximum polar radius
EnhancedPathParameter * m_maximumY
the maximum y-coordinate
EnhancedPathParameter * m_minimumX
the minimum x-coordinate
The abstract parameter class.
virtual qreal evaluate()=0
evaluates the parameter using the given path
virtual void modify(qreal value)
modifies the parameter if possible, using the new value