]> Shamusworld >> Repos - architektonas/blobdiff - src/dimension.cpp
Fix for missing ampersand in QApplication.
[architektonas] / src / dimension.cpp
index 4ccd48e52352e97ad69938f3873b0090221fc11e..26a39f5d29d9b4c001a47e5d79c4b793336ed203 100644 (file)
@@ -4,7 +4,7 @@
 // (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
 // ---  ----------  ------------------------------------------------------------
@@ -56,24 +56,30 @@ Dimension::~Dimension()
        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 !!!
@@ -323,6 +329,16 @@ void Dimension::SetPoint2(Vector * v)
        needUpdate = true;
 }
 
+Vector Dimension::GetPoint1(void)
+{
+       return position;
+}
+
+Vector Dimension::GetPoint2(void)
+{
+       return endpoint;
+}
+
 void Dimension::FlipSides(void)
 {
 #if 0
@@ -336,3 +352,4 @@ void Dimension::FlipSides(void)
 #endif
        needUpdate = true;
 }
+