Blender  V2.93
view3d_gizmo_preselect.c
Go to the documentation of this file.
1 /*
2  * This program is free software; you can redistribute it and/or
3  * modify it under the terms of the GNU General Public License
4  * as published by the Free Software Foundation; either version 2
5  * of the License, or (at your option) any later version.
6  *
7  * This program is distributed in the hope that it will be useful,
8  * but WITHOUT ANY WARRANTY; without even the implied warranty of
9  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10  * GNU General Public License for more details.
11  *
12  * You should have received a copy of the GNU General Public License
13  * along with this program; if not, write to the Free Software Foundation,
14  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
15  */
16 
21 #include "MEM_guardedalloc.h"
22 
23 #include "BLI_utildefines.h"
24 
25 #include "BKE_context.h"
26 
27 #include "ED_gizmo_utils.h"
28 #include "ED_screen.h"
29 
30 #include "UI_resources.h"
31 
32 #include "WM_api.h"
33 #include "WM_types.h"
34 
35 #include "view3d_intern.h" /* own include */
36 
37 /* -------------------------------------------------------------------- */
43 };
44 
46 {
47  const wmGizmoType *gzt_presel = WM_gizmotype_find("GIZMO_GT_mesh_preselect_elem_3d", true);
48  struct GizmoGroupPreSelElem *ggd = MEM_callocN(sizeof(struct GizmoGroupPreSelElem), __func__);
49  gzgroup->customdata = ggd;
50 
51  wmGizmo *gz = ggd->gizmo = WM_gizmo_new_ptr(gzt_presel, gzgroup, NULL);
54 }
55 
57 {
58  gzgt->name = "Mesh Preselect Element";
59  gzgt->idname = "VIEW3D_GGT_mesh_preselect_elem";
60 
61  gzgt->flag = WM_GIZMOGROUPTYPE_3D;
62 
65 
68 }
69 
72 /* -------------------------------------------------------------------- */
78 };
79 
81  wmGizmoGroup *gzgroup)
82 {
83  const wmGizmoType *gzt_presel = WM_gizmotype_find("GIZMO_GT_mesh_preselect_edgering_3d", true);
85  __func__);
86  gzgroup->customdata = ggd;
87 
88  wmGizmo *gz = ggd->gizmo = WM_gizmo_new_ptr(gzt_presel, gzgroup, NULL);
91 }
92 
94 {
95  gzgt->name = "Mesh Preselect Edge Ring";
96  gzgt->idname = "VIEW3D_GGT_mesh_preselect_edgering";
97 
98  gzgt->flag = WM_GIZMOGROUPTYPE_3D;
99 
102 
105 }
106 
#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:39
void UI_GetThemeColor3fv(int colorid, float col[3])
Definition: resources.c:1191
@ TH_GIZMO_HI
Definition: UI_resources.h:320
@ TH_GIZMO_PRIMARY
Definition: UI_resources.h:321
@ WM_GIZMOGROUPTYPE_3D
void *(* MEM_callocN)(size_t len, const char *str)
Definition: mallocn.c:45
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:96
const wmGizmoType * WM_gizmotype_find(const char *idname, bool quiet)
Definition: wm_gizmo_type.c:58