X-Git-Url: http://shamusworld.gotdns.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fdimension.cpp;h=26a39f5d29d9b4c001a47e5d79c4b793336ed203;hb=5446001bd9adfd9f4787f5de5a2a7afd8d7cdb5a;hp=9ba0ed5a0b82638e67e4705b75d777add76129da;hpb=043ecf4d074909ba2f7f53237962f9eaa72f19c2;p=architektonas diff --git a/src/dimension.cpp b/src/dimension.cpp index 9ba0ed5..26a39f5 100644 --- a/src/dimension.cpp +++ b/src/dimension.cpp @@ -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; } +