Blender V4.3
BKE_pbvh_api.hh File Reference

A BVH for high poly meshes. More...

#include <optional>
#include <string>
#include <variant>
#include "BLI_array.hh"
#include "BLI_bit_group_vector.hh"
#include "BLI_bit_vector.hh"
#include "BLI_bounds_types.hh"
#include "BLI_compiler_compat.h"
#include "BLI_function_ref.hh"
#include "BLI_generic_span.hh"
#include "BLI_index_mask_fwd.hh"
#include "BLI_math_vector_types.hh"
#include "BLI_offset_indices.hh"
#include "BLI_set.hh"
#include "BLI_span.hh"
#include "BLI_string_ref.hh"
#include "BLI_utildefines.h"
#include "BLI_vector.hh"
#include "DNA_customdata_types.h"
#include "BKE_ccg.hh"
#include "BKE_pbvh.hh"
#include "bmesh.hh"

Go to the source code of this file.

Classes

class  blender::bke::pbvh::Node
 
struct  blender::bke::pbvh::MeshNode
 
struct  blender::bke::pbvh::GridsNode
 
struct  blender::bke::pbvh::BMeshNode
 
class  blender::bke::pbvh::DrawCache
 
class  blender::bke::pbvh::Tree
 
struct  PBVHFrustumPlanes
 

Namespaces

namespace  blender
 
namespace  blender::bke
 
namespace  blender::bke::pbvh
 
namespace  blender::bke::pbvh::pixels
 

Enumerations

enum  PBVHTopologyUpdateMode { PBVH_Subdivide = 1 , PBVH_Collapse = 2 }
 

Functions

void blender::bke::pbvh::build_pixels (const Depsgraph &depsgraph, Object &object, Image &image, ImageUser &image_user)
 
void blender::bke::pbvh::raycast (Tree &pbvh, FunctionRef< void(Node &node, float *tmin)> cb, const float3 &ray_start, const float3 &ray_normal, bool original)
 
bool blender::bke::pbvh::node_raycast_mesh (const MeshNode &node, Span< float3 > node_positions, Span< float3 > vert_positions, OffsetIndices< int > faces, Span< int > corner_verts, Span< int3 > corner_tris, Span< bool > hide_poly, const float3 &ray_start, const float3 &ray_normal, IsectRayPrecalc *isect_precalc, float *depth, int &r_active_vertex, int &r_active_face_index, float3 &r_face_normal)
 
bool blender::bke::pbvh::node_raycast_grids (const SubdivCCG &subdiv_ccg, GridsNode &node, Span< float3 > node_positions, const float3 &ray_start, const float3 &ray_normal, const IsectRayPrecalc *isect_precalc, float *depth, SubdivCCGCoord &r_active_vertex, int &r_active_grid_index, float3 &r_face_normal)
 
bool blender::bke::pbvh::node_raycast_bmesh (BMeshNode &node, const float3 &ray_start, const float3 &ray_normal, IsectRayPrecalc *isect_precalc, float *depth, bool use_original, BMVert **r_active_vertex, float3 &r_face_normal)
 
bool blender::bke::pbvh::raycast_node_detail_bmesh (BMeshNode &node, const float3 &ray_start, IsectRayPrecalc *isect_precalc, float *depth, float *r_edge_length)
 
void blender::bke::pbvh::clip_ray_ortho (Tree &pbvh, bool original, float ray_start[3], float ray_end[3], float ray_normal[3])
 
void blender::bke::pbvh::find_nearest_to_ray (Tree &pbvh, const FunctionRef< void(Node &node, float *tmin)> fn, const float3 &ray_start, const float3 &ray_normal, bool original)
 
bool blender::bke::pbvh::find_nearest_to_ray_node (Tree &pbvh, Node &node, Span< float3 > node_positions, bool use_origco, Span< float3 > vert_positions, const OffsetIndices< int > faces, Span< int > corner_verts, Span< int3 > corner_tris, Span< bool > hide_poly, const SubdivCCG *subdiv_ccg, const float ray_start[3], const float ray_normal[3], float *depth, float *dist_sq)
 
void blender::bke::pbvh::set_frustum_planes (Tree &pbvh, PBVHFrustumPlanes *planes)
 
