public MouseNavigateEventArgs(PointF point, EMouseBtns btns, float delta, bool along_ray) { ZNavigation = true; Point = point; Btns = btns; Delta = delta; AlongRay = along_ray; Handled = false; }
public MouseNavigateEventArgs(PointF point, EMouseBtns btns, ENavOp nav_op, bool nav_beg_or_end) { ZNavigation = false; Point = point; Btns = btns; NavOp = nav_op; NavBegOrEnd = nav_beg_or_end; Handled = false; }
public HitTestResult(EZone zone, Point client_point, Point chart_point, ModifierKeys modifier_keys, EMouseBtns mouse_btns, IEnumerable <Hit> hits, View3d.Camera cam) { Zone = zone; ClientPoint = client_point; ChartPoint = chart_point; Hits = hits.ToList(); ModifierKeys = modifier_keys; MouseBtns = mouse_btns; Camera = cam; }
/// <summary> /// Zoom using the mouse. /// 'point' is a point in client rect space. /// 'delta' is the mouse wheel scroll delta value (i.e. 120 = 1 click) /// 'along_ray' is true if the camera should move along a ray cast through 'point' /// Returns true if the scene requires refreshing</summary> public bool MouseNavigateZ(PointF point, EMouseBtns btns, float delta, bool along_ray) { if (m_in_mouse_navigate != 0) { return(false); } using (Scope.Create(() => ++ m_in_mouse_navigate, () => -- m_in_mouse_navigate)) { // Notify of navigating, allowing client code to make // changes or optionally handle the mouse event. var args = new MouseNavigateEventArgs(point, btns, delta, along_ray); MouseNavigating?.Invoke(this, args); if (args.Handled) { return(false); } // The mouse event wasn't handled, so forward to the window for navigation return(View3D_MouseNavigateZ(Handle, v2.From(args.Point), args.Delta, args.AlongRay)); } }
/// <summary> /// Mouse navigation and/or object manipulation. /// 'point' is a point in client space. /// 'btns' is the state of the mouse buttons (MK_LBUTTON etc) /// 'nav_op' is the logical navigation operation to perform. /// 'nav_beg_or_end' should be true on mouse button down or up, and false during mouse movement /// Returns true if the scene requires refreshing</summary> public bool MouseNavigate(PointF point, EMouseBtns btns, ENavOp nav_op, bool nav_beg_or_end) { // This function is not in the CameraControls object because it is not solely used // for camera navigation. It can also be used to manipulate objects in the scene. if (m_in_mouse_navigate != 0) { return(false); } using (Scope.Create(() => ++ m_in_mouse_navigate, () => -- m_in_mouse_navigate)) { // Notify of navigating, allowing client code to make // changes or optionally handle the mouse event. var args = new MouseNavigateEventArgs(point, btns, nav_op, nav_beg_or_end); MouseNavigating?.Invoke(this, args); if (args.Handled) { return(false); } // The mouse event wasn't handled, so forward to the window for navigation return(View3D_MouseNavigate(Handle, v2.From(args.Point), args.NavOp, args.NavBegOrEnd)); } }
public ChartAreaSelectEventArgs(BBox selection_area, EMouseBtns mouse_btns) { SelectionArea = selection_area; MouseBtns = mouse_btns; Handled = false; }
public bool MouseNavigate(PointF point, EMouseBtns btns, bool nav_beg_or_end) { var op = Camera.MouseBtnToNavOp(btns); return(MouseNavigate(point, btns, op, nav_beg_or_end)); }