Canguro.Controller.TrackingController.MouseMove C# (CSharp) Method

MouseMove() public method

public MouseMove ( object sender, MouseEventArgs e, Canguro activeView ) : bool
sender object
e MouseEventArgs
activeView Canguro
return bool
        public bool MouseMove(object sender, MouseEventArgs e, Canguro.View.GraphicView activeView)
        {
            Viewport vp = activeView.Viewport;
            if (e.X >= vp.X && e.X <= vp.X + vp.Width && e.Y >= vp.Y && e.Y <= vp.Y + vp.Height)
            {
                bool needPaint = (trackingService != null);

                if (snapController.IsActive)
                    needPaint |= snapController.MouseMove(activeView, e) || (trackingService != null);

                if (hoverController.IsActive && !activeView.ModelRenderer.RenderOptions.ShowAnimated)
                    needPaint |= hoverController.MouseMove(activeView, e);

                if (needPaint && trackingService != null)
                    trackingService.MouseMove(e.Location);

                return needPaint;
            }

            return false;
        }

Usage Example

示例#1
0
        /// <summary>
        /// Method to dispatch the MouseMove event from the ScenePanel and forward it to
        /// the current ViewCommand. It is responsible of updating the current view if
        /// necessary and of setting the new tracking point for the active TrackingService.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e">MouseMove params</param>
        void scenePanel_MouseMove(object sender, System.Windows.Forms.MouseEventArgs e)
        {
            System.Diagnostics.Debug.Assert(mainFrm != null);
            // Si el botón del mouse está apretado o es el SelectionCommand mandar evento
            // (La selección lo necesita aunque no esté apretado para poder manejar el Tracking)
            if ((viewCmd == SelectionCommand) || ((mainFrm.ScenePanel.Capture == true) && (viewCmd != null)))
            {
                GraphicViewManager gvm = GraphicViewManager.Instance;
                GraphicView        gv  = gvm.ActiveView;
                viewCmd.MouseMove(gv, e);

                if (viewCmd != SelectionCommand)
                {
                    gvm.UpdateView(gv);
                }
                else
                {
                    // Notify and Paint trackers
                    if (TrackingController.MouseMove(this, e, gv))
                    {
                        gvm.Presenter.TrackingPaint(this, e, gv, TrackingController);
                    }
                }
            }
        }