]> Shamusworld >> Repos - architektonas/blob - src/line.h
In the middle of refactoring objects for loading/saving.
[architektonas] / src / line.h
1 #ifndef __LINE_H__
2 #define __LINE_H__
3
4 #include "object.h"
5
6 class Dimension;
7
8 class Line: public Object
9 {
10         public:
11                 Line(Vector, Vector, Object * p = 0);
12                 ~Line();
13
14                 virtual void Draw(Painter *);
15                 virtual Vector Center(void);
16                 virtual bool Collided(Vector);
17                 virtual void PointerMoved(Vector);
18                 virtual void PointerReleased(void);
19                 virtual Vector * GetPointAt(Vector);
20                 virtual void Enumerate(FILE *);
21                 virtual Object * Copy(void);
22 //              void SetDimensionOnPoint1(Dimension *);
23 //              void SetDimensionOnPoint2(Dimension *);
24                 void SetDimensionOnLine(Dimension * d = 0);
25
26         protected:
27                 bool HitTest(Point);
28                 void SaveState(void);
29                 bool StateChanged(void);
30
31         protected:
32                 Vector endpoint;                                        // Starting point is Object::position
33                 Vector oldPoint;                                        // Used for dragging
34
35         private:
36                 bool draggingLine;
37                 bool draggingHandle1;
38                 bool draggingHandle2;
39                 bool objectWasDragged;
40                 double length;
41                 Vector angle;
42                 bool hitPoint1, hitPoint2, hitLine;
43                 bool oldHitPoint1, oldHitPoint2, oldHitLine;
44 };
45
46 #endif  // __LINE_H__