X-Git-Url: http://shamusworld.gotdns.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fstructs.h;fp=src%2Fstructs.h;h=0d16ff8d30f5c81772766997d20ebae3b652b434;hb=5d8c9e52606315fbfe857f2715b8f051b4f97491;hp=bef3c52f93879fa24f545b90ca9cf4cdc97ac813;hpb=742d2aa9bb46bce4f690474fa22f5980e175e55e;p=architektonas diff --git a/src/structs.h b/src/structs.h index bef3c52..0d16ff8 100644 --- a/src/structs.h +++ b/src/structs.h @@ -8,7 +8,7 @@ #include "rect.h" #include "vector.h" -enum ObjectType { OTNone = 0, OTLine, OTCircle, OTEllipse, OTArc, OTPolygon, OTDimension, OTSpline, OTText, OTContainer, OTCount }; +enum ObjectType { OTNone = 0, OTLine, OTCircle, OTEllipse, OTArc, OTPolygon, OTDimension, OTSpline, OTText, OTContainer, OTPolyline, OTCount }; enum DimensionType { DTLinear = 0, DTLinearVert, DTLinearHorz, DTRadial, DTDiametric, DTCircumferential, DTAngular, DTLeader, DTCount }; @@ -37,7 +37,7 @@ const char dimName[DTCount][32] = { bool hitPoint[5]; \ bool hitObject; \ Point p[5]; \ - double angle[2]; \ + double angle[3]; \ double radius[2]; \ double length; @@ -116,10 +116,22 @@ struct Text { struct Polygon { OBJECT_COMMON; + int sides; Polygon(): type(OTPolygon), id(Global::objectID++) {} }; +struct Polyline { + OBJECT_COMMON; + VPVector objects; + bool closed; + Object * clicked; + + Polyline(): type(OTPolyline), id(Global::objectID++), selected(false), hovered(false), hitObject(false), clicked(NULL) {} + void Add(void * obj) { objects.push_back(obj); } + void Add(VPVector objs) { objects.insert(objects.end(), objs.begin(), objs.end()); } +}; + struct Spline { OBJECT_COMMON; @@ -154,4 +166,3 @@ struct Container { }; #endif // __STRUCTS_H__ -