X-Git-Url: http://shamusworld.gotdns.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fstructs.h;h=a6b52ccb69a5fa3f4b70d3b58e65bba10e10eaf7;hb=84afe881653a02a16b19d4da37435b8701b1a826;hp=b9f6e9b9bcf78a32c10ddbb269f854c759b14d75;hpb=db0a3d91f37031e155cc8eac7cfdec9889f233ee;p=architektonas diff --git a/src/structs.h b/src/structs.h index b9f6e9b..a6b52cc 100644 --- a/src/structs.h +++ b/src/structs.h @@ -4,25 +4,39 @@ #include #include #include +#include "global.h" #include "vector.h" +enum ObjectType { OTNone, OTObject, OTLine, OTCircle, OTArc, OTDimension, OTEllipse, OTContainer, OTSpline }; + #define OBJECT_COMMON \ - int type; \ - uint32_t id; \ - int layer; \ - uint32_t color; \ - float thickness; + int type; \ + uint32_t id; \ + int layer; \ + uint32_t color; \ + float thickness; \ + int style; \ + bool selected; struct Line { OBJECT_COMMON; Point p1; Point p2; + + Line(): type(OTLine), id(Global::objectID++) {} + Line(Vector pt1, Vector pt2, float th = 1.0, uint32_t c = 0, int l = 0): + type(OTLine), id(Global::objectID++), layer(l), color(c), thickness(th), + style(0), selected(false), p1(pt1), p2(pt2) {} }; struct Circle { OBJECT_COMMON; Point p1; double radius; + + Circle(Vector pt1, double r, float th = 1.0, uint32_t c = 0, int l = 0): + type(OTCircle), id(Global::objectID++), layer(l), color(c), thickness(th), + style(0), selected(false), p1(pt1), radius(r) {} }; struct Arc { @@ -31,6 +45,10 @@ struct Arc { double radius; double angle1; double angle2; + + Arc(Vector pt1, double r, double a1, double a2, float th = 1.0, uint32_t c = 0, int l = 0): + type(OTArc), id(Global::objectID++), layer(l), color(c), thickness(th), + style(0), selected(false), p1(pt1), radius(r), angle1(a1), angle2(a2) {} }; struct Text {