+// drawarcaction.cpp: Draw arc object
+//
+// Part of the Architektonas Project
+// (C) 2011 Underground Software
+// See the README and GPLv3 files for licensing and warranty information
+//
+// JLH = James Hammons <jlhamm@acm.org>
+//
+// WHO WHEN WHAT
+// --- ---------- ------------------------------------------------------------
+// JLH 08/13/2013 Created this file
+//
+
+#include "drawarcaction.h"
+#include "painter.h"
+#include "arc.h"
+//#include "vector.h"
+
+
+enum { FIRST_POINT, SECOND_POINT, THIRD_POINT };
+//#define FIRST_POINT 0
+//#define SECOND_POINT 1
+#define NEXT_POINT 2
+
+
+DrawArcAction::DrawArcAction(): state(FIRST_POINT), arc(NULL)
+{
+}
+
+
+DrawArcAction::~DrawArcAction()
+{
+}
+
+
+/*virtual*/ void DrawArcAction::Draw(Painter * painter)
+{
+ painter->SetPen(QPen(Qt::red, 2.0, Qt::DotLine));
+
+ // I think stuff like crosshairs should be done in the DrawingView, tho
+ if (state == FIRST_POINT)
+ {
+ painter->DrawHandle(p1);
+ }
+ else
+ {
+// painter->DrawLine(p1, p2);
+// painter->DrawHandle(p2);
+ }
+}
+
+
+/*virtual*/ void DrawArcAction::MouseDown(Vector point)
+{
+ if (state == FIRST_POINT)
+ p1 = point;
+// else
+// p2 = point;
+}
+
+
+/*virtual*/ void DrawArcAction::MouseMoved(Vector point)
+{
+ if (state == FIRST_POINT)
+ p1 = point;
+// else
+// p2 = point;
+}
+
+
+/*virtual*/ void DrawArcAction::MouseReleased(void)
+{
+ if (state == FIRST_POINT)
+ {
+// p2 = p1;
+ state = NEXT_POINT;
+ }
+ else if (state == NEXT_POINT)
+ {
+ // We create the new object here, and then pass it off to the
+ // DrawingView which stuffs it into the document.
+// text = new Text(p1, p2);
+// arc = new Arc(...);
+ // We don't need no stinkin' sentinels, when we have signals & slots!
+ emit ObjectReady(arc);
+ }
+}
+