#include <vector>
#include <string>
#include "global.h"
+#include "rect.h"
#include "vector.h"
enum ObjectType { OTNone = 0, OTLine, OTCircle, OTEllipse, OTArc, OTPolygon, OTDimension, OTSpline, OTText, OTContainer, OTCount };
-enum DimensionType { DTLinear, DTLinearVert, DTLinearHorz, DTRadial, DTDiametric, DTCircumferential, DTAngular, DTLeader };
+enum DimensionType { DTLinear = 0, DTLinearVert, DTLinearHorz, DTRadial, DTDiametric, DTCircumferential, DTAngular, DTLeader, DTCount };
enum ToolType { TTNone, TTLine, TTCircle, TTEllipse, TTArc, TTDimension, TTText, TTPolygon, TTSpline, TTRotate, TTMirror, TTTrim, TTTriangulate, TTDelete };
double angle[2]; \
double radius[2];
+struct Object {
+ OBJECT_COMMON;
+};
+
struct Line {
OBJECT_COMMON;
OBJECT_COMMON;
int subtype;
double offset;
- Point lp[2]; // Line point, the actual dimension line
+ Point lp[2]; // Line point, the actual dimension line
+ Object * obj[2]; // Pointer to attached objects (circle, lines for angle)
Dimension(): type(OTDimension), id(Global::objectID++) {}
Dimension(Vector pt1, Vector pt2, DimensionType dt = DTLinear, float th = 1.0, uint32_t c = 0x0000FF, int l = LSSolid):
struct Text {
OBJECT_COMMON;
+ Rect extents;
+ bool measured;
std::string s;
Text(): type(OTText), id(Global::objectID++) {}
Text(Vector pt1, char * str, float th = 10.0, uint32_t c = 0):
type(OTText), id(Global::objectID++), layer(0), color(c), thickness(th),
- style(LSSolid), selected(false), hovered(false), hitObject(false), s(str) { p[0] = pt1; }
+ style(LSSolid), selected(false), hovered(false), hitObject(false),
+ measured(false), s(str) { p[0] = pt1; angle[0] = 0; }
};
struct Polygon {
}*/
};
-struct Object {
- OBJECT_COMMON;
-};
-
#endif // __STRUCTS_H__