+// This function is for drawing object handles without regard for zoom level;
+// we don't want our object handle size to depend on the zoom level!
+void Painter::DrawSmallHandle(Vector center)
+{
+ if (!painter)
+ return;
+
+ center = CartesianToQtCoords(center);
+ painter->setPen(QPen(Qt::red, 2.0, Qt::DotLine));
+ painter->setBrush(Qt::NoBrush);
+ painter->drawEllipse(QPointF(center.x, center.y), 2.0, 2.0);
+}
+
+// This function is for drawing feedback points without regard for zoom level;
+// we don't want our feedback point size to depend on the zoom level!
+void Painter::DrawCross(Vector point)
+{
+ if (!painter)
+ return;
+
+ point = CartesianToQtCoords(point);
+ painter->setPen(QPen(Qt::red, 2.0, Qt::SolidLine));
+ painter->drawLine(point.x - 8.0, point.y, point.x + 8.0, point.y);
+ painter->drawLine(point.x, point.y - 8.0, point.x, point.y + 8.0);
+}
+
+// This function is for drawing feedback points without regard for zoom level;
+// we don't want our feedback point size to depend on the zoom level!
+void Painter::DrawRectCorners(Rect rect)
+{
+ if (!painter)
+ return;
+
+ Vector v1 = CartesianToQtCoords(Vector(rect.l, rect.t));
+ Vector v2 = CartesianToQtCoords(Vector(rect.r, rect.b));
+ v1 += Vector(-8.0, -8.0);
+ v2 += Vector(+8.0, +8.0);
+ painter->setPen(QPen(Qt::red, 2.0, Qt::DashLine));
+ painter->drawLine(v1.x, v1.y, v1.x + 24, v1.y);
+ painter->drawLine(v1.x, v1.y, v1.x, v1.y + 24);
+ painter->drawLine(v2.x, v1.y, v2.x - 24, v1.y);
+ painter->drawLine(v2.x, v1.y, v2.x, v1.y + 24);
+ painter->drawLine(v2.x, v2.y, v2.x - 24, v2.y);
+ painter->drawLine(v2.x, v2.y, v2.x, v2.y - 24);
+ painter->drawLine(v1.x, v2.y, v1.x + 24, v2.y);
+ painter->drawLine(v1.x, v2.y, v1.x, v2.y - 24);
+
+}
+
+// This function is for drawing object handles without regard for zoom level;
+// we don't want our object handle size to depend on the zoom level!
+void Painter::DrawArrowHandle(Vector center, double angle)
+{
+ if (!painter)
+ return;
+
+ center = CartesianToQtCoords(center);
+ QPolygonF arrow;
+
+ // Since we're drawing directly on the screen, the Y is inverted. So we use
+ // the mirror of the angle.
+ double orthoAngle = -angle + QTR_TAU;
+ Vector orthogonal = Vector(cos(orthoAngle), sin(orthoAngle));
+ Vector unit = Vector(cos(-angle), sin(-angle));
+
+ Point p0 = center + (unit * 6.0);
+ Point p1 = center + (unit * 21.0);
+ Point p1b = center + (unit * 11.0);
+ Point p2 = p1b + (orthogonal * 5.0);
+ Point p3 = p1b - (orthogonal * 5.0);
+
+ painter->drawLine(p0.x, p0.y, p1.x, p1.y);
+ arrow << QPointF(p1.x, p1.y) << QPointF(p2.x, p2.y) << QPointF(p3.x, p3.y);
+
+ painter->drawPolygon(arrow);
+}
+
+// This function is for drawing object handles without regard for zoom level;
+// we don't want our object handle size to depend on the zoom level!
+void Painter::DrawArrowToLineHandle(Vector center, double angle)
+{
+ if (!painter)
+ return;
+
+ DrawArrowHandle(center, angle);
+ center = CartesianToQtCoords(center);
+
+ // Since we're drawing directly on the screen, the Y is inverted. So we use
+ // the mirror of the angle.
+ double orthoAngle = -angle + QTR_TAU;
+ Vector orthogonal = Vector(cos(orthoAngle), sin(orthoAngle));
+ Vector unit = Vector(cos(-angle), sin(-angle));
+
+ Point p1 = center + (unit * 21.0);
+ Point p2 = p1 + (orthogonal * 7.0);
+ Point p3 = p1 - (orthogonal * 7.0);
+
+ painter->drawLine(p2.x, p2.y, p3.x, p3.y);
+}
+