Blender  V3.3
Classes | Macros | Typedefs | Enumerations | Functions
pbvh.c File Reference
#include "MEM_guardedalloc.h"
#include "BLI_utildefines.h"
#include "BLI_bitmap.h"
#include "BLI_ghash.h"
#include "BLI_math.h"
#include "BLI_rand.h"
#include "BLI_task.h"
#include "DNA_mesh_types.h"
#include "DNA_meshdata_types.h"
#include "BKE_attribute.h"
#include "BKE_ccg.h"
#include "BKE_mesh.h"
#include "BKE_mesh_mapping.h"
#include "BKE_paint.h"
#include "BKE_pbvh.h"
#include "BKE_subdiv_ccg.h"
#include "PIL_time.h"
#include "GPU_buffers.h"
#include "bmesh.h"
#include "atomic_ops.h"
#include "pbvh_intern.h"
#include <limits.h>

Go to the source code of this file.

Classes

struct  PBVHStack
 
struct  PBVHIter
 
struct  node_tree
 
struct  PBVHUpdateData
 
struct  RaycastData
 
struct  FindNearestRayData
 
struct  PBVHDrawSearchData
 

Macros

#define LEAF_LIMIT   10000
 
#define STACK_FIXED_DEPTH   100
 

Typedefs

typedef struct PBVHStack PBVHStack
 
typedef struct PBVHIter PBVHIter
 
typedef struct node_tree node_tree
 
typedef struct PBVHUpdateData PBVHUpdateData
 
typedef struct PBVHDrawSearchData PBVHDrawSearchData
 

Enumerations

enum  PlaneAABBIsect { ISECT_INSIDE , ISECT_OUTSIDE , ISECT_INTERSECT }
 

Functions

void BB_reset (BB *bb)
 
void BB_expand (BB *bb, const float co[3])
 
void BB_expand_with_bb (BB *bb, BB *bb2)
 
int BB_widest_axis (const BB *bb)
 
void BBC_update_centroid (BBC *bbc)
 
static void update_node_vb (PBVH *pbvh, PBVHNode *node)
 
static bool face_materials_match (const MPoly *f1, const MPoly *f2)
 
static bool grid_materials_match (const DMFlagMat *f1, const DMFlagMat *f2)
 
static int partition_indices (int *prim_indices, int lo, int hi, int axis, float mid, BBC *prim_bbc)
 
static int partition_indices_material (PBVH *pbvh, int lo, int hi)
 
void pbvh_grow_nodes (PBVH *pbvh, int totnode)
 
static int map_insert_vert (PBVH *pbvh, GHash *map, unsigned int *face_verts, unsigned int *uniq_verts, int vertex)
 
static void build_mesh_leaf_node (PBVH *pbvh, PBVHNode *node)
 
static void update_vb (PBVH *pbvh, PBVHNode *node, BBC *prim_bbc, int offset, int count)
 
int BKE_pbvh_count_grid_quads (BLI_bitmap **grid_hidden, const int *grid_indices, int totgrid, int gridsize)
 
void BKE_pbvh_sync_face_sets_to_grids (PBVH *pbvh)
 
static void build_grid_leaf_node (PBVH *pbvh, PBVHNode *node)
 
static void build_leaf (PBVH *pbvh, int node_index, BBC *prim_bbc, int offset, int count)
 
static bool leaf_needs_material_split (PBVH *pbvh, int offset, int count)
 
static void build_sub (PBVH *pbvh, int node_index, BB *cb, BBC *prim_bbc, int offset, int count)
 
static void pbvh_build (PBVH *pbvh, BB *cb, BBC *prim_bbc, int totprim)
 
void BKE_pbvh_build_mesh (PBVH *pbvh, Mesh *mesh, const MPoly *mpoly, const MLoop *mloop, MVert *verts, int totvert, struct CustomData *vdata, struct CustomData *ldata, struct CustomData *pdata, const MLoopTri *looptri, int looptri_num)
 
void BKE_pbvh_build_grids (PBVH *pbvh, CCGElem **grids, int totgrid, CCGKey *key, void **gridfaces, DMFlagMat *flagmats, BLI_bitmap **grid_hidden)
 
PBVHBKE_pbvh_new (void)
 
void BKE_pbvh_free (PBVH *pbvh)
 
static void pbvh_iter_begin (PBVHIter *iter, PBVH *pbvh, BKE_pbvh_SearchCallback scb, void *search_data)
 
static void pbvh_iter_end (PBVHIter *iter)
 
static void pbvh_stack_push (PBVHIter *iter, PBVHNode *node, bool revisiting)
 
static PBVHNodepbvh_iter_next (PBVHIter *iter)
 
static PBVHNodepbvh_iter_next_occluded (PBVHIter *iter)
 
void BKE_pbvh_search_gather (PBVH *pbvh, BKE_pbvh_SearchCallback scb, void *search_data, PBVHNode ***r_array, int *r_tot)
 
void BKE_pbvh_search_callback (PBVH *pbvh, BKE_pbvh_SearchCallback scb, void *search_data, BKE_pbvh_HitCallback hcb, void *hit_data)
 
static void node_tree_insert (node_tree *tree, node_tree *new_node)
 
static void traverse_tree (node_tree *tree, BKE_pbvh_HitOccludedCallback hcb, void *hit_data, float *tmin)
 
static void free_tree (node_tree *tree)
 
float BKE_pbvh_node_get_tmin (PBVHNode *node)
 
static void BKE_pbvh_search_callback_occluded (PBVH *pbvh, BKE_pbvh_SearchCallback scb, void *search_data, BKE_pbvh_HitOccludedCallback hcb, void *hit_data)
 
static bool update_search_cb (PBVHNode *node, void *data_v)
 
static void pbvh_update_normals_clear_task_cb (void *__restrict userdata, const int n, const TaskParallelTLS *__restrict UNUSED(tls))
 
static void pbvh_update_normals_accum_task_cb (void *__restrict userdata, const int n, const TaskParallelTLS *__restrict UNUSED(tls))
 
static void pbvh_update_normals_store_task_cb (void *__restrict userdata, const int n, const TaskParallelTLS *__restrict UNUSED(tls))
 
static void pbvh_faces_update_normals (PBVH *pbvh, PBVHNode **nodes, int totnode)
 
static void pbvh_update_mask_redraw_task_cb (void *__restrict userdata, const int n, const TaskParallelTLS *__restrict UNUSED(tls))
 
static void pbvh_update_mask_redraw (PBVH *pbvh, PBVHNode **nodes, int totnode, int flag)
 
static void pbvh_update_visibility_redraw_task_cb (void *__restrict userdata, const int n, const TaskParallelTLS *__restrict UNUSED(tls))
 
static void pbvh_update_visibility_redraw (PBVH *pbvh, PBVHNode **nodes, int totnode, int flag)
 
static void pbvh_update_BB_redraw_task_cb (void *__restrict userdata, const int n, const TaskParallelTLS *__restrict UNUSED(tls))
 
void pbvh_update_BB_redraw (PBVH *pbvh, PBVHNode **nodes, int totnode, int flag)
 
static int pbvh_get_buffers_update_flags (PBVH *UNUSED(pbvh))
 
bool BKE_pbvh_get_color_layer (const Mesh *me, CustomDataLayer **r_layer, eAttrDomain *r_attr)
 
static void pbvh_update_draw_buffer_cb (void *__restrict userdata, const int n, const TaskParallelTLS *__restrict UNUSED(tls))
 
void pbvh_free_draw_buffers (PBVH *pbvh, PBVHNode *node)
 
static void pbvh_check_draw_layout (PBVH *pbvh)
 
static void pbvh_update_draw_buffers (PBVH *pbvh, PBVHNode **nodes, int totnode, int update_flag)
 
static int pbvh_flush_bb (PBVH *pbvh, PBVHNode *node, int flag)
 
void BKE_pbvh_update_bounds (PBVH *pbvh, int flag)
 
void BKE_pbvh_update_vertex_data (PBVH *pbvh, int flag)
 
static void pbvh_faces_node_visibility_update (PBVH *pbvh, PBVHNode *node)
 
static void pbvh_grids_node_visibility_update (PBVH *pbvh, PBVHNode *node)
 
static void pbvh_bmesh_node_visibility_update (PBVHNode *node)
 
static void pbvh_update_visibility_task_cb (void *__restrict userdata, const int n, const TaskParallelTLS *__restrict UNUSED(tls))
 
static void pbvh_update_visibility (PBVH *pbvh, PBVHNode **nodes, int totnode)
 
void BKE_pbvh_update_visibility (PBVH *pbvh)
 
void BKE_pbvh_redraw_BB (PBVH *pbvh, float bb_min[3], float bb_max[3])
 
