Blender  V2.93
Classes | Macros | Typedefs | Enumerations | Functions
BKE_pbvh.h File Reference

A BVH for high poly meshes. More...

#include "BLI_bitmap.h"
#include "BLI_ghash.h"
#include "BKE_ccg.h"

Go to the source code of this file.

Classes

struct  PBVHProxyNode
 
struct  PBVHColorBufferNode
 
struct  PBVHFrustumPlanes
 
struct  PBVHVertexIter
 

Macros

#define PBVH_ITER_ALL   0
 
#define PBVH_ITER_UNIQUE   1
 
#define BKE_pbvh_vertex_iter_begin(pbvh, node, vi, mode)
 
#define BKE_pbvh_vertex_iter_end
 

Typedefs

typedef struct PBVH PBVH
 
typedef struct PBVHNode PBVHNode
 
typedef struct PBVHFrustumPlanes PBVHFrustumPlanes
 
typedef bool(* BKE_pbvh_SearchCallback) (PBVHNode *node, void *data)
 
typedef void(* BKE_pbvh_HitCallback) (PBVHNode *node, void *data)
 
typedef void(* BKE_pbvh_HitOccludedCallback) (PBVHNode *node, void *data, float *tmin)
 
typedef void(* BKE_pbvh_SearchNearestCallback) (PBVHNode *node, void *data, float *tmin)
 
typedef struct PBVHVertexIter PBVHVertexIter
 

Enumerations

enum  PBVHNodeFlags {
  PBVH_Leaf = 1 << 0 , PBVH_UpdateNormals = 1 << 1 , PBVH_UpdateBB = 1 << 2 , PBVH_UpdateOriginalBB = 1 << 3 ,
  PBVH_UpdateDrawBuffers = 1 << 4 , PBVH_UpdateRedraw = 1 << 5 , PBVH_UpdateMask = 1 << 6 , PBVH_UpdateVisibility = 1 << 8 ,
  PBVH_RebuildDrawBuffers = 1 << 9 , PBVH_FullyHidden = 1 << 10 , PBVH_FullyMasked = 1 << 11 , PBVH_FullyUnmasked = 1 << 12 ,
  PBVH_UpdateTopology = 1 << 13 , PBVH_UpdateColor = 1 << 14
}
 
enum  PBVHType { PBVH_FACES , PBVH_GRIDS , PBVH_BMESH }
 
enum  PBVHTopologyUpdateMode { PBVH_Subdivide = 1 , PBVH_Collapse = 2 }
 

Functions

void BKE_pbvh_set_frustum_planes (PBVH *pbvh, PBVHFrustumPlanes *planes)
 
void BKE_pbvh_get_frustum_planes (PBVH *pbvh, PBVHFrustumPlanes *planes)
 
PBVHBKE_pbvh_new (void)
 
void BKE_pbvh_build_mesh (PBVH *pbvh, const struct Mesh *mesh, const struct MPoly *mpoly, const struct MLoop *mloop, struct MVert *verts, int totvert, struct CustomData *vdata, struct CustomData *ldata, struct CustomData *pdata, const struct MLoopTri *looptri, int looptri_num)
 
void BKE_pbvh_build_grids (PBVH *pbvh, struct CCGElem **grids, int totgrid, struct CCGKey *key, void **gridfaces, struct DMFlagMat *flagmats, unsigned int **grid_hidden)
 
void BKE_pbvh_build_bmesh (PBVH *pbvh, struct BMesh *bm, bool smooth_shading, struct BMLog *log, const int cd_vert_node_offset, const int cd_face_node_offset)
 
void BKE_pbvh_free (PBVH *pbvh)
 
void BKE_pbvh_search_callback (PBVH *pbvh, BKE_pbvh_SearchCallback scb, void *search_data, BKE_pbvh_HitCallback hcb, void *hit_data)
 
void BKE_pbvh_search_gather (PBVH *pbvh, BKE_pbvh_SearchCallback scb, void *search_data, PBVHNode ***array, int *tot)
 
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 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)
 
bool BKE_pbvh_bmesh_node_raycast_detail (PBVHNode *node, const float ray_start[3], struct IsectRayPrecalc *isect_precalc, float *depth, float *r_edge_length)
 
