Blender
V3.3
|
#include "MEM_guardedalloc.h"
#include "BLI_heap_simple.h"
#include "BLI_linklist.h"
#include "BLI_math.h"
#include "DNA_meshdata_types.h"
#include "bmesh.h"
#include "bmesh_path_uv.h"
#include "intern/bmesh_query.h"
#include "intern/bmesh_query_uv.h"
Go to the source code of this file.
Macros | |
#define | COST_INIT_MAX FLT_MAX |
Functions | |
Generic Helpers | |
static float | step_cost_3_v2_ex (const float v1[2], const float v2[2], const float v3[2], bool skip_12, bool skip_23) |
static float | step_cost_3_v2 (const float v1[2], const float v2[2], const float v3[2]) |
BM_mesh_calc_path_uv_vert | |
static void | verttag_add_adjacent_uv (HeapSimple *heap, BMLoop *l_a, BMLoop **loops_prev, float *cost, const struct BMCalcPathUVParams *params) |
struct LinkNode * | BM_mesh_calc_path_uv_vert (BMesh *bm, BMLoop *l_src, BMLoop *l_dst, const struct BMCalcPathUVParams *params, bool(*filter_fn)(BMLoop *, void *), void *user_data) |
BM_mesh_calc_path_uv_edge | |
static float | edgetag_cut_cost_vert_uv (BMLoop *l_e_a, BMLoop *l_e_b, BMLoop *l_v, const float aspect_y, const int cd_loop_uv_offset) |
static float | edgetag_cut_cost_face_uv (BMLoop *l_e_a, BMLoop *l_e_b, BMFace *f, const float aspect_v2[2], const int cd_loop_uv_offset) |
static void | edgetag_add_adjacent_uv (HeapSimple *heap, BMLoop *l_a, BMLoop **loops_prev, float *cost, const struct BMCalcPathUVParams *params) |
struct LinkNode * | BM_mesh_calc_path_uv_edge (BMesh *bm, BMLoop *l_src, BMLoop *l_dst, const struct BMCalcPathUVParams *params, bool(*filter_fn)(BMLoop *, void *), void *user_data) |
BM_mesh_calc_path_uv_face | |
static float | facetag_cut_cost_edge_uv (BMFace *f_a, BMFace *f_b, BMLoop *l_edge, const void *const f_endpoints[2], const float aspect_v2[2], const int cd_loop_uv_offset) |
static float | facetag_cut_cost_vert_uv (BMFace *f_a, BMFace *f_b, BMLoop *l_vert, const void *const f_endpoints[2], const float aspect_v2[2], const int cd_loop_uv_offset) |
static void | facetag_add_adjacent_uv (HeapSimple *heap, BMFace *f_a, BMFace **faces_prev, float *cost, const void *const f_endpoints[2], const float aspect_v2[2], const struct BMCalcPathUVParams *params) |
struct LinkNode * | BM_mesh_calc_path_uv_face (BMesh *bm, BMFace *f_src, BMFace *f_dst, const struct BMCalcPathUVParams *params, bool(*filter_fn)(BMFace *, void *), void *user_data) |
Find a path between 2 elements in UV space.
Definition in file bmesh_path_uv.c.
#define COST_INIT_MAX FLT_MAX |
Definition at line 22 of file bmesh_path_uv.c.
struct LinkNode* BM_mesh_calc_path_uv_edge | ( | BMesh * | bm, |
BMLoop * | l_src, | ||
BMLoop * | l_dst, | ||
const struct BMCalcPathUVParams * | params, | ||
bool(*)(BMLoop *, void *) | filter_fn, | ||
void * | user_data | ||
) |
Definition at line 315 of file bmesh_path_uv.c.
References BLI_heapsimple_free(), BLI_heapsimple_insert(), BLI_heapsimple_is_empty(), BLI_heapsimple_new(), BLI_heapsimple_pop_min(), BLI_linklist_prepend(), bm, BM_elem_flag_enable, BM_elem_flag_set, BM_elem_flag_test, BM_elem_index_get, BM_elem_index_set, BM_ELEM_TAG, BM_FACE_FIRST_LOOP, BM_FACES_OF_MESH, BM_ITER_MESH, BM_LOOP, BM_loop_uv_share_edge_check(), copy_vn_fl(), COST_INIT_MAX, BMLoop::e, edgetag_add_adjacent_uv(), BMesh::elem_index_dirty, l, MEM_callocN, MEM_freeN, MEM_mallocN, BMLoop::next, NULL, params, BMesh::totloop, and user_data.
Referenced by mouse_mesh_uv_shortest_path_edge().
struct LinkNode* BM_mesh_calc_path_uv_face | ( | BMesh * | bm, |
BMFace * | f_src, | ||
BMFace * | f_dst, | ||
const struct BMCalcPathUVParams * | params, | ||
bool(*)(BMFace *, void *) | filter_fn, | ||
void * | user_data | ||
) |
Definition at line 538 of file bmesh_path_uv.c.
References BLI_heapsimple_free(), BLI_heapsimple_insert(), BLI_heapsimple_is_empty(), BLI_heapsimple_new(), BLI_heapsimple_pop_min(), BLI_linklist_prepend(), bm, BM_elem_flag_enable, BM_elem_flag_set, BM_elem_flag_test, BM_elem_index_get, BM_elem_index_set, BM_ELEM_TAG, BM_FACE, BM_FACES_OF_MESH, BM_ITER_MESH, copy_vn_fl(), COST_INIT_MAX, BMesh::elem_index_dirty, facetag_add_adjacent_uv(), MEM_callocN, MEM_freeN, MEM_mallocN, NULL, params, BMesh::totface, and user_data.
Referenced by mouse_mesh_uv_shortest_path_face().
struct LinkNode* BM_mesh_calc_path_uv_vert | ( | BMesh * | bm, |
BMLoop * | l_src, | ||
BMLoop * | l_dst, | ||
const struct BMCalcPathUVParams * | params, | ||
bool(*)(BMLoop *, void *) | filter_fn, | ||
void * | user_data | ||
) |
Definition at line 110 of file bmesh_path_uv.c.
References BLI_heapsimple_free(), BLI_heapsimple_insert(), BLI_heapsimple_is_empty(), BLI_heapsimple_new(), BLI_heapsimple_pop_min(), BLI_linklist_prepend(), bm, BM_elem_flag_enable, BM_elem_flag_set, BM_elem_flag_test, BM_elem_index_get, BM_elem_index_set, BM_ELEM_TAG, BM_FACE_FIRST_LOOP, BM_FACES_OF_MESH, BM_ITER_MESH, BM_LOOP, BM_loop_uv_share_vert_check(), copy_vn_fl(), COST_INIT_MAX, BMesh::elem_index_dirty, l, MEM_callocN, MEM_freeN, MEM_mallocN, BMLoop::next, NULL, params, BMesh::totloop, user_data, BMLoop::v, and verttag_add_adjacent_uv().
Referenced by mouse_mesh_uv_shortest_path_vert().
|
static |
Definition at line 221 of file bmesh_path_uv.c.
References ARRAY_SIZE, BLI_assert, BLI_heapsimple_insert(), BM_EDGES_OF_VERT, BM_elem_flag_test, BM_elem_index_get, BM_ELEM_TAG, BM_ITER_ELEM, BM_loop_uv_share_edge_check(), BM_loop_uv_share_vert_check(), edgetag_cut_cost_face_uv(), edgetag_cut_cost_vert_uv(), BMLoop::f, if(), BMEdge::l, l_b, BMLoop::next, NULL, params, BMLoop::radial_next, BMLoop::v, and v.
Referenced by BM_mesh_calc_path_uv_edge().
|
static |
Definition at line 203 of file bmesh_path_uv.c.
References BM_ELEM_CD_GET_VOID_P, BM_face_uv_calc_center_median_weighted(), mid_v2_v2v2(), mul_v2_v2(), step_cost_3_v2(), and MLoopUV::uv.
Referenced by edgetag_add_adjacent_uv().
|
static |
Definition at line 186 of file bmesh_path_uv.c.
References BM_ELEM_CD_GET_VOID_P, BMLoop::next, step_cost_3_v2(), MLoopUV::uv, and BMLoop::v.
Referenced by edgetag_add_adjacent_uv().
|
static |
Definition at line 457 of file bmesh_path_uv.c.
References BLI_heapsimple_insert(), BM_elem_flag_test, BM_elem_index_get, BM_ELEM_TAG, BM_ITER_ELEM, BM_loop_share_edge_check(), BM_loop_uv_share_edge_check(), BM_loop_uv_share_vert_check(), BM_LOOPS_OF_FACE, BM_LOOPS_OF_VERT, BMLoop::f, facetag_cut_cost_edge_uv(), facetag_cut_cost_vert_uv(), l_b, params, BMLoop::radial_next, and BMLoop::v.
Referenced by BM_mesh_calc_path_uv_face().
|
static |
Definition at line 386 of file bmesh_path_uv.c.
References BM_ELEM_CD_GET_VOID_P, BM_face_uv_calc_center_median_weighted(), copy_v2_v2(), isect_line_line_v2_point(), line_point_factor_v2(), mid_v2_v2v2(), mul_v2_v2(), BMLoop::next, and step_cost_3_v2_ex().
Referenced by facetag_add_adjacent_uv().
|
static |
Definition at line 433 of file bmesh_path_uv.c.
References BM_ELEM_CD_GET_VOID_P, BM_face_uv_calc_center_median_weighted(), copy_v2_v2(), mul_v2_v2(), and step_cost_3_v2_ex().
Referenced by facetag_add_adjacent_uv().
Definition at line 50 of file bmesh_path_uv.c.
References step_cost_3_v2_ex(), v1, and v2.
Referenced by edgetag_cut_cost_face_uv(), and edgetag_cut_cost_vert_uv().
|
static |
Use skip options when we want to start measuring from a boundary.
See step_cost_3_v3_ex in bmesh_path.c which follows the same logic.
Definition at line 33 of file bmesh_path_uv.c.
References dot_v2v2(), fabsf, normalize_v2(), sqrtf, sub_v2_v2v2(), v1, and v2.
Referenced by facetag_cut_cost_edge_uv(), facetag_cut_cost_vert_uv(), and step_cost_3_v2().
|
static |
Definition at line 61 of file bmesh_path_uv.c.
References BLI_assert, BLI_heapsimple_insert(), BM_ELEM_CD_GET_VOID_P, BM_elem_flag_enable, BM_elem_flag_test, BM_elem_index_get, BM_ELEM_TAG, BM_ITER_ELEM, BM_LOOPS_OF_VERT, equals_v2v2(), l, l_b, len_v2v2(), BMLoop::next, params, BMLoop::prev, MLoopUV::uv, and BMLoop::v.
Referenced by BM_mesh_calc_path_uv_vert().