35 QPointF posTangentialCenter,
36 QPointF posTangentialHigh,
43 double angleRotation = -1.0 * m_graphicsItem->rotation();
44 QTransform rotateTransform;
45 rotateTransform.rotate (angleRotation);
46 QPointF posLowInEllipseFrame = rotateTransform.map (posTangentialLow);
47 QPointF posCenterInEllipseFrame = rotateTransform.map (posTangentialCenter);
48 QPointF posHighInEllipseFrame = rotateTransform.map (posTangentialHigh);
51 double angleLow = -1.0 * qAtan2 (posLowInEllipseFrame.y() * widthToHeight,
52 posLowInEllipseFrame.x());
53 double angleCenter = -1.0 * qAtan2 (posCenterInEllipseFrame.y() * widthToHeight,
54 posCenterInEllipseFrame.x());
55 double angleHigh = -1.0 * qAtan2 (posHighInEllipseFrame.y() * widthToHeight,
56 posHighInEllipseFrame.x());
58 int lowTics = (int) (
RADIANS_TO_TICS * (angleCenter + scaling * (angleLow - angleCenter)));
59 int highTics = (int) (
RADIANS_TO_TICS * (angleCenter + scaling * (angleHigh - angleCenter)));
61 m_graphicsItem->setStartAngle (lowTics);
62 m_graphicsItem->setSpanAngle (highTics - lowTics);
void slotUpdateAngles(QPointF posTangentialLow, QPointF posTangentialCenter, QPointF posTangentialHigh, double widthToHeight, double scaling)
Slot inputs to QGraphicsEllipseItem::setStartAngle and QGraphicsEllipseItem::setSpanAngle.