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 \
34 Line(): type(OTLine), id(Global::objectID++) {}
35 Line(Vector pt1, Vector pt2, float th = 1.0, uint32_t c = 0, int l = LSSolid):
36 type(OTLine), id(Global::objectID++), layer(0), color(c), thickness(th),
37 style(l), selected(false), hovered(false), hitObject(false) { p[0] = pt1; p[1] = pt2; }
44 Circle(): type(OTCircle), id(Global::objectID++) {}
45 Circle(Vector pt1, double r, float th = 1.0, uint32_t c = 0, int l = LSSolid):
46 type(OTCircle), id(Global::objectID++), layer(0), color(c), thickness(th),
47 style(l), selected(false), hovered(false), hitObject(false), radius(r) { p[0] = pt1; }
55 Ellipse(): type(OTEllipse), id(Global::objectID++) {}
56 Ellipse(Vector pt1, Vector pt2, double r1, double r2, float th = 1.0, uint32_t c = 0, int l = LSSolid):
57 type(OTEllipse), id(Global::objectID++), layer(0), color(c), thickness(th),
58 style(l), selected(false), hovered(false), hitObject(false), radius1(r1), radius2(r2) { p[0] = pt1; p[1] = pt2; }
67 Arc(): type(OTArc), id(Global::objectID++) {}
68 Arc(Vector pt1, double r, double a1, double a2, float th = 1.0, uint32_t c = 0, int l = LSSolid):
69 type(OTArc), id(Global::objectID++), layer(0), color(c), thickness(th),
70 style(l), selected(false), hovered(false), hitObject(false), radius(r), angle1(a1), angle2(a2) { p[0] = pt1; }
78 Dimension(): type(OTDimension), id(Global::objectID++) {}
79 Dimension(Vector pt1, Vector pt2, DimensionType dt = DTLinear, float th = 1.0, uint32_t c = 0x0000FF, int l = LSSolid):
80 type(OTDimension), id(Global::objectID++), layer(0), color(c), thickness(th),
81 style(l), selected(false), hovered(false), hitObject(false), subtype(dt) { p[0] = pt1; p[1] = pt2; }
88 Text(): type(OTText), id(Global::objectID++) {}
89 Text(Vector pt1, char * str, float th = 10.0, uint32_t c = 0):
90 type(OTText), id(Global::objectID++), layer(0), color(c), thickness(th),
91 style(LSSolid), selected(false), hovered(false), hitObject(false), s(str) { p[0] = pt1; }
96 std::vector<void *> objects;
100 Container(): type(OTContainer), id(Global::objectID++), selected(false), hovered(false), hitObject(false) {}
108 #endif // __STRUCTS_H__