void BKE_pbvh_get_grid_updates (PBVH *pbvh, bool clear, void ***r_gridfaces, int *r_totface)
 
PBVHType BKE_pbvh_type (const PBVH *pbvh)
 
bool BKE_pbvh_has_faces (const PBVH *pbvh)
 
void BKE_pbvh_bounding_box (const PBVH *pbvh, float min[3], float max[3])
 
BLI_bitmap ** BKE_pbvh_grid_hidden (const PBVH *pbvh)
 
const CCGKeyBKE_pbvh_get_grid_key (const PBVH *pbvh)
 
struct CCGElem ** BKE_pbvh_get_grids (const PBVH *pbvh)
 
BLI_bitmap ** BKE_pbvh_get_grid_visibility (const PBVH *pbvh)
 
int BKE_pbvh_get_grid_num_vertices (const PBVH *pbvh)
 
int BKE_pbvh_get_grid_num_faces (const PBVH *pbvh)
 
BMeshBKE_pbvh_get_bmesh (PBVH *pbvh)
 
void BKE_pbvh_node_mark_update (PBVHNode *node)
 
void BKE_pbvh_node_mark_update_mask (PBVHNode *node)
 
void BKE_pbvh_node_mark_update_color (PBVHNode *node)
 
void BKE_pbvh_mark_rebuild_pixels (PBVH *pbvh)
 
void BKE_pbvh_node_mark_update_visibility (PBVHNode *node)
 
void BKE_pbvh_node_mark_rebuild_draw (PBVHNode *node)
 
void BKE_pbvh_node_mark_redraw (PBVHNode *node)
 
void BKE_pbvh_node_mark_normals_update (PBVHNode *node)
 
void BKE_pbvh_node_fully_hidden_set (PBVHNode *node, int fully_hidden)
 
bool BKE_pbvh_node_fully_hidden_get (PBVHNode *node)
 
void BKE_pbvh_node_fully_masked_set (PBVHNode *node, int fully_masked)
 
bool BKE_pbvh_node_fully_masked_get (PBVHNode *node)
 
void BKE_pbvh_node_fully_unmasked_set (PBVHNode *node, int fully_masked)
 
bool BKE_pbvh_node_fully_unmasked_get (PBVHNode *node)
 
void BKE_pbvh_vert_tag_update_normal (PBVH *pbvh, int index)
 
void BKE_pbvh_node_get_loops (PBVH *pbvh, PBVHNode *node, const int **r_loop_indices, const MLoop **r_loops)
 
void BKE_pbvh_node_get_verts (PBVH *pbvh, PBVHNode *node, const int **r_vert_indices, MVert **r_verts)
 
void BKE_pbvh_node_num_verts (PBVH *pbvh, PBVHNode *node, int *r_uniquevert, int *r_totvert)
 
void BKE_pbvh_node_get_grids (PBVH *pbvh, PBVHNode *node, int **r_grid_indices, int *r_totgrid, int *r_maxgrid, int *r_gridsize, CCGElem ***r_griddata)
 
void BKE_pbvh_node_get_BB (PBVHNode *node, float bb_min[3], float bb_max[3])
 
void BKE_pbvh_node_get_original_BB (PBVHNode *node, float bb_min[3], float bb_max[3])
 
void BKE_pbvh_node_get_proxies (PBVHNode *node, PBVHProxyNode **proxies, int *proxy_count)
 
void BKE_pbvh_node_get_bm_orco_data (PBVHNode *node, int(**r_orco_tris)[3], int *r_orco_tris_num, float(**r_orco_coords)[3])
 
bool BKE_pbvh_node_has_vert_with_normal_update_tag (PBVH *pbvh, PBVHNode *node)
 
static bool ray_aabb_intersect (PBVHNode *node, void *data_v)
 
void BKE_pbvh_raycast (PBVH *pbvh, BKE_pbvh_HitOccludedCallback cb, void *data, const float ray_start[3], const float ray_normal[3], bool original)
 
bool ray_face_intersection_quad (const float ray_start[3], struct IsectRayPrecalc *isect_precalc, const float t0[3], const float t1[3], const float t2[3], const float t3[3], float *depth)
 
bool ray_face_intersection_tri (const float ray_start[3], struct IsectRayPrecalc *isect_precalc, const float t0[3], const float t1[3], const float t2[3], float *depth)
 
static float dist_squared_ray_to_tri_v3_fast (const float ray_origin[3], const float ray_direction[3], const float v0[3], const float v1[3], const float v2[3], float r_point[3], float *r_depth)
 
bool ray_face_nearest_quad (const float ray_start[3], const float ray_normal[3], const float t0[3], const float t1[3], const float t2[3], const float t3[3], float *depth, float *dist_sq)
 
bool ray_face_nearest_tri (const float ray_start[3], const float ray_normal[3], const float t0[3], const float t1[3], const float t2[3], float *depth, float *dist_sq)
 
static bool pbvh_faces_node_raycast (PBVH *pbvh, const PBVHNode *node, float(*origco)[3], const float ray_start[3], const float ray_normal[3], struct IsectRayPrecalc *isect_precalc, float *depth, int *r_active_vertex_index, int *r_active_face_index, float *r_face_normal)
 
static bool pbvh_grids_node_raycast (PBVH *pbvh, PBVHNode *node, float(*origco)[3], const float ray_start[3], const float ray_normal[3], struct IsectRayPrecalc *isect_precalc, float *depth, int *r_active_vertex_index, int *r_active_grid_index, float *r_face_normal)
 
bool BKE_pbvh_node_raycast (PBVH *pbvh, PBVHNode *node, float(*origco)[3], bool use_origco, const float ray_start[3], const float ray_normal[3], struct IsectRayPrecalc *isect_precalc, float *depth, int *active_vertex_index, int *active_face_grid_index, float *face_normal)
 
void BKE_pbvh_raycast_project_ray_root (PBVH *pbvh, bool original, float ray_start[3], float ray_end[3], float ray_normal[3])
 
static bool nearest_to_ray_aabb_dist_sq (PBVHNode *node, void *data_v)
 
void BKE_pbvh_find_nearest_to_ray (PBVH *pbvh, BKE_pbvh_SearchNearestCallback cb, void *data, const float ray_start[3], const float ray_normal[3], bool original)
 
static bool pbvh_faces_node_nearest_to_ray (PBVH *pbvh, const PBVHNode *node, float(*origco)[3], const float ray_start[3], const float ray_normal[3], float *depth, float *dist_sq)
 
static bool pbvh_grids_node_nearest_to_ray (PBVH *pbvh, PBVHNode *node, float(*origco)[3], const float ray_start[3], const float ray_normal[3], float *depth, float *dist_sq)
 
bool BKE_pbvh_node_find_nearest_to_ray (PBVH *pbvh, PBVHNode *node, float(*origco)[3], bool use_origco, const float ray_start[3], const float ray_normal[3], float *depth, float *dist_sq)
 
static PlaneAABBIsect test_frustum_aabb (const float bb_min[3], const float bb_max[3], PBVHFrustumPlanes *frustum)
 
bool BKE_pbvh_node_frustum_contain_AABB (PBVHNode *node, void *data)
 
bool BKE_pbvh_node_frustum_exclude_AABB (PBVHNode *node, void *data)
 
void BKE_pbvh_update_normals (PBVH *pbvh, struct SubdivCCG *subdiv_ccg)
 
void BKE_pbvh_face_sets_color_set (PBVH *pbvh, int seed, int color_default)
 
static bool pbvh_draw_search_cb (PBVHNode *node, void *data_v)
 
void BKE_pbvh_draw_cb (PBVH *pbvh, bool update_only_visible, PBVHFrustumPlanes *update_frustum, PBVHFrustumPlanes *draw_frustum, void(*draw_fn)(void *user_data, GPU_PBVH_Buffers *buffers), void *user_data, bool UNUSED(full_render))
 
void BKE_pbvh_draw_debug_cb (PBVH *pbvh, void(*draw_fn)(void *user_data, const float bmin[3], const float bmax[3], PBVHNodeFlags flag), void *user_data)
 
void BKE_pbvh_grids_update (PBVH *pbvh, CCGElem **grids, void **gridfaces, DMFlagMat *flagmats, BLI_bitmap **grid_hidden)
 
float(* BKE_pbvh_vert_coords_alloc (PBVH *pbvh))[3]
 
void BKE_pbvh_vert_coords_apply (PBVH *pbvh, const float(*vertCos)[3], const int totvert)
 
bool BKE_pbvh_is_deformed (PBVH *pbvh)
 
PBVHProxyNodeBKE_pbvh_node_add_proxy (PBVH *pbvh, PBVHNode *node)
 
void BKE_pbvh_node_free_proxies (PBVHNode *node)
 
void BKE_pbvh_gather_proxies (PBVH *pbvh, PBVHNode ***r_array, int *r_tot)
 
