X-Git-Url: http://shamusworld.gotdns.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;ds=sidebyside;f=src%2Fdimension.cpp;h=29eaf6965ca9d1a4dcc2046078eda44805ba2e62;hb=d549bfdc8c872b966b9d787c00e5e8027366093c;hp=2107d67865e34c12fa0fa7feb8bde2f089e24b25;hpb=e11a07565fe5ef3dfafbf9a933d7a1575e058867;p=architektonas diff --git a/src/dimension.cpp b/src/dimension.cpp index 2107d67..29eaf69 100644 --- a/src/dimension.cpp +++ b/src/dimension.cpp @@ -22,16 +22,18 @@ 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()), type(dt), point1(NULL), point2(NULL) + length(p2.Magnitude()), dimensionType(dt), point1(NULL), point2(NULL) { + type = OTDimension; } // This is bad, p1 & p2 could be NULL, causing much consternation... Dimension::Dimension(Connection p1, Connection p2, DimensionType dt/*= DTLinear*/ , Object * p/*= NULL*/): dragging(false), draggingHandle1(false), draggingHandle2(false), - length(0), type(dt), point1(p1), point2(p2) + length(0), dimensionType(dt), point1(p1), point2(p2) { + type = OTDimension; } @@ -360,6 +362,29 @@ about keeping track of old states... } +/*virtual*/ QRectF Dimension::Extents(void) +{ + Point p1 = position; + Point p2 = endpoint; + + if (point1.object) + p1 = point1.object->GetPointAtParameter(point1.t); + + if (point2.object) + p2 = point2.object->GetPointAtParameter(point2.t); + + return QRectF(QPointF(p1.x, p1.y), QPointF(p2.x, p2.y)); +} + + +#if 0 +/*virtual*/ ObjectType Dimension::Type(void) +{ + return OTDimension; +} +#endif + + void Dimension::FlipSides(void) { #if 0