23 const QRectF &sceneRect,
24 double thetaGraphDegrees)
26 QPointF posGraphBL, posGraphTL, posGraphTR, posGraphBR;
36 QPointF anglesLeft (qMin (posGraphBL.x(), posGraphTL.x()),
37 qMax (posGraphBL.x(), posGraphTL.x()));
38 QPointF anglesTop (qMin (posGraphTL.x(), posGraphTR.x()),
39 qMax (posGraphTL.x(), posGraphTR.x()));
40 QPointF anglesRight (qMin (posGraphTR.x(), posGraphBR.x()),
41 qMax (posGraphTR.x(), posGraphBR.x()));
42 QPointF anglesBottom (qMin (posGraphBR.x(), posGraphBL.x()),
43 qMax (posGraphBR.x(), posGraphBL.x()));
46 if (qAbs (anglesLeft.y() - anglesLeft.x()) > 180.0) {
47 double temp = anglesLeft.x();
48 anglesLeft.setX (anglesLeft.y());
49 anglesLeft.setY (temp + 360.0);
51 if (qAbs (anglesTop.y() - anglesTop.x()) > 180.0) {
52 double temp = anglesTop.x();
53 anglesTop.setX (anglesTop.y());
54 anglesTop.setY (temp + 360.0);
56 if (qAbs (anglesRight.y() - anglesRight.x()) > 180.0) {
57 double temp = anglesRight.x();
58 anglesRight.setX (anglesRight.y());
59 anglesRight.setY (temp + 360.0);
61 if (qAbs (anglesBottom.y() - anglesBottom.x()) > 180.0) {
62 double temp = anglesBottom.x();
63 anglesBottom.setX (anglesBottom.y());
64 anglesBottom.setY (temp + 360.0);
69 double thetaGraphPlus = thetaGraphDegrees + 360.0;
70 if ((anglesLeft.x() <= thetaGraphDegrees && thetaGraphDegrees <= anglesLeft.y()) ||
71 (anglesLeft.x() <= thetaGraphPlus && thetaGraphPlus <= anglesLeft.y())) {
74 line = intersect (transformation,
79 }
else if ((anglesTop.x() <= thetaGraphDegrees && thetaGraphDegrees <= anglesTop.y()) ||
80 (anglesTop.x() <= thetaGraphPlus && thetaGraphPlus <= anglesTop.y())) {
83 line = intersect (transformation,
88 }
else if ((anglesRight.x() <= thetaGraphDegrees && thetaGraphDegrees <= anglesRight.y()) ||
89 (anglesRight.x() <= thetaGraphPlus && thetaGraphPlus <= anglesRight.y())) {
92 line = intersect (transformation,
100 line = intersect (transformation,
void calculateCorners(const Transformation &transformation, const QRectF &sceneRect, QPointF &posGraphBL, QPointF &posGraphTL, QPointF &posGraphTR, QPointF &posGraphBR) const
Conpute four corners of scene in graph coordinates.