]> Shamusworld >> Repos - architektonas/blobdiff - src/line.h
Readded click to add dimension to object (for Line).
[architektonas] / src / line.h
index 1a38fa337ef73d49caf9fac1e0ad7b66284a2ea2..70bf39861b41bf39817c16f5ee55e442419698a7 100644 (file)
@@ -3,30 +3,57 @@
 
 #include "object.h"
 
+class Dimension;
+
 class Line: public Object
 {
+       friend class Geometry;
+
        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 void MovePointAtParameter(double parameter, Vector);
+               virtual QRectF Extents(void);
+               virtual void Translate(Vector);
+               virtual void Rotate(Point, double);
+               virtual void Scale(Vector, double);
+               virtual void Mirror(Point, Point);
+               virtual void Save(void);
+               virtual void Restore(void);
+               void SetDimensionOnLine(Dimension * d = 0);
+               Object * FindAttachedDimension(void);
+
+       protected:
+               void SaveHitState(void);
+               bool HitStateChanged(void);
 
        protected:
                Vector endpoint;                                        // Starting point is Object::position
                Vector oldPoint;                                        // Used for dragging
+               Point oldEndpoint;
 
        private:
-               bool dragging;
+               bool draggingLine;
                bool draggingHandle1;
                bool draggingHandle2;
-//             bool needUpdate;
                bool objectWasDragged;
                double length;
+               Vector angle;
+       public:
+               bool hitPoint1, hitPoint2, hitLine;
+       private:
+               bool oldHitPoint1, oldHitPoint2, oldHitLine;
 };
 
 #endif // __LINE_H__