]> Shamusworld >> Repos - architektonas/blobdiff - src/dimension.cpp
Added Architektonas drawing file loading/saving infrastructure.
[architektonas] / src / dimension.cpp
index 5aa6a8829a815634a96135411c5c4bda46370580..3060ff1b930c8682409f10993b73622562fbb098 100644 (file)
 #include "painter.h"
 
 
-Dimension::Dimension(Vector p1, Vector p2, Object * p/*= NULL*/): Object(p1, p), endpoint(p2),
+Dimension::Dimension(Vector p1, Vector p2, DimensionType dt/*= DTLinear*/ ,Object * p/*= NULL*/):
+       Object(p1, p), endpoint(p2),
        dragging(false), draggingHandle1(false), draggingHandle2(false),
-       length(p2.Magnitude()), point1(NULL), point2(NULL)
+       length(p2.Magnitude()), type(dt), point1(NULL), point2(NULL)
 {
 }
 
 // This is bad, p1 & p2 could be NULL, causing much consternation...
-Dimension::Dimension(Vector * p1, Vector * p2, Object * p/*= NULL*/): Object(*p1, p), endpoint(*p2),
+Dimension::Dimension(Vector * p1, Vector * p2, DimensionType dt/*= DTLinear*/ , Object * p/*= NULL*/):
+       Object(*p1, p), endpoint(*p2),
        dragging(false), draggingHandle1(false), draggingHandle2(false),
-       length(p2->Magnitude()), point1(p1), point2(p2)
+       length(p2->Magnitude()), type(dt), point1(p1), point2(p2)
 {
 }
 
@@ -329,6 +331,16 @@ void Dimension::SetPoint2(Vector * v)
        needUpdate = true;
 }
 
+Vector Dimension::GetPoint1(void)
+{
+       return position;
+}
+
+Vector Dimension::GetPoint2(void)
+{
+       return endpoint;
+}
+
 void Dimension::FlipSides(void)
 {
 #if 0
@@ -342,3 +354,4 @@ void Dimension::FlipSides(void)
 #endif
        needUpdate = true;
 }
+