PBVHColorBufferNodeBKE_pbvh_node_color_buffer_get (PBVHNode *node)
 
void BKE_pbvh_node_color_buffer_free (PBVH *pbvh)
 
void pbvh_vertex_iter_init (PBVH *pbvh, PBVHNode *node, PBVHVertexIter *vi, int mode)
 
bool pbvh_has_mask (const PBVH *pbvh)
 
bool pbvh_has_face_sets (PBVH *pbvh)
 
void pbvh_show_mask_set (PBVH *pbvh, bool show_mask)
 
void pbvh_show_face_sets_set (PBVH *pbvh, bool show_face_sets)
 
void BKE_pbvh_set_frustum_planes (PBVH *pbvh, PBVHFrustumPlanes *planes)
 
void BKE_pbvh_get_frustum_planes (PBVH *pbvh, PBVHFrustumPlanes *planes)
 
void BKE_pbvh_parallel_range_settings (TaskParallelSettings *settings, bool use_threading, int totnode)
 
MVertBKE_pbvh_get_verts (const PBVH *pbvh)
 
const float(* BKE_pbvh_get_vert_normals (const PBVH *pbvh))[3]
 
void BKE_pbvh_subdiv_cgg_set (PBVH *pbvh, SubdivCCG *subdiv_ccg)
 
void BKE_pbvh_face_sets_set (PBVH *pbvh, int *face_sets)
 
void BKE_pbvh_respect_hide_set (PBVH *pbvh, bool respect_hide)
 
bool BKE_pbvh_is_drawing (const PBVH *pbvh)
 
bool BKE_pbvh_draw_cache_invalid (const PBVH *pbvh)
 
void BKE_pbvh_is_drawing_set (PBVH *pbvh, bool val)
 
void BKE_pbvh_node_num_loops (PBVH *pbvh, PBVHNode *node, int *r_totloop)
 
void BKE_pbvh_update_active_vcol (PBVH *pbvh, const Mesh *mesh)
 
void BKE_pbvh_pmap_set (PBVH *pbvh, const MeshElemMap *pmap)
 
void BKE_pbvh_ensure_node_loops (PBVH *pbvh)
 

Macro Definition Documentation

◆ LEAF_LIMIT

#define LEAF_LIMIT   10000

Definition at line 40 of file pbvh.c.

◆ STACK_FIXED_DEPTH

#define STACK_FIXED_DEPTH   100

Definition at line 44 of file pbvh.c.

Typedef Documentation

◆ node_tree

typedef struct node_tree node_tree

◆ PBVHDrawSearchData

PBVH drawing, updating draw buffers as needed and culling any nodes outside the specified frustum.

◆ PBVHIter

typedef struct PBVHIter PBVHIter

◆ PBVHStack

typedef struct PBVHStack PBVHStack

◆ PBVHUpdateData

Enumeration Type Documentation

◆ PlaneAABBIsect

Enumerator
ISECT_INSIDE 
ISECT_OUTSIDE 
ISECT_INTERSECT 

Definition at line 2750 of file pbvh.c.

Function Documentation

◆ BB_expand()

void BB_expand ( BB bb,
const float  co[3] 
)

◆ BB_expand_with_bb()

void BB_expand_with_bb ( BB bb,
BB bb2 
)

Expand the bounding box to include another bounding box.

Definition at line 77 of file pbvh.c.

References BB::bmax, BB::bmin, max_ff(), and min_ff().

Referenced by BKE_pbvh_redraw_BB(), pbvh_bmesh_create_nodes_fast_recursive(), pbvh_bmesh_node_split(), update_node_vb(), and update_vb().

◆ BB_reset()

void BB_reset ( BB bb)

◆ BB_widest_axis()

int BB_widest_axis ( const BB bb)

Return 0, 1, or 2 to indicate the widest axis of the bounding box.

Definition at line 85 of file pbvh.c.

References BB::bmax, and BB::bmin.

Referenced by build_sub(), pbvh_bmesh_node_limit_ensure_fast(), and pbvh_bmesh_node_split().

◆ BBC_update_centroid()

void BBC_update_centroid ( BBC bbc)

◆ BKE_pbvh_bounding_box()

void BKE_pbvh_bounding_box ( const PBVH pbvh,
float  min[3],
float  max[3] 
)

Get the PBVH root's bounding box.

Definition at line 1812 of file pbvh.c.

References BB::bmax, BB::bmin, copy_v3_v3(), max, min, PBVH::nodes, PBVH::totnode, PBVHNode::vb, and zero_v3().

Referenced by sculpt_detail_flood_fill_exec(), and SCULPT_update_object_bounding_box().

◆ BKE_pbvh_build_grids()

void BKE_pbvh_build_grids ( PBVH pbvh,
struct CCGElem **  grids,
int  totgrid,
struct CCGKey key,
void **  gridfaces,
struct DMFlagMat flagmats,
unsigned int **  grid_hidden 
)

◆ BKE_pbvh_build_mesh()

void BKE_pbvh_build_mesh ( PBVH pbvh,
Mesh mesh,
const MPoly mpoly,
const MLoop mloop,
MVert verts,
int  totvert,
struct CustomData vdata,
struct CustomData ldata,
struct CustomData pdata,
const MLoopTri looptri,
int  looptri_num 
)

◆ BKE_pbvh_count_grid_quads()

int BKE_pbvh_count_grid_quads ( BLI_bitmap **  grid_hidden,
const int *  grid_indices,
int  totgrid,
int  gridsize 
)

Returns the number of visible quads in the nodes' grids.

Definition at line 339 of file pbvh.c.

References paint_is_grid_face_hidden(), x, and y.

Referenced by build_grid_leaf_node(), and GPU_pbvh_grid_buffers_update().

◆ BKE_pbvh_draw_cache_invalid()

bool BKE_pbvh_draw_cache_invalid ( const PBVH pbvh)

Definition at line 3250 of file pbvh.c.

References PBVH::draw_cache_invalid.

Referenced by mesh_batch_cache_valid().

◆ BKE_pbvh_draw_cb()

void BKE_pbvh_draw_cb ( PBVH pbvh,
bool  update_only_visible,
PBVHFrustumPlanes update_frustum,
PBVHFrustumPlanes draw_frustum,
void(*)(void *user_data, GPU_PBVH_Buffers *buffers)  draw_fn,
void user_data,
bool   UNUSEDfull_render 
)

◆ BKE_pbvh_draw_debug_cb()

void BKE_pbvh_draw_debug_cb ( PBVH pbvh,
void(*)(void *user_data, const float bmin[3], const float bmax[3], PBVHNodeFlags flag)  draw_fn,
void user_data 
)

Definition at line 2920 of file pbvh.c.

References Freestyle::a, node, PBVH::nodes, PBVH::totnode, and user_data.

Referenced by drw_sculpt_generate_calls().

◆ BKE_pbvh_ensure_node_loops()

void BKE_pbvh_ensure_node_loops ( PBVH pbvh)

◆ BKE_pbvh_face_sets_color_set()

void BKE_pbvh_face_sets_color_set ( PBVH pbvh,
int  seed,
int  color_default 
)

◆ BKE_pbvh_face_sets_set()

void BKE_pbvh_face_sets_set ( PBVH pbvh,
int *  face_sets 
)

Definition at line 3236 of file pbvh.c.

References PBVH::face_sets.

Referenced by sculpt_update_object().

◆ BKE_pbvh_find_nearest_to_ray()

void BKE_pbvh_find_nearest_to_ray ( PBVH pbvh,
BKE_pbvh_SearchNearestCallback  cb,
void data,
const float  ray_start[3],
const float  ray_normal[3],
bool  original 
)

◆ BKE_pbvh_free()

void BKE_pbvh_free ( PBVH pbvh)

◆ BKE_pbvh_gather_proxies()

void BKE_pbvh_gather_proxies ( PBVH pbvh,
PBVHNode ***  r_array,
int *  r_tot 
)

◆ BKE_pbvh_get_bmesh()

BMesh* BKE_pbvh_get_bmesh ( PBVH pbvh)

◆ BKE_pbvh_get_color_layer()

bool BKE_pbvh_get_color_layer ( const Mesh me,
CustomDataLayer **  r_layer,
eAttrDomain r_attr 
)

◆ BKE_pbvh_get_frustum_planes()

void BKE_pbvh_get_frustum_planes ( PBVH pbvh,
PBVHFrustumPlanes planes 
)

◆ BKE_pbvh_get_grid_key()

const CCGKey* BKE_pbvh_get_grid_key ( const PBVH pbvh)

◆ BKE_pbvh_get_grid_num_faces()

int BKE_pbvh_get_grid_num_faces ( const PBVH pbvh)

