Blender
V3.3
|
#include "BLI_math.h"
#include "BLI_rect.h"
#include "BKE_context.h"
#include "BKE_screen.h"
#include "DEG_depsgraph_query.h"
#include "WM_api.h"
#include "RNA_access.h"
#include "ED_screen.h"
#include "PIL_time.h"
#include "view3d_intern.h"
#include "view3d_navigate.h"
Go to the source code of this file.
Functions | |
View Zoom Operator | |
void | viewzoom_modal_keymap (wmKeyConfig *keyconf) |
static void | view_zoom_to_window_xy_camera (Scene *scene, Depsgraph *depsgraph, View3D *v3d, ARegion *region, float dfac, const int zoom_xy[2]) |
static void | view_zoom_to_window_xy_3d (ARegion *region, float dfac, const int zoom_xy[2]) |
static float | viewzoom_scale_value (const rcti *winrct, const eViewZoom_Style viewzoom, const bool zoom_invert, const bool zoom_invert_force, const int xy_curr[2], const int xy_init[2], const float val, const float val_orig, double *r_timer_lastdraw) |
static float | viewzoom_scale_value_offset (const rcti *winrct, const eViewZoom_Style viewzoom, const bool zoom_invert, const bool zoom_invert_force, const int xy_curr[2], const int xy_init[2], const int xy_offset[2], const float val, const float val_orig, double *r_timer_lastdraw) |
static void | viewzoom_apply_camera (ViewOpsData *vod, const int xy[2], const eViewZoom_Style viewzoom, const bool zoom_invert, const bool zoom_to_pos) |
static void | viewzoom_apply_3d (ViewOpsData *vod, const int xy[2], const eViewZoom_Style viewzoom, const bool zoom_invert, const bool zoom_to_pos) |
static void | viewzoom_apply (ViewOpsData *vod, const int xy[2], const eViewZoom_Style viewzoom, const bool zoom_invert, const bool zoom_to_pos) |
static int | viewzoom_modal (bContext *C, wmOperator *op, const wmEvent *event) |
static int | viewzoom_exec (bContext *C, wmOperator *op) |
static int | viewzoom_invoke (bContext *C, wmOperator *op, const wmEvent *event) |
static void | viewzoom_cancel (bContext *C, wmOperator *op) |
void | VIEW3D_OT_zoom (wmOperatorType *ot) |
void VIEW3D_OT_zoom | ( | wmOperatorType * | ot | ) |
Definition at line 585 of file view3d_navigate_zoom.c.
References wmOperatorType::cancel, wmOperatorType::description, wmOperatorType::exec, wmOperatorType::flag, wmOperatorType::idname, wmOperatorType::invoke, wmOperatorType::modal, wmOperatorType::name, OPTYPE_BLOCKING, OPTYPE_GRAB_CURSOR_XY, ot, wmOperatorType::poll, V3D_OP_PROP_DELTA, V3D_OP_PROP_MOUSE_CO, V3D_OP_PROP_USE_MOUSE_INIT, view3d_operator_properties_common(), view3d_zoom_or_dolly_poll(), viewzoom_cancel(), viewzoom_exec(), viewzoom_invoke(), and viewzoom_modal().
Referenced by view3d_operatortypes().
zoom_xy | Optionally zoom to window location (coords compatible w/ wmEvent.xy). Use when not NULL. |
Definition at line 140 of file view3d_navigate_zoom.c.
References add_v3_v3v3(), copy_v3_v3(), RegionView3D::dist, ED_view3d_calc_zfac(), ED_view3d_win_to_delta(), float(), madd_v3_v3v3fl(), negate_v3(), negate_v3_v3(), NULL, RegionView3D::ofs, ARegion::regiondata, ARegion::winrct, ARegion::winx, ARegion::winy, rcti::xmin, and rcti::ymin.
Referenced by viewzoom_apply_3d(), and viewzoom_exec().
|
static |
zoom_xy | Optionally zoom to window location (coords compatible w/ wmEvent.xy). Use when not NULL. |
Definition at line 87 of file view3d_navigate_zoom.c.
References BKE_screen_view3d_zoom_from_fac(), BKE_screen_view3d_zoom_to_fac(), BLI_rctf_transform_pt_v(), BLI_rctf_translate(), RegionView3D::camdx, RegionView3D::camdy, RegionView3D::camzoom, CLAMP, clamp_f(), depsgraph, ED_view3d_calc_camera_border(), NULL, ARegion::regiondata, RV3D_CAMZOOM_MAX, RV3D_CAMZOOM_MAX_FACTOR, RV3D_CAMZOOM_MIN, RV3D_CAMZOOM_MIN_FACTOR, scene, sub_v2_v2v2(), ARegion::winrct, ARegion::winx, ARegion::winy, rcti::xmin, and rcti::ymin.
Referenced by viewzoom_apply_camera(), and viewzoom_exec().
|
static |
Definition at line 358 of file view3d_navigate_zoom.c.
References ED_view3d_camera_lock_check(), RegionView3D::is_persp, RegionView3D::persp, ViewOpsData::rv3d, RV3D_CAMOB, ViewOpsData::v3d, viewzoom_apply_3d(), viewzoom_apply_camera(), and xy.
Referenced by viewzoom_invoke(), and viewzoom_modal().
|
static |
Definition at line 316 of file view3d_navigate_zoom.c.
References ViewOpsData::area, CLAMP, ViewOpsData::depsgraph, ViewOpsData::dist, RegionView3D::dist, ED_region_tag_redraw(), ED_view3d_camera_lock_sync(), ED_view3d_dist_range_get(), ViewOpsData::event_xy, ViewOpsData::event_xy_offset, ViewOpsData::init, NULL, ViewOpsData::prev, ViewOpsData::region, ViewOpsData::rv3d, RV3D_BOXVIEW, RV3D_LOCK_FLAGS, ViewOpsData::time, ViewOpsData::v3d, view3d_boxview_sync(), view_zoom_to_window_xy_3d(), viewzoom_scale_value_offset(), ARegion::winrct, and xy.
Referenced by viewzoom_apply().
|
static |
Definition at line 281 of file view3d_navigate_zoom.c.
References BKE_screen_view3d_zoom_to_fac(), ViewOpsData::camzoom, RegionView3D::camzoom, ViewOpsData::depsgraph, ED_region_tag_redraw(), ELEM, ViewOpsData::event_xy, ViewOpsData::event_xy_offset, ViewOpsData::init, NULL, ViewOpsData::prev, ViewOpsData::region, ViewOpsData::rv3d, ViewOpsData::scene, ViewOpsData::time, ViewOpsData::v3d, view_zoom_to_window_xy_camera(), viewzoom_scale_value_offset(), ARegion::winrct, and xy.
Referenced by viewzoom_apply().
|
static |
Definition at line 579 of file view3d_navigate_zoom.c.
References C, wmOperator::customdata, NULL, and viewops_data_free().
Referenced by VIEW3D_OT_zoom().
|
static |
Definition at line 436 of file view3d_navigate_zoom.c.
References blender::compositor::area(), ViewOpsData::area, C, CTX_data_ensure_evaluated_depsgraph(), CTX_data_scene(), CTX_wm_area(), CTX_wm_region(), wmOperator::customdata, depsgraph, RegionView3D::dist, ED_region_tag_redraw(), ED_view3d_camera_lock_autokey(), ED_view3d_camera_lock_check(), ED_view3d_camera_lock_sync(), ED_view3d_camera_lock_undo_grouped_push(), ED_view3d_dist_range_get(), RegionView3D::is_persp, wmOperatorType::name, NULL, OPERATOR_FINISHED, RegionView3D::persp, wmOperator::ptr, ViewOpsData::region, ARegion::regiondata, RNA_boolean_get(), RNA_int_get(), RNA_struct_property_is_set(), RV3D_BOXVIEW, RV3D_CAMOB, RV3D_LOCK_FLAGS, scene, wmOperator::type, USER_ZOOM_TO_MOUSEPOS, view3d_boxview_sync(), view_zoom_to_window_xy_3d(), view_zoom_to_window_xy_camera(), viewops_data_free(), ARegion::winx, and ARegion::winy.
Referenced by VIEW3D_OT_zoom(), and viewzoom_invoke().
|
static |
Definition at line 519 of file view3d_navigate_zoom.c.
References C, CTX_wm_manager(), CTX_wm_window(), wmOperator::customdata, ED_view3d_camera_lock_autokey(), ED_view3d_smooth_view_force_finish(), ELEM, ViewOpsData::event_xy, ViewOpsData::init, MOUSEPAN, MOUSEZOOM, NULL, OPERATOR_FINISHED, OPERATOR_RUNNING_MODAL, PIL_check_seconds_timer(), ViewOpsData::prev, wmEvent::prev_xy, wmOperator::ptr, ViewOpsData::region, RNA_boolean_get(), RNA_int_set(), RNA_struct_property_is_set(), ViewOpsData::rv3d, ViewOpsData::time, ViewOpsData::timer, TIMER, wmEvent::type, USER_ZOOM_CONTINUE, USER_ZOOM_DOLLY, USER_ZOOM_HORIZ, USER_ZOOM_INVERT, USER_ZOOM_TO_MOUSEPOS, ViewOpsData::v3d, viewops_data_create(), viewops_data_free(), viewops_flag_from_prefs(), VIEWOPS_FLAG_ORBIT_SELECT, VIEWOPS_FLAG_USE_MOUSE_INIT, viewzoom_apply(), viewzoom_exec(), WM_event_add_modal_handler(), WM_event_add_timer(), and wmEvent::xy.
Referenced by VIEW3D_OT_zoom().
|
static |
Definition at line 373 of file view3d_navigate_zoom.c.
References C, CTX_wm_manager(), wmOperator::customdata, wmEvent::customdata, ED_screen_animation_playing(), ED_view3d_camera_lock_autokey(), ED_view3d_camera_lock_undo_push(), ViewOpsData::event_type, EVT_MODAL_MAP, ViewOpsData::init, KM_RELEASE, MOUSEMOVE, wmOperatorType::name, NULL, OPERATOR_FINISHED, OPERATOR_RUNNING_MODAL, wmOperator::ptr, ret, RNA_boolean_get(), ViewOpsData::rv3d, ViewOpsData::timer, TIMER, wmOperator::type, wmEvent::type, USER_ZOOM_INVERT, USER_ZOOM_TO_MOUSEPOS, ViewOpsData::v3d, wmEvent::val, VIEW_APPLY, VIEW_CONFIRM, VIEW_MODAL_CONFIRM, VIEW_PASS, viewops_data_free(), VIEWROT_MODAL_SWITCH_MOVE, VIEWROT_MODAL_SWITCH_ROTATE, viewzoom_apply(), WM_OP_INVOKE_DEFAULT, WM_operator_name_call(), and wmEvent::xy.
Referenced by VIEW3D_OT_zoom().
void viewzoom_modal_keymap | ( | wmKeyConfig * | keyconf | ) |
Definition at line 31 of file view3d_navigate_zoom.c.
References EVT_LEFTCTRLKEY, EVT_LEFTSHIFTKEY, KM_ANY, KM_PRESS, KM_RELEASE, LEFTMOUSE, wmKeyMap::modal_items, NULL, VIEW_MODAL_CONFIRM, VIEWROT_MODAL_SWITCH_MOVE, VIEWROT_MODAL_SWITCH_ROTATE, WM_modalkeymap_add_item(), WM_modalkeymap_assign(), WM_modalkeymap_ensure(), and WM_modalkeymap_find().
Referenced by view3d_keymap().
|
static |
Definition at line 178 of file view3d_navigate_zoom.c.
References BLI_rcti_cent_x(), BLI_rcti_cent_y(), float(), len_v2v2_int(), max_ff(), PIL_check_seconds_timer(), SWAP, time, USER_ZOOM_CONTINUE, USER_ZOOM_HORIZ, USER_ZOOM_SCALE, rcti::xmax, and rcti::ymax.
Referenced by viewzoom_scale_value_offset().
|
static |
Definition at line 251 of file view3d_navigate_zoom.c.
References viewzoom_scale_value().
Referenced by viewzoom_apply_3d(), and viewzoom_apply_camera().