Exemplo n.º 1
0
 private static void UpdateArrowHeadDirections(LinearDimension dl)
 {
     var v = dl.DimensionLineP1 - dl.DimensionLineP2;
     v.Normalize();
     dl.ArrowHead1Direction = v;
     v.Negate();
     dl.ArrowHead2Direction = v;
 }
Exemplo n.º 2
0
 private static void InitializeOffsetPoint(LinearDimension dl)
 {
     var d = Vector.Multiply(dl.P1 - dl.P2, dl.OffsetDirection);
     Point op = d < 0
         ? dl.P2
         : dl.P1;
     if (IsNan(dl.OffsetPoint) || (dl.OffsetPoint - op).Length > 1e-3)
     {
         dl.SetCurrentValue(OffsetPointProperty, dl.P2);
         dl._hasExplicitOffsetPoint = false;
     }
 }
Exemplo n.º 3
0
 private static Point GetOffsetPoint(Point p, LinearDimension dl)
 {
     var op = dl.OffsetPoint + (dl.Scale * dl.Offset * dl.OffsetDirection);
     var d = Vector.Multiply(op - p, dl.OffsetDirection);
     return p + (d * dl.OffsetDirection);
 }
Exemplo n.º 4
0
 private static void InitializeOffsetVector(LinearDimension dl)
 {
     var v = dl.P1 - dl.P2;
     v.Normalize();
     var dir = Vector.Multiply(v, Rotate90Cw.Value);
     if (!dl.OffsetDirection.Equals(dir))
     {
         dl.SetCurrentValue(OffsetDirectionProperty, dir);
         dl._hasExplicitOffsetDirection = false;
     }
 }