X-Git-Url: http://shamusworld.gotdns.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fstructs.h;h=bc68adf76801316d1b790aa3d72695b879b0a3c8;hb=e78daf62eb771ee29a59035d16cf63c1e6ebe144;hp=6920e491cb92203f7555a57efc1c1268b209d22c;hpb=0fcc2d879e1e0ca17eeaceae2159f5143a06586f;p=architektonas diff --git a/src/structs.h b/src/structs.h index 6920e49..bc68adf 100644 --- a/src/structs.h +++ b/src/structs.h @@ -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 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::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__