+
+bool Dimension::HitStateChanged(void)
+{
+ if ((hitPoint1 != oldHitPoint1) || (hitPoint2 != oldHitPoint2)
+ || (hitLine != oldHitLine) || (hitFlipSwitch != oldHitFlipSwitch)
+ || (hitChangeSwitch1 != oldHitChangeSwitch1)
+ || (hitChangeSwitch2 != oldHitChangeSwitch2))
+ return true;
+
+ return false;
+}
+
+
+/*virtual*/ void Dimension::Translate(Vector amount)
+{
+ position += amount;
+ endpoint += amount;
+}
+
+
+/*virtual*/ void Dimension::Rotate(Point point, double angle)
+{
+ Point l1 = Geometry::RotatePointAroundPoint(position, point, angle);
+ Point l2 = Geometry::RotatePointAroundPoint(endpoint, point, angle);
+ position = l1;
+ endpoint = l2;
+}
+
+
+/*virtual*/ void Dimension::Mirror(Point p1, Point p2)
+{
+ Point l1 = Geometry::MirrorPointAroundLine(position, p1, p2);
+ Point l2 = Geometry::MirrorPointAroundLine(endpoint, p1, p2);
+ position = l1;
+ endpoint = l2;
+}
+
+
+/*virtual*/ void Dimension::Save(void)
+{
+ Object::Save();
+ oldEndpoint = endpoint;
+}
+
+
+/*virtual*/ void Dimension::Restore(void)
+{
+ Object::Restore();
+ endpoint = oldEndpoint;
+}
+
+
+/*virtual*/ void Dimension::Enumerate(FILE * file)
+{
+ fprintf(file, "DIMENSION %i (%lf,%lf) (%lf,%lf) %i\n", layer, position.x, position.y, endpoint.x, endpoint.y, dimensionType);
+}
+
+
+/*virtual*/ Object * Dimension::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.
+*/
+
+ Dimension * d = new Dimension(position, endpoint, dimensionType, parent);
+ d->size = size;
+ return d;
+}
+
+
+// Dimensions are special: they contain exactly *two* points. Here, we check
+// only for zero/non-zero in returning the correct points.
+/*virtual*/ Vector Dimension::GetPointAtParameter(double parameter)