48 count->selection_len += 1;
59 count->selection_len += 1;
70 count->selection_len += 1;
75 void *__restrict chunk_join,
76 void *__restrict chunk)
102 const int MIN_ITER_SIZE = 1024;
114 BM_iter_parallel(
bm, iter_type, range_func,
nullptr, &settings);
115 return count.selection_len;
157 const BMEdge *e_iter = e_first;
169static bool bm_vert_is_edge_select_any(
const BMVert *
v)
172 const BMEdge *e_iter, *e_first;
173 e_iter = e_first =
v->e;
187 const BMEdge *e_iter, *e_first;
188 e_iter = e_first =
v->e;
200 const BMLoop *l_iter = l_first;
203 while ((l_iter = l_iter->
radial_next) != l_first) {
212static bool bm_edge_is_face_select_any(
const BMEdge *
e)
215 const BMLoop *l_iter, *l_first;
216 l_iter = l_first =
e->l;
221 }
while ((l_iter = l_iter->
radial_next) != l_first);
230 const BMLoop *l_iter, *l_first;
231 l_iter = l_first =
e->l;
236 }
while ((l_iter = l_iter->
radial_next) != l_first);
246 return !
ELEM(
bm->totvertsel, 0,
bm->totvert);
249 return !
ELEM(
bm->totedgesel, 0,
bm->totedge);
251 return !
ELEM(
bm->totfacesel, 0,
bm->totface);
262 if (
bm->totvertsel) {
270 if (
bm->totedgesel) {
283 if (
bm->totvertsel) {
291 if (
bm->totedgesel) {
299 if (
bm->totfacesel) {
307 }
while ((l_iter = l_iter->
next) != l_first);
332 tls->userdata_chunk);
353 tls->userdata_chunk);
366 }
while ((l_iter = l_iter->
next) != l_first);
373 if (is_selected && !ok) {
376 else if (ok && !is_selected) {
382 void *__restrict chunk_join,
383 void *__restrict chunk)
431 bool any_select =
false;
466 bool any_select =
false;
480 }
while ((l_iter = l_iter->
next) != l_first);
494 }
while ((l_iter = l_iter->
next) != l_first);
577 }
while ((l_iter = l_iter->
next) != l_first);
606 l_iter = l_first =
e->l;
609 }
while ((l_iter = l_iter->
radial_next) != l_first);
668 for (
i = 0;
i < 2;
i++) {
703 }
while ((l_iter = l_iter->
next) != l_first);
724 }
while ((l_iter = l_iter->
next) != l_first);
735 }
while ((l_iter = l_iter->
next) != l_first);
743 }
while ((l_iter = l_iter->
next) != l_first);
752 }
while ((l_iter = l_iter->
next) != l_first);
812 bm->selectmode = selectmode;
863 const bool respecthide,
864 const bool test_for_enabled)
909 const bool respecthide)
917 const bool respecthide)
975 for (; ese; ese = ese->
prev) {
1005 if (
bm->selected.last) {
1018 if (
bm->selected.last) {
1031 if (
bm->selected.last) {
1090 float vec[3] = {0.0f, 0.0f, 0.0f};
1101 if (eve->
no[0] < 0.5f) {
1104 else if (eve->
no[1] < 0.5f) {
1126 if (eed->
v2->
co[1] > eed->
v1->
co[1]) {
1217 for (ese =
static_cast<BMEditSelection *
>(
bm->selected.first); ese; ese = ese_next) {
1218 ese_next = ese->
next;
1227 char htype_selected = 0;
1229 htype_selected |= ese->
htype;
1235 return htype_selected;
1252 ese->
ele = ese_last->
ele;
1257 ese->
ele = ese_last->
ele;
1303 GHash *map =
nullptr;
1304 switch (ese->ele->head.htype) {
1318 if (map !=
nullptr) {
1319 BMElem *ele_dst = ese->ele;
1323 if (ele_dst_next ==
nullptr) {
1326 ele_dst = ele_dst_next;
1328 if (
UNLIKELY(ele_dst == ese->ele)) {
1332 if (use_chain ==
false) {
1344 ese_next = ese->next;
1357 const bool respecthide,
1358 const bool overwrite,
1359 const char hflag_test)
1376 (respecthide ==
false) && (hflag_test == 0))
1380 for (
i = 0;
i < 3;
i++) {
1385 for (; ele; ele =
static_cast<BMElem *
>(BM_iter_step(&iter))) {
1390 bm->totvertsel =
bm->totedgesel =
bm->totfacesel = 0;
1393 for (
i = 0;
i < 3;
i++) {
1397 if (htype & flag_types[
i]) {
1399 for (; ele; ele =
static_cast<BMElem *
>(BM_iter_step(&iter))) {
1410 else if (overwrite) {
1426 const bool respecthide,
1427 const bool overwrite,
1428 const char hflag_test)
1450 for (
i = 0;
i < 3;
i++) {
1451 if (htype & flag_types[
i]) {
1453 for (; ele; ele =
static_cast<BMElem *
>(BM_iter_step(&iter))) {
1465 else if (overwrite) {
1480 const bool respecthide)
1489 const bool respecthide)
1526 BMEdge *e_iter, *e_first;
1527 e_iter = e_first =
v->e;
1531 const BMLoop *l_radial_iter, *l_radial_first;
1532 l_radial_iter = l_radial_first = e_iter->
l;
1535 }
while ((l_radial_iter = l_radial_iter->
radial_next) != l_radial_first);
1550 const BMLoop *l_iter, *l_first;
1551 l_iter = l_first =
e->l;
1554 }
while ((l_iter = l_iter->
radial_next) != l_first);
1586 }
while ((l_iter = l_iter->
next) != l_first);
1591 }
while ((l_iter = l_iter->
next) != l_first);
1601 }
while ((l_iter = l_iter->
next) != l_first);
1609 switch (head->
htype) {
GHash * BLI_ghash_ptr_new(const char *info) ATTR_MALLOC ATTR_WARN_UNUSED_RESULT
void * BLI_ghash_lookup(const GHash *gh, const void *key) ATTR_WARN_UNUSED_RESULT
void BLI_ghash_insert(GHash *gh, void *key, void *val)
#define LISTBASE_FOREACH(type, var, list)
BLI_INLINE bool BLI_listbase_is_empty(const ListBase *lb)
void BLI_freelinkN(ListBase *listbase, void *vlink) ATTR_NONNULL(1)
void void BLI_freelistN(ListBase *listbase) ATTR_NONNULL(1)
void BLI_addtail(ListBase *listbase, void *vlink) ATTR_NONNULL(1)
void BLI_insertlinkafter(ListBase *listbase, void *vprevlink, void *vnewlink) ATTR_NONNULL(1)
void BLI_addhead(ListBase *listbase, void *vlink) ATTR_NONNULL(1)
void * BLI_findptr(const struct ListBase *listbase, const void *ptr, int offset) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
MINLINE void sub_v3_v3v3(float r[3], const float a[3], const float b[3])
MINLINE void copy_v3_v3(float r[3], const float a[3])
MINLINE void add_v3_v3v3(float r[3], const float a[3], const float b[3])
MINLINE void cross_v3_v3v3(float r[3], const float a[3], const float b[3])
void mid_v3_v3v3(float r[3], const float a[3], const float b[3])
MINLINE float normalize_v3(float n[3])
struct MempoolIterData MempoolIterData
BLI_INLINE void BLI_parallel_range_settings_defaults(TaskParallelSettings *settings)
void(* TaskParallelMempoolFunc)(void *userdata, MempoolIterData *iter, const TaskParallelTLS *__restrict tls)
Read Guarded memory(de)allocation.
#define BM_FACE_FIRST_LOOP(p)
#define BM_elem_index_get(ele)
#define BM_elem_flag_disable(ele, hflag)
#define BM_elem_flag_set(ele, hflag, val)
#define BM_elem_flag_test(ele, hflag)
#define BM_elem_flag_test_bool(ele, hflag)
#define BM_elem_flag_enable(ele, hflag)
#define BM_ITER_MESH(ele, iter, bm, itype)
BMIterType
BMesh Iterators.
#define BM_iter_new(iter, bm, itype, data)
BMVert * BM_mesh_active_vert_get(BMesh *bm)
static TaskParallelMempoolFunc recount_totsels_get_range_func(BMIterType iter_type)
void BM_select_history_clear(BMesh *bm)
static void vert_flush_hide_set(BMVert *v)
void _bm_elem_hide_set(BMesh *bm, BMHeader *head, const bool hide)
bool _bm_select_history_check(BMesh *bm, const BMHeader *ele)
static void recount_totsels_range_vert_func(void *, MempoolIterData *iter, const TaskParallelTLS *__restrict tls)
void _bm_select_history_store_head_notest(BMesh *bm, BMHeader *ele)
int BM_mesh_active_face_index_get(BMesh *bm, bool is_sloppy, bool is_selected)
void BM_vert_hide_set(BMVert *v, const bool hide)
char BM_select_history_htype_all(const BMesh *bm)
void BM_mesh_elem_hflag_enable_all(BMesh *bm, const char htype, const char hflag, const bool respecthide)
int BM_mesh_active_edge_index_get(BMesh *bm)
static bool bm_edge_is_face_visible_any(const BMEdge *e)
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)
static void recount_totsels_range_face_func(void *, MempoolIterData *iter, const TaskParallelTLS *__restrict tls)
void BM_mesh_select_mode_set(BMesh *bm, int selectmode)
static void recount_totsels_reduce(const void *__restrict, void *__restrict chunk_join, void *__restrict chunk)
void BM_face_select_set(BMesh *bm, BMFace *f, const bool select)
Select Face.
static bool bm_vert_is_edge_visible_any(const BMVert *v)
BMEdge * BM_mesh_active_edge_get(BMesh *bm)
void BM_elem_select_set(BMesh *bm, BMElem *ele, const bool select)
static bool recount_totsels_are_ok(BMesh *bm)
bool _bm_select_history_remove(BMesh *bm, BMHeader *ele)
void BM_mesh_select_mode_flush_ex(BMesh *bm, const short selectmode, BMSelectFlushFlag flag)
Select Mode Flush.
static void recount_totsels(BMesh *bm)
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.
static void bm_mesh_select_mode_flush_vert_to_edge(BMesh *bm)
static bool bm_vert_is_edge_select_any_other(const BMVert *v, const BMEdge *e_first)
void _bm_select_history_store_after(BMesh *bm, BMEditSelection *ese_ref, BMHeader *ele)
static bool bm_edge_is_face_select_any_other(BMLoop *l_first)
void _bm_select_history_store_notest(BMesh *bm, BMHeader *ele)
BMFace * BM_mesh_active_face_get(BMesh *bm, const bool is_sloppy, const bool is_selected)
int BM_mesh_active_vert_index_get(BMesh *bm)
static int recount_totsel(BMesh *bm, BMIterType iter_type)
BMElem * BM_mesh_active_elem_get(BMesh *bm)
void BM_mesh_select_mode_clean(BMesh *bm)
static void bm_mesh_select_mode_flush_vert_to_edge_iter_fn(void *, MempoolIterData *iter, const TaskParallelTLS *__restrict tls)
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])
static void bm_mesh_select_mode_flush_edge_to_face_iter_fn(void *, MempoolIterData *iter, const TaskParallelTLS *__restrict tls)
static void bm_mesh_select_mode_flush_edge_to_vert(BMesh *bm)
static void edge_flush_hide_set(BMEdge *e)
GHash * BM_select_history_map_create(BMesh *bm)
void BM_edge_hide_set(BMEdge *e, const bool hide)
static void bm_mesh_select_mode_flush_edge_to_face(BMesh *bm)
void BM_mesh_elem_hflag_disable_all(BMesh *bm, const char htype, const char hflag, const bool respecthide)
static void bm_mesh_select_mode_flush_face_to_vert_and_edge(BMesh *bm)
static int bm_mesh_flag_count(BMesh *bm, const char htype, const char hflag, const bool respecthide, const bool test_for_enabled)
void BM_mesh_active_face_set(BMesh *bm, BMFace *f)
void _bm_select_history_store(BMesh *bm, BMHeader *ele)
static void recount_totsels_range_edge_func(void *, MempoolIterData *iter, const TaskParallelTLS *__restrict tls)
static void recount_totvertsel(BMesh *bm)
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)
static void bm_mesh_select_mode_flush_reduce_fn(const void *__restrict, void *__restrict chunk_join, void *__restrict chunk)
static void recount_totedgesel(BMesh *bm)
bool BM_mesh_select_is_mixed(const BMesh *bm)
bool BM_select_history_active_get(BMesh *bm, BMEditSelection *ese)
void BM_face_hide_set(BMFace *f, const bool hide)
static BMEditSelection * bm_select_history_create(BMHeader *ele)
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)
void BM_mesh_select_flush_from_verts(BMesh *bm, const bool select)
static void recount_totfacesel(BMesh *bm)
#define BM_select_history_store_notest(bm, ele)
#define BM_select_history_store_head_notest(bm, ele)
#define BMSelectFlushFlag_Default
#define BM_select_history_store_after_notest(bm, ese_ref, ele)
#define BM_select_history_check(bm, ele)
void BM_face_calc_center_median(const BMFace *f, float r_cent[3])
void BM_face_calc_tangent_auto(const BMFace *f, float r_tangent[3])
#define BM_ELEM_API_FLAG_DISABLE(element, f)
#define BM_ELEM_API_FLAG_TEST(element, f)
#define BM_ELEM_API_FLAG_ENABLE(element, f)
BLI_INLINE bool BM_edge_is_boundary(const BMEdge *e) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL()
ATTR_WARN_UNUSED_RESULT const BMVert const BMEdge * e
ATTR_WARN_UNUSED_RESULT const BMVert * v
BLI_INLINE BMEdge * bmesh_disk_edge_next(const BMEdge *e, const BMVert *v) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL()
void * MEM_callocN(size_t len, const char *str)
struct BMEditSelection * next
struct BMEditSelection * prev
struct BMLoop * radial_next
TaskParallelReduceFunc func_reduce
size_t userdata_chunk_size