- objects.erase(objects.begin() + i); // Calls the destructor, (deletes the object, I presume... O_o)
+#if 0
+Dimension * dimension = objects[i]->GetAttachedDimension();
+#endif
+ Object * objectToDelete = objects[i];
+ objects.erase(objects.begin() + i); // Calls the destructor, (deletes the object, I presume... O_o) [NOPE! SURE DOESN'T!]
+ delete objectToDelete;
+
+// If this object had an attached dimension, reattach it to another object, if any...
+// The only problem with that approach is if the object it gets attached to is deleted,
+// it will call the dimension to use a NULL pointer and BLAMMO
+#if 0
+if (dimension)
+{
+ Vector p1 = dimension->GetPoint1();
+ Vector p2 = dimension->GetPoint2();
+ for(int j=0; j<(int)objects.size(); j++)
+ {
+ Vector * objectP1 = objects[i]->GetPointAt(p1);
+ Vector * objectP2 = objects[i]->GetPointAt(p2);
+
+ if (objectP1)
+ dimension->SetPoint1(objectP1);
+
+ if (objectP2)
+ dimension->SetPoint2(objectP2);
+ }
+}
+#endif
+ // This only allows deleting objects one at a time...