]> Shamusworld >> Repos - architektonas/blob - src/arc.h
Added Architektonas drawing file loading/saving infrastructure.
[architektonas] / src / arc.h
1 #ifndef __ARC_H__
2 #define __ARC_H__
3
4 #include "object.h"
5
6 class Arc: public Object
7 {
8         public:
9                 Arc(Vector, double, double, double, Object * p = 0);
10                 ~Arc();
11
12                 virtual void Draw(Painter *);
13                 virtual Vector Center(void);
14                 virtual bool Collided(Vector);
15                 virtual void PointerMoved(Vector);
16                 virtual void PointerReleased(void);
17 //              virtual bool NeedsUpdate(void);
18
19         private:
20                 bool AngleInArcSpan(double angle);
21
22         protected:
23                 double radius;                                          // Center is Object::position
24                 double startAngle;                                      // Starting angle in radians
25                 double angleSpan;                                       // # of degrees the arc spans in radians
26
27         private:
28                 bool hitHandle1;        // Moving
29                 bool hitHandle2;        // Rotation
30                 bool hitHandle3;        // Setting span of the arc
31                 bool hitHandle4;        // Resizing
32                 bool objectWasDragged;
33                 Vector oldPoint;                                        // Used for dragging
34                 double oldAngle;                                        // Used for user feedback
35                 double oldRadius;                                       // Used for user feedback
36 };
37
38 #endif  // __ARC_H__