X-Git-Url: http://shamusworld.gotdns.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fobject.cpp;h=ab95c0ea16fb5a35cf56af5074671b17cf8377b2;hb=baf67656b97e3d61e9223e66ebe4f554e364cd4a;hp=eaef4d4484eb9d002d34777354554704cac985b7;hpb=c51c02d23ddd4423882da2c54b76f8f2c90c1c99;p=architektonas diff --git a/src/object.cpp b/src/object.cpp index eaef4d4..ab95c0e 100644 --- a/src/object.cpp +++ b/src/object.cpp @@ -5,7 +5,7 @@ // (C) 2011 Underground Software // See the README and GPLv3 files for licensing and warranty information // -// JLH = James L. Hammons +// JLH = James Hammons // // WHO WHEN WHAT // --- ---------- ------------------------------------------------------------ @@ -13,6 +13,7 @@ // JLH 04/01/2011 Added constructor to allow derived objects to have empty // constructor bodies, added state querying // JLH 04/02/2001 Added static methods for global states (fixed angle, etc) +// #include "object.h" @@ -21,15 +22,18 @@ bool Object::fixedAngle = false; bool Object::fixedLength = false; QFont * Object::font = 0; int Object::viewportHeight = 0; +bool Object::deleteActive = false; +bool Object::dimensionActive = false; +bool Object::snapToGrid = true; Object::Object(): position(Vector(0, 0)), parent(0), state(OSInactive), oldState(OSInactive), - needUpdate(false), dimPoint1(0), dimPoint2(0) + needUpdate(false), attachedDimension(0) { } Object::Object(Vector v, Object * passedInParent/*= 0*/): position(v), parent(passedInParent), - state(OSInactive), oldState(OSInactive), needUpdate(false), dimPoint1(0), dimPoint2(0) + state(OSInactive), oldState(OSInactive), needUpdate(false), attachedDimension(0) { } @@ -37,7 +41,7 @@ Object::~Object() { } -/*virtual*/ void Object::Draw(QPainter *) +/*virtual*/ void Object::Draw(Painter *) { } @@ -69,11 +73,36 @@ Object::~Object() { } +/*virtual*/ Object * Object::GetParent(void) +{ + return parent; +} + +/*virtual*/ void Object::Add(Object *) +{ +} + +// This returns a pointer to the point passed in, if it coincides. Otherwise returns NULL. +/*virtual*/ Vector * Object::GetPointAt(Vector) +{ + return 0; +} + ObjectState Object::GetState(void) { return state; } +void Object::Reparent(Object * newParent) +{ + parent = newParent; +} + +Dimension * Object::GetAttachedDimension(void) +{ + return attachedDimension; +} + // Class methods... void Object::SetFixedAngle(bool state/*= true*/) @@ -95,3 +124,18 @@ void Object::SetViewportHeight(int height) { viewportHeight = height; } + +void Object::SetDeleteActive(bool state/*= true*/) +{ + deleteActive = state; +} + +void Object::SetDimensionActive(bool state/*= true*/) +{ + dimensionActive = state; +} + +void Object::SetSnapMode(bool state/*= true*/) +{ + snapToGrid = state; +}