]> Shamusworld >> Repos - architektonas/blob - src/dimension.h
Beginnings of visual feedback for editing shapes.
[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                 void FlipSides(void);
20
21         protected:
22                 Vector endpoint;                                        // Starting point is Object::position
23                 Vector oldPoint;                                        // Used for dragging
24
25         private:
26                 bool dragging;
27                 bool draggingHandle1;
28                 bool draggingHandle2;
29                 bool objectWasDragged;
30                 double length;
31 };
32
33 #endif  // __DIMENSION_H__