X-Git-Url: http://shamusworld.gotdns.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fobject.cpp;h=925d9b4ceeeae7f6ef816da797d697bbf1327887;hb=e11a07565fe5ef3dfafbf9a933d7a1575e058867;hp=8f9377bf7345624c61acffb6b9de11735a4ec656;hpb=eb0057e8a8145032152e4c417fcd102ef5a21484;p=architektonas diff --git a/src/object.cpp b/src/object.cpp index 8f9377b..925d9b4 100644 --- a/src/object.cpp +++ b/src/object.cpp @@ -16,6 +16,7 @@ // #include "object.h" +#include // Initialize static variables bool Object::fixedAngle = false; @@ -28,19 +29,22 @@ bool Object::snapToGrid = true; Object::Object(): position(Vector(0, 0)), parent(0), state(OSInactive), oldState(OSInactive), - needUpdate(false), attachedDimension(0) + needUpdate(false)//, attachedDimension(0) { } Object::Object(Vector v, Object * passedInParent/*= 0*/): position(v), parent(passedInParent), - state(OSInactive), oldState(OSInactive), needUpdate(false), attachedDimension(0) + state(OSInactive), oldState(OSInactive), needUpdate(false)//, attachedDimension(0) { } Object::~Object() { +printf("Object: Destroyed!\n"); + for(uint i=0; iDisconnectAll(this); } @@ -113,6 +117,51 @@ Object::~Object() } +// This returns a point on the object at 'parameter', which is between 0 and 1. +// Default is to return the object's position. +/*virtual*/ Vector Object::GetPointAtParameter(double) +{ + return position; +} + + +// Since these functions are pretty much non-object specific, we can implement +// them here. :-) +/*virtual*/ void Object::Connect(Object * obj, double parameter) +{ + connected.push_back(Connection(obj, parameter)); +} + + +/*virtual*/ void Object::Disconnect(Object * obj, double parameter) +{ + for(uint i=0; i