void BKE_pbvh_raycast_project_ray_root (PBVH *pbvh, bool original, float ray_start[3], float ray_end[3], float ray_normal[3])
 
void BKE_pbvh_find_nearest_to_ray (PBVH *pbvh, BKE_pbvh_HitOccludedCallback cb, void *data, const float ray_start[3], const float ray_normal[3], bool original)
 
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)
 
void BKE_pbvh_draw_cb (PBVH *pbvh, bool update_only_visible, PBVHFrustumPlanes *update_frustum, PBVHFrustumPlanes *draw_frustum, void(*draw_fn)(void *user_data, struct GPU_PBVH_Buffers *buffers), void *user_data)
 
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)
 
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])
 
unsigned int ** BKE_pbvh_grid_hidden (const PBVH *pbvh)
 
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)
 
const struct 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)
 
struct BMeshBKE_pbvh_get_bmesh (PBVH *pbvh)
 
void BKE_pbvh_bmesh_detail_size_set (PBVH *pbvh, float detail_size)
 
bool BKE_pbvh_bmesh_update_topology (PBVH *pbvh, PBVHTopologyUpdateMode mode, const float center[3], const float view_normal[3], float radius, const bool use_frontface, const bool use_projected)
 
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_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_mark_topology_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_node_get_grids (PBVH *pbvh, PBVHNode *node, int **grid_indices, int *totgrid, int *maxgrid, int *gridsize, struct CCGElem ***r_griddata)
 
void BKE_pbvh_node_num_verts (PBVH *pbvh, PBVHNode *node, int *r_uniquevert, int *r_totvert)
 
void BKE_pbvh_node_get_verts (PBVH *pbvh, PBVHNode *node, const int **r_vert_indices, struct MVert **r_verts)
 
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])
 
float BKE_pbvh_node_get_tmin (PBVHNode *node)
 
bool BKE_pbvh_node_frustum_contain_AABB (PBVHNode *node, void *frustum)
 
bool BKE_pbvh_node_frustum_exclude_AABB (PBVHNode *node, void *frustum)
 
struct GSetBKE_pbvh_bmesh_node_unique_verts (PBVHNode *node)
 
struct GSetBKE_pbvh_bmesh_node_other_verts (PBVHNode *node)
 
struct GSetBKE_pbvh_bmesh_node_faces (PBVHNode *node)
 
void BKE_pbvh_bmesh_node_save_orig (struct BMesh *bm, PBVHNode *node)
 
void BKE_pbvh_bmesh_after_stroke (PBVH *pbvh)
 
void BKE_pbvh_update_bounds (PBVH *pbvh, int flags)
 
void BKE_pbvh_update_vertex_data (PBVH *pbvh, int flags)
 
void BKE_pbvh_update_visibility (PBVH *pbvh)
 
void BKE_pbvh_update_normals (PBVH *pbvh, struct SubdivCCG *subdiv_ccg)
 
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)
 
void BKE_pbvh_grids_update (PBVH *pbvh, struct CCGElem **grids, void **gridfaces, struct DMFlagMat *flagmats, unsigned int **grid_hidden)
 
void BKE_pbvh_subdiv_cgg_set (PBVH *pbvh, struct SubdivCCG *subdiv_ccg)
 
void BKE_pbvh_face_sets_set (PBVH *pbvh, int *face_sets)
 
void BKE_pbvh_face_sets_color_set (PBVH *pbvh, int seed, int color_default)
 
void BKE_pbvh_respect_hide_set (PBVH *pbvh, bool respect_hide)
 
float(* BKE_pbvh_vert_coords_alloc (struct PBVH *pbvh))[3]
 
void BKE_pbvh_vert_coords_apply (struct PBVH *pbvh, const float(*vertCos)[3], const int totvert)
 
bool BKE_pbvh_is_deformed (struct PBVH *pbvh)
 
void pbvh_vertex_iter_init (PBVH *pbvh, PBVHNode *node, PBVHVertexIter *vi, int mode)
 
void BKE_pbvh_node_get_proxies (PBVHNode *node, PBVHProxyNode **proxies, int *proxy_count)
 
void BKE_pbvh_node_free_proxies (PBVHNode *node)
 
PBVHProxyNodeBKE_pbvh_node_add_proxy (PBVH *pbvh, PBVHNode *node)
 
