|
Blender V4.3
|
#include <view3d_navigate.hh>
Inherited by ViewOpsData_Utility.
Public Member Functions | |
ViewOpsData definition | |
| void | init_context (bContext *C) |
| void | state_backup () |
| void | state_restore () |
| void | init_navigation (bContext *C, const wmEvent *event, const ViewOpsType *nav_type, const float dyn_ofs_override[3]=nullptr, const bool use_cursor_init=false) |
| void | end_navigation (bContext *C) |
Public Attributes | ||
| Scene * | scene | |
| ScrArea * | area | |
| ARegion * | region | |
| View3D * | v3d | |
| RegionView3D * | rv3d | |
| Depsgraph * | depsgraph | |
| wmTimer * | timer | |
| struct { | ||
| float ofs [3] | ||
| float ofs_lock [2] | ||
| float camdx | ||
| float camdy | ||
| float camzoom | ||
| float dist | ||
| float quat [4] | ||
| char persp | ||
| char view | ||
| char view_axis_roll | ||
| char persp_with_auto_persp_applied | ||
| int event_xy [2] | ||
| int event_xy_offset [2] | ||
| int event_type | ||
| float zfac | ||
| float trackvec [3] | ||
| float mousevec [3] | ||
| Dial * dial | ||
| } | init | |
| struct { | ||
| int event_xy [2] | ||
| double time | ||
| } | prev | |
| struct { | ||
| float viewquat [4] | ||
| } | curr | |
| const ViewOpsType * | nav_type | |
| eViewOpsFlag | viewops_flag | |
| float | reverse | |
| bool | axis_snap | |
| float | dyn_ofs [3] | |
| bool | use_dyn_ofs | |
| bool | use_dyn_ofs_ortho_correction | |
Generic View Operator Custom-Data
Definition at line 93 of file view3d_navigate.hh.
| void ViewOpsData::end_navigation | ( | bContext * | C | ) |
Definition at line 379 of file view3d_navigate.cc.
References CTX_wm_manager(), ED_region_tag_redraw(), init, MEM_SAFE_FREE, RegionView3D::rflag, rv3d, timer, wmTimer::win, and WM_event_timer_remove().
Referenced by ED_view3d_navigation_do(), ED_view3d_navigation_free(), view3d_navigate_modal_fn(), viewops_data_free(), and vieworbit_exec().
| void ViewOpsData::init_context | ( | bContext * | C | ) |
Definition at line 78 of file view3d_navigate.cc.
References CTX_data_ensure_evaluated_depsgraph(), CTX_data_scene(), CTX_wm_area(), CTX_wm_region(), depsgraph, rv3d, and v3d.
Referenced by view3d_navigate_invoke_impl(), viewops_data_create(), ViewOpsData_Utility::ViewOpsData_Utility(), and vieworbit_exec().
| void ViewOpsData::init_navigation | ( | bContext * | C, |
| const wmEvent * | event, | ||
| const ViewOpsType * | nav_type, | ||
| const float | dyn_ofs_override[3] = nullptr, | ||
| const bool | use_cursor_init = false ) |
Definition at line 221 of file view3d_navigate.cc.
References add_v2_v2v2_int(), add_v3_v3v3(), BLI_rcti_cent_x(), BLI_rcti_cent_y(), calctrackballvec(), closest_to_line_v3(), copy_qt_qt(), copy_v2_v2_int(), copy_v3_v3(), curr, depsgraph, RegionView3D::dist, dyn_ofs, ED_region_tag_redraw(), ED_view3d_calc_zfac(), ED_view3d_camera_lock_init_ex(), ED_view3d_persp_ensure(), ED_view3d_win_to_3d(), ED_view3d_win_to_vector(), ELEM, event_xy_offset, ViewOpsType::flag, float, init, RegionView3D::is_persp, len_v3v3(), wmEvent::mval, nav_type, navigate_pivot_get(), NDOF_MODE_ORBIT, negate_v3(), negate_v3_v3(), RegionView3D::ofs, RegionView3D::persmat, RegionView3D::persp, prev, reverse, RegionView3D::rflag, rv3d, RV3D_NAVIGATING, state_backup(), blender::math::transform_point(), use_dyn_ofs, use_dyn_ofs_ortho_correction, v3d, RegionView3D::viewinv, viewops_flag, VIEWOPS_FLAG_DEPTH_NAVIGATE, viewops_flag_from_prefs(), VIEWOPS_FLAG_INIT_ZFAC, VIEWOPS_FLAG_ORBIT_SELECT, VIEWOPS_FLAG_PERSP_ENSURE, VIEWOPS_FLAG_ZOOM_TO_MOUSE, RegionView3D::viewquat, wmEvent::xy, and zero_v2_int().
Referenced by view3d_navigation_invoke_generic(), viewops_data_create(), vieworbit_exec(), and viewroll_exec().
| void ViewOpsData::state_backup | ( | ) |
Definition at line 89 of file view3d_navigate.cc.
References RegionView3D::camdx, RegionView3D::camdy, RegionView3D::camzoom, copy_qt_qt(), copy_v2_v2(), copy_v3_v3(), RegionView3D::dist, init, RegionView3D::ofs, RegionView3D::ofs_lock, RegionView3D::persp, rv3d, RegionView3D::view, RegionView3D::view_axis_roll, and RegionView3D::viewquat.
Referenced by init_navigation().
| void ViewOpsData::state_restore | ( | ) |
Definition at line 104 of file view3d_navigate.cc.
References RegionView3D::camdx, RegionView3D::camdy, RegionView3D::camzoom, copy_qt_qt(), copy_v2_v2(), copy_v3_v3(), depsgraph, RegionView3D::dist, ED_view3d_camera_lock_check(), ED_view3d_camera_lock_sync(), ED_view3d_offset_lock_check(), init, RegionView3D::ofs, RegionView3D::ofs_lock, RegionView3D::persp, rv3d, RV3D_BOXVIEW, RV3D_CAMOB, RV3D_LOCK_FLAGS, v3d, RegionView3D::view, view3d_boxview_sync(), RegionView3D::view_axis_roll, and RegionView3D::viewquat.
Referenced by viewdolly_modal(), viewmove_modal_impl(), viewroll_modal(), viewrotate_modal_impl(), and viewzoom_modal_impl().
| ScrArea* ViewOpsData::area |
Definition at line 96 of file view3d_navigate.hh.
Referenced by viewdolly_apply(), viewdolly_exec(), viewmove_apply(), viewroll_apply(), viewzoom_apply_3d(), and viewzoom_invoke_impl().
| bool ViewOpsData::axis_snap |
Definition at line 167 of file view3d_navigate.hh.
Referenced by view3d_navigate_event(), and viewrotate_apply().
| float ViewOpsData::camdx |
Definition at line 112 of file view3d_navigate.hh.
| float ViewOpsData::camdy |
Definition at line 112 of file view3d_navigate.hh.
| float ViewOpsData::camzoom |
Definition at line 113 of file view3d_navigate.hh.
Referenced by viewzoom_apply_camera().
| struct { ... } ViewOpsData::curr |
Current state.
Referenced by init_navigation(), vieworbit_exec(), viewrotate_apply(), and viewrotate_apply_snap().
| Depsgraph* ViewOpsData::depsgraph |
Definition at line 100 of file view3d_navigate.hh.
Referenced by ED_view3d_navigation_do(), init_context(), init_navigation(), state_restore(), viewdolly_apply(), viewmove_apply(), viewroll_apply(), viewroll_exec(), viewrotate_apply(), viewzoom_apply_3d(), viewzoom_apply_camera(), and viewzoom_invoke_impl().
| Dial* ViewOpsData::dial |
Used for roll
Definition at line 145 of file view3d_navigate.hh.
Referenced by viewroll_apply(), and viewroll_invoke().
| float ViewOpsData::dist |
Definition at line 114 of file view3d_navigate.hh.
Referenced by viewzoom_apply_3d().
| float ViewOpsData::dyn_ofs[3] |
Use for orbit selection and auto-dist.
Definition at line 170 of file view3d_navigate.hh.
Referenced by init_navigation(), vieworbit_exec(), viewroll_apply(), viewroll_exec(), and viewrotate_apply_dyn_ofs().
| int ViewOpsData::event_type |
wmEvent.type that triggered the operator.
Definition at line 134 of file view3d_navigate.hh.
Referenced by view3d_navigate_event(), viewdolly_modal(), and viewroll_modal().
| int ViewOpsData::event_xy[2] |
The ones below are unrelated to the state of the 3D view. wmEvent.xy.
Definition at line 129 of file view3d_navigate.hh.
Referenced by viewdolly_apply(), viewdolly_invoke(), viewmove_apply(), viewpan_invoke_impl(), viewroll_invoke(), viewrotate_apply(), viewzoom_apply_3d(), viewzoom_apply_camera(), and viewzoom_invoke_impl().
| int ViewOpsData::event_xy_offset[2] |
Definition at line 132 of file view3d_navigate.hh.
Referenced by init_navigation(), viewrotate_apply(), viewzoom_apply_3d(), and viewzoom_apply_camera().
| struct { ... } ViewOpsData::init |
Viewport state on initialization, don't change afterwards.
Referenced by end_navigation(), init_navigation(), state_backup(), state_restore(), view3d_navigate_event(), viewdolly_apply(), viewdolly_exec(), viewdolly_invoke(), viewdolly_modal(), viewmove_apply(), viewroll_apply(), viewroll_invoke(), viewroll_modal(), viewrotate_apply(), viewrotate_apply_dyn_ofs(), viewrotate_apply_snap(), viewzoom_apply_3d(), viewzoom_apply_camera(), and viewzoom_invoke_impl().
| float ViewOpsData::mousevec[3] |
Dolly only.
Definition at line 142 of file view3d_navigate.hh.
Referenced by viewdolly_apply(), viewdolly_exec(), viewdolly_invoke(), viewroll_apply(), and viewroll_invoke().
| const ViewOpsType* ViewOpsData::nav_type |
Definition at line 163 of file view3d_navigate.hh.
Referenced by ED_view3d_navigation_do(), init_navigation(), view3d_navigate_event(), and view3d_navigate_modal_fn().
| float ViewOpsData::ofs[3] |
These variables reflect the same in RegionView3D.
Definition at line 110 of file view3d_navigate.hh.
Referenced by viewdolly_apply(), viewroll_apply(), and viewrotate_apply_dyn_ofs().
| float ViewOpsData::ofs_lock[2] |
Definition at line 111 of file view3d_navigate.hh.
| char ViewOpsData::persp |
Definition at line 116 of file view3d_navigate.hh.
| char ViewOpsData::persp_with_auto_persp_applied |
RegionView3D.persp set after auto-perspective is applied. If we want the value before running the operator, add a separate member.
Definition at line 124 of file view3d_navigate.hh.
Referenced by view3d_navigate_event(), and viewrotate_apply_snap().
| struct { ... } ViewOpsData::prev |
Previous state (previous modal event handled).
Referenced by init_navigation(), viewdolly_invoke(), viewmove_apply(), viewpan_invoke_impl(), viewroll_invoke(), viewrotate_apply(), viewzoom_apply_3d(), viewzoom_apply_camera(), and viewzoom_invoke_impl().
| float ViewOpsData::quat[4] |
Definition at line 115 of file view3d_navigate.hh.
Referenced by viewroll_apply(), viewrotate_apply(), and viewrotate_apply_dyn_ofs().
| ARegion* ViewOpsData::region |
Definition at line 97 of file view3d_navigate.hh.
Referenced by ED_view3d_navigation_do(), view3d_navigation_invoke_generic(), viewdolly_apply(), viewdolly_exec(), viewdolly_invoke(), viewmove_apply(), vieworbit_exec(), viewroll_apply(), viewroll_exec(), viewroll_invoke(), viewrotate_apply(), viewzoom_apply_3d(), viewzoom_apply_camera(), and viewzoom_invoke_impl().
| float ViewOpsData::reverse |
Definition at line 166 of file view3d_navigate.hh.
Referenced by init_navigation(), and viewrotate_apply().
| RegionView3D* ViewOpsData::rv3d |
Definition at line 99 of file view3d_navigate.hh.
Referenced by ED_view3d_navigation_do(), end_navigation(), init_context(), init_navigation(), state_backup(), state_restore(), view3d_navigate_event(), view3d_navigate_modal_fn(), viewdolly_apply(), viewdolly_invoke(), viewdolly_modal(), viewmove_apply(), viewmove_modal_impl(), vieworbit_exec(), viewroll_apply(), viewroll_exec(), viewroll_invoke(), viewroll_modal(), viewrotate_apply(), viewrotate_apply_dyn_ofs(), viewrotate_apply_snap(), viewrotate_invoke_impl(), viewrotate_modal_impl(), viewzoom_apply(), viewzoom_apply_3d(), viewzoom_apply_camera(), viewzoom_invoke_impl(), and viewzoom_modal_impl().
| Scene* ViewOpsData::scene |
Context pointers (assigned by viewops_data_create).
Definition at line 95 of file view3d_navigate.hh.
Referenced by ED_view3d_navigation_do(), viewzoom_apply_camera(), and viewzoom_invoke_impl().
| double ViewOpsData::time |
For operators that use time-steps (continuous zoom).
Definition at line 152 of file view3d_navigate.hh.
Referenced by viewzoom_apply_3d(), viewzoom_apply_camera(), and viewzoom_invoke_impl().
| wmTimer* ViewOpsData::timer |
Needed for continuous zoom.
Definition at line 103 of file view3d_navigate.hh.
Referenced by end_navigation(), view3d_navigate_event(), and viewzoom_invoke_impl().
| float ViewOpsData::trackvec[3] |
Trackball rotation only.
Definition at line 140 of file view3d_navigate.hh.
Referenced by viewrotate_apply().
| bool ViewOpsData::use_dyn_ofs |
Definition at line 171 of file view3d_navigate.hh.
Referenced by init_navigation(), vieworbit_exec(), viewroll_apply(), viewroll_exec(), viewrotate_apply_dyn_ofs(), and viewrotate_invoke_impl().
| bool ViewOpsData::use_dyn_ofs_ortho_correction |
In orthographic views, a dynamic offset should not cause RegionView3D::ofs to end up at a location that has no relation to the content where ofs originated or to dyn_ofs. Failing to do so can cause the orthographic views ofs to be far away from the content to the point it gets clipped out of the view. See view3d_orbit_apply_dyn_ofs code-comments for an example, also see: #104385.
Definition at line 180 of file view3d_navigate.hh.
Referenced by init_navigation(), viewrotate_apply_dyn_ofs(), and viewrotate_invoke_impl().
| View3D* ViewOpsData::v3d |
Definition at line 98 of file view3d_navigate.hh.
Referenced by ED_view3d_navigation_do(), init_context(), init_navigation(), state_restore(), view3d_navigate_modal_fn(), view3d_navigation_invoke_generic(), viewdolly_apply(), viewdolly_invoke(), viewdolly_modal(), viewmove_apply(), viewmove_modal_impl(), vieworbit_exec(), viewroll_apply(), viewroll_exec(), viewroll_invoke(), viewroll_modal(), viewrotate_apply(), viewrotate_modal_impl(), viewzoom_apply(), viewzoom_apply_3d(), viewzoom_apply_camera(), viewzoom_invoke_impl(), and viewzoom_modal_impl().
| char ViewOpsData::view |
Definition at line 117 of file view3d_navigate.hh.
| char ViewOpsData::view_axis_roll |
Definition at line 118 of file view3d_navigate.hh.
| eViewOpsFlag ViewOpsData::viewops_flag |
Definition at line 164 of file view3d_navigate.hh.
Referenced by init_navigation(), viewzoom_apply(), and viewzoom_invoke_impl().
| float ViewOpsData::viewquat[4] |
Working copy of RegionView3D.viewquat, needed for rotation calculation so we can apply snap to the 3D Viewport while keeping the unsnapped rotation here to use when snap is disabled and for continued calculation.
Definition at line 160 of file view3d_navigate.hh.
Referenced by vieworbit_exec(), viewrotate_apply(), and viewrotate_apply_snap().
| float ViewOpsData::zfac |
Initial distance to 'ofs'.
Definition at line 137 of file view3d_navigate.hh.
Referenced by viewmove_apply().