|
Blender
V2.93
|
#include "MEM_guardedalloc.h"#include "DNA_windowmanager_types.h"#include "BLI_math.h"#include "BLI_rect.h"#include "BKE_context.h"#include "WM_api.h"#include "WM_types.h"#include "wm.h"#include "wm_event_system.h"#include "wm_event_types.h"#include "ED_screen.h"#include "ED_select_utils.h"#include "UI_interface.h"#include "RNA_access.h"#include "RNA_define.h"Go to the source code of this file.
Functions | |
Internal Gesture Utilities | |
Border gesture has two types:
It stores 4 values (xmin, xmax, ymin, ymax) and event it ended with (event_type). | |
| static void | gesture_modal_end (bContext *C, wmOperator *op) |
| static void | gesture_modal_state_to_operator (wmOperator *op, int modal_state) |
| static int UNUSED_FUNCTION() | gesture_modal_state_from_operator (wmOperator *op) |
Border Gesture | |
Border gesture has two types:
It stores 4 values (xmin, xmax, ymin, ymax) and event it ended with (event_type). | |
| static bool | gesture_box_apply_rect (wmOperator *op) |
| static bool | gesture_box_apply (bContext *C, wmOperator *op) |
| int | WM_gesture_box_invoke (bContext *C, wmOperator *op, const wmEvent *event) |
| int | WM_gesture_box_modal (bContext *C, wmOperator *op, const wmEvent *event) |
| void | WM_gesture_box_cancel (bContext *C, wmOperator *op) |
Circle Gesture | |
Currently only used for selection or modal paint stuff, calls wmOperatorType.exec while hold mouse, exits on release (with no difference between cancel and confirm). | |
| static void | gesture_circle_apply (bContext *C, wmOperator *op) |
| int | WM_gesture_circle_invoke (bContext *C, wmOperator *op, const wmEvent *event) |
| int | WM_gesture_circle_modal (bContext *C, wmOperator *op, const wmEvent *event) |
| void | WM_gesture_circle_cancel (bContext *C, wmOperator *op) |
Tweak Gesture | |
| static void | gesture_tweak_modal (bContext *C, const wmEvent *event) |
| void | wm_tweakevent_test (bContext *C, const wmEvent *event, int action) |
Lasso Gesture | |
| int | WM_gesture_lasso_invoke (bContext *C, wmOperator *op, const wmEvent *event) |
| int | WM_gesture_lines_invoke (bContext *C, wmOperator *op, const wmEvent *event) |
| static int | gesture_lasso_apply (bContext *C, wmOperator *op) |
| int | WM_gesture_lasso_modal (bContext *C, wmOperator *op, const wmEvent *event) |
| int | WM_gesture_lines_modal (bContext *C, wmOperator *op, const wmEvent *event) |
| void | WM_gesture_lasso_cancel (bContext *C, wmOperator *op) |
| void | WM_gesture_lines_cancel (bContext *C, wmOperator *op) |
| const int(* | WM_gesture_lasso_path_to_array (bContext *UNUSED(C), wmOperator *op, int *r_mcoords_len))[2] |
Straight Line Gesture | |
Gesture defined by the start and end points of a line that is created between the position of the initial event and the position of the current event. Straight Line Gesture has two modal callbacks depending on the tool that is being implemented: a regular modal callback intended to update the data during the execution of the gesture and a one-shot callback that only updates the data once when the gesture finishes. It stores 4 values: | |
| #define | STRAIGHTLINE_SNAP_DEG 15.0f |
| static bool | gesture_straightline_apply (bContext *C, wmOperator *op) |
| int | WM_gesture_straightline_invoke (bContext *C, wmOperator *op, const wmEvent *event) |
| int | WM_gesture_straightline_active_side_invoke (bContext *C, wmOperator *op, const wmEvent *event) |
| static void | wm_gesture_straightline_do_angle_snap (rcti *rect) |
| int | WM_gesture_straightline_modal (bContext *C, wmOperator *op, const wmEvent *event) |
| int | WM_gesture_straightline_oneshot_modal (bContext *C, wmOperator *op, const wmEvent *event) |
| void | WM_gesture_straightline_cancel (bContext *C, wmOperator *op) |
Default operator callbacks for use with gestures (border/circle/lasso/straightline). Operators themselves are defined elsewhere.
wm_operators.c.wm_operator_props.c. Definition in file wm_gesture_ops.c.
| #define STRAIGHTLINE_SNAP_DEG 15.0f |
Definition at line 900 of file wm_gesture_ops.c.
|
static |
Definition at line 158 of file wm_gesture_ops.c.
References C, wmOperator::customdata, wmOperatorType::exec, gesture_box_apply_rect(), gesture_modal_state_to_operator(), wmGesture::modal_state, OPERATOR_RETVAL_CHECK, wmOperator::type, and wmGesture::wait_for_input.
Referenced by WM_gesture_box_modal().
|
static |
Definition at line 140 of file wm_gesture_ops.c.
References wmOperator::customdata, wmGesture::customdata, max_ii(), min_ii(), wmOperator::ptr, RNA_int_set(), rcti::xmax, rcti::xmin, rcti::ymax, and rcti::ymin.
Referenced by gesture_box_apply(), and WM_gesture_box_modal().
|
static |
Definition at line 329 of file wm_gesture_ops.c.
References C, wmOperator::customdata, wmGesture::customdata, wmOperatorType::exec, GESTURE_MODAL_NOP, gesture_modal_state_to_operator(), wmGesture::modal_state, OPERATOR_RETVAL_CHECK, wmOperator::ptr, RNA_int_set(), wmOperator::type, wmGesture::wait_for_input, rcti::xmax, rcti::xmin, and rcti::ymin.
Referenced by WM_gesture_circle_invoke(), and WM_gesture_circle_modal().
|
static |
Definition at line 640 of file wm_gesture_ops.c.
References C, wmOperator::customdata, wmGesture::customdata, wmOperatorType::exec, gesture_modal_end(), OPERATOR_FINISHED, OPERATOR_RETVAL_CHECK, wmGesture::points, wmOperator::ptr, RNA_collection_add(), RNA_collection_clear(), RNA_float_set_array(), and wmOperator::type.
Referenced by WM_gesture_lasso_modal().
|
static |
Definition at line 65 of file wm_gesture_ops.c.
References C, CTX_wm_area(), CTX_wm_window(), wmOperator::customdata, ED_area_tag_redraw(), NULL, wmOperator::ptr, RNA_struct_find_property(), WM_cursor_modal_restore(), and WM_gesture_end().
Referenced by gesture_lasso_apply(), WM_gesture_box_cancel(), WM_gesture_box_modal(), WM_gesture_circle_cancel(), WM_gesture_circle_modal(), WM_gesture_lasso_cancel(), WM_gesture_lasso_modal(), WM_gesture_lines_cancel(), WM_gesture_straightline_cancel(), WM_gesture_straightline_modal(), and WM_gesture_straightline_oneshot_modal().
|
static |
Definition at line 104 of file wm_gesture_ops.c.
References GESTURE_MODAL_DESELECT, GESTURE_MODAL_IN, GESTURE_MODAL_NOP, GESTURE_MODAL_OUT, GESTURE_MODAL_SELECT, RNA_property_boolean_get(), RNA_property_enum_get(), RNA_property_is_set(), RNA_struct_find_property(), and SEL_OP_SUB.
|
static |
Definition at line 80 of file wm_gesture_ops.c.
References GESTURE_MODAL_DESELECT, GESTURE_MODAL_IN, GESTURE_MODAL_OUT, GESTURE_MODAL_SELECT, wmOperator::ptr, RNA_property_boolean_set(), RNA_property_enum_set(), RNA_struct_find_property(), SEL_OP_ADD, and SEL_OP_SUB.
Referenced by gesture_box_apply(), and gesture_circle_apply().
|
static |
Definition at line 840 of file wm_gesture_ops.c.
References C, wmOperator::customdata, wmGesture::customdata, wmOperatorType::exec, OPERATOR_RETVAL_CHECK, wmOperator::ptr, RNA_boolean_set(), RNA_int_set(), wmOperator::type, wmGesture::use_flip, rcti::xmax, rcti::xmin, rcti::ymax, and rcti::ymin.
Referenced by WM_gesture_straightline_modal(), and WM_gesture_straightline_oneshot_modal().
Definition at line 489 of file wm_gesture_ops.c.
References C, CTX_wm_region(), CTX_wm_window(), wmGesture::customdata, ED_region_tag_redraw(), EVENT_NONE, wmGesture::event_type, EVT_TWEAK_L, EVT_TWEAK_M, EVT_TWEAK_R, ARegion::gizmo_map, INBETWEEN_MOUSEMOVE, wmEvent::is_repeat, ISTIMER, KM_RELEASE, LEFTMOUSE, MIDDLEMOUSE, MOUSEMOVE, NULL, RIGHTMOUSE, wmWindow::tweak, wmEvent::type, wmEvent::val, wmGesture::winrct, wm_event_add_ex(), wm_event_init_from_window(), WM_gesture_end(), wm_gesture_evaluate(), WM_gizmomap_tag_delay_refresh_for_tweak_check(), wmEvent::x, rcti::xmax, rcti::xmin, wmEvent::y, rcti::ymax, and rcti::ymin.
Referenced by wm_tweakevent_test().
| void WM_gesture_box_cancel | ( | bContext * | C, |
| wmOperator * | op | ||
| ) |
Definition at line 282 of file wm_gesture_ops.c.
References C, and gesture_modal_end().
Referenced by ACTION_OT_select_box(), ANIM_OT_channels_select_box(), ANIM_OT_previewrange_set(), FILE_OT_select_box(), GPENCIL_OT_select_box(), GRAPH_OT_select_box(), IMAGE_OT_render_border(), IMAGE_OT_view_zoom_border(), INFO_OT_select_box(), MARKER_OT_select_box(), NLA_OT_select_box(), NODE_OT_select_box(), NODE_OT_viewer_border(), OUTLINER_OT_select_box(), SEQUENCER_OT_select_box(), SEQUENCER_OT_view_ghost_border(), UV_OT_select_box(), VIEW2D_OT_zoom_border(), VIEW3D_OT_clip_border(), VIEW3D_OT_render_border(), VIEW3D_OT_select_box(), and VIEW3D_OT_zoom_border().
| int WM_gesture_box_invoke | ( | bContext * | C, |
| wmOperator * | op, | ||
| const wmEvent * | event | ||
| ) |
Definition at line 178 of file wm_gesture_ops.c.
References C, CTX_wm_region(), CTX_wm_window(), wmOperator::customdata, ISTWEAK, OPERATOR_RUNNING_MODAL, wmOperator::ptr, RNA_boolean_get(), wmEvent::type, wmGesture::wait_for_input, WM_event_add_modal_handler(), WM_GESTURE_CROSS_RECT, WM_gesture_new(), WM_GESTURE_RECT, and wm_gesture_tag_redraw().
Referenced by actkeys_box_select_invoke(), ANIM_OT_channels_select_box(), ANIM_OT_previewrange_set(), CLIP_OT_graph_select_box(), CLIP_OT_select_box(), ed_marker_box_select_invoke(), FILE_OT_select_box(), GPENCIL_OT_select_box(), graphkeys_box_select_invoke(), hide_show_invoke(), IMAGE_OT_render_border(), IMAGE_OT_view_zoom_border(), INFO_OT_select_box(), MASK_OT_select_box(), nlaedit_box_select_invoke(), node_box_select_invoke(), NODE_OT_viewer_border(), outliner_box_select_invoke(), PAINT_OT_mask_box_gesture(), SCULPT_OT_face_set_box_gesture(), sculpt_trim_gesture_box_invoke(), sequencer_box_select_invoke(), SEQUENCER_OT_view_ghost_border(), UV_OT_select_box(), VIEW2D_OT_zoom_border(), view3d_clipping_invoke(), VIEW3D_OT_render_border(), VIEW3D_OT_select_box(), and VIEW3D_OT_zoom_border().
| int WM_gesture_box_modal | ( | bContext * | C, |
| wmOperator * | op, | ||
| const wmEvent * | event | ||
| ) |
Definition at line 204 of file wm_gesture_ops.c.
References BLI_rcti_translate(), C, CTX_wm_window(), wmOperator::customdata, wmGesture::customdata, EVT_MODAL_MAP, gesture_box_apply(), gesture_box_apply_rect(), GESTURE_MODAL_BEGIN, GESTURE_MODAL_CANCEL, GESTURE_MODAL_DESELECT, gesture_modal_end(), GESTURE_MODAL_IN, GESTURE_MODAL_MOVE, GESTURE_MODAL_OUT, GESTURE_MODAL_SELECT, wmGesture::is_active, wmGesture::is_active_prev, wmGesture::modal_state, MOUSEMOVE, wmGesture::move, NDOF_MOTION, OPERATOR_CANCELLED, OPERATOR_FINISHED, OPERATOR_PASS_THROUGH, OPERATOR_RUNNING_MODAL, wmGesture::type, wmEvent::type, wmEvent::val, wmGesture::wait_for_input, wmGesture::winrct, WM_GESTURE_CROSS_RECT, wm_gesture_tag_redraw(), wmEvent::x, rcti::xmax, rcti::xmin, wmEvent::y, rcti::ymax, and rcti::ymin.
Referenced by ACTION_OT_select_box(), ANIM_OT_channels_select_box(), ANIM_OT_previewrange_set(), CLIP_OT_graph_select_box(), CLIP_OT_select_box(), file_box_select_modal(), GPENCIL_OT_select_box(), GRAPH_OT_select_box(), IMAGE_OT_render_border(), IMAGE_OT_view_zoom_border(), INFO_OT_select_box(), MARKER_OT_select_box(), MASK_OT_select_box(), NLA_OT_select_box(), NODE_OT_select_box(), NODE_OT_viewer_border(), OUTLINER_OT_select_box(), PAINT_OT_hide_show(), PAINT_OT_mask_box_gesture(), SCULPT_OT_face_set_box_gesture(), SCULPT_OT_trim_box_gesture(), SEQUENCER_OT_select_box(), SEQUENCER_OT_view_ghost_border(), UV_OT_select_box(), VIEW2D_OT_zoom_border(), VIEW3D_OT_clip_border(), VIEW3D_OT_render_border(), VIEW3D_OT_select_box(), and VIEW3D_OT_zoom_border().
| void WM_gesture_circle_cancel | ( | bContext * | C, |
| wmOperator * | op | ||
| ) |
Definition at line 461 of file wm_gesture_ops.c.
References C, and gesture_modal_end().
Referenced by ACTION_OT_select_circle(), GPENCIL_OT_select_circle(), GRAPH_OT_select_circle(), UV_OT_select_circle(), and VIEW3D_OT_select_circle().
| int WM_gesture_circle_invoke | ( | bContext * | C, |
| wmOperator * | op, | ||
| const wmEvent * | event | ||
| ) |
Definition at line 300 of file wm_gesture_ops.c.
References C, CTX_wm_region(), CTX_wm_window(), wmOperator::customdata, wmGesture::customdata, gesture_circle_apply(), wmGesture::is_active, ISTWEAK, OPERATOR_RUNNING_MODAL, wmOperator::ptr, RNA_boolean_get(), RNA_int_get(), wmEvent::type, wmGesture::wait_for_input, WM_event_add_modal_handler(), WM_GESTURE_CIRCLE, WM_gesture_new(), wm_gesture_tag_redraw(), and rcti::xmax.
Referenced by ACTION_OT_select_circle(), CLIP_OT_select_circle(), GPENCIL_OT_select_circle(), GRAPH_OT_select_circle(), MASK_OT_select_circle(), NODE_OT_select_circle(), UV_OT_select_circle(), and VIEW3D_OT_select_circle().
| int WM_gesture_circle_modal | ( | bContext * | C, |
| wmOperator * | op, | ||
| const wmEvent * | event | ||
| ) |
Definition at line 357 of file wm_gesture_ops.c.
References C, ceil(), CTX_wm_window(), wmOperator::customdata, wmGesture::customdata, EVT_MODAL_MAP, floor(), gesture_circle_apply(), GESTURE_MODAL_CANCEL, GESTURE_MODAL_CIRCLE_ADD, GESTURE_MODAL_CIRCLE_SIZE, GESTURE_MODAL_CIRCLE_SUB, GESTURE_MODAL_CONFIRM, GESTURE_MODAL_DESELECT, gesture_modal_end(), GESTURE_MODAL_NOP, GESTURE_MODAL_SELECT, wmGesture::is_active, wmGesture::is_active_prev, wmGesture::modal_state, MOUSEMOVE, NDOF_MOTION, OPERATOR_FINISHED, OPERATOR_PASS_THROUGH, OPERATOR_RUNNING_MODAL, wmOperator::ptr, RNA_int_set(), wmEvent::type, wmEvent::val, wmGesture::wait_for_input, wmGesture::winrct, wm_gesture_tag_redraw(), rcti::xmax, rcti::xmin, and rcti::ymin.
Referenced by ACTION_OT_select_circle(), CLIP_OT_select_circle(), GPENCIL_OT_select_circle(), GRAPH_OT_select_circle(), MASK_OT_select_circle(), NODE_OT_select_circle(), UV_OT_select_circle(), and VIEW3D_OT_select_circle().
| void WM_gesture_lasso_cancel | ( | bContext * | C, |
| wmOperator * | op | ||
| ) |
Definition at line 740 of file wm_gesture_ops.c.
References C, and gesture_modal_end().
Referenced by ACTION_OT_select_lasso(), CLIP_OT_select_lasso(), GPENCIL_OT_select_lasso(), GPENCIL_OT_stroke_cutter(), GRAPH_OT_select_lasso(), MASK_OT_select_lasso(), NODE_OT_select_lasso(), UV_OT_select_lasso(), and VIEW3D_OT_select_lasso().
| int WM_gesture_lasso_invoke | ( | bContext * | C, |
| wmOperator * | op, | ||
| const wmEvent * | event | ||
| ) |
Definition at line 602 of file wm_gesture_ops.c.
References C, CTX_wm_region(), CTX_wm_window(), wmOperator::customdata, OPERATOR_RUNNING_MODAL, wmOperator::ptr, RNA_property_int_get(), RNA_struct_find_property(), WM_cursor_modal_set(), WM_event_add_modal_handler(), WM_GESTURE_LASSO, WM_gesture_new(), and wm_gesture_tag_redraw().
Referenced by ACTION_OT_select_lasso(), CLIP_OT_select_lasso(), GPENCIL_OT_select_lasso(), GPENCIL_OT_stroke_cutter(), GRAPH_OT_select_lasso(), MASK_OT_select_lasso(), node_lasso_select_invoke(), PAINT_OT_mask_lasso_gesture(), SCULPT_OT_face_set_lasso_gesture(), sculpt_trim_gesture_lasso_invoke(), UV_OT_select_lasso(), and VIEW3D_OT_select_lasso().
| int WM_gesture_lasso_modal | ( | bContext * | C, |
| wmOperator * | op, | ||
| const wmEvent * | event | ||
| ) |
Definition at line 669 of file wm_gesture_ops.c.
References C, CTX_wm_window(), wmOperator::customdata, wmGesture::customdata, EVT_ESCKEY, EVT_MODAL_MAP, gesture_lasso_apply(), gesture_modal_end(), GESTURE_MODAL_MOVE, INBETWEEN_MOUSEMOVE, wmGesture::is_active, wmGesture::is_active_prev, KM_RELEASE, LEFTMOUSE, MEM_reallocN, MIDDLEMOUSE, MOUSEMOVE, wmGesture::move, OPERATOR_CANCELLED, OPERATOR_RUNNING_MODAL, wmGesture::points, wmGesture::points_alloc, pow2f(), RIGHTMOUSE, wmEvent::type, UI_DPI_FAC, wmEvent::val, wmGesture::winrct, wm_gesture_tag_redraw(), x, rcti::xmin, y, and rcti::ymin.
Referenced by ACTION_OT_select_lasso(), CLIP_OT_select_lasso(), GPENCIL_OT_select_lasso(), GPENCIL_OT_stroke_cutter(), GRAPH_OT_select_lasso(), MASK_OT_select_lasso(), NODE_OT_select_lasso(), PAINT_OT_mask_lasso_gesture(), SCULPT_OT_face_set_lasso_gesture(), SCULPT_OT_trim_lasso_gesture(), UV_OT_select_lasso(), VIEW3D_OT_select_lasso(), and WM_gesture_lines_modal().
| const int(* WM_gesture_lasso_path_to_array | ( | bContext * | UNUSEDC, |
| wmOperator * | op, | ||
| int * | r_mcoords_len | ||
| ) | )[2] |
helper function, we may want to add options for conversion to view space
caller must free.
Definition at line 755 of file wm_gesture_ops.c.
References BLI_assert, len, MEM_mallocN, NULL, RNA_float_get_array(), RNA_PROP_BEGIN, RNA_PROP_END, RNA_property_collection_length(), and RNA_struct_find_property().
Referenced by actkeys_lassoselect_exec(), clip_lasso_select_exec(), gpencil_cutter_exec(), gpencil_lasso_select_exec(), graphkeys_lassoselect_exec(), node_lasso_select_exec(), sculpt_gesture_init_from_lasso(), uv_lasso_select_exec(), and view3d_lasso_select_exec().
| void WM_gesture_lines_cancel | ( | bContext * | C, |
| wmOperator * | op | ||
| ) |
Definition at line 745 of file wm_gesture_ops.c.
References C, and gesture_modal_end().
Referenced by NODE_OT_add_reroute(), NODE_OT_links_cut(), and NODE_OT_links_mute().
| int WM_gesture_lines_invoke | ( | bContext * | C, |
| wmOperator * | op, | ||
| const wmEvent * | event | ||
| ) |
Definition at line 621 of file wm_gesture_ops.c.
References C, CTX_wm_region(), CTX_wm_window(), wmOperator::customdata, OPERATOR_RUNNING_MODAL, wmOperator::ptr, RNA_property_int_get(), RNA_struct_find_property(), WM_cursor_modal_set(), WM_event_add_modal_handler(), WM_GESTURE_LINES, WM_gesture_new(), and wm_gesture_tag_redraw().
Referenced by MESH_OT_knife_cut(), NODE_OT_add_reroute(), NODE_OT_links_cut(), and NODE_OT_links_mute().
| int WM_gesture_lines_modal | ( | bContext * | C, |
| wmOperator * | op, | ||
| const wmEvent * | event | ||
| ) |
Definition at line 735 of file wm_gesture_ops.c.
References C, and WM_gesture_lasso_modal().
Referenced by MESH_OT_knife_cut(), NODE_OT_add_reroute(), NODE_OT_links_cut(), and NODE_OT_links_mute().
| int WM_gesture_straightline_active_side_invoke | ( | bContext * | C, |
| wmOperator * | op, | ||
| const wmEvent * | event | ||
| ) |
This invoke callback starts the straightline gesture with a viewport preview to the right side of the line.
Definition at line 891 of file wm_gesture_ops.c.
References C, wmOperator::customdata, wmGesture::draw_active_side, OPERATOR_RUNNING_MODAL, wmGesture::use_flip, and WM_gesture_straightline_invoke().
Referenced by PAINT_OT_mask_line_gesture(), and SCULPT_OT_project_line_gesture().
| void WM_gesture_straightline_cancel | ( | bContext * | C, |
| wmOperator * | op | ||
| ) |
Definition at line 1097 of file wm_gesture_ops.c.
References C, and gesture_modal_end().
Referenced by IMAGE_OT_sample_line(), MESH_OT_bisect(), PAINT_OT_weight_gradient(), and paint_weight_gradient_modal().
|
static |
Definition at line 901 of file wm_gesture_ops.c.
References add_v2_v2(), angle(), angle_signed_v2v2(), DEG2RAD, floorf, mul_v2_fl(), normalize_v2(), RAD2DEG, rotate_v2_v2fl(), STRAIGHTLINE_SNAP_DEG, sub_v2_v2v2(), rcti::xmax, rcti::xmin, rcti::ymax, and rcti::ymin.
Referenced by WM_gesture_straightline_modal(), and WM_gesture_straightline_oneshot_modal().
| int WM_gesture_straightline_invoke | ( | bContext * | C, |
| wmOperator * | op, | ||
| const wmEvent * | event | ||
| ) |
Definition at line 864 of file wm_gesture_ops.c.
References C, CTX_wm_region(), CTX_wm_window(), wmOperator::customdata, wmGesture::is_active, ISTWEAK, OPERATOR_RUNNING_MODAL, wmOperator::ptr, RNA_property_int_get(), RNA_struct_find_property(), wmEvent::type, WM_cursor_modal_set(), WM_event_add_modal_handler(), WM_gesture_new(), WM_GESTURE_STRAIGHTLINE, and wm_gesture_tag_redraw().
Referenced by image_sample_line_invoke(), mesh_bisect_invoke(), paint_weight_gradient_invoke(), and WM_gesture_straightline_active_side_invoke().
| int WM_gesture_straightline_modal | ( | bContext * | C, |
| wmOperator * | op, | ||
| const wmEvent * | event | ||
| ) |
This modal callback calls exec once per mouse move event while the gesture is active with the updated line start and end values, so it can be used for tools that have a real time preview (like a gradient updating in real time over the mesh).
Definition at line 931 of file wm_gesture_ops.c.
References BLI_rcti_translate(), C, CTX_wm_window(), wmOperator::customdata, wmGesture::customdata, EVT_MODAL_MAP, GESTURE_MODAL_BEGIN, GESTURE_MODAL_CANCEL, gesture_modal_end(), GESTURE_MODAL_FLIP, GESTURE_MODAL_MOVE, GESTURE_MODAL_SELECT, GESTURE_MODAL_SNAP, gesture_straightline_apply(), wmGesture::is_active, wmGesture::is_active_prev, MOUSEMOVE, wmGesture::move, OPERATOR_CANCELLED, OPERATOR_FINISHED, OPERATOR_RUNNING_MODAL, wmEvent::type, wmGesture::use_flip, wmGesture::use_snap, wmEvent::val, wmGesture::winrct, wm_gesture_straightline_do_angle_snap(), wm_gesture_tag_redraw(), wmEvent::x, rcti::xmax, rcti::xmin, wmEvent::y, rcti::ymax, and rcti::ymin.
Referenced by IMAGE_OT_sample_line(), mesh_bisect_modal(), and paint_weight_gradient_modal().
| int WM_gesture_straightline_oneshot_modal | ( | bContext * | C, |
| wmOperator * | op, | ||
| const wmEvent * | event | ||
| ) |
This modal one-shot callback only calls exec once after the gesture finishes without any updates during the gesture execution. Should be used for operations that are intended to be applied once without real time preview (like a trimming tool that only applies the bisect operation once after finishing the gesture as the bisect operation is too heavy to be computed in real time for a preview).
Definition at line 1016 of file wm_gesture_ops.c.
References BLI_rcti_translate(), C, CTX_wm_window(), wmOperator::customdata, wmGesture::customdata, EVT_MODAL_MAP, GESTURE_MODAL_BEGIN, GESTURE_MODAL_CANCEL, GESTURE_MODAL_DESELECT, gesture_modal_end(), GESTURE_MODAL_FLIP, GESTURE_MODAL_IN, GESTURE_MODAL_MOVE, GESTURE_MODAL_OUT, GESTURE_MODAL_SELECT, GESTURE_MODAL_SNAP, gesture_straightline_apply(), wmGesture::is_active, wmGesture::is_active_prev, wmGesture::modal_state, MOUSEMOVE, wmGesture::move, OPERATOR_CANCELLED, OPERATOR_FINISHED, OPERATOR_RUNNING_MODAL, wmEvent::type, wmGesture::use_flip, wmGesture::use_snap, wmEvent::val, wmGesture::wait_for_input, wmGesture::winrct, wm_gesture_straightline_do_angle_snap(), wm_gesture_tag_redraw(), wmEvent::x, rcti::xmax, rcti::xmin, wmEvent::y, rcti::ymax, and rcti::ymin.
Referenced by PAINT_OT_mask_line_gesture(), and SCULPT_OT_project_line_gesture().
Definition at line 570 of file wm_gesture_ops.c.
References C, CTX_wm_region(), CTX_wm_window(), ELEM, gesture_tweak_modal(), KM_PRESS, LEFTMOUSE, MIDDLEMOUSE, NULL, RIGHTMOUSE, wmWindow::tweak, wmEvent::type, wmEvent::val, WM_gesture_end(), WM_gesture_new(), WM_GESTURE_TWEAK, and WM_HANDLER_BREAK.
Referenced by wm_event_do_handlers().