void blender::bke::pbvh::get_frustum_planes (const Tree &pbvh, PBVHFrustumPlanes *planes)
 
Bounds< float3blender::bke::pbvh::bounds_get (const Tree &pbvh)
 
void BKE_pbvh_sync_visibility_from_verts (Object &object)
 
int blender::bke::pbvh::count_grid_quads (const BitGroupVector<> &grid_visibility, Span< int > grid_indices, int gridsize, int display_gridsize)
 
int BKE_pbvh_get_grid_num_verts (const Object &object)
 
int BKE_pbvh_get_grid_num_faces (const Object &object)
 
 ENUM_OPERATORS (PBVHTopologyUpdateMode, PBVH_Collapse)
 
bool blender::bke::pbvh::bmesh_update_topology (BMesh &bm, Tree &pbvh, BMLog &bm_log, PBVHTopologyUpdateMode mode, float min_edge_len, float max_edge_len, const float center[3], const float view_normal[3], float radius, bool use_frontface, bool use_projected)
 
void BKE_pbvh_node_mark_update (blender::bke::pbvh::Node &node)
 
void BKE_pbvh_node_mark_topology_update (blender::bke::pbvh::Node &node)
 
void BKE_pbvh_node_fully_hidden_set (blender::bke::pbvh::Node &node, int fully_hidden)
 
bool BKE_pbvh_node_fully_hidden_get (const blender::bke::pbvh::Node &node)
 
void BKE_pbvh_node_fully_masked_set (blender::bke::pbvh::Node &node, int fully_masked)
 
bool BKE_pbvh_node_fully_masked_get (const blender::bke::pbvh::Node &node)
 
void BKE_pbvh_node_fully_unmasked_set (blender::bke::pbvh::Node &node, int fully_masked)
 
bool BKE_pbvh_node_fully_unmasked_get (const blender::bke::pbvh::Node &node)
 
void BKE_pbvh_mark_rebuild_pixels (blender::bke::pbvh::Tree &pbvh)
 
Span< intblender::bke::pbvh::node_face_indices_calc_grids (const SubdivCCG &subdiv_ccg, const GridsNode &node, Vector< int > &faces)
 
Bounds< float3blender::bke::pbvh::node_bounds (const Node &node)
 
blender::Bounds< blender::float3BKE_pbvh_node_get_original_BB (const blender::bke::pbvh::Node *node)
 
float BKE_pbvh_node_get_tmin (const blender::bke::pbvh::Node *node)
 
bool BKE_pbvh_node_frustum_contain_AABB (const blender::bke::pbvh::Node *node, const PBVHFrustumPlanes *frustum)
 
bool BKE_pbvh_node_frustum_exclude_AABB (const blender::bke::pbvh::Node *node, const PBVHFrustumPlanes *frustum)
 
const blender::Set< BMVert *, 0 > & BKE_pbvh_bmesh_node_unique_verts (blender::bke::pbvh::BMeshNode *node)
 
const blender::Set< BMVert *, 0 > & BKE_pbvh_bmesh_node_other_verts (blender::bke::pbvh::BMeshNode *node)
 
const blender::Set< BMFace *, 0 > & BKE_pbvh_bmesh_node_faces (blender::bke::pbvh::BMeshNode *node)
 
void BKE_pbvh_bmesh_node_save_orig (BMesh *bm, BMLog *log, blender::bke::pbvh::BMeshNode *node, bool use_original)
 
void BKE_pbvh_bmesh_after_stroke (BMesh &bm, blender::bke::pbvh::Tree &pbvh)
 
void blender::bke::pbvh::update_bounds (const Depsgraph &depsgraph, const Object &object, Tree &pbvh)
 
void blender::bke::pbvh::update_bounds_mesh (Span< float3 > vert_positions, Tree &pbvh)
 
void blender::bke::pbvh::update_bounds_grids (const CCGKey &key, Span< float3 > positions, Tree &pbvh)
 
void blender::bke::pbvh::update_bounds_bmesh (const BMesh &bm, Tree &pbvh)
 
void blender::bke::pbvh::store_bounds_orig (Tree &pbvh)
 
