]> Shamusworld >> Repos - architektonas/blob - src/dimension.h
Fix for missing ampersand in QApplication.
[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(Vector *, Vector *, Object * p = 0);
11                 ~Dimension();
12
13                 virtual void Draw(Painter *);
14                 virtual Vector Center(void);
15                 virtual bool Collided(Vector);
16                 virtual void PointerMoved(Vector);
17                 virtual void PointerReleased(void);
18                 void SetPoint1(Vector *);
19                 void SetPoint2(Vector *);
20                 Vector GetPoint1(void);
21                 Vector GetPoint2(void);
22                 void FlipSides(void);
23
24         protected:
25                 Vector endpoint;                                        // Starting point is Object::position
26                 Vector oldPoint;                                        // Used for dragging
27
28         private:
29                 bool dragging;
30                 bool draggingHandle1;
31                 bool draggingHandle2;
32                 bool objectWasDragged;
33                 double length;
34
35                 Vector * point1;                                        // These couple to external points; if there
36                 Vector * point2;                                        // are none then fall back to endpoint/position
37 };
38
39 #endif  // __DIMENSION_H__