]> Shamusworld >> Repos - architektonas/blobdiff - src/dimension.h
Initial stab at horizontally aligned Dimensions.
[architektonas] / src / dimension.h
index 32aa2857c3582ee1786faaa70b7f62baf0210c29..c3709b61bbaf24da3fa23aa78a273ba3a399ec7f 100644 (file)
@@ -4,13 +4,17 @@
 #include "connection.h"
 #include "object.h"
 
+class Line;
+
 enum DimensionType { DTLinear, DTLinearVert, DTLinearHorz, DTRadial, DTDiametric, DTCircumferential, DTAngular, DTLeader };
 
 class Dimension: public Object
 {
+       friend class Line;
+       friend class Geometry;
+
        public:
                Dimension(Vector, Vector, DimensionType dt = DTLinear, Object * p = 0);
-               Dimension(Connection, Connection, DimensionType dt = DTLinear, Object * p = 0);
                ~Dimension();
 
                virtual void Draw(Painter *);
@@ -22,9 +26,7 @@ class Dimension: public Object
                virtual void Enumerate(FILE *);
                virtual Object * Copy(void);
                virtual Vector GetPointAtParameter(double parameter);
-               virtual void Connect(Object *, double);
-               virtual void Disconnect(Object *, double);
-               virtual void DisconnectAll(Object *);
+               virtual void MovePointAtParameter(double parameter, Vector);
                virtual QRectF Extents(void);
                void FlipSides(void);
 
@@ -46,15 +48,11 @@ class Dimension: public Object
                DimensionType dimensionType;
                bool hitPoint1;
                bool hitPoint2;
-               bool oldHitPoint1, oldHitPoint2;
+               bool hitLine;
+               bool hitFlipSwitch;
+               bool oldHitPoint1, oldHitPoint2, oldHitLine, oldHitFlipSwitch;
        public:
                double size;                                            // Size of arrows/text in base units
-
-       private:
-               // We use these in lieu of the built-in connected[] array; no reason to
-               // do it this way especially
-               Connection point1;
-               Connection point2;
 };
 
 #endif // __DIMENSION_H__