]> Shamusworld >> Repos - architektonas/blobdiff - src/structs.h
Added object pane, grouping, load/save functionality.
[architektonas] / src / structs.h
index 6920e491cb92203f7555a57efc1c1268b209d22c..bc68adf76801316d1b790aa3d72695b879b0a3c8 100644 (file)
@@ -7,7 +7,7 @@
 #include "global.h"
 #include "vector.h"
 
-enum ObjectType { OTNone, OTLine, OTCircle, OTEllipse, OTArc, OTPolygon, OTDimension, OTSpline, OTText, OTContainer };
+enum ObjectType { OTNone = 0, OTLine, OTCircle, OTEllipse, OTArc, OTPolygon, OTDimension, OTSpline, OTText, OTContainer, OTCount };
 
 enum DimensionType { DTLinear, DTLinearVert, DTLinearHorz, DTRadial, DTDiametric, DTCircumferential, DTAngular, DTLeader };
 
@@ -106,14 +106,29 @@ struct Container {
        OBJECT_COMMON;
        std::vector<void *> objects;
        double scale;
+       bool topLevel;
 
-       Container(): type(OTContainer), id(Global::objectID++), selected(false), hovered(false), hitObject(false) {}
+       Container(bool tl = false): type(OTContainer), id(Global::objectID++), selected(false), hovered(false), hitObject(false), topLevel(tl) {}
+//     void DeleteContents(void) {}
+/*     void DeleteContents(Container * c)
+       {
+               std::vector<void *>::iterator i;
+
+               for(i=c->objects.begin(); i!=c->objects.end(); i++)
+               {
+                       Object * obj = (Object *)(*i);
+
+                       if (obj->type == OTContainer)
+                               DeleteContainer((Container *)obj);
+
+                       delete *i;
+               }
+       }*/
 };
 
 struct Object {
        OBJECT_COMMON;
 };
 
-
 #endif // __STRUCTS_H__