]> Shamusworld >> Repos - architektonas/blob - src/line.h
Fixed Line rendering to keep attached Dimensions correct length with 'Fix Len'
[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(QPainter *);
15                 virtual Vector Center(void);
16                 virtual bool Collided(Vector);
17                 virtual void PointerMoved(Vector);
18                 virtual void PointerReleased(void);
19                 void SetDimensionOnPoint1(Dimension *);
20                 void SetDimensionOnPoint2(Dimension *);
21
22         protected:
23                 Vector endpoint;                                        // Starting point is Object::position
24                 Vector oldPoint;                                        // Used for dragging
25
26         private:
27                 bool dragging;
28                 bool draggingHandle1;
29                 bool draggingHandle2;
30                 bool objectWasDragged;
31                 double length;
32 };
33
34 #endif  // __LINE_H__