protected override void OnMouseDown(MouseEventArgs e) { base.OnMouseDown(e); m_MouseButtonsDown |= e.Button; Capture = true; switch (m_ManipulationState) { case MANIPULATION_STATE.CROP_RECTANGLE: { // Take care of crop rectangle manipulation if (m_CropRectangleManipulatedSpot == CROP_RECTANGLE_SPOT.NONE) { return; // Nothing to manipulate... } m_CropRectangleManipulationStarted = true; break; } case MANIPULATION_STATE.CALIBRATION_TARGET: { // Take care of calibration manipulation if (m_CalibrationStage == CALIBRATION_STAGE.PICK_CENTER) { m_CalibrationStage = CALIBRATION_STAGE.SET_RADIUS; } else if (m_CalibrationStage == CALIBRATION_STAGE.SET_RADIUS) { // We're done! Notify! m_CalibrationDelegate(m_CalibrationCenter, m_CalibrationRadius); ManipulationState = MANIPULATION_STATE.STOPPED; // End manipulation } break; } } }
/// <summary> /// Starts calibration target picking mode (user is expected to place the target with the mouse, then change the radius so the calibration can take place) /// </summary> /// <param name="_Notify"></param> public void StartCalibrationTargetPicking(CalibrationDone _Notify) { m_CalibrationDelegate = _Notify; m_CalibrationRadius = 0.0f; ManipulationState = MANIPULATION_STATE.CALIBRATION_TARGET; m_CalibrationStage = CALIBRATION_STAGE.PICK_CENTER; }
protected override void OnMouseDown( MouseEventArgs e ) { base.OnMouseDown( e ); m_MouseButtonsDown |= e.Button; Capture = true; switch ( m_ManipulationState ) { case MANIPULATION_STATE.CROP_RECTANGLE: { // Take care of crop rectangle manipulation if ( m_CropRectangleManipulatedSpot == CROP_RECTANGLE_SPOT.NONE ) return; // Nothing to manipulate... m_CropRectangleManipulationStarted = true; break; } case MANIPULATION_STATE.CALIBRATION_TARGET: { // Take care of calibration manipulation if ( m_CalibrationStage == CALIBRATION_STAGE.PICK_CENTER ) m_CalibrationStage = CALIBRATION_STAGE.SET_RADIUS; else if ( m_CalibrationStage == CALIBRATION_STAGE.SET_RADIUS ) { // We're done! Notify! m_CalibrationDelegate( m_CalibrationCenter, m_CalibrationRadius ); ManipulationState = MANIPULATION_STATE.STOPPED; // End manipulation } break; } } }
/// <summary> /// Starts calibration target picking mode (user is expected to place the target with the mouse, then change the radius so the calibration can take place) /// </summary> /// <param name="_Notify"></param> public void StartCalibrationTargetPicking( CalibrationDone _Notify ) { m_CalibrationDelegate = _Notify; m_CalibrationRadius = 0.0f; ManipulationState = MANIPULATION_STATE.CALIBRATION_TARGET; m_CalibrationStage = CALIBRATION_STAGE.PICK_CENTER; }