|
Blender V4.3
|
#include "MEM_guardedalloc.h"#include "BLI_kdopbvh.h"#include "BLI_math_geom.h"#include "BLI_math_vector.h"#include "BKE_editmesh.hh"#include "BKE_editmesh_bvh.hh"Go to the source code of this file.
Classes | |
| struct | BMBVHTree |
| struct | RayCastUserData |
| struct | RayCastUserData_Filter |
| struct | VertSearchUserData |
| struct | FaceSearchUserData |
| struct | BMBVHTree_OverlapData |
Functions | |
| BMBVHTree * | BKE_bmbvh_new_from_editmesh (BMEditMesh *em, int flag, const blender::float3 *cos_cage, const bool cos_cage_free) |
| BMBVHTree * | BKE_bmbvh_new_ex (BMesh *bm, const Span< std::array< BMLoop *, 3 > > looptris, int flag, const blender::float3 *cos_cage, const bool cos_cage_free, bool(*test_fn)(BMFace *, void *user_data), void *user_data) |
| static bool | bm_face_is_select (BMFace *f, void *) |
| static bool | bm_face_is_not_hidden (BMFace *f, void *) |
| BMBVHTree * | BKE_bmbvh_new (BMesh *bm, const Span< std::array< BMLoop *, 3 > > looptris, int flag, const blender::float3 *cos_cage, const bool cos_cage_free) |
| void | BKE_bmbvh_free (BMBVHTree *bmtree) |
| BVHTree * | BKE_bmbvh_tree_get (BMBVHTree *bmtree) |
| static void | bmbvh_tri_from_face (const float *cos[3], const std::array< BMLoop *, 3 > <ri, const blender::float3 *cos_cage) |
| static BMFace * | bmbvh_ray_cast_handle_hit (const BMBVHTree *bmtree, RayCastUserData *bmcb_data, const BVHTreeRayHit *hit, float *r_dist, float r_hitout[3], float r_cagehit[3]) |
| static void | bmbvh_ray_cast_cb (void *userdata, int index, const BVHTreeRay *ray, BVHTreeRayHit *hit) |
| BMFace * | BKE_bmbvh_ray_cast (const BMBVHTree *bmtree, const float co[3], const float dir[3], const float radius, float *r_dist, float r_hitout[3], float r_cagehit[3]) |
| static void | bmbvh_ray_cast_cb_filter (void *userdata, int index, const BVHTreeRay *ray, BVHTreeRayHit *hit) |
| BMFace * | BKE_bmbvh_ray_cast_filter (const BMBVHTree *bmtree, const float co[3], const float dir[3], const float radius, float *r_dist, float r_hitout[3], float r_cagehit[3], BMBVHTree_FaceFilter filter_cb, void *filter_userdata) |
| static void | bmbvh_find_vert_closest_cb (void *userdata, int index, const float co[3], BVHTreeNearest *hit) |
| BMVert * | BKE_bmbvh_find_vert_closest (const BMBVHTree *bmtree, const float co[3], const float dist_max) |
| static void | bmbvh_find_face_closest_cb (void *userdata, int index, const float co[3], BVHTreeNearest *hit) |
| BMFace * | BKE_bmbvh_find_face_closest (const BMBVHTree *bmtree, const float co[3], const float dist_max) |
| static bool | bmbvh_overlap_cb (void *userdata, int index_a, int index_b, int) |
| BVHTreeOverlap * | BKE_bmbvh_overlap (const BMBVHTree *bmtree_a, const BMBVHTree *bmtree_b, uint *r_overlap_tot) |
| static bool | bmbvh_overlap_self_cb (void *userdata, int index_a, int index_b, int thread) |
| BVHTreeOverlap * | BKE_bmbvh_overlap_self (const BMBVHTree *bmtree, uint *r_overlap_tot) |
| BMFace * BKE_bmbvh_find_face_closest | ( | const BMBVHTree * | bmtree, |
| const float | co[3], | ||
| const float | dist_max ) |
Definition at line 485 of file editmesh_bvh.cc.
References BLI_assert, BLI_bvhtree_find_nearest(), BMBVHTree::bm, BM_VERT, bmbvh_find_face_closest_cb(), BMBVHTree::cos_cage, FaceSearchUserData::cos_cage, FaceSearchUserData::dist_max_sq, BMesh::elem_index_dirty, BMBVHTree::looptris, FaceSearchUserData::looptris, and BMBVHTree::tree.
Referenced by edbm_face_split_by_edges_exec().
Find a vert closest to co in a sphere of radius dist_max.
Definition at line 424 of file editmesh_bvh.cc.
References BLI_assert, BLI_bvhtree_find_nearest(), BMBVHTree::bm, BM_VERT, bmbvh_find_vert_closest_cb(), BMBVHTree::cos_cage, VertSearchUserData::cos_cage, VertSearchUserData::dist_max_sq, BMesh::elem_index_dirty, VertSearchUserData::index_tri, BMBVHTree::looptris, VertSearchUserData::looptris, and BMBVHTree::tree.
| void BKE_bmbvh_free | ( | BMBVHTree * | bmtree | ) |
Definition at line 169 of file editmesh_bvh.cc.
References BLI_bvhtree_free(), BMBVHTree::cos_cage, BMBVHTree::cos_cage_free, MEM_freeN(), and BMBVHTree::tree.
Referenced by calcEdgeSlide_mval_range(), edbm_face_split_by_edges_exec(), blender::draw::statvis_calc_intersect(), and blender::draw::statvis_calc_thickness().
| BMBVHTree * BKE_bmbvh_new | ( | BMesh * | bm, |
| const Span< std::array< BMLoop *, 3 > > | looptris, | ||
| int | flag, | ||
| const blender::float3 * | cos_cage, | ||
| const bool | cos_cage_free ) |
Definition at line 146 of file editmesh_bvh.cc.
References BKE_bmbvh_new_ex(), bm, bm_face_is_not_hidden(), bm_face_is_select(), BMBVH_RESPECT_HIDDEN, BMBVH_RESPECT_SELECT, and flag.
Referenced by BKE_bmbvh_new_from_editmesh().
| BMBVHTree * BKE_bmbvh_new_ex | ( | BMesh * | bm, |
| const Span< std::array< BMLoop *, 3 > > | looptris, | ||
| int | flag, | ||
| const blender::float3 * | cos_cage, | ||
| const bool | cos_cage_free, | ||
| bool(* | test_fn )(BMFace *, void *user_data), | ||
| void * | user_data ) |
Definition at line 42 of file editmesh_bvh.cc.
References BLI_assert, BLI_bvhtree_balance(), BLI_bvhtree_insert(), BLI_bvhtree_new(), bm, BMBVHTree::bm, BM_elem_index_get, BM_mesh_elem_index_ensure(), BM_VERT, BMBVH_RESPECT_HIDDEN, BMBVH_RESPECT_SELECT, BMVert::co, copy_v3_v3(), cos(), BMBVHTree::cos_cage, BMBVHTree::cos_cage_free, BMBVHTree::flag, flag, BMBVHTree::looptris, MEM_callocN, BMesh::totface, BMBVHTree::tree, and v.
Referenced by BKE_bmbvh_new().
| BMBVHTree * BKE_bmbvh_new_from_editmesh | ( | BMEditMesh * | em, |
| int | flag, | ||
| const blender::float3 * | cos_cage, | ||
| const bool | cos_cage_free ) |
Definition at line 34 of file editmesh_bvh.cc.
References BKE_bmbvh_new(), BMEditMesh::bm, flag, and BMEditMesh::looptris.
Referenced by calcEdgeSlide_mval_range(), blender::draw::statvis_calc_intersect(), and blender::draw::statvis_calc_thickness().
| BVHTreeOverlap * BKE_bmbvh_overlap | ( | const BMBVHTree * | bmtree_a, |
| const BMBVHTree * | bmtree_b, | ||
| unsigned int * | r_overlap_tot ) |
Overlap indices reference the looptris.
Definition at line 553 of file editmesh_bvh.cc.
References BLI_bvhtree_get_epsilon(), BLI_bvhtree_overlap(), bmbvh_overlap_cb(), data, max_ff(), BMBVHTree::tree, and BMBVHTree_OverlapData::tree_pair.
| BVHTreeOverlap * BKE_bmbvh_overlap_self | ( | const BMBVHTree * | bmtree, |
| unsigned int * | r_overlap_tot ) |
Overlap indices reference the looptris.
Definition at line 576 of file editmesh_bvh.cc.
References BLI_bvhtree_get_epsilon(), BLI_bvhtree_overlap(), bmbvh_overlap_self_cb(), data, BMBVHTree::tree, and BMBVHTree_OverlapData::tree_pair.
Referenced by blender::draw::statvis_calc_intersect().
| BMFace * BKE_bmbvh_ray_cast | ( | const BMBVHTree * | bmtree, |
| const float | co[3], | ||
| const float | dir[3], | ||
| const float | radius, | ||
| float * | r_dist, | ||
| float | r_hitout[3], | ||
| float | r_cagehit[3] ) |
Definition at line 289 of file editmesh_bvh.cc.
References BLI_assert, BLI_bvhtree_ray_cast(), BMBVHTree::bm, BM_VERT, bmbvh_ray_cast_cb(), bmbvh_ray_cast_handle_hit(), BMBVHTree::cos_cage, RayCastUserData::cos_cage, BMesh::elem_index_dirty, FLT_MAX, BMBVHTree::looptris, RayCastUserData::looptris, and BMBVHTree::tree.
Referenced by edge_ray_cast(), and blender::draw::statvis_calc_thickness().
| BMFace * BKE_bmbvh_ray_cast_filter | ( | const BMBVHTree * | bmtree, |
| const float | co[3], | ||
| const float | dir[3], | ||
| const float | radius, | ||
| float * | r_dist, | ||
| float | r_hitout[3], | ||
| float | r_cagehit[3], | ||
| BMBVHTree_FaceFilter | filter_cb, | ||
| void * | filter_userdata ) |
Definition at line 347 of file editmesh_bvh.cc.
References BLI_assert, BLI_bvhtree_ray_cast(), BMBVHTree::bm, BM_VERT, bmbvh_ray_cast_cb_filter(), bmbvh_ray_cast_handle_hit(), RayCastUserData_Filter::bmcb_data, BMBVHTree::cos_cage, RayCastUserData::cos_cage, BMesh::elem_index_dirty, RayCastUserData_Filter::filter_cb, RayCastUserData_Filter::filter_userdata, FLT_MAX, BMBVHTree::looptris, RayCastUserData::looptris, and BMBVHTree::tree.
Definition at line 180 of file editmesh_bvh.cc.
References BMBVHTree::tree.
|
static |
Definition at line 141 of file editmesh_bvh.cc.
References BM_elem_flag_test, and BM_ELEM_HIDDEN.
Referenced by BKE_bmbvh_new().
|
static |
Definition at line 136 of file editmesh_bvh.cc.
References BM_elem_flag_test, and BM_ELEM_SELECT.
Referenced by BKE_bmbvh_new().
|
static |
Definition at line 461 of file editmesh_bvh.cc.
References bmbvh_tri_from_face(), closest_on_tri_to_point_v3(), copy_v3_v3(), FaceSearchUserData::cos_cage, FaceSearchUserData::dist_max_sq, len_squared_v3v3(), FaceSearchUserData::looptris, and UNPACK3.
Referenced by BKE_bmbvh_find_face_closest().
|
static |
Definition at line 399 of file editmesh_bvh.cc.
References bmbvh_tri_from_face(), copy_v3_v3(), VertSearchUserData::cos_cage, VertSearchUserData::dist_max_sq, VertSearchUserData::index_tri, len_squared_v3v3(), and VertSearchUserData::looptris.
Referenced by BKE_bmbvh_find_vert_closest().
Definition at line 521 of file editmesh_bvh.cc.
References ELEM, isect_tri_tri_v3(), len_squared_v3v3(), BMBVHTree::looptris, UNLIKELY, and UNPACK3.
Referenced by BKE_bmbvh_overlap(), and bmbvh_overlap_self_cb().
Definition at line 568 of file editmesh_bvh.cc.
References bmbvh_overlap_cb().
Referenced by BKE_bmbvh_overlap_self().
|
static |
Definition at line 249 of file editmesh_bvh.cc.
References bmbvh_tri_from_face(), copy_v2_v2(), copy_v3_v3(), RayCastUserData::cos_cage, isect_ray_tri_epsilon_v3(), isect_ray_tri_v3(), isect_ray_tri_watertight_v3(), RayCastUserData::looptris, madd_v3_v3v3fl(), and RayCastUserData::uv.
Referenced by BKE_bmbvh_ray_cast(), and bmbvh_ray_cast_cb_filter().
|
static |
Definition at line 334 of file editmesh_bvh.cc.
References bmbvh_ray_cast_cb(), RayCastUserData_Filter::bmcb_data, RayCastUserData_Filter::filter_cb, RayCastUserData_Filter::filter_userdata, and RayCastUserData::looptris.
Referenced by BKE_bmbvh_ray_cast_filter().
|
static |
Definition at line 221 of file editmesh_bvh.cc.
References BMBVH_RETURN_ORIG, BMVert::co, copy_v3_v3(), BMBVHTree::flag, interp_v3_v3v3v3_uv(), BMBVHTree::looptris, RayCastUserData::uv, and v.
Referenced by BKE_bmbvh_ray_cast(), and BKE_bmbvh_ray_cast_filter().
|
static |
Return the coords from a triangle.
Definition at line 191 of file editmesh_bvh.cc.
References BM_elem_index_get, cos(), and v.
Referenced by bmbvh_find_face_closest_cb(), bmbvh_find_vert_closest_cb(), and bmbvh_ray_cast_cb().