X-Git-Url: http://shamusworld.gotdns.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fobject.h;h=513b677fba566421b6999859b705a8d051e76fba;hb=70297ac8ec7453e4196f4b58056bcfe4b04f2aca;hp=2e2efffa5f5b14bb14c196052115ea84b0d6f521;hpb=676007c81e292079daaa7188f4fbf2757ae77ef8;p=architektonas diff --git a/src/object.h b/src/object.h index 2e2efff..513b677 100644 --- a/src/object.h +++ b/src/object.h @@ -5,6 +5,7 @@ #include // This is a container #include "vector.h" // This is the mathematical construct #include "connection.h" +#include class Painter; class QFont; @@ -12,6 +13,7 @@ class Dimension; //class FILE; enum ObjectState { OSInactive, OSSelected }; +enum ObjectType { OTNone, OTObject, OTLine, OTCircle, OTArc, OTDimension, OTEllipse, OTContainer }; class Object { @@ -26,6 +28,7 @@ class Object virtual void PointerMoved(Vector); virtual void PointerReleased(void); virtual bool NeedsUpdate(void); + virtual bool HitTest(Point); virtual void Transmute(Object *, Object *); virtual Object * GetParent(void); virtual void Add(Object *); @@ -36,6 +39,11 @@ class Object virtual void Connect(Object *, double); virtual void Disconnect(Object *, double); virtual void DisconnectAll(Object *); + virtual QRectF Extents(void); +// virtual ObjectType Type(void);// = 0; // Pure virtual, must be implemented + virtual void Translate(Vector); + virtual void Rotate(Vector, double); + virtual void Scale(Vector, double); ObjectState GetState(void); void Reparent(Object *); // Dimension * GetAttachedDimension(void); @@ -55,7 +63,10 @@ class Object Object * parent; // Pen pen; // Fill fill; + public: + ObjectType type; ObjectState state; + protected: ObjectState oldState; bool needUpdate; // Dimension * attachedDimension; @@ -69,6 +80,11 @@ class Object static bool deleteActive; static bool dimensionActive; static bool snapToGrid; + static bool ignoreClicks; + static bool dontMove; + public: + static bool selectionInProgress; + static QRectF selection; }; #endif // __OBJECT_H__