Blender V4.3
editmesh_bvh.cc File Reference
#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

BMBVHTreeBKE_bmbvh_new_from_editmesh (BMEditMesh *em, int flag, const blender::float3 *cos_cage, const bool cos_cage_free)
 
BMBVHTreeBKE_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 *)
 
BMBVHTreeBKE_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)
 
BVHTreeBKE_bmbvh_tree_get (BMBVHTree *bmtree)
 
static void bmbvh_tri_from_face (const float *cos[3], const std::array< BMLoop *, 3 > &ltri, const blender::float3 *cos_cage)
 
static BMFacebmbvh_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)
 
BMFaceBKE_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)
 
BMFaceBKE_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)
 
BMVertBKE_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)
 
BMFaceBKE_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)
 
BVHTreeOverlapBKE_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)
 
BVHTreeOverlapBKE_bmbvh_overlap_self (const BMBVHTree *bmtree, uint *r_overlap_tot)
 

Function Documentation

◆ BKE_bmbvh_find_face_closest()

◆ BKE_bmbvh_find_vert_closest()

◆ BKE_bmbvh_free()

◆ BKE_bmbvh_new()

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 )

◆ BKE_bmbvh_new_ex()

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 )

◆ BKE_bmbvh_new_from_editmesh()

BMBVHTree * BKE_bmbvh_new_from_editmesh ( BMEditMesh * em,
int flag,
const blender::float3 * cos_cage,
const bool cos_cage_free )

◆ BKE_bmbvh_overlap()

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.

◆ BKE_bmbvh_overlap_self()

BVHTreeOverlap * BKE_bmbvh_overlap_self ( const BMBVHTree * bmtree,
unsigned int * r_overlap_tot )

◆ BKE_bmbvh_ray_cast()

◆ BKE_bmbvh_ray_cast_filter()

◆ BKE_bmbvh_tree_get()

BVHTree * BKE_bmbvh_tree_get ( BMBVHTree * bmtree)

Definition at line 180 of file editmesh_bvh.cc.

References BMBVHTree::tree.

◆ bm_face_is_not_hidden()

static bool bm_face_is_not_hidden ( BMFace * f,
void *  )
static

Definition at line 141 of file editmesh_bvh.cc.

References BM_elem_flag_test, and BM_ELEM_HIDDEN.

Referenced by BKE_bmbvh_new().

◆ bm_face_is_select()

static bool bm_face_is_select ( BMFace * f,
void *  )
static

Definition at line 136 of file editmesh_bvh.cc.

References BM_elem_flag_test, and BM_ELEM_SELECT.

Referenced by BKE_bmbvh_new().

◆ bmbvh_find_face_closest_cb()

static void bmbvh_find_face_closest_cb ( void * userdata,
int index,
const float co[3],
BVHTreeNearest * hit )
static

◆ bmbvh_find_vert_closest_cb()

static void bmbvh_find_vert_closest_cb ( void * userdata,
int index,
const float co[3],
BVHTreeNearest * hit )
static

◆ bmbvh_overlap_cb()

static bool bmbvh_overlap_cb ( void * userdata,
int index_a,
int index_b,
int  )
static

◆ bmbvh_overlap_self_cb()

static bool bmbvh_overlap_self_cb ( void * userdata,
int index_a,
int index_b,
int thread )
static

Definition at line 568 of file editmesh_bvh.cc.

References bmbvh_overlap_cb().

Referenced by BKE_bmbvh_overlap_self().

◆ bmbvh_ray_cast_cb()

◆ bmbvh_ray_cast_cb_filter()

static void bmbvh_ray_cast_cb_filter ( void * userdata,
int index,
const BVHTreeRay * ray,
BVHTreeRayHit * hit )
static

◆ bmbvh_ray_cast_handle_hit()

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

◆ bmbvh_tri_from_face()

static void bmbvh_tri_from_face ( const float * cos[3],
const std::array< BMLoop *, 3 > & ltri,
const blender::float3 * cos_cage )
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().