]> Shamusworld >> Repos - architektonas/blobdiff - src/object.cpp
Added Architektonas drawing file loading/saving infrastructure.
[architektonas] / src / object.cpp
index e38e6614ba353d4f7cd8102abdc7a19657c0b70d..ab95c0ea16fb5a35cf56af5074671b17cf8377b2 100644 (file)
@@ -5,7 +5,7 @@
 // (C) 2011 Underground Software
 // See the README and GPLv3 files for licensing and warranty information
 //
-// JLH = James L. Hammons <jlhamm@acm.org>
+// JLH = James Hammons <jlhamm@acm.org>
 //
 // WHO  WHEN        WHAT
 // ---  ----------  ------------------------------------------------------------
@@ -24,6 +24,7 @@ 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),
@@ -81,6 +82,12 @@ Object::~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;
@@ -91,6 +98,11 @@ void Object::Reparent(Object * newParent)
        parent = newParent;
 }
 
+Dimension * Object::GetAttachedDimension(void)
+{
+       return attachedDimension;
+}
+
 // Class methods...
 
 void Object::SetFixedAngle(bool state/*= true*/)
@@ -122,3 +134,8 @@ void Object::SetDimensionActive(bool state/*= true*/)
 {
        dimensionActive = state;
 }
+
+void Object::SetSnapMode(bool state/*= true*/)
+{
+       snapToGrid = state;
+}