Blender
V3.3
|
#include "MEM_guardedalloc.h"
#include "BLI_alloca.h"
#include "BLI_linklist.h"
#include "BLI_math.h"
#include "BLI_utildefines_stack.h"
#include "bmesh.h"
#include "bmesh_path_region_uv.h"
Go to the source code of this file.
Macros | |
#define | USE_EDGE_CHAIN |
Functions | |
static bool | bm_loop_pair_ends (BMLoop *l_pivot, BMLoop *l_end_pair[2]) |
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) |
Loop Vertex in Region Checks | |
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) |
Main Functions (exposed externally). | |
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) |
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) |
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) |
Find the region defined by the path(s) between 2 UV elements. (path isn't ordered).
Definition in file bmesh_path_region_uv.c.
#define USE_EDGE_CHAIN |
Special handling of vertices with 2 edges (act as if the edge-chain is a single edge).
Restrict walking over a vertex chain to cases where the edges share the same faces. This is more typical of what a user would consider a vertex chain.
Definition at line 35 of file bmesh_path_region_uv.c.
Takes a vertex with 2 edge users and assigns the vertices at each end-point,
Definition at line 43 of file bmesh_path_region_uv.c.
References BLI_assert, BM_vert_is_edge_pair_manifold(), BMLoop::next, BMLoop::prev, and BMLoop::v.
Referenced by bm_loop_region_test_chain(), and mesh_calc_path_region_elem().
Definition at line 65 of file bmesh_path_region_uv.c.
References BM_elem_index_get, and l.
Referenced by bm_loop_region_test_chain().
Definition at line 73 of file bmesh_path_region_uv.c.
References bm_loop_pair_ends(), bm_loop_region_test(), BM_vert_is_edge_pair_manifold(), l, and BMLoop::v.
Referenced by mesh_calc_path_region_elem().
LinkNode* BM_mesh_calc_path_uv_region_edge | ( | BMesh * | bm, |
BMElem * | ele_src, | ||
BMElem * | ele_dst, | ||
const uint | cd_loop_uv_offset, | ||
bool(*)(BMLoop *, void *user_data) | filter_fn, | ||
void * | user_data | ||
) |
Definition at line 426 of file bmesh_path_region_uv.c.
References bm, BM_EDGE, BM_elem_flag_set, BM_elem_index_set, BM_ELEM_TAG, BM_FACES_OF_MESH, BM_ITER_ELEM, BM_ITER_MESH, BM_LOOP, BM_LOOPS_OF_FACE, BMesh::elem_index_dirty, l, mesh_calc_path_region_elem(), NULL, and user_data.
Referenced by mouse_mesh_uv_shortest_path_edge().
LinkNode* BM_mesh_calc_path_uv_region_face | ( | BMesh * | bm, |
BMElem * | ele_src, | ||
BMElem * | ele_dst, | ||
const uint | cd_loop_uv_offset, | ||
bool(*)(BMFace *, void *user_data) | filter_fn, | ||
void * | user_data | ||
) |
Definition at line 455 of file bmesh_path_region_uv.c.
References bm, BM_elem_flag_disable, BM_elem_flag_set, BM_ELEM_TAG, BM_FACE, BM_FACE_FIRST_LOOP, BM_FACES_OF_MESH, BM_ITER_MESH_INDEX, BM_mesh_elem_hflag_enable_all(), BM_VERT, mesh_calc_path_region_elem(), BMLoop::next, NULL, user_data, and BMLoop::v.
Referenced by mouse_mesh_uv_shortest_path_face().
LinkNode* BM_mesh_calc_path_uv_region_vert | ( | BMesh * | bm, |
BMElem * | ele_src, | ||
BMElem * | ele_dst, | ||
const uint | cd_loop_uv_offset, | ||
bool(*)(BMLoop *, void *user_data) | filter_fn, | ||
void * | user_data | ||
) |
Definition at line 397 of file bmesh_path_region_uv.c.
References bm, BM_elem_flag_set, BM_elem_index_set, BM_ELEM_TAG, BM_FACES_OF_MESH, BM_ITER_ELEM, BM_ITER_MESH, BM_LOOP, BM_LOOPS_OF_FACE, BM_VERT, BMesh::elem_index_dirty, l, mesh_calc_path_region_elem(), NULL, and user_data.
Referenced by mouse_mesh_uv_shortest_path_vert().
|
static |
Main logic for calculating region between 2 elements.
This method works walking (breadth first) over all vertices, keeping track of topological distance from the source.
This is done in both directions, after that each vertices 'depth' is added to check if its less than the number of passes needed to complete the search. When it is, we know the path is one of possible paths that have the minimum topological distance.
Definition at line 109 of file bmesh_path_region_uv.c.
References BLI_array_alloca, BLI_assert, BLI_linklist_prepend(), bm, BM_EDGE, BM_elem_flag_test, BM_elem_index_get, BM_ELEM_TAG, BM_FACE, BM_FACE_FIRST_LOOP, BM_FACES_OF_MESH, BM_ITER_ELEM, BM_ITER_MESH, BM_LOOP, bm_loop_pair_ends(), bm_loop_region_test_chain(), BM_loop_uv_share_vert_check(), BM_LOOPS_OF_FACE, BM_LOOPS_OF_VERT, BM_mesh_elem_index_ensure(), BM_VERT, BM_vert_is_edge_pair_manifold(), copy_vn_i(), ELEM, BMElem::head, BMHeader::htype, l, l_b, BMFace::len, MEM_freeN, MEM_mallocN, BMLoop::next, NULL, BMLoop::prev, STACK_CLEAR, STACK_DECLARE, STACK_INIT, STACK_POP, STACK_PUSH, STACK_SIZE, STACK_SWAP, BMesh::totloop, and BMLoop::v.
Referenced by BM_mesh_calc_path_uv_region_edge(), BM_mesh_calc_path_uv_region_face(), and BM_mesh_calc_path_uv_region_vert().