void blender::bke::pbvh::update_mask_mesh (const Mesh &mesh, const IndexMask &node_mask, Tree &pbvh)
 
void blender::bke::pbvh::update_mask_grids (const SubdivCCG &subdiv_ccg, const IndexMask &node_mask, Tree &pbvh)
 
void blender::bke::pbvh::update_mask_bmesh (const BMesh &bm, const IndexMask &node_mask, Tree &pbvh)
 
void blender::bke::pbvh::update_visibility (const Object &object, Tree &pbvh)
 
void blender::bke::pbvh::update_normals (const Depsgraph &depsgraph, Object &object_orig, Tree &pbvh)
 
void blender::bke::pbvh::update_normals_from_eval (Object &object_eval, Tree &pbvh)
 
blender::Bounds< blender::float3BKE_pbvh_redraw_BB (const blender::bke::pbvh::Tree &pbvh)
 
IndexMask blender::bke::pbvh::nodes_to_face_selection_grids (const SubdivCCG &subdiv_ccg, Span< GridsNode > nodes, const IndexMask &nodes_mask, IndexMaskMemory &memory)
 
void BKE_pbvh_vert_coords_apply (blender::bke::pbvh::Tree &pbvh, blender::Span< blender::float3 > vert_positions)
 
void BKE_pbvh_node_get_bm_orco_data (const blender::bke::pbvh::BMeshNode &node, blender::Span< blender::float3 > &r_orig_positions, blender::Span< blender::int3 > &r_orig_tris)
 
Span< float3blender::bke::pbvh::vert_positions_eval (const Depsgraph &depsgraph, const Object &object_orig)
 
Span< float3blender::bke::pbvh::vert_positions_eval_from_eval (const Object &object_eval)
 
MutableSpan< float3blender::bke::pbvh::vert_positions_eval_for_write (const Depsgraph &depsgraph, Object &object_orig)
 
Span< float3blender::bke::pbvh::vert_normals_eval (const Depsgraph &depsgraph, const Object &object_orig)
 
Span< float3blender::bke::pbvh::vert_normals_eval_from_eval (const Object &object_eval)
 
Span< float3blender::bke::pbvh::face_normals_eval_from_eval (const Object &object_eval)
 
int BKE_pbvh_debug_draw_gen_get (blender::bke::pbvh::Node &node)
 
IndexMask blender::bke::pbvh::all_leaf_nodes (const Tree &pbvh, IndexMaskMemory &memory)
 
IndexMask blender::bke::pbvh::search_nodes (const Tree &pbvh, IndexMaskMemory &memory, FunctionRef< bool(const Node &)> filter_fn)
 
void blender::bke::pbvh::node_update_mask_mesh (Span< float > mask, MeshNode &node)
 
void blender::bke::pbvh::node_update_mask_grids (const CCGKey &key, Span< float > masks, GridsNode &node)
 
void blender::bke::pbvh::node_update_mask_bmesh (int mask_offset, BMeshNode &node)
 
void blender::bke::pbvh::node_update_visibility_mesh (Span< bool > hide_vert, MeshNode &node)
 
void blender::bke::pbvh::node_update_visibility_grids (const BitGroupVector<> &grid_hidden, GridsNode &node)
 
void blender::bke::pbvh::node_update_visibility_bmesh (BMeshNode &node)
 
void blender::bke::pbvh::update_node_bounds_mesh (Span< float3 > positions, MeshNode &node)
 
void blender::bke::pbvh::update_node_bounds_grids (int grid_area, Span< float3 > positions, GridsNode &node)
 
void blender::bke::pbvh::update_node_bounds_bmesh (BMeshNode &node)
 
void blender::bke::pbvh::flush_bounds_to_parents (Tree &pbvh)
 

Detailed Description

A BVH for high poly meshes.

Definition in file BKE_pbvh_api.hh.

Enumeration Type Documentation

◆ PBVHTopologyUpdateMode

Enumerator
PBVH_Subdivide 
PBVH_Collapse 

Definition at line 426 of file BKE_pbvh_api.hh.

Function Documentation

◆ BKE_pbvh_bmesh_after_stroke()

◆ BKE_pbvh_bmesh_node_faces()

