#include "arc.h"
#include <QtGui>
+#include "geometry.h"
#include "mathconstants.h"
#include "painter.h"
/*virtual*/ bool Arc::Collided(Vector point)
{
+ // Someone told us to fuck off, so we'll fuck off. :-)
+ if (ignoreClicks)
+ return false;
+
objectWasDragged = false;
bool hitSomething = HitTest(point);
draggingCenter = hitCenter;
/*virtual*/ void Arc::Enumerate(FILE * file)
{
- fprintf(file, "ARC (%lf,%lf) %lf, %lf, %lf\n", position.x, position.y, radius, startAngle, angleSpan);
+ fprintf(file, "ARC %i (%lf,%lf) %lf, %lf, %lf\n", layer, position.x, position.y, radius, startAngle, angleSpan);
}
return new Arc(position, radius, startAngle, angleSpan, parent);
}
+
+/*virtual*/ void Arc::Mirror(Point p1, Point p2)
+{
+ Point c1 = Geometry::MirrorPointAroundLine(position, p1, p2);
+ Point ap1(cos(startAngle + angleSpan), sin(startAngle + angleSpan));
+ Point angleEndPoint = (ap1 * radius) + position;
+ Point c2 = Geometry::MirrorPointAroundLine(angleEndPoint, p1, p2);
+
+ position = c1;
+ startAngle = Vector(c2, c1).Angle();
+}
+
+
+/*virtual*/ void Arc::Save(void)
+{
+ Object::Save();
+ oldRadius2 = radius;
+ oldStartAngle = startAngle;
+ oldAngleSpan = angleSpan;
+}
+
+
+/*virtual*/ void Arc::Restore(void)
+{
+ Object::Restore();
+ radius = oldRadius2;
+ startAngle = oldStartAngle;
+ angleSpan = oldAngleSpan;
+}
+