X-Git-Url: http://shamusworld.gotdns.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fobject.h;h=efcffe1f00bd34990cb15102f19a8759990cace6;hb=baf67656b97e3d61e9223e66ebe4f554e364cd4a;hp=e0ea740460bbb83b71bece85b2272e303b82afa1;hpb=9f6ad3fe0b9cb30115a5d38e8af3aebed0d70c08;p=architektonas diff --git a/src/object.h b/src/object.h index e0ea740..efcffe1 100644 --- a/src/object.h +++ b/src/object.h @@ -1,10 +1,12 @@ #ifndef __OBJECT_H__ #define __OBJECT_H__ -#include "vector.h" +#include // This is a container +#include "vector.h" // This is the mathematical construct -class QPainter; +class Painter; class QFont; +class Dimension; enum ObjectState { OSInactive, OSSelected }; @@ -15,20 +17,29 @@ class Object Object(Vector, Object * passedInParent = 0); ~Object(); - virtual void Draw(QPainter *); + virtual void Draw(Painter *); virtual Vector Center(void); virtual bool Collided(Vector); virtual void PointerMoved(Vector); virtual void PointerReleased(void); virtual bool NeedsUpdate(void); - + virtual void Transmute(Object *, Object *); + virtual Object * GetParent(void); + virtual void Add(Object *); + virtual Vector * GetPointAt(Vector); ObjectState GetState(void); + void Reparent(Object *); + Dimension * GetAttachedDimension(void); +//Hm. Object * Connect(Object *); // Class methods static void SetFixedAngle(bool state = true); static void SetFixedLength(bool state = true); static void SetFont(QFont *); static void SetViewportHeight(int); + static void SetDeleteActive(bool state = true); + static void SetDimensionActive(bool state = true); + static void SetSnapMode(bool state = true); protected: Vector position; // All objects have a position (doubles as reference point) @@ -38,12 +49,17 @@ class Object ObjectState state; ObjectState oldState; bool needUpdate; + Dimension * attachedDimension; + std::vector connected; // Class variables static QFont * font; static bool fixedAngle; static bool fixedLength; static int viewportHeight; + static bool deleteActive; + static bool dimensionActive; + static bool snapToGrid; }; #endif // __OBJECT_H__