5 #include <vector> // This is a container
6 #include "vector.h" // This is the mathematical construct
7 #include "connection.h"
15 enum ObjectState { OSInactive, OSSelected };
16 enum ObjectType { OTNone, OTObject, OTLine, OTCircle, OTArc, OTDimension, OTEllipse, OTContainer };
22 Object(Vector, Object * passedInParent = 0);
25 virtual void Draw(Painter *);
26 virtual Vector Center(void);
27 virtual bool Collided(Vector);
28 virtual void PointerMoved(Vector);
29 virtual void PointerReleased(void);
30 virtual bool NeedsUpdate(void);
31 virtual void Transmute(Object *, Object *);
32 virtual Object * GetParent(void);
33 virtual void Add(Object *);
34 virtual Vector * GetPointAt(Vector);
35 virtual void Enumerate(FILE *);
36 virtual Object * Copy(void);
37 virtual Vector GetPointAtParameter(double parameter);
38 virtual void Connect(Object *, double);
39 virtual void Disconnect(Object *, double);
40 virtual void DisconnectAll(Object *);
41 virtual QRectF Extents(void);
42 // virtual ObjectType Type(void);// = 0; // Pure virtual, must be implemented
43 ObjectState GetState(void);
44 void Reparent(Object *);
45 // Dimension * GetAttachedDimension(void);
46 //Hm. Object * Connect(Object *);
49 static void SetFixedAngle(bool state = true);
50 static void SetFixedLength(bool state = true);
51 static void SetFont(QFont *);
52 static void SetViewportHeight(int);
53 static void SetDeleteActive(bool state = true);
54 static void SetDimensionActive(bool state = true);
55 static void SetSnapMode(bool state = true);
58 Vector position; // All objects have a position (doubles as reference point)
68 // Dimension * attachedDimension;
69 std::vector<Connection> connected;
73 static bool fixedAngle;
74 static bool fixedLength;
75 static int viewportHeight;
76 static bool deleteActive;
77 static bool dimensionActive;
78 static bool snapToGrid;
79 static bool ignoreClicks;
83 #endif // __OBJECT_H__