]> Shamusworld >> Repos - architektonas/blob - src/line.h
Added infrastructure to support mirror tool, cross compile script.
[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 bool HitTest(Point);
20                 virtual Vector * GetPointAt(Vector);
21                 virtual void Enumerate(FILE *);
22                 virtual Object * Copy(void);
23                 virtual Vector GetPointAtParameter(double parameter);
24                 virtual QRectF Extents(void);
25 //              virtual ObjectType Type(void);
26                 virtual void Translate(Vector);
27                 virtual void Rotate(Vector, double);
28                 virtual void Scale(Vector, double);
29                 virtual Object * Mirror(Vector, Vector);
30                 void SetDimensionOnLine(Dimension * d = 0);
31                 Object * FindAttachedDimension(void);
32
33         protected:
34                 void SaveHitState(void);
35                 bool HitStateChanged(void);
36
37         protected:
38                 Vector endpoint;                                        // Starting point is Object::position
39                 Vector oldPoint;                                        // Used for dragging
40
41         private:
42                 bool draggingLine;
43                 bool draggingHandle1;
44                 bool draggingHandle2;
45                 bool objectWasDragged;
46                 double length;
47                 Vector angle;
48                 bool hitPoint1, hitPoint2, hitLine;
49                 bool oldHitPoint1, oldHitPoint2, oldHitLine;
50 };
51
52 #endif  // __LINE_H__