X-Git-Url: http://shamusworld.gotdns.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fobject.cpp;h=523601dd755b438f20e0857bad2a127b0aa33f2e;hb=70297ac8ec7453e4196f4b58056bcfe4b04f2aca;hp=8f9377bf7345624c61acffb6b9de11735a4ec656;hpb=eb0057e8a8145032152e4c417fcd102ef5a21484;p=architektonas diff --git a/src/object.cpp b/src/object.cpp index 8f9377b..523601d 100644 --- a/src/object.cpp +++ b/src/object.cpp @@ -16,6 +16,7 @@ // #include "object.h" +#include // Initialize static variables bool Object::fixedAngle = false; @@ -25,22 +26,31 @@ int Object::viewportHeight = 0; bool Object::deleteActive = false; bool Object::dimensionActive = false; bool Object::snapToGrid = true; +//snapToPoints all well here? +bool Object::ignoreClicks = false; +bool Object::dontMove = false; +bool Object::selectionInProgress = false; +QRectF Object::selection; -Object::Object(): position(Vector(0, 0)), parent(0), state(OSInactive), oldState(OSInactive), - needUpdate(false), attachedDimension(0) +Object::Object(): position(Vector(0, 0)), parent(0), type(OTObject), + state(OSInactive), oldState(OSInactive), 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); } @@ -77,6 +87,12 @@ Object::~Object() } +/*virtual*/ bool Object::HitTest(Point) +{ + return false; +} + + // This is intended to be overridden by the Container class, for object morphing /*virtual*/ void Object::Transmute(Object *, Object *) { @@ -113,6 +129,81 @@ 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