Blender  V2.93
bmesh_marking.h
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 
17 #pragma once
18 
23 typedef struct BMEditSelection {
26  char htype;
28 
29 /* geometry hiding code */
30 #define BM_elem_hide_set(bm, ele, hide) _bm_elem_hide_set(bm, &(ele)->head, hide)
31 void _bm_elem_hide_set(BMesh *bm, BMHeader *head, const bool hide);
32 void BM_vert_hide_set(BMVert *v, const bool hide);
33 void BM_edge_hide_set(BMEdge *e, const bool hide);
34 void BM_face_hide_set(BMFace *f, const bool hide);
35 
36 /* Selection code */
37 void BM_elem_select_set(BMesh *bm, BMElem *ele, const bool select);
38 
40  const char htype,
41  const char hflag,
42  const bool respecthide,
43  const bool overwrite,
44  const char hflag_test);
46  const char htype,
47  const char hflag,
48  const bool respecthide,
49  const bool overwrite,
50  const char hflag_test);
51 
53  const char htype,
54  const char hflag,
55  const bool respecthide);
57  const char htype,
58  const char hflag,
59  const bool respecthide);
60 
61 /* individual element select functions, BM_elem_select_set is a shortcut for these
62  * that automatically detects which one to use*/
63 void BM_vert_select_set(BMesh *bm, BMVert *v, const bool select);
64 void BM_edge_select_set(BMesh *bm, BMEdge *e, const bool select);
65 void BM_face_select_set(BMesh *bm, BMFace *f, const bool select);
66 
67 /* lower level functions which don't do flushing */
68 void BM_edge_select_set_noflush(BMesh *bm, BMEdge *e, const bool select);
69 void BM_face_select_set_noflush(BMesh *bm, BMFace *f, const bool select);
70 
71 void BM_mesh_select_mode_clean_ex(BMesh *bm, const short selectmode);
73 
74 void BM_mesh_select_mode_set(BMesh *bm, int selectmode);
75 void BM_mesh_select_mode_flush_ex(BMesh *bm, const short selectmode);
77 
80 
82  const char htype,
83  const char hflag,
84  const bool respecthide);
86  const char htype,
87  const char hflag,
88  const bool respecthide);
89 
90 /* edit selection stuff */
92 BMFace *BM_mesh_active_face_get(BMesh *bm, const bool is_sloppy, const bool is_selected);
96 
97 void BM_editselection_center(BMEditSelection *ese, float r_center[3]);
98 void BM_editselection_normal(BMEditSelection *ese, float r_normal[3]);
99 void BM_editselection_plane(BMEditSelection *ese, float r_plane[3]);
100 
101 #define BM_select_history_check(bm, ele) _bm_select_history_check(bm, &(ele)->head)
102 #define BM_select_history_remove(bm, ele) _bm_select_history_remove(bm, &(ele)->head)
103 #define BM_select_history_store_notest(bm, ele) _bm_select_history_store_notest(bm, &(ele)->head)
104 #define BM_select_history_store(bm, ele) _bm_select_history_store(bm, &(ele)->head)
105 #define BM_select_history_store_head_notest(bm, ele) \
106  _bm_select_history_store_head_notest(bm, &(ele)->head)
107 #define BM_select_history_store_head(bm, ele) _bm_select_history_store_head(bm, &(ele)->head)
108 #define BM_select_history_store_after_notest(bm, ese_ref, ele) \
109  _bm_select_history_store_after_notest(bm, ese_ref, &(ele)->head)
110 #define BM_select_history_store_after(bm, ese, ese_ref) \
111  _bm_select_history_store_after(bm, ese_ref, &(ele)->head)
112 
121 
126 
128  BMesh *bm, GHash *vert_map, GHash *edge_map, GHash *face_map, const bool use_chain);
129 
130 #define BM_SELECT_HISTORY_BACKUP(bm) \
131  { \
132  ListBase _bm_prev_selected = (bm)->selected; \
133  BLI_listbase_clear(&(bm)->selected)
134 
135 #define BM_SELECT_HISTORY_RESTORE(bm) \
136  (bm)->selected = _bm_prev_selected; \
137  } \
138  (void)0
ATTR_WARN_UNUSED_RESULT BMesh * bm
void BM_select_history_clear(BMesh *bm)
BMEdge * BM_mesh_active_edge_get(BMesh *bm)
void _bm_elem_hide_set(BMesh *bm, BMHeader *head, const bool hide)
bool _bm_select_history_check(BMesh *bm, const BMHeader *ele)
void _bm_select_history_store_head_notest(BMesh *bm, BMHeader *ele)
struct BMEditSelection BMEditSelection
void BM_vert_hide_set(BMVert *v, const bool hide)
void BM_mesh_elem_hflag_enable_all(BMesh *bm, const char htype, const char hflag, const bool respecthide)
void BM_mesh_select_mode_flush(BMesh *bm)
int BM_mesh_elem_hflag_count_disabled(BMesh *bm, const char htype, const char hflag, const bool respecthide)
void BM_mesh_select_mode_set(BMesh *bm, int selectmode)
void BM_face_select_set(BMesh *bm, BMFace *f, const bool select)
Select Face.
void BM_elem_select_set(BMesh *bm, BMElem *ele, const bool select)
void BM_mesh_select_flush(BMesh *bm)
bool _bm_select_history_remove(BMesh *bm, BMHeader *ele)
void _bm_select_history_store_head(BMesh *bm, BMHeader *ele)
void BM_mesh_select_mode_clean_ex(BMesh *bm, const short selectmode)
Select Mode Clean.
void _bm_select_history_store_after(BMesh *bm, BMEditSelection *ese_ref, BMHeader *ele)
void _bm_select_history_store_notest(BMesh *bm, BMHeader *ele)
bool BM_select_history_active_get(BMesh *bm, struct BMEditSelection *ese)
void BM_mesh_select_mode_clean(BMesh *bm)
void BM_editselection_center(BMEditSelection *ese, float r_center[3])
void BM_vert_select_set(BMesh *bm, BMVert *v, const bool select)
Select Vert.
void BM_mesh_elem_hflag_disable_test(BMesh *bm, const char htype, const char hflag, const bool respecthide, const bool overwrite, const char hflag_test)
void _bm_select_history_store_after_notest(BMesh *bm, BMEditSelection *ese_ref, BMHeader *ele)
void BM_edge_select_set(BMesh *bm, BMEdge *e, const bool select)
Select Edge.
void BM_select_history_validate(BMesh *bm)
void BM_editselection_plane(BMEditSelection *ese, float r_plane[3])
void BM_edge_select_set_noflush(BMesh *bm, BMEdge *e, const bool select)
void BM_editselection_normal(BMEditSelection *ese, float r_normal[3])
void BM_mesh_deselect_flush(BMesh *bm)
void BM_edge_hide_set(BMEdge *e, const bool hide)
void BM_mesh_elem_hflag_disable_all(BMesh *bm, const char htype, const char hflag, const bool respecthide)
BMVert * BM_mesh_active_vert_get(BMesh *bm)
void BM_mesh_active_face_set(BMesh *bm, BMFace *f)
void _bm_select_history_store(BMesh *bm, BMHeader *ele)
BMFace * BM_mesh_active_face_get(BMesh *bm, const bool is_sloppy, const bool is_selected)
void BM_select_history_merge_from_targetmap(BMesh *bm, GHash *vert_map, GHash *edge_map, GHash *face_map, const bool use_chain)
void BM_face_select_set_noflush(BMesh *bm, BMFace *f, const bool select)
void BM_face_hide_set(BMFace *f, const bool hide)
void BM_mesh_select_mode_flush_ex(BMesh *bm, const short selectmode)
Select Mode Flush.
struct GHash * BM_select_history_map_create(BMesh *bm)
int BM_mesh_elem_hflag_count_enabled(BMesh *bm, const char htype, const char hflag, const bool respecthide)
void BM_mesh_elem_hflag_enable_test(BMesh *bm, const char htype, const char hflag, const bool respecthide, const bool overwrite, const char hflag_test)
BMElem * BM_mesh_active_elem_get(BMesh *bm)
ATTR_WARN_UNUSED_RESULT const BMVert const BMEdge * e
ATTR_WARN_UNUSED_RESULT const BMVert * v
struct BMEditSelection * next
Definition: bmesh_marking.h:24
struct BMEditSelection * prev
Definition: bmesh_marking.h:24
__forceinline const avxb select(const avxb &m, const avxb &t, const avxb &f)
Definition: util_avxb.h:167