public override void MoveHandle(PointF point, int handleNumber, Keys modifiers) { int constraintAngleSubdivisions = 8; // (Constraint by 45° steps). switch (handleNumber) { case 1: if ((modifiers & Keys.Shift) == Keys.Shift) { points["a"] = GeometryHelper.GetPointAtClosestRotationStepCardinal(points["b"], point, constraintAngleSubdivisions); } else { points["a"] = point; } SignalTrackablePointMoved("a"); break; case 2: if ((modifiers & Keys.Shift) == Keys.Shift) { points["b"] = GeometryHelper.GetPointAtClosestRotationStepCardinal(points["a"], point, constraintAngleSubdivisions); } else { points["b"] = point; } SignalTrackablePointMoved("b"); break; case 3: // Move the center of the mini label to the mouse coord. miniLabel.SetLabel(point); break; } if (CalibrationHelper != null) { CalibrationHelper.CalibrationByLine_Update(Id, points["a"], points["b"]); } }
public override void MoveHandle(PointF point, int handle, Keys modifiers) { int constraintAngleSubdivisions = 8; // (Constraint by 45° steps). switch (handle) { case 1: points["o"] = point; SignalTrackablePointMoved("o"); break; case 2: if ((modifiers & Keys.Shift) == Keys.Shift) { points["a"] = GeometryHelper.GetPointAtClosestRotationStepCardinal(points["o"], point, constraintAngleSubdivisions); } else { points["a"] = point; } SignalTrackablePointMoved("a"); break; case 3: if ((modifiers & Keys.Shift) == Keys.Shift) { points["b"] = GeometryHelper.GetPointAtClosestRotationStepCardinal(points["o"], point, constraintAngleSubdivisions); } else { points["b"] = point; } SignalTrackablePointMoved("b"); break; default: break; } }
private static void MovePointHandleAtDistance(GenericPosture posture, int handle, PointF point, GenericPostureConstraintDistanceToPoint constraint, Keys modifiers) { if (constraint == null) { MovePointHandleFreely(posture, handle, point); return; } PointF parent = posture.PointList[constraint.RefPoint]; PointF child = posture.PointList[posture.Handles[handle].Reference]; float distance = GeometryHelper.GetDistance(parent, child); PointF temp = GeometryHelper.GetPointAtDistance(parent, point, distance); int constraintAngleSubdivisions = 8; // (Constraint by 45° steps). if ((modifiers & Keys.Shift) == Keys.Shift) { posture.PointList[posture.Handles[handle].Reference] = GeometryHelper.GetPointAtClosestRotationStepCardinal(parent, temp, constraintAngleSubdivisions); } else { posture.PointList[posture.Handles[handle].Reference] = temp; } }