]> Shamusworld >> Repos - architektonas/blobdiff - src/dimension.cpp
In the middle of refactoring objects for loading/saving.
[architektonas] / src / dimension.cpp
index 3060ff1b930c8682409f10993b73622562fbb098..ad2ffcbe38a08bd88fbbc85ea8333060306862d1 100644 (file)
@@ -25,6 +25,7 @@ Dimension::Dimension(Vector p1, Vector p2, DimensionType dt/*= DTLinear*/ ,Objec
 {
 }
 
+
 // This is bad, p1 & p2 could be NULL, causing much consternation...
 Dimension::Dimension(Vector * p1, Vector * p2, DimensionType dt/*= DTLinear*/ , Object * p/*= NULL*/):
        Object(*p1, p), endpoint(*p2),
@@ -33,10 +34,12 @@ Dimension::Dimension(Vector * p1, Vector * p2, DimensionType dt/*= DTLinear*/ ,
 {
 }
 
+
 Dimension::~Dimension()
 {
 }
 
+
 /*virtual*/ void Dimension::Draw(Painter * painter)
 {
        // If there are valid Vector pointers in here, use them to update the internal
@@ -130,6 +133,7 @@ retarded is that? :-/
 */
 }
 
+
 /*virtual*/ Vector Dimension::Center(void)
 {
        // Technically, this is the midpoint but who are we to quibble? :-)
@@ -137,6 +141,7 @@ retarded is that? :-/
        return endpoint + v;
 }
 
+
 /*virtual*/ bool Dimension::Collided(Vector /*point*/)
 {
 #if 0
@@ -237,6 +242,7 @@ Like so:
        return false;
 }
 
+
 /*virtual*/ void Dimension::PointerMoved(Vector point)
 {
        // We know this is true because mouse move messages don't come here unless
@@ -277,6 +283,7 @@ Like so:
                needUpdate = false;
 }
 
+
 /*virtual*/ void Dimension::PointerReleased(void)
 {
        if (draggingHandle1 || draggingHandle2)
@@ -319,28 +326,33 @@ about keeping track of old states...
                state = oldState;
 }
 
+
 void Dimension::SetPoint1(Vector * v)
 {
        point1 = v;
        needUpdate = true;
 }
 
+
 void Dimension::SetPoint2(Vector * v)
 {
        point2 = v;
        needUpdate = true;
 }
 
+
 Vector Dimension::GetPoint1(void)
 {
        return position;
 }
 
+
 Vector Dimension::GetPoint2(void)
 {
        return endpoint;
 }
 
+
 void Dimension::FlipSides(void)
 {
 #if 0
@@ -355,3 +367,9 @@ void Dimension::FlipSides(void)
        needUpdate = true;
 }
 
+
+/*virtual*/ void Dimension::Enumerate(FILE * file)
+{
+       fprintf(file, "DIMENSION (%lf,%lf) (%lf,%lf) %i\n", position.x, position.y, endpoint.x, endpoint.y, type);
+}
+