Definition at line 1855 of file pbvh.c.

References BLI_assert, CCGKey::grid_size, PBVH::gridkey, PBVH_GRIDS, PBVH::totgrid, and PBVH::type.

Referenced by stats_object_sculpt().

◆ BKE_pbvh_get_grid_num_vertices()

int BKE_pbvh_get_grid_num_vertices ( const PBVH pbvh)

◆ BKE_pbvh_get_grid_updates()

void BKE_pbvh_get_grid_updates ( PBVH pbvh,
bool  clear,
void ***  r_gridfaces,
int *  r_totface 
)

◆ BKE_pbvh_get_grid_visibility()

BLI_bitmap** BKE_pbvh_get_grid_visibility ( const PBVH pbvh)

Definition at line 1843 of file pbvh.c.

References BLI_assert, PBVH::grid_hidden, PBVH_GRIDS, and PBVH::type.

Referenced by SCULPT_vertex_visible_get().

◆ BKE_pbvh_get_grids()

struct CCGElem** BKE_pbvh_get_grids ( const PBVH pbvh)

◆ BKE_pbvh_get_vert_normals()

const float(* BKE_pbvh_get_vert_normals ( const PBVH pbvh) )[3]

Definition at line 3225 of file pbvh.c.

References BLI_assert, PBVH_FACES, PBVH::type, and PBVH::vert_normals.

Referenced by SCULPT_vertex_normal_get().

◆ BKE_pbvh_get_verts()

MVert* BKE_pbvh_get_verts ( const PBVH pbvh)

◆ BKE_pbvh_grid_hidden()

BLI_bitmap** BKE_pbvh_grid_hidden ( const PBVH pbvh)

Multi-res hidden data, only valid for type == PBVH_GRIDS.

Definition at line 1825 of file pbvh.c.

References BLI_assert, PBVH::grid_hidden, PBVH_GRIDS, and PBVH::type.

Referenced by partialvis_update_grids(), pbvh_grids_node_visibility_update(), and sculpt_undo_alloc_and_store_hidden().

◆ BKE_pbvh_grids_update()

void BKE_pbvh_grids_update ( PBVH pbvh,
CCGElem **  grids,
void **  gridfaces,
DMFlagMat flagmats,
BLI_bitmap **  grid_hidden 
)

◆ BKE_pbvh_has_faces()

bool BKE_pbvh_has_faces ( const PBVH pbvh)

Definition at line 1803 of file pbvh.c.

References PBVH::bm, PBVH_BMESH, BMesh::totface, PBVH::totprim, and PBVH::type.

◆ BKE_pbvh_is_deformed()

bool BKE_pbvh_is_deformed ( PBVH pbvh)

Definition at line 3010 of file pbvh.c.

References PBVH::deformed.

Referenced by sculpt_update_object().

◆ BKE_pbvh_is_drawing()

bool BKE_pbvh_is_drawing ( const PBVH pbvh)

Definition at line 3245 of file pbvh.c.

References PBVH::is_drawing.

Referenced by mesh_batch_cache_init(), and mesh_batch_cache_valid().

◆ BKE_pbvh_is_drawing_set()

void BKE_pbvh_is_drawing_set ( PBVH pbvh,
bool  val 
)

Definition at line 3255 of file pbvh.c.

References PBVH::is_drawing.

Referenced by workbench_color_type_get().

◆ BKE_pbvh_mark_rebuild_pixels()

void BKE_pbvh_mark_rebuild_pixels ( PBVH pbvh)

Definition at line 1885 of file pbvh.c.

References node, PBVH::nodes, PBVH_Leaf, PBVH_RebuildPixels, and PBVH::totnode.

Referenced by sculpt_update_object().

◆ BKE_pbvh_new()

PBVH* BKE_pbvh_new ( void  )

◆ BKE_pbvh_node_add_proxy()

PBVHProxyNode* BKE_pbvh_node_add_proxy ( PBVH pbvh,
PBVHNode node 
)

◆ BKE_pbvh_node_color_buffer_free()

void BKE_pbvh_node_color_buffer_free ( PBVH pbvh)

Definition at line 3088 of file pbvh.c.

References BKE_pbvh_search_gather(), MEM_SAFE_FREE, and NULL.

Referenced by paint_mesh_restore_co(), and sculpt_stroke_done().

◆ BKE_pbvh_node_color_buffer_get()

PBVHColorBufferNode* BKE_pbvh_node_color_buffer_get ( PBVHNode node)

Definition at line 3079 of file pbvh.c.

References MEM_callocN, and node.

Referenced by do_paint_brush_task_cb_ex().

◆ BKE_pbvh_node_find_nearest_to_ray()

bool BKE_pbvh_node_find_nearest_to_ray ( PBVH pbvh,
PBVHNode node,
float(*)  origco[3],
bool  use_origco,
const float  ray_start[3],
const float  ray_normal[3],
float depth,
float dist_sq 
)

◆ BKE_pbvh_node_free_proxies()

void BKE_pbvh_node_free_proxies ( PBVHNode node)

Definition at line 3037 of file pbvh.c.

References MEM_freeN, node, and NULL.

Referenced by sculpt_combine_proxies_task_cb().

◆ BKE_pbvh_node_frustum_contain_AABB()

bool BKE_pbvh_node_frustum_contain_AABB ( PBVHNode node,
void frustum 
)

◆ BKE_pbvh_node_frustum_exclude_AABB()

bool BKE_pbvh_node_frustum_exclude_AABB ( PBVHNode node,
void frustum 
)

Test if AABB is at least partially outside the PBVHFrustumPlanes volume.

Definition at line 2803 of file pbvh.c.

References data, ISECT_INSIDE, node, and test_frustum_aabb().

Referenced by get_pbvh_nodes().

◆ BKE_pbvh_node_fully_hidden_get()

bool BKE_pbvh_node_fully_hidden_get ( PBVHNode node)

Definition at line 1928 of file pbvh.c.

References node, PBVH_FullyHidden, and PBVH_Leaf.

Referenced by SCULPT_search_sphere_cb().

◆ BKE_pbvh_node_fully_hidden_set()

void BKE_pbvh_node_fully_hidden_set ( PBVHNode node,
int  fully_hidden 
)

◆ BKE_pbvh_node_fully_masked_get()

bool BKE_pbvh_node_fully_masked_get ( PBVHNode node)

Definition at line 1945 of file pbvh.c.

References node, PBVH_FullyMasked, and PBVH_Leaf.

Referenced by SCULPT_search_circle_cb(), and SCULPT_search_sphere_cb().

◆ BKE_pbvh_node_fully_masked_set()

void BKE_pbvh_node_fully_masked_set ( PBVHNode node,
int  fully_masked 
)

Definition at line 1933 of file pbvh.c.

References BLI_assert, node, PBVH_FullyMasked, and PBVH_Leaf.

Referenced by pbvh_update_mask_redraw_task_cb().

◆ BKE_pbvh_node_fully_unmasked_get()

bool BKE_pbvh_node_fully_unmasked_get ( PBVHNode node)

Definition at line 1962 of file pbvh.c.

References node, PBVH_FullyUnmasked, and PBVH_Leaf.

◆ BKE_pbvh_node_fully_unmasked_set()

void BKE_pbvh_node_fully_unmasked_set ( PBVHNode node,
int  fully_masked 
)

Definition at line 1950 of file pbvh.c.

References BLI_assert, node, PBVH_FullyUnmasked, and PBVH_Leaf.

Referenced by pbvh_update_mask_redraw_task_cb().

◆ BKE_pbvh_node_get_BB()

void BKE_pbvh_node_get_BB ( PBVHNode node,
float  bb_min[3],
float  bb_max[3] 
)

Definition at line 2084 of file pbvh.c.

References copy_v3_v3(), and node.

Referenced by BKE_pbvh_raycast_project_ray_root(), SCULPT_search_circle_cb(), and SCULPT_search_sphere_cb().

◆ BKE_pbvh_node_get_bm_orco_data()

void BKE_pbvh_node_get_bm_orco_data ( PBVHNode node,
int(**)  r_orco_tris[3],
int *  r_orco_tris_num,
float(**)  r_orco_coords[3] 
)

Definition at line 2116 of file pbvh.c.

References node.

Referenced by calc_area_normal_and_center_task_cb().

◆ BKE_pbvh_node_get_grids()

void BKE_pbvh_node_get_grids ( PBVH pbvh,
PBVHNode node,
int **  r_grid_indices,
int *  r_totgrid,
int *  r_maxgrid,
int *  r_gridsize,
CCGElem ***  r_griddata 
)

◆ BKE_pbvh_node_get_loops()

void BKE_pbvh_node_get_loops ( PBVH pbvh,
PBVHNode node,
const int **  r_loop_indices,
const MLoop **  r_loops 
)

