X-Git-Url: http://shamusworld.gotdns.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fdimension.cpp;h=b3f1e7f3d915d0392c37abe7c2d01b8826b13b95;hb=565c33c91ea355528145ba94b31b2e44309d0834;hp=c9777e50bd673688bc5d06dee646c6a4753cd19d;hpb=2549a213bacfb2f6993ec143083d72b716854345;p=architektonas diff --git a/src/dimension.cpp b/src/dimension.cpp index c9777e5..b3f1e7f 100644 --- a/src/dimension.cpp +++ b/src/dimension.cpp @@ -20,7 +20,7 @@ #include "painter.h" -Dimension::Dimension(Vector p1, Vector p2, DimensionType dt/*= DTLinear*/ ,Object * p/*= NULL*/): +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()), dimensionType(dt), size(0.25), point1(NULL), point2(NULL) @@ -31,7 +31,7 @@ Dimension::Dimension(Vector p1, Vector p2, DimensionType dt/*= DTLinear*/ ,Objec // This is bad, p1 & p2 could be NULL, causing much consternation... -Dimension::Dimension(Connection p1, Connection p2, DimensionType dt/*= DTLinear*/ , Object * p/*= NULL*/): +Dimension::Dimension(Connection p1, Connection p2, DimensionType dt/*= DTLinear*/, Object * p/*= NULL*/): dragging(false), draggingHandle1(false), draggingHandle2(false), length(0), dimensionType(dt), size(0.25), point1(p1), point2(p2) { @@ -61,6 +61,7 @@ all objects move as a unified whole. /*virtual*/ void Dimension::Draw(Painter * painter) { +#if 0 // If there are valid Vector pointers in here, use them to update the internal // positions. Otherwise, we just use the internal positions by default. if (point1.object) @@ -68,6 +69,7 @@ all objects move as a unified whole. if (point2.object) endpoint = point2.object->GetPointAtParameter(point2.t); +#endif painter->SetPen(QPen(Qt::magenta, 2.0, Qt::DotLine)); @@ -402,6 +404,17 @@ same reference number. } +/*virtual*/ void Dimension::MovePointAtParameter(double parameter, Vector v) +{ + if (parameter == 0) + position += v; + else if (parameter == 1.0) + endpoint += v; + else + {} // Not sure how to handle this case :-P +} + + /*virtual*/ void Dimension::Connect(Object * obj, double param) { // There are four possibilities here...