void BKE_pbvh_gather_proxies (PBVH *pbvh, PBVHNode ***r_array, int *r_tot)
 
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_vert_update_check_any (PBVH *pbvh, PBVHNode *node)
 
bool pbvh_has_mask (PBVH *pbvh)
 
void pbvh_show_mask_set (PBVH *pbvh, bool show_mask)
 
bool pbvh_has_face_sets (PBVH *pbvh)
 
void pbvh_show_face_sets_set (PBVH *pbvh, bool show_face_sets)
 
void BKE_pbvh_parallel_range_settings (struct TaskParallelSettings *settings, bool use_threading, int totnode)
 
struct MVertBKE_pbvh_get_verts (const PBVH *pbvh)
 
PBVHColorBufferNodeBKE_pbvh_node_color_buffer_get (PBVHNode *node)
 
void BKE_pbvh_node_color_buffer_free (PBVH *pbvh)
 

Detailed Description

A BVH for high poly meshes.

Definition in file BKE_pbvh.h.

Macro Definition Documentation

◆ BKE_pbvh_vertex_iter_begin

#define BKE_pbvh_vertex_iter_begin (   pbvh,
  node,
  vi,
  mode 
)

Definition at line 384 of file BKE_pbvh.h.

◆ BKE_pbvh_vertex_iter_end

#define BKE_pbvh_vertex_iter_end
Value:
} \
} \
} \
((void)0)

Definition at line 457 of file BKE_pbvh.h.

◆ PBVH_ITER_ALL

#define PBVH_ITER_ALL   0

Definition at line 334 of file BKE_pbvh.h.

◆ PBVH_ITER_UNIQUE

#define PBVH_ITER_UNIQUE   1

Definition at line 335 of file BKE_pbvh.h.

Typedef Documentation

◆ BKE_pbvh_HitCallback

typedef void(* BKE_pbvh_HitCallback) (PBVHNode *node, void *data)

Definition at line 96 of file BKE_pbvh.h.

◆ BKE_pbvh_HitOccludedCallback

typedef void(* BKE_pbvh_HitOccludedCallback) (PBVHNode *node, void *data, float *tmin)

Definition at line 97 of file BKE_pbvh.h.

◆ BKE_pbvh_SearchCallback

typedef bool(* BKE_pbvh_SearchCallback) (PBVHNode *node, void *data)

Definition at line 94 of file BKE_pbvh.h.

◆ BKE_pbvh_SearchNearestCallback

typedef void(* BKE_pbvh_SearchNearestCallback) (PBVHNode *node, void *data, float *tmin)

Definition at line 99 of file BKE_pbvh.h.

◆ PBVH

typedef struct PBVH PBVH

Definition at line 1 of file BKE_pbvh.h.

◆ PBVHFrustumPlanes

◆ PBVHNode

typedef struct PBVHNode PBVHNode

Definition at line 1 of file BKE_pbvh.h.

◆ PBVHVertexIter

Enumeration Type Documentation

◆ PBVHNodeFlags

Enumerator
PBVH_Leaf 
PBVH_UpdateNormals 
PBVH_UpdateBB 
PBVH_UpdateOriginalBB 
PBVH_UpdateDrawBuffers 
PBVH_UpdateRedraw 
PBVH_UpdateMask 
PBVH_UpdateVisibility 
PBVH_RebuildDrawBuffers 
PBVH_FullyHidden 
PBVH_FullyMasked 
PBVH_FullyUnmasked 
PBVH_UpdateTopology 
PBVH_UpdateColor 

Definition at line 63 of file BKE_pbvh.h.

◆ PBVHTopologyUpdateMode

Enumerator
PBVH_Subdivide 
PBVH_Collapse 

Definition at line 243 of file BKE_pbvh.h.

◆ PBVHType

enum PBVHType
Enumerator
PBVH_FACES 
PBVH_GRIDS 
PBVH_BMESH 

Definition at line 209 of file BKE_pbvh.h.

Function Documentation

◆ BKE_pbvh_bmesh_after_stroke()

void BKE_pbvh_bmesh_after_stroke ( PBVH pbvh)

◆ BKE_pbvh_bmesh_detail_size_set()

void BKE_pbvh_bmesh_detail_size_set ( PBVH pbvh,
float  detail_size 
)

