X-Git-Url: http://shamusworld.gotdns.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fobject.h;h=d34e79ae7598df74e85b3d330f63a390a9aeafe4;hb=67fbc130b4b6b4d253f69a9c32980d3d3306def5;hp=34063a76e522d44f976a54f3db3d47c9f5d29287;hpb=ba6723b86d8dd67ebc7b11b245de3e7ff64f06b1;p=architektonas diff --git a/src/object.h b/src/object.h index 34063a7..d34e79a 100644 --- a/src/object.h +++ b/src/object.h @@ -28,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 *); @@ -40,6 +41,12 @@ class Object 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); + virtual void Mirror(Point, Point); + virtual void Save(void); + virtual void Restore(void); ObjectState GetState(void); void Reparent(Object *); // Dimension * GetAttachedDimension(void); @@ -53,15 +60,18 @@ class Object static void SetDeleteActive(bool state = true); static void SetDimensionActive(bool state = true); static void SetSnapMode(bool state = true); + static Vector SnapPointToGrid(Vector); protected: Vector position; // All objects have a position (doubles as reference point) Object * parent; // Pen pen; // Fill fill; + Point oldPosition; public: ObjectType type; ObjectState state; + unsigned int layer; protected: ObjectState oldState; bool needUpdate; @@ -69,15 +79,23 @@ class Object std::vector connected; // Class variables + public: static QFont * font; + protected: static bool fixedAngle; static bool fixedLength; static int viewportHeight; static bool deleteActive; static bool dimensionActive; + public: static bool snapToGrid; static bool ignoreClicks; static bool dontMove; + public: + static bool selectionInProgress; + static QRectF selection; + static double gridSpacing; // Grid spacing in base units + static int currentLayer; }; #endif // __OBJECT_H__