コード例 #1
0
        public override void MoveHandle(PointF point, int handle, Keys modifiers)
        {
            int index = handle - 1;

            GenericPostureConstraintEngine.MoveHandle(genericPosture, CalibrationHelper, index, point, modifiers);
            SignalTrackablePointMoved(index);
        }
コード例 #2
0
ファイル: GenericPosture.cs プロジェクト: wyj64852999/Kinovea
        public void SetTrackablePointValue(string name, PointF value, CalibrationHelper calibrationHelper)
        {
            // Value coming from tracking.
            int pointIndex = int.Parse(name);

            if (pointIndex >= PointList.Count)
            {
                throw new ArgumentException("This point is not bound.");
            }

            int handleIndex = Handles.FindIndex((h) => h.Reference == pointIndex);

            GenericPostureConstraintEngine.MoveHandle(this, calibrationHelper, handleIndex, value, Keys.None);
        }
コード例 #3
0
        public void SetTrackablePointValue(string name, PointF value, CalibrationHelper calibrationHelper, EventHandler <TrackablePointMovedEventArgs> trackablePointMoved)
        {
            // Value coming from tracking.
            int pointIndex = int.Parse(name);

            if (pointIndex >= PointList.Count)
            {
                throw new ArgumentException("This point is not bound.");
            }

            int handleIndex = Handles.FindIndex((h) => h.Reference == pointIndex);

            // Honor the constraint system.
            // Tracking can move the endpoint of a horizontal slide arbitrarily and we force it back.
            GenericPostureConstraintEngine.MoveHandle(this, calibrationHelper, handleIndex, value, Keys.None);

            // Store the final position into the tracking timeline for proper kinematics.
            if (PointList[pointIndex] != value && trackablePointMoved != null)
            {
                SignalTrackablePointMoved(handleIndex, trackablePointMoved);
            }
        }