Definition at line 1973 of file pbvh.c.

References BKE_pbvh_type(), BLI_assert, PBVH::mloop, node, and PBVH_FACES.

◆ BKE_pbvh_node_get_original_BB()

void BKE_pbvh_node_get_original_BB ( PBVHNode node,
float  bb_min[3],
float  bb_max[3] 
)

Definition at line 2090 of file pbvh.c.

References copy_v3_v3(), and node.

Referenced by BKE_pbvh_raycast_project_ray_root(), SCULPT_search_circle_cb(), and SCULPT_search_sphere_cb().

◆ BKE_pbvh_node_get_proxies()

void BKE_pbvh_node_get_proxies ( PBVHNode node,
PBVHProxyNode **  proxies,
int *  proxy_count 
)

Definition at line 2096 of file pbvh.c.

References node, and NULL.

Referenced by sculpt_combine_proxies_task_cb().

◆ BKE_pbvh_node_get_tmin()

float BKE_pbvh_node_get_tmin ( PBVHNode node)

Definition at line 949 of file pbvh.c.

References node.

Referenced by sculpt_find_nearest_to_ray_cb(), sculpt_raycast_cb(), and sculpt_raycast_detail_cb().

◆ BKE_pbvh_node_get_verts()

void BKE_pbvh_node_get_verts ( PBVH pbvh,
PBVHNode node,
const int **  r_vert_indices,
MVert **  r_verts 
)

◆ BKE_pbvh_node_has_vert_with_normal_update_tag()

bool BKE_pbvh_node_has_vert_with_normal_update_tag ( PBVH pbvh,
PBVHNode node 
)
Note
doing a full search on all vertices here seems expensive, however this is important to avoid having to recalculate bound-box & sync the buffers to the GPU (which is far more expensive!) See: T47232.

Definition at line 2126 of file pbvh.c.

References BLI_assert, node, PBVH_FACES, PBVH::type, v, PBVH::vert_bitmap, and verts.

Referenced by update_cb_partial().

◆ BKE_pbvh_node_mark_normals_update()

void BKE_pbvh_node_mark_normals_update ( PBVHNode node)

Definition at line 1911 of file pbvh.c.

References node, and PBVH_UpdateNormals.

Referenced by mask_flood_fill_task_cb(), mask_gesture_apply_task_cb(), and SCULPT_filter_cache_init().

◆ BKE_pbvh_node_mark_rebuild_draw()

void BKE_pbvh_node_mark_rebuild_draw ( PBVHNode node)

◆ BKE_pbvh_node_mark_redraw()

void BKE_pbvh_node_mark_redraw ( PBVHNode node)

◆ BKE_pbvh_node_mark_update()

void BKE_pbvh_node_mark_update ( PBVHNode node)

◆ BKE_pbvh_node_mark_update_color()

void BKE_pbvh_node_mark_update_color ( PBVHNode node)

◆ BKE_pbvh_node_mark_update_mask()

void BKE_pbvh_node_mark_update_mask ( PBVHNode node)

◆ BKE_pbvh_node_mark_update_visibility()

void BKE_pbvh_node_mark_update_visibility ( PBVHNode node)

◆ BKE_pbvh_node_num_loops()

void BKE_pbvh_node_num_loops ( PBVH pbvh,
PBVHNode node,
int *  r_totloop 
)

Definition at line 3260 of file pbvh.c.

References BKE_pbvh_type(), BLI_assert, node, PBVH_FACES, and UNUSED_VARS.

Referenced by sculpt_undo_alloc_node(), and SCULPT_undo_push_node().

◆ BKE_pbvh_node_num_verts()

void BKE_pbvh_node_num_verts ( PBVH pbvh,
PBVHNode node,
int *  r_uniquevert,
int *  r_totvert 
)

◆ BKE_pbvh_node_raycast()

bool BKE_pbvh_node_raycast ( PBVH pbvh,
PBVHNode node,
float(*)  origco[3],
bool  use_origco,
const float  ray_start[3],
const float  ray_normal[3],
struct IsectRayPrecalc isect_precalc,
float depth,
int *  active_vertex_index,
int *  active_face_grid_index,
float face_normal 
)

◆ BKE_pbvh_parallel_range_settings()

void BKE_pbvh_parallel_range_settings ( TaskParallelSettings settings,
bool  use_threading,
int  totnode 
)

Definition at line 3211 of file pbvh.c.

References TaskParallelSettings::use_threading.

Referenced by calculate_average_weight(), cloth_brush_apply_brush_foces(), do_brush_action(), do_gravity(), mask_flood_fill_exec(), paint_mesh_restore_co(), pbvh_faces_update_normals(), pbvh_update_BB_redraw(), pbvh_update_draw_buffers(), pbvh_update_mask_redraw(), pbvh_update_visibility(), pbvh_update_visibility_redraw(), SCULPT_bmesh_topology_rake(), SCULPT_calc_area_center(), SCULPT_calc_area_normal_and_center(), SCULPT_cloth_brush_do_simulation_step(), SCULPT_cloth_brush_ensure_nodes_constraints(), sculpt_cloth_filter_modal(), sculpt_color_filter_modal(), sculpt_combine_proxies(), SCULPT_combine_transform_proxies(), sculpt_dirty_mask_exec(), SCULPT_do_boundary_brush(), SCULPT_do_clay_brush(), SCULPT_do_clay_strips_brush(), SCULPT_do_clay_thumb_brush(), SCULPT_do_crease_brush(), SCULPT_do_displacement_eraser_brush(), SCULPT_do_displacement_smear_brush(), SCULPT_do_draw_brush(), SCULPT_do_draw_face_sets_brush(), SCULPT_do_draw_sharp_brush(), SCULPT_do_elastic_deform_brush(), SCULPT_do_fill_brush(), SCULPT_do_flatten_brush(), SCULPT_do_grab_brush(), SCULPT_do_inflate_brush(), SCULPT_do_layer_brush(), SCULPT_do_mask_brush_draw(), SCULPT_do_multiplane_scrape_brush(), SCULPT_do_nudge_brush(), SCULPT_do_paint_brush(), SCULPT_do_paint_brush_image(), SCULPT_do_pinch_brush(), SCULPT_do_pose_brush(), SCULPT_do_rotate_brush(), SCULPT_do_scrape_brush(), SCULPT_do_slide_relax_brush(), SCULPT_do_smear_brush(), SCULPT_do_snake_hook_brush(), SCULPT_do_surface_smooth_brush(), SCULPT_do_thumb_brush(), SCULPT_enhance_details_brush(), sculpt_expand_update_for_vertex(), SCULPT_fake_neighbor_search(), SCULPT_filter_cache_init(), SCULPT_flush_stroke_deform(), sculpt_gesture_face_set_apply_for_symmetry_pass(), sculpt_gesture_mask_apply_for_symmetry_pass(), sculpt_gesture_project_apply_for_symmetry_pass(), sculpt_mask_by_color_contiguous(), sculpt_mask_by_color_full_mesh(), sculpt_mask_expand_invoke(), sculpt_mask_expand_modal(), sculpt_mask_filter_exec(), SCULPT_mask_filter_smooth_apply(), sculpt_mask_init_exec(), sculpt_mesh_filter_modal(), SCULPT_nearest_vertex_get(), SCULPT_pbvh_calc_area_normal(), SCULPT_pose_brush_init(), sculpt_pose_grow_pose_factor(), SCULPT_smooth(), sculpt_transform_all_vertices(), sculpt_transform_radius_elastic(), sculpt_undo_bmesh_restore_generic(), blender::bke::pbvh::pixels::update_pixels(), and wpaint_paint_leaves().

◆ BKE_pbvh_pmap_set()

void BKE_pbvh_pmap_set ( PBVH pbvh,
const MeshElemMap pmap 
)

Definition at line 3275 of file pbvh.c.

References PBVH::pmap.

◆ BKE_pbvh_raycast()

void BKE_pbvh_raycast ( PBVH pbvh,
BKE_pbvh_HitOccludedCallback  cb,
void data,
const float  ray_start[3],
const float  ray_normal[3],
bool  original 
)

◆ BKE_pbvh_raycast_project_ray_root()

void BKE_pbvh_raycast_project_ray_root ( PBVH pbvh,
bool  original,
float  ray_start[3],
float  ray_end[3],
float  ray_normal[3] 
)

For orthographic cameras, project the far away ray segment points to the root node so we can have better precision.

Definition at line 2516 of file pbvh.c.

References add_v3_v3(), BKE_pbvh_node_get_BB(), BKE_pbvh_node_get_original_BB(), isect_ray_aabb_v3(), isect_ray_aabb_v3_precalc(), madd_v3_v3v3fl(), mid_v3_v3v3(), mul_v3_v3fl(), PBVH::nodes, offset, and sub_v3_v3v3().

