X-Git-Url: http://shamusworld.gotdns.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fstructs.h;h=bc68adf76801316d1b790aa3d72695b879b0a3c8;hb=86ad64f2288cf50ae9832116ef37c433556355c4;hp=e0e17c89bf8dd5ce82ce381cfd555051557ee79c;hpb=da1348151182fe5340495ff8243e662b96c1fbfa;p=architektonas diff --git a/src/structs.h b/src/structs.h index e0e17c8..bc68adf 100644 --- a/src/structs.h +++ b/src/structs.h @@ -7,13 +7,13 @@ #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 }; enum ToolType { TTNone, TTLine, TTCircle, TTEllipse, TTArc, TTDimension, TTText, TTPolygon, TTSpline, TTRotate, TTMirror, TTTrim, TTTriangulate, TTDelete }; -enum ToolState { TSNone, TSPoint1, TSPoint2, TSDone }; +enum ToolState { TSNone, TSPoint1, TSPoint2, TSPoint3, TSPoint4, TSDone }; #define OBJECT_COMMON \ int type; \ @@ -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__