]> Shamusworld >> Repos - architektonas/blob - src/arc.h
587d0eb5cbf3be72eaf61901890e9876be1df8ad
[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 void Enumerate(FILE *);
18                 virtual QRectF Extents(void);
19 //              virtual Object * Copy(void);
20 //              virtual ObjectType Type(void);
21
22         private:
23                 bool AngleInArcSpan(double angle);
24
25         protected:
26                 double radius;                                          // Center is Object::position
27                 double startAngle;                                      // Starting angle in radians
28                 double angleSpan;                                       // # of degrees the arc spans in radians
29
30         private:
31                 bool hitHandle1;        // Moving
32                 bool hitHandle2;        // Rotation
33                 bool hitHandle3;        // Setting span of the arc
34                 bool hitHandle4;        // Resizing
35                 bool objectWasDragged;
36                 Vector oldPoint;                                        // Used for dragging
37                 double oldAngle;                                        // Used for user feedback
38                 double oldRadius;                                       // Used for user feedback
39 };
40
41 #endif  // __ARC_H__