Referenced by SCULPT_raycast_init().

◆ BKE_pbvh_redraw_BB()

void BKE_pbvh_redraw_BB ( PBVH pbvh,
float  bb_min[3],
float  bb_max[3] 
)

◆ BKE_pbvh_respect_hide_set()

void BKE_pbvh_respect_hide_set ( PBVH pbvh,
bool  respect_hide 
)

Definition at line 3241 of file pbvh.c.

References PBVH::respect_hide.

Referenced by build_pbvh_from_ccg(), and build_pbvh_from_regular_mesh().

◆ BKE_pbvh_search_callback()

void BKE_pbvh_search_callback ( PBVH pbvh,
BKE_pbvh_SearchCallback  scb,
void search_data,
BKE_pbvh_HitCallback  hcb,
void hit_data 
)

Definition at line 871 of file pbvh.c.

References node, pbvh_iter_begin(), pbvh_iter_end(), pbvh_iter_next(), and PBVH_Leaf.

Referenced by sculpt_undo_restore_list().

◆ BKE_pbvh_search_callback_occluded()

static void BKE_pbvh_search_callback_occluded ( PBVH pbvh,
BKE_pbvh_SearchCallback  scb,
void search_data,
BKE_pbvh_HitOccludedCallback  hcb,
void hit_data 
)
static

◆ BKE_pbvh_search_gather()

void BKE_pbvh_search_gather ( PBVH pbvh,
BKE_pbvh_SearchCallback  scb,
void search_data,
PBVHNode ***  r_array,
int *  r_tot 
)

Definition at line 838 of file pbvh.c.

References MEM_freeN, MEM_recallocN_id, node, NULL, pbvh_iter_begin(), pbvh_iter_end(), pbvh_iter_next(), PBVH_Leaf, and UNLIKELY.

Referenced by BKE_pbvh_draw_cb(), BKE_pbvh_node_color_buffer_free(), BKE_pbvh_update_bounds(), BKE_pbvh_update_normals(), BKE_pbvh_update_vertex_data(), BKE_pbvh_update_visibility(), BKE_sculpt_update_object_before_eval(), cloth_sim_initialize_default_node_state(), do_brush_action(), get_pbvh_nodes(), mask_flood_fill_exec(), paint_mesh_restore_co(), SCULPT_cloth_brush_affected_nodes_gather(), sculpt_detail_flood_fill_exec(), sculpt_dirty_mask_exec(), sculpt_expand_finish(), sculpt_expand_invoke(), sculpt_expand_restore_color_data(), sculpt_expand_restore_face_set_data(), sculpt_expand_restore_mask_data(), sculpt_expand_undo_push(), sculpt_face_set_create_exec(), sculpt_face_set_edit_modify_coordinates(), sculpt_face_set_edit_modify_face_sets(), sculpt_face_set_init_exec(), sculpt_face_sets_change_visibility_exec(), sculpt_face_sets_randomize_colors_exec(), SCULPT_fake_neighbor_search(), SCULPT_filter_cache_init(), SCULPT_flush_stroke_deform(), sculpt_gesture_update_effected_nodes_by_clip_planes(), sculpt_gesture_update_effected_nodes_by_line_plane(), sculpt_mask_by_color_contiguous(), sculpt_mask_by_color_full_mesh(), sculpt_mask_expand_invoke(), sculpt_mask_filter_exec(), sculpt_mask_init_exec(), SCULPT_nearest_vertex_get(), sculpt_pbvh_gather_cursor_update(), sculpt_pbvh_gather_generic(), SCULPT_pose_brush_init(), sculpt_pose_grow_pose_factor(), sculpt_set_pivot_position_exec(), sculpt_undo_bmesh_restore_generic(), sculpt_undo_push_all_grids(), and vwpaint_pbvh_gather_generic().

◆ BKE_pbvh_set_frustum_planes()

void BKE_pbvh_set_frustum_planes ( PBVH pbvh,
PBVHFrustumPlanes planes 
)

◆ BKE_pbvh_subdiv_cgg_set()

void BKE_pbvh_subdiv_cgg_set ( PBVH pbvh,
SubdivCCG subdiv_ccg 
)

Definition at line 3231 of file pbvh.c.

References PBVH::subdiv_ccg.

Referenced by sculpt_update_object().

◆ BKE_pbvh_sync_face_sets_to_grids()

void BKE_pbvh_sync_face_sets_to_grids ( PBVH pbvh)

◆ BKE_pbvh_type()

PBVHType BKE_pbvh_type ( const PBVH pbvh)

Definition at line 1798 of file pbvh.c.

References PBVH::type.

Referenced by BKE_pbvh_ensure_node_loops(), BKE_pbvh_node_get_loops(), BKE_pbvh_node_num_loops(), BKE_sculpt_object_pbvh_ensure(), BKE_sculptsession_use_pbvh_draw(), calculate_average_color(), do_brush_action(), do_draw_face_sets_brush_task_cb_ex(), do_vpaint_brush_blur_loops(), do_vpaint_brush_blur_verts(), do_vpaint_brush_smear(), do_wpaint_brush_blur_task_cb_ex(), do_wpaint_brush_calc_average_weight_cb_ex(), do_wpaint_brush_draw_task_cb_ex(), do_wpaint_brush_smear_task_cb_ex(), face_set_edit_do_post_visibility_updates(), hide_show_exec(), mask_flood_fill_exec(), mask_gesture_apply_task_cb(), multires_flush_sculpt_updates(), multires_stitch_grids(), paint_cursor_sculpt_session_update_and_init(), pbvh_update_visibility_task_cb(), sample_detail(), SCULPT_active_face_set_get(), SCULPT_active_vertex_get(), sculpt_boundary_edit_data_init(), sculpt_color_filter_invoke(), sculpt_colors_poll(), SCULPT_cursor_geometry_info_update(), sculpt_expand_active_face_set_id_get(), sculpt_expand_diagonals_falloff_create(), sculpt_expand_falloff_factors_from_vertex_and_symm_create(), sculpt_expand_geodesics_from_state_boundary(), sculpt_expand_initialize_from_face_set_boundary(), sculpt_expand_invoke(), sculpt_expand_mesh_face_falloff_from_vertex_falloff(), sculpt_expand_resursion_step_add(), sculpt_expand_snap_initialize_from_enabled(), sculpt_face_set_create_exec(), sculpt_face_set_edit_is_operation_valid(), sculpt_face_set_init_exec(), SCULPT_face_set_next_available_get(), SCULPT_face_set_visibility_set(), sculpt_face_sets_automasking_init(), sculpt_face_sets_change_visibility_exec(), sculpt_face_sets_randomize_colors_exec(), SCULPT_face_sets_visibility_all_set(), SCULPT_face_sets_visibility_invert(), SCULPT_filter_cache_init(), sculpt_find_nearest_to_ray_cb(), SCULPT_flush_update_done(), SCULPT_geodesic_distances_create(), sculpt_geometry_preview_lines_draw(), SCULPT_geometry_preview_lines_update(), sculpt_gesture_mask_end(), SCULPT_handles_colors_report(), SCULPT_mesh_deformed_mverts_get(), sculpt_no_multires_poll(), sculpt_raycast_cb(), SCULPT_smooth(), SCULPT_stroke_get_location(), SCULPT_stroke_is_dynamic_topology(), sculpt_symmetrize_exec(), SCULPT_topology_automasking_init(), sculpt_topology_update(), sculpt_trim_gesture_box_exec(), sculpt_trim_gesture_lasso_exec(), sculpt_undo_restore_list(), sculpt_undo_store_color(), SCULPT_vertex_all_face_sets_visible_get(), SCULPT_vertex_any_face_set_visible_get(), SCULPT_vertex_co_get(), SCULPT_vertex_count_get(), SCULPT_vertex_face_set_get(), SCULPT_vertex_face_set_set(), SCULPT_vertex_has_face_set(), SCULPT_vertex_has_unique_face_set(), SCULPT_vertex_is_boundary(), SCULPT_vertex_limit_surface_get(), SCULPT_vertex_mask_get(), SCULPT_vertex_neighbors_get(), SCULPT_vertex_normal_get(), SCULPT_vertex_random_access_ensure(), SCULPT_vertex_visible_get(), SCULPT_vertex_visible_set(), SCULPT_visibility_sync_all_face_sets_to_vertices(), SCULPT_visibility_sync_all_vertex_to_face_sets(), stats_object_sculpt(), update_cb_partial(), vpaint_do_draw(), and workbench_color_type_get().

◆ BKE_pbvh_update_active_vcol()

void BKE_pbvh_update_active_vcol ( PBVH pbvh,
const Mesh mesh 
)

Definition at line 3270 of file pbvh.c.

