|
Blender V4.3
|
#include "MEM_guardedalloc.h"#include <fmt/format.h>#include "DNA_space_types.h"#include "DNA_windowmanager_types.h"#include "BLI_math_base.hh"#include "BLI_math_rotation.h"#include "BLI_math_vector.h"#include "BLI_math_vector.hh"#include "BLI_math_vector_types.hh"#include "BLI_rect.h"#include "BLT_translation.hh"#include "BKE_context.hh"#include "WM_api.hh"#include "WM_types.hh"#include "wm.hh"#include "wm_event_types.hh"#include "ED_screen.hh"#include "ED_select_utils.hh"#include "RNA_access.hh"Go to the source code of this file.
Classes | |
| struct | SnapAngle |
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) |
Lasso Gesture | |
There are two types of lasso gesture:
The operator stores data in the "path" property as a series of screen space positions. | |
| 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) |
| Array< int2 > | WM_gesture_lasso_path_to_array (bContext *, wmOperator *op) |
Polyline Gesture | |
Gesture defined by three or more points in a viewport enclosing a particular area. Like the Lasso Gesture, the data passed onto other operators via the 'path' property is a sequential array of mouse positions. | |
| int | WM_gesture_polyline_invoke (bContext *C, wmOperator *op, const wmEvent *event) |
| static int | gesture_polyline_valid_points (const wmGesture &wmGesture, const bool is_click_submitted) |
| static bool | gesture_polyline_can_apply (const wmGesture &wmGesture, const bool is_click_submitted) |
| static int | gesture_polyline_apply (bContext *C, wmOperator *op, const bool is_click_submitted) |
| int | WM_gesture_polyline_modal (bContext *C, wmOperator *op, const wmEvent *event) |
| void | WM_gesture_polyline_cancel (bContext *C, wmOperator *op) |
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: | |
| static SnapAngle | get_snap_angle (const ScrArea &area, const ToolSettings &tool_settings) |
| 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, float snap_angle) |
| 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.cc.wm_operator_props.cc. Definition in file wm_gesture_ops.cc.
|
static |
Definition at line 151 of file wm_gesture_ops.cc.
References wmOperator::customdata, wmOperatorType::exec, gesture_box_apply_rect(), gesture_modal_state_to_operator(), wmGesture::modal_state, OPERATOR_FINISHED, OPERATOR_RETVAL_CHECK, true, wmOperator::type, and wmGesture::wait_for_input.
Referenced by WM_gesture_box_modal().
|
static |
Definition at line 133 of file wm_gesture_ops.cc.
References wmGesture::customdata, wmOperator::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 325 of file wm_gesture_ops.cc.
References wmGesture::customdata, wmOperator::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 534 of file wm_gesture_ops.cc.
References wmGesture::customdata, wmOperator::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 57 of file wm_gesture_ops.cc.
References CTX_wm_area(), CTX_wm_window(), wmOperator::customdata, ED_area_tag_redraw(), wmOperator::ptr, RNA_struct_find_property(), WM_cursor_modal_restore(), and WM_gesture_end().
Referenced by gesture_lasso_apply(), gesture_polyline_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_polyline_cancel(), WM_gesture_polyline_modal(), WM_gesture_straightline_cancel(), WM_gesture_straightline_modal(), and WM_gesture_straightline_oneshot_modal().
|
static |
Definition at line 96 of file wm_gesture_ops.cc.
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 72 of file wm_gesture_ops.cc.
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 792 of file wm_gesture_ops.cc.
References BLI_assert, wmGesture::customdata, wmOperator::customdata, wmOperatorType::exec, gesture_modal_end(), gesture_polyline_can_apply(), gesture_polyline_valid_points(), wmGesture::mval, 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_polyline_modal().
|
static |
Evaluates whether the poly-line has at least three points and represents a shape and can be submitted for other gesture operators to act on.
We handle clicking within the original point radius differently than double clicking or submitting through the confirm key-bindings, as the user expects to not add a new point when interacting with this targeted area.
Definition at line 778 of file wm_gesture_ops.cc.
References gesture_polyline_valid_points(), and wmGesture::points.
Referenced by gesture_polyline_apply(), and WM_gesture_polyline_modal().
|
static |
Definition at line 753 of file wm_gesture_ops.cc.
References BLI_assert, wmGesture::customdata, wmGesture::mval, and wmGesture::points.
Referenced by gesture_polyline_apply(), and gesture_polyline_can_apply().
|
static |
Definition at line 978 of file wm_gesture_ops.cc.
References wmGesture::customdata, wmOperator::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().
|
static |
Definition at line 963 of file wm_gesture_ops.cc.
References SnapAngle::increment, SnapAngle::precise_increment, ToolSettings::snap_angle_increment_2d, ToolSettings::snap_angle_increment_2d_precision, ToolSettings::snap_angle_increment_3d, ToolSettings::snap_angle_increment_3d_precision, and SPACE_VIEW3D.
Referenced by WM_gesture_straightline_modal(), and WM_gesture_straightline_oneshot_modal().
| void WM_gesture_box_cancel | ( | bContext * | C, |
| wmOperator * | op ) |
Definition at line 276 of file wm_gesture_ops.cc.
References gesture_modal_end().
Referenced by ACTION_OT_select_box(), ANIM_OT_channels_select_box(), ANIM_OT_previewrange_set(), FILE_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(), blender::ed::space_node::NODE_OT_select_box(), blender::ed::space_node::NODE_OT_viewer_border(), blender::ed::outliner::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 171 of file wm_gesture_ops.cc.
References CTX_wm_region(), CTX_wm_window(), wmOperator::customdata, OPERATOR_RUNNING_MODAL, wmOperator::ptr, RNA_boolean_get(), wmGesture::wait_for_input, WM_event_add_modal_handler(), WM_event_is_mouse_drag_or_press(), 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(), blender::ed::sculpt_paint::face_set::gesture_box_invoke(), blender::ed::sculpt_paint::trim::gesture_box_invoke(), graphkeys_box_select_invoke(), IMAGE_OT_render_border(), IMAGE_OT_view_zoom_border(), INFO_OT_select_box(), MASK_OT_select_box(), nlaedit_box_select_invoke(), blender::ed::space_node::node_box_select_invoke(), blender::ed::space_node::NODE_OT_viewer_border(), blender::ed::outliner::outliner_box_select_invoke(), blender::ed::sculpt_paint::hide::PAINT_OT_hide_show(), blender::ed::sculpt_paint::mask::PAINT_OT_mask_box_gesture(), 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 198 of file wm_gesture_ops.cc.
References BLI_rcti_translate(), CTX_wm_window(), wmGesture::customdata, wmOperator::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, wmEvent::type, wmGesture::type, wmEvent::val, wmGesture::wait_for_input, wmGesture::winrct, WM_GESTURE_CROSS_RECT, wm_gesture_tag_redraw(), rcti::xmax, rcti::xmin, wmEvent::xy, 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(), 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(), blender::ed::space_node::NODE_OT_select_box(), blender::ed::space_node::NODE_OT_viewer_border(), blender::ed::outliner::OUTLINER_OT_select_box(), blender::ed::sculpt_paint::hide::PAINT_OT_hide_show(), blender::ed::sculpt_paint::mask::PAINT_OT_mask_box_gesture(), blender::ed::sculpt_paint::face_set::SCULPT_OT_face_set_box_gesture(), blender::ed::sculpt_paint::trim::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 457 of file wm_gesture_ops.cc.
References gesture_modal_end().
Referenced by ACTION_OT_select_circle(), GRAPH_OT_select_circle(), UV_OT_select_circle(), and view3d_circle_select_cancel().
| int WM_gesture_circle_invoke | ( | bContext * | C, |
| wmOperator * | op, | ||
| const wmEvent * | event ) |
Definition at line 294 of file wm_gesture_ops.cc.
References CTX_wm_region(), CTX_wm_window(), wmGesture::customdata, wmOperator::customdata, gesture_circle_apply(), wmGesture::is_active, wmGesture::is_active_prev, OPERATOR_RUNNING_MODAL, wmOperator::ptr, RNA_boolean_get(), RNA_int_get(), wmGesture::wait_for_input, WM_event_add_modal_handler(), WM_event_is_mouse_drag_or_press(), WM_GESTURE_CIRCLE, WM_gesture_new(), wm_gesture_tag_redraw(), and rcti::xmax.
Referenced by ACTION_OT_select_circle(), CLIP_OT_select_circle(), GRAPH_OT_select_circle(), MASK_OT_select_circle(), blender::ed::space_node::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 353 of file wm_gesture_ops.cc.
References ceil(), CTX_wm_window(), wmGesture::customdata, wmOperator::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(), GRAPH_OT_select_circle(), MASK_OT_select_circle(), blender::ed::space_node::NODE_OT_select_circle(), UV_OT_select_circle(), and view3d_circle_select_modal().
| void WM_gesture_lasso_cancel | ( | bContext * | C, |
| wmOperator * | op ) |
Definition at line 650 of file wm_gesture_ops.cc.
References gesture_modal_end().
Referenced by ACTION_OT_select_lasso(), CLIP_OT_select_lasso(), GRAPH_OT_select_lasso(), GREASE_PENCIL_OT_stroke_trim(), MASK_OT_select_lasso(), blender::ed::space_node::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 490 of file wm_gesture_ops.cc.
References CTX_wm_region(), CTX_wm_window(), wmOperator::customdata, OPERATOR_RUNNING_MODAL, wmOperator::ptr, RNA_boolean_get(), RNA_property_int_get(), RNA_struct_find_property(), wmGesture::use_smooth, 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(), blender::ed::sculpt_paint::face_set::gesture_lasso_invoke(), blender::ed::sculpt_paint::trim::gesture_lasso_invoke(), GRAPH_OT_select_lasso(), GREASE_PENCIL_OT_stroke_trim(), MASK_OT_select_lasso(), blender::ed::space_node::node_lasso_select_invoke(), blender::ed::sculpt_paint::hide::PAINT_OT_hide_show_lasso_gesture(), blender::ed::sculpt_paint::mask::PAINT_OT_mask_lasso_gesture(), UV_OT_select_lasso(), and VIEW3D_OT_select_lasso().
| int WM_gesture_lasso_modal | ( | bContext * | C, |
| wmOperator * | op, | ||
| const wmEvent * | event ) |
Definition at line 563 of file wm_gesture_ops.cc.
References CTX_wm_window(), wmGesture::customdata, wmOperator::customdata, EVT_ESCKEY, EVT_MODAL_MAP, float, gesture_lasso_apply(), gesture_modal_end(), GESTURE_MODAL_MOVE, INBETWEEN_MOUSEMOVE, int2, blender::math::interpolate(), wmGesture::is_active, wmGesture::is_active_prev, KM_RELEASE, LEFTMOUSE, blender::math::length_squared(), MEM_reallocN, MIDDLEMOUSE, MOUSEMOVE, wmGesture::move, wmGesture::mval, OPERATOR_CANCELLED, OPERATOR_RUNNING_MODAL, wmGesture::points, wmGesture::points_alloc, pow2f(), wmOperator::ptr, RIGHTMOUSE, RNA_float_get(), RNA_int_get(), square_f(), wmEvent::type, UI_SCALE_FAC, wmGesture::use_smooth, wmEvent::val, wmGesture::winrct, wm_gesture_tag_redraw(), float2::x, rcti::xmin, wmEvent::xy, float2::y, and rcti::ymin.
Referenced by ACTION_OT_select_lasso(), CLIP_OT_select_lasso(), GRAPH_OT_select_lasso(), GREASE_PENCIL_OT_stroke_trim(), MASK_OT_select_lasso(), blender::ed::space_node::NODE_OT_select_lasso(), blender::ed::sculpt_paint::hide::PAINT_OT_hide_show_lasso_gesture(), blender::ed::sculpt_paint::mask::PAINT_OT_mask_lasso_gesture(), blender::ed::sculpt_paint::face_set::SCULPT_OT_face_set_lasso_gesture(), blender::ed::sculpt_paint::trim::SCULPT_OT_trim_lasso_gesture(), UV_OT_select_lasso(), VIEW3D_OT_select_lasso(), and WM_gesture_lines_modal().
| Array< int2 > WM_gesture_lasso_path_to_array | ( | bContext * | C, |
| wmOperator * | op ) |
helper function, we may want to add options for conversion to view space
Definition at line 660 of file wm_gesture_ops.cc.
References BLI_assert, int2, len, wmOperator::ptr, 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(), clip_lasso_select_exec(), graphkeys_lassoselect_exec(), blender::ed::greasepencil::grease_pencil_stroke_trim(), blender::ed::sculpt_paint::gesture::init_from_lasso(), blender::ed::space_node::node_lasso_select_exec(), uv_lasso_select_exec(), and view3d_lasso_select_exec().
| void WM_gesture_lines_cancel | ( | bContext * | C, |
| wmOperator * | op ) |
Definition at line 655 of file wm_gesture_ops.cc.
References gesture_modal_end().
Referenced by blender::ed::space_node::NODE_OT_add_reroute(), blender::ed::space_node::NODE_OT_links_cut(), and blender::ed::space_node::NODE_OT_links_mute().
| int WM_gesture_lines_invoke | ( | bContext * | C, |
| wmOperator * | op, | ||
| const wmEvent * | event ) |
Definition at line 511 of file wm_gesture_ops.cc.
References CTX_wm_region(), CTX_wm_window(), wmOperator::customdata, OPERATOR_RUNNING_MODAL, wmOperator::ptr, RNA_property_boolean_get(), RNA_property_int_get(), RNA_struct_find_property(), wmGesture::use_smooth, WM_cursor_modal_set(), WM_event_add_modal_handler(), WM_GESTURE_LINES, WM_gesture_new(), and wm_gesture_tag_redraw().
Referenced by blender::ed::space_node::NODE_OT_add_reroute(), blender::ed::space_node::NODE_OT_links_cut(), and blender::ed::space_node::NODE_OT_links_mute().
| int WM_gesture_lines_modal | ( | bContext * | C, |
| wmOperator * | op, | ||
| const wmEvent * | event ) |
Definition at line 645 of file wm_gesture_ops.cc.
References WM_gesture_lasso_modal().
Referenced by blender::ed::space_node::NODE_OT_add_reroute(), blender::ed::space_node::NODE_OT_links_cut(), and blender::ed::space_node::NODE_OT_links_mute().
| void WM_gesture_polyline_cancel | ( | bContext * | C, |
| wmOperator * | op ) |
Definition at line 905 of file wm_gesture_ops.cc.
References gesture_modal_end().
| int WM_gesture_polyline_invoke | ( | bContext * | C, |
| wmOperator * | op, | ||
| const wmEvent * | event ) |
Definition at line 732 of file wm_gesture_ops.cc.
References 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_new(), WM_GESTURE_POLYLINE, and wm_gesture_tag_redraw().
Referenced by blender::ed::sculpt_paint::face_set::gesture_polyline_invoke(), blender::ed::sculpt_paint::trim::gesture_polyline_invoke(), blender::ed::sculpt_paint::hide::PAINT_OT_hide_show_polyline_gesture(), and blender::ed::sculpt_paint::mask::PAINT_OT_mask_polyline_gesture().
| int WM_gesture_polyline_modal | ( | bContext * | C, |
| wmOperator * | op, | ||
| const wmEvent * | event ) |
Definition at line 827 of file wm_gesture_ops.cc.
References CTX_wm_window(), wmGesture::customdata, wmOperator::customdata, EVT_MODAL_MAP, GESTURE_MODAL_CANCEL, GESTURE_MODAL_CONFIRM, gesture_modal_end(), GESTURE_MODAL_MOVE, GESTURE_MODAL_SELECT, gesture_polyline_apply(), gesture_polyline_can_apply(), INBETWEEN_MOUSEMOVE, int2, wmGesture::is_active, wmGesture::is_active_prev, len_v2v2(), MEM_reallocN, MOUSEMOVE, wmGesture::move, wmGesture::mval, OPERATOR_CANCELLED, OPERATOR_RUNNING_MODAL, wmGesture::points, wmGesture::points_alloc, blender::wm::gesture::POLYLINE_CLICK_RADIUS, wmEvent::type, UI_SCALE_FAC, wmEvent::val, wmGesture::winrct, wm_gesture_tag_redraw(), rcti::xmin, wmEvent::xy, and rcti::ymin.
Referenced by blender::ed::sculpt_paint::hide::PAINT_OT_hide_show_polyline_gesture(), blender::ed::sculpt_paint::mask::PAINT_OT_mask_polyline_gesture(), blender::ed::sculpt_paint::face_set::SCULPT_OT_face_set_polyline_gesture(), and blender::ed::sculpt_paint::trim::SCULPT_OT_trim_polyline_gesture().
| int WM_gesture_straightline_active_side_invoke | ( | bContext * | C, |
| wmOperator * | op, | ||
| const wmEvent * | event ) |
This invoke callback starts the straight-line gesture with a viewport preview to the right side of the line.
Definition at line 1025 of file wm_gesture_ops.cc.
References wmOperator::customdata, wmGesture::draw_active_side, OPERATOR_RUNNING_MODAL, wmGesture::use_flip, and WM_gesture_straightline_invoke().
Referenced by blender::ed::sculpt_paint::face_set::gesture_line_invoke(), blender::ed::sculpt_paint::project::gesture_line_invoke(), blender::ed::sculpt_paint::trim::gesture_line_invoke(), mesh_bisect_invoke(), blender::ed::sculpt_paint::hide::PAINT_OT_hide_show_line_gesture(), and blender::ed::sculpt_paint::mask::PAINT_OT_mask_line_gesture().
| void WM_gesture_straightline_cancel | ( | bContext * | C, |
| wmOperator * | op ) |
Definition at line 1243 of file wm_gesture_ops.cc.
References gesture_modal_end().
Referenced by blender::ed::greasepencil::GREASE_PENCIL_OT_texture_gradient(), blender::ed::greasepencil::grease_pencil_texture_gradient_modal(), IMAGE_OT_sample_line(), MESH_OT_bisect(), PAINT_OT_weight_gradient(), and paint_weight_gradient_modal().
Definition at line 1034 of file wm_gesture_ops.cc.
References abs(), add_v2_v2(), angle_signed_v2v2(), compare_ff(), DEG2RADF, e, fabsf, float, floorf, fractf(), int, mul_v2_fl(), normalize_v2(), rotate_v2_v2fl(), 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 1002 of file wm_gesture_ops.cc.
References CTX_wm_region(), CTX_wm_window(), wmOperator::customdata, wmGesture::is_active, OPERATOR_RUNNING_MODAL, wmOperator::ptr, RNA_property_int_get(), RNA_struct_find_property(), WM_cursor_modal_set(), WM_event_add_modal_handler(), WM_event_is_mouse_drag_or_press(), WM_gesture_new(), WM_GESTURE_STRAIGHTLINE, and wm_gesture_tag_redraw().
Referenced by blender::ed::greasepencil::grease_pencil_texture_gradient_invoke(), 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 1073 of file wm_gesture_ops.cc.
References BLI_rcti_translate(), CTX_data_scene(), CTX_wm_area(), CTX_wm_window(), wmGesture::customdata, wmOperator::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(), get_snap_angle(), SnapAngle::increment, 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(), rcti::xmax, rcti::xmin, wmEvent::xy, rcti::ymax, and rcti::ymin.
Referenced by blender::ed::greasepencil::grease_pencil_texture_gradient_modal(), 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 1157 of file wm_gesture_ops.cc.
References BLI_rcti_translate(), CTX_data_scene(), CTX_wm_area(), CTX_wm_window(), wmGesture::customdata, wmOperator::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(), get_snap_angle(), SnapAngle::increment, 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(), rcti::xmax, rcti::xmin, wmEvent::xy, rcti::ymax, and rcti::ymin.
Referenced by blender::ed::sculpt_paint::hide::PAINT_OT_hide_show_line_gesture(), blender::ed::sculpt_paint::mask::PAINT_OT_mask_line_gesture(), blender::ed::sculpt_paint::face_set::SCULPT_OT_face_set_line_gesture(), blender::ed::sculpt_paint::project::SCULPT_OT_project_line_gesture(), and blender::ed::sculpt_paint::trim::SCULPT_OT_trim_line_gesture().