35 #define USE_EDGE_CHAIN
46 for (j = 0; j < 2; j++) {
49 l_other = j ? l_other->
next : l_other->
prev;
50 if (l_other == l_pivot) {
54 l_end_pair[j] = l_other;
68 return (((depths[0][index] != -1) && (depths[1][index] != -1)) &&
69 ((depths[0][index] + depths[1][index]) < pass));
112 const uint cd_loop_uv_offset,
113 const char path_htype)
115 int ele_loops_len[2];
119 for (
int side = 0; side < 2; side++) {
120 BMElem *ele = side ? ele_dst : ele_src;
130 ele_loops[side][j++] = l_iter;
131 }
while ((l_iter = l_iter->
next) != l_first);
137 ele_loops[side][j++] =
l;
138 ele_loops[side][j++] =
l->
next;
140 else if (path_htype ==
BM_VERT) {
144 ele_loops[side][j++] =
l;
153 ele_loops_len[side] = j;
156 int *depths[2] = {
NULL};
172 bool found_all =
false;
174 for (
int side = 0; side < 2; side++) {
175 const int side_other = !side;
185 for (
int i = 0; i < ele_loops_len[side]; i++) {
186 BMLoop *
l = ele_loops[side][i];
193 #ifdef USE_EDGE_CHAIN
198 for (
int i = 0; i < ele_loops_len[side]; i++) {
199 BMLoop *
l = ele_loops[side][i];
202 for (
int j = 0; j < 2; j++) {
204 if (depths[side][l_end_index] == -1) {
205 depths[side][l_end_index] = 0;
219 for (pass = 1; (
STACK_SIZE(stack) != 0); pass++) {
240 for (
int j = 0; j < 2; j++) {
243 if (depths[side][l_b_index] == -1) {
245 #ifdef USE_EDGE_CHAIN
249 ((depths[side][l_b_index] == -1) &&
252 depths[side][l_b_index] = pass;
261 if (depths[side][l_b_index] == -1) {
262 #ifdef USE_EDGE_CHAIN
266 depths[side][l_b_index] = pass;
281 for (
int i = 0; i < ele_loops_len[side_other]; i++) {
287 if (found_all ==
true) {
297 if (found_all ==
false) {
309 if (found_all ==
false) {
312 else if (path_htype ==
BM_FACE) {
328 }
while ((l_iter = l_iter->
next) != l_first);
333 int ok_tests = f->
len > 3 ? 1 : 0;
342 }
while ((l_iter = l_iter->
next) != l_first);
351 else if (path_htype ==
BM_EDGE) {
360 const bool l_in_chain = l_in_chain_next;
362 if (l_in_chain && l_in_chain_next) {
368 else if (path_htype ==
BM_VERT) {
382 for (
int side = 0; side < 2; side++) {
391 #undef USE_EDGE_CHAIN
400 const uint cd_loop_uv_offset,
429 const uint cd_loop_uv_offset,
458 const uint cd_loop_uv_offset,
481 }
while ((l_iter = l_iter->
next) != l_first);
#define BLI_array_alloca(arr, realsize)
void void BLI_linklist_prepend(LinkNode **listp, void *ptr) ATTR_NONNULL(1)
void copy_vn_i(int *array_tar, int size, int val)
#define STACK_CLEAR(stack)
#define STACK_PUSH(stack, val)
#define STACK_DECLARE(stack)
#define STACK_SIZE(stack)
#define STACK_INIT(stack, stack_num)
#define STACK_SWAP(stack_a, stack_b)
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_index_set(ele, index)
#define BM_elem_flag_test(ele, hflag)
#define BM_ITER_ELEM(ele, iter, data, itype)
#define BM_ITER_MESH(ele, iter, bm, itype)
#define BM_ITER_MESH_INDEX(ele, iter, bm, itype, indexvar)
ATTR_WARN_UNUSED_RESULT BMesh * bm
void BM_mesh_elem_hflag_enable_all(BMesh *bm, const char htype, const char hflag, const bool respecthide)
void BM_mesh_elem_index_ensure(BMesh *bm, const char htype)
static bool bm_loop_pair_ends(BMLoop *l_pivot, BMLoop *l_end_pair[2])
LinkNode * BM_mesh_calc_path_uv_region_vert(BMesh *bm, BMElem *ele_src, BMElem *ele_dst, const uint cd_loop_uv_offset, bool(*filter_fn)(BMLoop *, void *user_data), void *user_data)
static LinkNode * mesh_calc_path_region_elem(BMesh *bm, BMElem *ele_src, BMElem *ele_dst, const uint cd_loop_uv_offset, const char path_htype)
static bool bm_loop_region_test(BMLoop *l, int *const depths[2], const int pass)
static bool bm_loop_region_test_chain(BMLoop *l, int *const depths[2], const int pass)
LinkNode * BM_mesh_calc_path_uv_region_face(BMesh *bm, BMElem *ele_src, BMElem *ele_dst, const uint cd_loop_uv_offset, bool(*filter_fn)(BMFace *, void *user_data), void *user_data)
LinkNode * BM_mesh_calc_path_uv_region_edge(BMesh *bm, BMElem *ele_src, BMElem *ele_dst, const uint cd_loop_uv_offset, bool(*filter_fn)(BMLoop *, void *user_data), void *user_data)
bool BM_vert_is_edge_pair_manifold(const BMVert *v)
ATTR_WARN_UNUSED_RESULT const BMLoop * l
ATTR_WARN_UNUSED_RESULT const BMLoop * l_b
bool BM_loop_uv_share_vert_check(BMLoop *l_a, BMLoop *l_b, const int cd_loop_uv_offset)
void(* MEM_freeN)(void *vmemh)
void *(* MEM_mallocN)(size_t len, const char *str)