X-Git-Url: http://shamusworld.gotdns.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fline.h;h=3d46551d6d1bedb7fe19a66fe5b2711068c8feaa;hb=70297ac8ec7453e4196f4b58056bcfe4b04f2aca;hp=1a38fa337ef73d49caf9fac1e0ad7b66284a2ea2;hpb=9f6ad3fe0b9cb30115a5d38e8af3aebed0d70c08;p=architektonas diff --git a/src/line.h b/src/line.h index 1a38fa3..3d46551 100644 --- a/src/line.h +++ b/src/line.h @@ -3,30 +3,49 @@ #include "object.h" +class Dimension; + class Line: public Object { public: Line(Vector, Vector, Object * p = 0); ~Line(); - 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 bool HitTest(Point); + virtual Vector * GetPointAt(Vector); + virtual void Enumerate(FILE *); + virtual Object * Copy(void); + virtual Vector GetPointAtParameter(double parameter); + virtual QRectF Extents(void); +// virtual ObjectType Type(void); + virtual void Translate(Vector); + virtual void Rotate(Vector, double); + virtual void Scale(Vector, double); + void SetDimensionOnLine(Dimension * d = 0); + Object * FindAttachedDimension(void); + + protected: + void SaveState(void); + bool StateChanged(void); protected: Vector endpoint; // Starting point is Object::position Vector oldPoint; // Used for dragging private: - bool dragging; + bool draggingLine; bool draggingHandle1; bool draggingHandle2; -// bool needUpdate; bool objectWasDragged; double length; + Vector angle; + bool hitPoint1, hitPoint2, hitLine; + bool oldHitPoint1, oldHitPoint2, oldHitLine; }; #endif // __LINE_H__