Blender  V3.3
view3d_gizmo_preselect.c
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-or-later */
2 
7 #include "MEM_guardedalloc.h"
8 
9 #include "BLI_utildefines.h"
10 
11 #include "BKE_context.h"
12 
13 #include "ED_gizmo_utils.h"
14 #include "ED_screen.h"
15 
16 #include "UI_resources.h"
17 
18 #include "WM_api.h"
19 #include "WM_types.h"
20 
21 #include "view3d_intern.h" /* own include */
22 
23 /* -------------------------------------------------------------------- */
29 };
30 
32 {
33  const wmGizmoType *gzt_presel = WM_gizmotype_find("GIZMO_GT_mesh_preselect_elem_3d", true);
34  struct GizmoGroupPreSelElem *ggd = MEM_callocN(sizeof(struct GizmoGroupPreSelElem), __func__);
35  gzgroup->customdata = ggd;
36 
37  wmGizmo *gz = ggd->gizmo = WM_gizmo_new_ptr(gzt_presel, gzgroup, NULL);
40 }
41 
43 {
44  gzgt->name = "Mesh Preselect Element";
45  gzgt->idname = "VIEW3D_GGT_mesh_preselect_elem";
46 
48 
51 
54 }
55 
58 /* -------------------------------------------------------------------- */
64 };
65 
67  wmGizmoGroup *gzgroup)
68 {
69  const wmGizmoType *gzt_presel = WM_gizmotype_find("GIZMO_GT_mesh_preselect_edgering_3d", true);
71  __func__);
72  gzgroup->customdata = ggd;
73 
74  wmGizmo *gz = ggd->gizmo = WM_gizmo_new_ptr(gzt_presel, gzgroup, NULL);
77 }
78 
80 {
81  gzgt->name = "Mesh Preselect Edge Ring";
82  gzgt->idname = "VIEW3D_GGT_mesh_preselect_edgering";
83 
85 
88 
91 }
92 
#define UNUSED(x)
@ RGN_TYPE_WINDOW
@ SPACE_VIEW3D
bool ED_gizmo_poll_or_unlink_delayed_from_tool(const struct bContext *C, struct wmGizmoGroupType *gzgt)
Read Guarded memory(de)allocation.
#define C
Definition: RandGen.cpp:25
void UI_GetThemeColor3fv(int colorid, float col[3])
Definition: resources.c:1165
@ TH_GIZMO_HI
Definition: UI_resources.h:304
@ TH_GIZMO_PRIMARY
Definition: UI_resources.h:305
@ WM_GIZMOGROUPTYPE_TOOL_FALLBACK_KEYMAP
@ WM_GIZMOGROUPTYPE_3D
void *(* MEM_callocN)(size_t len, const char *str)
Definition: mallocn.c:31
wmGizmoGroupFnInit setup
const char * idname
eWM_GizmoFlagGroupTypeFlag flag
wmGizmoGroupFnPoll poll
struct wmGizmoMapType_Params gzmap_params
const char * name
float color_hi[4]
float color[4]
static void WIDGETGROUP_mesh_preselect_edgering_setup(const bContext *UNUSED(C), wmGizmoGroup *gzgroup)
void VIEW3D_GGT_mesh_preselect_edgering(wmGizmoGroupType *gzgt)
void VIEW3D_GGT_mesh_preselect_elem(wmGizmoGroupType *gzgt)
static void WIDGETGROUP_mesh_preselect_elem_setup(const bContext *UNUSED(C), wmGizmoGroup *gzgroup)
wmGizmo * WM_gizmo_new_ptr(const wmGizmoType *gzt, wmGizmoGroup *gzgroup, PointerRNA *properties)
Definition: wm_gizmo.c:81
const wmGizmoType * WM_gizmotype_find(const char *idname, bool quiet)
Definition: wm_gizmo_type.c:45