X-Git-Url: http://shamusworld.gotdns.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fobject.cpp;fp=src%2Fobject.cpp;h=8f9377bf7345624c61acffb6b9de11735a4ec656;hb=eb0057e8a8145032152e4c417fcd102ef5a21484;hp=ab95c0ea16fb5a35cf56af5074671b17cf8377b2;hpb=baf67656b97e3d61e9223e66ebe4f554e364cd4a;p=architektonas diff --git a/src/object.cpp b/src/object.cpp index ab95c0e..8f9377b 100644 --- a/src/object.cpp +++ b/src/object.cpp @@ -32,77 +32,105 @@ Object::Object(): position(Vector(0, 0)), parent(0), state(OSInactive), oldState { } + Object::Object(Vector v, Object * passedInParent/*= 0*/): position(v), parent(passedInParent), state(OSInactive), oldState(OSInactive), needUpdate(false), attachedDimension(0) { } + Object::~Object() { } + /*virtual*/ void Object::Draw(Painter *) { } + /*virtual*/ Vector Object::Center(void) { return Vector(); } + /*virtual*/ bool Object::Collided(Vector) { return false; } + /*virtual*/ void Object::PointerMoved(Vector) { } + /*virtual*/ void Object::PointerReleased(void) { } + /*virtual*/ bool Object::NeedsUpdate(void) { return needUpdate; } + // This is intended to be overridden by the Container class, for object morphing /*virtual*/ void Object::Transmute(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; } + +// This is meant for writing object data to a file. +/*virtual*/ void Object::Enumerate(FILE *) +{ +} + + +/*virtual*/ Object * Object::Copy(void) +{ + return new Object(position, parent); +} + + 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*/) @@ -110,31 +138,37 @@ void Object::SetFixedAngle(bool state/*= true*/) fixedAngle = state; } + void Object::SetFixedLength(bool state/*= true*/) { fixedLength = state; } + void Object::SetFont(QFont * f) { font = f; } + 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;