References BKE_pbvh_get_color_layer(), PBVH::color_domain, PBVH::color_layer, and mesh.

Referenced by BKE_pbvh_build_mesh().

◆ BKE_pbvh_update_bounds()

void BKE_pbvh_update_bounds ( PBVH pbvh,
int  flag 
)

◆ BKE_pbvh_update_normals()

void BKE_pbvh_update_normals ( PBVH pbvh,
struct SubdivCCG subdiv_ccg 
)

◆ BKE_pbvh_update_vertex_data()

void BKE_pbvh_update_vertex_data ( PBVH pbvh,
int  flag 
)

◆ BKE_pbvh_update_visibility()

void BKE_pbvh_update_visibility ( PBVH pbvh)

◆ BKE_pbvh_vert_coords_alloc()

float(* BKE_pbvh_vert_coords_alloc ( PBVH pbvh) )[3]

Definition at line 2948 of file pbvh.c.

References Freestyle::a, MVert::co, copy_v3_v3(), float(), MEM_callocN, NULL, PBVH::totvert, and PBVH::verts.

Referenced by sculpt_update_keyblock().

◆ BKE_pbvh_vert_coords_apply()

void BKE_pbvh_vert_coords_apply ( PBVH pbvh,
const float(*)  vertCos[3],
const int  totvert 
)

◆ BKE_pbvh_vert_tag_update_normal()

void BKE_pbvh_vert_tag_update_normal ( PBVH pbvh,
int  index 
)

Definition at line 1967 of file pbvh.c.

References BLI_assert, PBVH_FACES, PBVH::type, and PBVH::vert_bitmap.

Referenced by BKE_pbvh_vert_coords_apply(), do_boundary_brush_bend_task_cb_ex(), do_boundary_brush_grab_task_cb_ex(), do_boundary_brush_inflate_task_cb_ex(), do_boundary_brush_slide_task_cb_ex(), do_boundary_brush_smooth_task_cb_ex(), do_boundary_brush_twist_task_cb_ex(), do_clay_brush_task_cb_ex(), do_clay_strips_brush_task_cb_ex(), do_clay_thumb_brush_task_cb_ex(), do_cloth_brush_solve_simulation_task_cb_ex(), do_crease_brush_task_cb_ex(), do_displacement_eraser_brush_task_cb_ex(), do_displacement_smear_brush_task_cb_ex(), do_draw_brush_task_cb_ex(), do_draw_sharp_brush_task_cb_ex(), do_elastic_deform_brush_task_cb_ex(), do_enhance_details_brush_task_cb_ex(), do_fill_brush_task_cb_ex(), do_flatten_brush_task_cb_ex(), do_grab_brush_task_cb_ex(), do_gravity_task_cb_ex(), do_inflate_brush_task_cb_ex(), do_layer_brush_task_cb_ex(), do_multiplane_scrape_brush_task_cb_ex(), do_nudge_brush_task_cb_ex(), do_pinch_brush_task_cb_ex(), do_pose_brush_task_cb_ex(), do_relax_face_sets_brush_task_cb_ex(), do_rotate_brush_task_cb_ex(), do_scrape_brush_task_cb_ex(), do_smooth_brush_task_cb_ex(), do_snake_hook_brush_task_cb_ex(), do_thumb_brush_task_cb_ex(), do_topology_rake_bmesh_task_cb_ex(), do_topology_relax_task_cb_ex(), do_topology_slide_task_cb_ex(), mesh_filter_task_cb(), paint_mesh_restore_co_task_cb(), project_line_gesture_apply_task_cb(), SCULPT_do_surface_smooth_brush_laplacian_task_cb_ex(), sculpt_elastic_transform_task_cb(), sculpt_transform_task_cb(), sculpt_undo_restore_coords(), and SCULPT_vertex_visible_set().

◆ build_grid_leaf_node()

static void build_grid_leaf_node ( PBVH pbvh,
PBVHNode node 
)
static

◆ build_leaf()

static void build_leaf ( PBVH pbvh,
int  node_index,
BBC prim_bbc,
int  offset,
int  count 
)
static

◆ build_mesh_leaf_node()

static void build_mesh_leaf_node ( PBVH pbvh,
PBVHNode node 
)
static

◆ build_sub()

static void build_sub ( PBVH pbvh,
int  node_index,
BB cb,
BBC prim_bbc,
int  offset,
int  count 
)
static

◆ dist_squared_ray_to_tri_v3_fast()

static float dist_squared_ray_to_tri_v3_fast ( const float  ray_origin[3],
const float  ray_direction[3],
const float  v0[3],
const float  v1[3],
const float  v2[3],
float  r_point[3],
float r_depth 
)
static

◆ face_materials_match()

static bool face_materials_match ( const MPoly f1,
const MPoly f2 
)
static

Definition at line 148 of file pbvh.c.

References MPoly::flag, MPoly::mat_nr, and ME_SMOOTH.

Referenced by leaf_needs_material_split(), and partition_indices_material().

◆ free_tree()

static void free_tree ( node_tree tree)
static

Definition at line 934 of file pbvh.c.

References free(), NULL, and tree.

Referenced by BKE_pbvh_search_callback_occluded().

◆ grid_materials_match()

static bool grid_materials_match ( const DMFlagMat f1,
const DMFlagMat f2 
)
static

Definition at line 153 of file pbvh.c.

References DMFlagMat::flag, DMFlagMat::mat_nr, and ME_SMOOTH.

Referenced by leaf_needs_material_split(), and partition_indices_material().

◆ leaf_needs_material_split()

static bool leaf_needs_material_split ( PBVH pbvh,
int  offset,
int  count 
)
static

◆ map_insert_vert()

static int map_insert_vert ( PBVH pbvh,
GHash map,
unsigned int *  face_verts,
unsigned int *  uniq_verts,
int  vertex 
)
static

Definition at line 239 of file pbvh.c.

References BLI_ghash_ensure_p(), map, POINTER_AS_INT, POINTER_FROM_INT, and PBVH::vert_bitmap.

Referenced by build_mesh_leaf_node().

◆ nearest_to_ray_aabb_dist_sq()

static bool nearest_to_ray_aabb_dist_sq ( PBVHNode node,
void data_v 
)
static

◆ node_tree_insert()

static void node_tree_insert ( node_tree tree,
node_tree new_node 
)
static

Definition at line 898 of file pbvh.c.

References node_tree::data, PBVHNode::tmin, and tree.

Referenced by BKE_pbvh_search_callback_occluded().

◆ partition_indices()

static int partition_indices ( int *  prim_indices,
int  lo,
int  hi,
int  axis,
float  mid,
BBC prim_bbc 
)
static

Definition at line 160 of file pbvh.c.

References BBC::bcentroid, and SWAP.

Referenced by build_sub().

◆ partition_indices_material()

static int partition_indices_material ( PBVH pbvh,
int  lo,
int  hi 
)
static

◆ pbvh_bmesh_node_visibility_update()

static void pbvh_bmesh_node_visibility_update ( PBVHNode node)
static

◆ pbvh_build()

static void pbvh_build ( PBVH pbvh,
BB cb,
BBC prim_bbc,
int  totprim 
)
static

◆ pbvh_check_draw_layout()

static void pbvh_check_draw_layout ( PBVH pbvh)
static

◆ pbvh_draw_search_cb()

static bool pbvh_draw_search_cb ( PBVHNode node,
void data_v 
)
static

Definition at line 2858 of file pbvh.c.

References BKE_pbvh_node_frustum_contain_AABB(), data, and node.

Referenced by BKE_pbvh_draw_cb().

◆ pbvh_faces_node_nearest_to_ray()

static bool pbvh_faces_node_nearest_to_ray ( PBVH pbvh,
const PBVHNode node,
float(*)  origco[3],
const float  ray_start[3],
const float  ray_normal[3],
float depth,
float dist_sq 
)
static

◆ pbvh_faces_node_raycast()

static bool pbvh_faces_node_raycast ( PBVH pbvh,
const PBVHNode node,
float(*)  origco[3],
const float  ray_start[3],
const float  ray_normal[3],
struct IsectRayPrecalc isect_precalc,
float depth,
int *  r_active_vertex_index,
int *  r_active_face_index,
float r_face_normal 
)
static

◆ pbvh_faces_node_visibility_update()

static void pbvh_faces_node_visibility_update ( PBVH pbvh,
PBVHNode node 
)
static

◆ pbvh_faces_update_normals()

static void pbvh_faces_update_normals ( PBVH pbvh,
PBVHNode **  nodes,
int  totnode 
)
static

◆ pbvh_flush_bb()

static int pbvh_flush_bb ( PBVH pbvh,
PBVHNode node,
int  flag 
)
static

◆ pbvh_free_draw_buffers()

