X-Git-Url: http://shamusworld.gotdns.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fdimension.h;h=efd5ea64ba3081ecea8e1517adfb81f8452c4a17;hb=8ab4e08bd78cb5b07f069e3e6c5bf76944cb14fa;hp=301bcffdb782df3205e00921acd1d5cdba0fe849;hpb=746443089f76c115245d1500b780d7d189b9b2af;p=architektonas diff --git a/src/dimension.h b/src/dimension.h index 301bcff..efd5ea6 100644 --- a/src/dimension.h +++ b/src/dimension.h @@ -1,22 +1,31 @@ #ifndef __DIMENSION_H__ #define __DIMENSION_H__ +#include "connection.h" #include "object.h" +enum DimensionType { DTLinear, DTLinearVert, DTLinearHorz, DTRadial, DTDiametric, DTCircumferential, DTAngular, DTLeader }; + class Dimension: public Object { public: - Dimension(Vector, Vector, Object * p = 0); - Dimension(Vector *, Vector *, Object * p = 0); + Dimension(Vector, Vector, DimensionType dt = DTLinear, Object * p = 0); + Dimension(Connection, Connection, DimensionType dt = DTLinear, Object * p = 0); ~Dimension(); - virtual void Draw(QPainter *); + virtual void Draw(Painter *); virtual Vector Center(void); virtual bool Collided(Vector); virtual void PointerMoved(Vector); virtual void PointerReleased(void); - void SetPoint1(Vector *); - void SetPoint2(Vector *); + 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 QRectF Extents(void); +// virtual ObjectType Type(void); void FlipSides(void); protected: @@ -29,9 +38,12 @@ class Dimension: public Object bool draggingHandle2; bool objectWasDragged; double length; + DimensionType dimensionType; - Vector * point1; // These couple to external points; if there - Vector * point2; // are none then fall back to endpoint/position + // 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__