49 #define USE_EDGE_CHAIN
60 for (j = 0; j < 2; j++) {
63 l_other = j ? l_other->
next : l_other->
prev;
64 if (l_other == l_pivot) {
68 l_end_pair[j] = l_other;
82 return (((depths[0][index] != -1) && (depths[1][index] != -1)) &&
83 ((depths[0][index] + depths[1][index]) < pass));
126 const uint cd_loop_uv_offset,
127 const char path_htype)
129 int ele_loops_len[2];
133 for (
int side = 0; side < 2; side++) {
134 BMElem *ele = side ? ele_dst : ele_src;
144 ele_loops[side][j++] = l_iter;
145 }
while ((l_iter = l_iter->
next) != l_first);
151 ele_loops[side][j++] =
l;
152 ele_loops[side][j++] =
l->
next;
154 else if (path_htype ==
BM_VERT) {
158 ele_loops[side][j++] =
l;
167 ele_loops_len[side] = j;
170 int *depths[2] = {
NULL};
186 bool found_all =
false;
188 for (
int side = 0; side < 2; side++) {
189 const int side_other = !side;
199 for (
int i = 0; i < ele_loops_len[side]; i++) {
200 BMLoop *
l = ele_loops[side][i];
207 #ifdef USE_EDGE_CHAIN
212 for (
int i = 0; i < ele_loops_len[side]; i++) {
213 BMLoop *
l = ele_loops[side][i];
216 for (
int j = 0; j < 2; j++) {
218 if (depths[side][l_end_index] == -1) {
219 depths[side][l_end_index] = 0;
233 for (pass = 1; (
STACK_SIZE(stack) != 0); pass++) {
254 for (
int j = 0; j < 2; j++) {
257 if (depths[side][l_b_index] == -1) {
259 #ifdef USE_EDGE_CHAIN
263 ((depths[side][l_b_index] == -1) &&
266 depths[side][l_b_index] = pass;
275 if (depths[side][l_b_index] == -1) {
276 #ifdef USE_EDGE_CHAIN
280 depths[side][l_b_index] = pass;
295 for (
int i = 0; i < ele_loops_len[side_other]; i++) {
301 if (found_all ==
true) {
311 if (found_all ==
false) {
323 if (found_all ==
false) {
326 else if (path_htype ==
BM_FACE) {
342 }
while ((l_iter = l_iter->
next) != l_first);
347 int ok_tests = f->
len > 3 ? 1 : 0;
356 }
while ((l_iter = l_iter->
next) != l_first);
365 else if (path_htype ==
BM_EDGE) {
374 const bool l_in_chain = l_in_chain_next;
376 if (l_in_chain && l_in_chain_next) {
382 else if (path_htype ==
BM_VERT) {
396 for (
int side = 0; side < 2; side++) {
405 #undef USE_EDGE_CHAIN
414 const uint cd_loop_uv_offset,
443 const uint cd_loop_uv_offset,
472 const uint cd_loop_uv_offset,
495 }
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, const int size, const int val)
#define STACK_CLEAR(stack)
#define STACK_PUSH(stack, val)
#define STACK_DECLARE(stack)
#define STACK_INIT(stack, tot)
#define STACK_SIZE(stack)
#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)