1 // drawarcaction.cpp: Draw arc object
3 // Part of the Architektonas Project
4 // (C) 2011 Underground Software
5 // See the README and GPLv3 files for licensing and warranty information
7 // JLH = James Hammons <jlhamm@acm.org>
10 // --- ---------- ------------------------------------------------------------
11 // JLH 08/13/2013 Created this file
14 #include "drawarcaction.h"
20 enum { FIRST_POINT, SECOND_POINT, THIRD_POINT };
21 //#define FIRST_POINT 0
22 //#define SECOND_POINT 1
26 DrawArcAction::DrawArcAction(): state(FIRST_POINT), arc(NULL)
31 DrawArcAction::~DrawArcAction()
36 /*virtual*/ void DrawArcAction::Draw(Painter * painter)
38 painter->SetPen(QPen(Qt::red, 2.0, Qt::DotLine));
40 // I think stuff like crosshairs should be done in the DrawingView, tho
41 if (state == FIRST_POINT)
43 painter->DrawHandle(p1);
47 // painter->DrawLine(p1, p2);
48 // painter->DrawHandle(p2);
53 /*virtual*/ void DrawArcAction::MouseDown(Vector point)
55 if (state == FIRST_POINT)
62 /*virtual*/ void DrawArcAction::MouseMoved(Vector point)
64 if (state == FIRST_POINT)
71 /*virtual*/ void DrawArcAction::MouseReleased(void)
73 if (state == FIRST_POINT)
78 else if (state == NEXT_POINT)
80 // We create the new object here, and then pass it off to the
81 // DrawingView which stuffs it into the document.
82 // text = new Text(p1, p2);
83 // arc = new Arc(...);
84 // We don't need no stinkin' sentinels, when we have signals & slots!
85 emit ObjectReady(arc);