Blender V4.3
blender::bke::pbvh::MeshNode Struct Reference

#include <BKE_pbvh_api.hh>

Inherits blender::bke::pbvh::Node.

Public Types

using LocalVertMapIndexT = int16_t
using LocalVertMap

Public Member Functions

Span< intfaces () const
Span< intverts () const
Span< intall_verts () const
int corners_num () const

Public Attributes

Span< intface_indices_
LocalVertMap vert_indices_
int unique_verts_num_ = 0
int corners_num_
Public Attributes inherited from blender::bke::pbvh::Node
Bounds< float3bounds_ = {}
Bounds< float3bounds_orig_ = {}
int children_offset_ = 0
PBVHNodeFlags flag_ = PBVH_UpdateRedraw
float tmin_ = 0.0f
int debug_draw_gen_ = 0
pixels::NodeDatapixels_ = nullptr

Detailed Description

Definition at line 104 of file BKE_pbvh_api.hh.

Member Typedef Documentation

◆ LocalVertMap

Initial value:
draw_view push_constant(Type::INT, "radiance_src") .push_constant(Type capture_info_buf storage_buf(1, Qualifier::READ, "ObjectBounds", "bounds_buf[]") .push_constant(Type draw_view int
PythonProbingStrategy<> DefaultProbingStrategy

Global vertices are mapped to local indices with a vector set, with a specialized type in order to use 32 bit integers for slot values. .

Definition at line 114 of file BKE_pbvh_api.hh.

◆ LocalVertMapIndexT

Use a 16 bit integer for the slot index type because there will always be less than leaf_limit vertices in a node.

Definition at line 109 of file BKE_pbvh_api.hh.

Member Function Documentation

◆ all_verts()

Span< int > blender::bke::pbvh::MeshNode::all_verts ( ) const
inline

Return all vertices used by faces in this node. The same as verts(), with the shared vertices added at the end of the array.

Definition at line 626 of file BKE_pbvh_api.hh.

References vert_indices_.

Referenced by blender::ed::sculpt_paint::undo::fill_node_data_mesh(), blender::bke::pbvh::node_update_mask_mesh(), blender::bke::pbvh::node_update_visibility_mesh(), and blender::bke::pbvh::update_node_bounds_mesh().

◆ corners_num()

int blender::bke::pbvh::MeshNode::corners_num ( ) const
inline

The number of corners in all of the node's faces.

Definition at line 630 of file BKE_pbvh_api.hh.

References corners_num_.

Referenced by blender::draw::pbvh::create_tri_index_mesh().

◆ faces()

◆ verts()

Span< int > blender::bke::pbvh::MeshNode::verts ( ) const
inline

Return the "unique" vertices owned by the node, excluding vertices owned by other nodes.

Definition at line 622 of file BKE_pbvh_api.hh.

References unique_verts_num_, and vert_indices_.

Referenced by blender::ed::sculpt_paint::cloth::apply_filter_forces_mesh(), blender::ed::sculpt_paint::mask::apply_mask_mesh(), blender::ed::sculpt_paint::project::apply_projection_mesh(), blender::ed::sculpt_paint::calc_area_normal_and_center_node_mesh(), blender::ed::sculpt_paint::boundary::calc_bend_mesh(), blender::ed::sculpt_paint::calc_faces(), blender::ed::sculpt_paint::calc_factors_common_from_orig_data_mesh(), blender::ed::sculpt_paint::calc_factors_common_mesh(), blender::ed::sculpt_paint::calc_factors_common_mesh_indexed(), blender::ed::sculpt_paint::cloth::calc_forces_mesh(), blender::ed::sculpt_paint::boundary::calc_grab_mesh(), blender::ed::sculpt_paint::boundary::calc_inflate_mesh(), blender::ed::sculpt_paint::pose::calc_mesh(), blender::ed::sculpt_paint::boundary::calc_slide_mesh(), blender::ed::sculpt_paint::boundary::calc_smooth_mesh(), blender::ed::sculpt_paint::boundary::calc_twist_mesh(), blender::ed::sculpt_paint::color::color_filter_task(), blender::ed::sculpt_paint::expand::colors_update_task(), blender::ed::sculpt_paint::color::do_color_smooth_task(), blender::ed::sculpt_paint::color::do_paint_brush_task(), blender::ed::sculpt_paint::color::do_sample_wet_paint_task(), blender::ed::sculpt_paint::color::do_smear_brush_task(), blender::ed::sculpt_paint::elastic_transform_node_mesh(), blender::ed::sculpt_paint::fake_neighbor_search_mesh(), blender::ed::sculpt_paint::undo::fill_node_data_mesh(), blender::ed::sculpt_paint::mask::get_hidden_verts(), blender::ed::sculpt_paint::mask::grow_mask_mesh(), blender::ed::sculpt_paint::hide::node_visible_verts(), blender::ed::sculpt_paint::orig_position_data_lookup_mesh(), blender::ed::sculpt_paint::sample_node_surface_mesh(), blender::ed::sculpt_paint::mask::sharpen_mask_mesh(), blender::ed::sculpt_paint::mask::shrink_mask_mesh(), blender::ed::sculpt_paint::mask::smooth_mask_mesh(), blender::ed::sculpt_paint::undo::store_color(), and blender::ed::sculpt_paint::transform_node_mesh().

Member Data Documentation

◆ corners_num_

int blender::bke::pbvh::MeshNode::corners_num_

The number of corners in all of the node's referenced faces. This value can easily be recalculated but currently it's faster to avoid that and store it here.

Definition at line 153 of file BKE_pbvh_api.hh.

Referenced by corners_num().

◆ face_indices_

Span<int> blender::bke::pbvh::MeshNode::face_indices_

Indices into the #Mesh::faces() array. Refers to a subset of Tree::prim_indices_.

Definition at line 122 of file BKE_pbvh_api.hh.

Referenced by blender::bke::pbvh::build_nodes_recursive_mesh(), and faces().

◆ unique_verts_num_

int blender::bke::pbvh::MeshNode::unique_verts_num_ = 0

The number of vertices in #vert_indices not shared with (owned by) another node.

Definition at line 148 of file BKE_pbvh_api.hh.

Referenced by blender::bke::pbvh::update_normals_mesh(), and verts().

◆ vert_indices_

LocalVertMap blender::bke::pbvh::MeshNode::vert_indices_

Array of indices into the mesh's vertex array. Contains the indices of all vertices used by faces that are within this node's bounding box.

Note that a vertex might be used by a multiple faces, and these faces might be in different leaf nodes. Such a vertex will appear in the vert_indices array of each of those leaf nodes.

In order to support cases where you want access to multiple nodes' vertices without duplication, the vert_indices array is ordered such that the first part of the array, up to index 'uniq_verts', contains "unique" vertex indices. These vertices might not be truly unique to this node, but if they appear in another node's vert_indices array, they will be above that node's 'uniq_verts' value.

Used for leaf nodes.

Todo
Find a way to disable the VectorSet inline buffer.

Definition at line 146 of file BKE_pbvh_api.hh.

Referenced by all_verts(), blender::bke::pbvh::node_raycast_mesh(), blender::bke::pbvh::pbvh_faces_node_nearest_to_ray(), blender::bke::pbvh::update_normals_mesh(), and verts().


The documentation for this struct was generated from the following file: