|
Blender V5.3
|
#include <BKE_paint_bvh.hh>
Public Member Functions | |
| Tree (const Tree &other)=delete | |
| Tree (Tree &&other)=default | |
| Tree & | operator= (const Tree &other)=delete |
| Tree & | operator= (Tree &&other)=default |
| ~Tree () | |
| int | nodes_num () const |
| template<typename NodeT> | |
| Span< NodeT > | nodes () const |
| template<typename NodeT> | |
| MutableSpan< NodeT > | nodes () |
| Type | type () const |
| void | tag_positions_changed (const IndexMask &node_mask) |
| void | tag_visibility_changed (const IndexMask &node_mask) |
| void | tag_topology_changed (const IndexMask &node_mask) |
| void | tag_face_sets_changed (const IndexMask &node_mask) |
| void | tag_masks_changed (const IndexMask &node_mask) |
| void | tag_attribute_changed (const IndexMask &node_mask, StringRef attribute_name) |
| void | flush_bounds_to_parents () |
| void | update_bounds (const Depsgraph &depsgraph, const Object &object) |
| void | update_bounds_mesh (Span< float3 > vert_positions) |
| void | update_bounds_grids (Span< float3 > positions, int grid_area) |
| void | update_bounds_bmesh (const BMesh &bm) |
| void | update_normals (Object &object_orig, Object &object_eval) |
| void | update_visibility (const Object &object) |
| template<> | |
| Span< MeshNode > | nodes () const |
| template<> | |
| Span< GridsNode > | nodes () const |
| template<> | |
| Span< BMeshNode > | nodes () const |
| template<> | |
| MutableSpan< MeshNode > | nodes () |
| template<> | |
| MutableSpan< GridsNode > | nodes () |
| template<> | |
| MutableSpan< BMeshNode > | nodes () |
Static Public Member Functions | |
| static Tree | from_mesh (const Mesh &mesh) |
| static Tree | from_grids (const Mesh &base_mesh, const SubdivCCG &subdiv_ccg) |
| static Tree | from_bmesh (BMesh &bm) |
Public Attributes | |
| std::variant< Vector< MeshNode >, Vector< GridsNode >, Vector< BMeshNode > > | nodes_ |
| pixels::PixelData * | pixels_ = nullptr |
| std::unique_ptr< DrawCache > | draw_data |
Definition at line 226 of file BKE_paint_bvh.hh.
|
delete |
References Tree().
Referenced by from_bmesh(), from_grids(), from_mesh(), nodes(), operator=(), operator=(), Tree(), and Tree().
|
default |
References Tree().
| blender::bke::pbvh::Tree::~Tree | ( | ) |
Definition at line 609 of file pbvh.cc.
References blender::bke::pbvh::pixels_free().
| void blender::bke::pbvh::Tree::flush_bounds_to_parents | ( | ) |
Run the last step of the BVH bounds recalculation process, propagating updated leaf node bounds to their parent/ancestor inner nodes. This is meant to be used after leaf node bounds have been computed separately.
Definition at line 1228 of file pbvh.cc.
References blender::Set< Key, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::add(), blender::Set< Key, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::begin(), blender::index_mask::IndexMask::foreach_index(), blender::IndexMask::from_bits(), blender::Set< Key, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::is_empty(), blender::Bounds< T >::max, blender::bounds::merge(), blender::Bounds< T >::min, node, nodes(), nodes_, blender::Set< Key, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::remove(), blender::Set< Key, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::reserve(), and blender::index_mask::IndexMask::size().
Referenced by nodes(), update_bounds_bmesh(), update_bounds_grids(), and update_bounds_mesh().
Build a BVH tree from a triangle BMesh.
Definition at line 2108 of file pbvh_bmesh.cc.
References blender::BLI_memarena_new(), BLI_MEMARENA_STD_BUFSIZE, blender::bm, BM_ELEM_CD_SET_INT, BM_elem_index_set, blender::BM_FACE, BM_FACE_FIRST_LOOP, blender::BM_FACES_OF_MESH, BM_ITER_MESH, BM_ITER_MESH_INDEX, blender::BM_VERTS_OF_MESH, blender::bke::pbvh::BMesh, blender::CD_PROP_INT32, blender::BMVert::co, blender::Core, blender::CustomData_get_offset_named(), blender::bke::pbvh::dyntopo_node_none, blender::BMesh::elem_index_dirty, blender::Vector< T, InlineBufferCapacity, Allocator >::index_range(), blender::math::min_max(), blender::bke::pbvh::negative_bounds(), blender::BMLoop::next, nodes(), blender::threading::parallel_for(), blender::bke::pbvh::pbvh_bmesh_create_nodes_fast_recursive(), blender::bke::pbvh::pbvh_bmesh_node_limit_ensure_fast(), blender::BMesh::pdata, PRF_scope, blender::Vector< T, InlineBufferCapacity, Allocator >::resize(), blender::bke::pbvh::store_bounds_orig(), blender::bke::pbvh::FastNodeBuildInfo::totface, blender::BMesh::totface, Tree(), blender::BMLoop::v, blender::v, and blender::BMesh::vdata.
Referenced by blender::bke::build_pbvh_for_dynamic_topology(), operator=(), and blender::bke::tests::TEST_F().
|
static |
Build a BVH tree from grids geometry.
Definition at line 465 of file pbvh.cc.
References blender::BKE_subdiv_ccg_key_top_level(), blender::bke::pbvh::build_nodes_recursive_grids(), blender::bke::pbvh::calc_face_grid_bounds(), blender::Core, blender::bke::Face, blender::array_utils::fill_index_range(), from_grids(), blender::CCGKey::grid_area, blender::bke::pbvh::Grids, blender::offset_indices::OffsetIndices< T >::index_range(), blender::Vector< T, InlineBufferCapacity, Allocator >::index_range(), blender::bke::subdiv::init(), blender::offset_indices::OffsetIndices< T >::is_empty(), blender::Span< T >::is_empty(), blender::bke::pbvh::leaf_limit, blender::bounds::merge(), blender::bke::pbvh::merge_bounds(), blender::bke::pbvh::negative_bounds(), nodes(), blender::threading::parallel_for(), blender::threading::parallel_reduce(), blender::SubdivCCG::positions, PRF_scope, blender::Vector< T, InlineBufferCapacity, Allocator >::resize(), blender::offset_indices::OffsetIndices< T >::size(), blender::Vector< T, InlineBufferCapacity, Allocator >::size(), blender::offset_indices::OffsetIndices< T >::total_size(), and Tree().
Referenced by blender::bke::build_pbvh_from_ccg(), from_grids(), operator=(), and blender::bke::tests::TEST_F().
Build a BVH tree from base mesh triangles.
Definition at line 304 of file pbvh.cc.
References blender::bke::pbvh::build_mesh_leaf_nodes(), blender::bke::pbvh::build_nodes_recursive_mesh(), blender::bke::pbvh::calc_face_bounds(), blender::Core, blender::bke::Face, blender::array_utils::fill_index_range(), from_mesh(), blender::offset_indices::OffsetIndices< T >::index_range(), blender::Vector< T, InlineBufferCapacity, Allocator >::index_range(), blender::bke::subdiv::init(), blender::blender::Span< T >::is_empty(), blender::offset_indices::OffsetIndices< T >::is_empty(), blender::bke::pbvh::leaf_limit, blender::bounds::merge(), blender::bke::pbvh::merge_bounds(), blender::bke::pbvh::Mesh, blender::bke::pbvh::negative_bounds(), nodes(), blender::threading::parallel_for(), blender::threading::parallel_reduce(), blender::bke::Point, PRF_scope, blender::Vector< T, InlineBufferCapacity, Allocator >::resize(), blender::offset_indices::OffsetIndices< T >::size(), blender::Span< T >::slice(), blender::bke::pbvh::store_bounds_orig(), and Tree().
Referenced by blender::bke::build_pbvh_from_regular_mesh(), from_mesh(), operator=(), and blender::bke::tests::TEST_F().
| MutableSpan< NodeT > blender::bke::pbvh::Tree::nodes | ( | ) |
References blender::bm, flush_bounds_to_parents(), tag_attribute_changed(), tag_face_sets_changed(), tag_masks_changed(), tag_positions_changed(), tag_topology_changed(), tag_visibility_changed(), Tree(), type(), update_bounds(), update_bounds_bmesh(), update_bounds_grids(), update_bounds_mesh(), update_normals(), and update_visibility().
| MutableSpan< BMeshNode > blender::bke::pbvh::Tree::nodes | ( | ) |
| MutableSpan< GridsNode > blender::bke::pbvh::Tree::nodes | ( | ) |
| MutableSpan< MeshNode > blender::bke::pbvh::Tree::nodes | ( | ) |
| Span< NodeT > blender::bke::pbvh::Tree::nodes | ( | ) | const |
| int blender::bke::pbvh::Tree::nodes_num | ( | ) | const |
Definition at line 579 of file pbvh.cc.
References nodes(), nodes_, and blender::Vector< T, InlineBufferCapacity, Allocator >::size().
Referenced by operator=().
References blender::bm, from_bmesh(), from_grids(), from_mesh(), nodes_num(), and Tree().
| void blender::bke::pbvh::Tree::tag_face_sets_changed | ( | const IndexMask & | node_mask | ) |
| void blender::bke::pbvh::Tree::tag_masks_changed | ( | const IndexMask & | node_mask | ) |
| void blender::bke::pbvh::Tree::tag_positions_changed | ( | const IndexMask & | node_mask | ) |
Mark data based on positions for specific BVH nodes dirty. In particular: bounds, normals, and GPU data buffers. That data is recomputed later on in functions like update_bounds.
Definition at line 614 of file pbvh.cc.
References draw_data, blender::index_mask::IndexMask::min_array_size(), and blender::index_mask::IndexMask::set_bits().
Referenced by nodes().
| void blender::bke::pbvh::Tree::tag_topology_changed | ( | const IndexMask & | node_mask | ) |
Tag nodes that have a different number of vertices or faces (currently just for Type::BMesh).
Definition at line 634 of file pbvh.cc.
References draw_data.
Referenced by nodes().
| void blender::bke::pbvh::Tree::tag_visibility_changed | ( | const IndexMask & | node_mask | ) |
Tag nodes where face or vertex visibility has changed.
Definition at line 625 of file pbvh.cc.
References draw_data, blender::index_mask::IndexMask::min_array_size(), and blender::index_mask::IndexMask::set_bits().
Referenced by nodes().
|
inline |
Definition at line 673 of file BKE_paint_bvh.hh.
Referenced by nodes().
| void blender::bke::pbvh::Tree::update_bounds | ( | const Depsgraph & | depsgraph, |
| const Object & | object ) |
Recalculate node bounding boxes based on the current coordinates. Calculation is only done for affected nodes that have been tagged by #PBVH::tag_positions_changed().
Definition at line 1309 of file pbvh.cc.
References blender::SculptSession::bm, blender::bke::pbvh::BMesh, blender::Core, blender::SubdivCCG::grid_area, blender::bke::pbvh::Grids, blender::bke::pbvh::Mesh, blender::SubdivCCG::positions, PRF_scope, blender::SculptSession::subdiv_ccg, update_bounds_bmesh(), update_bounds_grids(), update_bounds_mesh(), and blender::bke::pbvh::vert_positions_eval().
Referenced by nodes().
| void blender::bke::pbvh::Tree::update_bounds_bmesh | ( | const BMesh & | bm | ) |
Definition at line 1296 of file pbvh.cc.
References flush_bounds_to_parents(), blender::index_mask::IndexMask::foreach_index(), blender::IndexMask::from_bits(), blender::exec_mode::grain_size(), blender::index_mask::IndexMask::is_empty(), nodes(), and blender::bke::pbvh::update_node_bounds_bmesh().
Referenced by nodes(), and update_bounds().
Definition at line 1282 of file pbvh.cc.
References flush_bounds_to_parents(), blender::index_mask::IndexMask::foreach_index(), blender::IndexMask::from_bits(), blender::exec_mode::grain_size(), blender::index_mask::IndexMask::is_empty(), nodes(), and blender::bke::pbvh::update_node_bounds_grids().
Referenced by nodes(), and update_bounds().
Definition at line 1268 of file pbvh.cc.
References flush_bounds_to_parents(), blender::index_mask::IndexMask::foreach_index(), blender::IndexMask::from_bits(), blender::exec_mode::grain_size(), blender::index_mask::IndexMask::is_empty(), nodes(), and blender::bke::pbvh::update_node_bounds_mesh().
Referenced by nodes(), and update_bounds().
Definition at line 1150 of file pbvh.cc.
References blender::BKE_subdiv_ccg_update_normals(), blender::bke::pbvh::BMesh, blender::bke::pbvh::bmesh_normals_update(), blender::Core, blender::IndexMask::from_bits(), blender::bke::pbvh::Grids, blender::bke::pbvh::Mesh, nodes(), blender::bke::pbvh::nodes_to_face_selection_grids(), PRF_scope, blender::Object::runtime, blender::bke::ObjectRuntime::sculpt_session, blender::SculptSession::subdiv_ccg, and blender::bke::pbvh::update_normals_mesh().
Referenced by nodes().
| void blender::bke::pbvh::Tree::update_visibility | ( | const Object & | object | ) |
Definition at line 1505 of file pbvh.cc.
References blender::bke::pbvh::BMesh, blender::Core, blender::data, blender::IndexMask::from_bits(), blender::bke::pbvh::Grids, blender::index_mask::IndexMask::is_empty(), blender::bke::pbvh::Mesh, nodes(), PRF_scope, blender::SculptSession::subdiv_ccg, blender::bke::pbvh::update_visibility_bmesh(), blender::bke::pbvh::update_visibility_faces(), and blender::bke::pbvh::update_visibility_grids().
Referenced by nodes().
| std::unique_ptr<DrawCache> blender::bke::pbvh::Tree::draw_data |
Definition at line 259 of file BKE_paint_bvh.hh.
Referenced by tag_attribute_changed(), tag_face_sets_changed(), tag_masks_changed(), tag_positions_changed(), tag_topology_changed(), and tag_visibility_changed().
| std::variant<Vector<MeshNode>, Vector<GridsNode>, Vector<BMeshNode> > blender::bke::pbvh::Tree::nodes_ |
Definition at line 255 of file BKE_paint_bvh.hh.
Referenced by flush_bounds_to_parents(), nodes(), nodes(), nodes_num(), and blender::bke::pbvh::pbvh_iter_next().
| pixels::PixelData* blender::bke::pbvh::Tree::pixels_ = nullptr |
Definition at line 257 of file BKE_paint_bvh.hh.