◆ BKE_pbvh_bmesh_node_faces()

struct GSet* BKE_pbvh_bmesh_node_faces ( PBVHNode node)

Definition at line 2131 of file pbvh_bmesh.c.

References node.

Referenced by partialvis_update_bmesh(), and sculpt_undo_bmesh_push().

◆ BKE_pbvh_bmesh_node_other_verts()

struct GSet* BKE_pbvh_bmesh_node_other_verts ( PBVHNode node)

Definition at line 2126 of file pbvh_bmesh.c.

References node.

Referenced by partialvis_update_bmesh(), and pbvh_bmesh_node_visibility_update().

◆ BKE_pbvh_bmesh_node_raycast_detail()

bool BKE_pbvh_bmesh_node_raycast_detail ( PBVHNode node,
const float  ray_start[3],
struct IsectRayPrecalc isect_precalc,
float depth,
float r_edge_length 
)

◆ BKE_pbvh_bmesh_node_save_orig()

void BKE_pbvh_bmesh_node_save_orig ( struct BMesh bm,
PBVHNode node 
)

◆ BKE_pbvh_bmesh_node_unique_verts()

struct GSet* BKE_pbvh_bmesh_node_unique_verts ( PBVHNode node)

Definition at line 2121 of file pbvh_bmesh.c.

References node.

Referenced by partialvis_update_bmesh(), and pbvh_bmesh_node_visibility_update().

◆ BKE_pbvh_bmesh_update_topology()

bool BKE_pbvh_bmesh_update_topology ( PBVH pbvh,
PBVHTopologyUpdateMode  mode,
const float  center[3],
const float  view_normal[3],
float  radius,
const bool  use_frontface,
const bool  use_projected 
)

◆ BKE_pbvh_bounding_box()

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

◆ BKE_pbvh_build_bmesh()

void BKE_pbvh_build_bmesh ( PBVH pbvh,
struct BMesh bm,
bool  smooth_shading,
struct BMLog log,
const int  cd_vert_node_offset,
const int  cd_face_node_offset 
)

◆ 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,
const struct Mesh mesh,
const struct MPoly mpoly,
const struct MLoop mloop,
struct MVert verts,
int  totvert,
struct CustomData vdata,
struct CustomData ldata,
struct CustomData pdata,
const struct 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 
)

Definition at line 355 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_cb()

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

◆ 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 2752 of file pbvh.c.

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

Referenced by drw_sculpt_generate_calls().

◆ 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 3061 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_HitOccludedCallback  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 
)

Definition at line 2882 of file pbvh.c.

References MEM_freeN, MEM_recallocN_id, node, PBVH::nodes, NULL, and PBVH::totnode.

Referenced by sculpt_combine_proxies().

◆ BKE_pbvh_get_bmesh()

struct BMesh* BKE_pbvh_get_bmesh ( PBVH pbvh)

◆ BKE_pbvh_get_frustum_planes()

void BKE_pbvh_get_frustum_planes ( PBVH pbvh,
PBVHFrustumPlanes planes 
)

◆ BKE_pbvh_get_grid_key()

const struct 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 1718 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 1706 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_verts()

struct MVert* BKE_pbvh_get_verts ( const PBVH pbvh)

◆ BKE_pbvh_grid_hidden()

unsigned int** BKE_pbvh_grid_hidden ( const PBVH pbvh)

◆ BKE_pbvh_grids_update()

void BKE_pbvh_grids_update ( PBVH pbvh,
struct CCGElem **  grids,
void **  gridfaces,
struct DMFlagMat flagmats,
unsigned int **  grid_hidden 
)

◆ BKE_pbvh_has_faces()

bool BKE_pbvh_has_faces ( const PBVH pbvh)

Definition at line 1666 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 ( struct PBVH pbvh)

Definition at line 2842 of file pbvh.c.

References PBVH::deformed.

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 2920 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 2911 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 2869 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 
)

Definition at line 2640 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 1781 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 1798 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 1786 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 1815 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 1803 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 1915 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 1947 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 **  grid_indices,
int *  totgrid,
int *  maxgrid,
int *  gridsize,
struct CCGElem ***  r_griddata 
)

◆ 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 1921 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 1927 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 954 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,
struct MVert **  r_verts 
)

