Blender
V3.3
|
#include "MEM_guardedalloc.h"
#include "BLI_heap_simple.h"
#include "BLI_linklist.h"
#include "BLI_math.h"
#include "bmesh.h"
#include "bmesh_path.h"
Go to the source code of this file.
Macros | |
#define | COST_INIT_MAX FLT_MAX |
Functions | |
Generic Helpers | |
static float | step_cost_3_v3_ex (const float v1[3], const float v2[3], const float v3[3], bool skip_12, bool skip_23) |
static float | step_cost_3_v3 (const float v1[3], const float v2[3], const float v3[3]) |
BM_mesh_calc_path_vert | |
static void | verttag_add_adjacent (HeapSimple *heap, BMVert *v_a, BMVert **verts_prev, float *cost, const struct BMCalcPathParams *params) |
LinkNode * | BM_mesh_calc_path_vert (BMesh *bm, BMVert *v_src, BMVert *v_dst, const struct BMCalcPathParams *params, bool(*filter_fn)(BMVert *, void *user_data), void *user_data) |
BM_mesh_calc_path_edge | |
static float | edgetag_cut_cost_vert (BMEdge *e_a, BMEdge *e_b, BMVert *v) |
static float | edgetag_cut_cost_face (BMEdge *e_a, BMEdge *e_b, BMFace *f) |
static void | edgetag_add_adjacent (HeapSimple *heap, BMEdge *e_a, BMEdge **edges_prev, float *cost, const struct BMCalcPathParams *params) |
LinkNode * | BM_mesh_calc_path_edge (BMesh *bm, BMEdge *e_src, BMEdge *e_dst, const struct BMCalcPathParams *params, bool(*filter_fn)(BMEdge *, void *user_data), void *user_data) |
BM_mesh_calc_path_face | |
static float | facetag_cut_cost_edge (BMFace *f_a, BMFace *f_b, BMEdge *e, const void *const f_endpoints[2]) |
static float | facetag_cut_cost_vert (BMFace *f_a, BMFace *f_b, BMVert *v, const void *const f_endpoints[2]) |
static void | facetag_add_adjacent (HeapSimple *heap, BMFace *f_a, BMFace **faces_prev, float *cost, const void *const f_endpoints[2], const struct BMCalcPathParams *params) |
LinkNode * | BM_mesh_calc_path_face (BMesh *bm, BMFace *f_src, BMFace *f_dst, const struct BMCalcPathParams *params, bool(*filter_fn)(BMFace *, void *user_data), void *user_data) |
Find a path between 2 elements.
Definition in file bmesh_path.c.
#define COST_INIT_MAX FLT_MAX |
Definition at line 20 of file bmesh_path.c.
LinkNode* BM_mesh_calc_path_edge | ( | BMesh * | bm, |
BMEdge * | e_src, | ||
BMEdge * | e_dst, | ||
const struct BMCalcPathParams * | params, | ||
bool(*)(BMEdge *, void *user_data) | filter_fn, | ||
void * | user_data | ||
) |
Definition at line 295 of file bmesh_path.c.
References BLI_heapsimple_free(), BLI_heapsimple_insert(), BLI_heapsimple_is_empty(), BLI_heapsimple_new(), BLI_heapsimple_pop_min(), BLI_linklist_prepend(), bm, BM_EDGE, BM_EDGES_OF_MESH, BM_elem_flag_enable, BM_elem_flag_set, BM_elem_flag_test, BM_elem_index_get, BM_elem_index_set, BM_ELEM_TAG, BM_ITER_MESH_INDEX, BM_mesh_elem_index_ensure(), BM_VERT, copy_vn_fl(), COST_INIT_MAX, e, edgetag_add_adjacent(), BMesh::elem_index_dirty, MEM_callocN, MEM_freeN, MEM_mallocN, NULL, params, BMesh::totedge, and user_data.
Referenced by mouse_mesh_shortest_path_edge().
LinkNode* BM_mesh_calc_path_face | ( | BMesh * | bm, |
BMFace * | f_src, | ||
BMFace * | f_dst, | ||
const struct BMCalcPathParams * | params, | ||
bool(*)(BMFace *, void *user_data) | filter_fn, | ||
void * | user_data | ||
) |
Definition at line 493 of file bmesh_path.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_INDEX, copy_vn_fl(), COST_INIT_MAX, BMesh::elem_index_dirty, facetag_add_adjacent(), MEM_callocN, MEM_freeN, MEM_mallocN, NULL, params, BMesh::totface, and user_data.
Referenced by mouse_mesh_shortest_path_face().
LinkNode* BM_mesh_calc_path_vert | ( | BMesh * | bm, |
BMVert * | v_src, | ||
BMVert * | v_dst, | ||
const struct BMCalcPathParams * | params, | ||
bool(*)(BMVert *, void *user_data) | filter_fn, | ||
void * | user_data | ||
) |
Definition at line 115 of file bmesh_path.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_ITER_MESH_INDEX, BM_VERT, BM_VERTS_OF_MESH, copy_vn_fl(), COST_INIT_MAX, BMesh::elem_index_dirty, MEM_callocN, MEM_freeN, MEM_mallocN, NULL, params, BMesh::totvert, user_data, v, and verttag_add_adjacent().
Referenced by mouse_mesh_shortest_path_vert().
|
static |
Definition at line 214 of file bmesh_path.c.
References BLI_heapsimple_insert(), BM_EDGES_OF_VERT, BM_elem_flag_test, BM_elem_index_get, BM_ELEM_TAG, BM_ITER_ELEM, BM_vert_in_edge(), BM_VERTS_OF_EDGE, BMLoop::e, edgetag_cut_cost_face(), edgetag_cut_cost_vert(), BMLoop::f, BMEdge::l, BMFace::len, BMLoop::next, NULL, params, BMLoop::prev, BMLoop::radial_next, and v.
Referenced by BM_mesh_calc_path_edge().
Definition at line 202 of file bmesh_path.c.
References BM_face_calc_center_median_weighted(), BMVert::co, mid_v3_v3v3(), step_cost_3_v3(), and BMEdge::v1.
Referenced by edgetag_add_adjacent().
Definition at line 195 of file bmesh_path.c.
References BM_edge_other_vert(), BMVert::co, step_cost_3_v3(), v, v1, and v2.
Referenced by edgetag_add_adjacent().
|
static |
Definition at line 425 of file bmesh_path.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_LOOPS_OF_FACE, BM_LOOPS_OF_VERT, BMLoop::e, BMLoop::f, facetag_cut_cost_edge(), facetag_cut_cost_vert(), l_b, params, BMLoop::radial_next, and BMLoop::v.
Referenced by BM_mesh_calc_path_face().
|
static |
Definition at line 375 of file bmesh_path.c.
References BM_face_calc_center_median_weighted(), BMVert::co, copy_v3_v3(), e, isect_line_line_v3(), line_point_factor_v3(), mid_v3_v3v3(), and step_cost_3_v3_ex().
Referenced by facetag_add_adjacent().
|
static |
Definition at line 410 of file bmesh_path.c.
References BM_face_calc_center_median_weighted(), BMVert::co, step_cost_3_v3_ex(), and v.
Referenced by facetag_add_adjacent().
Definition at line 46 of file bmesh_path.c.
References step_cost_3_v3_ex(), v1, and v2.
Referenced by edgetag_cut_cost_face(), and edgetag_cut_cost_vert().
|
static |
Use skip options when we want to start measuring from a boundary.
Definition at line 29 of file bmesh_path.c.
References dot_v3v3(), fabsf, normalize_v3(), sqrtf, sub_v3_v3v3(), v1, and v2.
Referenced by facetag_cut_cost_edge(), facetag_cut_cost_vert(), and step_cost_3_v3().
|
static |
Definition at line 57 of file bmesh_path.c.
References BLI_heapsimple_insert(), BM_edge_other_vert(), BM_EDGES_OF_VERT, BM_elem_flag_test, BM_elem_index_get, BM_ELEM_TAG, BM_ITER_ELEM, BM_LOOPS_OF_VERT, BMVert::co, e, BMLoop::f, l, BMFace::len, len_v3v3(), BMLoop::next, params, BMLoop::prev, and BMLoop::v.
Referenced by BM_mesh_calc_path_vert().