9 #define C_RED Colour(1,0,0,1)
10 #define C_GREEN Colour(0,1,0,1)
11 #define C_BLUE Colour(0,0,1,1)
12 #define C_BLACK Colour(0,0,0,1);
17 inline Real Random(Real max=1, Real min=0)
19 return min + (max-min) * (Real(rand() % (int)1e6) / Real(1e6));
22 typedef unsigned ObjectID;
24 * NOTE: Extra entry in the enum so we can use this as an array index
33 NUMBER_OF_OBJECT_TYPES
52 float r; float g; float b; float a;
54 Colour(float _r, float _g, float _b, float _a) : r(_r), g(_g), b(_b), a(_a) {}
64 /** Used by all objects **/
65 std::vector<ObjectType> types; // types of objects
66 std::vector<Rect> bounds; // rectangle bounds of objects
68 /** Used by BEZIER to identify data position in relevant vector **/
69 std::vector<unsigned> data_indices;
71 /** Used by BEZIER only **/
72 std::vector<Bezier> beziers; // bezier curves - look up by data_indices
74 std::vector<std::pair<unsigned, unsigned> > groups;