2 // object.cpp: Base class for all CAD objects
4 // Part of the Architektonas Project
5 // (C) 2011 Underground Software
6 // See the README and GPLv3 files for licensing and warranty information
8 // JLH = James L. Hammons <jlhamm@acm.org>
11 // --- ---------- ------------------------------------------------------------
12 // JLH 03/22/2011 Created this file
13 // JLH 04/01/2011 Added constructor to allow derived objects to have empty
14 // constructor bodies, added state querying
15 // JLH 04/02/2001 Added static methods for global states (fixed angle, etc)
19 // Initialize static variables
20 bool Object::fixedAngle = false;
21 bool Object::fixedLength = false;
22 QFont * Object::font = 0;
23 int Object::viewportHeight = 0;
26 Object::Object(): position(Vector(0, 0)), parent(0), state(OSInactive), oldState(OSInactive),
27 needUpdate(false), dimPoint1(0), dimPoint2(0)
31 Object::Object(Vector v, Object * passedInParent/*= 0*/): position(v), parent(passedInParent),
32 state(OSInactive), oldState(OSInactive), needUpdate(false), dimPoint1(0), dimPoint2(0)
40 /*virtual*/ void Object::Draw(QPainter *)
44 /*virtual*/ Vector Object::Center(void)
49 /*virtual*/ bool Object::Collided(Vector)
54 /*virtual*/ void Object::PointerMoved(Vector)
58 /*virtual*/ void Object::PointerReleased(void)
62 /*virtual*/ bool Object::NeedsUpdate(void)
67 // This is intended to be overridden by the Container class, for object morphing
68 /*virtual*/ void Object::Transmute(Object *, Object *)
72 ObjectState Object::GetState(void)
79 void Object::SetFixedAngle(bool state/*= true*/)
84 void Object::SetFixedLength(bool state/*= true*/)
89 void Object::SetFont(QFont * f)
94 void Object::SetViewportHeight(int height)
96 viewportHeight = height;