◆ BKE_pbvh_bmesh_node_other_verts()

◆ BKE_pbvh_bmesh_node_save_orig()

◆ BKE_pbvh_bmesh_node_unique_verts()

const blender::Set< BMVert *, 0 > & BKE_pbvh_bmesh_node_unique_verts ( blender::bke::pbvh::BMeshNode * node)

Definition at line 2505 of file pbvh_bmesh.cc.

Referenced by blender::ed::sculpt_paint::cloth::apply_filter_forces_bmesh(), blender::ed::sculpt_paint::mask::apply_mask_bmesh(), blender::ed::sculpt_paint::mask::apply_new_mask_bmesh(), blender::ed::sculpt_paint::project::apply_projection_bmesh(), blender::ed::sculpt_paint::smooth::blur_geometry_data_array(), blender::ed::sculpt_paint::undo::bmesh_push(), blender::ed::sculpt_paint::calc_area_normal_and_center_node_bmesh(), blender::ed::sculpt_paint::boundary::calc_bend_bmesh(), blender::ed::sculpt_paint::calc_bmesh(), blender::ed::sculpt_paint::pose::calc_bmesh(), blender::ed::sculpt_paint::cloth::calc_constraint_factors(), blender::ed::sculpt_paint::filter::calc_enhance_details_filter(), blender::ed::sculpt_paint::calc_factors_common_bmesh(), blender::ed::sculpt_paint::calc_factors_common_from_orig_data_bmesh(), blender::ed::sculpt_paint::cloth::calc_forces_bmesh(), blender::ed::sculpt_paint::boundary::calc_grab_bmesh(), blender::ed::sculpt_paint::boundary::calc_inflate_bmesh(), blender::ed::sculpt_paint::filter::calc_inflate_filter(), blender::ed::sculpt_paint::filter::calc_random_filter(), blender::ed::sculpt_paint::filter::calc_relax_face_sets_filter(), blender::ed::sculpt_paint::filter::calc_relax_filter(), blender::ed::sculpt_paint::filter::calc_scale_filter(), blender::ed::sculpt_paint::filter::calc_sharpen_filter(), blender::ed::sculpt_paint::boundary::calc_slide_bmesh(), blender::ed::sculpt_paint::boundary::calc_smooth_bmesh(), blender::ed::sculpt_paint::filter::calc_smooth_filter(), blender::ed::sculpt_paint::filter::calc_sphere_filter(), blender::ed::sculpt_paint::filter::calc_surface_smooth_filter(), blender::ed::sculpt_paint::boundary::calc_twist_bmesh(), blender::ed::sculpt_paint::create_node_vert_offsets_bmesh(), blender::ed::sculpt_paint::mask::decrease_contrast_mask_bmesh(), blender::ed::sculpt_paint::cloth::do_simulation_step(), blender::ed::sculpt_paint::elastic_transform_node_bmesh(), blender::ed::sculpt_paint::cloth::ensure_nodes_constraints(), blender::ed::sculpt_paint::fake_neighbor_search_bmesh(), blender::ed::sculpt_paint::mask::fill_mask_bmesh(), blender::ed::sculpt_paint::mask::gesture_apply_for_symmetry_pass(), blender::ed::sculpt_paint::pose::grow_factors_bmesh(), blender::ed::sculpt_paint::mask::grow_mask_bmesh(), blender::ed::sculpt_paint::mask::increase_contrast_mask_bmesh(), blender::ed::sculpt_paint::mask::invert_mask_bmesh(), blender::ed::sculpt_paint::hide::invert_visibility_bmesh(), blender::ed::sculpt_paint::filter::mesh_filter_sharpen_init(), blender::ed::sculpt_paint::nearest_vert_calc_bmesh(), blender::ed::sculpt_paint::hide::partialvis_update_bmesh_nodes(), blender::ed::sculpt_paint::undo::restore_mask_from_undo_step(), blender::ed::sculpt_paint::undo::restore_position_from_undo_step(), blender::ed::sculpt_paint::sample_node_surface_bmesh(), blender::ed::sculpt_paint::mask::sculpt_mask_init_exec(), blender::ed::sculpt_paint::mask::sharpen_mask_bmesh(), blender::ed::sculpt_paint::mask::shrink_mask_bmesh(), blender::ed::sculpt_paint::mask::smooth_mask_bmesh(), blender::ed::sculpt_paint::transform_node_bmesh(), and blender::ed::sculpt_paint::expand::update_mask_bmesh().

