Blender  V3.3
button2d_gizmo.c
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-or-later */
2 
15 #include "MEM_guardedalloc.h"
16 
17 #include "BLI_math.h"
18 
19 #include "BKE_context.h"
20 
21 #include "GPU_batch.h"
22 #include "GPU_batch_utils.h"
23 #include "GPU_immediate.h"
24 #include "GPU_immediate_util.h"
25 #include "GPU_matrix.h"
26 #include "GPU_select.h"
27 #include "GPU_state.h"
28 
29 #include "RNA_access.h"
30 #include "RNA_define.h"
31 #include "RNA_enum_types.h"
32 
33 #include "WM_api.h"
34 #include "WM_types.h"
35 
36 #include "ED_gizmo_library.h"
37 #include "ED_screen.h"
38 #include "ED_view3d.h"
39 
40 #include "UI_interface.h"
41 #include "UI_interface_icons.h"
42 #include "UI_resources.h"
43 
44 /* own includes */
45 #include "../gizmo_geometry.h"
46 #include "../gizmo_library_intern.h"
47 
48 /* -------------------------------------------------------------------- */
52 typedef struct ButtonGizmo2D {
54  bool is_init;
55  /* Use an icon or shape */
56  int icon;
59 
62 /* -------------------------------------------------------------------- */
66 static void button2d_geom_draw_backdrop(const wmGizmo *gz,
67  const float color[4],
68  const float fill_alpha,
69  const bool select,
70  const float screen_scale)
71 {
72  float viewport[4];
73  GPU_viewport_size_get_f(viewport);
74 
75  const float max_pixel_error = 0.25f;
76  int nsegments = (int)(ceilf(M_PI / acosf(1.0f - max_pixel_error / screen_scale)));
77  nsegments = max_ff(nsegments, 8);
78  nsegments = min_ff(nsegments, 1000);
79 
81  /* NOTE(Metal): Prefer 3D coordinate for 2D rendering when using 3D shader. */
83 
84  /* TODO: other draw styles. */
85  if (color[3] == 1.0 && fill_alpha == 1.0 && select == false) {
88  imm_draw_circle_fill_3d(pos, 0.0f, 0.0f, 1.0f, nsegments);
90 
92  immUniform2fv("viewportSize", &viewport[2]);
93  immUniform1f("lineWidth", gz->line_width * U.pixelsize);
95  imm_draw_circle_wire_3d(pos, 0.0f, 0.0f, 1.0f, nsegments);
97  }
98  else {
99  /* Draw fill. */
100  if ((fill_alpha != 0.0f) || (select == true)) {
101  const float fill_color[4] = {UNPACK3(color), fill_alpha * color[3]};
103  immUniformColor4fv(fill_color);
104  imm_draw_circle_fill_3d(pos, 0.0f, 0.0f, 1.0f, nsegments);
106  }
107 
108  /* Draw outline. */
109  if ((fill_alpha != 1.0f) && (select == false)) {
111  immUniform2fv("viewportSize", &viewport[2]);
112  immUniform1f("lineWidth", gz->line_width * U.pixelsize);
114  imm_draw_circle_wire_3d(pos, 0.0f, 0.0f, 1.0f, nsegments);
116  }
117  }
118 
120 }
121 
122 static void button2d_draw_intern(const bContext *C,
123  wmGizmo *gz,
124  const bool select,
125  const bool highlight)
126 {
127  ButtonGizmo2D *button = (ButtonGizmo2D *)gz;
128  float viewport[4];
129  GPU_viewport_size_get_f(viewport);
130 
131  const int draw_options = RNA_enum_get(gz->ptr, "draw_options");
132  if (button->is_init == false) {
133  button->is_init = true;
134  PropertyRNA *prop = RNA_struct_find_property(gz->ptr, "icon");
135  button->icon = -1;
136  if (RNA_property_is_set(gz->ptr, prop)) {
137  button->icon = RNA_property_enum_get(gz->ptr, prop);
138  }
139  else {
140  prop = RNA_struct_find_property(gz->ptr, "shape");
141  const uint polys_len = RNA_property_string_length(gz->ptr, prop);
142  /* We shouldn't need the +1, but a NULL char is set. */
143  char *polys = MEM_mallocN(polys_len + 1, __func__);
144  RNA_property_string_get(gz->ptr, prop, polys);
146  (uchar *)polys, polys_len, NULL);
148  (uchar *)polys, polys_len, NULL);
149  MEM_freeN(polys);
150  }
151  }
152 
153  float color[4];
154  float matrix_final[4][4];
155 
156  gizmo_color_get(gz, highlight, color);
157  WM_gizmo_calc_matrix_final(gz, matrix_final);
158 
159  bool is_3d = (gz->parent_gzgroup->type->flag & WM_GIZMOGROUPTYPE_3D) != 0;
160 
161  if ((select == false) && (draw_options & ED_GIZMO_BUTTON_SHOW_HELPLINE)) {
162  float matrix_final_no_offset[4][4];
163  WM_gizmo_calc_matrix_final_no_offset(gz, matrix_final_no_offset);
166  immUniform2fv("viewportSize", &viewport[2]);
167  immUniform1f("lineWidth", gz->line_width * U.pixelsize);
170  immVertex3fv(pos, matrix_final[3]);
171  immVertex3fv(pos, matrix_final_no_offset[3]);
172  immEnd();
174  }
175 
176  bool need_to_pop = true;
177  GPU_matrix_push();
178  GPU_matrix_mul(matrix_final);
179 
180  float screen_scale = 200.0f;
181  if (is_3d) {
183  float matrix_align[4][4];
184  float matrix_final_unit[4][4];
185  normalize_m4_m4(matrix_final_unit, matrix_final);
186  mul_m4_m4m4(matrix_align, rv3d->viewmat, matrix_final_unit);
187  zero_v3(matrix_align[3]);
188  transpose_m4(matrix_align);
189  GPU_matrix_mul(matrix_align);
190  }
191  else {
192  screen_scale = mat4_to_scale(matrix_final);
193  }
194 
195  if (select) {
196  BLI_assert(is_3d);
197  button2d_geom_draw_backdrop(gz, color, 1.0, select, screen_scale);
198  }
199  else {
200 
202 
203  if (draw_options & ED_GIZMO_BUTTON_SHOW_BACKDROP) {
204  const float fill_alpha = RNA_float_get(gz->ptr, "backdrop_fill_alpha");
205  button2d_geom_draw_backdrop(gz, color, fill_alpha, select, screen_scale);
206  }
207 
208  if (button->shape_batch[0] != NULL) {
209  GPU_line_smooth(true);
210  GPU_polygon_smooth(false);
211  for (uint i = 0; i < ARRAY_SIZE(button->shape_batch) && button->shape_batch[i]; i++) {
212  const bool do_wires = (i == 1);
213  if (do_wires) {
216  GPU_batch_uniform_2fv(button->shape_batch[i], "viewportSize", &viewport[2]);
217  GPU_batch_uniform_1f(button->shape_batch[i], "lineWidth", gz->line_width * U.pixelsize);
218  }
219  else {
221  }
222 
223  /* Invert line color for wire. */
224  if (draw_options & ED_GIZMO_BUTTON_SHOW_BACKDROP) {
225  /* If we have a backdrop already,
226  * draw a contrasting shape over it instead of drawing it the same color.
227  * Use a low value instead of 50% so some darker primary colors
228  * aren't considered being close to black. */
229  float color_contrast[4];
230  copy_v3_fl(color_contrast, rgb_to_grayscale(color) < 0.2f ? 1 : 0);
231  color_contrast[3] = color[3];
232  GPU_shader_uniform_4f(button->shape_batch[i]->shader, "color", UNPACK4(color_contrast));
233  }
234  else {
235  GPU_shader_uniform_4f(button->shape_batch[i]->shader, "color", UNPACK4(color));
236  }
237 
238  GPU_batch_draw(button->shape_batch[i]);
239 
240  if (draw_options & ED_GIZMO_BUTTON_SHOW_OUTLINE) {
241  color[0] = 1.0f - color[0];
242  color[1] = 1.0f - color[1];
243  color[2] = 1.0f - color[2];
244  }
245  }
246  GPU_line_smooth(false);
247  GPU_polygon_smooth(true);
248  }
249  else if (button->icon != -1) {
250  float pos[2];
251  if (is_3d) {
252  const float fac = 2.0f;
253  GPU_matrix_translate_2f(-(fac / 2), -(fac / 2));
255  fac / (ICON_DEFAULT_HEIGHT * UI_DPI_FAC));
256  pos[0] = 1.0f;
257  pos[1] = 1.0f;
258  }
259  else {
260  pos[0] = gz->matrix_basis[3][0] - (ICON_DEFAULT_WIDTH / 2.0) * UI_DPI_FAC;
261  pos[1] = gz->matrix_basis[3][1] - (ICON_DEFAULT_HEIGHT / 2.0) * UI_DPI_FAC;
262  GPU_matrix_pop();
263  need_to_pop = false;
264  }
265 
266  float alpha = (highlight) ? 1.0f : 0.8f;
267  GPU_polygon_smooth(false);
268  UI_icon_draw_alpha(pos[0], pos[1], button->icon, alpha);
269  GPU_polygon_smooth(true);
270  }
272  }
273 
274  if (need_to_pop) {
275  GPU_matrix_pop();
276  }
277 }
278 
279 static void gizmo_button2d_draw_select(const bContext *C, wmGizmo *gz, int select_id)
280 {
281  GPU_select_load_id(select_id);
282  button2d_draw_intern(C, gz, true, false);
283 }
284 
285 static void gizmo_button2d_draw(const bContext *C, wmGizmo *gz)
286 {
287  const bool is_highlight = (gz->state & WM_GIZMO_STATE_HIGHLIGHT) != 0;
288 
290  button2d_draw_intern(C, gz, false, is_highlight);
292 }
293 
294 static int gizmo_button2d_test_select(bContext *C, wmGizmo *gz, const int mval[2])
295 {
296  float point_local[2];
297 
298  if (0) {
299  /* correct, but unnecessarily slow. */
300  if (gizmo_window_project_2d(C, gz, (const float[2]){UNPACK2(mval)}, 2, true, point_local) ==
301  false) {
302  return -1;
303  }
304  }
305  else {
306  copy_v2_v2(point_local, (float[2]){UNPACK2(mval)});
307  sub_v2_v2(point_local, gz->matrix_basis[3]);
308  mul_v2_fl(point_local, 1.0f / gz->scale_final);
309  }
310  /* The 'gz->scale_final' is already applied when projecting. */
311  if (len_squared_v2(point_local) < 1.0f) {
312  return 0;
313  }
314 
315  return -1;
316 }
317 
319 {
320  if (RNA_boolean_get(gz->ptr, "show_drag")) {
321  return WM_CURSOR_NSEW_SCROLL;
322  }
323  return WM_CURSOR_DEFAULT;
324 }
325 
326 #define CIRCLE_RESOLUTION_3D 32
327 static bool gizmo_button2d_bounds(bContext *C, wmGizmo *gz, rcti *r_bounding_box)
328 {
330  float rad = CIRCLE_RESOLUTION_3D * U.dpi_fac / 2.0f;
331  const float *co = NULL;
332  float matrix_final[4][4];
333  float co_proj[3];
334  WM_gizmo_calc_matrix_final(gz, matrix_final);
335 
337  ARegion *region = CTX_wm_region(C);
338  if (ED_view3d_project_float_global(region, matrix_final[3], co_proj, V3D_PROJ_TEST_NOP) ==
339  V3D_PROJ_RET_OK) {
340  float matrix_final_no_offset[4][4];
341  const RegionView3D *rv3d = region->regiondata;
342  WM_gizmo_calc_matrix_final_no_offset(gz, matrix_final_no_offset);
343  const float factor = ED_view3d_pixel_size_no_ui_scale(rv3d, matrix_final_no_offset[3]) /
344  ED_view3d_pixel_size_no_ui_scale(rv3d, matrix_final[3]);
345  /* It's possible (although unlikely) `matrix_final_no_offset` is behind the view.
346  * `matrix_final` has already been projected so both can't be negative. */
347  if (factor > 0.0f) {
348  rad *= factor;
349  }
350  co = co_proj;
351  }
352  }
353  else {
354  rad = mat4_to_scale(matrix_final);
355  co = matrix_final[3];
356  }
357 
358  if (co != NULL) {
359  r_bounding_box->xmin = co[0] + area->totrct.xmin - rad;
360  r_bounding_box->ymin = co[1] + area->totrct.ymin - rad;
361  r_bounding_box->xmax = r_bounding_box->xmin + rad;
362  r_bounding_box->ymax = r_bounding_box->ymin + rad;
363  return true;
364  }
365  return false;
366 }
367 
368 static void gizmo_button2d_free(wmGizmo *gz)
369 {
370  ButtonGizmo2D *shape = (ButtonGizmo2D *)gz;
371 
372  for (uint i = 0; i < ARRAY_SIZE(shape->shape_batch); i++) {
374  }
375 }
376 
379 /* -------------------------------------------------------------------- */
384 {
385  /* identifiers */
386  gzt->idname = "GIZMO_GT_button_2d";
387 
388  /* api callbacks */
389  gzt->draw = gizmo_button2d_draw;
394  gzt->free = gizmo_button2d_free;
395 
396  gzt->struct_size = sizeof(ButtonGizmo2D);
397 
398  /* rna */
399  static EnumPropertyItem rna_enum_draw_options[] = {
400  {ED_GIZMO_BUTTON_SHOW_OUTLINE, "OUTLINE", 0, "Outline", ""},
401  {ED_GIZMO_BUTTON_SHOW_BACKDROP, "BACKDROP", 0, "Backdrop", ""},
402  {ED_GIZMO_BUTTON_SHOW_HELPLINE, "HELPLINE", 0, "Help Line", ""},
403  {0, NULL, 0, NULL, NULL},
404  };
405  PropertyRNA *prop;
406 
407  RNA_def_enum_flag(gzt->srna, "draw_options", rna_enum_draw_options, 0, "Draw Options", "");
408 
409  prop = RNA_def_property(gzt->srna, "icon", PROP_ENUM, PROP_NONE);
411 
412  /* Passed to 'GPU_batch_tris_from_poly_2d_encoded' */
414 
415  /* Currently only used for cursor display. */
416  RNA_def_boolean(gzt->srna, "show_drag", true, "Show Drag", "");
417 
418  RNA_def_float(gzt->srna,
419  "backdrop_fill_alpha",
420  1.0f,
421  0.0f,
422  1.0,
423  "When below 1.0, draw the interior with a reduced alpha compared to the outline",
424  "",
425  0.0f,
426  1.0f);
427 }
428 
430 {
432 }
433  /* Button Gizmo API */
struct ScrArea * CTX_wm_area(const bContext *C)
Definition: context.c:738
struct ARegion * CTX_wm_region(const bContext *C)
Definition: context.c:749
struct RegionView3D * CTX_wm_region_view3d(const bContext *C)
Definition: context.c:793
#define BLI_assert(a)
Definition: BLI_assert.h:46
MINLINE float max_ff(float a, float b)
MINLINE float min_ff(float a, float b)
#define M_PI
Definition: BLI_math_base.h:20
MINLINE float rgb_to_grayscale(const float rgb[3])
void mul_m4_m4m4(float R[4][4], const float A[4][4], const float B[4][4])
Definition: math_matrix.c:259
void normalize_m4_m4(float R[4][4], const float M[4][4]) ATTR_NONNULL()
Definition: math_matrix.c:1965
float mat4_to_scale(const float M[4][4])
Definition: math_matrix.c:2185
void transpose_m4(float R[4][4])
Definition: math_matrix.c:1377
MINLINE float len_squared_v2(const float v[2]) ATTR_WARN_UNUSED_RESULT
MINLINE void sub_v2_v2(float r[2], const float a[2])
MINLINE void mul_v2_fl(float r[2], float f)
MINLINE void copy_v2_v2(float r[2], const float a[2])
MINLINE void copy_v3_fl(float r[3], float f)
MINLINE void zero_v3(float r[3])
unsigned char uchar
Definition: BLI_sys_types.h:70
unsigned int uint
Definition: BLI_sys_types.h:67
#define UNPACK2(a)
#define UNPACK4(a)
#define ARRAY_SIZE(arr)
#define UNUSED_VARS(...)
#define UNPACK3(a)
@ ED_GIZMO_BUTTON_SHOW_BACKDROP
@ ED_GIZMO_BUTTON_SHOW_OUTLINE
@ ED_GIZMO_BUTTON_SHOW_HELPLINE
@ V3D_PROJ_TEST_NOP
Definition: ED_view3d.h:234
eV3DProjStatus ED_view3d_project_float_global(const struct ARegion *region, const float co[3], float r_co[2], eV3DProjTest flag)
@ V3D_PROJ_RET_OK
Definition: ED_view3d.h:217
float ED_view3d_pixel_size_no_ui_scale(const struct RegionView3D *rv3d, const float co[3])
GPUBatch
Definition: GPU_batch.h:78
#define GPU_batch_uniform_1f(batch, name, x)
Definition: GPU_batch.h:144
void GPU_batch_program_set_builtin(GPUBatch *batch, eGPUBuiltinShader shader_id)
Definition: gpu_batch.cc:287
#define GPU_batch_uniform_2fv(batch, name, val)
Definition: GPU_batch.h:150
#define GPU_BATCH_DISCARD_SAFE(batch)
Definition: GPU_batch.h:216
void GPU_batch_draw(GPUBatch *batch)
Definition: gpu_batch.cc:223
struct GPUBatch * GPU_batch_tris_from_poly_2d_encoded(const uchar *polys_flat, uint polys_flat_len, const struct rctf *rect) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
struct GPUBatch * GPU_batch_wire_from_poly_2d_encoded(const uchar *polys_flat, uint polys_flat_len, const struct rctf *rect) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
void immUniform2fv(const char *name, const float data[2])
void immUnbindProgram(void)
void immBindBuiltinProgram(eGPUBuiltinShader shader_id)
void immUniform1f(const char *name, float x)
void immUniformColor4fv(const float rgba[4])
GPUVertFormat * immVertexFormat(void)
void immVertex3fv(uint attr_id, const float data[3])
void immBegin(GPUPrimType, uint vertex_len)
void immEnd(void)
void imm_draw_circle_wire_3d(uint pos, float x, float y, float radius, int nsegments)
void imm_draw_circle_fill_3d(uint pos, float x, float y, float radius, int nsegments)
void GPU_matrix_pop(void)
Definition: gpu_matrix.cc:126
void GPU_matrix_scale_2f(float x, float y)
Definition: gpu_matrix.cc:216
#define GPU_matrix_mul(x)
Definition: GPU_matrix.h:224
void GPU_matrix_push(void)
Definition: gpu_matrix.cc:119
void GPU_matrix_translate_2f(float x, float y)
Definition: gpu_matrix.cc:174
@ GPU_PRIM_LINE_STRIP
Definition: GPU_primitive.h:22
bool GPU_select_load_id(unsigned int id)
Definition: gpu_select.c:117
void GPU_shader_uniform_4f(GPUShader *sh, const char *name, float x, float y, float z, float w)
Definition: gpu_shader.cc:675
@ GPU_SHADER_3D_POLYLINE_UNIFORM_COLOR
Definition: GPU_shader.h:253
@ GPU_SHADER_2D_UNIFORM_COLOR
Definition: GPU_shader.h:201
@ GPU_SHADER_3D_UNIFORM_COLOR
Definition: GPU_shader.h:230
@ GPU_BLEND_NONE
Definition: GPU_state.h:60
@ GPU_BLEND_ALPHA
Definition: GPU_state.h:62
void GPU_blend(eGPUBlend blend)
Definition: gpu_state.cc:39
void GPU_line_smooth(bool enable)
Definition: gpu_state.cc:75
void GPU_viewport_size_get_f(float coords[4])
Definition: gpu_state.cc:259
void GPU_polygon_smooth(bool enable)
Definition: gpu_state.cc:80
@ GPU_FETCH_FLOAT
uint GPU_vertformat_attr_add(GPUVertFormat *, const char *name, GPUVertCompType, uint comp_len, GPUVertFetchMode)
@ GPU_COMP_F32
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 Bright Control the brightness and contrast of the input color Vector Map an input vectors to used to fine tune the interpolation of the input 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 a color
@ PROP_ENUM
Definition: RNA_types.h:63
@ PROP_STRING
Definition: RNA_types.h:62
@ PROP_BYTESTRING
Definition: RNA_types.h:133
@ PROP_NONE
Definition: RNA_types.h:126
#define C
Definition: RandGen.cpp:25
#define UI_DPI_FAC
Definition: UI_interface.h:305
#define ICON_DEFAULT_HEIGHT
void UI_icon_draw_alpha(float x, float y, int icon_id, float alpha)
#define ICON_DEFAULT_WIDTH
@ WM_GIZMOGROUPTYPE_3D
@ WM_GIZMO_STATE_HIGHLIGHT
__forceinline const avxb select(const avxb &m, const avxb &t, const avxb &f)
Definition: avxb.h:154
unsigned int U
Definition: btGjkEpa3.h:78
static void GIZMO_GT_button_2d(wmGizmoType *gzt)
static void button2d_draw_intern(const bContext *C, wmGizmo *gz, const bool select, const bool highlight)
static bool gizmo_button2d_bounds(bContext *C, wmGizmo *gz, rcti *r_bounding_box)
static void gizmo_button2d_free(wmGizmo *gz)
struct ButtonGizmo2D ButtonGizmo2D
static void button2d_geom_draw_backdrop(const wmGizmo *gz, const float color[4], const float fill_alpha, const bool select, const float screen_scale)
static int gizmo_button2d_test_select(bContext *C, wmGizmo *gz, const int mval[2])
static int gizmo_button2d_cursor_get(wmGizmo *gz)
void ED_gizmotypes_button_2d(void)
#define CIRCLE_RESOLUTION_3D
static void gizmo_button2d_draw_select(const bContext *C, wmGizmo *gz, int select_id)
static void gizmo_button2d_draw(const bContext *C, wmGizmo *gz)
bool gizmo_window_project_2d(bContext *C, const struct wmGizmo *gz, const float mval[2], int axis, bool use_offset, float r_co[2])
void gizmo_color_get(const struct wmGizmo *gz, bool highlight, float r_color[4])
uint pos
format
Definition: logImageCore.h:38
void(* MEM_freeN)(void *vmemh)
Definition: mallocn.c:27
void *(* MEM_mallocN)(size_t len, const char *str)
Definition: mallocn.c:33
#define ceilf(x)
Definition: metal/compat.h:225
#define acosf(x)
Definition: metal/compat.h:222
static void area(int d1, int d2, int e1, int e2, float weights[2])
bool RNA_property_is_set(PointerRNA *ptr, PropertyRNA *prop)
Definition: rna_access.c:5271
PropertyRNA * RNA_struct_find_property(PointerRNA *ptr, const char *identifier)
Definition: rna_access.c:717
void RNA_property_string_get(PointerRNA *ptr, PropertyRNA *prop, char *value)
Definition: rna_access.c:3149
float RNA_float_get(PointerRNA *ptr, const char *name)
Definition: rna_access.c:4957
int RNA_property_enum_get(PointerRNA *ptr, PropertyRNA *prop)
Definition: rna_access.c:3402
bool RNA_boolean_get(PointerRNA *ptr, const char *name)
Definition: rna_access.c:4863
int RNA_enum_get(PointerRNA *ptr, const char *name)
Definition: rna_access.c:5004
int RNA_property_string_length(PointerRNA *ptr, PropertyRNA *prop)
Definition: rna_access.c:3213
PropertyRNA * RNA_def_float(StructOrFunctionRNA *cont_, const char *identifier, float default_value, float hardmin, float hardmax, const char *ui_name, const char *ui_description, float softmin, float softmax)
Definition: rna_define.c:3836
PropertyRNA * RNA_def_boolean(StructOrFunctionRNA *cont_, const char *identifier, bool default_value, const char *ui_name, const char *ui_description)
Definition: rna_define.c:3493
PropertyRNA * RNA_def_enum_flag(StructOrFunctionRNA *cont_, const char *identifier, const EnumPropertyItem *items, int default_value, const char *ui_name, const char *ui_description)
Definition: rna_define.c:3806
void RNA_def_property_enum_items(PropertyRNA *prop, const EnumPropertyItem *item)
Definition: rna_define.c:1872
PropertyRNA * RNA_def_property(StructOrFunctionRNA *cont_, const char *identifier, int type, int subtype)
Definition: rna_define.c:1257
const EnumPropertyItem rna_enum_icon_items[]
Definition: rna_ui_api.c:30
void * regiondata
GPUBatch * shape_batch[2]
float viewmat[4][4]
int ymin
Definition: DNA_vec_types.h:64
int ymax
Definition: DNA_vec_types.h:64
int xmin
Definition: DNA_vec_types.h:63
int xmax
Definition: DNA_vec_types.h:63
eWM_GizmoFlagGroupTypeFlag flag
struct wmGizmoGroupType * type
wmGizmoFnDraw draw
wmGizmoFnScreenBoundsGet screen_bounds_get
const char * idname
wmGizmoFnTestSelect test_select
wmGizmoFnCursorGet cursor_get
struct StructRNA * srna
wmGizmoFnFree free
wmGizmoFnDrawSelect draw_select
eWM_GizmoFlagState state
struct wmGizmoGroup * parent_gzgroup
float matrix_basis[4][4]
float scale_final
struct PointerRNA * ptr
float line_width
@ WM_CURSOR_NSEW_SCROLL
Definition: wm_cursors.h:51
@ WM_CURSOR_DEFAULT
Definition: wm_cursors.h:18
void WM_gizmo_calc_matrix_final(const wmGizmo *gz, float r_mat[4][4])
Definition: wm_gizmo.c:554
void WM_gizmo_calc_matrix_final_no_offset(const wmGizmo *gz, float r_mat[4][4])
Definition: wm_gizmo.c:539
void WM_gizmotype_append(void(*gtfunc)(struct wmGizmoType *))
Definition: wm_gizmo_type.c:93