Blender
V3.3
|
#include "DNA_screen_types.h"
#include "DNA_userdef_types.h"
#include "DNA_vec_types.h"
#include "DNA_windowmanager_types.h"
#include "MEM_guardedalloc.h"
#include "BLI_bitmap_draw_2d.h"
#include "BLI_blenlib.h"
#include "BLI_lasso_2d.h"
#include "BLI_math.h"
#include "BLI_utildefines.h"
#include "BKE_context.h"
#include "WM_api.h"
#include "WM_types.h"
#include "wm.h"
#include "wm_draw.h"
#include "GPU_immediate.h"
#include "GPU_immediate_util.h"
#include "GPU_state.h"
#include "BIF_glutil.h"
Go to the source code of this file.
Classes | |
struct | LassoFillData |
Functions | |
wmGesture * | WM_gesture_new (wmWindow *window, const ARegion *region, const wmEvent *event, int type) |
void | WM_gesture_end (wmWindow *win, wmGesture *gesture) |
void | WM_gestures_free_all (wmWindow *win) |
void | WM_gestures_remove (wmWindow *win) |
bool | WM_gesture_is_modal_first (const wmGesture *gesture) |
static void | wm_gesture_draw_line_active_side (rcti *rect, const bool flip) |
static void | wm_gesture_draw_line (wmGesture *gt) |
static void | wm_gesture_draw_rect (wmGesture *gt) |
static void | wm_gesture_draw_circle (wmGesture *gt) |
static void | draw_filled_lasso_px_cb (int x, int x_end, int y, void *user_data) |
static void | draw_filled_lasso (wmGesture *gt) |
static void | wm_gesture_draw_lasso (wmGesture *gt, bool filled) |
static void | wm_gesture_draw_cross (wmWindow *win, wmGesture *gt) |
void | wm_gesture_draw (wmWindow *win) |
void | wm_gesture_tag_redraw (wmWindow *win) |
Gestures (cursor motions) creating, evaluating and drawing, shared between operators.
Definition in file wm_gesture.c.
Definition at line 289 of file wm_gesture.c.
References BLI_bitmap_draw_2d_poly_v2i_n(), BLI_lasso_boundbox(), BLI_rcti_is_empty(), BLI_rcti_isect(), BLI_rcti_size_x(), BLI_rcti_size_y(), BLI_rcti_translate(), wmGesture::customdata, draw_filled_lasso_px_cb(), GPU_blend(), GPU_BLEND_ADDITIVE_PREMULT, GPU_BLEND_NONE, GPU_R8, GPU_SHADER_2D_IMAGE_SHUFFLE_COLOR, GPU_shader_bind(), GPU_shader_get_uniform(), GPU_shader_unbind(), GPU_shader_uniform_vector(), immDrawPixelsTexSetup(), immDrawPixelsTexTiled(), MEM_callocN, MEM_freeN, MEM_mallocN, NULL, wmGesture::points, red, state, w(), wmGesture::winrct, rcti::xmax, rcti::xmin, rcti::ymax, and rcti::ymin.
Referenced by wm_gesture_draw_lasso().
Definition at line 282 of file wm_gesture.c.
References col, data, user_data, x, and y.
Referenced by draw_filled_lasso().
Definition at line 433 of file wm_gesture.c.
References ListBase::first, wmWindow::gesture, GPU_line_width(), wmGesture::is_active, wmGesture::next, wmGesture::type, wmGesture::winrct, WM_GESTURE_CIRCLE, WM_GESTURE_CROSS_RECT, wm_gesture_draw_circle(), wm_gesture_draw_cross(), wm_gesture_draw_lasso(), wm_gesture_draw_line(), wm_gesture_draw_rect(), WM_GESTURE_LASSO, WM_GESTURE_LINES, WM_GESTURE_RECT, WM_GESTURE_STRAIGHTLINE, and wmViewport().
Referenced by wm_draw_window_onscreen().
Definition at line 242 of file wm_gesture.c.
References wmGesture::customdata, GPU_blend(), GPU_BLEND_ALPHA, GPU_BLEND_NONE, GPU_COMP_F32, GPU_FETCH_FLOAT, GPU_SHADER_2D_LINE_DASHED_UNIFORM_COLOR, GPU_SHADER_2D_UNIFORM_COLOR, GPU_vertformat_attr_add(), GPU_viewport_size_get_f(), imm_draw_circle_fill_2d(), imm_draw_circle_wire_2d(), immBindBuiltinProgram(), immUnbindProgram(), immUniform1f(), immUniform1i(), immUniform2f(), immUniform4f(), immUniformColor4f(), immVertexFormat(), rcti::xmax, rcti::xmin, and rcti::ymin.
Referenced by wm_gesture_draw().
Definition at line 387 of file wm_gesture.c.
References wmGesture::customdata, float(), GPU_COMP_F32, GPU_FETCH_FLOAT, GPU_PRIM_LINES, GPU_SHADER_2D_LINE_DASHED_UNIFORM_COLOR, GPU_vertformat_attr_add(), GPU_viewport_size_get_f(), immBegin(), immBindBuiltinProgram(), immEnd(), immUnbindProgram(), immUniform1f(), immUniform1i(), immUniform2f(), immUniform4f(), immVertex2f(), immVertexFormat(), WM_window_pixels_x(), WM_window_pixels_y(), x2, rcti::xmin, y1, and rcti::ymin.
Referenced by wm_gesture_draw().
Definition at line 345 of file wm_gesture.c.
References wmGesture::customdata, draw_filled_lasso(), GPU_COMP_F32, GPU_FETCH_FLOAT, GPU_PRIM_LINE_LOOP, GPU_PRIM_LINE_STRIP, GPU_SHADER_2D_LINE_DASHED_UNIFORM_COLOR, GPU_vertformat_attr_add(), GPU_viewport_size_get_f(), if(), immBegin(), immBindBuiltinProgram(), immEnd(), immUnbindProgram(), immUniform1f(), immUniform1i(), immUniform2f(), immUniform4f(), immVertex2f(), immVertexFormat(), wmGesture::points, wmGesture::type, and WM_GESTURE_LASSO.
Referenced by wm_gesture_draw().
Definition at line 167 of file wm_gesture.c.
References wmGesture::customdata, wmGesture::draw_active_side, float(), GPU_COMP_F32, GPU_FETCH_FLOAT, GPU_PRIM_LINES, GPU_SHADER_2D_LINE_DASHED_UNIFORM_COLOR, GPU_vertformat_attr_add(), GPU_viewport_size_get_f(), if(), immBegin(), immBindBuiltinProgram(), immEnd(), immUnbindProgram(), immUniform1f(), immUniform1i(), immUniform2f(), immUniform4f(), immVertex2f(), immVertexFormat(), wmGesture::use_flip, wm_gesture_draw_line_active_side(), rcti::xmax, rcti::xmin, rcti::ymax, and rcti::ymin.
Referenced by wm_gesture_draw().
Definition at line 118 of file wm_gesture.c.
References add_v2_v2v2(), GPU_blend(), GPU_BLEND_ALPHA, GPU_BLEND_NONE, GPU_COMP_F32, GPU_FETCH_FLOAT, GPU_PRIM_TRIS, GPU_SHADER_2D_SMOOTH_COLOR, GPU_vertformat_attr_add(), immAttr4f(), immBegin(), immBindBuiltinProgram(), immEnd(), immUnbindProgram(), immVertex2f(), immVertexFormat(), mul_v2_fl(), normalize_v2(), ortho_v2_v2(), sub_v2_v2v2(), UNPACK4, rcti::xmax, rcti::xmin, rcti::ymax, and rcti::ymin.
Referenced by wm_gesture_draw_line().
Definition at line 201 of file wm_gesture.c.
References wmGesture::customdata, GPU_blend(), GPU_BLEND_ALPHA, GPU_BLEND_NONE, GPU_COMP_F32, GPU_COMP_I32, GPU_FETCH_FLOAT, GPU_FETCH_INT_TO_FLOAT, GPU_SHADER_2D_LINE_DASHED_UNIFORM_COLOR, GPU_SHADER_2D_UNIFORM_COLOR, GPU_vertformat_attr_add(), GPU_viewport_size_get_f(), imm_draw_box_wire_2d(), immBindBuiltinProgram(), immRecti(), immUnbindProgram(), immUniform1f(), immUniform1i(), immUniform2f(), immUniform4f(), immUniformColor4f(), immVertexFormat(), rcti::xmax, rcti::xmin, rcti::ymax, and rcti::ymin.
Referenced by wm_gesture_draw().
Definition at line 86 of file wm_gesture.c.
References BLI_remlink(), wmGesture::customdata, wmWindow::gesture, MEM_freeN, wmGesture::user_data, and WM_generic_user_data_free().
Referenced by gesture_modal_end(), WM_gestures_free_all(), and WM_gestures_remove().
Definition at line 108 of file wm_gesture.c.
References wmGesture::is_active_prev, and NULL.
Referenced by action_circle_select_exec(), circle_select_exec(), gpencil_circle_select_exec(), graph_circle_select_exec(), blender::ed::space_node::node_circleselect_exec(), uv_circle_select_exec(), and view3d_circle_select_exec().
wmGesture* WM_gesture_new | ( | wmWindow * | window, |
const ARegion * | region, | ||
const wmEvent * | event, | ||
int | type | ||
) |
Definition at line 37 of file wm_gesture.c.
References BLI_addtail(), wmGesture::customdata, ELEM, wmGesture::event_keymodifier, wmGesture::event_modifier, wmGesture::event_type, wmWindow::gesture, GESTURE_MODAL_NOP, MEM_callocN, MEM_mallocN, wmGesture::modal_state, wmGesture::move, wmGesture::points, wmGesture::points_alloc, type, wmGesture::type, wmGenericUserData::use_free, wmGesture::user_data, ARegion::winrct, wmGesture::winrct, WM_event_drag_start_xy(), WM_GESTURE_CIRCLE, WM_GESTURE_CROSS_RECT, WM_GESTURE_LASSO, WM_GESTURE_LINES, WM_GESTURE_RECT, WM_GESTURE_STRAIGHTLINE, rcti::xmax, rcti::xmin, xy, rcti::ymax, and rcti::ymin.
Referenced by WM_gesture_box_invoke(), WM_gesture_circle_invoke(), WM_gesture_lasso_invoke(), WM_gesture_lines_invoke(), and WM_gesture_straightline_invoke().
Use for line gesture.
Definition at line 468 of file wm_gesture.c.
References bScreen::do_draw_gesture, and WM_window_get_active_screen().
Referenced by WM_gesture_box_invoke(), WM_gesture_box_modal(), WM_gesture_circle_invoke(), WM_gesture_circle_modal(), WM_gesture_lasso_invoke(), WM_gesture_lasso_modal(), WM_gesture_lines_invoke(), WM_gesture_straightline_invoke(), WM_gesture_straightline_modal(), and WM_gesture_straightline_oneshot_modal().
Definition at line 94 of file wm_gesture.c.
References ListBase::first, wmWindow::gesture, and WM_gesture_end().
Referenced by wm_window_free().
Definition at line 101 of file wm_gesture.c.
References ListBase::first, wmWindow::gesture, and WM_gesture_end().
Referenced by ui_but_drag_init().