◆ BKE_pbvh_debug_draw_gen_get()

int BKE_pbvh_debug_draw_gen_get ( blender::bke::pbvh::Node & node)

Definition at line 2525 of file pbvh.cc.

Referenced by DRW_sculpt_debug_cb().

◆ BKE_pbvh_get_grid_num_faces()

◆ BKE_pbvh_get_grid_num_verts()

◆ BKE_pbvh_mark_rebuild_pixels()

void BKE_pbvh_mark_rebuild_pixels ( blender::bke::pbvh::Tree & pbvh)

Definition at line 1517 of file pbvh.cc.

References blender::bke::pbvh::Tree::nodes_, PBVH_Leaf, and PBVH_RebuildPixels.

Referenced by sculpt_update_object().

◆ BKE_pbvh_node_frustum_contain_AABB()

bool BKE_pbvh_node_frustum_contain_AABB ( const blender::bke::pbvh::Node * node,
const PBVHFrustumPlanes * frustum )

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

Definition at line 2354 of file pbvh.cc.

References blender::bke::pbvh::ISECT_OUTSIDE, and blender::bke::pbvh::test_frustum_aabb().

Referenced by drw_sculpt_generate_calls(), and blender::draw::sculpt_batches_get_ex().

◆ BKE_pbvh_node_frustum_exclude_AABB()

bool BKE_pbvh_node_frustum_exclude_AABB ( const blender::bke::pbvh::Node * node,
const PBVHFrustumPlanes * frustum )

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

Definition at line 2361 of file pbvh.cc.

References blender::bke::pbvh::ISECT_INSIDE, and blender::bke::pbvh::test_frustum_aabb().

◆ BKE_pbvh_node_fully_hidden_get()

◆ BKE_pbvh_node_fully_hidden_set()

◆ BKE_pbvh_node_fully_masked_get()

bool BKE_pbvh_node_fully_masked_get ( const blender::bke::pbvh::Node & node)

Definition at line 1559 of file pbvh.cc.

References PBVH_FullyMasked, and PBVH_Leaf.

Referenced by blender::ed::sculpt_paint::node_fully_masked_or_hidden().

◆ BKE_pbvh_node_fully_masked_set()

void BKE_pbvh_node_fully_masked_set ( blender::bke::pbvh::Node & node,
int fully_masked )

◆ BKE_pbvh_node_fully_unmasked_get()

bool BKE_pbvh_node_fully_unmasked_get ( const blender::bke::pbvh::Node & node)

Definition at line 1576 of file pbvh.cc.

References PBVH_FullyUnmasked, and PBVH_Leaf.

◆ BKE_pbvh_node_fully_unmasked_set()

void BKE_pbvh_node_fully_unmasked_set ( blender::bke::pbvh::Node & node,
int fully_masked )

◆ BKE_pbvh_node_get_bm_orco_data()

void BKE_pbvh_node_get_bm_orco_data ( const blender::bke::pbvh::BMeshNode & node,
blender::Span< blender::float3 > & r_orig_positions,
blender::Span< blender::int3 > & r_orig_tris )

◆ BKE_pbvh_node_get_original_BB()

◆ BKE_pbvh_node_get_tmin()

◆ BKE_pbvh_node_mark_topology_update()

◆ BKE_pbvh_node_mark_update()

void BKE_pbvh_node_mark_update ( blender::bke::pbvh::Node & node)

Definition at line 1512 of file pbvh.cc.

References PBVH_RebuildPixels.

Referenced by BKE_sculpt_update_object_before_eval().

◆ BKE_pbvh_redraw_BB()

◆ BKE_pbvh_sync_visibility_from_verts()

◆ BKE_pbvh_vert_coords_apply()

◆ ENUM_OPERATORS()

ENUM_OPERATORS ( PBVHTopologyUpdateMode ,
PBVH_Collapse  )