Blender V4.3
wm_gesture.cc
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2008 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
11#include "DNA_screen_types.h"
12#include "DNA_userdef_types.h"
13#include "DNA_vec_types.h"
15
16#include "MEM_guardedalloc.h"
17
18#include "BLI_bitmap_draw_2d.h"
19#include "BLI_blenlib.h"
20#include "BLI_lasso_2d.hh"
21#include "BLI_utildefines.h"
22
23#include "WM_api.hh"
24#include "WM_types.hh"
25
26#include "wm.hh"
27
28#include "GPU_immediate.hh"
29#include "GPU_immediate_util.hh"
30#include "GPU_state.hh"
31
32#include "BIF_glutil.hh"
33
34using blender::Array;
35using blender::int2;
36
37wmGesture *WM_gesture_new(wmWindow *window, const ARegion *region, const wmEvent *event, int type)
38{
39 wmGesture *gesture = static_cast<wmGesture *>(MEM_callocN(sizeof(wmGesture), "new gesture"));
40
41 BLI_addtail(&window->gesture, gesture);
42
43 gesture->type = type;
44 gesture->event_type = event->type;
45 gesture->event_modifier = event->modifier;
46 gesture->event_keymodifier = event->keymodifier;
47 gesture->winrct = region->winrct;
48 gesture->user_data.use_free = true; /* Free if user-data is set. */
50 gesture->move = false;
51
52 int xy[2];
54
55 if (ELEM(type,
60 {
61 rcti *rect = static_cast<rcti *>(MEM_callocN(sizeof(rcti), "gesture rect new"));
62
63 gesture->customdata = rect;
64 rect->xmin = xy[0] - gesture->winrct.xmin;
65 rect->ymin = xy[1] - gesture->winrct.ymin;
66 if (type == WM_GESTURE_CIRCLE) {
67 /* Caller is responsible for initializing 'xmax' to radius. */
68 }
69 else {
70 rect->xmax = xy[0] - gesture->winrct.xmin;
71 rect->ymax = xy[1] - gesture->winrct.ymin;
72 }
73 }
74 else if (ELEM(type, WM_GESTURE_LINES, WM_GESTURE_LASSO)) {
75 float *lasso;
76 gesture->points_alloc = 1024;
77 gesture->customdata = lasso = static_cast<float *>(
78 MEM_mallocN(sizeof(float[2]) * gesture->points_alloc, "lasso points"));
79 lasso[0] = xy[0] - gesture->winrct.xmin;
80 lasso[1] = xy[1] - gesture->winrct.ymin;
81 gesture->points = 1;
82 }
83 else if (ELEM(type, WM_GESTURE_POLYLINE)) {
84 gesture->points_alloc = 64;
85 short *border = static_cast<short int *>(
86 MEM_mallocN(sizeof(short[2]) * gesture->points_alloc, "polyline points"));
87 gesture->customdata = border;
88 border[0] = xy[0] - gesture->winrct.xmin;
89 border[1] = xy[1] - gesture->winrct.ymin;
90 gesture->mval.x = border[0];
91 gesture->mval.y = border[1];
92 gesture->points = 1;
93 }
94
95 return gesture;
96}
97
98void WM_gesture_end(wmWindow *win, wmGesture *gesture)
99{
100 BLI_remlink(&win->gesture, gesture);
101 MEM_freeN(gesture->customdata);
103 MEM_freeN(gesture);
104}
105
107{
108 while (win->gesture.first) {
109 WM_gesture_end(win, static_cast<wmGesture *>(win->gesture.first));
110 }
111}
112
114{
115 while (win->gesture.first) {
116 WM_gesture_end(win, static_cast<wmGesture *>(win->gesture.first));
117 }
118}
119
121{
122 if (gesture == nullptr) {
123 return true;
124 }
125 return (gesture->is_active_prev == false);
126}
127
128/* ******************* gesture draw ******************* */
129
130static void wm_gesture_draw_line_active_side(const rcti *rect, const bool flip)
131{
135
138
139 const float gradient_length = 150.0f * U.pixelsize;
140 float line_dir[2];
141 float gradient_dir[2];
142 float gradient_point[2][2];
143
144 const float line_start[2] = {float(rect->xmin), float(rect->ymin)};
145 const float line_end[2] = {float(rect->xmax), float(rect->ymax)};
146 const float color_line_gradient_start[4] = {0.2f, 0.2f, 0.2f, 0.4f};
147 const float color_line_gradient_end[4] = {0.0f, 0.0f, 0.0f, 0.0f};
148
149 sub_v2_v2v2(line_dir, line_end, line_start);
150 normalize_v2(line_dir);
151 ortho_v2_v2(gradient_dir, line_dir);
152 if (!flip) {
153 mul_v2_fl(gradient_dir, -1.0f);
154 }
155 mul_v2_fl(gradient_dir, gradient_length);
156 add_v2_v2v2(gradient_point[0], line_start, gradient_dir);
157 add_v2_v2v2(gradient_point[1], line_end, gradient_dir);
158
160 immAttr4f(shdr_col, UNPACK4(color_line_gradient_start));
161 immVertex2f(shdr_pos, line_start[0], line_start[1]);
162 immAttr4f(shdr_col, UNPACK4(color_line_gradient_start));
163 immVertex2f(shdr_pos, line_end[0], line_end[1]);
164 immAttr4f(shdr_col, UNPACK4(color_line_gradient_end));
165 immVertex2f(shdr_pos, gradient_point[1][0], gradient_point[1][1]);
166
167 immAttr4f(shdr_col, UNPACK4(color_line_gradient_start));
168 immVertex2f(shdr_pos, line_start[0], line_start[1]);
169 immAttr4f(shdr_col, UNPACK4(color_line_gradient_end));
170 immVertex2f(shdr_pos, gradient_point[1][0], gradient_point[1][1]);
171 immAttr4f(shdr_col, UNPACK4(color_line_gradient_end));
172 immVertex2f(shdr_pos, gradient_point[0][0], gradient_point[0][1]);
173 immEnd();
174
177}
178
180{
181 const rcti *rect = (rcti *)gt->customdata;
182
183 if (gt->draw_active_side) {
185 }
186
187 uint shdr_pos = GPU_vertformat_attr_add(
189
191
192 float viewport_size[4];
193 GPU_viewport_size_get_f(viewport_size);
194 immUniform2f("viewport_size", viewport_size[2], viewport_size[3]);
195
196 immUniform1i("colors_len", 2); /* "advanced" mode. */
197 immUniform4f("color", 0.4f, 0.4f, 0.4f, 1.0f);
198 immUniform4f("color2", 1.0f, 1.0f, 1.0f, 1.0f);
199 immUniform1f("dash_width", 8.0f);
200 immUniform1f("udash_factor", 0.5f);
201
202 float xmin = float(rect->xmin);
203 float ymin = float(rect->ymin);
204
206 immVertex2f(shdr_pos, xmin, ymin);
207 immVertex2f(shdr_pos, float(rect->xmax), float(rect->ymax));
208 immEnd();
209
211}
212
214{
215 const rcti *rect = static_cast<const rcti *>(gt->customdata);
216
217 uint shdr_pos = GPU_vertformat_attr_add(
219
221
223 immUniformColor4f(1.0f, 1.0f, 1.0f, 0.05f);
224
225 immRecti(shdr_pos, rect->xmin, rect->ymin, rect->xmax, rect->ymax);
226
228
230
232
234
235 float viewport_size[4];
236 GPU_viewport_size_get_f(viewport_size);
237 immUniform2f("viewport_size", viewport_size[2], viewport_size[3]);
238
239 immUniform1i("colors_len", 2); /* "advanced" mode. */
240 immUniform4f("color", 0.4f, 0.4f, 0.4f, 1.0f);
241 immUniform4f("color2", 1.0f, 1.0f, 1.0f, 1.0f);
242 immUniform1f("dash_width", 8.0f);
243 immUniform1f("udash_factor", 0.5f);
244
246 shdr_pos, float(rect->xmin), float(rect->ymin), float(rect->xmax), float(rect->ymax));
247
249
250 /* Draws a diagonal line in the lined box to test #wm_gesture_draw_line. */
251 // wm_gesture_draw_line(gt);
252}
253
255{
256 const rcti *rect = static_cast<const rcti *>(gt->customdata);
257
259
260 const uint shdr_pos = GPU_vertformat_attr_add(
262
264
265 immUniformColor4f(1.0f, 1.0f, 1.0f, 0.05f);
266 imm_draw_circle_fill_2d(shdr_pos, float(rect->xmin), float(rect->ymin), float(rect->xmax), 40);
267
269
271
273
274 float viewport_size[4];
275 GPU_viewport_size_get_f(viewport_size);
276 immUniform2f("viewport_size", viewport_size[2], viewport_size[3]);
277
278 immUniform1i("colors_len", 2); /* "advanced" mode. */
279 immUniform4f("color", 0.4f, 0.4f, 0.4f, 1.0f);
280 immUniform4f("color2", 1.0f, 1.0f, 1.0f, 1.0f);
281 immUniform1f("dash_width", 4.0f);
282 immUniform1f("udash_factor", 0.5f);
283
284 imm_draw_circle_wire_2d(shdr_pos, float(rect->xmin), float(rect->ymin), float(rect->xmax), 40);
285
287}
288
291 int width;
292};
293
294static void draw_filled_lasso_px_cb(int x, int x_end, int y, void *user_data)
295{
296 LassoFillData *data = static_cast<LassoFillData *>(user_data);
297 uchar *col = &(data->px[(y * data->width) + x]);
298 memset(col, 0x10, x_end - x);
299}
300
302{
303 const float *lasso = (float *)gt->customdata;
304 const int mcoords_len = gt->points;
305 Array<int2> mcoords(mcoords_len);
306 int i;
307 rcti rect;
308 const float red[4] = {1.0f, 0.0f, 0.0f, 0.0f};
309
310 for (i = 0; i < mcoords_len; i++, lasso += 2) {
311 mcoords[i][0] = lasso[0];
312 mcoords[i][1] = lasso[1];
313 }
314
315 BLI_lasso_boundbox(&rect, mcoords);
316
317 BLI_rcti_translate(&rect, gt->winrct.xmin, gt->winrct.ymin);
318 BLI_rcti_isect(&gt->winrct, &rect, &rect);
319 BLI_rcti_translate(&rect, -gt->winrct.xmin, -gt->winrct.ymin);
320
321 /* Highly unlikely this will fail, but could crash if (mcoords_len == 0). */
322 if (BLI_rcti_is_empty(&rect) == false) {
323 const int w = BLI_rcti_size_x(&rect);
324 const int h = BLI_rcti_size_y(&rect);
325 uchar *pixel_buf = static_cast<uchar *>(MEM_callocN(sizeof(*pixel_buf) * w * h, __func__));
326 LassoFillData lasso_fill_data = {pixel_buf, w};
327
329 rect.ymin,
330 rect.xmax,
331 rect.ymax,
332 mcoords,
334 &lasso_fill_data);
335
337
339 GPU_shader_bind(state.shader);
341 state.shader, GPU_shader_get_uniform(state.shader, "shuffle"), 4, 1, red);
342
344 &state, rect.xmin, rect.ymin, w, h, GPU_R8, false, pixel_buf, 1.0f, 1.0f, nullptr);
345
347
348 MEM_freeN(pixel_buf);
349
351 }
352}
353
354/* TODO: Extract this common functionality so it can be shared between Sculpt brushes, the annotate
355 * tool, and this common logic. */
356static void draw_lasso_smooth_stroke_indicator(wmGesture *gt, const uint shdr_pos)
357{
358 float(*lasso)[2] = static_cast<float(*)[2]>(gt->customdata);
359 float last_x = lasso[gt->points - 1][0];
360 float last_y = lasso[gt->points - 1][1];
361
363 GPU_line_smooth(true);
365
366 GPU_line_width(1.25f);
367 const float color[3] = {1.0f, 0.39f, 0.39f};
368
369 const float radius = 4.0f;
370
371 /* Draw Inner Ring */
372 immUniformColor4f(color[0], color[1], color[2], 0.8f);
373 imm_draw_circle_wire_2d(shdr_pos, gt->mval.x, gt->mval.y, radius, 40);
374
375 /* Draw Outer Ring: Dark color for contrast on light backgrounds (e.g. gray on white) */
376 float darkcolor[3];
377 mul_v3_v3fl(darkcolor, color, 0.40f);
378 immUniformColor4f(darkcolor[0], darkcolor[1], darkcolor[2], 0.8f);
379 imm_draw_circle_wire_2d(shdr_pos, gt->mval.x, gt->mval.y, radius + 1, 40);
380
381 /* Draw line from the last saved position to the current mouse position. */
382 immUniformColor4f(color[0], color[1], color[2], 0.8f);
384 immVertex2f(shdr_pos, gt->mval.x, gt->mval.y);
385 immVertex2f(shdr_pos, last_x, last_y);
386 immEnd();
387
389 GPU_line_smooth(false);
391}
392
393static void wm_gesture_draw_lasso(wmGesture *gt, bool filled)
394{
395 const float *lasso = (float *)gt->customdata;
396 int i;
397
398 if (filled) {
400 }
401
402 const int numverts = gt->points;
403
404 /* Nothing to draw, do early output. */
405 if (numverts < 2) {
406 return;
407 }
408
409 const uint shdr_pos = GPU_vertformat_attr_add(
411
413
414 float viewport_size[4];
415 GPU_viewport_size_get_f(viewport_size);
416 immUniform2f("viewport_size", viewport_size[2], viewport_size[3]);
417
418 immUniform1i("colors_len", 2); /* "advanced" mode. */
419 immUniform4f("color", 0.4f, 0.4f, 0.4f, 1.0f);
420 immUniform4f("color2", 1.0f, 1.0f, 1.0f, 1.0f);
421 immUniform1f("dash_width", 2.0f);
422 immUniform1f("udash_factor", 0.5f);
423
425
426 for (i = 0; i < gt->points; i++, lasso += 2) {
427 immVertex2f(shdr_pos, lasso[0], lasso[1]);
428 }
429
430 immEnd();
432
433 if (gt->use_smooth) {
435 }
436}
437
438static void draw_start_vertex_circle(const wmGesture &gt, const uint shdr_pos)
439{
440 const int numverts = gt.points;
441
442 /* Draw the circle around the starting vertex. */
443 const short(*border)[2] = static_cast<short int(*)[2]>(gt.customdata);
444
445 const float start_pos[2] = {float(border[0][0]), float(border[0][1])};
446 const float current_pos[2] = {float(gt.mval.x), float(gt.mval.y)};
447
448 const float dist = len_v2v2(start_pos, current_pos);
450
451 if (dist < limit && numverts > 2) {
452 const float u = smoothstep(0.0f, limit, dist);
453 const float radius = interpf(
455
457
458 const blender::float3 color = {1.0f, 1.0f, 1.0f};
459 immUniformColor4f(color.x, color.y, color.z, 0.8f);
460 imm_draw_circle_wire_2d(shdr_pos, start_pos[0], start_pos[1], radius, 15.0f);
461
462 const blender::float3 darker_color = color * 0.4f;
463 immUniformColor4f(darker_color.x, darker_color.y, darker_color.z, 0.8f);
464 imm_draw_circle_wire_2d(shdr_pos, start_pos[0], start_pos[1], radius + 1, 15.0f);
465
467 }
468}
469
471{
473
474 const int numverts = gt->points + 1;
475 if (numverts < 2) {
476 return;
477 }
478
479 const uint shdr_pos = GPU_vertformat_attr_add(
481
483
484 float viewport_size[4];
485 GPU_viewport_size_get_f(viewport_size);
486 immUniform2f("viewport_size", viewport_size[2], viewport_size[3]);
487
488 immUniform1i("colors_len", 2); /* "advanced" mode */
489 immUniform4f("color", 0.4f, 0.4f, 0.4f, 1.0f);
490 immUniform4f("color2", 1.0f, 1.0f, 1.0f, 1.0f);
491 immUniform1f("dash_width", 2.0f);
492 immUniform1f("udash_factor", 0.5f);
493
494 immBegin(GPU_PRIM_LINE_LOOP, numverts);
495
496 const short *border = (short *)gt->customdata;
497 for (int i = 0; i < gt->points; i++, border += 2) {
498 immVertex2f(shdr_pos, float(border[0]), float(border[1]));
499 }
500 immVertex2f(shdr_pos, float(gt->mval.x), float(gt->mval.y));
501
502 immEnd();
503
505
506 draw_start_vertex_circle(*gt, shdr_pos);
507}
508
509static void wm_gesture_draw_cross(const wmWindow *win, const wmGesture *gt)
510{
511 const rcti *rect = static_cast<const rcti *>(gt->customdata);
512 const blender::int2 win_size = WM_window_native_pixel_size(win);
513
514 float x1, x2, y1, y2;
515
516 const uint shdr_pos = GPU_vertformat_attr_add(
518
520
521 float viewport_size[4];
522 GPU_viewport_size_get_f(viewport_size);
523 immUniform2f("viewport_size", viewport_size[2], viewport_size[3]);
524
525 immUniform1i("colors_len", 2); /* "advanced" mode. */
526 immUniform4f("color", 0.4f, 0.4f, 0.4f, 1.0f);
527 immUniform4f("color2", 1.0f, 1.0f, 1.0f, 1.0f);
528 immUniform1f("dash_width", 8.0f);
529 immUniform1f("udash_factor", 0.5f);
530
532
533 x1 = float(rect->xmin - win_size[0]);
534 y1 = float(rect->ymin);
535 x2 = float(rect->xmin + win_size[0]);
536 y2 = y1;
537
538 immVertex2f(shdr_pos, x1, y1);
539 immVertex2f(shdr_pos, x2, y2);
540
541 x1 = float(rect->xmin);
542 y1 = float(rect->ymin - win_size[1]);
543 x2 = x1;
544 y2 = float(rect->ymin + win_size[1]);
545
546 immVertex2f(shdr_pos, x1, y1);
547 immVertex2f(shdr_pos, x2, y2);
548
549 immEnd();
550
552}
553
555{
556 wmGesture *gt = (wmGesture *)win->gesture.first;
557
558 GPU_line_width(1.0f);
559 for (; gt; gt = gt->next) {
560 /* All in sub-window space. */
561 wmViewport(&gt->winrct);
562
563 if (gt->type == WM_GESTURE_RECT) {
565 }
566 else if (gt->type == WM_GESTURE_CIRCLE) {
568 }
569 else if (gt->type == WM_GESTURE_CROSS_RECT) {
570 if (gt->is_active) {
572 }
573 else {
574 wm_gesture_draw_cross(win, gt);
575 }
576 }
577 else if (gt->type == WM_GESTURE_LINES) {
578 wm_gesture_draw_lasso(gt, false);
579 }
580 else if (gt->type == WM_GESTURE_LASSO) {
581 wm_gesture_draw_lasso(gt, true);
582 }
583 else if (gt->type == WM_GESTURE_STRAIGHTLINE) {
585 }
586 else if (gt->type == WM_GESTURE_POLYLINE) {
588 }
589 }
590}
591
593{
595
596 if (screen) {
597 screen->do_draw_gesture = true;
598 }
599}
void immDrawPixelsTexTiled(IMMDrawPixelsTexState *state, float x, float y, int img_w, int img_h, eGPUTextureFormat gpu_format, bool use_filter, const void *rect, float xzoom, float yzoom, const float color[4])
Definition glutil.cc:334
IMMDrawPixelsTexState immDrawPixelsTexSetup(int builtin)
Definition glutil.cc:40
void BLI_bitmap_draw_2d_poly_v2i_n(int xmin, int ymin, int xmax, int ymax, blender::Span< blender::int2 > verts, void(*callback)(int x, int x_end, int y, void *), void *user_data)
void BLI_lasso_boundbox(rcti *rect, blender::Span< blender::int2 > mcoords)
void BLI_addtail(struct ListBase *listbase, void *vlink) ATTR_NONNULL(1)
Definition listbase.cc:110
void BLI_remlink(struct ListBase *listbase, void *vlink) ATTR_NONNULL(1)
Definition listbase.cc:130
MINLINE float pow2f(float x)
MINLINE float interpf(float target, float origin, float t)
MINLINE float len_v2v2(const float v1[2], const float v2[2]) ATTR_WARN_UNUSED_RESULT
MINLINE void mul_v2_fl(float r[2], float f)
MINLINE void add_v2_v2v2(float r[2], const float a[2], const float b[2])
void ortho_v2_v2(float out[2], const float v[2])
MINLINE void sub_v2_v2v2(float r[2], const float a[2], const float b[2])
MINLINE float normalize_v2(float n[2])
MINLINE void mul_v3_v3fl(float r[3], const float a[3], float f)
BLI_INLINE int BLI_rcti_size_y(const struct rcti *rct)
Definition BLI_rect.h:193
void BLI_rcti_translate(struct rcti *rect, int x, int y)
Definition rct.c:560
bool BLI_rcti_isect(const struct rcti *src1, const struct rcti *src2, struct rcti *dest)
BLI_INLINE int BLI_rcti_size_x(const struct rcti *rct)
Definition BLI_rect.h:189
bool BLI_rcti_is_empty(const struct rcti *rect)
unsigned char uchar
unsigned int uint
#define UNPACK4(a)
#define ELEM(...)
#define UI_SCALE_FAC
void immUniform4f(const char *name, float x, float y, float z, float w)
void immEnd()
void immUnbindProgram()
void immUniform2f(const char *name, float x, float y)
void immUniformColor4f(float r, float g, float b, float a)
void immVertex2f(uint attr_id, float x, float y)
void immBindBuiltinProgram(eGPUBuiltinShader shader_id)
void immUniform1i(const char *name, int x)
void immUniform1f(const char *name, float x)
GPUVertFormat * immVertexFormat()
void immAttr4f(uint attr_id, float x, float y, float z, float w)
void immBegin(GPUPrimType, uint vertex_len)
void imm_draw_box_wire_2d(uint pos, float x1, float y1, float x2, float y2)
void imm_draw_circle_fill_2d(uint shdr_pos, float x, float y, float radius, int nsegments)
void immRecti(uint pos, int x1, int y1, int x2, int y2)
void imm_draw_circle_wire_2d(uint shdr_pos, float x, float y, float radius, int nsegments)
@ GPU_PRIM_LINE_LOOP
@ GPU_PRIM_LINES
@ GPU_PRIM_LINE_STRIP
@ GPU_PRIM_TRIS
int GPU_shader_get_uniform(GPUShader *shader, const char *name)
void GPU_shader_uniform_float_ex(GPUShader *shader, int location, int length, int array_size, const float *value)
void GPU_shader_bind(GPUShader *shader)
void GPU_shader_unbind()
@ GPU_SHADER_3D_SMOOTH_COLOR
@ GPU_SHADER_3D_LINE_DASHED_UNIFORM_COLOR
@ GPU_SHADER_3D_UNIFORM_COLOR
@ GPU_SHADER_2D_IMAGE_SHUFFLE_COLOR
@ GPU_BLEND_ADDITIVE_PREMULT
Definition GPU_state.hh:90
@ GPU_BLEND_NONE
Definition GPU_state.hh:85
@ GPU_BLEND_ALPHA
Definition GPU_state.hh:87
void GPU_blend(eGPUBlend blend)
Definition gpu_state.cc:42
void GPU_line_width(float width)
Definition gpu_state.cc:161
void GPU_line_smooth(bool enable)
Definition gpu_state.cc:78
void GPU_viewport_size_get_f(float coords[4])
Definition gpu_state.cc:262
@ GPU_R8
@ GPU_FETCH_FLOAT
@ GPU_FETCH_INT_TO_FLOAT
uint GPU_vertformat_attr_add(GPUVertFormat *, const char *name, GPUVertCompType, uint comp_len, GPUVertFetchMode)
@ GPU_COMP_F32
@ GPU_COMP_I32
Read Guarded memory(de)allocation.
Group Output data from inside of a node group A color picker Mix two input colors RGB to Convert a color s luminance to a grayscale value Generate a normal vector and a dot product Brightness Control the brightness and contrast of the input color Vector Map input vector components with curves Camera Retrieve information about the camera and how it relates to the current shading point s position Clamp a value between a minimum and a maximum Vector Perform vector math operation Invert Invert a producing a negative Combine Generate a color from its red
#define WM_GESTURE_RECT
Definition WM_types.hh:568
#define WM_GESTURE_STRAIGHTLINE
Definition WM_types.hh:572
#define WM_GESTURE_LINES
Definition WM_types.hh:567
#define WM_GESTURE_LASSO
Definition WM_types.hh:570
#define WM_GESTURE_CIRCLE
Definition WM_types.hh:571
#define WM_GESTURE_CROSS_RECT
Definition WM_types.hh:569
#define WM_GESTURE_POLYLINE
Definition WM_types.hh:573
unsigned int U
Definition btGjkEpa3.h:78
SIMD_FORCE_INLINE const btScalar & w() const
Return the w value.
Definition btQuadWord.h:119
draw_view in_light_buf[] float
uint col
format
void *(* MEM_mallocN)(size_t len, const char *str)
Definition mallocn.cc:44
void MEM_freeN(void *vmemh)
Definition mallocn.cc:105
void *(* MEM_callocN)(size_t len, const char *str)
Definition mallocn.cc:42
MINLINE float smoothstep(float edge0, float edge1, float x)
static ulong state[N]
constexpr float POLYLINE_CLICK_RADIUS
Definition WM_types.hh:563
void * first
int ymin
int ymax
int xmin
int xmax
int event_type
Definition WM_types.hh:581
uint is_active_prev
Definition WM_types.hh:607
int modal_state
Definition WM_types.hh:594
void * customdata
Definition WM_types.hh:629
int points_alloc
Definition WM_types.hh:593
wmGenericUserData user_data
Definition WM_types.hh:632
uint move
Definition WM_types.hh:611
bool draw_active_side
Definition WM_types.hh:596
uint use_flip
Definition WM_types.hh:617
uint is_active
Definition WM_types.hh:605
short event_keymodifier
Definition WM_types.hh:585
uint8_t event_modifier
Definition WM_types.hh:583
wmGesture * next
Definition WM_types.hh:579
rcti winrct
Definition WM_types.hh:589
uint use_smooth
Definition WM_types.hh:620
blender::int2 mval
Definition WM_types.hh:598
int xy[2]
Definition wm_draw.cc:170
void WM_event_drag_start_xy(const wmEvent *event, int r_xy[2])
@ GESTURE_MODAL_NOP
static void wm_gesture_draw_circle(wmGesture *gt)
static void draw_start_vertex_circle(const wmGesture &gt, const uint shdr_pos)
static void wm_gesture_draw_polyline(wmGesture *gt)
static void draw_filled_lasso_px_cb(int x, int x_end, int y, void *user_data)
static void wm_gesture_draw_cross(const wmWindow *win, const wmGesture *gt)
wmGesture * WM_gesture_new(wmWindow *window, const ARegion *region, const wmEvent *event, int type)
Definition wm_gesture.cc:37
void wm_gesture_draw(wmWindow *win)
static void wm_gesture_draw_rect(wmGesture *gt)
void wm_gesture_tag_redraw(wmWindow *win)
static void wm_gesture_draw_lasso(wmGesture *gt, bool filled)
static void draw_lasso_smooth_stroke_indicator(wmGesture *gt, const uint shdr_pos)
static void wm_gesture_draw_line(wmGesture *gt)
bool WM_gesture_is_modal_first(const wmGesture *gesture)
void WM_gestures_free_all(wmWindow *win)
static void draw_filled_lasso(wmGesture *gt)
void WM_gesture_end(wmWindow *win, wmGesture *gesture)
Definition wm_gesture.cc:98
void WM_gestures_remove(wmWindow *win)
static void wm_gesture_draw_line_active_side(const rcti *rect, const bool flip)
void wmViewport(const rcti *winrct)
void WM_generic_user_data_free(wmGenericUserData *wm_userdata)
Definition wm_utils.cc:45
blender::int2 WM_window_native_pixel_size(const wmWindow *win)
bScreen * WM_window_get_active_screen(const wmWindow *win)