// (C) 2011 Underground Software
// See the README and GPLv3 files for licensing and warranty information
//
-// JLH = James L. Hammons <jlhamm@acm.org>
+// JLH = James Hammons <jlhamm@acm.org>
//
// WHO WHEN WHAT
// --- ---------- ------------------------------------------------------------
Vector orthogonal = Vector(cos(orthoAngle), sin(orthoAngle));
Vector unit = Vector(endpoint - position).Unit();
+//NOTE: SCREEN_ZOOM is our kludge factor... We need to figure out a better
+// way of doing this...
// Get our line parallel to our points
- Point p1 = position + (orthogonal * 10.0);
- Point p2 = endpoint + (orthogonal * 10.0);
+ Point p1 = position + (orthogonal * 10.0 * SCREEN_ZOOM);
+ Point p2 = endpoint + (orthogonal * 10.0 * SCREEN_ZOOM);
// Draw main dimension line
painter->DrawLine(p1, p2);
- Point p3 = position + (orthogonal * 16.0);
- Point p4 = endpoint + (orthogonal * 16.0);
- Point p5 = position + (orthogonal * 4.0);
- Point p6 = endpoint + (orthogonal * 4.0);
+ Point p3 = position + (orthogonal * 16.0 * SCREEN_ZOOM);
+ Point p4 = endpoint + (orthogonal * 16.0 * SCREEN_ZOOM);
+ Point p5 = position + (orthogonal * 4.0 * SCREEN_ZOOM);
+ Point p6 = endpoint + (orthogonal * 4.0 * SCREEN_ZOOM);
// Draw extension lines
painter->DrawLine(p3, p5);
painter->DrawLine(p4, p6);
+ painter->SetBrush(QBrush(QColor(Qt::blue)));
+ painter->DrawArrowhead(p1, p2);
+ painter->DrawArrowhead(p2, p1);
+
// Draw length of dimension line...
- painter->SetFont(QFont("Arial", 10));
+ painter->SetFont(QFont("Arial", 10.0 * Painter::zoom * SCREEN_ZOOM));
Vector v1((p1.x - p2.x) / 2.0, (p1.y - p2.y) / 2.0);
Point ctr = p2 + v1;
// This is in pixels, which isn't even remotely correct... !!! FIX !!!
needUpdate = true;
}
+Vector Dimension::GetPoint1(void)
+{
+ return position;
+}
+
+Vector Dimension::GetPoint2(void)
+{
+ return endpoint;
+}
+
void Dimension::FlipSides(void)
{
#if 0
#endif
needUpdate = true;
}
+