- document.Add(new Line(Vector(5, 5), Vector(50, 40), &document));
+ Line * line = new Line(Vector(5, 5), Vector(50, 40), &document);
+ document.Add(line);
document.Add(new Line(Vector(50, 40), Vector(10, 83), &document));
document.Add(new Line(Vector(10, 83), Vector(17, 2), &document));
document.Add(new Circle(Vector(100, 100), 36, &document));
document.Add(new Circle(Vector(50, 150), 49, &document));
document.Add(new Arc(Vector(300, 300), 32, PI / 4.0, PI * 1.3, &document)),
document.Add(new Arc(Vector(200, 200), 60, PI / 2.0, PI * 1.5, &document));
document.Add(new Line(Vector(50, 40), Vector(10, 83), &document));
document.Add(new Line(Vector(10, 83), Vector(17, 2), &document));
document.Add(new Circle(Vector(100, 100), 36, &document));
document.Add(new Circle(Vector(50, 150), 49, &document));
document.Add(new Arc(Vector(300, 300), 32, PI / 4.0, PI * 1.3, &document)),
document.Add(new Arc(Vector(200, 200), 60, PI / 2.0, PI * 1.5, &document));
- document.Add(new Dimension(Vector(5, 5), Vector(50, 40), &document));
+#if 1
+ Dimension * dimension = new Dimension(Vector(0, 0), Vector(0, 0), &document);
+ line->SetDimensionOnLine(dimension);
+// line->SetDimensionOnPoint2(dimension);
+ document.Add(dimension);
+#else
+ // Alternate way to do the above...
+ line->SetDimensionOnLine();
+#endif
// snap to the one before it. So we add half of the grid spacing to the
// point, then divide by it so that we can remove the fractional part, then
// multiply it back to get back to the correct answer.
// snap to the one before it. So we add half of the grid spacing to the
// point, then divide by it so that we can remove the fractional part, then
// multiply it back to get back to the correct answer.
- point += gridSpacing / 2.0; // *This* adds to Z!!!
- point /= gridSpacing;
- point.x = floor(point.x);//need to fix this for negative numbers...
- point.y = floor(point.y);
- point.z = 0; // Make *sure* Z doesn't go anywhere!!!
- point *= gridSpacing;
+ if (event->buttons() & Qt::LeftButton)
+ {
+ point += gridSpacing / 2.0; // *This* adds to Z!!!
+ point /= gridSpacing;
+ point.x = floor(point.x);//need to fix this for negative numbers...
+ point.y = floor(point.y);
+ point.z = 0; // Make *sure* Z doesn't go anywhere!!!
+ point *= gridSpacing;
+ }