]> Shamusworld >> Repos - architektonas/blob - src/dimension.h
Fixed Line rendering to keep attached Dimensions correct length with 'Fix Len'
[architektonas] / src / dimension.h
1 #ifndef __DIMENSION_H__
2 #define __DIMENSION_H__
3
4 #include "object.h"
5
6 class Dimension: public Object
7 {
8         public:
9                 Dimension(Vector, Vector, Object * p = 0);
10                 ~Dimension();
11
12                 virtual void Draw(QPainter *);
13                 virtual Vector Center(void);
14                 virtual bool Collided(Vector);
15                 virtual void PointerMoved(Vector);
16                 virtual void PointerReleased(void);
17                 void SetPoint1(Vector);
18                 void SetPoint2(Vector);
19
20         protected:
21                 Vector endpoint;                                        // Starting point is Object::position
22                 Vector oldPoint;                                        // Used for dragging
23
24         private:
25                 bool dragging;
26                 bool draggingHandle1;
27                 bool draggingHandle2;
28                 bool objectWasDragged;
29                 double length;
30 };
31
32 #endif  // __DIMENSION_H__