10 enum ObjectType { OTNone, OTLine, OTCircle, OTEllipse, OTArc, OTDimension, OTSpline, OTText, OTContainer };
12 enum DimensionType { DTLinear, DTLinearVert, DTLinearHorz, DTRadial, DTDiametric, DTCircumferential, DTAngular, DTLeader };
14 enum ToolType { TTNone, TTLine, TTCircle, TTEllipse, TTArc, TTDimension, TTText, TTPolygon, TTSpline, TTRotate, TTMirror, TTTrim, TTTriangulate, TTDelete };
16 enum ToolState { TSNone, TSPoint1, TSPoint2, TSDone };
18 #define OBJECT_COMMON \
35 Line(): type(OTLine), id(Global::objectID++) {}
36 Line(Vector pt1, Vector pt2, float th = 1.0, uint32_t c = 0, int l = LSSolid):
37 type(OTLine), id(Global::objectID++), layer(0), color(c), thickness(th),
38 style(l), selected(false), hovered(false), p1(pt1), p2(pt2) {}
46 Circle(Vector pt1, double r, float th = 1.0, uint32_t c = 0, int l = LSSolid):
47 type(OTCircle), id(Global::objectID++), layer(0), color(c), thickness(th),
48 style(l), selected(false), hovered(false), p1(pt1), radius(r) {}
58 Ellipse(Vector pt1, Vector pt2, double r1, double r2, float th = 1.0, uint32_t c = 0, int l = LSSolid):
59 type(OTEllipse), id(Global::objectID++), layer(0), color(c), thickness(th),
60 style(l), selected(false), hovered(false), p1(pt1), p2(pt2), radius1(r1), radius2(r2) {}
70 Arc(Vector pt1, double r, double a1, double a2, float th = 1.0, uint32_t c = 0, int l = LSSolid):
71 type(OTArc), id(Global::objectID++), layer(0), color(c), thickness(th),
72 style(l), selected(false), hovered(false), p1(pt1), radius(r), angle1(a1), angle2(a2) {}
82 Dimension(Vector pt1, Vector pt2, DimensionType dt = DTLinear, float th = 1.0, uint32_t c = 0x0000FF, int l = LSSolid):
83 type(OTDimension), id(Global::objectID++), layer(0), color(c), thickness(th),
84 style(l), selected(false), hovered(false), subtype(dt), p1(pt1), p2(pt2) {}
92 Text(Vector pt, char * str, float th = 10.0, uint32_t c = 0):
93 type(OTText), id(Global::objectID++), layer(0), color(c), thickness(th),
94 style(LSSolid), selected(false), hovered(false), p1(pt), s(str) {}
100 std::vector<void *> objects;
104 Container(): type(OTContainer), id(Global::objectID++), selected(false), hovered(false) {}
112 #endif // __STRUCTS_H__