|
Blender V5.0
|
Namespaces | |
| namespace | pixels |
| namespace | uv_islands |
Classes | |
| class | Node |
| struct | MeshNode |
| struct | GridsNode |
| struct | BMeshNode |
| class | DrawCache |
| class | Tree |
| struct | StackItem |
| struct | PBVHIter |
| struct | NodeTree |
| struct | PositionSourceResult |
| struct | RaycastData |
| struct | EdgeQueue |
| struct | EdgeQueueContext |
| struct | FastNodeBuildInfo |
Enumerations | |
| enum class | Type { Mesh , Grids , BMesh } |
| enum class | PositionSource : int8_t { Eval , EvalDeform , Orig , RuntimeDeform } |
| enum class | PlaneAABBIsect : int8_t { Inside , Outside , Intersect } |
Functions | |
| ENUM_OPERATORS (Node::Flags, Node::Flags::TopologyUpdated) | |
| void | build_pixels (const Depsgraph &depsgraph, Object &object, Image &image, ImageUser &image_user) |
| void | raycast (Tree &pbvh, FunctionRef< void(Node &node, float *tmin)> hit_fn, const float3 &ray_start, const float3 &ray_normal, bool original) |
| Bounds< float3 > | calc_face_bounds (const Span< float3 > vert_positions, const Span< int > face_verts) |
| int | partition_along_axis (const Span< float3 > face_centers, MutableSpan< int > faces, const int axis, const float middle) |
| int | partition_material_indices (const Span< int > material_indices, MutableSpan< int > faces) |
| bool | leaf_needs_material_split (const Span< int > faces, const Span< int > material_indices) |
| bool | 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 | 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 | node_raycast_bmesh (BMeshNode &node, const float3 &ray_start, const float3 &ray_normal, const IsectRayPrecalc *isect_precalc, float *depth, bool use_original, BMVert **r_active_vertex, float3 &r_face_normal) |
| bool | raycast_node_detail_bmesh (const BMeshNode &node, const float3 &ray_start, const IsectRayPrecalc *isect_precalc, float *depth, float *r_edge_length) |
| void | clip_ray_ortho (Tree &pbvh, bool original, float ray_start[3], float ray_end[3], float ray_normal[3]) |
| void | 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 | 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) |
| Bounds< float3 > | bounds_get (const Tree &pbvh) |
| bool | node_frustum_contain_aabb (const Node &node, Span< float4 > frustum_planes) |
| bool | node_frustum_exclude_aabb (const Node &node, Span< float4 > frustum_planes) |
| int | count_grid_quads (const BitGroupVector<> &grid_hidden, Span< int > grid_indices, int gridsize, int display_gridsize) |
| bool | bmesh_update_topology (BMesh &bm, Tree &pbvh, BMLog &bm_log, PBVHTopologyUpdateMode mode, float min_edge_len, float max_edge_len, const float3 ¢er, const std::optional< float3 > &view_normal, float radius, bool use_frontface, bool use_projected) |
| Span< int > | node_face_indices_calc_grids (const SubdivCCG &subdiv_ccg, const GridsNode &node, Vector< int > &faces) |
| void | store_bounds_orig (Tree &pbvh) |
| void | update_mask_mesh (const Mesh &mesh, const IndexMask &node_mask, Tree &pbvh) |
| void | update_mask_grids (const SubdivCCG &subdiv_ccg, const IndexMask &node_mask, Tree &pbvh) |
| void | update_mask_bmesh (const BMesh &bm, const IndexMask &node_mask, Tree &pbvh) |
| void | update_normals (const Depsgraph &depsgraph, Object &object_orig, Tree &pbvh) |
| void | update_normals_from_eval (Object &object_eval, Tree &pbvh) |
| IndexMask | nodes_to_face_selection_grids (const SubdivCCG &subdiv_ccg, Span< GridsNode > nodes, const IndexMask &nodes_mask, IndexMaskMemory &memory) |
| Span< float3 > | vert_positions_eval (const Depsgraph &depsgraph, const Object &object_orig) |
| Span< float3 > | vert_positions_eval_from_eval (const Object &object_eval) |
| MutableSpan< float3 > | vert_positions_eval_for_write (const Depsgraph &depsgraph, Object &object_orig) |
| Span< float3 > | vert_normals_eval (const Depsgraph &depsgraph, const Object &object_orig) |
| Span< float3 > | vert_normals_eval_from_eval (const Object &object_eval) |
| Span< float3 > | face_normals_eval_from_eval (const Object &object_eval) |
| IndexMask | all_leaf_nodes (const Tree &pbvh, IndexMaskMemory &memory) |
| IndexMask | search_nodes (const Tree &pbvh, IndexMaskMemory &memory, FunctionRef< bool(const Node &)> filter_fn) |
| void | node_update_mask_mesh (Span< float > mask, MeshNode &node) |
| void | node_update_mask_grids (const CCGKey &key, Span< float > masks, GridsNode &node) |
| void | node_update_mask_bmesh (int mask_offset, BMeshNode &node) |
| void | node_update_visibility_mesh (Span< bool > hide_vert, MeshNode &node) |
| void | node_update_visibility_grids (const BitGroupVector<> &grid_hidden, GridsNode &node) |
| void | node_update_visibility_bmesh (BMeshNode &node) |
| void | update_node_bounds_mesh (Span< float3 > positions, MeshNode &node) |
| void | update_node_bounds_grids (int grid_area, Span< float3 > positions, GridsNode &node) |
| void | update_node_bounds_bmesh (BMeshNode &node) |
| static Bounds< float3 > | negative_bounds () |
| static Bounds< float3 > | merge_bounds (const Bounds< float3 > &a, const Bounds< float3 > &b) |
| static BLI_NOINLINE void | build_mesh_leaf_nodes (const int verts_num, const OffsetIndices< int > faces, const Span< int > corner_verts, MutableSpan< MeshNode > nodes) |
| static void | build_nodes_recursive_mesh (const Span< int > material_indices, const int leaf_limit, const int node_index, const int parent_index, const std::optional< Bounds< float3 > > &bounds_precalc, const Span< float3 > face_centers, const int depth, MutableSpan< int > faces, Vector< MeshNode > &nodes) |
| static void | build_nodes_recursive_grids (const Span< int > material_indices, const int leaf_limit, const int node_index, const int parent_index, const std::optional< Bounds< float3 > > &bounds_precalc, const Span< float3 > face_centers, const int depth, MutableSpan< int > faces, Vector< GridsNode > &nodes) |
| static Bounds< float3 > | calc_face_grid_bounds (const OffsetIndices< int > faces, const Span< float3 > positions, const CCGKey &key, const int face) |
| static bool | tree_is_empty (const Tree &pbvh) |
| static Node & | first_node (Tree &pbvh) |
| static void | pbvh_iter_begin (PBVHIter *iter, Tree &pbvh, FunctionRef< bool(Node &)> scb) |
| static Node * | pbvh_iter_next (PBVHIter *iter, Node::Flags leaf_flag) |
| static Node * | pbvh_iter_next_occluded (PBVHIter *iter) |
| static void | node_tree_insert (NodeTree *tree, NodeTree *new_node) |
| static void | traverse_tree (NodeTree *tree, const FunctionRef< void(Node &node, float *tmin)> hit_fn, float *tmin) |
| static void | free_tree (NodeTree *tree) |
| static void | search_callback_occluded (Tree &pbvh, const FunctionRef< bool(Node &)> scb, const FunctionRef< void(Node &node, float *tmin)> hit_fn) |
| static bool | mesh_topology_count_matches (const Mesh &a, const Mesh &b) |
| static PositionSourceResult | cache_source_get (const Object &object_orig, const Object &object_eval) |
| static const SharedCache< Vector< float3 > > & | vert_normals_cache_eval (const Object &object_orig, const Object &object_eval) |
| static SharedCache< Vector< float3 > > & | vert_normals_cache_eval_for_write (Object &object_orig, Object &object_eval) |
| static const SharedCache< Vector< float3 > > & | face_normals_cache_eval (const Object &object_orig, const Object &object_eval) |
| static SharedCache< Vector< float3 > > & | face_normals_cache_eval_for_write (Object &object_orig, Object &object_eval) |
| static Span< float3 > | vert_positions_eval (const Object &object_orig, const Object &object_eval) |
| static MutableSpan< float3 > | vert_positions_eval_for_write (Object &object_orig, Object &object_eval) |
| static void | normals_calc_faces (const Span< float3 > positions, const OffsetIndices< int > faces, const Span< int > corner_verts, const Span< int > face_indices, MutableSpan< float3 > face_normals) |
| static void | calc_boundary_face_normals (const Span< float3 > positions, const OffsetIndices< int > faces, const Span< int > corner_verts, const Span< int > face_indices, MutableSpan< float3 > face_normals) |
| static void | calc_node_face_normals (const Span< float3 > positions, const OffsetIndices< int > faces, const Span< int > corner_verts, const Span< MeshNode > nodes, const IndexMask &nodes_to_update, MutableSpan< float3 > face_normals) |
| static void | normals_calc_verts_simple (const GroupedSpan< int > vert_to_face_map, const Span< float3 > face_normals, const Span< int > verts, MutableSpan< float3 > vert_normals) |
| static void | calc_boundary_vert_normals (const GroupedSpan< int > vert_to_face_map, const Span< float3 > face_normals, const Span< int > verts, MutableSpan< float3 > vert_normals) |
| static void | calc_node_vert_normals (const GroupedSpan< int > vert_to_face_map, const Span< float3 > face_normals, const Span< MeshNode > nodes, const IndexMask &nodes_to_update, MutableSpan< float3 > vert_normals) |
| static void | update_normals_mesh (Object &object_orig, Object &object_eval, const Span< MeshNode > nodes, const IndexMask &nodes_to_update) |
| static void | update_visibility_faces (const Mesh &mesh, const MutableSpan< MeshNode > nodes, const IndexMask &node_mask) |
| static void | update_visibility_grids (const SubdivCCG &subdiv_ccg, const MutableSpan< GridsNode > nodes, const IndexMask &node_mask) |
| static void | update_visibility_bmesh (const MutableSpan< BMeshNode > nodes, const IndexMask &node_mask) |
| static bool | ray_aabb_intersect (Node &node, const RaycastData &rcd) |
| void | raycast (Tree &pbvh, const FunctionRef< void(Node &node, float *tmin)> hit_fn, const float3 &ray_start, const float3 &ray_normal, bool original) |
| bool | ray_face_intersection_quad (const float3 &ray_start, const IsectRayPrecalc *isect_precalc, const float3 &t0, const float3 &t1, const float3 &t2, const float3 &t3, float *depth) |
| bool | ray_face_intersection_tri (const float3 &ray_start, const IsectRayPrecalc *isect_precalc, const float3 &t0, const float3 &t1, const float3 &t2, float *depth) |
| static float | dist_squared_ray_to_tri_v3_fast (const float3 &ray_origin, const float3 &ray_direction, const float3 &v0, const float3 &v1, const float3 &v2, float3 &r_point, float *r_depth) |
| bool | ray_face_nearest_quad (const float3 &ray_start, const float3 &ray_normal, const float3 &t0, const float3 &t1, const float3 &t2, const float3 &t3, float *r_depth, float *dist_sq) |
| bool | ray_face_nearest_tri (const float3 &ray_start, const float3 &ray_normal, const float3 &t0, const float3 &t1, const float3 &t2, float *r_depth, float *dist_sq) |
| static void | calc_mesh_intersect_data (const Span< int > corner_verts, const Span< int3 > corner_tris, const float3 &ray_start, const float3 &ray_normal, const int face_index, const int tri_index, const std::array< const float *, 3 > co, const float depth, int &r_active_vertex, int &r_active_face_index, float3 &r_face_normal) |
| static void | calc_grids_intersect_data (const float3 &ray_start, const float3 &ray_normal, const int grid, const short x, const short y, const std::array< const float *, 4 > co, const float depth, SubdivCCGCoord &r_active_vertex, int &r_active_grid_index, float3 &r_face_normal) |
| static bool | nearest_to_ray_aabb_dist_sq (Node *node, const DistRayAABB_Precalc &dist_ray_to_aabb_precalc, const bool original) |
| static bool | pbvh_faces_node_nearest_to_ray (const MeshNode &node, const Span< float3 > node_positions, const Span< float3 > vert_positions, const OffsetIndices< int > faces, const Span< int > corner_verts, const Span< int3 > corner_tris, const Span< bool > hide_poly, const float3 &ray_start, const float3 &ray_normal, float *r_depth, float *dist_sq) |
| static bool | pbvh_grids_node_nearest_to_ray (const SubdivCCG &subdiv_ccg, GridsNode &node, const Span< float3 > node_positions, const float ray_start[3], const float ray_normal[3], float *r_depth, float *dist_sq) |
| static PlaneAABBIsect | test_frustum_aabb (const Bounds< float3 > &bounds, const Span< float4 > frustum_planes) |
| static Vector< Node * > | search_gather (Tree &pbvh, const FunctionRef< bool(Node &)> scb, Node::Flags leaf_flag) |
| static void | pbvh_bmesh_node_finalize (BMeshNode &n, const int node_index, const int cd_vert_node_offset, const int cd_face_node_offset) |
| static void | pbvh_bmesh_node_split (Vector< BMeshNode > &nodes, Vector< bool > &node_changed, const int cd_vert_node_offset, const int cd_face_node_offset, const Span< Bounds< float3 > > face_bounds, const int node_index) |
| static bool | pbvh_bmesh_node_limit_ensure (BMesh &bm, Vector< BMeshNode > &nodes, Vector< bool > &node_changed, const int cd_vert_node_offset, const int cd_face_node_offset, const int node_index) |
| BLI_INLINE int | pbvh_bmesh_node_index_from_vert (const int cd_vert_node_offset, const BMVert *key) |
| BLI_INLINE int | pbvh_bmesh_node_index_from_face (const int cd_face_node_offset, const BMFace *key) |
| BLI_INLINE BMeshNode * | pbvh_bmesh_node_from_vert (MutableSpan< BMeshNode > nodes, const int cd_vert_node_offset, const BMVert *key) |
| BLI_INLINE BMeshNode * | pbvh_bmesh_node_from_face (MutableSpan< BMeshNode > nodes, const int cd_face_node_offset, const BMFace *key) |
| static BMVert * | pbvh_bmesh_vert_create (BMesh &bm, MutableSpan< BMeshNode > nodes, MutableSpan< bool > node_changed, BMLog &bm_log, const BMVert *v1, const BMVert *v2, const int node_index, const float3 &co, const float3 &no, const int cd_vert_node_offset, const int cd_vert_mask_offset) |
| static BMFace * | pbvh_bmesh_face_create (BMesh &bm, MutableSpan< BMeshNode > nodes, MutableSpan< bool > node_changed, const int cd_face_node_offset, BMLog &bm_log, const int node_index, const Span< BMVert * > v_tri, const Span< BMEdge * > e_tri, const BMFace *f_example) |
| static int | pbvh_bmesh_node_vert_use_count_at_most (MutableSpan< BMeshNode > nodes, const int cd_face_node_offset, const BMeshNode *node, BMVert *v, const int count_max) |
| static std::optional< int > | pbvh_bmesh_vert_other_node_find (const int cd_vert_node_offset, const int cd_face_node_offset, BMVert *v) |
| static void | pbvh_bmesh_vert_ownership_transfer (MutableSpan< BMeshNode > nodes, MutableSpan< bool > node_changed, const int cd_vert_node_offset, const int new_owner_index, BMVert *v) |
| static void | pbvh_bmesh_vert_remove (MutableSpan< BMeshNode > nodes, MutableSpan< bool > node_changed, const int cd_vert_node_offset, const int cd_face_node_offset, BMVert *v) |
| static void | pbvh_bmesh_face_remove (MutableSpan< BMeshNode > nodes, MutableSpan< bool > node_changed, const int cd_vert_node_offset, const int cd_face_node_offset, BMLog &bm_log, BMFace *f) |
| static Array< BMLoop * > | pbvh_bmesh_edge_loops (BMEdge *e) |
| static void | pbvh_bmesh_node_drop_orig (BMeshNode *node) |
| static bool | edge_queue_tri_in_sphere (const EdgeQueue *queue, BMFace *f) |
| static bool | edge_queue_tri_in_circle (const EdgeQueue *queue, BMFace *f) |
| static bool | check_mask (const EdgeQueueContext *eq_ctx, const BMVert *v) |
| static void | edge_queue_insert (const EdgeQueueContext *eq_ctx, BMEdge *e, const float priority) |
| static bool | is_boundary_edge (const BMEdge &edge) |
| static bool | is_boundary_vert (const BMVert &vertex) |
| static bool | is_edge_adjacent_to_boundary (const BMEdge &edge) |
| static float | long_edge_queue_priority (const BMEdge &edge) |
| static float | short_edge_queue_priority (const BMEdge &edge) |
| static void | long_edge_queue_edge_add (const EdgeQueueContext *eq_ctx, BMEdge *e) |
| static void | long_edge_queue_edge_add_recursive (const EdgeQueueContext *eq_ctx, const BMLoop *l_edge, const BMLoop *l_end, const float len_sq, const float limit_len) |
| static void | short_edge_queue_edge_add (const EdgeQueueContext *eq_ctx, BMEdge *e) |
| static void | long_edge_queue_face_add (const EdgeQueueContext *eq_ctx, BMFace *f) |
| static void | short_edge_queue_face_add (const EdgeQueueContext *eq_ctx, BMFace *f) |
| static void | long_edge_queue_create (const EdgeQueueContext *eq_ctx, const float max_edge_len, MutableSpan< BMeshNode > nodes, const float3 ¢er, const std::optional< float3 > view_normal, const float radius, const bool use_frontface, const bool use_projected) |
| static void | short_edge_queue_create (const EdgeQueueContext *eq_ctx, const float min_edge_len, MutableSpan< BMeshNode > nodes, const float3 ¢er, const std::optional< float3 > view_normal, const float radius, const bool use_frontface, const bool use_projected) |
| static void | copy_edge_data (BMesh &bm, BMEdge &dst, const BMEdge &src) |
| static void | merge_edge_data (BMesh &bm, BMEdge &dst, const BMEdge &src) |
| static void | pbvh_bmesh_split_edge (const EdgeQueueContext *eq_ctx, BMesh &bm, MutableSpan< BMeshNode > nodes, MutableSpan< bool > node_changed, const int cd_vert_node_offset, const int cd_face_node_offset, BMLog &bm_log, BMEdge *e) |
| static bool | pbvh_bmesh_subdivide_long_edges (const EdgeQueueContext *eq_ctx, BMesh &bm, MutableSpan< BMeshNode > nodes, MutableSpan< bool > node_changed, const int cd_vert_node_offset, const int cd_face_node_offset, BMLog &bm_log) |
| static bool | vert_in_face_adjacent_to_edge (BMVert &vert, BMEdge &edge) |
| static void | merge_flap_edge_data (BMesh &bm, const BMFace *del_face, const BMFace *flap_face, BMEdge *e, BMVert *v_del, const BMLoop *l_del, BMVert *v_conn) |
| static BMVert * | find_outer_flap_vert (BMFace &face) |
| static void | try_merge_flap_edge_data_before_dissolve (BMesh &bm, BMFace &face) |
| static void | merge_face_edge_data (BMesh &bm, BMFace *, BMFace *new_face, BMVert *v_del, const BMLoop *l_del, const BMVert *v_conn) |
| static void | pbvh_bmesh_collapse_edge (BMesh &bm, MutableSpan< BMeshNode > nodes, MutableSpan< bool > node_changed, const int cd_vert_node_offset, const int cd_face_node_offset, BMLog &bm_log, BMEdge *e, BMVert *v1, BMVert *v2, Map< BMVert *, BMVert * > &deleted_verts, const EdgeQueueContext *eq_ctx) |
| static bool | pbvh_bmesh_collapse_short_edges (const EdgeQueueContext *eq_ctx, const float min_edge_len, BMesh &bm, MutableSpan< BMeshNode > nodes, MutableSpan< bool > node_changed, const int cd_vert_node_offset, const int cd_face_node_offset, BMLog &bm_log) |
| bool | bmesh_node_nearest_to_ray (BMeshNode &node, const float3 &ray_start, const float3 &ray_normal, float *r_depth, float *dist_sq, const bool use_original) |
| void | bmesh_normals_update (Tree &pbvh, const IndexMask &nodes_to_update) |
| static void | pbvh_bmesh_node_limit_ensure_fast (const MutableSpan< BMFace * > nodeinfo, const Span< Bounds< float3 > > face_bounds, FastNodeBuildInfo *node, MemArena *arena) |
| static void | pbvh_bmesh_create_nodes_fast_recursive (Vector< BMeshNode > &nodes, const int cd_vert_node_offset, const int cd_face_node_offset, const Span< BMFace * > nodeinfo, const Span< Bounds< float3 > > face_bounds, const FastNodeBuildInfo *node, const int node_index, const int parent_index) |
| static void | copy_original_vert (BMLog *log, BMeshNode *node, BMVert *v, int i, bool use_original) |
| void | node_pixels_free (blender::bke::pbvh::Node *node) |
| void | pixels_free (blender::bke::pbvh::Tree *pbvh) |
BMesh Utility API | |
Use some local functions which assume triangles. | |
| static Bounds< float3 > | negative_bounds () |
| static std::array< BMEdge *, 3 > | bm_edges_from_tri (BMesh &bm, const Span< BMVert * > v_tri) |
| BLI_INLINE std::array< BMVert *, 3 > | bm_face_as_array (const BMFace &f) |
| static BMFace * | bm_face_exists_tri_from_loop_vert (const BMLoop *l_radial_first, const BMVert *v_opposite) |
| static BMVert * | bm_vert_hash_lookup_chain (Map< BMVert *, BMVert * > &deleted_verts, BMVert *v) |
Variables | |
| constexpr int | leaf_limit = 400 |
| static constexpr int | dyntopo_node_none = -1 |
|
strong |
|
strong |
|
strong |
| Enumerator | |
|---|---|
| Mesh | |
| Grids | |
| BMesh | |
Definition at line 221 of file BKE_paint_bvh.hh.
| IndexMask blender::bke::pbvh::all_leaf_nodes | ( | const Tree & | pbvh, |
| IndexMaskMemory & | memory ) |
Return pointers to all the leaf nodes in the BVH tree.
Definition at line 2628 of file pbvh.cc.
References all_leaf_nodes(), IndexMask::from_predicate(), i, and blender::bke::pbvh::Node::Leaf.
Referenced by all_leaf_nodes(), BKE_sculpt_update_object_before_eval(), blender::ed::sculpt_paint::smooth::blur_geometry_data_array(), blender::ed::sculpt_paint::undo::bmesh_restore_generic(), blender::ed::sculpt_paint::cloth::brush_affected_nodes_gather(), blender::ed::sculpt_paint::cloth::calc_constraint_factors(), blender::ed::sculpt_paint::islands::calc_topology_islands_bmesh(), blender::ed::sculpt_paint::face_set::change_visibility_exec(), blender::ed::sculpt_paint::cloth::cloth_sim_initialize_default_node_state(), blender::ed::sculpt_paint::face_set::create_op_exec(), blender::ed::sculpt_paint::face_set::edit_fairing(), blender::ed::sculpt_paint::face_set::edit_grow_shrink(), blender::ed::sculpt_paint::face_set::edit_modify_coordinates(), blender::ed::sculpt_paint::mask::fill_mask(), blender::ed::sculpt_paint::pose::grow_pose_factor(), blender::ed::sculpt_paint::hide::hide_show_all_exec(), blender::ed::sculpt_paint::hide::hide_show_masked_exec(), blender::ed::sculpt_paint::face_set::init_op_exec(), blender::ed::sculpt_paint::mask::invert_mask(), blender::ed::sculpt_paint::mask::mask_by_color_contiguous_mesh(), blender::ed::sculpt_paint::mask::mask_by_color_full_mesh(), blender::ed::sculpt_paint::mask::mask_from_boundary_exec(), blender::ed::sculpt_paint::mask::mask_from_cavity_exec(), blender::ed::sculpt_paint::face_set::randomize_colors_exec(), blender::ed::sculpt_paint::expand::restore_color_data(), blender::ed::sculpt_paint::expand::restore_face_set_data(), blender::ed::sculpt_paint::undo::restore_face_set_from_undo_step(), blender::ed::sculpt_paint::undo::restore_list(), blender::ed::sculpt_paint::undo::restore_mask_from_undo_step(), blender::ed::sculpt_paint::undo::restore_position_from_undo_step(), blender::draw::sculpt_batches_get_ex(), blender::ed::sculpt_paint::dyntopo::sculpt_detail_flood_fill_exec(), blender::ed::sculpt_paint::expand::sculpt_expand_invoke(), blender::ed::sculpt_paint::mask::sculpt_mask_filter_exec(), blender::ed::sculpt_paint::mask::sculpt_mask_init_exec(), blender::ed::sculpt_paint::store_mesh_from_eval(), transform_active_color(), blender::ed::sculpt_paint::expand::undo_push(), vertex_color_set_exec(), blender::ed::sculpt_paint::hide::visibility_filter_exec(), blender::ed::sculpt_paint::hide::visibility_invert_exec(), and blender::ed::sculpt_paint::expand::write_mask_data().
|
static |
Definition at line 113 of file pbvh_bmesh.cc.
References bm, BM_CREATE_NO_DOUBLE, and BM_edge_create().
Referenced by pbvh_bmesh_collapse_edge(), and pbvh_bmesh_split_edge().
| BLI_INLINE std::array< BMVert *, 3 > blender::bke::pbvh::bm_face_as_array | ( | const BMFace & | f | ) |
Definition at line 122 of file pbvh_bmesh.cc.
References BLI_assert, BLI_INLINE, BM_FACE_FIRST_LOOP, l, BMFace::len, and result.
Referenced by BKE_pbvh_bmesh_node_save_orig().
|
static |
A version of BM_face_exists, optimized for triangles when we know the loop and the opposite vertex.
Check if any triangle is formed by (l_radial_first->v, l_radial_first->next->v, v_opposite), at either winding (since its a triangle no special checks are needed).
l_radial_first->v & l_radial_first->next->v +---+ | / | / + v_opposite
Its assumed that l_radial_first is never forming the target face.
Definition at line 154 of file pbvh_bmesh.cc.
References BLI_assert, ELEM, BMLoop::f, BMFace::len, BMLoop::next, BMLoop::prev, BMLoop::radial_next, and BMLoop::v.
Referenced by pbvh_bmesh_collapse_edge().
|
static |
Uses a map of vertices to lookup the final target. References can't point to previous items (would cause infinite loop).
Definition at line 175 of file pbvh_bmesh.cc.
References blender::Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::lookup_ptr(), and v.
Referenced by pbvh_bmesh_collapse_short_edges().
| bool blender::bke::pbvh::bmesh_node_nearest_to_ray | ( | BMeshNode & | node, |
| const float3 & | ray_start, | ||
| const float3 & | ray_normal, | ||
| float * | r_depth, | ||
| float * | dist_sq, | ||
| const bool | use_original ) |
Definition at line 1915 of file pbvh_bmesh.cc.
References BLI_assert, BM_elem_flag_test, BM_ELEM_HIDDEN, BM_face_as_array_vert_tri(), blender::bke::pbvh::BMeshNode::bm_faces_, i, BMFace::len, blender::bke::pbvh::BMeshNode::orig_positions_, blender::bke::pbvh::BMeshNode::orig_tris_, and ray_face_nearest_tri().
Referenced by find_nearest_to_ray_node().
Definition at line 1952 of file pbvh_bmesh.cc.
References BM_face_normal_update(), blender::bke::pbvh::BMeshNode::bm_faces_, blender::bke::pbvh::BMeshNode::bm_other_verts_, blender::bke::pbvh::BMeshNode::bm_unique_verts_, BM_vert_normal_update(), blender::index_mask::IndexMask::foreach_index(), and i.
Referenced by blender::bke::pbvh::Tree::update_normals().
| 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 float3 & | center, | ||
| const std::optional< float3 > & | view_normal, | ||
| float | radius, | ||
| bool | use_frontface, | ||
| bool | use_projected ) |
Collapse short edges, subdivide long edges.
Definition at line 2239 of file pbvh_bmesh.cc.
References BKE_pbvh_bmesh_node_save_orig(), BLI_assert_msg, BLI_heapsimple_free(), BLI_mempool_create(), BLI_mempool_destroy(), BLI_MEMPOOL_NOP, bm, bmesh_update_topology(), CD_PROP_FLOAT, CD_PROP_INT32, CustomData_get_offset_named(), blender::IndexMask::from_bools(), blender::bke::pbvh::EdgeQueue::heap, blender::bke::pbvh::Node::Leaf, blender::math::length_squared(), long_edge_queue_create(), pbvh_bmesh_collapse_short_edges(), pbvh_bmesh_node_drop_orig(), pbvh_bmesh_subdivide_long_edges(), PBVH_Collapse, PBVH_Subdivide, short_edge_queue_create(), blender::bke::pbvh::Node::TopologyUpdated, and blender::bke::pbvh::Node::UpdateTopology.
Referenced by bmesh_update_topology(), blender::ed::sculpt_paint::dynamic_topology_update(), and blender::ed::sculpt_paint::dyntopo::sculpt_detail_flood_fill_exec().
Get the Tree root's bounding box.
Definition at line 1661 of file pbvh.cc.
References bounds_get().
Referenced by bounds_get(), blender::ed::sculpt_paint::ensure_valid_pivot(), blender::ed::sculpt_paint::dyntopo::sculpt_detail_flood_fill_exec(), blender::ed::sculpt_paint::tag_mesh_positions_changed(), and blender::draw::Manager::unique_handle_for_sculpt().
|
static |
Definition at line 80 of file pbvh.cc.
References BLI_NOINLINE, faces, blender::threading::parallel_for(), and SCOPED_TIMER_AVERAGED.
Referenced by blender::bke::pbvh::Tree::from_mesh().
|
static |
Definition at line 379 of file pbvh.cc.
References BLI_assert, build_nodes_recursive_grids(), blender::math::dominant_axis(), faces, blender::bke::pbvh::Node::flag_, blender::bke::pbvh::Node::Leaf, leaf_limit, leaf_needs_material_split(), blender::Bounds< T >::max, merge_bounds(), blender::math::midpoint(), blender::Bounds< T >::min, blender::math::min_max(), negative_bounds(), blender::threading::parallel_reduce(), blender::bke::pbvh::Node::parent_, partition_along_axis(), partition_material_indices(), blender::bke::pbvh::GridsNode::prim_indices_, split(), and STACK_FIXED_DEPTH.
Referenced by build_nodes_recursive_grids(), and blender::bke::pbvh::Tree::from_grids().
|
static |
Definition at line 143 of file pbvh.cc.
References BLI_assert, build_nodes_recursive_mesh(), blender::math::dominant_axis(), blender::bke::pbvh::MeshNode::face_indices_, faces, blender::bke::pbvh::Node::flag_, blender::bke::pbvh::Node::Leaf, leaf_limit, leaf_needs_material_split(), blender::Bounds< T >::max, merge_bounds(), blender::math::midpoint(), blender::Bounds< T >::min, blender::math::min_max(), negative_bounds(), blender::threading::parallel_reduce(), blender::bke::pbvh::Node::parent_, partition_along_axis(), partition_material_indices(), split(), and STACK_FIXED_DEPTH.
Referenced by build_nodes_recursive_mesh(), and blender::bke::pbvh::Tree::from_mesh().
| void blender::bke::pbvh::build_pixels | ( | const Depsgraph & | depsgraph, |
| Object & | object, | ||
| Image & | image, | ||
| ImageUser & | image_user ) |
Definition at line 484 of file pbvh_pixels.cc.
References depsgraph, blender::bke::object::pbvh_get(), and blender::bke::pbvh::pixels::update_pixels().
Referenced by sculpt_pbvh_update_pixels().
|
static |
Definition at line 917 of file pbvh.cc.
References BKE_object_get_evaluated_mesh_no_subsurf(), BKE_object_get_mesh_deform_eval(), BLI_assert, Object::data, SculptSession::deform_cos, Eval, EvalDeform, Mesh, mesh_topology_count_matches(), Object::mode, OB_MODE_VERTEX_PAINT, OB_MODE_WEIGHT_PAINT, Orig, blender::bke::object::pbvh_get(), RuntimeDeform, Object::sculpt, and Mesh::verts_num.
Referenced by face_normals_cache_eval(), vert_normals_cache_eval(), vert_positions_eval(), and vert_positions_eval_for_write().
|
static |
Definition at line 1090 of file pbvh.cc.
References faces, blender::Span< T >::index_range(), and blender::threading::parallel_for().
Referenced by update_normals_mesh().
|
static |
Definition at line 1131 of file pbvh.cc.
References blender::threading::parallel_for(), and verts.
Referenced by update_normals_mesh().
|
inline |
Definition at line 350 of file BKE_paint_bvh.hh.
References blender::Span< T >::first(), blender::math::min_max(), blender::Span< T >::size(), and blender::Span< T >::slice().
Referenced by blender::bke::compute_local_mesh_groups(), and blender::bke::pbvh::Tree::from_mesh().
|
static |
Definition at line 459 of file pbvh.cc.
References calc_face_grid_bounds(), blender::bke::ccg::face_range(), faces, blender::math::min_max(), negative_bounds(), and blender::Span< T >::slice().
Referenced by calc_face_grid_bounds(), and blender::bke::pbvh::Tree::from_grids().
|
static |
Definition at line 2058 of file pbvh.cc.
References calc_grids_intersect_data(), copy_v3_v3(), i, len_squared_v3v3(), normal_quad_v3(), x, and y.
Referenced by calc_grids_intersect_data(), and node_raycast_grids().
|
static |
Definition at line 1945 of file pbvh.cc.
References calc_mesh_intersect_data(), i, len_squared_v3v3(), and normal_tri_v3().
Referenced by calc_mesh_intersect_data(), and node_raycast_mesh().
|
static |
Definition at line 1101 of file pbvh.cc.
References faces, blender::index_mask::IndexMask::foreach_index(), i, and normals_calc_faces().
Referenced by update_normals_mesh().
|
static |
Definition at line 1141 of file pbvh.cc.
References blender::index_mask::IndexMask::foreach_index(), i, normals_calc_verts_simple(), and verts.
Referenced by update_normals_mesh().
|
static |
Return true if the vertex mask is less than 1.0, false otherwise.
Definition at line 761 of file pbvh_bmesh.cc.
References BM_ELEM_CD_GET_FLOAT, blender::bke::pbvh::EdgeQueueContext::cd_vert_mask_offset, and v.
Referenced by edge_queue_insert().
| void blender::bke::pbvh::clip_ray_ortho | ( | Tree & | 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 2182 of file pbvh.cc.
References add_v3_v3(), axis_dominant_v3_to_m3(), b, clip_ray_ortho(), copy_v3_v3(), first_node(), FLT_MAX, interp_v3_v3v3(), isect_ray_aabb_v3(), isect_ray_aabb_v3_precalc(), line_point_factor_v3(), madd_v3_v3v3fl(), blender::Bounds< T >::max, max, mid_v3_v3v3(), blender::Bounds< T >::min, min, minmax_v3v3_v3(), mul_m3_v3(), mul_v3_v3fl(), sub_v3_v3v3(), and tree_is_empty().
Referenced by clip_ray_ortho(), and blender::ed::sculpt_paint::raycast_init().
Copy custom data from src to dst edge.
Definition at line 1095 of file pbvh_bmesh.cc.
References bm, BM_ELEM_TAG, CustomData_bmesh_copy_block(), BMHeader::data, BMEdge::head, and BMHeader::hflag.
Referenced by pbvh_bmesh_split_edge().
|
static |
Definition at line 2347 of file pbvh_bmesh.cc.
References BM_log_find_original_vert_co(), copy_original_vert(), i, log, blender::bke::pbvh::BMeshNode::orig_positions_, blender::bke::pbvh::BMeshNode::orig_verts_, and v.
Referenced by BKE_pbvh_bmesh_node_save_orig(), and copy_original_vert().
| int blender::bke::pbvh::count_grid_quads | ( | const BitGroupVector<> & | grid_hidden, |
| Span< int > | grid_indices, | ||
| int | gridsize, | ||
| int | display_gridsize ) |
Returns the number of visible quads in the nodes' grids.
Definition at line 1605 of file pbvh.cc.
References count_grid_quads(), blender::bits::BitGroupVector< InlineBufferCapacity, Allocator >::is_empty(), log2, paint_is_grid_face_hidden(), blender::Span< T >::size(), x, and y.
Referenced by count_grid_quads(), and blender::draw::pbvh::create_tri_index_grids().
|
static |
Definition at line 1868 of file pbvh.cc.
References copy_v3_v3(), dist_squared_ray_to_seg_v3(), dist_squared_ray_to_tri_v3_fast(), FLT_MAX, i, and v2.
Referenced by dist_squared_ray_to_tri_v3_fast(), ray_face_nearest_quad(), and ray_face_nearest_tri().
|
static |
Definition at line 766 of file pbvh_bmesh.cc.
References BLI_assert, BLI_heapsimple_insert(), BLI_mempool_alloc(), BM_elem_flag_test_bool, BM_ELEM_HIDDEN, blender::bke::pbvh::EdgeQueueContext::cd_vert_mask_offset, check_mask(), e, EDGE_QUEUE_ENABLE, EDGE_QUEUE_TEST, blender::bke::pbvh::EdgeQueue::heap, blender::bke::pbvh::EdgeQueueContext::pool, and blender::bke::pbvh::EdgeQueueContext::queue.
Referenced by long_edge_queue_edge_add(), long_edge_queue_edge_add_recursive(), and short_edge_queue_edge_add().
Definition at line 739 of file pbvh_bmesh.cc.
References BLI_assert_msg, BM_face_as_array_vert_tri(), blender::bke::pbvh::EdgeQueue::center_proj, closest_on_tri_to_point_v3(), blender::math::distance_squared(), project_plane_normalized_v3_v3v3(), blender::bke::pbvh::EdgeQueue::radius_squared, and blender::bke::pbvh::EdgeQueue::view_normal.
Referenced by long_edge_queue_create(), and short_edge_queue_create().
Definition at line 725 of file pbvh_bmesh.cc.
References BM_face_as_array_vert_tri(), blender::bke::pbvh::EdgeQueue::center, closest_on_tri_to_point_v3(), blender::math::distance_squared(), and blender::bke::pbvh::EdgeQueue::radius_squared.
Referenced by long_edge_queue_create(), and short_edge_queue_create().
| blender::bke::pbvh::ENUM_OPERATORS | ( | Node::Flags | , |
| Node::Flags::TopologyUpdated | ) |
References blender::bke::pbvh::Node::TopologyUpdated.
|
static |
Definition at line 973 of file pbvh.cc.
References BLI_assert, BLI_assert_unreachable, cache_source_get(), Object::data, Eval, EvalDeform, SculptSession::face_normals_deform, Mesh, Orig, blender::bke::object::pbvh_get(), result, Mesh::runtime, RuntimeDeform, and Object::sculpt.
Referenced by face_normals_cache_eval_for_write(), and face_normals_eval_from_eval().
|
static |
Definition at line 993 of file pbvh.cc.
References face_normals_cache_eval().
Referenced by update_normals_mesh().
Definition at line 1072 of file pbvh.cc.
References BLI_assert, DEG_get_original(), DEG_is_original(), and face_normals_cache_eval().
Referenced by blender::draw::pbvh::update_normals_mesh().
| 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 ) |
Definition at line 2294 of file pbvh.cc.
References dist_squared_ray_to_aabb_v3_precalc(), find_nearest_to_ray(), nearest_to_ray_aabb_dist_sq(), and search_callback_occluded().
Referenced by find_nearest_to_ray(), and blender::ed::sculpt_paint::stroke_get_location_bvh_ex().
| 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 ) |
Definition at line 2432 of file pbvh.cc.
References BLI_assert_unreachable, BMesh, bmesh_node_nearest_to_ray(), faces, find_nearest_to_ray_node(), blender::bke::pbvh::Node::flag_, blender::bke::pbvh::Node::FullyHidden, Grids, Mesh, pbvh_faces_node_nearest_to_ray(), and pbvh_grids_node_nearest_to_ray().
Referenced by find_nearest_to_ray_node(), and blender::ed::sculpt_paint::sculpt_find_nearest_to_ray_cb().
Find vertex which can be an outer for the flap face: the vertex will become loose when the face and its edges are removed. If there are multiple of such vertices, return null.
Definition at line 1392 of file pbvh_bmesh.cc.
References BM_ITER_ELEM, BM_vert_face_count_at_most(), and BM_VERTS_OF_FACE.
Referenced by try_merge_flap_edge_data_before_dissolve().
Definition at line 688 of file pbvh.cc.
References BLI_assert, and tree_is_empty().
Referenced by clip_ray_ortho(), and pbvh_iter_begin().
|
static |
Definition at line 832 of file pbvh.cc.
References free(), free_tree(), and tree.
Referenced by free_tree(), and search_callback_occluded().
|
static |
Return true if the edge is a boundary edge: both its vertices are on a boundary.
Definition at line 789 of file pbvh_bmesh.cc.
References BM_edge_is_manifold(), BM_ELEM_SEAM, BM_ELEM_SMOOTH, BMEdge::head, and BMHeader::hflag.
Referenced by is_boundary_vert(), and short_edge_queue_priority().
|
static |
Definition at line 807 of file pbvh_bmesh.cc.
References BM_DISK_EDGE_NEXT, BMVert::e, and is_boundary_edge().
Referenced by is_edge_adjacent_to_boundary(), and pbvh_bmesh_collapse_edge().
|
static |
Return true if at least one of the edge vertices is adjacent to a boundary.
Definition at line 824 of file pbvh_bmesh.cc.
References is_boundary_vert(), BMEdge::v1, and BMEdge::v2.
Referenced by short_edge_queue_priority().
| bool blender::bke::pbvh::leaf_needs_material_split | ( | const Span< int > | faces, |
| const Span< int > | material_indices ) |
Definition at line 133 of file pbvh.cc.
References faces, blender::Span< T >::is_empty(), and leaf_needs_material_split().
Referenced by build_nodes_recursive_grids(), build_nodes_recursive_mesh(), leaf_needs_material_split(), and blender::bke::partition_faces_recursively().
|
static |
Create a priority queue containing vertex pairs connected by a long edge as defined by Tree.bm_max_edge_len.
Only nodes marked for topology update are checked, and in those nodes only edges used by a face intersecting the (center, radius) sphere are checked.
The highest priority (lowest number) is given to the longest edge.
Definition at line 987 of file pbvh_bmesh.cc.
References BLI_assert_msg, BLI_heapsimple_new(), blender::bke::pbvh::EdgeQueue::center, blender::bke::pbvh::EdgeQueue::center_proj, edge_queue_tri_in_circle(), blender::bke::pbvh::EdgeQueue::edge_queue_tri_in_range, edge_queue_tri_in_sphere(), blender::bke::pbvh::Node::FullyHidden, blender::bke::pbvh::EdgeQueue::heap, blender::bke::pbvh::Node::Leaf, blender::bke::pbvh::EdgeQueue::limit_len, blender::bke::pbvh::EdgeQueue::limit_len_squared, long_edge_queue_face_add(), project_plane_normalized_v3_v3v3(), blender::bke::pbvh::EdgeQueueContext::queue, blender::bke::pbvh::EdgeQueue::radius_squared, blender::bke::pbvh::Node::UpdateTopology, blender::bke::pbvh::EdgeQueue::use_front_face, and blender::bke::pbvh::EdgeQueue::view_normal.
Referenced by bmesh_update_topology().
|
static |
Definition at line 868 of file pbvh_bmesh.cc.
References BM_edge_calc_length_squared(), e, edge_queue_insert(), EDGE_QUEUE_TEST, blender::bke::pbvh::EdgeQueue::limit_len_squared, long_edge_queue_priority(), and blender::bke::pbvh::EdgeQueueContext::queue.
Referenced by pbvh_bmesh_split_edge().
|
static |
Definition at line 877 of file pbvh_bmesh.cc.
References BLI_assert, BM_edge_calc_length_squared(), dot_v3v3(), BMLoop::e, e, edge_queue_insert(), EDGE_QUEUE_TEST, BMLoop::f, G, i, long_edge_queue_edge_add_recursive(), long_edge_queue_priority(), max_ff(), BMLoop::next, BMFace::no, BMLoop::prev, blender::bke::pbvh::EdgeQueueContext::queue, BMLoop::radial_next, square_f(), UNLIKELY, blender::bke::pbvh::EdgeQueue::use_front_face, and blender::bke::pbvh::EdgeQueue::view_normal.
Referenced by long_edge_queue_edge_add_recursive(), and long_edge_queue_face_add().
|
static |
Definition at line 937 of file pbvh_bmesh.cc.
References BM_edge_calc_length_squared(), BM_FACE_FIRST_LOOP, dot_v3v3(), BMLoop::e, blender::bke::pbvh::EdgeQueue::edge_queue_tri_in_range, blender::bke::pbvh::EdgeQueue::limit_len, blender::bke::pbvh::EdgeQueue::limit_len_squared, long_edge_queue_edge_add_recursive(), BMLoop::next, BMFace::no, blender::bke::pbvh::EdgeQueueContext::queue, BMLoop::radial_next, blender::bke::pbvh::EdgeQueue::use_front_face, and blender::bke::pbvh::EdgeQueue::view_normal.
Referenced by long_edge_queue_create(), and pbvh_bmesh_split_edge().
Definition at line 849 of file pbvh_bmesh.cc.
References BM_edge_calc_length_squared().
Referenced by long_edge_queue_edge_add(), and long_edge_queue_edge_add_recursive().
|
static |
Definition at line 56 of file pbvh.cc.
References b, and blender::bounds::merge().
Referenced by build_nodes_recursive_grids(), build_nodes_recursive_mesh(), blender::bke::pbvh::Tree::from_grids(), and blender::bke::pbvh::Tree::from_mesh().
Definition at line 1102 of file pbvh_bmesh.cc.
References bm, BM_data_interp_from_edges(), BM_ELEM_SMOOTH, BM_ELEM_TAG, BMEdge::head, and BMHeader::hflag.
Referenced by merge_face_edge_data(), merge_flap_edge_data(), and try_merge_flap_edge_data_before_dissolve().
|
static |
Merge attributes of edges from v_del to f
This function is to be called before faces adjacent to e are deleted. This function only handles edge attributes. and does not handle face deletion.
| del_face | Face which is adjacent to v_del and will be deleted as part of merging v_del to v_conn. |
| new_face | A new face which is created from del_face by replacing v_del with v_conn. |
| v_del | A vertex which will be removed after the edge collapse. |
| l_del | A loop of del_face which is adjacent to v_del. |
| v_conn | A vertex which into which geometry is reconnected to after the edge collapse. |
Definition at line 1466 of file pbvh_bmesh.cc.
References BLI_assert, bm, BM_edge_exists(), BM_edge_other_vert(), BM_EDGES_OF_FACE, BM_ITER_ELEM, BM_vert_in_edge(), CLOG_WARN, LOG, merge_edge_data(), BMLoop::next, BMLoop::prev, and BMLoop::v.
Referenced by pbvh_bmesh_collapse_edge().
|
static |
Merge attributes of a flap face into an edge which will remain after the edge collapse in pbvh_bmesh_collapse_edge.
This function is to be called before faces adjacent to e are deleted. This function only handles edge attributes and does not handle face deletion.
| del_face | Face which is adjacent to v_del and will form a flap when merging v_del to v_conn. |
| flap_face | Face which is adjacent to v_conn and will form a flap when merging v_del to v_conn. |
| e | An edge which is being collapsed. It connects v_del and v_conn. |
| v_del | A vertex which will be removed after the edge collapse. |
| l_del | A loop of del_face which is adjacent to v_del. |
| v_conn | A vertex which into which geometry is reconnected to after the edge collapse. |
Definition at line 1315 of file pbvh_bmesh.cc.
References BLI_assert, bm, BM_edge_exists(), BM_edge_in_face(), BM_edge_other_vert(), CLOG_WARN, e, LOG, merge_edge_data(), BMLoop::next, BMLoop::prev, UNUSED_VARS_NDEBUG, BMLoop::v, BMEdge::v1, BMEdge::v2, v2, and vert_in_face_adjacent_to_edge().
Referenced by pbvh_bmesh_collapse_edge().
Logic used to test whether to use the evaluated mesh for positions.
Definition at line 899 of file pbvh.cc.
References b, Mesh::corners_num, Mesh::faces_num, and Mesh::verts_num.
Referenced by cache_source_get().
|
static |
Definition at line 2271 of file pbvh.cc.
References blender::bke::pbvh::Node::bounds_, blender::bke::pbvh::Node::bounds_orig_, dist_squared_ray_to_aabb_v3(), nearest_to_ray_aabb_dist_sq(), and blender::bke::pbvh::Node::tmin_.
Referenced by find_nearest_to_ray(), and nearest_to_ray_aabb_dist_sq().
Create invalid bounds for use with math::min_max.
Definition at line 51 of file pbvh.cc.
Referenced by build_nodes_recursive_grids(), build_nodes_recursive_mesh(), calc_face_grid_bounds(), blender::bke::pbvh::Tree::from_bmesh(), blender::bke::pbvh::Tree::from_grids(), blender::bke::pbvh::Tree::from_mesh(), pbvh_bmesh_node_finalize(), pbvh_bmesh_node_limit_ensure(), pbvh_bmesh_node_limit_ensure_fast(), pbvh_bmesh_node_split(), update_node_bounds_bmesh(), update_node_bounds_grids(), and update_node_bounds_mesh().
Definition at line 108 of file pbvh_bmesh.cc.
| Span< int > blender::bke::pbvh::node_face_indices_calc_grids | ( | const SubdivCCG & | subdiv_ccg, |
| const GridsNode & | node, | ||
| Vector< int > & | faces ) |
Gather the indices of all base mesh faces in the node. For convenience, pass a reference to the data in the result.
Definition at line 1767 of file pbvh.cc.
References faces, SubdivCCG::grid_to_face_map, blender::bke::pbvh::GridsNode::grids(), and node_face_indices_calc_grids().
Referenced by blender::ed::sculpt_paint::face_set::clear_face_sets(), blender::ed::sculpt_paint::face_set::face_hide_update(), blender::ed::sculpt_paint::face_set::face_sets_update(), blender::ed::sculpt_paint::undo::fill_node_data_grids(), blender::ed::sculpt_paint::face_set::gesture_apply_mesh(), node_face_indices_calc_grids(), blender::ed::sculpt_paint::undo::restore_face_set_from_undo_step(), and blender::ed::sculpt_paint::undo::restore_list().
| bool blender::bke::pbvh::node_frustum_contain_aabb | ( | const Node & | node, |
| Span< float4 > | frustum_planes ) |
Test if AABB is at least partially inside the #PBVHFrustumPlanes volume.
Definition at line 2520 of file pbvh.cc.
References blender::bke::pbvh::Node::bounds_, node_frustum_contain_aabb(), Outside, and test_frustum_aabb().
Referenced by node_frustum_contain_aabb(), and blender::draw::sculpt_batches_get_ex().
| bool blender::bke::pbvh::node_frustum_exclude_aabb | ( | const Node & | node, |
| Span< float4 > | frustum_planes ) |
Test if AABB is at least partially outside the #PBVHFrustumPlanes volume.
Definition at line 2525 of file pbvh.cc.
References blender::bke::pbvh::Node::bounds_, Inside, node_frustum_exclude_aabb(), and test_frustum_aabb().
Referenced by node_frustum_exclude_aabb().
| void blender::bke::pbvh::node_pixels_free | ( | blender::bke::pbvh::Node * | node | ) |
Definition at line 490 of file pbvh_pixels.cc.
References blender::bke::pbvh::Node::pixels_.
Referenced by blender::bke::pbvh::Tree::~Tree().
| bool blender::bke::pbvh::node_raycast_bmesh | ( | BMeshNode & | node, |
| const float3 & | ray_start, | ||
| const float3 & | ray_normal, | ||
| const IsectRayPrecalc * | isect_precalc, | ||
| float * | depth, | ||
| bool | use_original, | ||
| BMVert ** | r_active_vertex, | ||
| float3 & | r_face_normal ) |
Definition at line 1796 of file pbvh_bmesh.cc.
References BLI_assert, BM_elem_flag_test, BM_ELEM_HIDDEN, BM_face_as_array_vert_tri(), blender::bke::pbvh::BMeshNode::bm_faces_, blender::math::distance_squared(), i, BMFace::len, blender::math::normal_tri(), blender::bke::pbvh::BMeshNode::orig_positions_, blender::bke::pbvh::BMeshNode::orig_tris_, blender::bke::pbvh::BMeshNode::orig_verts_, and ray_face_intersection_tri().
Referenced by blender::ed::sculpt_paint::sculpt_raycast_cb().
| 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 ) |
Definition at line 2092 of file pbvh.cc.
References BKE_subdiv_ccg_key_top_level(), calc_grids_intersect_data(), CCG_grid_xy_to_index(), SubdivCCG::grid_hidden, blender::bke::ccg::grid_range(), CCGKey::grid_size, blender::bke::pbvh::GridsNode::grids(), i, blender::Span< T >::index_range(), blender::bits::BitGroupVector< InlineBufferCapacity, Allocator >::is_empty(), blender::Span< T >::is_empty(), node_raycast_grids(), paint_is_grid_face_hidden(), SubdivCCG::positions, ray_face_intersection_quad(), blender::Span< T >::slice(), x, and y.
Referenced by node_raycast_grids(), and blender::ed::sculpt_paint::sculpt_raycast_cb().
| 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 ) |
Definition at line 1976 of file pbvh.cc.
References calc_mesh_intersect_data(), blender::bke::mesh::face_triangles_range(), blender::bke::pbvh::MeshNode::faces(), faces, i, blender::VectorSet< Key, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::index_of(), blender::Span< T >::index_range(), blender::Span< T >::is_empty(), node_raycast_mesh(), ray_face_intersection_tri(), and blender::bke::pbvh::MeshNode::vert_indices_.
Referenced by node_raycast_mesh(), and blender::ed::sculpt_paint::sculpt_raycast_cb().
Definition at line 797 of file pbvh.cc.
References blender::bke::pbvh::NodeTree::data, node_tree_insert(), blender::bke::pbvh::Node::tmin_, and tree.
Referenced by node_tree_insert(), and search_callback_occluded().
| void blender::bke::pbvh::node_update_mask_bmesh | ( | int | mask_offset, |
| BMeshNode & | node ) |
Definition at line 1479 of file pbvh.cc.
References BLI_assert, BM_ELEM_CD_GET_FLOAT, blender::bke::pbvh::BMeshNode::bm_other_verts_, blender::bke::pbvh::BMeshNode::bm_unique_verts_, blender::bke::pbvh::Node::flag_, blender::bke::pbvh::Node::FullyMasked, blender::bke::pbvh::Node::FullyUnmasked, node_update_mask_bmesh(), and SET_FLAG_FROM_TEST.
Referenced by blender::ed::sculpt_paint::mask::apply_mask_from_settings(), blender::ed::sculpt_paint::mask::apply_new_mask_bmesh(), blender::ed::sculpt_paint::mask::decrease_contrast_mask_bmesh(), blender::ed::sculpt_paint::brushes::do_mask_brush(), blender::ed::sculpt_paint::mask::gesture_apply_for_symmetry_pass(), blender::ed::sculpt_paint::mask::increase_contrast_mask_bmesh(), blender::ed::sculpt_paint::mask::invert_mask_bmesh(), node_update_mask_bmesh(), blender::ed::sculpt_paint::undo::restore_mask_from_undo_step(), blender::ed::sculpt_paint::mask::sculpt_mask_init_exec(), update_mask_bmesh(), and blender::ed::sculpt_paint::expand::update_mask_bmesh().
| void blender::bke::pbvh::node_update_mask_grids | ( | const CCGKey & | key, |
| Span< float > | masks, | ||
| GridsNode & | node ) |
Definition at line 1449 of file pbvh.cc.
References blender::bke::pbvh::Node::flag_, blender::bke::pbvh::Node::FullyMasked, blender::bke::pbvh::Node::FullyUnmasked, blender::bke::ccg::grid_range(), blender::bke::pbvh::GridsNode::grids(), mask(), node_update_mask_grids(), SET_FLAG_FROM_TEST, and blender::Span< T >::slice().
Referenced by blender::ed::sculpt_paint::mask::apply_mask_from_settings(), blender::ed::sculpt_paint::mask::apply_new_mask_grids(), blender::ed::sculpt_paint::mask::decrease_contrast_mask_grids(), blender::ed::sculpt_paint::brushes::do_mask_brush(), blender::ed::sculpt_paint::mask::gesture_apply_for_symmetry_pass(), blender::ed::sculpt_paint::mask::increase_contrast_mask_grids(), blender::ed::sculpt_paint::mask::init_mask_grids(), blender::ed::sculpt_paint::mask::invert_mask_grids(), node_update_mask_grids(), blender::ed::sculpt_paint::undo::restore_mask_from_undo_step(), update_mask_grids(), and blender::ed::sculpt_paint::expand::update_mask_grids().
Definition at line 1421 of file pbvh.cc.
References blender::bke::pbvh::MeshNode::all_verts(), blender::bke::pbvh::Node::flag_, blender::bke::pbvh::Node::FullyMasked, blender::bke::pbvh::Node::FullyUnmasked, mask(), node_update_mask_mesh(), SET_FLAG_FROM_TEST, and verts.
Referenced by blender::ed::sculpt_paint::mask::apply_mask_from_settings(), blender::ed::sculpt_paint::mask::apply_new_mask_mesh(), blender::ed::sculpt_paint::mask::decrease_contrast_mask_mesh(), blender::ed::sculpt_paint::brushes::do_mask_brush(), blender::ed::sculpt_paint::mask::increase_contrast_mask_mesh(), node_update_mask_mesh(), blender::ed::sculpt_paint::undo::restore_mask_from_undo_step(), update_mask_mesh(), blender::ed::sculpt_paint::mask::update_mask_mesh(), and blender::ed::sculpt_paint::mask::write_mask_mesh().
| void blender::bke::pbvh::node_update_visibility_bmesh | ( | BMeshNode & | node | ) |
Definition at line 1560 of file pbvh.cc.
References Set< Key, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::begin(), blender::bke::pbvh::BMeshNode::bm_other_verts_, blender::bke::pbvh::BMeshNode::bm_unique_verts_, Set< Key, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::end(), blender::bke::pbvh::Node::flag_, blender::bke::pbvh::Node::FullyHidden, node_update_visibility_bmesh(), and SET_FLAG_FROM_TEST.
Referenced by node_update_visibility_bmesh(), and update_visibility_bmesh().
| void blender::bke::pbvh::node_update_visibility_grids | ( | const BitGroupVector<> & | grid_hidden, |
| GridsNode & | node ) |
Definition at line 1536 of file pbvh.cc.
References Span< T >::begin(), BLI_assert, Span< T >::end(), blender::bke::pbvh::Node::flag_, blender::bke::pbvh::Node::FullyHidden, blender::bits::BitGroupVector< InlineBufferCapacity, Allocator >::is_empty(), node_update_visibility_grids(), blender::bke::pbvh::GridsNode::prim_indices_, and SET_FLAG_FROM_TEST.
Referenced by blender::ed::sculpt_paint::hide::grid_hide_update(), blender::ed::sculpt_paint::hide::invert_visibility_grids(), node_update_visibility_grids(), and update_visibility_grids().
Definition at line 1512 of file pbvh.cc.
References blender::bke::pbvh::MeshNode::all_verts(), BLI_assert, blender::bke::pbvh::Node::flag_, blender::bke::pbvh::Node::FullyHidden, blender::Span< T >::is_empty(), node_update_visibility_mesh(), SET_FLAG_FROM_TEST, and verts.
Referenced by blender::ed::sculpt_paint::hide::flush_face_changes_node(), node_update_visibility_mesh(), blender::ed::sculpt_paint::hide::update_node_visibility_from_face_changes(), and update_visibility_faces().
| IndexMask blender::bke::pbvh::nodes_to_face_selection_grids | ( | const SubdivCCG & | subdiv_ccg, |
| Span< GridsNode > | nodes, | ||
| const IndexMask & | nodes_mask, | ||
| IndexMaskMemory & | memory ) |
Definition at line 1643 of file pbvh.cc.
References SubdivCCG::faces, blender::index_mask::IndexMask::foreach_index(), IndexMask::from_bools(), SubdivCCG::grid_to_face_map, i, and nodes_to_face_selection_grids().
Referenced by nodes_to_face_selection_grids(), and blender::bke::pbvh::Tree::update_normals().
|
static |
Definition at line 1079 of file pbvh.cc.
References blender::bke::mesh::face_normal_calc(), faces, i, and blender::Span< T >::slice().
Referenced by calc_node_face_normals().
|
static |
Definition at line 1113 of file pbvh.cc.
References length(), blender::math::normalize_and_get_length(), and verts.
Referenced by calc_node_vert_normals().
| int blender::bke::pbvh::partition_along_axis | ( | const Span< float3 > | face_centers, |
| MutableSpan< int > | faces, | ||
| const int | axis, | ||
| const float | middle ) |
Definition at line 61 of file pbvh.cc.
References faces, and split().
Referenced by build_nodes_recursive_grids(), build_nodes_recursive_mesh(), and blender::bke::partition_faces_recursively().
| int blender::bke::pbvh::partition_material_indices | ( | const Span< int > | material_indices, |
| MutableSpan< int > | faces ) |
Definition at line 72 of file pbvh.cc.
References faces, and split().
Referenced by build_nodes_recursive_grids(), build_nodes_recursive_mesh(), and blender::bke::partition_faces_recursively().
|
static |
Definition at line 1530 of file pbvh_bmesh.cc.
References Set< Key, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::add(), blender::Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::add_new(), add_v3_v3(), blender::Vector< T, InlineBufferCapacity, Allocator >::append(), BLI_assert, bm, BM_edge_in_face(), BM_edge_is_wire(), BM_edge_kill(), bm_edges_from_tri(), BM_ELEM_CD_GET_FLOAT, BM_face_exists(), bm_face_exists_tri_from_loop_vert(), BM_FACE_FIRST_LOOP, BM_face_kill(), BM_log_vert_before_modified(), BM_log_vert_removed(), BM_LOOPS_OF_VERT_ITER_BEGIN, BM_LOOPS_OF_VERT_ITER_END, blender::bke::pbvh::BMeshNode::bm_other_verts_, blender::bke::pbvh::BMeshNode::bm_unique_verts_, BM_vert_face_check(), BM_vert_kill(), blender::bke::pbvh::EdgeQueueContext::cd_vert_mask_offset, BMVert::co, Set< Key, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::contains(), BMLoop::e, e, BMLoop::f, is_boundary_vert(), l, merge_face_edge_data(), merge_flap_edge_data(), mid_v3_v3v3(), BMLoop::next, BMVert::no, normalize_v3(), pbvh_bmesh_face_create(), pbvh_bmesh_face_remove(), pbvh_bmesh_node_from_face(), pbvh_bmesh_node_index_from_face(), pbvh_bmesh_vert_remove(), try_merge_flap_edge_data_before_dissolve(), BMLoop::v, and v2.
Referenced by pbvh_bmesh_collapse_short_edges().
|
static |
Definition at line 1724 of file pbvh_bmesh.cc.
References BLI_heapsimple_is_empty(), BLI_heapsimple_pop_min(), BLI_mempool_free(), BLI_time_now_seconds(), bm, BM_edge_exists(), BM_ELEM_CD_GET_INT, bm_vert_hash_lookup_chain(), blender::bke::pbvh::EdgeQueueContext::cd_vert_node_offset, CLOG_DEBUG, BMVert::co, dyntopo_node_none, e, EDGE_QUEUE_DISABLE, blender::bke::pbvh::EdgeQueue::heap, len_squared_v3v3(), LOG, pbvh_bmesh_collapse_edge(), blender::bke::pbvh::EdgeQueueContext::pool, blender::bke::pbvh::EdgeQueueContext::queue, and v2.
Referenced by bmesh_update_topology().
|
static |
Definition at line 2086 of file pbvh_bmesh.cc.
References BLI_assert, BM_ELEM_CD_GET_INT, BM_ELEM_CD_SET_INT, BM_FACE_FIRST_LOOP, blender::bke::pbvh::FastNodeBuildInfo::child1, blender::bke::pbvh::FastNodeBuildInfo::child2, dyntopo_node_none, i, blender::bke::pbvh::Node::Leaf, BMLoop::next, pbvh_bmesh_create_nodes_fast_recursive(), blender::bke::pbvh::FastNodeBuildInfo::start, blender::bke::pbvh::FastNodeBuildInfo::totface, BMLoop::v, and v.
Referenced by blender::bke::pbvh::Tree::from_bmesh(), and pbvh_bmesh_create_nodes_fast_recursive().
Definition at line 643 of file pbvh_bmesh.cc.
References blender::bke::Array, BM_edge_face_count(), BM_edge_loop_pair(), BM_iter_as_array(), BM_LOOPS_OF_EDGE, blender::Array< T, InlineBufferCapacity, Allocator >::data(), e, LIKELY, and blender::Array< T, InlineBufferCapacity, Allocator >::size().
Referenced by pbvh_bmesh_split_edge().
|
static |
Definition at line 455 of file pbvh_bmesh.cc.
References Set< Key, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::add(), BLI_assert, bm, BM_CREATE_NOP, BM_ELEM_CD_SET_INT, BM_face_create(), BM_face_exists(), blender::bke::pbvh::BMeshNode::bm_faces_, BM_log_face_added(), blender::Span< T >::data(), blender::bke::pbvh::Node::flag_, BMFace::head, BMHeader::hflag, and blender::bke::pbvh::Node::TopologyUpdated.
Referenced by pbvh_bmesh_collapse_edge(), and pbvh_bmesh_split_edge().
|
static |
Definition at line 596 of file pbvh_bmesh.cc.
References BLI_assert, BM_ELEM_CD_SET_INT, BM_FACE_FIRST_LOOP, blender::bke::pbvh::BMeshNode::bm_faces_, BM_log_face_removed(), blender::bke::pbvh::BMeshNode::bm_other_verts_, blender::bke::pbvh::BMeshNode::bm_unique_verts_, BM_vert_face_count_is_equal, Set< Key, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::contains(), dyntopo_node_none, blender::bke::pbvh::Node::flag_, BMLoop::next, pbvh_bmesh_node_index_from_face(), pbvh_bmesh_node_vert_use_count_is_equal, pbvh_bmesh_vert_other_node_find(), pbvh_bmesh_vert_ownership_transfer(), Set< Key, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::remove(), blender::bke::pbvh::Node::TopologyUpdated, BMLoop::v, and v.
Referenced by pbvh_bmesh_collapse_edge(), and pbvh_bmesh_split_edge().
|
static |
Definition at line 656 of file pbvh_bmesh.cc.
References blender::bke::pbvh::BMeshNode::orig_positions_, blender::bke::pbvh::BMeshNode::orig_tris_, and blender::bke::pbvh::BMeshNode::orig_verts_.
Referenced by bmesh_update_topology().
|
static |
Update node data after splitting.
Definition at line 198 of file pbvh_bmesh.cc.
References Set< Key, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::add(), BKE_pbvh_node_fully_hidden_set(), BLI_assert, BM_ELEM_CD_GET_INT, BM_ELEM_CD_SET_INT, BM_elem_flag_test, BM_ELEM_HIDDEN, BM_FACE_FIRST_LOOP, blender::bke::pbvh::BMeshNode::bm_faces_, blender::bke::pbvh::BMeshNode::bm_other_verts_, blender::bke::pbvh::BMeshNode::bm_unique_verts_, blender::bke::pbvh::Node::bounds_, blender::bke::pbvh::Node::bounds_orig_, Set< Key, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::contains(), dyntopo_node_none, blender::math::min_max(), negative_bounds(), BMLoop::next, BMLoop::v, and v.
Referenced by pbvh_bmesh_node_split().
| BLI_INLINE BMeshNode * blender::bke::pbvh::pbvh_bmesh_node_from_face | ( | MutableSpan< BMeshNode > | nodes, |
| const int | cd_face_node_offset, | ||
| const BMFace * | key ) |
Definition at line 409 of file pbvh_bmesh.cc.
References BLI_INLINE, and pbvh_bmesh_node_index_from_face().
Referenced by pbvh_bmesh_collapse_edge(), and pbvh_bmesh_node_vert_use_count_at_most().
| BLI_INLINE BMeshNode * blender::bke::pbvh::pbvh_bmesh_node_from_vert | ( | MutableSpan< BMeshNode > | nodes, |
| const int | cd_vert_node_offset, | ||
| const BMVert * | key ) |
Definition at line 402 of file pbvh_bmesh.cc.
References BLI_INLINE, and pbvh_bmesh_node_index_from_vert().
Referenced by pbvh_bmesh_vert_remove().
| BLI_INLINE int blender::bke::pbvh::pbvh_bmesh_node_index_from_face | ( | const int | cd_face_node_offset, |
| const BMFace * | key ) |
Definition at line 394 of file pbvh_bmesh.cc.
References BLI_assert, BLI_INLINE, BM_ELEM_CD_GET_INT, and dyntopo_node_none.
Referenced by pbvh_bmesh_collapse_edge(), pbvh_bmesh_face_remove(), pbvh_bmesh_node_from_face(), pbvh_bmesh_vert_other_node_find(), and pbvh_bmesh_vert_remove().
| BLI_INLINE int blender::bke::pbvh::pbvh_bmesh_node_index_from_vert | ( | const int | cd_vert_node_offset, |
| const BMVert * | key ) |
Definition at line 386 of file pbvh_bmesh.cc.
References BLI_assert, BLI_INLINE, BM_ELEM_CD_GET_INT, and dyntopo_node_none.
Referenced by pbvh_bmesh_node_from_vert(), pbvh_bmesh_vert_other_node_find(), and pbvh_bmesh_vert_ownership_transfer().
|
static |
Recursively split the node if it exceeds the leaf_limit.
Definition at line 344 of file pbvh_bmesh.cc.
References bm, BM_elem_index_set, BM_FACE, BM_FACE_FIRST_LOOP, BMVert::co, i, leaf_limit, blender::math::min_max(), negative_bounds(), BMLoop::next, pbvh_bmesh_node_split(), and BMLoop::v.
|
static |
Recursively split the node if it exceeds the leaf_limit. This function is multi-thread-able since each invocation applies to a sub part of the arrays.
Definition at line 1981 of file pbvh_bmesh.cc.
References BLI_assert, BLI_memarena_alloc(), BM_elem_index_get, blender::bke::pbvh::FastNodeBuildInfo::child1, blender::bke::pbvh::FastNodeBuildInfo::child2, blender::math::dominant_axis(), i, leaf_limit, blender::Bounds< T >::max, max, blender::math::midpoint(), blender::Bounds< T >::min, min, blender::math::min_max(), negative_bounds(), pbvh_bmesh_node_limit_ensure_fast(), blender::bke::pbvh::FastNodeBuildInfo::start, and blender::bke::pbvh::FastNodeBuildInfo::totface.
Referenced by blender::bke::pbvh::Tree::from_bmesh(), and pbvh_bmesh_node_limit_ensure_fast().
|
static |
Recursively split the node if it exceeds the leaf_limit.
Definition at line 244 of file pbvh_bmesh.cc.
References blender::Set< Key, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::add(), Set< Key, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::add(), BM_ELEM_CD_SET_INT, BM_elem_index_get, blender::bke::pbvh::BMeshNode::bm_faces_, blender::math::dominant_axis(), dyntopo_node_none, blender::bke::pbvh::Node::flag_, i, Set< Key, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::is_empty(), blender::bke::pbvh::Node::Leaf, leaf_limit, blender::Bounds< T >::max, max, blender::bounds::merge(), blender::math::midpoint(), blender::Bounds< T >::min, min, blender::math::min_max(), negative_bounds(), blender::bke::pbvh::Node::parent_, pbvh_bmesh_node_finalize(), pbvh_bmesh_node_split(), Set< Key, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::reserve(), blender::Vector< T, InlineBufferCapacity, Allocator >::resize(), blender::Vector< T, InlineBufferCapacity, Allocator >::size(), and v.
Referenced by pbvh_bmesh_node_limit_ensure(), and pbvh_bmesh_node_split().
|
static |
Definition at line 489 of file pbvh_bmesh.cc.
References BM_FACES_OF_VERT_ITER_BEGIN, BM_FACES_OF_VERT_ITER_END, count, pbvh_bmesh_node_from_face(), and v.
|
static |
Definition at line 1114 of file pbvh_bmesh.cc.
References BLI_assert, bm, BM_CREATE_NO_DOUBLE, BM_edge_create(), BM_edge_kill(), bm_edges_from_tri(), BM_EDGES_OF_VERT, BM_ELEM_CD_GET_INT, BM_face_kill(), BM_ITER_ELEM, BM_vert_edge_count_is_over, blender::bke::pbvh::EdgeQueueContext::cd_face_node_offset, blender::bke::pbvh::EdgeQueueContext::cd_vert_mask_offset, blender::bke::pbvh::EdgeQueueContext::cd_vert_node_offset, copy_edge_data(), e, BMLoop::f, i, blender::Array< T, InlineBufferCapacity, Allocator >::index_range(), BMFace::len, long_edge_queue_edge_add(), long_edge_queue_face_add(), blender::math::midpoint(), BMLoop::next, blender::math::normalize(), pbvh_bmesh_edge_loops(), pbvh_bmesh_face_create(), pbvh_bmesh_face_remove(), pbvh_bmesh_vert_create(), pbvh_bmesh_vert_ownership_transfer(), BMLoop::prev, BMLoop::v, and v2.
Referenced by pbvh_bmesh_subdivide_long_edges().
|
static |
Definition at line 1232 of file pbvh_bmesh.cc.
References BLI_assert, BLI_heapsimple_is_empty(), BLI_heapsimple_pop_min(), BLI_mempool_free(), BLI_time_now_seconds(), bm, BM_edge_exists(), BM_ELEM_CD_GET_INT, blender::bke::pbvh::EdgeQueueContext::cd_vert_node_offset, CLOG_DEBUG, BMVert::co, dyntopo_node_none, e, EDGE_QUEUE_DISABLE, blender::bke::pbvh::EdgeQueue::heap, len_squared_v3v3(), blender::bke::pbvh::EdgeQueue::limit_len_squared, LOG, pbvh_bmesh_split_edge(), blender::bke::pbvh::EdgeQueueContext::pool, blender::bke::pbvh::EdgeQueueContext::queue, and v2.
Referenced by bmesh_update_topology().
|
static |
Definition at line 416 of file pbvh_bmesh.cc.
References Set< Key, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::add(), BLI_assert, bm, BM_CREATE_NOP, BM_data_interp_from_verts(), BM_ELEM_CD_SET_INT, BM_log_vert_added(), blender::bke::pbvh::BMeshNode::bm_unique_verts_, BM_vert_create(), copy_v3_v3(), blender::bke::pbvh::Node::flag_, blender::bke::pbvh::Node::TopologyUpdated, v, and v2.
Referenced by pbvh_bmesh_split_edge().
|
static |
Return a node that uses vertex v other than its current owner.
Definition at line 513 of file pbvh_bmesh.cc.
References BM_FACES_OF_VERT_ITER_BEGIN, BM_FACES_OF_VERT_ITER_END, pbvh_bmesh_node_index_from_face(), pbvh_bmesh_node_index_from_vert(), and v.
Referenced by pbvh_bmesh_face_remove().
|
static |
Definition at line 532 of file pbvh_bmesh.cc.
References Set< Key, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::add(), BLI_assert, BM_ELEM_CD_SET_INT, blender::bke::pbvh::BMeshNode::bm_other_verts_, blender::bke::pbvh::BMeshNode::bm_unique_verts_, Set< Key, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::contains(), blender::bke::pbvh::Node::flag_, pbvh_bmesh_node_index_from_vert(), Set< Key, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::remove(), blender::bke::pbvh::Node::TopologyUpdated, and v.
Referenced by pbvh_bmesh_face_remove(), and pbvh_bmesh_split_edge().
|
static |
Definition at line 560 of file pbvh_bmesh.cc.
References BLI_assert, BM_ELEM_CD_SET_INT, BM_FACES_OF_VERT_ITER_BEGIN, BM_FACES_OF_VERT_ITER_END, blender::bke::pbvh::BMeshNode::bm_other_verts_, blender::bke::pbvh::BMeshNode::bm_unique_verts_, Set< Key, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::contains(), dyntopo_node_none, blender::bke::pbvh::Node::flag_, pbvh_bmesh_node_from_vert(), pbvh_bmesh_node_index_from_face(), Set< Key, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::remove(), blender::bke::pbvh::Node::TopologyUpdated, and v.
Referenced by pbvh_bmesh_collapse_edge().
|
static |
Definition at line 2309 of file pbvh.cc.
References blender::bke::mesh::face_triangles_range(), blender::bke::pbvh::MeshNode::faces(), faces, i, blender::VectorSet< Key, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::index_of(), blender::Span< T >::index_range(), blender::Span< T >::is_empty(), pbvh_faces_node_nearest_to_ray(), ray_face_nearest_tri(), and blender::bke::pbvh::MeshNode::vert_indices_.
Referenced by find_nearest_to_ray_node(), and pbvh_faces_node_nearest_to_ray().
|
static |
Definition at line 2367 of file pbvh.cc.
References BKE_subdiv_ccg_key_top_level(), CCG_grid_xy_to_index(), SubdivCCG::grid_hidden, blender::bke::ccg::grid_range(), CCGKey::grid_size, blender::bke::pbvh::GridsNode::grids(), i, blender::Span< T >::index_range(), blender::bits::BitGroupVector< InlineBufferCapacity, Allocator >::is_empty(), blender::Span< T >::is_empty(), paint_is_grid_face_hidden(), pbvh_grids_node_nearest_to_ray(), SubdivCCG::positions, ray_face_nearest_quad(), blender::Span< T >::slice(), x, and y.
Referenced by find_nearest_to_ray_node(), and pbvh_grids_node_nearest_to_ray().
|
static |
Definition at line 706 of file pbvh.cc.
References first_node(), blender::bke::pbvh::PBVHIter::pbvh, blender::bke::pbvh::PBVHIter::scb, and blender::bke::pbvh::PBVHIter::stack.
Referenced by search_callback_occluded(), and search_gather().
|
static |
Definition at line 713 of file pbvh.cc.
References blender::bke::pbvh::Node::children_offset_, blender::bke::pbvh::Node::flag_, blender::bke::pbvh::StackItem::node, blender::bke::pbvh::Tree::nodes_, blender::bke::pbvh::PBVHIter::pbvh, blender::bke::pbvh::StackItem::revisiting, blender::bke::pbvh::PBVHIter::scb, and blender::bke::pbvh::PBVHIter::stack.
Referenced by search_gather().
Definition at line 758 of file pbvh.cc.
References blender::bke::pbvh::Node::children_offset_, blender::bke::pbvh::Node::flag_, blender::bke::pbvh::Node::Leaf, blender::bke::pbvh::StackItem::node, blender::bke::pbvh::Tree::nodes_, blender::bke::pbvh::PBVHIter::pbvh, blender::bke::pbvh::PBVHIter::scb, and blender::bke::pbvh::PBVHIter::stack.
Referenced by search_callback_occluded().
| void blender::bke::pbvh::pixels_free | ( | blender::bke::pbvh::Tree * | pbvh | ) |
Definition at line 502 of file pbvh_pixels.cc.
Referenced by blender::bke::pbvh::Tree::~Tree().
|
static |
Definition at line 1803 of file pbvh.cc.
References blender::bke::pbvh::Node::bounds_, blender::bke::pbvh::Node::bounds_orig_, isect_ray_aabb_v3(), blender::bke::pbvh::RaycastData::original, blender::bke::pbvh::RaycastData::ray, and blender::bke::pbvh::Node::tmin_.
| bool blender::bke::pbvh::ray_face_intersection_quad | ( | const float3 & | ray_start, |
| const IsectRayPrecalc * | isect_precalc, | ||
| const float3 & | t0, | ||
| const float3 & | t1, | ||
| const float3 & | t2, | ||
| const float3 & | t3, | ||
| float * | depth ) |
Definition at line 1826 of file pbvh.cc.
References isect_ray_tri_watertight_v3(), and ray_face_intersection_quad().
Referenced by node_raycast_grids(), and ray_face_intersection_quad().
| bool blender::bke::pbvh::ray_face_intersection_tri | ( | const float3 & | ray_start, |
| const IsectRayPrecalc * | isect_precalc, | ||
| const float3 & | t0, | ||
| const float3 & | t1, | ||
| const float3 & | t2, | ||
| float * | depth ) |
Definition at line 1848 of file pbvh.cc.
References isect_ray_tri_watertight_v3(), and ray_face_intersection_tri().
Referenced by node_raycast_bmesh(), node_raycast_mesh(), ray_face_intersection_tri(), and raycast_node_detail_bmesh().
| bool blender::bke::pbvh::ray_face_nearest_quad | ( | const float3 & | ray_start, |
| const float3 & | ray_normal, | ||
| const float3 & | t0, | ||
| const float3 & | t1, | ||
| const float3 & | t2, | ||
| const float3 & | t3, | ||
| float * | r_depth, | ||
| float * | dist_sq ) |
Definition at line 1892 of file pbvh.cc.
References dist_squared_ray_to_tri_v3_fast(), and ray_face_nearest_quad().
Referenced by pbvh_grids_node_nearest_to_ray(), and ray_face_nearest_quad().
| bool blender::bke::pbvh::ray_face_nearest_tri | ( | const float3 & | ray_start, |
| const float3 & | ray_normal, | ||
| const float3 & | t0, | ||
| const float3 & | t1, | ||
| const float3 & | t2, | ||
| float * | r_depth, | ||
| float * | dist_sq ) |
Definition at line 1922 of file pbvh.cc.
References dist_squared_ray_to_tri_v3_fast(), and ray_face_nearest_tri().
Referenced by bmesh_node_nearest_to_ray(), pbvh_faces_node_nearest_to_ray(), and ray_face_nearest_tri().
| void blender::bke::pbvh::raycast | ( | Tree & | pbvh, |
| const FunctionRef< void(Node &node, float *tmin)> | hit_fn, | ||
| const float3 & | ray_start, | ||
| const float3 & | ray_normal, | ||
| bool | original ) |
Definition at line 1811 of file pbvh.cc.
References isect_ray_aabb_v3_precalc(), blender::bke::pbvh::RaycastData::original, blender::bke::pbvh::RaycastData::ray, ray_aabb_intersect(), raycast(), and search_callback_occluded().
| bool blender::bke::pbvh::raycast_node_detail_bmesh | ( | const BMeshNode & | node, |
| const float3 & | ray_start, | ||
| const IsectRayPrecalc * | isect_precalc, | ||
| float * | depth, | ||
| float * | r_edge_length ) |
Definition at line 1873 of file pbvh_bmesh.cc.
References BLI_assert, BM_elem_flag_test, BM_ELEM_HIDDEN, BM_face_as_array_vert_tri(), blender::bke::pbvh::BMeshNode::bm_faces_, blender::bke::pbvh::Node::flag_, blender::bke::pbvh::Node::FullyHidden, BMFace::len, len_squared_v3v3(), max_fff(), ray_face_intersection_tri(), and sqrtf.
Referenced by blender::ed::sculpt_paint::dyntopo::sculpt_raycast_detail_cb().
|
static |
Definition at line 856 of file pbvh.cc.
References blender::bke::pbvh::NodeTree::data, blender::bke::pbvh::Node::flag_, FLT_MAX, free_tree(), blender::bke::pbvh::Node::Leaf, blender::bke::pbvh::NodeTree::left, node_tree_insert(), pbvh_iter_begin(), pbvh_iter_next_occluded(), blender::bke::pbvh::NodeTree::right, traverse_tree(), tree, and tree_is_empty().
Referenced by find_nearest_to_ray(), and raycast().
|
static |
Definition at line 2640 of file pbvh.cc.
References blender::bke::pbvh::Node::flag_, pbvh_iter_begin(), pbvh_iter_next(), search_gather(), and tree_is_empty().
Referenced by search_gather(), and search_nodes().
| IndexMask blender::bke::pbvh::search_nodes | ( | const Tree & | pbvh, |
| IndexMaskMemory & | memory, | ||
| FunctionRef< bool(const Node &)> | filter_fn ) |
Create a selection of nodes that match the filter function.
Definition at line 2663 of file pbvh.cc.
References IndexMask::from_indices(), i, indices, blender::bke::pbvh::Node::Leaf, search_gather(), and search_nodes().
Referenced by blender::ed::sculpt_paint::average_mask_border_position(), blender::ed::sculpt_paint::average_unmasked_position(), blender::ed::sculpt_paint::cloth::brush_affected_nodes_gather(), blender::ed::sculpt_paint::filter::cache_init(), blender::ed::sculpt_paint::brushes::clay_strips::calc_node_mask(), blender::ed::sculpt_paint::brushes::plane::calc_node_mask(), blender::ed::sculpt_paint::brushes::do_enhance_details_brush(), blender::ed::sculpt_paint::fake_neighbor_search(), blender::ed::sculpt_paint::gather_nodes(), blender::ed::sculpt_paint::nearest_vert_calc_bmesh(), blender::ed::sculpt_paint::nearest_vert_calc_grids(), blender::ed::sculpt_paint::nearest_vert_calc_mesh(), blender::ed::sculpt_paint::pbvh_gather_cursor_update(), blender::ed::sculpt_paint::pbvh_gather_generic(), blender::ed::sculpt_paint::vwpaint::pbvh_gather_generic(), blender::draw::sculpt_batches_get_ex(), search_nodes(), blender::ed::sculpt_paint::gesture::update_affected_nodes_by_clip_planes(), and blender::ed::sculpt_paint::gesture::update_affected_nodes_by_line_plane().
|
static |
Create a priority queue containing vertex pairs connected by a short edge as defined by Tree.bm_min_edge_len.
Only nodes marked for topology update are checked, and in those nodes only edges used by a face intersecting the (center, radius) sphere are checked.
The highest priority (lowest number) is given to the shortest edge.
Definition at line 1044 of file pbvh_bmesh.cc.
References BLI_assert_msg, BLI_heapsimple_new(), blender::bke::pbvh::EdgeQueue::center, blender::bke::pbvh::EdgeQueue::center_proj, edge_queue_tri_in_circle(), blender::bke::pbvh::EdgeQueue::edge_queue_tri_in_range, edge_queue_tri_in_sphere(), blender::bke::pbvh::Node::FullyHidden, blender::bke::pbvh::EdgeQueue::heap, blender::bke::pbvh::Node::Leaf, blender::bke::pbvh::EdgeQueue::limit_len, blender::bke::pbvh::EdgeQueue::limit_len_squared, project_plane_normalized_v3_v3v3(), blender::bke::pbvh::EdgeQueueContext::queue, blender::bke::pbvh::EdgeQueue::radius_squared, short_edge_queue_face_add(), blender::bke::pbvh::Node::UpdateTopology, blender::bke::pbvh::EdgeQueue::use_front_face, and blender::bke::pbvh::EdgeQueue::view_normal.
Referenced by bmesh_update_topology().
|
static |
Definition at line 928 of file pbvh_bmesh.cc.
References BM_edge_calc_length_squared(), e, edge_queue_insert(), EDGE_QUEUE_TEST, blender::bke::pbvh::EdgeQueue::limit_len_squared, blender::bke::pbvh::EdgeQueueContext::queue, and short_edge_queue_priority().
Referenced by short_edge_queue_face_add().
|
static |
Definition at line 959 of file pbvh_bmesh.cc.
References BM_FACE_FIRST_LOOP, dot_v3v3(), BMLoop::e, blender::bke::pbvh::EdgeQueue::edge_queue_tri_in_range, BMLoop::next, BMFace::no, blender::bke::pbvh::EdgeQueueContext::queue, short_edge_queue_edge_add(), blender::bke::pbvh::EdgeQueue::use_front_face, and blender::bke::pbvh::EdgeQueue::view_normal.
Referenced by short_edge_queue_create().
Definition at line 854 of file pbvh_bmesh.cc.
References BM_edge_calc_length_squared(), is_boundary_edge(), and is_edge_adjacent_to_boundary().
Referenced by short_edge_queue_edge_add().
| void blender::bke::pbvh::store_bounds_orig | ( | Tree & | pbvh | ) |
Copy all current node bounds to the original bounds. "Original" bounds are typically from before a brush stroke started (while the "regular" bounds update on every change of positions). These are stored to optimize the BVH traversal for original coordinates enabled by various "use original" arguments in the Tree API.
Definition at line 1408 of file pbvh.cc.
References blender::threading::parallel_for().
Referenced by BKE_pbvh_vert_coords_apply(), blender::ed::sculpt_paint::flush_update_done(), blender::bke::pbvh::Tree::from_bmesh(), blender::bke::pbvh::Tree::from_mesh(), and blender::ed::sculpt_paint::undo::restore_list().
|
static |
Definition at line 2490 of file pbvh.cc.
References dot_v3v3(), i, blender::Span< T >::index_range(), Inside, Intersect, Outside, ret, and test_frustum_aabb().
Referenced by node_frustum_contain_aabb(), node_frustum_exclude_aabb(), and test_frustum_aabb().
|
static |
Definition at line 817 of file pbvh.cc.
References traverse_tree(), and tree.
Referenced by search_callback_occluded(), and traverse_tree().
|
static |
Definition at line 683 of file pbvh.cc.
Referenced by clip_ray_ortho(), first_node(), search_callback_occluded(), and search_gather().
|
static |
If the del_face is a flap, merge edge data from edges adjacent to "corner" vertex into the other edge. The "corner" as it is an "outer", or a vertex which will become loose when the del_face and its edges are removed.
If the face is not a flap then this function does nothing.
Definition at line 1418 of file pbvh_bmesh.cc.
References BLI_assert, bm, BM_edge_face_count(), BM_vert_find_first_loop(), BMLoop::e, find_outer_flap_vert(), merge_edge_data(), BMLoop::next, BMLoop::prev, and BMLoop::v.
Referenced by pbvh_bmesh_collapse_edge().
| void blender::bke::pbvh::update_mask_bmesh | ( | const BMesh & | bm, |
| const IndexMask & | node_mask, | ||
| Tree & | pbvh ) |
Definition at line 1496 of file pbvh.cc.
References bm, CD_PROP_FLOAT, CustomData_get_offset_named(), blender::index_mask::IndexMask::foreach_index(), blender::bke::pbvh::Node::FullyUnmasked, i, node_update_mask_bmesh(), and update_mask_bmesh().
Referenced by blender::ed::sculpt_paint::undo::bmesh_restore_generic(), blender::ed::sculpt_paint::brushes::do_smooth_mask_brush(), update_mask_bmesh(), and blender::ed::sculpt_paint::expand::write_mask_data().
| void blender::bke::pbvh::update_mask_grids | ( | const SubdivCCG & | subdiv_ccg, |
| const IndexMask & | node_mask, | ||
| Tree & | pbvh ) |
Definition at line 1463 of file pbvh.cc.
References BKE_subdiv_ccg_key_top_level(), blender::index_mask::IndexMask::foreach_index(), blender::bke::pbvh::Node::FullyUnmasked, i, Array< T, InlineBufferCapacity, Allocator >::is_empty(), SubdivCCG::masks, node_update_mask_grids(), and update_mask_grids().
Referenced by blender::ed::sculpt_paint::brushes::do_smooth_mask_brush(), blender::ed::sculpt_paint::undo::restore_list(), update_mask_grids(), and blender::ed::sculpt_paint::expand::write_mask_data().
| void blender::bke::pbvh::update_mask_mesh | ( | const Mesh & | mesh, |
| const IndexMask & | node_mask, | ||
| Tree & | pbvh ) |
Update node "fully masked" and "fully unmasked" values after mask values have been changed.
Definition at line 1432 of file pbvh.cc.
References blender::index_mask::IndexMask::foreach_index(), blender::bke::pbvh::Node::FullyUnmasked, i, mask(), node_update_mask_mesh(), blender::bke::Point, and update_mask_mesh().
Referenced by blender::ed::sculpt_paint::undo::restore_list(), update_mask_mesh(), and blender::ed::sculpt_paint::expand::write_mask_data().
| void blender::bke::pbvh::update_node_bounds_bmesh | ( | BMeshNode & | node | ) |
Definition at line 1294 of file pbvh.cc.
References blender::bke::pbvh::BMeshNode::bm_other_verts_, blender::bke::pbvh::BMeshNode::bm_unique_verts_, blender::bke::pbvh::Node::bounds_, BMVert::co, blender::math::min_max(), and negative_bounds().
Referenced by blender::ed::sculpt_paint::boundary::do_bend_brush(), blender::ed::sculpt_paint::brushes::do_bmesh_topology_rake_brush(), blender::ed::sculpt_paint::brushes::do_clay_brush(), blender::ed::sculpt_paint::brushes::do_clay_strips_brush(), blender::ed::sculpt_paint::brushes::do_clay_thumb_brush(), blender::ed::sculpt_paint::brushes::do_draw_vector_displacement_brush(), blender::ed::sculpt_paint::brushes::do_elastic_deform_brush(), blender::ed::sculpt_paint::brushes::do_enhance_details_brush(), blender::ed::sculpt_paint::boundary::do_grab_brush(), blender::ed::sculpt_paint::brushes::do_grab_brush(), blender::ed::sculpt_paint::boundary::do_inflate_brush(), blender::ed::sculpt_paint::brushes::do_inflate_brush(), blender::ed::sculpt_paint::brushes::do_layer_brush(), blender::ed::sculpt_paint::brushes::do_multiplane_scrape_brush(), blender::ed::sculpt_paint::brushes::do_pinch_brush(), blender::ed::sculpt_paint::brushes::do_plane_brush(), blender::ed::sculpt_paint::pose::do_pose_brush(), blender::ed::sculpt_paint::brushes::do_rotate_brush(), blender::ed::sculpt_paint::cloth::do_simulation_step(), blender::ed::sculpt_paint::boundary::do_slide_brush(), blender::ed::sculpt_paint::boundary::do_smooth_brush(), blender::ed::sculpt_paint::brushes::do_snake_hook_brush(), blender::ed::sculpt_paint::brushes::do_thumb_brush(), blender::ed::sculpt_paint::brushes::do_topology_slide_brush(), blender::ed::sculpt_paint::boundary::do_twist_brush(), blender::ed::sculpt_paint::project::gesture_apply_for_symmetry_pass(), blender::ed::sculpt_paint::brushes::offset_positions(), blender::ed::sculpt_paint::cloth::sculpt_cloth_filter_modal(), blender::ed::sculpt_paint::sculpt_transform_all_vertices(), blender::ed::sculpt_paint::transform_radius_elastic(), and blender::bke::pbvh::Tree::update_bounds_bmesh().
| void blender::bke::pbvh::update_node_bounds_grids | ( | int | grid_area, |
| Span< float3 > | positions, | ||
| GridsNode & | node ) |
Definition at line 1283 of file pbvh.cc.
References blender::bke::pbvh::Node::bounds_, blender::bke::ccg::grid_range(), blender::bke::pbvh::GridsNode::grids(), blender::math::min_max(), negative_bounds(), and blender::Span< T >::slice().
Referenced by blender::ed::sculpt_paint::boundary::do_bend_brush(), blender::ed::sculpt_paint::brushes::do_clay_brush(), blender::ed::sculpt_paint::brushes::do_clay_strips_brush(), blender::ed::sculpt_paint::brushes::do_clay_thumb_brush(), blender::ed::sculpt_paint::brushes::do_displacement_eraser_brush(), blender::ed::sculpt_paint::brushes::do_displacement_smear_brush(), blender::ed::sculpt_paint::brushes::do_draw_vector_displacement_brush(), blender::ed::sculpt_paint::brushes::do_elastic_deform_brush(), blender::ed::sculpt_paint::brushes::do_enhance_details_brush(), blender::ed::sculpt_paint::boundary::do_grab_brush(), blender::ed::sculpt_paint::brushes::do_grab_brush(), blender::ed::sculpt_paint::boundary::do_inflate_brush(), blender::ed::sculpt_paint::brushes::do_inflate_brush(), blender::ed::sculpt_paint::brushes::do_layer_brush(), blender::ed::sculpt_paint::brushes::do_multiplane_scrape_brush(), blender::ed::sculpt_paint::brushes::do_pinch_brush(), blender::ed::sculpt_paint::brushes::do_plane_brush(), blender::ed::sculpt_paint::pose::do_pose_brush(), blender::ed::sculpt_paint::brushes::do_rotate_brush(), blender::ed::sculpt_paint::cloth::do_simulation_step(), blender::ed::sculpt_paint::boundary::do_slide_brush(), blender::ed::sculpt_paint::boundary::do_smooth_brush(), blender::ed::sculpt_paint::brushes::do_snake_hook_brush(), blender::ed::sculpt_paint::brushes::do_thumb_brush(), blender::ed::sculpt_paint::brushes::do_topology_slide_brush(), blender::ed::sculpt_paint::boundary::do_twist_brush(), blender::ed::sculpt_paint::project::gesture_apply_for_symmetry_pass(), blender::ed::sculpt_paint::brushes::offset_positions(), blender::ed::sculpt_paint::cloth::sculpt_cloth_filter_modal(), blender::ed::sculpt_paint::sculpt_transform_all_vertices(), blender::ed::sculpt_paint::transform_radius_elastic(), and blender::bke::pbvh::Tree::update_bounds_grids().
Definition at line 1274 of file pbvh.cc.
References blender::bke::pbvh::MeshNode::all_verts(), blender::bke::pbvh::Node::bounds_, blender::math::min_max(), and negative_bounds().
Referenced by blender::ed::sculpt_paint::boundary::do_bend_brush(), blender::ed::sculpt_paint::brushes::do_clay_brush(), blender::ed::sculpt_paint::brushes::do_clay_strips_brush(), blender::ed::sculpt_paint::brushes::do_clay_thumb_brush(), blender::ed::sculpt_paint::brushes::do_draw_vector_displacement_brush(), blender::ed::sculpt_paint::brushes::do_elastic_deform_brush(), blender::ed::sculpt_paint::brushes::do_enhance_details_brush(), blender::ed::sculpt_paint::boundary::do_grab_brush(), blender::ed::sculpt_paint::brushes::do_grab_brush(), blender::ed::sculpt_paint::boundary::do_inflate_brush(), blender::ed::sculpt_paint::brushes::do_inflate_brush(), blender::ed::sculpt_paint::brushes::do_layer_brush(), blender::ed::sculpt_paint::brushes::do_multiplane_scrape_brush(), blender::ed::sculpt_paint::brushes::do_pinch_brush(), blender::ed::sculpt_paint::brushes::do_plane_brush(), blender::ed::sculpt_paint::pose::do_pose_brush(), blender::ed::sculpt_paint::brushes::do_rotate_brush(), blender::ed::sculpt_paint::cloth::do_simulation_step(), blender::ed::sculpt_paint::boundary::do_slide_brush(), blender::ed::sculpt_paint::boundary::do_smooth_brush(), blender::ed::sculpt_paint::brushes::do_snake_hook_brush(), blender::ed::sculpt_paint::brushes::do_thumb_brush(), blender::ed::sculpt_paint::brushes::do_topology_slide_brush(), blender::ed::sculpt_paint::boundary::do_twist_brush(), blender::ed::sculpt_paint::project::gesture_apply_for_symmetry_pass(), blender::ed::sculpt_paint::brushes::offset_positions(), blender::ed::sculpt_paint::cloth::sculpt_cloth_filter_modal(), blender::ed::sculpt_paint::sculpt_transform_all_vertices(), blender::ed::sculpt_paint::transform_radius_elastic(), and blender::bke::pbvh::Tree::update_bounds_mesh().
| void blender::bke::pbvh::update_normals | ( | const Depsgraph & | depsgraph, |
| Object & | object_orig, | ||
| Tree & | pbvh ) |
Definition at line 1257 of file pbvh.cc.
References BLI_assert, DEG_get_evaluated(), DEG_is_original(), and depsgraph.
Referenced by blender::ed::sculpt_paint::filter::calc_relax_face_sets_filter(), blender::ed::sculpt_paint::filter::calc_relax_filter(), blender::ed::sculpt_paint::cancel_modal_transform(), blender::ed::sculpt_paint::cursor_geometry_info_update(), blender::ed::sculpt_paint::do_brush_action(), blender::ed::geometry::get_original_geometry_eval_copy(), blender::ed::sculpt_paint::undo::restore_from_undo_step(), blender::ed::sculpt_paint::filter::sculpt_mesh_filter_cancel(), and sculpt_update_object().
Update geometry normals (potentially on the original object geometry).
Definition at line 1264 of file pbvh.cc.
References DEG_get_original().
Referenced by BKE_sculpt_update_object_before_eval(), blender::draw::DRW_mesh_batch_cache_create_requested(), and blender::draw::sculpt_batches_get_ex().
|
static |
Definition at line 1152 of file pbvh.cc.
References blender::VectorSet< Key, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::add_multiple(), blender::VectorSet< Key, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::as_span(), calc_boundary_face_normals(), calc_boundary_vert_normals(), calc_node_face_normals(), calc_node_vert_normals(), blender::SharedCache< T >::data(), Object::data, Span< T >::drop_front(), blender::SharedCache< T >::ensure(), face_normals_cache_eval_for_write(), faces, blender::index_mask::IndexMask::foreach_index(), i, blender::SharedCache< T >::is_dirty(), blender::bke::mesh::normals_calc_faces(), blender::bke::mesh::normals_calc_verts(), blender::threading::parallel_invoke(), blender::VectorSet< Key, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::reserve(), blender::Vector< T, InlineBufferCapacity, Allocator >::resize(), blender::Span< T >::size(), blender::VectorSet< Key, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::size(), blender::Span< T >::slice(), blender::bke::pbvh::MeshNode::unique_verts_num_, blender::SharedCache< T >::update(), blender::bke::pbvh::MeshNode::vert_indices_, vert_normals_cache_eval_for_write(), and vert_positions_eval_from_eval().
Referenced by blender::bke::pbvh::Tree::update_normals().
|
static |
Definition at line 1573 of file pbvh.cc.
References blender::index_mask::IndexMask::foreach_index(), i, node_update_visibility_bmesh(), and update_visibility_bmesh().
Referenced by blender::bke::pbvh::Tree::update_visibility(), and update_visibility_bmesh().
|
static |
Definition at line 1521 of file pbvh.cc.
References blender::index_mask::IndexMask::foreach_index(), i, blender::Span< T >::is_empty(), blender::bke::AttributeAccessor::lookup(), node_update_visibility_mesh(), blender::bke::Point, and update_visibility_faces().
Referenced by blender::bke::pbvh::Tree::update_visibility(), and update_visibility_faces().
|
static |
Definition at line 1546 of file pbvh.cc.
References blender::index_mask::IndexMask::foreach_index(), SubdivCCG::grid_hidden, i, blender::bits::BitGroupVector< InlineBufferCapacity, Allocator >::is_empty(), node_update_visibility_grids(), and update_visibility_grids().
Referenced by blender::bke::pbvh::Tree::update_visibility(), and update_visibility_grids().
Check whether the vert is adjacent to any face which are adjacent to the #edge.
Definition at line 1287 of file pbvh_bmesh.cc.
References BM_FACES_OF_EDGE, BM_ITER_ELEM, and BM_vert_in_face().
Referenced by merge_flap_edge_data().
|
static |
Definition at line 945 of file pbvh.cc.
References BLI_assert, BLI_assert_unreachable, cache_source_get(), Object::data, Eval, EvalDeform, Mesh, Orig, blender::bke::object::pbvh_get(), result, Mesh::runtime, RuntimeDeform, Object::sculpt, and SculptSession::vert_normals_deform.
Referenced by vert_normals_cache_eval_for_write(), vert_normals_eval(), and vert_normals_eval_from_eval().
|
static |
Definition at line 966 of file pbvh.cc.
References vert_normals_cache_eval().
Referenced by update_normals_mesh().
| Span< float3 > blender::bke::pbvh::vert_normals_eval | ( | const Depsgraph & | depsgraph, |
| const Object & | object_orig ) |
Return the vertex normals corresponding the positions from vert_positions_eval. This may be a reference to the normals cache on the original mesh.
Definition at line 1059 of file pbvh.cc.
References DEG_get_evaluated(), depsgraph, and vert_normals_cache_eval().
Referenced by blender::ed::sculpt_paint::calc_area_center(), blender::ed::sculpt_paint::calc_area_normal(), blender::ed::sculpt_paint::calc_area_normal_and_center(), blender::ed::sculpt_paint::auto_mask::calc_blurred_cavity_mesh(), blender::ed::sculpt_paint::auto_mask::calc_face_factors(), blender::ed::sculpt_paint::filter::calc_relax_face_sets_filter(), blender::ed::sculpt_paint::filter::calc_relax_filter(), blender::ed::sculpt_paint::auto_mask::calc_vert_factors(), calculate_average_weight(), blender::ed::sculpt_paint::cloth::cloth_brush_apply_brush_forces(), blender::ed::sculpt_paint::cloth::copy_normals_to_array(), blender::ed::sculpt_paint::brushes::do_clay_brush(), blender::ed::sculpt_paint::brushes::do_clay_strips_brush(), blender::ed::sculpt_paint::brushes::do_clay_thumb_brush(), blender::ed::sculpt_paint::brushes::do_draw_vector_displacement_brush(), blender::ed::sculpt_paint::brushes::do_enhance_details_brush(), blender::ed::sculpt_paint::brushes::do_inflate_brush(), blender::ed::sculpt_paint::brushes::do_layer_brush(), blender::ed::sculpt_paint::brushes::do_mask_brush(), blender::ed::sculpt_paint::brushes::do_multiplane_scrape_brush(), blender::ed::sculpt_paint::color::do_paint_brush(), blender::ed::sculpt_paint::brushes::do_pinch_brush(), blender::ed::sculpt_paint::brushes::do_plane_brush(), blender::ed::sculpt_paint::color::do_smear_brush(), blender::ed::sculpt_paint::brushes::do_snake_hook_brush(), do_vpaint_brush_blur_loops(), do_vpaint_brush_blur_verts(), do_vpaint_brush_smear(), do_wpaint_brush_blur(), do_wpaint_brush_draw(), do_wpaint_brush_smear(), blender::ed::sculpt_paint::mask::gesture_apply_for_symmetry_pass(), blender::ed::sculpt_paint::project::gesture_apply_for_symmetry_pass(), blender::ed::sculpt_paint::boundary::init_boundary_mesh(), blender::ed::sculpt_paint::auto_mask::normal_occlusion_automasking_fill(), blender::ed::sculpt_paint::expand::normals_falloff_create(), blender::ed::sculpt_paint::brushes::offset_positions(), blender::ed::sculpt_paint::hide::partialvis_gesture_update_mesh(), blender::ed::sculpt_paint::brushes::sample_surface(), blender::ed::sculpt_paint::cloth::sculpt_cloth_filter_modal(), blender::ed::sculpt_paint::set_persistent_base_exec(), blender::ed::sculpt_paint::undo::store_positions_mesh(), and vpaint_do_draw().
Definition at line 1065 of file pbvh.cc.
References BLI_assert, DEG_get_original(), DEG_is_original(), and vert_normals_cache_eval().
Referenced by blender::draw::pbvh::update_normals_mesh().
| Span< float3 > blender::bke::pbvh::vert_positions_eval | ( | const Depsgraph & | depsgraph, |
| const Object & | object_orig ) |
Retrieve the positions array from the evaluated mesh after deforming modifiers and before topology-changing operations. If there are no deform modifiers, this returns the original mesh's vertex positions.
Definition at line 1040 of file pbvh.cc.
References DEG_get_evaluated(), depsgraph, and vert_positions_eval().
Referenced by SculptSession::active_vert_position(), blender::ed::sculpt_paint::average_mask_border_position(), blender::ed::sculpt_paint::average_unmasked_position(), blender::ed::sculpt_paint::calc_area_center(), blender::ed::sculpt_paint::calc_area_normal(), blender::ed::sculpt_paint::calc_area_normal_and_center(), blender::ed::sculpt_paint::pose::calc_average_face_set_center(), blender::ed::sculpt_paint::auto_mask::calc_blurred_cavity_mesh(), blender::ed::sculpt_paint::auto_mask::calc_face_factors(), blender::ed::sculpt_paint::pose::calc_pose_origin_and_factor_mesh(), blender::ed::sculpt_paint::calc_smooth_translations(), blender::ed::sculpt_paint::auto_mask::calc_vert_factors(), calculate_average_color(), calculate_average_weight(), blender::ed::sculpt_paint::trim::calculate_depth(), blender::ed::sculpt_paint::cloth::cloth_brush_apply_brush_forces(), blender::ed::sculpt_paint::cloth::copy_positions_to_array(), blender::ed::sculpt_paint::cursor_geometry_info_update(), blender::ed::sculpt_paint::boundary::data_init_mesh(), blender::ed::sculpt_paint::brushes::do_mask_brush(), blender::ed::sculpt_paint::color::do_paint_brush(), blender::ed::sculpt_paint::paint::image::do_paint_pixels(), blender::ed::sculpt_paint::color::do_smear_brush(), do_vpaint_brush_blur_loops(), do_vpaint_brush_blur_verts(), do_vpaint_brush_smear(), do_wpaint_brush_blur(), do_wpaint_brush_draw(), do_wpaint_brush_smear(), blender::ed::sculpt_paint::expand::enabled_state_to_bitmap(), blender::ed::sculpt_paint::fake_neighbor_search(), blender::ed::sculpt_paint::auto_mask::fill_topology_automasking_factors(), blender::ed::sculpt_paint::find_symm_verts_mesh(), blender::ed::sculpt_paint::expand::geodesic_falloff_create(), blender::ed::sculpt_paint::geometry_preview_lines_update(), blender::ed::sculpt_paint::mask::gesture_apply_for_symmetry_pass(), blender::ed::sculpt_paint::face_set::gesture_apply_mesh(), blender::ed::sculpt_paint::pose::grow_pose_factor(), blender::ed::sculpt_paint::pose::ik_chain_init_face_sets_mesh(), blender::ed::sculpt_paint::pose::ik_chain_init_topology(), blender::ed::sculpt_paint::auto_mask::init_boundary_masking_mesh(), blender::ed::sculpt_paint::boundary::init_boundary_mesh(), blender::ed::sculpt_paint::auto_mask::normal_occlusion_automasking_fill(), blender::ed::sculpt_paint::paint_cursor_draw_3d_view_brush_cursor_inactive(), blender::ed::sculpt_paint::hide::partialvis_gesture_update_mesh(), blender::ed::sculpt_paint::PositionDeformData::PositionDeformData(), blender::ed::sculpt_paint::expand::reposition_pivot(), blender::ed::sculpt_paint::dyntopo::sample_detail_voxel(), blender::ed::sculpt_paint::brushes::sample_surface(), blender::ed::sculpt_paint::cloth::sculpt_cloth_filter_modal(), blender::ed::sculpt_paint::expand::spherical_falloff_create(), blender::ed::sculpt_paint::undo::store_positions_mesh(), blender::ed::sculpt_paint::stroke_get_location_bvh_ex(), blender::bke::pbvh::Tree::update_bounds(), blender::ed::sculpt_paint::expand::update_for_vert(), blender::bke::pbvh::pixels::update_pixels(), vert_positions_eval(), vert_positions_eval_from_eval(), blender::ed::sculpt_paint::vert_positions_for_grab_active_get(), blender::ed::sculpt_paint::vertex_is_occluded(), and vpaint_do_draw().
|
static |
Definition at line 1000 of file pbvh.cc.
References BLI_assert, BLI_assert_unreachable, cache_source_get(), Object::data, SculptSession::deform_cos, Eval, EvalDeform, Mesh, Orig, blender::bke::object::pbvh_get(), result, RuntimeDeform, and Object::sculpt.
| MutableSpan< float3 > blender::bke::pbvh::vert_positions_eval_for_write | ( | const Depsgraph & | depsgraph, |
| Object & | object_orig ) |
Retrieve write access to the evaluated deform positions, or the original object positions if there are no deformation modifiers. Writing the evaluated positions is necessary because they are used for drawing and we don't run a full dependency graph update whenever they are changed.
Definition at line 1053 of file pbvh.cc.
References DEG_get_evaluated(), depsgraph, and vert_positions_eval_for_write().
Referenced by blender::ed::sculpt_paint::PositionDeformData::PositionDeformData(), blender::ed::sculpt_paint::undo::restore_position_from_undo_step(), and vert_positions_eval_for_write().
|
static |
Definition at line 1020 of file pbvh.cc.
References BLI_assert, BLI_assert_unreachable, cache_source_get(), Object::data, SculptSession::deform_cos, Eval, EvalDeform, Mesh, Orig, blender::bke::object::pbvh_get(), result, RuntimeDeform, and Object::sculpt.
Definition at line 1046 of file pbvh.cc.
References BLI_assert, DEG_get_original(), DEG_is_original(), and vert_positions_eval().
Referenced by update_normals_mesh(), and blender::draw::pbvh::update_positions_mesh().
|
staticconstexpr |
Definition at line 51 of file pbvh_bmesh.cc.
Referenced by blender::bke::pbvh::Tree::from_bmesh(), pbvh_bmesh_collapse_short_edges(), pbvh_bmesh_create_nodes_fast_recursive(), pbvh_bmesh_face_remove(), pbvh_bmesh_node_finalize(), pbvh_bmesh_node_index_from_face(), pbvh_bmesh_node_index_from_vert(), pbvh_bmesh_node_split(), pbvh_bmesh_subdivide_long_edges(), and pbvh_bmesh_vert_remove().
|
constexpr |
Ensure we don't have dirty tags for the edge queue, and that they are left cleared. (slow, even for debug mode, so leave disabled for now).
Definition at line 49 of file pbvh_bmesh.cc.
Referenced by build_nodes_recursive_grids(), build_nodes_recursive_mesh(), blender::bke::pbvh::Tree::from_grids(), blender::bke::pbvh::Tree::from_mesh(), pbvh_bmesh_node_limit_ensure(), pbvh_bmesh_node_limit_ensure_fast(), and pbvh_bmesh_node_split().