#include <stdint.h>
#include <vector>
#include <string>
+#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 {
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 {