◆ BKE_pbvh_node_mark_normals_update()

void BKE_pbvh_node_mark_normals_update ( PBVHNode node)

Definition at line 1764 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_topology_update()

void BKE_pbvh_node_mark_topology_update ( PBVHNode node)

Definition at line 2116 of file pbvh_bmesh.c.

References node, and PBVH_UpdateTopology.

Referenced by sculpt_detail_flood_fill_exec(), and sculpt_topology_update().

◆ 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_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_node_vert_update_check_any()

bool BKE_pbvh_node_vert_update_check_any ( 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 1962 of file pbvh.c.

References BLI_assert, MVert::flag, ME_VERT_PBVH_UPDATE, node, PBVH_FACES, PBVH::type, v, PBVH::verts, and verts.

Referenced by update_cb_partial().

◆ BKE_pbvh_parallel_range_settings()

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

Definition at line 3042 of file pbvh.c.

References TaskParallelSettings::use_threading.

Referenced by bmesh_topology_rake(), calc_area_center(), calc_area_normal_and_center(), calculate_average_color(), calculate_average_weight(), cloth_brush_apply_brush_foces(), do_brush_action(), do_clay_brush(), do_clay_strips_brush(), do_clay_thumb_brush(), do_crease_brush(), do_displacement_eraser_brush(), do_displacement_smear_brush(), do_draw_brush(), do_draw_sharp_brush(), do_elastic_deform_brush(), do_fill_brush(), do_flatten_brush(), do_grab_brush(), do_gravity(), do_inflate_brush(), do_layer_brush(), do_mask_brush_draw(), do_nudge_brush(), do_pinch_brush(), do_rotate_brush(), do_scrape_brush(), do_slide_relax_brush(), do_snake_hook_brush(), do_thumb_brush(), 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_cloth_brush_do_simulation_step(), SCULPT_cloth_brush_ensure_nodes_constraints(), sculpt_cloth_filter_modal(), sculpt_color_filter_modal(), sculpt_combine_proxies(), sculpt_dirty_mask_exec(), SCULPT_do_boundary_brush(), SCULPT_do_draw_face_sets_brush(), SCULPT_do_multiplane_scrape_brush(), SCULPT_do_paint_brush(), SCULPT_do_pose_brush(), SCULPT_do_smear_brush(), SCULPT_do_surface_smooth_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_undo_bmesh_restore_generic(), vpaint_paint_leaves(), and wpaint_paint_leaves().

◆ 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] 
)

◆ 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 3066 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 876 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_gather()

void BKE_pbvh_search_gather ( PBVH pbvh,
BKE_pbvh_SearchCallback  scb,
void *  search_data,
PBVHNode ***  array,
int *  tot 
)

Definition at line 843 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,
struct SubdivCCG subdiv_ccg 
)

Definition at line 3056 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 1661 of file pbvh.c.

References PBVH::type.

Referenced by BKE_sculpt_object_pbvh_ensure(), BKE_sculptsession_use_pbvh_draw(), do_brush_action(), do_draw_face_sets_brush_task_cb_ex(), do_vpaint_brush_blur_task_cb_ex(), do_vpaint_brush_calc_average_color_cb_ex(), do_vpaint_brush_draw_task_cb_ex(), do_vpaint_brush_smear_task_cb_ex(), 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_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_mask_by_color_invoke(), 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_vertex_all_face_sets_visible_get(), SCULPT_vertex_any_face_set_visible_get(), SCULPT_vertex_co_get(), SCULPT_vertex_color_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(), and update_cb_partial().

◆ BKE_pbvh_update_bounds()

void BKE_pbvh_update_bounds ( PBVH pbvh,
int  flags 
)

◆ 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  flags 
)

◆ BKE_pbvh_update_visibility()

void BKE_pbvh_update_visibility ( PBVH pbvh)

◆ BKE_pbvh_vert_coords_alloc()

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

Definition at line 2780 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 ( struct PBVH pbvh,
const float(*)  vertCos[3],
const int  totvert 
)

◆ pbvh_has_face_sets()

bool pbvh_has_face_sets ( PBVH pbvh)

◆ pbvh_has_mask()

bool pbvh_has_mask ( PBVH pbvh)

◆ 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_vertex_iter_init()

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