]> Shamusworld >> Repos - architektonas/blob - src/object.h
Preliminary Delete Object tool implementation.
[architektonas] / src / object.h
1 #ifndef __OBJECT_H__
2 #define __OBJECT_H__
3
4 #include "vector.h"
5
6 class QPainter;
7 class QFont;
8 class Dimension;
9
10 enum ObjectState { OSInactive, OSSelected };
11
12 class Object
13 {
14         public:
15                 Object();
16                 Object(Vector, Object * passedInParent = 0);
17                 ~Object();
18
19                 virtual void Draw(QPainter *);
20                 virtual Vector Center(void);
21                 virtual bool Collided(Vector);
22                 virtual void PointerMoved(Vector);
23                 virtual void PointerReleased(void);
24                 virtual bool NeedsUpdate(void);
25                 virtual void Transmute(Object *, Object *);
26                 ObjectState GetState(void);
27
28                 // Class methods
29                 static void SetFixedAngle(bool state = true);
30                 static void SetFixedLength(bool state = true);
31                 static void SetFont(QFont *);
32                 static void SetViewportHeight(int);
33                 static void SetDeleteActive(bool state = true);
34
35         protected:
36                 Vector position;                                        // All objects have a position (doubles as reference point)
37                 Object * parent;
38 //              Pen pen;
39 //              Fill fill;
40                 ObjectState state;
41                 ObjectState oldState;
42                 bool needUpdate;
43                 Dimension * dimPoint1;
44                 Dimension * dimPoint2;
45
46                 // Class variables
47                 static QFont * font;
48                 static bool fixedAngle;
49                 static bool fixedLength;
50                 static int viewportHeight;
51                 static bool deleteActive;
52 };
53
54 #endif  // __OBJECT_H__