void pbvh_free_draw_buffers ( PBVH pbvh,
PBVHNode node 
)

Definition at line 1389 of file pbvh.c.

References PBVH::draw_cache_invalid, GPU_pbvh_buffers_free(), node, and NULL.

Referenced by pbvh_bmesh_node_split(), and pbvh_update_draw_buffers().

◆ pbvh_get_buffers_update_flags()

static int pbvh_get_buffers_update_flags ( PBVH UNUSEDpbvh)
static

◆ pbvh_grids_node_nearest_to_ray()

static bool pbvh_grids_node_nearest_to_ray ( PBVH pbvh,
PBVHNode node,
float(*)  origco[3],
const float  ray_start[3],
const float  ray_normal[3],
float depth,
float dist_sq 
)
static

◆ pbvh_grids_node_raycast()

static bool pbvh_grids_node_raycast ( PBVH pbvh,
PBVHNode node,
float(*)  origco[3],
const float  ray_start[3],
const float  ray_normal[3],
struct IsectRayPrecalc isect_precalc,
float depth,
int *  r_active_vertex_index,
int *  r_active_grid_index,
float r_face_normal 
)
static

◆ pbvh_grids_node_visibility_update()

static void pbvh_grids_node_visibility_update ( PBVH pbvh,
PBVHNode node 
)
static

◆ pbvh_grow_nodes()

void pbvh_grow_nodes ( PBVH pbvh,
int  totnode 
)

◆ pbvh_has_face_sets()

bool pbvh_has_face_sets ( PBVH pbvh)

◆ pbvh_has_mask()

bool pbvh_has_mask ( const PBVH pbvh)

◆ pbvh_iter_begin()

static void pbvh_iter_begin ( PBVHIter iter,
PBVH pbvh,
BKE_pbvh_SearchCallback  scb,
void search_data 
)
static

◆ pbvh_iter_end()

static void pbvh_iter_end ( PBVHIter iter)
static

◆ pbvh_iter_next()

static PBVHNode* pbvh_iter_next ( PBVHIter iter)
static

◆ pbvh_iter_next_occluded()

static PBVHNode* pbvh_iter_next_occluded ( PBVHIter iter)
static

◆ pbvh_show_face_sets_set()

void pbvh_show_face_sets_set ( PBVH pbvh,
bool  show_face_sets 
)

◆ pbvh_show_mask_set()

void pbvh_show_mask_set ( PBVH pbvh,
bool  show_mask 
)

◆ pbvh_stack_push()

static void pbvh_stack_push ( PBVHIter iter,
PBVHNode node,
bool  revisiting 
)
static

◆ pbvh_update_BB_redraw()

void pbvh_update_BB_redraw ( PBVH pbvh,
PBVHNode **  nodes,
int  totnode,
int  flag 
)

◆ pbvh_update_BB_redraw_task_cb()

static void pbvh_update_BB_redraw_task_cb ( void *__restrict  userdata,
const int  n,
const TaskParallelTLS *__restrict   UNUSEDtls 
)
static

Definition at line 1226 of file pbvh.c.

References data, node, PBVH_UpdateBB, PBVH_UpdateOriginalBB, PBVH_UpdateRedraw, and update_node_vb().

Referenced by pbvh_update_BB_redraw().

◆ pbvh_update_draw_buffer_cb()

static void pbvh_update_draw_buffer_cb ( void *__restrict  userdata,
const int  n,
const TaskParallelTLS *__restrict   UNUSEDtls 
)
static

◆ pbvh_update_draw_buffers()

static void pbvh_update_draw_buffers ( PBVH pbvh,
PBVHNode **  nodes,
int  totnode,
int  update_flag 
)
static

◆ pbvh_update_mask_redraw()

static void pbvh_update_mask_redraw ( PBVH pbvh,
PBVHNode **  nodes,
int  totnode,
int  flag 
)
static

◆ pbvh_update_mask_redraw_task_cb()

static void pbvh_update_mask_redraw_task_cb ( void *__restrict  userdata,
const int  n,
const TaskParallelTLS *__restrict   UNUSEDtls 
)
static

◆ pbvh_update_normals_accum_task_cb()

static void pbvh_update_normals_accum_task_cb ( void *__restrict  userdata,
const int  n,
const TaskParallelTLS *__restrict   UNUSEDtls 
)
static

◆ pbvh_update_normals_clear_task_cb()

static void pbvh_update_normals_clear_task_cb ( void *__restrict  userdata,
const int  n,
const TaskParallelTLS *__restrict   UNUSEDtls 
)
static

Definition at line 1014 of file pbvh.c.

References data, float(), node, PBVH_UpdateNormals, v, PBVH::vert_bitmap, verts, and zero_v3().

Referenced by pbvh_faces_update_normals().

◆ pbvh_update_normals_store_task_cb()

static void pbvh_update_normals_store_task_cb ( void *__restrict  userdata,
const int  n,
const TaskParallelTLS *__restrict   UNUSEDtls 
)
static

Definition at line 1085 of file pbvh.c.

References data, float(), node, normalize_v3(), PBVH_UpdateNormals, v, PBVH::vert_bitmap, and verts.

Referenced by pbvh_faces_update_normals().

◆ pbvh_update_visibility()

static void pbvh_update_visibility ( PBVH pbvh,
PBVHNode **  nodes,
int  totnode 
)
static

◆ pbvh_update_visibility_redraw()

static void pbvh_update_visibility_redraw ( PBVH pbvh,
PBVHNode **  nodes,
int  totnode,
int  flag 
)
static

◆ pbvh_update_visibility_redraw_task_cb()

static void pbvh_update_visibility_redraw_task_cb ( void *__restrict  userdata,
const int  n,
const TaskParallelTLS *__restrict   UNUSEDtls 
)
static

◆ pbvh_update_visibility_task_cb()

static void pbvh_update_visibility_task_cb ( void *__restrict  userdata,
const int  n,
const TaskParallelTLS *__restrict   UNUSEDtls 
)
static

◆ pbvh_vertex_iter_init()

void pbvh_vertex_iter_init ( PBVH pbvh,
PBVHNode node,
PBVHVertexIter vi,
int  mode 
)

◆ ray_aabb_intersect()

static bool ray_aabb_intersect ( PBVHNode node,
void data_v 
)
static

Definition at line 2150 of file pbvh.c.

References isect_ray_aabb_v3(), node, RaycastData::original, and RaycastData::ray.

Referenced by BKE_pbvh_raycast().

◆ ray_face_intersection_quad()

bool ray_face_intersection_quad ( const float  ray_start[3],
struct IsectRayPrecalc isect_precalc,
const float  t0[3],
const float  t1[3],
const float  t2[3],
const float  t3[3],
float depth 
)

Definition at line 2184 of file pbvh.c.

References isect_ray_tri_watertight_v3(), and NULL.

Referenced by pbvh_grids_node_raycast().

◆ ray_face_intersection_tri()

bool ray_face_intersection_tri ( const float  ray_start[3],
struct IsectRayPrecalc isect_precalc,
const float  t0[3],
const float  t1[3],
const float  t2[3],
float depth 
)

◆ ray_face_nearest_quad()

bool ray_face_nearest_quad ( const float  ray_start[3],
const float  ray_normal[3],
const float  t0[3],
const float  t1[3],
const float  t2[3],
const float  t3[3],
float depth,
float dist_sq 
)

Definition at line 2247 of file pbvh.c.

References dist_squared_ray_to_tri_v3_fast().

Referenced by pbvh_grids_node_nearest_to_ray().

◆ ray_face_nearest_tri()

bool ray_face_nearest_tri ( const float  ray_start[3],
const float  ray_normal[3],
const float  t0[3],
const float  t1[3],
const float  t2[3],
float depth,
float dist_sq 
)

◆ test_frustum_aabb()

static PlaneAABBIsect test_frustum_aabb ( const float  bb_min[3],
const float  bb_max[3],
PBVHFrustumPlanes frustum 
)
static

◆ traverse_tree()

static void traverse_tree ( node_tree tree,
BKE_pbvh_HitOccludedCallback  hcb,
void hit_data,
float tmin 
)
static

Definition at line 918 of file pbvh.c.

References tree.

Referenced by BKE_pbvh_search_callback_occluded().

◆ update_node_vb()

static void update_node_vb ( PBVH pbvh,
PBVHNode node 
)
static

◆ update_search_cb()

static bool update_search_cb ( PBVHNode node,
void data_v 
)
static

◆ update_vb()

static void update_vb ( PBVH pbvh,
PBVHNode node,
BBC prim_bbc,
int  offset,
int  count 
)
static

Definition at line 330 of file pbvh.c.

References BB_expand_with_bb(), BB_reset(), count, node, offset, and PBVH::prim_indices.

Referenced by build_leaf(), and build_sub().