Blender
V3.3
|
#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 } |
typedef struct PBVHDrawSearchData PBVHDrawSearchData |
PBVH drawing, updating draw buffers as needed and culling any nodes outside the specified frustum.
typedef struct PBVHUpdateData PBVHUpdateData |
enum PlaneAABBIsect |
Expand the bounding box to include a new coordinate.
Definition at line 69 of file pbvh.c.
References BB::bmax, BB::bmin, max_ff(), and min_ff().
Referenced by BKE_pbvh_build_bmesh(), BKE_pbvh_build_grids(), BKE_pbvh_build_mesh(), build_sub(), pbvh_bmesh_node_finalize(), pbvh_bmesh_node_limit_ensure(), pbvh_bmesh_node_limit_ensure_fast(), pbvh_bmesh_node_split(), and update_node_vb().
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().
Definition at line 63 of file pbvh.c.
References BB::bmax, and BB::bmin.
Referenced by BKE_pbvh_build_bmesh(), BKE_pbvh_build_grids(), BKE_pbvh_build_mesh(), BKE_pbvh_redraw_BB(), build_sub(), pbvh_bmesh_create_nodes_fast_recursive(), pbvh_bmesh_node_finalize(), pbvh_bmesh_node_limit_ensure(), pbvh_bmesh_node_limit_ensure_fast(), pbvh_bmesh_node_split(), update_node_vb(), and update_vb().
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().
Definition at line 108 of file pbvh.c.
References BBC::bcentroid, BBC::bmax, and BBC::bmin.
Referenced by BKE_pbvh_build_bmesh(), BKE_pbvh_build_grids(), BKE_pbvh_build_mesh(), and pbvh_bmesh_node_limit_ensure().
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().
void BKE_pbvh_build_grids | ( | PBVH * | pbvh, |
struct CCGElem ** | grids, | ||
int | totgrid, | ||
struct CCGKey * | key, | ||
void ** | gridfaces, | ||
struct DMFlagMat * | flagmats, | ||
unsigned int ** | grid_hidden | ||
) |
Do a full rebuild with on Grids data structure.
Definition at line 608 of file pbvh.c.
References BB_expand(), BB_reset(), BBC_update_centroid(), BBC::bcentroid, CCG_elem_offset_co(), PBVH::grid_flag_mats, PBVH::grid_hidden, CCGKey::grid_size, PBVH::gridfaces, PBVH::gridkey, PBVH::grids, LEAF_LIMIT, PBVH::leaf_limit, max_ii(), MEM_freeN, MEM_mallocN, pbvh_build(), PBVH_GRIDS, PBVH::totgrid, and PBVH::type.
Referenced by build_pbvh_from_ccg().
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 | ||
) |
Definition at line 542 of file pbvh.c.
References BB_expand(), BB_reset(), BBC_update_centroid(), BBC::bcentroid, BKE_mesh_vertex_normals_ensure(), BKE_mesh_vertex_normals_for_write(), BKE_pbvh_update_active_vcol(), PBVH::face_sets_color_default, Mesh::face_sets_color_default, PBVH::face_sets_color_seed, Mesh::face_sets_color_seed, PBVH::ldata, LEAF_LIMIT, PBVH::leaf_limit, PBVH::looptri, MEM_calloc_arrayN, MEM_freeN, MEM_mallocN, PBVH::mesh, mesh, PBVH::mloop, PBVH::mpoly, NULL, pbvh_build(), PBVH_FACES, PBVH::pdata, PBVH::totvert, MLoopTri::tri, PBVH::type, MLoop::v, PBVH::vdata, PBVH::vert_bitmap, PBVH::vert_normals, PBVH::verts, and verts.
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().
Definition at line 3250 of file pbvh.c.
References PBVH::draw_cache_invalid.
Referenced by mesh_batch_cache_valid().
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 | ||
) |
Definition at line 2869 of file pbvh.c.
References BKE_pbvh_search_gather(), data, PBVH::draw_cache_invalid, PBVHDrawSearchData::frustum, MEM_SAFE_FREE, node, pbvh_check_draw_layout(), pbvh_draw_search_cb(), PBVH_FullyHidden, PBVH_RebuildDrawBuffers, pbvh_update_draw_buffers(), PBVH_UpdateDrawBuffers, POINTER_FROM_INT, update_search_cb(), and user_data.
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().
Definition at line 3280 of file pbvh.c.
References BKE_pbvh_type(), BLI_assert, BLI_BITMAP_ENABLE, BLI_BITMAP_NEW, BLI_BITMAP_TEST, PBVH::looptri, MEM_malloc_arrayN, MEM_SAFE_FREE, node, PBVH::nodes, PBVH_FACES, PBVH_Leaf, PBVH::totnode, and MLoopTri::tri.
Referenced by do_brush_action(), SCULPT_filter_cache_init(), sculpt_mask_by_color_invoke(), and vpaint_invoke().
Definition at line 2843 of file pbvh.c.
References PBVH::face_sets_color_default, PBVH::face_sets_color_seed, and seed.
Referenced by sculpt_face_set_create_exec(), sculpt_face_sets_randomize_colors_exec(), and sculpt_update_object().
Definition at line 3236 of file pbvh.c.
References PBVH::face_sets.
Referenced by sculpt_update_object().
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 | ||
) |
Definition at line 2593 of file pbvh.c.
References BKE_pbvh_search_callback_occluded(), data, FindNearestRayData::dist_ray_to_aabb_precalc, dist_squared_ray_to_aabb_v3_precalc(), nearest_to_ray_aabb_dist_sq(), and FindNearestRayData::original.
Referenced by SCULPT_stroke_get_location().
Definition at line 663 of file pbvh.c.
References BLI_gset_free(), PBVH::deformed, GPU_pbvh_buffers_free(), GPU_pbvh_free_format(), PBVH::looptri, MEM_freeN, MEM_SAFE_FREE, node, PBVH::nodes, NULL, PBVH_Leaf, pbvh_pixels_free(), PBVH::prim_indices, PBVH::totnode, PBVH::vbo_id, PBVH::vert_bitmap, and PBVH::verts.
Referenced by multires_force_sculpt_rebuild(), SCULPT_pbvh_clear(), and sculptsession_free_pbvh().
Definition at line 3050 of file pbvh.c.
References MEM_freeN, MEM_recallocN_id, node, PBVH::nodes, NULL, and PBVH::totnode.
Referenced by sculpt_combine_proxies(), and SCULPT_combine_transform_proxies().
Only valid for type == PBVH_BMESH.
Definition at line 1861 of file pbvh.c.
References BLI_assert, PBVH::bm, PBVH_BMESH, and PBVH::type.
Referenced by partialvis_update_bmesh(), SCULPT_vertex_co_get(), SCULPT_vertex_count_get(), SCULPT_vertex_mask_get(), and SCULPT_vertex_normal_get().
bool BKE_pbvh_get_color_layer | ( | const Mesh * | me, |
CustomDataLayer ** | r_layer, | ||
eAttrDomain * | r_attr | ||
) |
Definition at line 1271 of file pbvh.c.
References ATTR_DOMAIN_CORNER, ATTR_DOMAIN_NUM, ATTR_DOMAIN_POINT, BKE_id_attribute_domain(), BKE_id_attributes_active_color_get(), CD_PROP_BYTE_COLOR, CD_PROP_COLOR, ELEM, NULL, and CustomDataLayer::type.
Referenced by BKE_pbvh_update_active_vcol().
void BKE_pbvh_get_frustum_planes | ( | PBVH * | pbvh, |
PBVHFrustumPlanes * | planes | ||
) |
Definition at line 3203 of file pbvh.c.
References copy_v4_v4(), PBVHFrustumPlanes::num_planes, PBVH::num_planes, PBVHFrustumPlanes::planes, and PBVH::planes.
Referenced by drw_sculpt_generate_calls().
Multi-res level, only valid for type == PBVH_GRIDS.
Definition at line 1831 of file pbvh.c.
References BLI_assert, PBVH::gridkey, PBVH_GRIDS, and PBVH::type.
Referenced by partialvis_update_grids(), pbvh_grids_node_visibility_update(), sculpt_expand_grids_to_faces_falloff(), SCULPT_vertex_all_face_sets_visible_get(), SCULPT_vertex_co_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_grids(), SCULPT_vertex_normal_get(), and SCULPT_vertex_visible_get().
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().
int BKE_pbvh_get_grid_num_vertices | ( | const PBVH * | pbvh | ) |
Definition at line 1849 of file pbvh.c.
References BLI_assert, CCGKey::grid_area, PBVH::gridkey, PBVH_GRIDS, PBVH::totgrid, and PBVH::type.
Referenced by SCULPT_vertex_count_get(), and stats_object_sculpt().
Definition at line 1751 of file pbvh.c.
References BLI_gset_add(), BLI_gset_free(), BLI_gset_len(), BLI_gset_ptr_new(), BLI_gsetIterator_getKey(), clear(), faces, PBVH::gridfaces, GSET_ITER_INDEX, MEM_mallocN, node, NULL, pbvh_iter_begin(), pbvh_iter_end(), pbvh_iter_next(), and PBVH_UpdateNormals.
Referenced by BKE_pbvh_update_normals(), and multires_stitch_grids().
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().
Definition at line 1837 of file pbvh.c.
References BLI_assert, PBVH::grids, PBVH_GRIDS, and PBVH::type.
Referenced by SCULPT_vertex_co_get(), SCULPT_vertex_mask_get(), and SCULPT_vertex_normal_get().
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().
Definition at line 3219 of file pbvh.c.
References BLI_assert, PBVH_FACES, PBVH::type, and PBVH::verts.
Referenced by SCULPT_mesh_deformed_mverts_get(), SCULPT_vertex_co_for_grab_active_get(), and SCULPT_vertex_co_get().
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().
void BKE_pbvh_grids_update | ( | PBVH * | pbvh, |
CCGElem ** | grids, | ||
void ** | gridfaces, | ||
DMFlagMat * | flagmats, | ||
BLI_bitmap ** | grid_hidden | ||
) |
Definition at line 2932 of file pbvh.c.
References Freestyle::a, BKE_pbvh_node_mark_rebuild_draw(), PBVH::grid_flag_mats, PBVH::grid_hidden, PBVH::gridfaces, PBVH::grids, PBVH::nodes, and PBVH::totnode.
Referenced by BKE_sculpt_bvh_update_from_ccg().
Definition at line 1803 of file pbvh.c.
References PBVH::bm, PBVH_BMESH, BMesh::totface, PBVH::totprim, and PBVH::type.
Definition at line 3010 of file pbvh.c.
References PBVH::deformed.
Referenced by sculpt_update_object().
Definition at line 3245 of file pbvh.c.
References PBVH::is_drawing.
Referenced by mesh_batch_cache_init(), and mesh_batch_cache_valid().
Definition at line 3255 of file pbvh.c.
References PBVH::is_drawing.
Referenced by workbench_color_type_get().
Definition at line 1885 of file pbvh.c.
References node, PBVH::nodes, PBVH_Leaf, PBVH_RebuildPixels, and PBVH::totnode.
Referenced by sculpt_update_object().
Definition at line 655 of file pbvh.c.
References PBVH::draw_cache_invalid, MEM_callocN, and PBVH::respect_hide.
Referenced by build_pbvh_for_dynamic_topology(), build_pbvh_from_ccg(), and build_pbvh_from_regular_mesh().
PBVHProxyNode* BKE_pbvh_node_add_proxy | ( | PBVH * | pbvh, |
PBVHNode * | node | ||
) |
Definition at line 3016 of file pbvh.c.
References BKE_pbvh_node_num_verts(), MEM_callocN, MEM_mallocN, MEM_reallocN, node, and NULL.
Referenced by do_clay_brush_task_cb_ex(), do_clay_strips_brush_task_cb_ex(), do_clay_thumb_brush_task_cb_ex(), do_crease_brush_task_cb_ex(), do_displacement_eraser_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_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_multiplane_scrape_brush_task_cb_ex(), do_nudge_brush_task_cb_ex(), do_pinch_brush_task_cb_ex(), do_rotate_brush_task_cb_ex(), do_scrape_brush_task_cb_ex(), do_snake_hook_brush_task_cb_ex(), do_thumb_brush_task_cb_ex(), do_topology_relax_task_cb_ex(), do_topology_slide_task_cb_ex(), and sculpt_elastic_transform_task_cb().
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().
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().
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 | ||
) |
Definition at line 2717 of file pbvh.c.
References node, PBVH_BMESH, pbvh_bmesh_node_nearest_to_ray(), PBVH_FACES, pbvh_faces_node_nearest_to_ray(), PBVH_FullyHidden, PBVH_GRIDS, pbvh_grids_node_nearest_to_ray(), and PBVH::type.
Referenced by sculpt_find_nearest_to_ray_cb().
Test if AABB is at least partially inside the PBVHFrustumPlanes volume.
Definition at line 2793 of file pbvh.c.
References data, ISECT_OUTSIDE, node, and test_frustum_aabb().
Referenced by get_pbvh_nodes(), pbvh_draw_search_cb(), sculpt_gesture_update_effected_nodes_by_clip_planes(), and sculpt_gesture_update_effected_nodes_by_line_plane().
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().
Definition at line 1928 of file pbvh.c.
References node, PBVH_FullyHidden, and PBVH_Leaf.
Referenced by SCULPT_search_sphere_cb().
Definition at line 1916 of file pbvh.c.
References BLI_assert, node, PBVH_FullyHidden, and PBVH_Leaf.
Referenced by build_grid_leaf_node(), build_mesh_leaf_node(), partialvis_update_bmesh(), partialvis_update_grids(), partialvis_update_mesh(), pbvh_bmesh_create_nodes_fast_recursive(), pbvh_bmesh_node_finalize(), pbvh_bmesh_node_visibility_update(), pbvh_faces_node_visibility_update(), pbvh_grids_node_visibility_update(), pbvh_update_visibility_redraw_task_cb(), update_cb(), and update_cb_partial().
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().
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().
Definition at line 1962 of file pbvh.c.
References node, PBVH_FullyUnmasked, and PBVH_Leaf.
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().
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().
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().
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 | ||
) |
Definition at line 2037 of file pbvh.c.
References CCGKey::grid_size, PBVH::gridkey, PBVH::grids, node, NULL, PBVH_BMESH, PBVH_FACES, PBVH_GRIDS, PBVH::totgrid, and PBVH::type.
Referenced by partialvis_update_grids(), pbvh_grids_node_visibility_update(), pbvh_vertex_iter_init(), sculpt_undo_alloc_and_store_hidden(), sculpt_undo_alloc_node(), SCULPT_undo_push_node(), and update_cb_partial().
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.
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().
void BKE_pbvh_node_get_proxies | ( | PBVHNode * | node, |
PBVHProxyNode ** | proxies, | ||
int * | proxy_count | ||
) |
Definition at line 2096 of file pbvh.c.
Referenced by sculpt_combine_proxies_task_cb().
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().
void BKE_pbvh_node_get_verts | ( | PBVH * | pbvh, |
PBVHNode * | node, | ||
const int ** | r_vert_indices, | ||
MVert ** | r_verts | ||
) |
Definition at line 1989 of file pbvh.c.
References node, and PBVH::verts.
Referenced by partialvis_update_mesh(), pbvh_faces_node_visibility_update(), pbvh_vertex_iter_init(), SCULPT_undo_push_node(), sculpt_undo_store_hidden(), and update_cb_partial().
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().
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().
Definition at line 1901 of file pbvh.c.
References node, PBVH_RebuildDrawBuffers, PBVH_UpdateDrawBuffers, and PBVH_UpdateRedraw.
Referenced by BKE_pbvh_grids_update(), build_grid_leaf_node(), build_mesh_leaf_node(), partialvis_update_bmesh(), partialvis_update_grids(), partialvis_update_mesh(), pbvh_bmesh_create_nodes_fast_recursive(), and pbvh_bmesh_node_finalize().
Definition at line 1906 of file pbvh.c.
References node, PBVH_UpdateDrawBuffers, and PBVH_UpdateRedraw.
Referenced by do_brush_action_task_cb(), sculpt_expand_face_sets_update(), sculpt_expand_restore_color_data(), sculpt_expand_restore_face_set_data(), sculpt_expand_restore_mask_data(), sculpt_expand_task_cb(), sculpt_face_set_create_exec(), sculpt_face_sets_randomize_colors_exec(), sculpt_mask_expand_cancel(), sculpt_mask_expand_invoke(), sculpt_mask_expand_modal(), and sculpt_undo_bmesh_restore_generic_task_cb().
Definition at line 1869 of file pbvh.c.
References node, PBVH_RebuildPixels, PBVH_UpdateBB, PBVH_UpdateDrawBuffers, PBVH_UpdateNormals, PBVH_UpdateOriginalBB, and PBVH_UpdateRedraw.
Referenced by BKE_pbvh_vert_coords_apply(), BKE_sculpt_update_object_before_eval(), cloth_filter_apply_forces_task_cb(), do_brush_action_task_cb(), mesh_filter_task_cb(), paint_mesh_restore_co_task_cb(), project_line_gesture_apply_task_cb(), sculpt_elastic_transform_task_cb(), sculpt_face_set_edit_modify_coordinates(), sculpt_topology_update(), sculpt_transform_task_cb(), update_cb(), and update_cb_partial().
Definition at line 1880 of file pbvh.c.
References node, PBVH_UpdateColor, PBVH_UpdateDrawBuffers, and PBVH_UpdateRedraw.
Referenced by color_filter_task_cb(), do_brush_action_task_cb(), paint_mesh_restore_co_task_cb(), sculpt_expand_colors_update_task_cb(), and update_cb_partial().
Definition at line 1875 of file pbvh.c.
References node, PBVH_UpdateDrawBuffers, PBVH_UpdateMask, and PBVH_UpdateRedraw.
Referenced by dirty_mask_apply_task_cb(), do_brush_action_task_cb(), do_mask_by_color_contiguous_update_nodes_cb(), do_mask_by_color_task_cb(), mask_filter_task_cb(), mask_flood_fill_task_cb(), mask_gesture_apply_task_cb(), mask_init_task_cb(), paint_mesh_restore_co_task_cb(), sculpt_expand_finish(), sculpt_expand_mask_update_task_cb(), sculpt_expand_task_cb(), update_cb(), and update_cb_partial().
Definition at line 1895 of file pbvh.c.
References node, PBVH_RebuildDrawBuffers, PBVH_UpdateDrawBuffers, PBVH_UpdateRedraw, and PBVH_UpdateVisibility.
Referenced by face_set_edit_do_post_visibility_updates(), face_set_gesture_apply_task_cb(), sculpt_face_set_init_exec(), sculpt_face_sets_change_visibility_exec(), update_cb(), and update_cb_partial().
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().
Definition at line 2003 of file pbvh.c.
References BLI_gset_len(), CCGKey::grid_area, PBVH::gridkey, node, PBVH_BMESH, PBVH_FACES, PBVH_GRIDS, and PBVH::type.
Referenced by BKE_pbvh_node_add_proxy(), partialvis_update_mesh(), pbvh_faces_node_visibility_update(), pbvh_vertex_iter_init(), sculpt_undo_alloc_node(), SCULPT_undo_push_node(), sculpt_undo_store_color(), sculpt_undo_store_hidden(), and update_cb_partial().
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 | ||
) |
Definition at line 2457 of file pbvh.c.
References PBVH::bm, BM_mesh_elem_index_ensure(), BM_VERT, node, PBVH_BMESH, pbvh_bmesh_node_raycast(), PBVH_FACES, pbvh_faces_node_raycast(), PBVH_FullyHidden, PBVH_GRIDS, pbvh_grids_node_raycast(), and PBVH::type.
Referenced by sculpt_raycast_cb().
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().
void BKE_pbvh_pmap_set | ( | PBVH * | pbvh, |
const MeshElemMap * | pmap | ||
) |
Definition at line 3275 of file pbvh.c.
References PBVH::pmap.
void BKE_pbvh_raycast | ( | PBVH * | pbvh, |
BKE_pbvh_HitOccludedCallback | cb, | ||
void * | data, | ||
const float | ray_start[3], | ||
const float | ray_normal[3], | ||
bool | original | ||
) |
Definition at line 2169 of file pbvh.c.
References BKE_pbvh_search_callback_occluded(), data, isect_ray_aabb_v3_precalc(), RaycastData::original, RaycastData::ray, and ray_aabb_intersect().
Referenced by sample_detail_dyntopo(), SCULPT_cursor_geometry_info_update(), and SCULPT_stroke_get_location().
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().
Definition at line 1729 of file pbvh.c.
References BB_expand_with_bb(), BB_reset(), BB::bmax, BB::bmin, copy_v3_v3(), node, NULL, pbvh_iter_begin(), pbvh_iter_end(), pbvh_iter_next(), and PBVH_UpdateRedraw.
Referenced by SCULPT_get_redraw_rect().
Definition at line 3241 of file pbvh.c.
References PBVH::respect_hide.
Referenced by build_pbvh_from_ccg(), and build_pbvh_from_regular_mesh().
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().
|
static |
Definition at line 954 of file pbvh.c.
References node_tree::data, free_tree(), node_tree::left, node, node_tree_insert(), NULL, pbvh_iter_begin(), pbvh_iter_end(), pbvh_iter_next_occluded(), PBVH_Leaf, node_tree::right, traverse_tree(), and tree.
Referenced by BKE_pbvh_find_nearest_to_ray(), and BKE_pbvh_raycast().
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().
void BKE_pbvh_set_frustum_planes | ( | PBVH * | pbvh, |
PBVHFrustumPlanes * | planes | ||
) |
Definition at line 3195 of file pbvh.c.
References copy_v4_v4(), PBVHFrustumPlanes::num_planes, PBVH::num_planes, PBVHFrustumPlanes::planes, and PBVH::planes.
Referenced by drw_sculpt_generate_calls().
Definition at line 3231 of file pbvh.c.
References PBVH::subdiv_ccg.
Referenced by sculpt_update_object().
Definition at line 371 of file pbvh.c.
References BKE_subdiv_ccg_grid_to_face_index(), BLI_BITMAP_NEW, BLI_BITMAP_SET, PBVH::face_sets, CCGKey::grid_area, PBVH::grid_hidden, CCGKey::grid_size, PBVH::gridkey, PBVH::subdiv_ccg, PBVH::totgrid, x, and y.
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().
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().
Definition at line 1545 of file pbvh.c.
References BKE_pbvh_search_gather(), MEM_SAFE_FREE, PBVH::nodes, pbvh_flush_bb(), pbvh_update_BB_redraw(), PBVH_UpdateBB, PBVH_UpdateOriginalBB, PBVH_UpdateRedraw, POINTER_FROM_INT, and update_search_cb().
Referenced by BKE_pbvh_vert_coords_apply(), ED_sculpt_redraw_planes_get(), SCULPT_flush_update_done(), SCULPT_flush_update_step(), sculpt_undo_restore_list(), and vwpaint_update_cache_variants().
Definition at line 2813 of file pbvh.c.
References BKE_pbvh_get_grid_updates(), BKE_pbvh_search_gather(), BKE_subdiv_ccg_update_normals(), faces, MEM_freeN, MEM_SAFE_FREE, PBVH_BMESH, pbvh_bmesh_normals_update(), PBVH_FACES, pbvh_faces_update_normals(), PBVH_GRIDS, PBVH_UpdateNormals, POINTER_FROM_INT, PBVH::type, and update_search_cb().
Referenced by DRW_mesh_batch_cache_create_requested(), drw_sculpt_generate_calls(), SCULPT_filter_cache_init(), and sculpt_mesh_filter_modal().
Definition at line 1567 of file pbvh.c.
References BKE_pbvh_search_gather(), PBVHNode::flag, MEM_freeN, PBVH::nodes, pbvh_update_mask_redraw(), pbvh_update_visibility_redraw(), PBVH_UpdateColor, PBVH_UpdateDrawBuffers, PBVH_UpdateMask, PBVH_UpdateRedraw, PBVH_UpdateVisibility, POINTER_FROM_INT, and update_search_cb().
Referenced by face_set_edit_do_post_visibility_updates(), mask_flood_fill_exec(), sculpt_dirty_mask_exec(), sculpt_face_set_init_exec(), sculpt_face_sets_change_visibility_exec(), SCULPT_flush_update_done(), sculpt_gesture_face_set_end(), sculpt_gesture_mask_end(), sculpt_mask_by_color_invoke(), sculpt_mask_init_exec(), sculpt_undo_restore_list(), and sculpt_undo_set_active_layer().
Definition at line 1711 of file pbvh.c.
References BKE_pbvh_search_gather(), MEM_freeN, PBVH::nodes, pbvh_update_visibility(), PBVH_UpdateVisibility, POINTER_FROM_INT, and update_search_cb().
Referenced by sculpt_undo_restore_list().
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().
Definition at line 2966 of file pbvh.c.
References Freestyle::a, BKE_mesh_calc_normals_looptri(), BKE_pbvh_node_mark_update(), BKE_pbvh_update_bounds(), BKE_pbvh_vert_tag_update_normal(), BLI_assert_msg, MVert::co, copy_v3_v3(), PBVH::deformed, PBVH::looptri, MEM_dupallocN, PBVH::mloop, PBVH::nodes, NULL, PBVH_UpdateBB, PBVH_UpdateOriginalBB, PBVH::totnode, PBVH::totprim, PBVH::totvert, and PBVH::verts.
Referenced by build_pbvh_from_regular_mesh(), sculpt_undo_restore_coords(), and sculpt_update_object().
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().
Definition at line 391 of file pbvh.c.
References BKE_pbvh_count_grid_quads(), BKE_pbvh_node_fully_hidden_set(), BKE_pbvh_node_mark_rebuild_draw(), PBVH::grid_hidden, CCGKey::grid_size, PBVH::gridkey, and node.
Referenced by build_leaf().
|
static |
Definition at line 399 of file pbvh.c.
References build_grid_leaf_node(), build_mesh_leaf_node(), count, PBVHNode::flag, PBVH::looptri, PBVH::nodes, offset, PBVH_Leaf, PBVHNode::prim_indices, PBVH::prim_indices, PBVHNode::totprim, and update_vb().
Referenced by build_sub().
Definition at line 264 of file pbvh.c.
References BKE_pbvh_node_fully_hidden_set(), BKE_pbvh_node_mark_rebuild_draw(), BLI_ghash_free(), BLI_ghash_int_new_ex(), BLI_ghashIterator_getKey(), BLI_ghashIterator_getValue(), GHASH_ITER, PBVH::looptri, map, map_insert_vert(), MEM_callocN, MEM_mallocN, PBVH::mloop, node, NULL, paint_is_face_hidden(), POINTER_AS_INT, PBVH::respect_hide, MLoopTri::tri, MLoop::v, and PBVH::verts.
Referenced by build_leaf().
|
static |
Definition at line 462 of file pbvh.c.
References BB_expand(), BB_reset(), BB_widest_axis(), BBC::bcentroid, BB::bmax, BB::bmin, build_leaf(), PBVHNode::children_offset, count, PBVH::leaf_limit, leaf_needs_material_split(), PBVH::nodes, NULL, offset, partition_indices(), partition_indices_material(), pbvh_grow_nodes(), PBVH::prim_indices, PBVH::totnode, and update_vb().
Referenced by pbvh_build().
|
static |
Definition at line 2224 of file pbvh.c.
References copy_v3_v3(), dist_squared_ray_to_seg_v3(), IsectRayAABB_Precalc::ray_origin, v1, and v2.
Referenced by ray_face_nearest_quad(), and ray_face_nearest_tri().
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().
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().
Definition at line 419 of file pbvh.c.
References count, face_materials_match(), PBVH::grid_flag_mats, grid_materials_match(), PBVH::looptri, PBVH::mpoly, offset, MLoopTri::poly, and PBVH::prim_indices.
Referenced by build_sub().
|
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().
Definition at line 2570 of file pbvh.c.
References FindNearestRayData::dist_ray_to_aabb_precalc, dist_squared_ray_to_aabb_v3(), node, and FindNearestRayData::original.
Referenced by BKE_pbvh_find_nearest_to_ray().
Definition at line 898 of file pbvh.c.
References node_tree::data, PBVHNode::tmin, and tree.
Referenced by BKE_pbvh_search_callback_occluded().
|
static |
Definition at line 160 of file pbvh.c.
References BBC::bcentroid, and SWAP.
Referenced by build_sub().
|
static |
Definition at line 181 of file pbvh.c.
References face_materials_match(), PBVH::grid_flag_mats, grid_materials_match(), indices, PBVH::looptri, PBVH::mpoly, MLoopTri::poly, PBVH::prim_indices, and SWAP.
Referenced by build_sub().
Definition at line 1647 of file pbvh.c.
References BKE_pbvh_bmesh_node_other_verts(), BKE_pbvh_bmesh_node_unique_verts(), BKE_pbvh_node_fully_hidden_set(), BLI_gsetIterator_getKey(), BM_elem_flag_test, BM_ELEM_HIDDEN, GSET_ITER, node, and v.
Referenced by pbvh_update_visibility_task_cb().
Definition at line 517 of file pbvh.c.
References build_sub(), MEM_callocN, MEM_freeN, MEM_mallocN, PBVH::node_mem_count, PBVH::nodes, PBVH::prim_indices, PBVH::totnode, and PBVH::totprim.
Referenced by BKE_pbvh_build_grids(), and BKE_pbvh_build_mesh().
Definition at line 1399 of file pbvh.c.
References PBVH::bm, GPU_pbvh_attribute_names_update(), GPU_pbvh_make_format(), PBVH::ldata, BMesh::ldata, node, PBVH::nodes, NULL, PBVH_BMESH, PBVH_FACES, PBVH_GRIDS, PBVH_Leaf, PBVH_RebuildDrawBuffers, PBVH_UpdateDrawBuffers, PBVH_UpdateRedraw, PBVH::totnode, PBVH::type, PBVH::vbo_id, PBVH::vdata, and BMesh::vdata.
Referenced by BKE_pbvh_draw_cb().
Definition at line 2858 of file pbvh.c.
References BKE_pbvh_node_frustum_contain_AABB(), data, and node.
Referenced by BKE_pbvh_draw_cb().
|
static |
Definition at line 2608 of file pbvh.c.
References MVert::co, faces, PBVH::looptri, PBVH::mloop, node, paint_is_face_hidden(), ray_face_nearest_tri(), PBVH::respect_hide, MLoopTri::tri, MLoop::v, and PBVH::verts.
Referenced by BKE_pbvh_node_find_nearest_to_ray().
|
static |
Definition at line 2295 of file pbvh.c.
References MVert::co, copy_v3_v3(), faces, len_squared_v3v3(), PBVH::looptri, madd_v3_v3v3fl(), PBVH::mloop, node, normal_tri_v3(), paint_is_face_hidden(), MLoopTri::poly, ray_face_intersection_tri(), PBVH::respect_hide, MLoopTri::tri, MLoop::v, and PBVH::verts.
Referenced by BKE_pbvh_node_raycast().
Definition at line 1597 of file pbvh.c.
References BKE_pbvh_node_fully_hidden_set(), BKE_pbvh_node_get_verts(), BKE_pbvh_node_num_verts(), ME_HIDE, node, NULL, and v.
Referenced by pbvh_update_visibility_task_cb().
Definition at line 1113 of file pbvh.c.
References BKE_pbvh_parallel_range_settings(), BLI_task_parallel_range(), data, PBVH::nodes, pbvh_update_normals_accum_task_cb(), pbvh_update_normals_clear_task_cb(), pbvh_update_normals_store_task_cb(), and PBVH::vert_normals.
Referenced by BKE_pbvh_update_normals().
Definition at line 1513 of file pbvh.c.
References node, PBVH::nodes, PBVH_Leaf, PBVH_UpdateBB, PBVH_UpdateOriginalBB, update(), and update_node_vb().
Referenced by BKE_pbvh_update_bounds().
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().
|
static |
Definition at line 1264 of file pbvh.c.
References GPU_PBVH_BUFFERS_SHOW_MASK, GPU_PBVH_BUFFERS_SHOW_SCULPT_FACE_SETS, and GPU_PBVH_BUFFERS_SHOW_VCOL.
Referenced by pbvh_update_draw_buffer_cb().
|
static |
Definition at line 2655 of file pbvh.c.
References CCG_grid_elem_co(), PBVH::grid_hidden, CCGKey::grid_size, PBVH::gridkey, PBVH::grids, node, paint_is_grid_face_hidden(), ray_face_nearest_quad(), x, and y.
Referenced by BKE_pbvh_node_find_nearest_to_ray().
|
static |
Definition at line 2363 of file pbvh.c.
References CCG_grid_elem_co(), copy_v3_v3(), CCGKey::grid_area, PBVH::grid_hidden, CCGKey::grid_size, PBVH::gridkey, PBVH::grids, len_squared_v3v3(), madd_v3_v3v3fl(), node, normal_quad_v3(), paint_is_grid_face_hidden(), ray_face_intersection_quad(), x, and y.
Referenced by BKE_pbvh_node_raycast().
Definition at line 1616 of file pbvh.c.
References BKE_pbvh_get_grid_key(), BKE_pbvh_grid_hidden(), BKE_pbvh_node_fully_hidden_set(), BKE_pbvh_node_get_grids(), BLI_BITMAP_TEST, usdtokens::g(), CCGKey::grid_size, node, NULL, x, and y.
Referenced by pbvh_update_visibility_task_cb().
Definition at line 224 of file pbvh.c.
References MEM_recallocN, PBVH::node_mem_count, PBVH::nodes, PBVH::totnode, and UNLIKELY.
Referenced by build_sub(), pbvh_bmesh_create_nodes_fast_recursive(), and pbvh_bmesh_node_split().
Definition at line 3171 of file pbvh.c.
References CD_SCULPT_FACE_SETS, CustomData_get_layer(), PBVH_BMESH, PBVH_FACES, PBVH_GRIDS, PBVH::pdata, and PBVH::type.
Referenced by OVERLAY_sculpt_cache_populate().
Definition at line 3157 of file pbvh.c.
References PBVH::bm, CD_PAINT_MASK, CustomData_get_layer(), CustomData_get_offset(), PBVH::gridkey, CCGKey::has_mask, PBVH_BMESH, PBVH_FACES, PBVH_GRIDS, PBVH::type, PBVH::vdata, and BMesh::vdata.
Referenced by OVERLAY_sculpt_cache_populate().
|
static |
Definition at line 724 of file pbvh.c.
References PBVHStack::node, PBVH::nodes, PBVHIter::pbvh, PBVHStack::revisiting, PBVHIter::scb, PBVHIter::search_data, PBVHIter::stack, STACK_FIXED_DEPTH, PBVHIter::stackfixed, PBVHIter::stacksize, and PBVHIter::stackspace.
Referenced by BKE_pbvh_get_grid_updates(), BKE_pbvh_redraw_BB(), BKE_pbvh_search_callback(), BKE_pbvh_search_callback_occluded(), and BKE_pbvh_search_gather().
Definition at line 741 of file pbvh.c.
References MEM_freeN, PBVHIter::stack, STACK_FIXED_DEPTH, and PBVHIter::stackspace.
Referenced by BKE_pbvh_get_grid_updates(), BKE_pbvh_redraw_BB(), BKE_pbvh_search_callback(), BKE_pbvh_search_callback_occluded(), and BKE_pbvh_search_gather().
Definition at line 766 of file pbvh.c.
References PBVHStack::node, node, PBVH::nodes, NULL, PBVHIter::pbvh, PBVH_Leaf, pbvh_stack_push(), PBVHStack::revisiting, PBVHIter::scb, PBVHIter::search_data, PBVHIter::stack, and PBVHIter::stacksize.
Referenced by BKE_pbvh_get_grid_updates(), BKE_pbvh_redraw_BB(), BKE_pbvh_search_callback(), and BKE_pbvh_search_gather().
Definition at line 809 of file pbvh.c.
References PBVHStack::node, node, PBVH::nodes, NULL, PBVHIter::pbvh, PBVH_Leaf, pbvh_stack_push(), PBVHIter::scb, PBVHIter::search_data, PBVHIter::stack, and PBVHIter::stacksize.
Referenced by BKE_pbvh_search_callback_occluded().
Definition at line 3190 of file pbvh.c.
References PBVH::show_face_sets.
Referenced by build_pbvh_for_dynamic_topology(), build_pbvh_from_ccg(), build_pbvh_from_regular_mesh(), and sculpt_update_object().
Definition at line 3185 of file pbvh.c.
References PBVH::show_mask.
Referenced by build_pbvh_for_dynamic_topology(), build_pbvh_from_ccg(), build_pbvh_from_regular_mesh(), and sculpt_update_object().
Definition at line 748 of file pbvh.c.
References MEM_mallocN, MEM_reallocN, PBVHStack::node, node, PBVHStack::revisiting, PBVHIter::stack, STACK_FIXED_DEPTH, PBVHIter::stackfixed, PBVHIter::stacksize, PBVHIter::stackspace, and UNLIKELY.
Referenced by pbvh_iter_next(), and pbvh_iter_next_occluded().
Definition at line 1250 of file pbvh.c.
References BKE_pbvh_parallel_range_settings(), BLI_task_parallel_range(), data, PBVHNode::flag, PBVH::nodes, and pbvh_update_BB_redraw_task_cb().
Referenced by BKE_pbvh_update_bounds().
|
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().
|
static |
Definition at line 1295 of file pbvh.c.
References PBVH::bm, CD_PAINT_MASK, CD_SCULPT_FACE_SETS, CustomData_get_layer(), data, PBVH::face_sets, PBVH::face_sets_color_default, PBVH::face_sets_color_seed, DMFlagMat::flag, PBVH::flags, GPU_pbvh_bmesh_buffers_build(), GPU_pbvh_bmesh_buffers_update(), GPU_pbvh_grid_buffers_build(), GPU_pbvh_grid_buffers_update(), GPU_pbvh_mesh_buffers_build(), GPU_pbvh_mesh_buffers_update(), PBVH::grid_flag_mats, PBVH::grid_hidden, PBVH::gridkey, PBVH::grids, PBVH::ldata, BMesh::ldata, PBVH::looptri, ME_SMOOTH, PBVH::mesh, PBVH::mloop, PBVH::mpoly, node, PBVH_BMESH, PBVH_DYNTOPO_SMOOTH_SHADING, PBVH_FACES, pbvh_get_buffers_update_flags(), PBVH_GRIDS, PBVH_RebuildDrawBuffers, PBVH_UpdateDrawBuffers, PBVH::pdata, smooth(), PBVH::subdiv_ccg, PBVH::type, PBVH::vbo_id, PBVH::vdata, BMesh::vdata, PBVH::vert_normals, and PBVH::verts.
Referenced by pbvh_update_draw_buffers().
|
static |
Definition at line 1446 of file pbvh.c.
References BKE_pbvh_parallel_range_settings(), BLI_task_parallel_range(), PBVH::bm, data, ELEM, GPU_pbvh_bmesh_buffers_update_free(), GPU_pbvh_buffers_update_flush(), GPU_pbvh_grid_buffers_update_free(), GPU_pbvh_make_format(), PBVH::grid_flag_mats, node, PBVH::nodes, NULL, PBVH_BMESH, PBVH_FACES, pbvh_free_draw_buffers(), PBVH_GRIDS, PBVH_RebuildDrawBuffers, pbvh_update_draw_buffer_cb(), PBVH_UpdateDrawBuffers, PBVH::type, UNUSED_VARS, PBVH::vbo_id, PBVH::vdata, and BMesh::vdata.
Referenced by BKE_pbvh_draw_cb().
|
static |
Definition at line 1176 of file pbvh.c.
References BKE_pbvh_parallel_range_settings(), BLI_task_parallel_range(), data, PBVHNode::flag, PBVH::nodes, and pbvh_update_mask_redraw_task_cb().
Referenced by BKE_pbvh_update_vertex_data().
|
static |
Definition at line 1140 of file pbvh.c.
References BKE_pbvh_node_fully_masked_set(), BKE_pbvh_node_fully_unmasked_set(), BKE_pbvh_vertex_iter_begin, BKE_pbvh_vertex_iter_end, data, PBVHVertexIter::mask, node, PBVH_ITER_ALL, PBVH_Leaf, and PBVH_UpdateMask.
Referenced by pbvh_update_mask_redraw().
|
static |
Definition at line 1035 of file pbvh.c.
References atomic_add_and_fetch_fl(), BKE_mesh_calc_poly_normal(), data, faces, float(), MPoly::loopstart, PBVH::looptri, PBVH::mloop, PBVH::mpoly, node, PBVH_UpdateNormals, MLoopTri::poly, MLoopTri::tri, UINT_MAX, v, MLoop::v, PBVH::vert_bitmap, and PBVH::verts.
Referenced by pbvh_faces_update_normals().
|
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().
|
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().
Definition at line 1699 of file pbvh.c.
References BKE_pbvh_parallel_range_settings(), BLI_task_parallel_range(), data, PBVH::nodes, and pbvh_update_visibility_task_cb().
Referenced by BKE_pbvh_update_visibility().
|
static |
Definition at line 1213 of file pbvh.c.
References BKE_pbvh_parallel_range_settings(), BLI_task_parallel_range(), data, PBVHNode::flag, PBVH::nodes, and pbvh_update_visibility_redraw_task_cb().
Referenced by BKE_pbvh_update_vertex_data().
|
static |
Definition at line 1189 of file pbvh.c.
References BKE_pbvh_node_fully_hidden_set(), BKE_pbvh_vertex_iter_begin, BKE_pbvh_vertex_iter_end, data, node, PBVH_ITER_ALL, PBVH_Leaf, PBVH_UpdateVisibility, and PBVHVertexIter::visible.
Referenced by pbvh_update_visibility_redraw().
|
static |
Definition at line 1675 of file pbvh.c.
References BKE_pbvh_type(), data, node, PBVH_BMESH, pbvh_bmesh_node_visibility_update(), PBVH_FACES, pbvh_faces_node_visibility_update(), PBVH_GRIDS, pbvh_grids_node_visibility_update(), and PBVH_UpdateVisibility.
Referenced by pbvh_update_visibility().
void pbvh_vertex_iter_init | ( | PBVH * | pbvh, |
PBVHNode * | node, | ||
PBVHVertexIter * | vi, | ||
int | mode | ||
) |
Definition at line 3099 of file pbvh.c.
References BKE_pbvh_node_get_grids(), BKE_pbvh_node_get_verts(), BKE_pbvh_node_num_verts(), BLI_gsetIterator_init(), PBVH::bm, PBVHVertexIter::bm_other_verts, PBVHVertexIter::bm_unique_verts, PBVHVertexIter::bm_vdata, CD_PAINT_MASK, PBVHVertexIter::cd_vert_mask_offset, CustomData_get_layer(), CustomData_get_offset(), PBVHVertexIter::fno, PBVHVertexIter::gh, PBVHVertexIter::grid, PBVHVertexIter::grid_hidden, PBVH::grid_hidden, PBVHVertexIter::grid_indices, PBVH::gridkey, PBVHVertexIter::grids, PBVHVertexIter::gridsize, PBVHVertexIter::key, PBVHVertexIter::mask, PBVHVertexIter::mvert, PBVHVertexIter::mverts, PBVHVertexIter::no, node, NULL, PBVH_BMESH, PBVH_FACES, PBVH_ITER_ALL, PBVH_ITER_UNIQUE, PBVHVertexIter::respect_hide, PBVH::respect_hide, PBVHVertexIter::totgrid, PBVHVertexIter::totvert, PBVH::type, PBVH::vdata, BMesh::vdata, PBVHVertexIter::vert_indices, PBVHVertexIter::vert_normals, PBVH::vert_normals, verts, PBVHVertexIter::visible, and PBVHVertexIter::vmask.
Definition at line 2150 of file pbvh.c.
References isect_ray_aabb_v3(), node, RaycastData::original, and RaycastData::ray.
Referenced by BKE_pbvh_raycast().
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().
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 | ||
) |
Definition at line 2205 of file pbvh.c.
References isect_ray_tri_watertight_v3(), and NULL.
Referenced by BKE_pbvh_bmesh_node_raycast_detail(), pbvh_bmesh_node_raycast(), and pbvh_faces_node_raycast().
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().
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 | ||
) |
Definition at line 2274 of file pbvh.c.
References dist_squared_ray_to_tri_v3_fast().
Referenced by pbvh_bmesh_node_nearest_to_ray(), and pbvh_faces_node_nearest_to_ray().
|
static |
Definition at line 2761 of file pbvh.c.
References dot_v3v3(), float(), ISECT_INSIDE, ISECT_INTERSECT, ISECT_OUTSIDE, PBVHFrustumPlanes::num_planes, PBVHFrustumPlanes::planes, and ret.
Referenced by BKE_pbvh_node_frustum_contain_AABB(), and BKE_pbvh_node_frustum_exclude_AABB().
|
static |
Definition at line 918 of file pbvh.c.
References tree.
Referenced by BKE_pbvh_search_callback_occluded().
Definition at line 116 of file pbvh.c.
References BB_expand(), BB_expand_with_bb(), BB_reset(), BKE_pbvh_vertex_iter_begin, BKE_pbvh_vertex_iter_end, PBVHVertexIter::co, node, PBVH::nodes, PBVH_ITER_ALL, PBVH_Leaf, and PBVHNode::vb.
Referenced by pbvh_flush_bb(), and pbvh_update_BB_redraw_task_cb().
Definition at line 993 of file pbvh.c.
References node, PBVH_Leaf, and POINTER_AS_INT.
Referenced by BKE_pbvh_draw_cb(), BKE_pbvh_update_bounds(), BKE_pbvh_update_normals(), BKE_pbvh_update_vertex_data(), and BKE_pbvh_update_visibility().
|
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().