]> Shamusworld >> Repos - architektonas/blobdiff - src/line.cpp
In the middle of refactoring objects for loading/saving.
[architektonas] / src / line.cpp
index 880a79d60bc48254645794628ce1cb69dbe246fb..739842bbe9bd811d510cc0d071e81cead1c5dd58 100644 (file)
@@ -580,3 +580,23 @@ else
 }
 */
 
+/*virtual*/ void Line::Enumerate(FILE * file)
+{
+       fprintf(file, "LINE (%lf,%lf) (%lf,%lf)\n", position.x, position.y, endpoint.x, endpoint.y);
+}
+
+
+/*virtual*/ Object * Line::Copy(void)
+{
+#warning "!!! This doesn't take care of attached Dimensions !!!"
+/*
+This is a real problem. While having a pointer in the Dimension to this line's points is fast & easy,
+it creates a huge problem when trying to replicate an object like this.
+
+Maybe a way to fix that then, is to have reference numbers instead of pointers. That way, if you copy
+them, ... you might still have problems. Because you can't be sure if a copy will be persistant or not,
+you then *definitely* do not want them to have the same reference number.
+*/
+       return new Line(position, endpoint, parent);
+}
+