コード例 #1
0
        private static void MovePointHandleAlongParallel(GenericPosture posture, CalibrationHelper calibrationHelper, int handle, PointF point, GenericPostureConstraintParallelSlide constraint)
        {
            if (constraint == null)
            {
                return;
            }

            PointF a = posture.PointList[constraint.A];
            PointF b = posture.PointList[constraint.B];
            PointF c = posture.PointList[constraint.C];

            PointF aPlane     = calibrationHelper.GetPoint(a);
            PointF bPlane     = calibrationHelper.GetPoint(b);
            PointF cPlane     = calibrationHelper.GetPoint(c);
            PointF pointPlane = calibrationHelper.GetPoint(point);

            PointF resultPlane = GeometryHelper.GetPointOnParallel(aPlane, bPlane, cPlane, pointPlane);
            PointF result      = calibrationHelper.GetImagePoint(resultPlane);

            posture.PointList[posture.Handles[handle].Reference] = result;
        }
コード例 #2
0
        private static void AlignPointParallel(GenericPosture posture, CalibrationHelper calibrationHelper, GenericPostureParallelAlign impact)
        {
            // The point is moved so that it stays on a segment parallel to another segment.

            if (impact == null)
            {
                return;
            }

            PointF a           = posture.PointList[impact.A];
            PointF b           = posture.PointList[impact.B];
            PointF c           = posture.PointList[impact.C];
            PointF pointToMove = posture.PointList[impact.PointToMove];

            PointF aPlane     = calibrationHelper.GetPoint(a);
            PointF bPlane     = calibrationHelper.GetPoint(b);
            PointF cPlane     = calibrationHelper.GetPoint(c);
            PointF pointPlane = calibrationHelper.GetPoint(pointToMove);

            PointF resultPlane = GeometryHelper.GetPointOnParallel(aPlane, bPlane, cPlane, pointPlane);
            PointF result      = calibrationHelper.GetImagePoint(resultPlane);

            posture.PointList[impact.PointToMove] = result;
        }