Beispiel #1
0
        public bool OnMouseDown(Metadata metadata, int activeKeyFrameIndex, PointF mouseCoordinates, long currentTimeStamp, bool allFrames)
        {
            //--------------------------------------------------------------------------------------
            // Change the ManipulationType if we are on a Drawing, Track, etc.
            // When we later pass in the MouseMove function, we will have the right ManipulationType set
            // and we will be able to do the right thing.
            //
            // We give priority to Keyframes Drawings because they can be moved...
            // If a Drawing is under a Trajectory or Chrono, we have to be able to move it around...
            //--------------------------------------------------------------------------------------

            manipulationType = ManipulationType.None;
            metadata.UnselectAll();

            // Store position (descaled: in original image coords).
            lastPoint.X = mouseCoordinates.X;
            lastPoint.Y = mouseCoordinates.Y;

            if (IsOnDrawing(metadata, activeKeyFrameIndex, mouseCoordinates, currentTimeStamp, allFrames))
            {
                return(true);
            }

            if (IsOnTrack(metadata, mouseCoordinates, currentTimeStamp))
            {
                return(true);
            }

            if (IsOnChronometer(metadata, mouseCoordinates, currentTimeStamp))
            {
                return(true);
            }

            if (IsOnExtraDrawing(metadata, mouseCoordinates, currentTimeStamp))
            {
                return(true);
            }

            // Moving the whole image (Direct Zoom)
            selectedObjectType = SelectedObjectType.None;
            return(false);
        }
Beispiel #2
0
        public bool OnMouseDown(Metadata _Metadata, int _iActiveKeyFrameIndex, Point _MouseCoordinates, long _iCurrentTimeStamp, bool _bAllFrames)
        {
            //--------------------------------------------------------------------------------------
            // Change the UserAction if we are on a Drawing, Track, etc.
            // When we later pass in the MouseMove function, we will have the right UserAction set
            // and we will be able to do the right thing.
            //
            // We give priority to Keyframes Drawings because they can be moved...
            // If a Drawing is under a Trajectory or Chrono, we have to be able to move it around...
            //
            // Maybe we could reuse the IsOndrawing, etc. functions from MetaData...
            //--------------------------------------------------------------------------------------

            bool bHit = true;

            m_UserAction = UserAction.None;

            _Metadata.UnselectAll();

            if (!IsOnDrawing(_Metadata, _iActiveKeyFrameIndex, _MouseCoordinates, _iCurrentTimeStamp, _bAllFrames))
            {
                if (!IsOnChrono(_Metadata, _MouseCoordinates, _iCurrentTimeStamp))
                {
                    if (!IsOnTrack(_Metadata, _MouseCoordinates, _iCurrentTimeStamp))
                    {
                        if (!IsOnGrids(_Metadata, _MouseCoordinates))
                        {
                            // Moving the whole image (Direct Zoom)
                            m_SelectedObjectType = SelectedObjectType.None;
                            bHit = false;
                        }
                    }
                }
            }

            // Store position (descaled: in original image coords).
            m_lastPoint.X = _MouseCoordinates.X;
            m_lastPoint.Y = _MouseCoordinates.Y;

            return(bHit);
        }