1 #ifndef __DIMENSION_H__
2 #define __DIMENSION_H__
4 #include "connection.h"
9 enum DimensionType { DTLinear, DTLinearVert, DTLinearHorz, DTRadial, DTDiametric, DTCircumferential, DTAngular, DTLeader };
11 class Dimension: public Object
16 Dimension(Vector, Vector, DimensionType dt = DTLinear, Object * p = 0);
17 Dimension(Connection, Connection, DimensionType dt = DTLinear, Object * p = 0);
20 virtual void Draw(Painter *);
21 virtual Vector Center(void);
22 virtual bool Collided(Vector);
23 virtual void PointerMoved(Vector);
24 virtual void PointerReleased(void);
25 virtual bool HitTest(Point);
26 virtual void Enumerate(FILE *);
27 virtual Object * Copy(void);
28 virtual Vector GetPointAtParameter(double parameter);
29 virtual void MovePointAtParameter(double parameter, Vector);
30 virtual void Connect(Object *, double);
31 virtual void Disconnect(Object *, double);
32 virtual void DisconnectAll(Object *);
33 virtual QRectF Extents(void);
37 void SaveHitState(void);
38 bool HitStateChanged(void);
41 Vector endpoint; // Starting point is Object::position
42 Vector oldPoint; // Used for dragging
49 bool objectWasDragged;
51 DimensionType dimensionType;
54 bool oldHitPoint1, oldHitPoint2;
56 double size; // Size of arrows/text in base units
59 // We use these in lieu of the built-in connected[] array; no reason to
60 // do it this way especially
65 #endif // __DIMENSION_H__