]> Shamusworld >> Repos - architektonas/blob - src/dimension.h
Added glue layer to Qt painting, to properly render cartesian coordinates.
[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                 void FlipSides(void);
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                 Vector * point1;                                        // These couple to external points; if there
34                 Vector * point2;                                        // are none then fall back to endpoint/position
35 };
36
37 #endif  // __DIMENSION_H__